diff --git a/appveyor.yml b/.appveyor.yml similarity index 86% rename from appveyor.yml rename to .appveyor.yml index 2d88bed44f8d1..80f8e38f0b02f 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -5,16 +5,17 @@ skip_tags: true environment: matrix: - FEATURE: HUGE - - FEATURE: NORMAL # disabled # - FEATURE: TINY # - FEATURE: SMALL +# - FEATURE: NORMAL # - FEATURE: BIG matrix: fast_finish: true before_build: + # Use Windows SDK 7.1 (= MSVC 2010) - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release' - 'set INCLUDE=%INCLUDE%C:\Program Files (x86)\Windows Kits\8.1\Include\um' @@ -27,7 +28,7 @@ test_script: - path C:\Python35-x64;%PATH% - nmake -f Make_dos.mak VIMPROG=..\gvim - nmake -f Make_dos.mak clean - # Testing with MingW console version + # Testing with MSVC console version - nmake -f Make_dos.mak VIMPROG=..\vim # vim: sw=2 sts=2 et ts=8 sr diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000000000..9512ca3d4654c --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,28 @@ +env: + CIRRUS_CLONE_DEPTH: 3 + FEATURES: huge + +freebsd_task: + name: FreeBSD + matrix: + - name: FreeBSD 13.1 + freebsd_instance: + image_family: freebsd-13-1 + - name: FreeBSD 12.3 + freebsd_instance: + image_family: freebsd-12-3 + only_if: $CIRRUS_TAG == '' + timeout_in: 20m + install_script: + - pkg update -f + - pkg install -y gettext + build_script: + - NPROC=$(getconf _NPROCESSORS_ONLN) + - ./configure --with-features=${FEATURES} + - make -j${NPROC} + test_script: + - src/vim --version + # run tests as user "cirrus" instead of root + - pw useradd cirrus -m + - chown -R cirrus:cirrus . + - sudo -u cirrus make test diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000000..8ce62c5813b29 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,12 @@ +coverage: + range: "80...100" + status: + project: + default: + threshold: 0.05% + +# Files not run by tests +ignore: + - "src/dosinst.c" + - "src/dosinst.h" + - "src/uninstall.c" diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000000000..1157ff2567837 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +service_name: github-actions diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000000..f5a45c4d9534d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,433 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. +# You can use github users with @user or email addresses + +# These owners will be the default owners for everything in the repo. +#* @brammool + +# Order is important. The last matching pattern has the most precedence. +# So if a pull request only touches javascript files, only these owners +# will be requested to review. + +runtime/autoload/freebasic.vim @dkearns +runtime/autoload/getscript.vim @cecamp +runtime/autoload/haskell.vim @alx741 +runtime/autoload/javascript.vim @jsit +runtime/autoload/netrw.vim @cecamp +runtime/autoload/netrwFileHandlers.vim @cecamp +runtime/autoload/netrwSettings.vim @cecamp +runtime/autoload/php.vim @david-szabo97 +runtime/autoload/rubycomplete.vim @segfault @dkearns +runtime/autoload/tar.vim @cecamp +runtime/autoload/vimball.vim @cecamp +runtime/autoload/xmlformat.vim @chrisbra +runtime/autoload/zip.vim @cecamp +runtime/colors/blue.vim @habamax @romainl @neutaaaaan +runtime/colors/darkblue.vim @habamax @romainl @neutaaaaan +runtime/colors/default.vim @habamax @romainl @neutaaaaan +runtime/colors/delek.vim @habamax @romainl @neutaaaaan +runtime/colors/desert.vim @habamax @romainl @neutaaaaan +runtime/colors/elflord.vim @habamax @romainl @neutaaaaan +runtime/colors/evening.vim @habamax @romainl @neutaaaaan +runtime/colors/industry.vim @habamax @romainl @neutaaaaan +runtime/colors/koehler.vim @habamax @romainl @neutaaaaan +runtime/colors/morning.vim @habamax @romainl @neutaaaaan +runtime/colors/murphy.vim @habamax @romainl @neutaaaaan +runtime/colors/pablo.vim @habamax @romainl @neutaaaaan +runtime/colors/peachpuff.vim @habamax @romainl @neutaaaaan +runtime/colors/ron.vim @habamax @romainl @neutaaaaan +runtime/colors/shine.vim @habamax @romainl @neutaaaaan +runtime/colors/slate.vim @habamax @romainl @neutaaaaan +runtime/colors/tools @habamax @romainl @neutaaaaan +runtime/colors/torte.vim @habamax @romainl @neutaaaaan +runtime/colors/zellner.vim @habamax @romainl @neutaaaaan +runtime/compiler/checkstyle.vim @dkearns +runtime/compiler/cm3.vim @dkearns +runtime/compiler/cucumber.vim @tpope +runtime/compiler/dart.vim @dkearns +runtime/compiler/dart2js.vim @dkearns +runtime/compiler/dart2native.vim @dkearns +runtime/compiler/dartanalyser.vim @dkearns +runtime/compiler/dartdevc.vim @dkearns +runtime/compiler/dartdoc.vim @dkearns +runtime/compiler/dartfmt.vim @dkearns +runtime/compiler/eruby.vim @dkearns +runtime/compiler/fbc.vim @dkearns +runtime/compiler/gawk.vim @dkearns +runtime/compiler/gjs.vim @dkearns +runtime/compiler/go.vim @dbarnett +runtime/compiler/haml.vim @tpope +runtime/compiler/icon.vim @dkearns +runtime/compiler/javac.vim @dkearns +runtime/compiler/jest.vim @dkearns +runtime/compiler/jjs.vim @dkearns +runtime/compiler/jshint.vim @dkearns +runtime/compiler/jsonlint.vim @dkearns +runtime/compiler/lazbuild.vim @dkearns +runtime/compiler/perl.vim @petdance @heptite +runtime/compiler/perlcritic.vim @petdance @dkearns +runtime/compiler/php.vim @dkearns +runtime/compiler/podchecker.vim @petdance @dkearns +runtime/compiler/powershell.vim @heaths +runtime/compiler/rake.vim @tpope @dkearns +runtime/compiler/rhino.vim @dkearns +runtime/compiler/rspec.vim @tpope @dkearns +runtime/compiler/rubocop.vim @dkearns +runtime/compiler/ruby.vim @tpope @dkearns +runtime/compiler/rubyunit.vim @dkearns +runtime/compiler/sass.vim @tpope +runtime/compiler/sdoc.vim @gpanders +runtime/compiler/se.vim @dkearns +runtime/compiler/shellcheck.vim @dkearns +runtime/compiler/sml.vim @dkearns +runtime/compiler/spectral.vim @romainl +runtime/compiler/stylelint.vim @dkearns +runtime/compiler/tcl.vim @dkearns +runtime/compiler/tidy.vim @dkearns +runtime/compiler/ts-node.vim @dkearns +runtime/compiler/tsc.vim @dkearns +runtime/compiler/typedoc.vim @dkearns +runtime/compiler/xmllint.vim @dkearns +runtime/compiler/xo.vim @dkearns +runtime/compiler/yamllint.vim @romainl +runtime/compiler/zsh.vim @dkearns +runtime/doc/pi_getscript.txt @cecamp +runtime/doc/pi_logipat.txt @cecamp +runtime/doc/pi_netrw.txt @cecamp +runtime/doc/pi_tar.txt @cecamp +runtime/doc/pi_vimball.txt @cecamp +runtime/doc/pi_zip.txt @cecamp +runtime/doc/ps1.txt @heaths +runtime/ftplugin/awk.vim @dkearns +runtime/ftplugin/basic.vim @dkearns +runtime/ftplugin/bst.vim @tpope +runtime/ftplugin/cfg.vim @chrisbra +runtime/ftplugin/clojure.vim @axvr +runtime/ftplugin/cs.vim @nickspoons +runtime/ftplugin/csh.vim @dkearns +runtime/ftplugin/css.vim @dkearns +runtime/ftplugin/cucumber.vim @tpope +runtime/ftplugin/dosbatch.vim @mrdubya +runtime/ftplugin/eiffel.vim @dkearns +runtime/ftplugin/erlang.vim @hcs42 +runtime/ftplugin/eruby.vim @tpope @dkearns +runtime/ftplugin/fpcmake.vim @dkearns +runtime/ftplugin/freebasic.vim @dkearns +runtime/ftplugin/fstab.vim @rid9 +runtime/ftplugin/git.vim @tpope +runtime/ftplugin/gitcommit.vim @tpope +runtime/ftplugin/gitconfig.vim @tpope +runtime/ftplugin/gitrebase.vim @tpope +runtime/ftplugin/gitsendemail.vim @tpope +runtime/ftplugin/go.vim @dbarnett +runtime/ftplugin/gprof.vim @dpelle +runtime/ftplugin/haml.vim @tpope +runtime/ftplugin/hgcommit.vim @k-takata +runtime/ftplugin/i3config.vim @hiqua +runtime/ftplugin/icon.vim @dkearns +runtime/ftplugin/indent.vim @dkearns +runtime/ftplugin/javascript.vim @dkearns +runtime/ftplugin/javascriptreact.vim @dkearns +runtime/ftplugin/jsonc.vim @izhakjakov +runtime/ftplugin/julia.vim @carlobaldassi +runtime/ftplugin/kconfig.vim @chrisbra +runtime/ftplugin/less.vim @genoma +runtime/ftplugin/liquid.vim @tpope +runtime/ftplugin/lua.vim @dkearns +runtime/ftplugin/m3build.vim @dkearns +runtime/ftplugin/m3quake.vim @dkearns +runtime/ftplugin/markdown.vim @tpope +runtime/ftplugin/matlab.vim @cecamp +runtime/ftplugin/meson.vim @Liambeguin +runtime/ftplugin/modula3.vim @dkearns +runtime/ftplugin/nginx.vim @chr4 +runtime/ftplugin/nroff.vim @a-vrma +runtime/ftplugin/nsis.vim @k-takata +runtime/ftplugin/octave.vim @dkearns +runtime/ftplugin/pascal.vim @dkearns +runtime/ftplugin/pbtxt.vim @lakshayg +runtime/ftplugin/pdf.vim @tpope +runtime/ftplugin/perl.vim @petdance @dkearns +runtime/ftplugin/pod.vim @petdance @dkearns +runtime/ftplugin/postscr.vim @mrdubya +runtime/ftplugin/ps1.vim @heaths +runtime/ftplugin/ps1xml.vim @heaths +runtime/ftplugin/python.vim @tpict +runtime/ftplugin/qb64.vim @dkearns +runtime/ftplugin/r.vim @jalvesaq +runtime/ftplugin/rhelp.vim @jalvesaq +runtime/ftplugin/rmd.vim @jalvesaq +runtime/ftplugin/rnoweb.vim @jalvesaq +runtime/ftplugin/routeros.vim @zainin +runtime/ftplugin/rrst.vim @jalvesaq +runtime/ftplugin/rst.vim @marshallward +runtime/ftplugin/ruby.vim @tpope @dkearns +runtime/ftplugin/sass.vim @tpope +runtime/ftplugin/scala.vim @derekwyatt +runtime/ftplugin/scss.vim @tpope +runtime/ftplugin/sdoc.vim @gpanders +runtime/ftplugin/solution.vim @dkearns +runtime/ftplugin/spec.vim @ignatenkobrain +runtime/ftplugin/systemverilog.vim @Kocha +runtime/ftplugin/tap.vim @petdance +runtime/ftplugin/tcsh.vim @dkearns +runtime/ftplugin/tidy.vim @dkearns +runtime/ftplugin/tmux.vim @ericpruitt +runtime/ftplugin/toml.vim @averms +runtime/ftplugin/tt2html.vim @petdance +runtime/ftplugin/typescript.vim @dkearns +runtime/ftplugin/typescriptreact.vim @dkearns +runtime/ftplugin/wast.vim @rhysd +runtime/ftplugin/wget.vim @dkearns +runtime/ftplugin/wget2.vim @dkearns +runtime/ftplugin/xml.vim @chrisbra +runtime/ftplugin/xs.vim @petdance +runtime/ftplugin/zsh.vim @chrisbra +runtime/indent/basic.vim @dkearns +runtime/indent/bst.vim @tpope +runtime/indent/cdl.vim @dkearns +runtime/indent/clojure.vim @axvr +runtime/indent/config.vim @dkearns +runtime/indent/cs.vim @nickspoons +runtime/indent/css.vim @dkearns +runtime/indent/cucumber.vim @tpope +runtime/indent/d.vim @dkearns +runtime/indent/dosbatch.vim @k-takata +runtime/indent/dtd.vim @dkearns +runtime/indent/dylan.vim @dkearns +runtime/indent/eiffel.vim @jocelyn +runtime/indent/elm.vim @andys8 +runtime/indent/erlang.vim @hcs42 +runtime/indent/eruby.vim @tpope @dkearns +runtime/indent/eterm.vim @dkearns +runtime/indent/falcon.vim @steveno +runtime/indent/framescript.vim @dkearns +runtime/indent/freebasic.vim @dkearns +runtime/indent/gitconfig.vim @tpope +runtime/indent/gitolite.vim @sitaramc +runtime/indent/go.vim @dbarnett +runtime/indent/haml.vim @tpope +runtime/indent/idlang.vim @dkearns +runtime/indent/java.vim @xuhdev +runtime/indent/javascript.vim @bounceme +runtime/indent/json.vim @elzr +runtime/indent/jsonc.vim @izhakjakov +runtime/indent/julia.vim @carlobaldassi +runtime/indent/ld.vim @dkearns +runtime/indent/less.vim @genoma +runtime/indent/liquid.vim @tpope +runtime/indent/make.vim @dkearns +runtime/indent/meson.vim @Liambeguin +runtime/indent/mma.vim @dkearns +runtime/indent/nginx.vim @chr4 +runtime/indent/nsis.vim @k-takata +runtime/indent/occam.vim @dkearns +runtime/indent/perl.vim @petdance +runtime/indent/php.vim @2072 +runtime/indent/postscr.vim @mrdubya +runtime/indent/prolog.vim @dkearns +runtime/indent/ps1.vim @heaths +runtime/indent/qb64.vim @dkearns +runtime/indent/r.vim @jalvesaq +runtime/indent/readline.vim @dkearns +runtime/indent/rhelp.vim @jalvesaq +runtime/indent/rmd.vim @jalvesaq +runtime/indent/rnoweb.vim @jalvesaq +runtime/indent/rrst.vim @jalvesaq +runtime/indent/ruby.vim @AndrewRadev @dkearns +runtime/indent/sass.vim @tpope +runtime/indent/scala.vim @derekwyatt +runtime/indent/scss.vim @tpope +runtime/indent/sh.vim @chrisbra +runtime/indent/systemverilog.vim @Kocha +runtime/indent/tcl.vim @dkearns +runtime/indent/tcsh.vim @dkearns +runtime/indent/teraterm.vim @k-takata +runtime/indent/typescript.vim @HerringtonDarkholme +runtime/indent/vroom.vim @dbarnett +runtime/indent/wast.vim @rhysd +runtime/indent/xml.vim @chrisbra +runtime/indent/zsh.vim @chrisbra +runtime/keymap/armenian-eastern_utf-8.vim @blinskey +runtime/keymap/armenian-western_utf-8.vim @blinskey +runtime/keymap/tamil_tscii.vim @yegappan +runtime/lang/menu_en_gb.latin1.vim @mrdubya +runtime/pack/dist/opt/cfilter/plugin/cfilter.vim @yegappan +runtime/pack/dist/opt/matchit/ @chrisbra +runtime/plugin/getscriptPlugin.vim @cecamp +runtime/plugin/logiPat.vim @cecamp +runtime/plugin/netrwPlugin.vim @cecamp +runtime/plugin/tarPlugin.vim @cecamp +runtime/plugin/vimballPlugin.vim @cecamp +runtime/plugin/zipPlugin.vim @cecamp +runtime/syntax/aidl.vim @dpelle +runtime/syntax/amiga.vim @cecamp +runtime/syntax/arduino.vim @johshoff +runtime/syntax/asciidoc.vim @aerostitch +runtime/syntax/asm.vim @dkearns +runtime/syntax/asmh8300.vim @dkearns +runtime/syntax/asterisk.vim @jaunis +runtime/syntax/autohotkey.vim @mmikeww +runtime/syntax/awk.vim @dkearns +runtime/syntax/basic.vim @dkearns +runtime/syntax/bst.vim @tpope +runtime/syntax/bzl.vim @dbarnett +runtime/syntax/bzr.vim @hdima +runtime/syntax/cabal.vim @coot +runtime/syntax/cabalconfig.vim @coot +runtime/syntax/cabalproject.vim @coot +runtime/syntax/cf.vim @ernstvanderlinden +runtime/syntax/clojure.vim @axvr +runtime/syntax/cs.vim @nickspoons +runtime/syntax/csh.vim @cecamp +runtime/syntax/cucumber.vim @tpope +runtime/syntax/d.vim @JesseKPhillips +runtime/syntax/dart.vim @pr3d4t0r +runtime/syntax/datascript.vim @dpelle +runtime/syntax/dcl.vim @cecamp +runtime/syntax/desktop.vim @e-kwsm +runtime/syntax/dosbatch.vim @mrdubya +runtime/syntax/dosini.vim @xuhdev +runtime/syntax/dot.vim @mmottl +runtime/syntax/doxygen.vim @frogonwheels +runtime/syntax/dtd.vim @chrisbra +runtime/syntax/dts.vim @zonque +runtime/syntax/eiffel.vim @jocelyn +runtime/syntax/elmfilt.vim @cecamp +runtime/syntax/erlang.vim @hcs42 +runtime/syntax/eruby.vim @tpope @dkearns +runtime/syntax/exports.vim @cecamp +runtime/syntax/falcon.vim @steveno +runtime/syntax/forth.vim @jkotlinski +runtime/syntax/fpcmake.vim @dkearns +runtime/syntax/fstab.vim @rid9 +runtime/syntax/git.vim @tpope +runtime/syntax/gitcommit.vim @tpope +runtime/syntax/gitconfig.vim @tpope +runtime/syntax/gitolite.vim @sitaramc +runtime/syntax/gitrebase.vim @tpope +runtime/syntax/go.vim @bhcleek +runtime/syntax/godoc.vim @dbarnett +runtime/syntax/gprof.vim @dpelle +runtime/syntax/groff.vim @jmarshall +runtime/syntax/haml.vim @tpope +runtime/syntax/haskell.vim @coot +runtime/syntax/hgcommit.vim @k-takata +runtime/syntax/i3config.vim @hiqua +runtime/syntax/icon.vim @dkearns +runtime/syntax/indent.vim @dkearns +runtime/syntax/jargon.vim @h3xx +runtime/syntax/java.vim @fleiner +runtime/syntax/jsonc.vim @izhakjakov +runtime/syntax/julia.vim @carlobaldassi +runtime/syntax/kconfig.vim @chrisbra +runtime/syntax/less.vim @genoma +runtime/syntax/lex.vim @cecamp +runtime/syntax/liquid.vim @tpope +runtime/syntax/lisp.vim @cecamp +runtime/syntax/lynx.vim @dkearns +runtime/syntax/m3build.vim @dkearns +runtime/syntax/m3quake.vim @dkearns +runtime/syntax/mailcap.vim @dkearns +runtime/syntax/make.vim @rohieb +runtime/syntax/mallard.vim @jhradilek +runtime/syntax/maple.vim @cecamp +runtime/syntax/markdown.vim @tpope +runtime/syntax/mason.vim @petdance +runtime/syntax/meson.vim @Liambeguin +runtime/syntax/modula3.vim @dkearns +runtime/syntax/n1ql.vim @pr3d4t0r +runtime/syntax/netrw.vim @cecamp +runtime/syntax/nginx.vim @chr4 +runtime/syntax/ninja.vim @nico +runtime/syntax/nroff.vim @jmarshall +runtime/syntax/nsis.vim @k-takata +runtime/syntax/pascal.vim @dkearns +runtime/syntax/pbtxt.vim @lakshayg +runtime/syntax/pdf.vim @tpope +runtime/syntax/perl.vim @petdance +runtime/syntax/php.vim @TysonAndre +runtime/syntax/plsql.vim @lee-lindley +runtime/syntax/pod.vim @petdance +runtime/syntax/postscr.vim @mrdubya +runtime/syntax/privoxy.vim @dkearns +runtime/syntax/prolog.vim @XVilka +runtime/syntax/ps1.vim @heaths +runtime/syntax/ps1xml.vim @heaths +runtime/syntax/psl.vim @danielkho +runtime/syntax/qb64.vim @dkearns +runtime/syntax/r.vim @jalvesaq +runtime/syntax/raml.vim @in3d +runtime/syntax/ratpoison.vim @trapd00r +runtime/syntax/rc.vim @chrisbra +runtime/syntax/rcs.vim @hdima +runtime/syntax/rebol.vim @mrdubya +runtime/syntax/rego.vim @zenmatic +runtime/syntax/resolv.vim @rid9 +runtime/syntax/rmd.vim @jalvesaq +runtime/syntax/rng.vim @jhradilek +runtime/syntax/routeros.vim @zainin +runtime/syntax/rpcgen.vim @cecamp +runtime/syntax/rrst.vim @jalvesaq +runtime/syntax/rst.vim @marshallward +runtime/syntax/ruby.vim @dkearns +runtime/syntax/sass.vim @tpope +runtime/syntax/scala.vim @derekwyatt +runtime/syntax/scss.vim @tpope +runtime/syntax/sdoc.vim @gpanders +runtime/syntax/sh.vim @cecamp +runtime/syntax/sm.vim @cecamp +runtime/syntax/spec.vim @ignatenkobrain +runtime/syntax/sqloracle.vim @chrisbra +runtime/syntax/squirrel.vim @zenmatic +runtime/syntax/sshconfig.vim @Jakuje +runtime/syntax/sshdconfig.vim @Jakuje +runtime/syntax/sudoers.vim @e-kwsm +runtime/syntax/svn.vim @hdima +runtime/syntax/systemverilog.vim @Kocha +runtime/syntax/tags.vim @cecamp +runtime/syntax/tap.vim @petdance +runtime/syntax/tcsh.vim @dkearns +runtime/syntax/teraterm.vim @k-takata +runtime/syntax/tex.vim @cecamp +runtime/syntax/tidy.vim @dkearns +runtime/syntax/tmux.vim @ericpruitt +runtime/syntax/toml.vim @averms +runtime/syntax/tt2.vim @petdance +runtime/syntax/tt2html.vim @petdance +runtime/syntax/tt2js.vim @petdance +runtime/syntax/typescript.vim @HerringtonDarkholme +runtime/syntax/typescriptcommon.vim @HerringtonDarkholme +runtime/syntax/typescriptreact.vim @HerringtonDarkholme +runtime/syntax/vim.vim @cecamp +runtime/syntax/vroom.vim @dbarnett +runtime/syntax/wast.vim @rhysd +runtime/syntax/wget.vim @dkearns +runtime/syntax/wget2.vim @dkearns +runtime/syntax/xbl.vim @dkearns +runtime/syntax/xmath.vim @cecamp +runtime/syntax/xml.vim @chrisbra +runtime/syntax/xs.vim @petdance +runtime/syntax/xslt.vim @Boobies +runtime/syntax/xxd.vim @cecamp +runtime/syntax/yacc.vim @cecamp +runtime/syntax/zsh.vim @chrisbra +runtime/tutor/tutor.eo @dpelle +runtime/tutor/tutor.eo.utf-8 @dpelle +runtime/tutor/tutor.fr @dpelle +runtime/tutor/tutor.fr.utf-8 @dpelle +src/iscygpty.* @k-takata +src/libvterm/ @leonerd +src/po/ca.po @nfdisco +src/po/de.po @chrisbra +src/po/eo.po @dpelle +src/po/es.po @victorhck +src/po/fi.po @flammie +src/po/fr.po @dpelle +src/po/ga.po @kscanne +src/po/it.po @azc100 +src/po/ja.po @k-takata +src/po/sr.po @eevan78 +src/po/tr.po @bitigchi +src/po/uk.po @sakhnik +src/xxd/ @jnweiger diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index eb9ae4d0ce8bb..0000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve Vim -title: '' -labels: '' - ---- - -_Instructions: Replace the template text and remove irrelevant text (including this line)_ - -**Describe the bug** -A clear and concise description of what the bug is. -(Issues related to the runtime files should be reported to their maintainer, check the file header.) - -**To Reproduce** -Detailed steps to reproduce the behavior: -1. Run `vim --clean` (or `gvim --clean`, etc.) -2. Edit `filename` -3. Type '....' -4. Describe the error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, copy/paste the text or add screenshots to help explain your problem. - -**Environment (please complete the following information):** - - Vim version [e.g. 8.1.1234] (Or paste the result of `vim --version`.) - - OS: [e.g. Ubuntu 18.04, Windows 10 1809, macOS 10.14] - - Terminal: [e.g. GNOME Terminal, mintty, iTerm2, tmux, GNU screen] (Use GUI if you use the GUI.) - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000000..6e4af6d5553ee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,57 @@ +--- +name: Bug report +description: Create a report to help us improve Vim. +labels: [bug] + +body: + - type: markdown + attributes: + value: | + Thanks for reporting issues of Vim! + + If you want to report a security issue, instead of reporting it here + you can alternatively disclose it on + [huntr.dev](https://huntr.dev/bounties/disclose/?utm_campaign=vim%2Fvim&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fvim%2Fvim). + They have rewards in the form of money, swag and CVEs. + + To make it easier for us to help you please enter detailed information below. + - type: textarea + attributes: + label: Steps to reproduce + placeholder: | + 1. + 2. + 3. + 4. + validations: + required: true + - type: textarea + attributes: + label: Expected behaviour + placeholder: A clear and concise description of what you expected to happen. + validations: + required: true + - type: input + attributes: + label: Version of Vim + description: > + Including patch level, use ":version" to see it [e.g. 8.2.1234] + validations: + required: true + - type: textarea + attributes: + label: Environment + description: > + OS [e.g. Ubuntu 21.10], terminal [e.g. GNOME Terminal 3.38.1], value of $TERM, shell [e.g. bash 5.1.8]; anything that might matter + placeholder: | + Operating system: + Terminal: + Value of $TERM: + Shell: + validations: + required: true + - type: textarea + attributes: + label: Logs and stack traces + placeholder: Insert log or other text here (if necessary) + render: shell diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index f78a84b56727b..8fa535d540b43 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -8,7 +8,7 @@ labels: enhancement _Instructions: Replace the template text and remove irrelevant text (including this line)_ -**Is your feature request related something that is currently hard to do? Please describe.** +**Is your feature request about something that is currently impossible or hard to do? Please describe the problem.** A clear and concise description of what is hard to do. Ex. It is difficult to [...] when [...] (If it is related to runtime files, please check their header for where to discuss enhancements.) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000000..61723cdf3febe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,626 @@ +name: GitHub CI + +on: + push: + branches: ['**'] + pull_request: + +# Cancels all previous workflow runs for pull requests that have not completed. +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + linux: + runs-on: ubuntu-18.04 + + env: + CC: ${{ matrix.compiler }} + TEST: test + SRCDIR: ./src + LEAK_CFLAGS: -DEXITFREE + CFLAGS: -Wno-error=deprecated-declarations + LOG_DIR: ${{ github.workspace }}/logs + TERM: xterm + DISPLAY: ':99' + DEBIAN_FRONTEND: noninteractive + + strategy: + fail-fast: false + matrix: + features: [tiny, small, normal, huge] + compiler: [clang, gcc] + extra: [none] + include: + - features: tiny + compiler: clang + extra: nogui + - features: tiny + compiler: gcc + extra: nogui + - features: normal + shadow: ./src/shadow + - features: huge + coverage: true + - features: huge + compiler: gcc + coverage: true + extra: testgui + uchar: true + - features: huge + compiler: clang + extra: asan + - features: huge + compiler: gcc + coverage: true + extra: unittests + - features: normal + compiler: gcc + extra: vimtags + + steps: + - name: Checkout repository from github + uses: actions/checkout@v3 + + - name: Install packages + run: | + PKGS=( \ + gettext \ + libgtk2.0-dev \ + desktop-file-utils \ + libtool-bin \ + ) + if ${{ matrix.features == 'huge' }}; then + PKGS+=( \ + autoconf \ + lcov \ + libcanberra-dev \ + libperl-dev \ + python-dev \ + python3-dev \ + liblua5.3-dev \ + lua5.3 \ + ruby-dev \ + tcl-dev \ + cscope \ + libsodium-dev \ + ) + fi + sudo apt update && sudo apt install -y "${PKGS[@]}" + + - name: Install gcc-11 + if: matrix.compiler == 'gcc' + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt install -y gcc-11 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 + sudo update-alternatives --set gcc /usr/bin/gcc-11 + + - name: Install clang-14 + if: matrix.compiler == 'clang' + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + . /etc/lsb-release + sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-14 main" + sudo apt install -y clang-14 llvm-14 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100 + sudo update-alternatives --set clang /usr/bin/clang-14 + sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-14 100 + sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-14 100 + + - name: Set up environment + run: | + mkdir -p "${LOG_DIR}" + mkdir -p "${HOME}/bin" + echo "${HOME}/bin" >> $GITHUB_PATH + ( + echo "LINUX_VERSION=$(uname -r)" + echo "NPROC=$(getconf _NPROCESSORS_ONLN)" + echo "SND_DUMMY_DIR=${HOME}/snd-dummy" + echo "TMPDIR=${{ runner.temp }}" + + case "${{ matrix.features }}" in + tiny|small) + echo "TEST=testtiny" + if ${{ contains(matrix.extra, 'nogui') }}; then + echo "CONFOPT=--disable-gui" + fi + ;; + normal) + ;; + huge) + echo "TEST=scripttests test_libvterm" + echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + ;; + esac + + if ${{ matrix.coverage == true }}; then + CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH" + echo "LDFLAGS=--coverage" + fi + if ${{ matrix.uchar == true }}; then + CFLAGS="$CFLAGS -funsigned-char" + fi + if ${{ contains(matrix.extra, 'testgui') }}; then + echo "TEST=-C src testgui" + fi + if ${{ contains(matrix.extra, 'unittests') }}; then + echo "TEST=unittests" + fi + if ${{ contains(matrix.extra, 'asan') }}; then + echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" + echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan" + echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan" + echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt" + fi + if ${{ contains(matrix.extra, 'vimtags') }}; then + echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim" + fi + echo "CFLAGS=$CFLAGS" + ) >> $GITHUB_ENV + + - name: Set up system + run: | + if [[ ${CC} = clang ]]; then + # Use llvm-cov instead of gcov when compiler is clang. + ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov + fi + # Setup lua5.3 manually since its package doesn't provide alternative. + # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 + if [[ ${CONFOPT} =~ luainterp ]]; then + sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10 + fi + sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 + sudo usermod -a -G audio "${USER}" + sudo bash ci/setup-xvfb.sh + + - name: Cache snd-dummy + uses: actions/cache@v3 + with: + path: ${{ env.SND_DUMMY_DIR }} + key: linux-${{ env.LINUX_VERSION }}-snd-dummy + + - name: Set up snd-dummy + run: | + if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then + bash ci/build-snd-dummy.sh + fi + cd "${SND_DUMMY_DIR}" + sudo insmod soundcore.ko + sudo insmod snd.ko + sudo insmod snd-pcm.ko + sudo insmod snd-dummy.ko + + - name: Check autoconf + if: contains(matrix.extra, 'unittests') + run: | + make -C src autoconf + + - name: Set up shadow dir + if: matrix.shadow + run: | + make -C src shadow + echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV + echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV + + - name: Configure + run: | + ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing + # Append various warning flags to CFLAGS. + sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk + sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk + if [[ ${CC} = clang ]]; then + # Suppress some warnings produced by clang 12 and later. + sed -i -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk + fi + + - name: Build + if: (!contains(matrix.extra, 'unittests')) + run: | + make ${SHADOWOPT} -j${NPROC} + + - name: Check version + if: (!contains(matrix.extra, 'unittests')) + run: | + "${SRCDIR}"/vim --version + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit + + - name: Test + timeout-minutes: 20 + run: | + do_test() { sg audio "sg $(id -gn) '$*'"; } + do_test make ${SHADOWOPT} ${TEST} + + # - name: Coveralls + # if: matrix.coverage && github.event_name != 'pull_request' + # env: + # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + # COVERALLS_PARALLEL: true + # TRAVIS_JOB_ID: ${{ github.run_id }} + # run: | + # sudo apt-get install -y python3-setuptools python3-wheel + # sudo -H pip3 install pip -U + # # needed for https support for coveralls building cffi only works with gcc, not with clang + # CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1 + # ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8 + + - name: Generate gcov files + if: matrix.coverage + run: | + cd "${SRCDIR}" + find . -type f -name '*.gcno' -exec gcov -pb {} + || true + + - name: Codecov + if: matrix.coverage + uses: codecov/codecov-action@v3.1.0 + with: + flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }} + + - name: ASan logs + if: contains(matrix.extra, 'asan') && !cancelled() + run: | + for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do + asan_symbolize -l "$f" + false # in order to fail a job + done + + # coveralls: + # runs-on: ubuntu-18.04 + # + # needs: linux + # if: always() && github.event_name != 'pull_request' + # + # steps: + # - name: Parallel finished + # env: + # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + # run: | + # curl -k "https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}" -d "payload[build_num]=${GITHUB_RUN_ID}&payload[status]=done" + + macos: + runs-on: macos-latest + + env: + CC: clang + TEST: test + SRCDIR: ./src + LEAK_CFLAGS: -DEXITFREE + TERM: xterm + + strategy: + fail-fast: false + matrix: + features: [tiny, normal, huge] + + steps: + - name: Checkout repository from github + uses: actions/checkout@v3 + + - name: Install packages + if: matrix.features == 'huge' + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + run: | + brew install lua + echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV + + - name: Set up environment + run: | + ( + echo "NPROC=$(getconf _NPROCESSORS_ONLN)" + case "${{ matrix.features }}" in + tiny) + echo "TEST=testtiny" + echo "CONFOPT=--disable-gui" + ;; + normal) + ;; + huge) + echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + ;; + esac + ) >> $GITHUB_ENV + + - name: Configure + run: | + ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing + # Append various warning flags to CFLAGS. + # BSD sed needs backup extension specified. + sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk + # On macOS, the entity of gcc is clang. + sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk + # Suppress some warnings produced by clang 12 and later. + if clang --version | grep -qs 'Apple clang version \(1[3-9]\|[2-9]\)\.'; then + sed -i.bak -f ci/config.mk.clang-12.sed ${SRCDIR}/auto/config.mk + fi + + - name: Build + env: + LC_ALL: C + run: | + make -j${NPROC} + + - name: Check version + run: | + "${SRCDIR}"/vim --version + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit + + - name: Test + timeout-minutes: 20 + run: | + make ${TEST} + + windows: + runs-on: windows-2022 + + env: + # Interfaces + # Lua + LUA_VER: 54 + LUA_VER_DOT: '5.4' + LUA_RELEASE: 5.4.2 + LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip + LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip + LUA_DIR: D:\Lua + # do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l + LUA_DIR_SLASH: D:/Lua + # Python 2 + PYTHON_VER: 27 + PYTHON_VER_DOT: '2.7' + PYTHON_DIR: 'C:\Python27' + # Python 3 + PYTHON3_VER: 310 + PYTHON3_VER_DOT: '3.10' + # Other dependencies + # winpty + WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip + # Escape sequences + COL_RED: "\x1b[31m" + COL_GREEN: "\x1b[32m" + COL_YELLOW: "\x1b[33m" + COL_RESET: "\x1b[m" + + strategy: + fail-fast: false + matrix: + toolchain: [msvc, mingw] + arch: [x64, x86] + features: [HUGE, NORMAL] + include: + - arch: x64 + vcarch: amd64 + warch: x64 + bits: 64 + msystem: MINGW64 + cygreg: registry + pyreg: "" + - arch: x86 + vcarch: x86 + warch: ia32 + bits: 32 + msystem: MINGW32 + cygreg: registry32 + pyreg: "-32" + - toolchain: mingw + arch: x64 + features: HUGE + coverage: yes + exclude: + - toolchain: msvc + arch: x64 + features: NORMAL + - toolchain: mingw + arch: x86 + features: NORMAL + + steps: + - name: Initialize + id: init + shell: bash + run: | + git config --global core.autocrlf input + echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV + if [ "${{ matrix.arch }}" = "x86" ]; then + choco install python2 --forcex86 + else + choco install python2 + fi + python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@") + echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV + + - uses: msys2/setup-msys2@v2 + if: matrix.toolchain == 'mingw' + with: + update: true + install: tar + pacboy: >- + make:p gcc:p + msystem: ${{ matrix.msystem }} + release: false + + - name: Checkout repository from github + uses: actions/checkout@v3 + + - name: Create a list of download URLs + shell: cmd + run: | + type NUL > urls.txt + echo %LUA_RELEASE%>> urls.txt + echo %WINPTY_URL%>> urls.txt + + - name: Cache downloaded files + uses: actions/cache@v3 + with: + path: downloads + key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }} + + - name: Download dependencies + shell: cmd + run: | + path C:\Program Files\7-Zip;%path% + if not exist downloads mkdir downloads + + echo %COL_GREEN%Download Lua%COL_RESET% + call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip + 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1 + + echo %COL_GREEN%Download winpty%COL_RESET% + call :downloadfile %WINPTY_URL% downloads\winpty.zip + 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1 + copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll + copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\ + + goto :eof + + :downloadfile + :: call :downloadfile + if not exist %2 ( + curl -f -L %1 -o %2 + ) + if ERRORLEVEL 1 ( + rem Retry once. + curl -f -L %1 -o %2 || exit 1 + ) + goto :eof + + - name: Copy src directory to src2 + shell: cmd + run: xcopy src src2\ /E > nul + + - name: Build (MSVC) + if: matrix.toolchain == 'msvc' + shell: cmd + run: | + call "%VCVARSALL%" ${{ matrix.vcarch }} + cd src + if "${{ matrix.features }}"=="HUGE" ( + nmake -nologo -f Make_mvc.mak ^ + FEATURES=${{ matrix.features }} ^ + GUI=yes IME=yes ICONV=yes VIMDLL=yes ^ + DYNAMIC_LUA=yes LUA=%LUA_DIR% ^ + DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^ + DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% + ) else ( + nmake -nologo -f Make_mvc.mak ^ + FEATURES=${{ matrix.features }} ^ + GUI=yes IME=yes ICONV=yes VIMDLL=yes + ) + if not exist vim${{ matrix.bits }}.dll ( + echo %COL_RED%Build failure.%COL_RESET% + exit 1 + ) + + - name: Build (MinGW) + if: matrix.toolchain == 'mingw' + shell: msys2 {0} + run: | + cd src + if [ "${{ matrix.features }}" = "HUGE" ]; then + mingw32-make -f Make_ming.mak -j2 \ + FEATURES=${{ matrix.features }} \ + GUI=yes IME=yes ICONV=yes VIMDLL=yes \ + DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \ + DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \ + DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \ + STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }} + else + mingw32-make -f Make_ming.mak -j2 \ + FEATURES=${{ matrix.features }} \ + GUI=yes IME=yes ICONV=yes VIMDLL=yes \ + STATIC_STDCPLUS=yes + fi + + - name: Check version + shell: cmd + run: | + PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR% + src\vim --version || exit 1 + src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit + src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit + + #- name: Prepare Artifact + # shell: cmd + # run: | + # mkdir artifacts + # copy src\*vim.exe artifacts + # copy src\vim*.dll artifacts + # + #- name: Upload Artifact + # uses: actions/upload-artifact@v1 + # with: + # name: vim${{ matrix.bits }}-${{ matrix.toolchain }} + # path: ./artifacts + + - name: Copy gcov data files to src2 + if: matrix.coverage + shell: msys2 {0} + run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1 + + - name: Test and show the result of testing gVim + shell: cmd + timeout-minutes: 20 + run: | + PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR% + call "%VCVARSALL%" ${{ matrix.vcarch }} + + echo %COL_GREEN%Start testing Vim in background.%COL_RESET% + start cmd /c "cd src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt" + + echo %COL_GREEN%Test gVim:%COL_RESET% + cd src\testdir + nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1 + + - name: Show the result of testing Vim + shell: cmd + timeout-minutes: 20 + run: | + PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR% + call "%VCVARSALL%" ${{ matrix.vcarch }} + + echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET% + cd src2\testdir + :: Wait about 10 minutes. + for /L %%i in (1,1,60) do ( + if exist done.txt goto exitloop + timeout 10 > NUL 2>&1 + if ERRORLEVEL 1 ping -n 11 localhost > NUL + ) + set timeout=1 + :exitloop + + echo %COL_GREEN%The result of testing Vim:%COL_RESET% + cd src2\testdir + if exist messages type messages + nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1 + + if "%timeout%"=="1" ( + echo %COL_RED%Timed out.%COL_RESET% + exit 1 + ) + + - name: Generate gcov files + if: matrix.coverage + shell: msys2 {0} + run: | + cd src + find . -type f -name '*.gcno' -exec gcov -pb {} + || true + cd ../src2 + find . -type f -name '*.gcno' -exec gcov -pb {} + || true + + - name: Codecov (gVim) + if: matrix.coverage + uses: codecov/codecov-action@v3.1.0 + with: + directory: src + flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui + + - name: Codecov (Vim) + if: matrix.coverage + uses: codecov/codecov-action@v3.1.0 + with: + directory: src2 + flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000000..efb9e66995960 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,69 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 18 * * 1' + +# Cancels all previous workflow runs for pull requests that have not completed. +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['cpp', 'python'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository from github + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 0000000000000..a58a20b6157ba --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,81 @@ +name: Coverity +on: + schedule: + - cron: '42 0 * * *' # Run once per day, to avoid Coverity's submission limits + workflow_dispatch: + +jobs: + scan: + runs-on: ubuntu-18.04 + + env: + CC: gcc + DEBIAN_FRONTEND: noninteractive + + steps: + - name: Checkout repository from github + uses: actions/checkout@v3 + + - name: Download Coverity + run: | + wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz + mkdir cov-scan + tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan + env: + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + + - name: Install packages + run: | + sudo apt update && sudo apt install -y \ + autoconf \ + gettext \ + libcanberra-dev \ + libperl-dev \ + python-dev \ + python3-dev \ + liblua5.3-dev \ + lua5.3 \ + ruby-dev \ + tcl-dev \ + libgtk2.0-dev \ + desktop-file-utils \ + libtool-bin \ + libsodium-dev + + - name: Set up environment + run: | + echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH + ( + echo "NPROC=$(getconf _NPROCESSORS_ONLN)" + echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + ) >> $GITHUB_ENV + + - name: Set up system + run: | + # Setup lua5.3 manually since its package doesn't provide alternative. + # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 + sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10 + + - name: Configure + run: | + ./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing + # Append various warning flags to CFLAGS. + sed -i -f ci/config.mk.sed src/auto/config.mk + sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk + + - name: Build/scan vim + run: | + cov-build --dir cov-int make -j${NPROC} + + - name: Submit results + run: | + tar zcf cov-scan.tgz cov-int + curl --form token=$TOKEN \ + --form email=$EMAIL \ + --form file=@cov-scan.tgz \ + --form version="$(git rev-parse HEAD)" \ + --form description="Automatic GHA scan" \ + 'https://scan.coverity.com/builds?project=vim' + env: + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} diff --git a/.gitignore b/.gitignore index 6c751e989353a..b7cd67307e126 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,10 @@ src/xxd/xxd src/auto/if_perl.c src/auto/gui_gtk_gresources.c src/auto/gui_gtk_gresources.h +src/auto/os_haiku.rdef src/objects/.dirstamp src/objects -src/tags +src/types.vim # We do need src/auto/configure. src/auto/config.cache @@ -29,7 +30,6 @@ src/auto/pathdef.c # Windows *.exe *.idb -*.manifest *.exp *.map *.obj @@ -56,6 +56,7 @@ nbproject/* # Mac OSX src/xxd/xxd.dSYM +.DS_Store # All platforms *.rej @@ -66,6 +67,11 @@ src/xxd/xxd.dSYM *.pyc *.log src/po/vim.pot +src/tags +/tags +/GPATH +/GTAGS +/GRTAGS # Generated by "make test" src/po/*.ck @@ -90,7 +96,7 @@ src/message_test src/kword_test # Generated by "make install" -runtime/doc/tags +runtime/doc/doctags # Generated by "make shadow". The directory names could be anything but we # restrict them to shadow (the default) or shadow-* @@ -99,5 +105,10 @@ src/shadow-* src/runtime src/pixmaps -# other possible files build by tools +# other files possibly created by tools src/cscope.out + +# Linter/language server files +/.cache/clangd/ +/.ccls-cache/ +/compile_commands.json diff --git a/.hgignore b/.hgignore index ff3d542046451..2153023a8d3ab 100644 --- a/.hgignore +++ b/.hgignore @@ -10,6 +10,7 @@ src/auto/gui_gtk_gresources.h src/objects/.dirstamp src/objects src/tags +src/types.vim # We do need src/auto/configure. src/auto/config.cache @@ -25,7 +26,6 @@ src/auto/pathdef.c # Windows *.exe *.idb -*.manifest *.exp *.map *.obj @@ -86,6 +86,7 @@ src/kword_test # Generated by "make install" runtime/doc/tags +runtime/doc/doctags # Generated by "make shadow". The directory names could be anything but we # restrict them to shadow (the default) or shadow-* diff --git a/.travis.yml b/.travis.yml index f96564bd3a3ea..d60037c3e3142 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,36 +1,41 @@ language: c -anchors: +env: + global: + - BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no LOG_DIR="$TRAVIS_BUILD_DIR/logs" + +_anchors: envs: - &tiny-nogui - BUILD=yes TEST=test COVERAGE=no FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=tiny TEST=testtiny CONFOPT="--disable-gui" - &tiny - BUILD=yes TEST=test COVERAGE=no FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=tiny TEST=testtiny - &small - BUILD=yes TEST=test COVERAGE=no FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=small TEST=testtiny - &normal - BUILD=yes TEST=test COVERAGE=no FEATURES=normal CONFOPT= SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow CHECK_AUTOCONF=no + FEATURES=normal - &linux-huge - BUILD=yes TEST="scripttests test_libvterm" COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no - "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp'" + FEATURES=huge TEST="scripttests test_libvterm" + CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" - &osx-huge # macOS build - BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no - "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'" + FEATURES=huge + CONFOPT="--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" - &unittests - BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes + BUILD=no TEST=unittests FEATURES=huge CHECK_AUTOCONF=yes + - &coverage + CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage - &asan # ASAN build - SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer" - ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt" + SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" + ASAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/asan" UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt" + - &shadowopt + SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow linux: &linux os: linux - dist: trusty + dist: bionic addons: apt: - sources: - # Need msgfmt 0.19.8 to be able to generate .desktop files - - sourceline: 'ppa:ricotz/toolchain' - packages: + packages: &apt-packages - autoconf - clang - lcov @@ -39,46 +44,45 @@ anchors: - libperl-dev - python-dev - python3-dev - - liblua5.2-dev - - lua5.2 + - liblua5.3-dev + - lua5.3 - ruby-dev - tcl-dev - cscope - libgtk2.0-dev - desktop-file-utils + - libtool-bin + services: + - xvfb before_install: - rvm reset - # Remove /opt/python/3.x.x/bin from $PATH for using system python3. - # ("pyenv global system" doesn't seem to work.) - - | - if [[ "$(which python3)" =~ ^/opt/python/ ]]; then - export PATH=$(py3=$(which python3); echo ${PATH//${py3%/python3}:/}) - fi + # Use llvm-cov instead of gcov when compiler is clang. - | - if [[ "${COVERAGE}" = "yes" ]]; then - pip install --user cpp-coveralls + if [[ "${CC}" = "clang" ]]; then + ln -sf "$(command -v llvm-cov)" /home/travis/bin/gcov fi - # needed for https support for coveralls - # building cffi only works with gcc, not with clang + # Setup lua5.3 manually since its package doesn't provide alternative. + # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 - | - if [[ "${COVERAGE}" = "yes" ]]; then - CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1 + if [[ "${CONFOPT}" =~ luainterp ]]; then + sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10 fi - # Use llvm-cov instead of gcov when compiler is clang. + before_script: + - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 + # It appears we can load "snd-dummy" on only amd64. - | - if [[ "${CC}" = "clang" ]]; then - ln -sf "$(which llvm-cov)" /home/travis/bin/gcov + if [[ "${TRAVIS_CPU_ARCH}" = amd64 ]]; then + sudo bash ci/load-snd-dummy.sh || true fi - before_script: - # Start virtual framebuffer to be able to test the GUI. Does not work on OS X. - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start && sleep 3 - - sudo modprobe snd-dummy - sudo usermod -a -G audio $USER - do_test() { sg audio "sg $(id -gn) '$*'"; } osx: &osx os: osx + before_script: + - do_test() { "$@"; } + + homebrew: &osx-homebrew addons: homebrew: packages: @@ -87,31 +91,31 @@ anchors: cache: directories: - /usr/local/Homebrew/Library/Homebrew/vendor/ - - /usr/local/Homebrew/Library/Taps/ + - /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/ before_install: - rvm reset - # Lua is not installed on Travis OSX + # Lua is not installed on macOS - export LUA_PREFIX=/usr/local - before_script: - - do_test() { "$@"; } - coverage: &coverage + coverage: &eval-coverage + # needed for https support for coveralls building cffi only works with gcc, + # not with clang + - CC=gcc pip install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1 - ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8 - (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash)) asan_symbolize: &asan_symbolize - - | - while read log; do - asan_symbolize < "${log}" - done < <(find . -type f -name 'asan.*' -size +0) - -sudo: false + # Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory". + # https://github.com/pyenv/pyenv/issues/580 + - (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true + - for f in $(grep -l '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*); do asan_symbolize-11 -l "$f"; done branches: except: - /^v[0-9]/ script: + - mkdir -p "$LOG_DIR" - NPROC=$(getconf _NPROCESSORS_ONLN) - set -o errexit - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K" @@ -129,104 +133,156 @@ script: - echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K" - | if [[ "${BUILD}" = "yes" ]]; then + # Append various warning flags to CFLAGS. + # BSD sed needs backup extension specified. + sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk + if [[ "${TRAVIS_OS_NAME}" = "osx" ]] || [[ "${CC}" = "clang-11" ]]; then + # On macOS, the entity of gcc is clang. + sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk + else + sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk + fi make ${SHADOWOPT} -j${NPROC} fi - echo -en "travis_fold:end:build\\r\\033[0K" - set +o errexit - - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K" # Show Vim version and also if_xx versions. - | if [[ "${BUILD}" = "yes" ]]; then "${SRCDIR}"/vim --version - "${SRCDIR}"/vim --not-a-term -u NONE -S "${SRCDIR}"/testdir/if_ver-1.vim -c quit > /dev/null - "${SRCDIR}"/vim --not-a-term -u NONE -S "${SRCDIR}"/testdir/if_ver-2.vim -c quit > /dev/null - cat if_ver.txt + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit fi - - > - do_test make ${SHADOWOPT} ${TEST} && - make -C runtime/doc vimtags VIMEXE=../../"${SRCDIR}"/vim && - FOLD_MARKER=travis_fold + - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K" + - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K" + - | + # Not all sanitizers will cause the tests to fail. This helps since we can + # see all the failures instead of just the first one, but we still want the + # test phase to fail if any sanitizer issues are detected. + if [[ -n "${ASAN_OPTIONS}" ]]; then + if grep -q '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*; then + false + fi + fi - -# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env), -# exclude some builds on mac os x and linux -# on mac os x "tiny" is always without GUI -# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env -matrix: +# Instead of using all environments with both compilers on both systems, +# exclude some builds on mac os x and linux. +# On mac os x "tiny" is always without GUI, use 2 compilers in 2 environments. +# Linux: 2 compilers on some of the environments + gcc on os390 +jobs: include: - - <<: *osx - name: tiny-nogui/clang - compiler: clang - env: *tiny-nogui - - <<: *osx - name: tiny-nogui/gcc - compiler: gcc - env: *tiny-nogui - - <<: *osx - name: huge/clang - compiler: clang - env: *osx-huge - - <<: *osx - name: huge/gcc - compiler: gcc - env: *osx-huge - - <<: *linux - name: tiny-nogui/clang - compiler: clang - env: *tiny-nogui - - <<: *linux - name: tiny-nogui/gcc - compiler: gcc - env: *tiny-nogui - - <<: *linux - name: tiny/clang - compiler: clang - env: *tiny - - <<: *linux - name: tiny/gcc - compiler: gcc - env: *tiny + #- <<: *osx + # name: tiny-nogui/clang + # compiler: clang + # env: *tiny-nogui + #- <<: *osx + # name: tiny-nogui/gcc + # compiler: gcc + # env: *tiny-nogui + #- <<: *osx + # <<: *osx-homebrew + # name: huge/clang + # compiler: clang + # env: *osx-huge + #- <<: *osx + # <<: *osx-homebrew + # name: huge/gcc + # compiler: gcc + # env: *osx-huge + #- <<: *linux + # name: tiny-nogui/clang + # compiler: clang + # env: *tiny-nogui + #- <<: *linux + # name: tiny-nogui/gcc + # compiler: gcc + # env: *tiny-nogui + #- <<: *linux + # name: tiny/clang + # compiler: clang + # env: *tiny + #- <<: *linux + # name: tiny/gcc + # compiler: gcc + # env: *tiny + #- <<: *linux + # name: small/gcc + # compiler: gcc + # env: *small + #- <<: *linux + # name: normal+shadow/clang + # compiler: clang + # env: + # - *normal + # - *shadowopt + #- <<: *linux + # name: normal+shadow/gcc + # compiler: gcc + # env: + # - *normal + # - *shadowopt - <<: *linux - name: small/gcc + arch: s390x + name: huge/gcc-s390x compiler: gcc - env: *small - - <<: *linux - name: normal/clang - compiler: clang - env: *normal - - <<: *linux - name: normal/gcc - compiler: gcc - env: *normal - - <<: *linux - name: huge+coverage/clang - compiler: clang env: *linux-huge - after_success: *coverage + services: [] - <<: *linux - name: huge+coverage/gcc + arch: arm64 + name: huge/gcc-arm64 compiler: gcc env: *linux-huge - after_success: *coverage - - <<: *linux - name: unittests+coverage/gcc - compiler: gcc - env: *unittests - after_success: *coverage - - <<: *linux # ASAN - name: huge+asan/gcc - compiler: gcc - env: - - *linux-huge - - *asan - after_failure: *asan_symbolize - - <<: *linux - name: huge-testgui+coverage/gcc - compiler: gcc - env: - - *linux-huge - - TEST="-C src testgui" - after_success: *coverage + services: [] + #- <<: *linux + # name: huge+coverage/clang + # compiler: clang + # env: + # - *linux-huge + # - *coverage + # after_success: *eval-coverage + #- <<: *linux + # name: huge+coverage/gcc + # compiler: gcc + # env: + # - *linux-huge + # - *coverage + # after_success: *eval-coverage + #- <<: *linux # ASAN + # name: huge+asan/clang + # compiler: clang-11 + # addons: + # apt: + # sources: + # - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main' + # key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + # packages: + # - *apt-packages + # - clang-11 + # env: + # - *linux-huge + # - *asan + # after_failure: *asan_symbolize + #- <<: *linux + # name: huge-testgui+coverage/gcc + # compiler: gcc + # env: + # - *linux-huge + # - *coverage + # - TEST="-C src testgui" + # after_success: *eval-coverage + #- <<: *linux + # name: unittests+coverage/gcc + # compiler: gcc + # env: + # - *unittests + # - *coverage + # after_success: *eval-coverage + #- <<: *linux + # name: vimtags/gcc + # compiler: gcc + # env: + # - *normal + # - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim" # vim:set sts=2 sw=2 tw=0 et: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0dcf29f768f7d..4918d5a8a56a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,7 @@ If you find a problem with one of these files or have a suggestion for improvement, please first try to contact the maintainer directly. Look in the header of the file for the name and email address. -The maintainer will take care of issues and send updates to Bram for +The maintainer will take care of issues and send updates to Bram for distribution with Vim. If the maintainer does not respond, contact the vim-dev maillist. @@ -65,6 +65,9 @@ If the maintainer does not respond, contact the vim-dev maillist. # Translations +Translations of this CONTRIBUTING file: +[Korean](https://github.com/cjw1359/opensource/blob/master/Vim/CONTRIBUTING_ko.md) + Translating messages and runtime files is very much appreciated! These things can be translated: * Messages in Vim, see [src/po/README.txt][1] diff --git a/Filelist b/Filelist index 6cb5f63b2c920..4a2bb151be424 100644 --- a/Filelist +++ b/Filelist @@ -3,15 +3,30 @@ # source files for all source archives SRC_ALL = \ - .gitignore \ + .cirrus.yml \ + .coveralls.yml \ .gitattributes \ + .github/CODEOWNERS \ + .github/ISSUE_TEMPLATE/bug_report.yml \ + .github/ISSUE_TEMPLATE/feature_request.md \ + .github/workflows/ci.yml \ + .github/workflows/codeql-analysis.yml \ + .github/workflows/coverity.yml \ + .gitignore \ .hgignore \ .lgtm.yml \ .travis.yml \ - appveyor.yml \ + .appveyor.yml \ + .codecov.yml \ ci/appveyor.bat \ + ci/build-snd-dummy.sh \ + ci/config.mk*.sed \ + ci/if_ver*.vim \ + ci/load-snd-dummy.sh \ + ci/setup-xvfb.sh \ src/Make_all.mak \ src/README.md \ + src/alloc.c \ src/alloc.h \ src/arabic.c \ src/arglist.c \ @@ -27,6 +42,8 @@ SRC_ALL = \ src/channel.c \ src/charset.c \ src/cindent.c \ + src/clientserver.c \ + src/clipboard.c \ src/cmdexpand.c \ src/cmdhist.c \ src/crypt.c \ @@ -38,6 +55,7 @@ SRC_ALL = \ src/drawline.c \ src/drawscreen.c \ src/edit.c \ + src/errors.h \ src/eval.c \ src/evalbuffer.c \ src/evalfunc.c \ @@ -54,6 +72,7 @@ SRC_ALL = \ src/fileio.c \ src/filepath.c \ src/findfile.c \ + src/float.c \ src/fold.c \ src/getchar.c \ src/globals.h \ @@ -62,18 +81,22 @@ SRC_ALL = \ src/gui_beval.c \ src/hardcopy.c \ src/hashtab.c \ + src/help.c \ src/highlight.c \ src/indent.c \ src/insexpand.c \ + src/job.c \ src/json.c \ src/json_test.c \ src/kword_test.c \ src/list.c \ + src/locale.c \ src/keymap.h \ src/macros.h \ src/main.c \ src/map.c \ src/mark.c \ + src/match.c \ src/mbyte.c \ src/memfile.c \ src/memfile_test.c \ @@ -90,6 +113,8 @@ SRC_ALL = \ src/nbdebug.h \ src/netbeans.c \ src/normal.c \ + src/nv_cmdidxs.h \ + src/nv_cmds.h \ src/ops.c \ src/option.c \ src/option.h \ @@ -115,15 +140,20 @@ SRC_ALL = \ src/spell.h \ src/spellfile.c \ src/spellsuggest.c \ + src/strings.c \ src/structs.h \ src/syntax.c \ src/tag.c \ src/term.c \ src/terminal.c \ - src/term.h \ + src/termdefs.h \ src/termlib.c \ src/testing.c \ + src/textformat.c \ + src/textobject.c \ src/textprop.c \ + src/time.c \ + src/typval.c \ src/ui.c \ src/undo.c \ src/usercmd.c \ @@ -131,6 +161,14 @@ SRC_ALL = \ src/version.c \ src/version.h \ src/vim.h \ + src/vim9.h \ + src/vim9cmds.c \ + src/vim9compile.c \ + src/vim9execute.c \ + src/vim9expr.c \ + src/vim9instr.c \ + src/vim9script.c \ + src/vim9type.c \ src/viminfo.c \ src/winclip.c \ src/window.c \ @@ -143,22 +181,23 @@ SRC_ALL = \ src/testdir/*.py \ src/testdir/lsan-suppress.txt \ src/testdir/sautest/autoload/*.vim \ - src/testdir/runtest.vim \ - src/testdir/summarize.vim \ + src/testdir/testluaplugin/lua/testluaplugin/*.lua \ src/testdir/check.vim \ - src/testdir/shared.vim \ + src/testdir/gui_init.vim \ + src/testdir/gui_preinit.vim \ + src/testdir/mouse.vim \ + src/testdir/runtest.vim \ src/testdir/screendump.vim \ - src/testdir/view_util.vim \ - src/testdir/term_util.vim \ src/testdir/setup.vim \ - src/testdir/gui_init.vim \ src/testdir/setup_gui.vim \ - src/testdir/gui_preinit.vim \ + src/testdir/shared.vim \ + src/testdir/vim9.vim \ + src/testdir/script_util.vim \ + src/testdir/summarize.vim \ + src/testdir/term_util.vim \ + src/testdir/view_util.vim \ src/testdir/test[0-9]*.ok \ - src/testdir/test[0-9]*a.ok \ - src/testdir/test_[a-z]*.ok \ - src/testdir/test49.vim \ - src/testdir/test83-tags? \ + src/testdir/test77a.ok \ src/testdir/test77a.com \ src/testdir/test_*.vim \ src/testdir/python2/*.py \ @@ -171,17 +210,15 @@ SRC_ALL = \ src/testdir/python_after/*.py \ src/testdir/python_before/*.py \ src/testdir/pyxfile/*.py \ - src/testdir/bench*.in \ - src/testdir/bench*.vim \ src/testdir/dumps/*.dump \ src/testdir/samples/*.txt \ src/testdir/samples/test000 \ - src/testdir/if_ver*.vim \ src/testdir/color_ramp.vim \ src/testdir/silent.wav \ src/testdir/popupbounce.vim \ src/proto.h \ src/protodef.h \ + src/proto/alloc.pro \ src/proto/arabic.pro \ src/proto/arglist.pro \ src/proto/autocmd.pro \ @@ -194,6 +231,8 @@ SRC_ALL = \ src/proto/channel.pro \ src/proto/charset.pro \ src/proto/cindent.pro \ + src/proto/clientserver.pro \ + src/proto/clipboard.pro \ src/proto/cmdexpand.pro \ src/proto/cmdhist.pro \ src/proto/crypt.pro \ @@ -218,20 +257,25 @@ SRC_ALL = \ src/proto/fileio.pro \ src/proto/filepath.pro \ src/proto/findfile.pro \ + src/proto/float.pro \ src/proto/fold.pro \ src/proto/getchar.pro \ src/proto/gui.pro \ src/proto/gui_beval.pro \ src/proto/hardcopy.pro \ src/proto/hashtab.pro \ + src/proto/help.pro \ src/proto/highlight.pro \ src/proto/indent.pro \ src/proto/insexpand.pro \ + src/proto/job.pro \ src/proto/json.pro \ src/proto/list.pro \ + src/proto/locale.pro \ src/proto/main.pro \ src/proto/map.pro \ src/proto/mark.pro \ + src/proto/match.pro \ src/proto/mbyte.pro \ src/proto/memfile.pro \ src/proto/memline.pro \ @@ -262,18 +306,30 @@ SRC_ALL = \ src/proto/spell.pro \ src/proto/spellfile.pro \ src/proto/spellsuggest.pro \ + src/proto/strings.pro \ src/proto/syntax.pro \ src/proto/tag.pro \ src/proto/term.pro \ src/proto/terminal.pro \ src/proto/termlib.pro \ src/proto/testing.pro \ + src/proto/textformat.pro \ + src/proto/textobject.pro \ src/proto/textprop.pro \ + src/proto/time.pro \ + src/proto/typval.pro \ src/proto/ui.pro \ src/proto/undo.pro \ src/proto/usercmd.pro \ src/proto/userfunc.pro \ src/proto/version.pro \ + src/proto/vim9cmds.pro \ + src/proto/vim9compile.pro \ + src/proto/vim9execute.pro \ + src/proto/vim9expr.pro \ + src/proto/vim9instr.pro \ + src/proto/vim9script.pro \ + src/proto/vim9type.pro \ src/proto/viminfo.pro \ src/proto/winclip.pro \ src/proto/window.pro \ @@ -282,13 +338,12 @@ SRC_ALL = \ src/libvterm/LICENSE \ src/libvterm/Makefile \ src/libvterm/README \ + src/libvterm/CONTRIBUTING \ src/libvterm/tbl2inc_c.pl \ src/libvterm/vterm.pc.in \ - src/libvterm/bin/unterm.c \ - src/libvterm/bin/vterm-ctrl.c \ - src/libvterm/bin/vterm-dump.c \ src/libvterm/doc/URLs \ src/libvterm/doc/seqs.txt \ + src/libvterm/find-wide-chars.pl \ src/libvterm/include/vterm.h \ src/libvterm/include/vterm_keycodes.h \ src/libvterm/src/encoding.c \ @@ -296,6 +351,7 @@ SRC_ALL = \ src/libvterm/src/encoding/DECdrawing.tbl \ src/libvterm/src/encoding/uk.inc \ src/libvterm/src/encoding/uk.tbl \ + src/libvterm/src/fullwidth.inc \ src/libvterm/src/keyboard.c \ src/libvterm/src/mouse.c \ src/libvterm/src/parser.c \ @@ -326,16 +382,19 @@ SRC_ALL = \ src/libvterm/t/27state_reset.test \ src/libvterm/t/28state_dbl_wh.test \ src/libvterm/t/29state_fallback.test \ - src/libvterm/t/30pen.test \ - src/libvterm/t/40screen_ascii.test \ - src/libvterm/t/41screen_unicode.test \ - src/libvterm/t/42screen_damage.test \ - src/libvterm/t/43screen_resize.test \ - src/libvterm/t/44screen_pen.test \ - src/libvterm/t/45screen_protect.test \ - src/libvterm/t/46screen_extent.test \ - src/libvterm/t/47screen_dbl_wh.test \ - src/libvterm/t/48screen_termprops.test \ + src/libvterm/t/30state_pen.test \ + src/libvterm/t/31state_rep.test \ + src/libvterm/t/32state_flow.test \ + src/libvterm/t/40state_selection.test \ + src/libvterm/t/60screen_ascii.test \ + src/libvterm/t/61screen_unicode.test \ + src/libvterm/t/62screen_damage.test \ + src/libvterm/t/63screen_resize.test \ + src/libvterm/t/64screen_pen.test \ + src/libvterm/t/65screen_protect.test \ + src/libvterm/t/66screen_extent.test \ + src/libvterm/t/67screen_dbl_wh.test \ + src/libvterm/t/68screen_termprops.test \ src/libvterm/t/90vttest_01-movement-1.test \ src/libvterm/t/90vttest_01-movement-2.test \ src/libvterm/t/90vttest_01-movement-3.test \ @@ -385,10 +444,8 @@ SRC_UNIX = \ src/configure \ src/configure.ac \ src/create_cmdidxs.vim \ - src/gui_at_fs.c \ - src/gui_at_sb.c \ - src/gui_at_sb.h \ - src/gui_athena.c \ + src/create_nvcmdidxs.c \ + src/create_nvcmdidxs.vim \ src/gui_gtk.c \ src/gui_gtk_f.c \ src/gui_gtk_f.h \ @@ -401,7 +458,6 @@ SRC_UNIX = \ src/gui_xmebwp.h \ src/gui_x11.c \ src/gui_x11_pm.h \ - src/hangulin.c \ src/if_xcmdsrv.c \ src/link.sh \ src/installman.sh \ @@ -414,14 +470,12 @@ SRC_UNIX = \ src/osdef1.h.in \ src/osdef2.h.in \ src/pathdef.sh \ - src/proto/gui_athena.pro \ src/proto/gui_gtk.pro \ src/proto/gui_gtk_x11.pro \ src/proto/gui_gtk_gresources.pro \ src/proto/gui_motif.pro \ src/proto/gui_xmdlg.pro \ src/proto/gui_x11.pro \ - src/proto/hangulin.pro \ src/proto/if_xcmdsrv.pro \ src/proto/os_unix.pro \ src/proto/pty.pro \ @@ -439,8 +493,8 @@ SRC_UNIX = \ # source files for both DOS and Unix SRC_DOS_UNIX = \ + src/gui_xim.c \ src/if_cscope.c \ - src/if_cscope.h \ src/if_lua.c \ src/if_mzsch.c \ src/if_mzsch.h \ @@ -451,6 +505,7 @@ SRC_DOS_UNIX = \ src/if_py_both.h \ src/if_ruby.c \ src/if_tcl.c \ + src/proto/gui_xim.pro \ src/proto/if_cscope.pro \ src/proto/if_lua.pro \ src/proto/if_mzsch.pro \ @@ -486,18 +541,14 @@ SRC_DOS = \ tools/rename.bat \ src/bigvim.bat \ src/bigvim64.bat \ - src/msvcsetup.bat \ src/msvc2008.bat \ src/msvc2010.bat \ src/msvc2015.bat \ src/msys32.bat \ src/msys64.bat \ - src/dimm.idl \ src/dlldata.c \ src/dosinst.c \ src/dosinst.h \ - src/glbl_ime.cpp \ - src/glbl_ime.h \ src/gui_dwrite.cpp \ src/gui_dwrite.h \ src/gui_w32.c \ @@ -523,10 +574,8 @@ SRC_DOS = \ src/testdir/Make_ming.mak \ src/testdir/dos.vim \ src/uninstall.c \ - src/vim.def \ src/vim.rc \ - src/vimio.h \ - src/gvim.exe.mnf \ + src/vim.manifest \ src/vimrun.c \ src/xpm_w32.c \ src/xpm_w32.h \ @@ -576,6 +625,7 @@ SRC_DOS_BIN = \ src/xpm/x86/lib-vc14/libXpm.lib \ src/xpm/x86/lib/libXpm.a \ src/xpm/x86/lib/libXpm.lib \ + runtime/bitmaps/vim.ico \ nsis/icons.zip \ # source files for Amiga, DOS, etc. (also in the extra archive) @@ -587,7 +637,7 @@ SRC_AMI = \ README_amisrc.txt.info \ src.info \ src/INSTALLami.txt \ - src/Make_morph.mak \ + src/Make_ami.mak \ src/os_amiga.c \ src/os_amiga.h \ src/proto/os_amiga.pro \ @@ -595,17 +645,21 @@ SRC_AMI = \ src/testdir/amiga.vim \ src/xxd/Make_amiga.mak \ +# source files for Haiku (also in the extra archive) +SRC_HAIKU = \ + README_haiku.txt \ + src/os_haiku.h \ + src/os_haiku.rdef.in \ + src/gui_haiku.cc \ + src/gui_haiku.h \ + src/proto/gui_haiku.pro \ + # source files for the Mac (also in the extra archive) SRC_MAC = \ src/INSTALLmac.txt \ - src/dehqx.py \ - src/gui_mac.c \ - src/os_mac_rsrc/*.icns \ src/os_mac.h \ - src/os_mac.rsr.hqx \ src/os_mac_conv.c \ src/os_macosx.m \ - src/proto/gui_mac.pro \ src/proto/os_mac_conv.pro \ # source files for VMS (in the extra archive) @@ -630,25 +684,18 @@ SRC_QNX = \ src/proto/gui_photon.pro \ src/proto/os_qnx.pro \ - # source files for the extra archive (all sources that are not for Unix) SRC_EXTRA = \ $(SRC_AMI) \ $(SRC_AMI_DOS) \ $(SRC_DOS) \ $(SRC_DOS_BIN) \ + $(SRC_HAIKU) \ $(SRC_MAC) \ $(SRC_QNX) \ $(SRC_VMS) \ README_os390.txt \ - src/Make_mint.mak \ - src/infplist.xml \ src/link.390 \ - src/os_beos.c \ - src/os_beos.h \ - src/os_beos.rsrc \ - src/proto/os_beos.pro \ - src/os_mint.h \ src/os_vms_fix.com \ src/toolbar.phi \ @@ -656,6 +703,8 @@ SRC_EXTRA = \ RT_ALL = \ README.txt \ README.md \ + README_VIM9.md \ + LICENSE \ CONTRIBUTING.md \ runtime/bugreport.vim \ runtime/doc/*.awk \ @@ -672,6 +721,7 @@ RT_ALL = \ runtime/doc/xxd.1 \ runtime/ftoff.vim \ runtime/gvimrc_example.vim \ + runtime/import/dist/vimhelp.vim \ runtime/macros/README.txt \ runtime/macros/editexisting.vim \ runtime/macros/hanoi/click.me \ @@ -747,6 +797,7 @@ RT_SCRIPTS = \ runtime/autoload/xml/*.vim \ runtime/colors/*.vim \ runtime/colors/README.txt \ + runtime/colors/lists/*.vim \ runtime/colors/tools/*.vim \ runtime/compiler/*.vim \ runtime/compiler/README.txt \ @@ -770,20 +821,20 @@ RT_UNIX = \ README_unix.txt \ runtime/hi16-action-make.png \ runtime/hi22-action-make.png \ - runtime/vim16x16.png \ - runtime/vim16x16.xpm \ - runtime/vim32x32.png \ - runtime/vim32x32.xpm \ - runtime/vim48x48.png \ - runtime/vim48x48.xpm \ runtime/gvim.desktop \ runtime/vim.desktop \ # Unix and DOS runtime without CR-LF translation RT_UNIX_DOS_BIN = \ runtime/vim16x16.gif \ + runtime/vim16x16.png \ + runtime/vim16x16.xpm \ runtime/vim32x32.gif \ + runtime/vim32x32.png \ + runtime/vim32x32.xpm \ runtime/vim48x48.gif \ + runtime/vim48x48.png \ + runtime/vim48x48.xpm \ # runtime not for unix or extra RT_NO_UNIX = \ @@ -799,7 +850,6 @@ RT_AMI_DOS = \ # DOS runtime (also in the extra archive) RT_DOS = \ README_dos.txt \ - runtime/rgb.txt \ vimtutor.bat \ # DOS runtime without CR-LF translation (also in the extra archive) @@ -942,7 +992,10 @@ LANG_GEN = \ runtime/doc/*-pl.UTF-8.1 \ runtime/doc/*-ru.1 \ runtime/doc/*-ru.UTF-8.1 \ + runtime/doc/*-tr.1 \ + runtime/doc/*-tr.UTF-8.1 \ runtime/lang/README.txt \ + runtime/lang/Makefile \ runtime/lang/menu_*.vim \ runtime/keymap/README.txt \ runtime/keymap/*.vim \ @@ -964,6 +1017,7 @@ LANG_GEN = \ runtime/spell/README.txt \ runtime/spell/??/*.diff \ runtime/spell/??/main.aap \ + runtime/spell/sr/README_sr.txt \ runtime/spell/tet/*.diff \ runtime/spell/tet/main.aap \ runtime/spell/check/main.aap \ @@ -990,6 +1044,8 @@ LANG_SRC = \ src/po/README_mvc.txt \ src/po/check.vim \ src/po/cleanup.vim \ + src/po/tojavascript.vim \ + src/po/fixfilenames.vim \ src/po/Makefile \ src/po/Make_all.mak \ src/po/Make_cyg.mak \ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000..ecfbe5534e21b --- /dev/null +++ b/LICENSE @@ -0,0 +1,78 @@ +VIM LICENSE + +I) There are no restrictions on distributing unmodified copies of Vim except + that they must include this license text. You can also distribute + unmodified parts of Vim, likewise unrestricted except that they must + include this license text. You are also allowed to include executables + that you made from the unmodified Vim sources, plus your own usage + examples and Vim scripts. + +II) It is allowed to distribute a modified (or extended) version of Vim, + including executables and/or source code, when the following four + conditions are met: + 1) This license text must be included unmodified. + 2) The modified Vim must be distributed in one of the following five ways: + a) If you make changes to Vim yourself, you must clearly describe in + the distribution how to contact you. When the maintainer asks you + (in any way) for a copy of the modified Vim you distributed, you + must make your changes, including source code, available to the + maintainer without fee. The maintainer reserves the right to + include your changes in the official version of Vim. What the + maintainer will do with your changes and under what license they + will be distributed is negotiable. If there has been no negotiation + then this license, or a later version, also applies to your changes. + The current maintainer is Bram Moolenaar . If this + changes it will be announced in appropriate places (most likely + vim.sf.net, www.vim.org and/or comp.editors). When it is completely + impossible to contact the maintainer, the obligation to send him + your changes ceases. Once the maintainer has confirmed that he has + received your changes they will not have to be sent again. + b) If you have received a modified Vim that was distributed as + mentioned under a) you are allowed to further distribute it + unmodified, as mentioned at I). If you make additional changes the + text under a) applies to those changes. + c) Provide all the changes, including source code, with every copy of + the modified Vim you distribute. This may be done in the form of a + context diff. You can choose what license to use for new code you + add. The changes and their license must not restrict others from + making their own changes to the official version of Vim. + d) When you have a modified Vim which includes changes as mentioned + under c), you can distribute it without the source code for the + changes if the following three conditions are met: + - The license that applies to the changes permits you to distribute + the changes to the Vim maintainer without fee or restriction, and + permits the Vim maintainer to include the changes in the official + version of Vim without fee or restriction. + - You keep the changes for at least three years after last + distributing the corresponding modified Vim. When the maintainer + or someone who you distributed the modified Vim to asks you (in + any way) for the changes within this period, you must make them + available to him. + - You clearly describe in the distribution how to contact you. This + contact information must remain valid for at least three years + after last distributing the corresponding modified Vim, or as long + as possible. + e) When the GNU General Public License (GPL) applies to the changes, + you can distribute the modified Vim under the GNU GPL version 2 or + any later version. + 3) A message must be added, at least in the output of the ":version" + command and in the intro screen, such that the user of the modified Vim + is able to see that it was modified. When distributing as mentioned + under 2)e) adding the message is only required for as far as this does + not conflict with the license used for the changes. + 4) The contact information as required under 2)a) and 2)d) must not be + removed or changed, except that the person himself can make + corrections. + +III) If you distribute a modified version of Vim, you are encouraged to use + the Vim license for your changes and make them available to the + maintainer, including the source code. The preferred way to do this is + by e-mail or by uploading the files to a server and e-mailing the URL. + If the number of changes is small (e.g., a modified Makefile) e-mailing a + context diff will do. The e-mail address to be used is + + +IV) It is not allowed to remove this license from the distribution of the Vim + sources, parts of it or from a modified version. You may use this + license for previous Vim releases instead of the license that they came + with, at your option. diff --git a/Makefile b/Makefile index f7bc3de487232..45cffff5730ab 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ first: # Some make programs use the last target for the $@ default; put the other # targets separately to always let $@ expand to "first" by default. -all install uninstall tools config configure reconfig proto depend lint tags types test scripttests test_libvterm unittests testclean clean distclean: +all install uninstall tools config configure reconfig proto depend lint tags types test scripttests testtiny test_libvterm unittests testclean clean distclean: @if test ! -f src/auto/config.mk; then \ cp src/config.mk.dist src/auto/config.mk; \ fi @@ -56,7 +56,7 @@ indenttest: cd runtime/indent && \ $(MAKE) clean && \ $(MAKE) test VIM="$(VIM_FOR_INDENTTEST)" - + ######################################################################### # 2. Creating the various distribution files. @@ -85,19 +85,18 @@ indenttest: # Before creating an archive first delete all backup files, *.orig, etc. MAJOR = 8 -MINOR = 1 +MINOR = 2 # CHECKLIST for creating a new version: # # - Update Vim version number. For a test version in: src/version.h, # READMEdir/Contents, MAJOR/MINOR above, VIMMAJOR and VIMMINOR in -# src/Makefile, README.txt, README.md, READMEdir/README*.txt, +# src/Makefile, README.txt, README.md, src/README.md, READMEdir/README*.txt, # runtime/doc/*.txt and make nsis/gvim_version.nsh. -# For a minor/major version: src/GvimExt/GvimExt.reg, src/vim.def, -# src/gvim.exe.mnf. -# - Compile Vim with GTK, Perl, Python, Python3, TCL, Ruby, MZscheme, Lua (if -# you can make it all work), Cscope and "huge" features. Exclude workshop -# and SNiFF. +# For a minor/major version: src/GvimExt/GvimExt.reg, src/vim.manifest. +# - Compile Vim with GTK, Perl, Python, Python3, TCL, Ruby, Lua, Cscope and +# "huge" features. Add MZscheme if you can make it work. +# Use "make reconfig" after selecting the configure arguments. # - With these features: "make proto" (requires cproto and Motif installed; # ignore warnings for missing include files, fix problems for syntax errors). # - With these features: "make depend" (works best with gcc). @@ -106,9 +105,6 @@ MINOR = 1 # - If you have valgrind, enable it in src/testdir/Makefile and run "make # test". Enable EXITFREE, disable GUI, scheme and tcl to avoid false alarms. # Check the valgrind output. -# - If you have the efence library, enable it in "src/Makefile" and run "make -# test". Disable Python and Ruby to avoid trouble with threads (efence is -# not threadsafe). # - Adjust the date and other info in src/version.h. # - Correct included_patches[] in src/version.c. # - Check for missing entries in runtime/makemenu.vim (with checkmenu script). @@ -148,7 +144,7 @@ MINOR = 1 # - > make dossrc # > make dosrt # Unpack dist/vim##rt.zip and dist/vim##src.zip on an MS-Windows PC. -# This creates the directory vim/vim81 and puts all files in there. +# This creates the directory vim/vim82 and puts all files in there. # Win32 console version build: # - See src/INSTALLpc.txt for installing the compiler and SDK. # - Set environment for Visual C++ 2015: @@ -156,7 +152,7 @@ MINOR = 1 # > msvc2015.bat # - Build the console binary: # > nmake -f Make_mvc.mak -# - Run the tests and check the ouput: +# - Run the tests and check the output: # > nmake -f Make_mvc.mak testclean # > nmake -f Make_mvc.mak test # - Rename (using ../tools/rename.bat): @@ -206,7 +202,7 @@ MINOR = 1 # Note: VisVim needs to be build with MSVC 5, newer versions don't work. # gvimext64.dll can be obtained from: # https://github.com/vim/vim-win32-installer/releases -# It is part of gvim_8.0.*_x64.zip as vim/vim80/GvimExt/gvimext64.dll. +# It is part of gvim_8.2.*_x64.zip as vim/vim82/GvimExt/gvimext64.dll. # - Make sure there is a diff.exe two levels up (get it from a previous Vim # version). Also put winpty32.dll and winpty-agent.exe there. # - go to ../nsis and do: diff --git a/README.md b/README.md index c579ccc4c1502..5c8403c3f91ac 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,26 @@ -![Vim Logo](https://github.com/vim/vim/blob/master/runtime/vimlogo.gif) +[![Vim Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org) -[![Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim) -[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) -[![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master) -[![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) -[![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp) -[![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) -[![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) +[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22) [![Travis Build Status](https://travis-ci.com/vim/vim.svg?branch=master)](https://travis-ci.com/github/vim/vim) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim) [![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master) [![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) [![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp) [![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) [![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) [![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html) + +For translations of this README see the end. + +If you find a bug or want to discuss the best way to add a new feature, please +open an [issue](https://github.com/vim/vim/issues). +If you have a question or want to discuss the best way to do something with +Vim, you can use [StackExchange](https://vi.stackexchange.com/) +or one of the [Maillists](https://www.vim.org/community.php). ## What is Vim? ## -Vim is a greatly improved version of the good old UNIX editor Vi. Many new +Vim is a greatly improved version of the good old UNIX editor +[Vi](https://en.wikipedia.org/wiki/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 +fingers" will feel at home. +See [`runtime/doc/vi_diff.txt`](runtime/doc/vi_diff.txt) for differences with Vi. This editor is very useful for editing programs and other plain text files. @@ -24,11 +28,12 @@ All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be mapped to commands by the user, and the mouse can be used. -Vim runs under MS-Windows (NT, 2000, XP, Vista, 7, 8, 10), Macintosh, VMS and -almost all flavours of UNIX. Porting to other systems should not be very -difficult. Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me, Amiga -DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained. +Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, Haiku, VMS and almost +all flavours of UNIX. Porting to other systems should not be very difficult. +Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS, +Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained. +For Vim9 script see [README_VIM9](README_VIM9.md). ## Distribution ## @@ -41,11 +46,11 @@ This `README.md` file comes with the runtime archive. It includes the documentation, syntax files and other files that are used at runtime. To run Vim you must get either one of the binary archives or a source archive. Which one you need depends on the system you want to run it on and whether you -want or must compile it yourself. Check http://www.vim.org/download.php for +want or must compile it yourself. Check https://www.vim.org/download.php for an overview of currently available distributions. Some popular places to get the latest Vim: -* Check out the git repository from [github](https://github.com/vim/vim). +* Check out the git repository from [GitHub](https://github.com/vim/vim). * Get the source code as an [archive](https://github.com/vim/vim/releases). * Get a Windows executable from the [vim-win32-installer](https://github.com/vim/vim-win32-installer/releases) repository. @@ -56,19 +61,20 @@ Some popular places to get the latest Vim: If you obtained a binary distribution you don't need to compile Vim. If you obtained a source distribution, all the stuff for compiling Vim is in the -`src` directory. See `src/INSTALL` for instructions. +[`src`](/src) directory. See [`src/INSTALL`](src/INSTALL) for instructions. ## Installation ## See one of these files for system-specific instructions. Either in the -READMEdir directory (in the repository) or the top directory (if you unpack an -archive): +[READMEdir directory](./READMEdir/) (in the repository) or +the top directory (if you unpack an archive): 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 other `README_*.txt` files, depending on the distribution you used. @@ -80,8 +86,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 +[`runtime/doc/help.txt`](/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`. @@ -89,7 +96,8 @@ Vim. See `:help user-manual`. Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation to help orphans in Uganda. Please read the file -`runtime/doc/uganda.txt` for details (do `:help uganda` inside Vim). +[`runtime/doc/uganda.txt`](runtime/doc/uganda.txt) +for details (do `:help uganda` inside Vim). Summary of the license: There are no restrictions on using or distributing an unmodified copy of Vim. Parts of Vim may also be distributed, but the license @@ -105,30 +113,31 @@ your appreciation for the work and motivate Bram and others 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! +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! For the most recent information about sponsoring look on the Vim web site: - http://www.vim.org/sponsor/ + https://www.vim.org/sponsor/ ## Contributing ## -If you would like to help making Vim better, see the [CONTRIBUTING.md](https://github.com/vim/vim/blob/master/CONTRIBUTING.md) file. +If you would like to help making Vim better, see the +[CONTRIBUTING.md](/CONTRIBUTING.md) file. ## Information ## The latest news about Vim can be found on the Vim home page: - http://www.vim.org/ + https://www.vim.org/ If you have problems, have a look at the Vim documentation or tips: - http://www.vim.org/docs.php - http://vim.wikia.com/wiki/Vim_Tips_Wiki + 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: - http://www.vim.org/maillist.php + https://www.vim.org/maillist.php If nothing else works, report bugs directly: Bram Moolenaar @@ -140,4 +149,9 @@ Send any other comments, patches, flowers and suggestions to: Bram Moolenaar -This is `README.md` for version 8.1 of Vim: Vi IMproved. +This is `README.md` for version 8.2 of Vim: Vi IMproved. + + +## Translations of this README ## + +[Korean](https://github.com/cjw1359/opensource/blob/master/Vim/README_ko.md) diff --git a/README.txt b/README.txt index e0132dc92ad3b..54f207c0d800d 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -README.txt for version 8.1 of Vim: Vi IMproved. +README.txt for version 8.2 of Vim: Vi IMproved. WHAT IS VIM? @@ -16,10 +16,10 @@ All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be mapped to commands by the user, and the mouse can be used. -Vim runs under MS-Windows (NT, 2000, XP, Vista, 7, 8, 10), Macintosh, VMS and -almost all flavours of UNIX. Porting to other systems should not be very -difficult. Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me, Amiga -DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained. +Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, VMS and almost all +flavours of UNIX. Porting to other systems should not be very difficult. +Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS, +Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained. DISTRIBUTION @@ -33,7 +33,7 @@ This README.txt file comes with the runtime archive. It includes the documentation, syntax files and other files that are used at runtime. To run Vim you must get either one of the binary archives or a source archive. Which one you need depends on the system you want to run it on and whether you -want or must compile it yourself. Check "http://www.vim.org/download.php" for +want or must compile it yourself. Check "https://www.vim.org/download.php" for an overview of currently available distributions. Some popular places to get the latest Vim: @@ -101,7 +101,7 @@ increase Bram's motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: - http://www.vim.org/sponsor/ + https://www.vim.org/sponsor/ CONTRIBUTING @@ -112,15 +112,15 @@ If you would like to help making Vim better, see the CONTRIBUTING.md file. INFORMATION The latest news about Vim can be found on the Vim home page: - http://www.vim.org/ + https://www.vim.org/ If you have problems, have a look at the Vim documentation or tips: - http://www.vim.org/docs.php - http://vim.wikia.com/wiki/Vim_Tips_Wiki + 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: - http://www.vim.org/maillist.php + https://www.vim.org/maillist.php If nothing else works, report bugs directly: Bram Moolenaar diff --git a/README_VIM9.md b/README_VIM9.md new file mode 100644 index 0000000000000..b3ca49f091018 --- /dev/null +++ b/README_VIM9.md @@ -0,0 +1,354 @@ +![Vim Logo](https://github.com/vim/vim/blob/master/runtime/vimlogo.gif) + +# What is Vim9? + +This is an experimental side of [Vim](https://github.com/vim/vim). +It explores ways of making Vim script faster and better. + +WARNING: The Vim9 script features are still under development, anything can +break! + +# Why Vim9? + +## 1. FASTER VIM SCRIPT + +The third item on the poll results of 2018, after popup windows and text +properties, is faster Vim script. So how do we do that? + +I have been throwing some ideas around, and soon came to the conclusion +that the current way functions are called and executed, with +dictionaries for the arguments and local variables, is never going to be +very fast. We're lucky if we can make it twice as fast. The overhead +of a function call and executing every line is just too high. + +So what then? We can only make something fast by having a new way of +defining a function, with similar but different properties of the old +way: +* Arguments are only available by name, not through the a: dictionary or + the a:000 list. +* Local variables are not available in an l: dictionary. +* A few more things that slow us down, such as exception handling details. + +I Implemented a "proof of concept" and measured the time to run a simple +for loop with an addition (Justin used this example in his presentation, +full code is below): + +``` vim + let sum = 0 + for i in range(1, 2999999) + let sum += i + endfor +``` + +| how | time in sec | +| --------| -------- | +| Vim old | 5.018541 | +| Python | 0.369598 | +| Lua | 0.078817 | +| LuaJit | 0.004245 | +| Vim new | 0.073595 | + +That looks very promising! It's just one example, but it shows how much +we can gain, and also that Vim script can be faster than builtin +interfaces. + +LuaJit is much faster at Lua-only instructions. In practice the script would +not do something useless as counting but change the text. For example, +reindent all the lines: + +``` vim + let totallen = 0 + for i in range(1, 100000) + call setline(i, ' ' .. getline(i)) + let totallen += len(getline(i)) + endfor +``` + +| how | time in sec | +| --------| -------- | +| Vim old | 0.578598 | +| Python | 0.152040 | +| Lua | 0.164917 | +| LuaJit | 0.128400 | +| Vim new | 0.079692 | + +[These times were measured on a different system by Dominique Pelle] + +The differences are smaller, but Vim 9 script is clearly the fastest. +Using LuaJIT is only a little bit faster than plain Lua here, clearly the call +back to the Vim code is costly. + +How does Vim9 script work? The function is first compiled into a sequence of +instructions. Each instruction has one or two parameters and a stack is +used to store intermediate results. Local variables are also on the +stack, space is reserved during compilation. This is a fairly normal +way of compilation into an intermediate format, specialized for Vim, +e.g. each stack item is a typeval_T. And one of the instructions is +"execute Ex command", for commands that are not compiled. + + +## 2. DEPRIORITIZE INTERFACES + +Attempts have been made to implement functionality with built-in script +languages such as Python, Perl, Lua, Tcl and Ruby. This never gained much +foothold, for various reasons. + +Instead of using script language support in Vim: +* Encourage implementing external tools in any language and communicate + with them. The job and channel support already makes this possible. + Really any language can be used, also Java and Go, which are not + available built-in. +* No priority for the built-in language interfaces. They will have to be kept + for backwards compatibility, but many users won't need a Vim build with these + interfaces. +* Improve the Vim script language, it is used to communicate with the external + tool and implements the Vim side of the interface. Also, it can be used when + an external tool is undesired. + +Altogether this creates a clear situation: Vim with the +eval feature +will be sufficient for most plugins, while some plugins require +installing a tool that can be written in any language. No confusion +about having Vim but the plugin not working because some specific +language is missing. This is a good long term goal. + +Rationale: Why is it better to run a tool separately from Vim than using a +built-in interface and interpreter? Take for example something that is +written in Python: +* The built-in interface uses the embedded python interpreter. This is less + well maintained than the python command. Building Vim with it requires + installing developer packages. If loaded dynamically there can be a version + mismatch. +* When running the tool externally the standard python command can be used, + which is quite often available by default or can be easily installed. +* The built-in interface has an API that is unique for Vim with Python. This is + an extra API to learn. +* A .py file can be compiled into a .pyc file and execute much faster. +* Inside Vim multi-threading can cause problems, since the Vim core is single + threaded. In an external tool there are no such problems. +* The Vim part is written in .vim files, the Python part is in .py files, this + is nicely separated. +* Disadvantage: An interface needs to be made between Vim and Python. + JSON is available for this, and it's fairly easy to use. But it still + requires implementing asynchronous communication. + + +## 3. BETTER VIM SCRIPT + +To make Vim faster a new way of defining a function needs to be added. +While we are doing that, since the lines in this function won't be fully +backwards compatible anyway, we can also make Vim script easier to use. +In other words: "less weird". Making it work more like modern +programming languages will help. No surprises. + +A good example is how in a function the arguments are prefixed with +"a:". No other language I know does that, so let's drop it. + +Taking this one step further is also dropping "s:" for script-local variables; +everything at the script level is script-local by default. Since this is not +backwards compatible it requires a new script style: Vim9 script! + +To avoid having more variations, the syntax inside a compiled function is the +same as in Vim9 script. Thus you have legacy syntax and Vim9 syntax. + +It should be possible to convert code from other languages to Vim +script. We can add functionality to make this easier. This still needs +to be discussed, but we can consider adding type checking and a simple +form of classes. If you look at JavaScript for example, it has gone +through these stages over time, adding real class support and now +TypeScript adds type checking. But we'll have to see how much of that +we actually want to include in Vim script. Ideally a conversion tool +can take Python, JavaScript or TypeScript code and convert it to Vim +script, with only some things that cannot be converted. + +Vim script won't work the same as any specific language, but we can use +mechanisms that are commonly known, ideally with the same syntax. One +thing I have been thinking of is assignments without ":let". I often +make that mistake (after writing JavaScript especially). I think it is +possible, if we make local variables shadow commands. That should be OK, +if you shadow a command you want to use, just rename the variable. +Using "var" and "const" to declare a variable, like in JavaScript and +TypeScript, can work: + + +``` vim +def MyFunction(arg: number): number + var local = 1 + var todo = arg + const ADD = 88 + while todo > 0 + local += ADD + todo -= 1 + endwhile + return local +enddef +``` + +The similarity with JavaScript/TypeScript can also be used for dependencies +between files. Vim currently uses the `:source` command, which has several +disadvantages: +* In the sourced script, is not clear what it provides. By default all + functions are global and can be used elsewhere. +* In a script that sources other scripts, it is not clear what function comes + from what sourced script. Finding the implementation is a hassle. +* Prevention of loading the whole script twice must be manually implemented. + +We can use the `:import` and `:export` commands from the JavaScript standard to +make this much better. For example, in script "myfunction.vim" define a +function and export it: + +``` vim +vim9script " Vim9 script syntax used here + +var local = 'local variable is not exported, script-local' + +export def MyFunction() " exported function +... + +def LocalFunction() " not exported, script-local +... +``` + +And in another script import the function: + +``` vim +vim9script " Vim9 script syntax used here + +import MyFunction from 'myfunction.vim' +``` + +This looks like JavaScript/TypeScript, thus many users will understand the +syntax. + +These are ideas, this will take time to design, discuss and implement. +Eventually this will lead to Vim 9! + + +## Code for sum time measurements + +Vim was build with -O2. + +``` vim +func VimOld() + let sum = 0 + for i in range(1, 2999999) + let sum += i + endfor + return sum +endfunc + +func Python() + py3 << END +sum = 0 +for i in range(1, 3000000): + sum += i +END + return py3eval('sum') +endfunc + +func Lua() + lua << END + sum = 0 + for i = 1, 2999999 do + sum = sum + i + end +END + return luaeval('sum') +endfunc + +def VimNew(): number + var sum = 0 + for i in range(1, 2999999) + sum += i + endfor + return sum +enddef + +let start = reltime() +echo VimOld() +echo 'Vim old: ' .. reltimestr(reltime(start)) + +let start = reltime() +echo Python() +echo 'Python: ' .. reltimestr(reltime(start)) + +let start = reltime() +echo Lua() +echo 'Lua: ' .. reltimestr(reltime(start)) + +let start = reltime() +echo VimNew() +echo 'Vim new: ' .. reltimestr(reltime(start)) +``` + +## Code for indent time measurements + +``` vim +def VimNew(): number + var totallen = 0 + for i in range(1, 100000) + setline(i, ' ' .. getline(i)) + totallen += len(getline(i)) + endfor + return totallen +enddef + +func VimOld() + let totallen = 0 + for i in range(1, 100000) + call setline(i, ' ' .. getline(i)) + let totallen += len(getline(i)) + endfor + return totallen +endfunc + +func Lua() + lua << END + b = vim.buffer() + totallen = 0 + for i = 1, 100000 do + b[i] = " " .. b[i] + totallen = totallen + string.len(b[i]) + end +END + return luaeval('totallen') +endfunc + +func Python() + py3 << END +cb = vim.current.buffer +totallen = 0 +for i in range(0, 100000): + cb[i] = ' ' + cb[i] + totallen += len(cb[i]) +END + return py3eval('totallen') +endfunc + +new +call setline(1, range(100000)) +let start = reltime() +echo VimOld() +echo 'Vim old: ' .. reltimestr(reltime(start)) +bwipe! + +new +call setline(1, range(100000)) +let start = reltime() +echo Python() +echo 'Python: ' .. reltimestr(reltime(start)) +bwipe! + +new +call setline(1, range(100000)) +let start = reltime() +echo Lua() +echo 'Lua: ' .. reltimestr(reltime(start)) +bwipe! + +new +call setline(1, range(100000)) +let start = reltime() +echo VimNew() +echo 'Vim new: ' .. reltimestr(reltime(start)) +bwipe! +``` diff --git a/READMEdir/Contents b/READMEdir/Contents index 822eb2c5d9c08..c8107bb22424a 100644 --- a/READMEdir/Contents +++ b/READMEdir/Contents @@ -9,10 +9,10 @@ Vim Vi IMproved. A clone of the UNIX text editor Vi. Very useful messages, shows current file name in window title, on-line help, rectangular cut/paste, etc., etc., etc... - Version 8.1. Also runs under UNIX, MS-Windows, Mac, etc. - vim81rt.tgz contains the documentation and syntax files. - vim81bin.tgz contains the binaries. - vim81src.tgz contains the sources. + Version 8.2. Also runs under UNIX, MS-Windows, Mac, etc. + vim82rt.tgz contains the documentation and syntax files. + vim82bin.tgz contains the binaries. + vim82src.tgz contains the sources. Author: Bram Moolenaar et al. diff --git a/READMEdir/README_ami.txt b/READMEdir/README_ami.txt index fc9a30d428520..7ea4332767250 100644 --- a/READMEdir/README_ami.txt +++ b/READMEdir/README_ami.txt @@ -1,4 +1,4 @@ -README_ami.txt for version 8.1 of Vim: Vi IMproved. +README_ami.txt for version 8.2 of Vim: Vi IMproved. This file explains the installation of Vim on Amiga systems. See README.txt for general information about Vim. @@ -16,8 +16,8 @@ easily upgrade to a new version. For example: You would then unpack the archives like this: cd dh0:editors - tar xf t:vim81bin.tar - tar xf t:vim81rt.tar + tar xf t:vim82bin.tar + tar xf t:vim82rt.tar Set the $VIM environment variable to point to the top directory of your Vim files. For the above example: diff --git a/READMEdir/README_amibin.txt b/READMEdir/README_amibin.txt index 5b9b02f926e2a..962567d58f767 100644 --- a/READMEdir/README_amibin.txt +++ b/READMEdir/README_amibin.txt @@ -1,8 +1,8 @@ -README_amibin.txt for version 8.1 of Vim: Vi IMproved. +README_amibin.txt for version 8.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. -These files are in the runtime archive (vim81rt.tgz). +These files are in the runtime archive (vim82rt.tgz). The Amiga "bin" archive contains the Vim executable for the Amiga. It was diff --git a/READMEdir/README_amisrc.txt b/READMEdir/README_amisrc.txt index 966bd34088dd3..6c4f76cf4b0b4 100644 --- a/READMEdir/README_amisrc.txt +++ b/READMEdir/README_amisrc.txt @@ -1,8 +1,8 @@ -README_amisrc.txt for version 8.1 of Vim: Vi IMproved. +README_amisrc.txt for version 8.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. -These files are in the runtime archive (vim81rt.tgz). +These files are in the runtime archive (vim82rt.tgz). The Amiga source archive contains the files needed to compile Vim on the diff --git a/READMEdir/README_bindos.txt b/READMEdir/README_bindos.txt index 7d10a6ffcca5d..d16c8d8002c6c 100644 --- a/READMEdir/README_bindos.txt +++ b/READMEdir/README_bindos.txt @@ -1,16 +1,16 @@ -README_bindos.txt for version 8.1 of Vim: Vi IMproved. +README_bindos.txt for version 8.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. -These files are in the runtime archive (vim81rt.zip). +These files are in the runtime archive (vim82rt.zip). There are several binary distributions of Vim for the PC. You would normally pick only one of them, but it's also possible to install several. These ones are available (the version number may differ): - vim81w32.zip Windows 95/98/NT/etc. console version - gvim81.zip Windows 95/98/NT/etc. GUI version - gvim81ole.zip Windows 95/98/NT/etc. GUI version with OLE + vim82w32.zip Windows 95/98/NT/etc. console version + gvim82.zip Windows 95/98/NT/etc. GUI version + gvim82ole.zip Windows 95/98/NT/etc. GUI version with OLE -You MUST also get the runtime archive (vim81rt.zip). -The sources are also available (vim81src.zip). +You MUST also get the runtime archive (vim82rt.zip). +The sources are also available (vim82src.zip). diff --git a/READMEdir/README_dos.txt b/READMEdir/README_dos.txt index ac6f090afed9d..3f086121bcbbf 100644 --- a/READMEdir/README_dos.txt +++ b/READMEdir/README_dos.txt @@ -1,6 +1,6 @@ -README_dos.txt for version 8.1 of Vim: Vi IMproved. +README_dos.txt for version 8.2 of Vim: Vi IMproved. -This file explains the installation of Vim on MS-DOS and MS-Windows systems. +This file explains the installation of Vim on MS-Windows systems. See "README.txt" for general information about Vim. There are two ways to install Vim: @@ -41,19 +41,19 @@ These are the normal steps to install Vim from the .zip archives: located. Check the $VIM setting to see where it points to: set VIM For example, if you have - C:\vim\vim81 + C:\vim\vim82 do cd C:\ Binary and runtime Vim archives are normally unpacked in the same location, on top of each other. -2. Unpack the zip archives. This will create a new directory "vim\vim81", +2. Unpack the zip archives. This will create a new directory "vim\vim82", in which all the distributed Vim files are placed. Since the directory name includes the version number, it is unlikely that you overwrite existing files. Examples: - pkunzip -d gvim81.zip - unzip vim81w32.zip + pkunzip -d gvim82.zip + unzip vim82w32.zip You need to unpack the runtime archive and at least one of the binary archives. When using more than one binary version, be careful not to @@ -64,12 +64,8 @@ These are the normal steps to install Vim from the .zip archives: to another location. That is where they will stay, the install program won't move or copy the runtime files. - Only for the 32 bit DOS version on MS-DOS without DPMI support (trying to - run install.exe will produce an error message): Unpack the CSDPMI4B.ZIP - archive and follow the instructions in the documentation. - 3. Change to the new directory: - cd vim\vim81 + cd vim\vim82 Run the "install.exe" program. It will ask you a number of questions about how you would like to have your Vim setup. Among these are: - You can tell it to write a "_vimrc" file with your preferences in the @@ -80,8 +76,8 @@ These are the normal steps to install Vim from the .zip archives: console or in a shell. You can select one of the directories in your $PATH. If you skip this, you can add Vim to the search path manually: The simplest is to add a line to your autoexec.bat. Examples: - set path=%path%;C:\vim\vim81 - set path=%path%;D:\editors\vim\vim81 + set path=%path%;C:\vim\vim82 + set path=%path%;D:\editors\vim\vim82 - Create entries for Vim on the desktop and in the Start menu. That's it! @@ -93,8 +89,8 @@ Remarks: won't show a menubar. Then you need to set the $VIM environment variable to point to the top directory of your Vim files. Example: set VIM=C:\editors\vim - Vim version 8.1 will look for your vimrc file in $VIM, and for the runtime - files in $VIM/vim81. See ":help $VIM" for more information. + Vim version 8.2 will look for your vimrc file in $VIM, and for the runtime + files in $VIM/vim82. See ":help $VIM" for more information. - To avoid confusion between distributed files of different versions and your own modified vim scripts, it is recommended to use this directory layout: @@ -105,14 +101,14 @@ Remarks: C:\vim\vimfiles\ftplugin\*.vim Filetype plugins C:\vim\... Other files you made. Distributed files: - C:\vim\vim81\vim.exe The Vim version 8.1 executable. - C:\vim\vim81\doc\*.txt The version 8.1 documentation files. - C:\vim\vim81\bugreport.vim A Vim version 8.1 script. - C:\vim\vim81\... Other version 8.1 distributed files. + C:\vim\vim82\vim.exe The Vim version 8.2 executable. + C:\vim\vim82\doc\*.txt The version 8.2 documentation files. + C:\vim\vim82\bugreport.vim A Vim version 8.2 script. + C:\vim\vim82\... Other version 8.2 distributed files. In this case the $VIM environment variable would be set like this: set VIM=C:\vim - Then $VIMRUNTIME will automatically be set to "$VIM\vim81". Don't add - "vim81" to $VIM, that won't work. + Then $VIMRUNTIME will automatically be set to "$VIM\vim82". Don't add + "vim82" to $VIM, that won't work. - You can put your Vim executable anywhere else. If the executable is not with the other Vim files, you should set $VIM. The simplest is to add a line @@ -121,7 +117,7 @@ Remarks: set VIM=d:\editors\vim - If you have told the "install.exe" program to add the "Edit with Vim" menu - entry, you can remove it by running the "uninstal.exe". See + entry, you can remove it by running the "uninstall.exe". See ":help win32-popup-menu". - In Windows 95/98/NT you can create a shortcut to Vim. This works for all @@ -136,8 +132,8 @@ Remarks: Select Properties. 5. In the Program tab, change the "Cmdline" to add "/c" and the name of the Vim executable. Examples: - C:\command.com /c C:\vim\vim81\vim.exe - C:\command.com /c D:\editors\vim\vim81\vim.exe + C:\command.com /c C:\vim\vim82\vim.exe + C:\command.com /c D:\editors\vim\vim82\vim.exe 6. Select the font, window size, etc. that you like. If this isn't possible, select "Advanced" in the Program tab, and deselect "MS-DOS mode". @@ -150,5 +146,4 @@ Remarks: For further information, type one of these inside Vim: :help dos - :help msdos :help win32 diff --git a/READMEdir/README_extra.txt b/READMEdir/README_extra.txt index ce629b2d64e70..94d93f986b0c7 100644 --- a/READMEdir/README_extra.txt +++ b/READMEdir/README_extra.txt @@ -1,4 +1,4 @@ -README_extra.txt for version 8.1 of Vim: Vi IMproved. +README_extra.txt for version 8.2 of Vim: Vi IMproved. These extra files of Vim are for special purposes. This README explains what the files are for. For general information about Vim, see the "README.txt" @@ -13,20 +13,11 @@ src/if_sniff.* Interface to SNiFF. If you don't know what SNiFF is, src/os_amiga.* Files for the Amiga port. -src/gui_beos.* -src/os_beos.* Files for the BeOS port. - src/os_msdos.* src/os_dos.* Files for the MS-DOS port. -src/gui_mac.* src/os_mac.* Files for the Mac port. -src/os_mint.8 Files for the Atari Mint port. - -src/os_os2* Files for the OS/2 port. -src/tee/* Extra program for OS/2. - src/os_vms* Files for the VMS port. src/os_w32* @@ -35,7 +26,6 @@ src/os_win32.* Files for the Win32 port. src/gui_w32.* Files for the Win32 GUI. src/gui_w48.* Files for the Win32 and Win16 GUI. src/Make_mvc.mak MS Visual C++ makefile for the Win32 GUI. -runtime/rgb.txt File with color definitions for the Win32 GUI. src/if_ole.* OLE automation interface, for MS Windows 95 and NT. diff --git a/READMEdir/README_haiku.txt b/READMEdir/README_haiku.txt new file mode 100644 index 0000000000000..860b40b0d7112 --- /dev/null +++ b/READMEdir/README_haiku.txt @@ -0,0 +1,13 @@ +README_haiku.txt for version 8.2 of Vim: Vi IMproved. + +This file explains the installation of Vim on Haiku operating system. +See "README.txt" for general information about Vim. + +Preferred (and easy) way to get Vim on Haiku is to use default Haiku +software repository HaikuPorts. To get Vim: + +- Open HaikuDepot application and search for "vim" package, then install, +- Open a Terminal and type "pkgman install vim", then follow instructions. + +If you prefer to install Vim from source, follow the instructions on +"runtime/doc/os_haiku.txt", "Compiling Vim" section. diff --git a/READMEdir/README_mac.txt b/READMEdir/README_mac.txt index d76a11adb9e42..4edd55cd38a80 100644 --- a/READMEdir/README_mac.txt +++ b/READMEdir/README_mac.txt @@ -1,28 +1,12 @@ -README_mac.txt for version 8.1 of Vim: Vi IMproved. +README_mac.txt for version 8.2 of Vim: Vi IMproved. -This file explains the installation of Vim on Macintosh systems. +This file explains the installation of Vim on MacOS systems. See "README.txt" for general information about Vim. +To build from source get the files with git from https://github.com/vim/vim. +The find the instructions in src/INSTALLmac.txt. -To build from sources, like on Unix - -1. Get the build tools: "clang" and "make". These can be installed with the - "CommandLineTools" package. If you don't have one, do - xcode-select --install - Just like for any software development with OS X. - -2. Get the source code. Best is to use git (which you need to install first), - see http://www.vim.org/git.php - Or you can download and unpack the Unix tar archive, see - http://www.vim.org/download.php - -3. Go to the top directory of the source tree, do - make - sudo make install - A newly built vim will be installed under "/usr/local". - - -If you can't manage to make this work, there is a fallback using Homebrew: - +Installing Vim using Homebrew: 1. Install Homebrew from http://brew.sh/ -2. Install latest Vim with: brew install vim +2. Install the latest Vim with: + brew install vim diff --git a/READMEdir/README_ole.txt b/READMEdir/README_ole.txt index 4c7e645438b13..839dd6aeef446 100644 --- a/READMEdir/README_ole.txt +++ b/READMEdir/README_ole.txt @@ -1,4 +1,4 @@ -README_ole.txt for version 8.1 of Vim: Vi IMproved. +README_ole.txt for version 8.2 of Vim: Vi IMproved. This archive contains gvim.exe with OLE interface and VisVim. This version of gvim.exe can also load a number of interface dynamically (you diff --git a/READMEdir/README_os2.txt b/READMEdir/README_os2.txt index 7d9c5ce77ff89..3a9cdf14c0f99 100644 --- a/READMEdir/README_os2.txt +++ b/READMEdir/README_os2.txt @@ -1,4 +1,4 @@ -README_os2.txt for version 8.1 of Vim: Vi IMproved. +README_os2.txt for version 8.2 of Vim: Vi IMproved. This file used to explain the installation of Vim on OS/2 systems. However, support for OS/2 has been removed in patch 7.4.1008. diff --git a/READMEdir/README_os390.txt b/READMEdir/README_os390.txt index e0a0bdb6ba864..360149532cc7c 100644 --- a/READMEdir/README_os390.txt +++ b/READMEdir/README_os390.txt @@ -1,4 +1,4 @@ -README_os390.txt for version 8.1 of Vim: Vi IMproved. +README_os390.txt for version 8.2 of Vim: Vi IMproved. This readme explains how to build Vim on z/OS. Formerly called OS/390. See "README.txt" for general information about Vim. diff --git a/READMEdir/README_src.txt b/READMEdir/README_src.txt index 89b83570e1afa..935830fe98fa4 100644 --- a/READMEdir/README_src.txt +++ b/READMEdir/README_src.txt @@ -1,8 +1,8 @@ -README_src.txt for version 8.1 of Vim: Vi IMproved. +README_src.txt for version 8.2 of Vim: Vi IMproved. The source archive contains the files needed to compile Vim on Unix systems. It is packed for Unix systems (NL line separator). For more information, see the README.txt file that comes with the runtime -archive (vim-8.1-rt.tar.gz). To be able to run Vim you MUST get the runtime +archive (vim-8.2-rt.tar.gz). To be able to run Vim you MUST get the runtime archive too! diff --git a/READMEdir/README_srcdos.txt b/READMEdir/README_srcdos.txt index 6acb65265acaf..ca016bd72955a 100644 --- a/READMEdir/README_srcdos.txt +++ b/READMEdir/README_srcdos.txt @@ -1,12 +1,12 @@ -README_srcdos.txt for version 8.1 of Vim: Vi IMproved. +README_srcdos.txt for version 8.2 of Vim: Vi IMproved. See "README.txt" for general information about Vim. -See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. -These files are in the runtime archive (vim81rt.zip). +See "README_dos.txt" for installation instructions for MS-Windows. +These files are in the runtime archive (vim82rt.zip). -The DOS source archive contains the files needed to compile Vim on MS-DOS or -MS-Windows. It is packed for DOS systems, with CR-LF. It also includes the -VisVim sources. +The DOS source archive contains the files needed to compile Vim on MS-Windows. +It is packed for MS-Windows systems, with CR-LF. It also includes the VisVim +sources. See "src/INSTALLpc.txt" for instructions on how to compile Vim on the PC. diff --git a/READMEdir/README_unix.txt b/READMEdir/README_unix.txt index ab8d18848f5b3..4ed11f01d41ea 100644 --- a/READMEdir/README_unix.txt +++ b/READMEdir/README_unix.txt @@ -1,4 +1,4 @@ -README_unix.txt for version 8.1 of Vim: Vi IMproved. +README_unix.txt for version 8.2 of Vim: Vi IMproved. This file explains the installation of Vim on Unix systems. See "README.txt" for general information about Vim. diff --git a/READMEdir/README_vms.txt b/READMEdir/README_vms.txt index c1c76137a94bb..d38fa983ed2a6 100644 --- a/READMEdir/README_vms.txt +++ b/READMEdir/README_vms.txt @@ -1,4 +1,4 @@ -README_vms.txt for version 8.1 of Vim: Vi IMproved. +README_vms.txt for version 8.2 of Vim: Vi IMproved. This file explains the installation of Vim on VMS systems. See "README.txt" in the runtime archive for information about Vim. diff --git a/READMEdir/README_w32s.txt b/READMEdir/README_w32s.txt index c4f9a0cecf69c..742a6551baf3a 100644 --- a/READMEdir/README_w32s.txt +++ b/READMEdir/README_w32s.txt @@ -1,15 +1,6 @@ -README_w32s.txt for version 8.1 of Vim: Vi IMproved. +README_w32s.txt for version 8.2 of Vim: Vi IMproved. -This archive contains the gvim.exe that was specifically compiled for use in -the Win32s subsystem in MS-Windows 3.1 and 3.11. - -Also see the README_bindos.txt, README_dos.txt and README.txt files. - -Be careful not to overwrite the Win32s gvim.exe with the another gvim.exe when -unpacking another binary archive! Check the output of ":version": - Win32s - "MS-Windows 16/32 bit GUI version" - Win32 - "MS-Windows 32 bit GUI version" -Win32 with OLE - "MS-Windows 32 bit GUI version with OLE support" - -For further information, type this inside Vim: - :help win32s +This file used to explain the installation of Vim on MS-Windows 3.1 and 3.11 +systems. However, support for MS-Windows 3.1 and 3.11 has been removed in +patch 7.4.1364. +See "README.txt" for general information about Vim. diff --git a/build_vim_xcframework.sh b/build_vim_xcframework.sh index d3c9f7144ed4c..9de06ab601b0e 100755 --- a/build_vim_xcframework.sh +++ b/build_vim_xcframework.sh @@ -15,7 +15,7 @@ ln -s Frameworks_iOS Frameworks make distclean # 1) configure # --enable-terminal -./configure vim_cv_toupper_broken=no vim_cv_terminfo=no vim_cv_tgetent=zero vim_cv_memmove_handles_overlap=no vim_cv_memcpy_handles_overlap=no vim_cv_bcopy_handles_overlap=no vim_cv_tty_group=world vim_cv_stat_ignores_slash=yes vim_cv_getcwd_broken=no LUA_PREFIX=${PWD} vi_cv_path_plain_lua=/usr/bin/lua vi_cv_version_plain_lua=5.3.4 --with-tlib=ncurses --with-features=big --enable-luainterp --enable-python3interp --with-python3-command=python3 CC=clang CXX=clang++ CFLAGS="-DEXITFREE -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -fembed-bitcode -DDYNAMIC_PYTHON3" CPPFLAGS="-DEXITFREE -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -DDYNAMIC_PYTHON3" CXXFLAGS="-DEXITFREE -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -fembed-bitcode -DDYNAMIC_PYTHON3" LDFLAGS="-shared -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -F$FRAMEWORKS -framework ios_system " --build=x86_64-apple-darwin --host=armv7-apple-darwin +./configure vim_cv_toupper_broken=no vim_cv_terminfo=no vim_cv_tgetent=zero vim_cv_memmove_handles_overlap=no vim_cv_memcpy_handles_overlap=no vim_cv_bcopy_handles_overlap=no vim_cv_tty_group=world vim_cv_stat_ignores_slash=yes vim_cv_getcwd_broken=no LUA_PREFIX=${PWD} vi_cv_path_plain_lua=/usr/bin/lua vi_cv_version_plain_lua=5.4.4 --with-tlib=ncurses --with-features=big --enable-luainterp --enable-python3interp --with-python3-command=python3 CC=clang CXX=clang++ CFLAGS="-DEXITFREE -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -fembed-bitcode -DDYNAMIC_PYTHON3" CPPFLAGS="-DEXITFREE -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -DDYNAMIC_PYTHON3" CXXFLAGS="-DEXITFREE -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -fembed-bitcode -DDYNAMIC_PYTHON3" LDFLAGS="-shared -arch arm64 -O2 -miphoneos-version-min=14.0 -isysroot $IOS_SDKROOT -F$FRAMEWORKS -framework ios_system " --build=x86_64-apple-darwin --host=armv7-apple-darwin # 2) make. This creates ./src/vim, a Mach-O 64-bit dynamically linked shared library for arm64. make diff --git a/ci/appveyor.bat b/ci/appveyor.bat index 18007472471ed..92ec936f98ece 100644 --- a/ci/appveyor.bat +++ b/ci/appveyor.bat @@ -5,44 +5,38 @@ setlocal ENABLEDELAYEDEXPANSION cd %APPVEYOR_BUILD_FOLDER% cd src -echo "Building MinGW 32bit console version" -set PATH=c:\msys64\mingw32\bin;%PATH% -mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 -:: Save vim.exe before Make clean, moved back below. -copy vim.exe testdir -mingw32-make.exe -f Make_ming.mak clean - -:: Build Mingw huge version with python and channel support, or -:: with specified features without python. -echo "Building MinGW 32bit GUI version" -if "%FEATURE%" == "HUGE" ( - mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1 -) ELSE ( - mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 -) -.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt - -:: Filter out the progress bar from the build log -sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak echo "Building MSVC 64bit console Version" -nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 -nmake -f Make_mvc2.mak clean +nmake -f Make_mvc.mak CPU=AMD64 ^ + OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^ + FEATURES=%FEATURE% +if not exist vim.exe ( + echo Build failure. + exit 1 +) :: build MSVC huge version with python and channel support :: GUI needs to be last, so that testing works echo "Building MSVC 64bit GUI Version" if "%FEATURE%" == "HUGE" ( - nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1 + nmake -f Make_mvc.mak CPU=AMD64 ^ + OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^ + PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^ + PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 ^ + FEATURES=%FEATURE% ) ELSE ( - nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 + nmake -f Make_mvc.mak CPU=AMD64 ^ + OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^ + FEATURES=%FEATURE% +) +if not exist gvim.exe ( + echo Build failure. + exit 1 ) -.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt +.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt || exit 1 -:: Restore vim.exe, tests will run with this. -move /Y testdir\vim.exe . -echo "version output MinGW" -type ver_ming.txt -echo "version output MVC" -type ver_msvc.txt +echo "version output MSVC console" +.\vim --version || exit 1 +echo "version output MSVC GUI" +type ver_msvc.txt || exit 1 cd .. diff --git a/ci/build-snd-dummy.sh b/ci/build-snd-dummy.sh new file mode 100644 index 0000000000000..a2380b4b16a27 --- /dev/null +++ b/ci/build-snd-dummy.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -eu + +LINUX_VERSION=$(uname -r | cut -d. -f1-2) +LINUX_ARCHIVE_FILE=v${LINUX_VERSION}.tar.gz +LINUX_SOURCE_DIR=linux-${LINUX_VERSION} + +mkdir -p "${TMPDIR}" +cd "${TMPDIR}" + +wget -q "https://github.com/torvalds/linux/archive/$%7BLINUX_ARCHIVE_FILE%7D" + +tar -xf "${LINUX_ARCHIVE_FILE}" "${LINUX_SOURCE_DIR}/sound" +cd "${LINUX_SOURCE_DIR}/sound" + +CC=gcc make -C "/lib/modules/$(uname -r)/build" M="${PWD}" CONFIG_SOUND=m CONFIG_SND=m CONFIG_SND_PCM=m CONFIG_SND_DUMMY=m modules + +mkdir -p "${SND_DUMMY_DIR}" +cp soundcore.ko core/snd.ko core/snd-pcm.ko drivers/snd-dummy.ko "${SND_DUMMY_DIR}" diff --git a/ci/config.mk.clang-12.sed b/ci/config.mk.clang-12.sed new file mode 100644 index 0000000000000..810b723c7fa70 --- /dev/null +++ b/ci/config.mk.clang-12.sed @@ -0,0 +1,3 @@ +# Clang 12 (or Apple clang 13) and later makes a warning '-Wcompound-token-split-by-macro' enable by default. +/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/ +/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/ diff --git a/ci/config.mk.clang.sed b/ci/config.mk.clang.sed new file mode 100644 index 0000000000000..9dc271c54bee1 --- /dev/null +++ b/ci/config.mk.clang.sed @@ -0,0 +1,2 @@ +/^CFLAGS[[:blank:]]*=/s/$/ -Wno-error=missing-field-initializers/ +/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unknown-attributes -Wno-error=ignored-attributes/ diff --git a/ci/config.mk.gcc.sed b/ci/config.mk.gcc.sed new file mode 100644 index 0000000000000..f46e488488fd4 --- /dev/null +++ b/ci/config.mk.gcc.sed @@ -0,0 +1 @@ +/^CFLAGS[[:blank:]]*=/s/$/ -Wno-error=maybe-uninitialized/ diff --git a/ci/config.mk.sed b/ci/config.mk.sed new file mode 100644 index 0000000000000..51e7ec903d991 --- /dev/null +++ b/ci/config.mk.sed @@ -0,0 +1,3 @@ +/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Werror/ +/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function/ +/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter/ diff --git a/ci/if_ver-1.vim b/ci/if_ver-1.vim new file mode 100644 index 0000000000000..adc40a7cb0b5e --- /dev/null +++ b/ci/if_ver-1.vim @@ -0,0 +1,25 @@ +" Print all interface versions for Ubuntu. Part 1. + +if 1 + execute 'source' expand(':h') .. '/if_ver-cmd.vim' + + echo "*** Interface versions ***\n" + + echo 'Lua:' + PrintVer lua print(vim.lua_version, jit and "(LuaJIT)" or "") + + echo 'MzScheme:' + PrintVer mzscheme (display (version)) + + echo 'Perl:' + PrintVer perl print $^V + + echo 'Ruby:' + PrintVer ruby print RUBY_VERSION + + echo 'Tcl:' + PrintVer tcl puts [info patchlevel] + + echo 'Python 2:' + PrintVer python print sys.version +endif diff --git a/ci/if_ver-2.vim b/ci/if_ver-2.vim new file mode 100644 index 0000000000000..83e80e48fff8c --- /dev/null +++ b/ci/if_ver-2.vim @@ -0,0 +1,8 @@ +" Print py3 interface versions for Ubuntu. Part 2. + +if 1 + execute 'source' expand(':h') .. '/if_ver-cmd.vim' + + echo 'Python 3:' + PrintVer python3 print(sys.version) +endif diff --git a/ci/if_ver-cmd.vim b/ci/if_ver-cmd.vim new file mode 100644 index 0000000000000..ac5d82a054b51 --- /dev/null +++ b/ci/if_ver-cmd.vim @@ -0,0 +1,12 @@ +" Provide 'PrintVer' command to print the interface versions. + +func s:print_ver(lang, ...) + if has(a:lang) + exec a:lang join(a:000) + else + echo 'N/A' + endif + echo '' +endfunc + +command -nargs=+ PrintVer call print_ver() diff --git a/ci/load-snd-dummy.sh b/ci/load-snd-dummy.sh new file mode 100644 index 0000000000000..b0101b0f8a195 --- /dev/null +++ b/ci/load-snd-dummy.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +if ! modprobe snd-dummy; then + # snd-dummy is contained in linux-modules-extra (if exists) + apt-get install -yq --no-install-suggests --no-install-recommends "linux-modules-extra-$(uname -r)" + modprobe snd-dummy +fi diff --git a/ci/setup-xvfb.sh b/ci/setup-xvfb.sh new file mode 100644 index 0000000000000..cfc0f97bba4ca --- /dev/null +++ b/ci/setup-xvfb.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +apt-get install -y xvfb + +cat </etc/systemd/system/xvfb.service +[Unit] +Description=X Virtual Frame Buffer Service +After=network.target +[Service] +ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24 +[Install] +WantedBy=multi-user.target +EOT + +systemctl enable xvfb.service +systemctl start xvfb.service diff --git a/include/lapi.h b/include/lapi.h index 6d36dee3fb788..9e99cc44824df 100644 --- a/include/lapi.h +++ b/include/lapi.h @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ +** $Id: lapi.h $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ @@ -11,14 +11,39 @@ #include "llimits.h" #include "lstate.h" + +/* Increments 'L->top', checking for stack overflows */ #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ "stack overflow");} + +/* +** If a call returns too many multiple returns, the callee may not have +** stack space to accommodate all results. In this case, this macro +** increases its stack space ('L->ci->top'). +*/ #define adjustresults(L,nres) \ - { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } + { if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } + +/* Ensure the stack has at least 'n' elements */ #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ "not enough elements in the stack") +/* +** To reduce the overhead of returning from C functions, the presence of +** to-be-closed variables in these functions is coded in the CallInfo's +** field 'nresults', in a way that functions with no to-be-closed variables +** with zero, one, or "all" wanted results have no overhead. Functions +** with other number of wanted results, as well as functions with +** variables to be closed, have an extra check. +*/ + +#define hastocloseCfunc(n) ((n) < LUA_MULTRET) + +/* Map [-1, inf) (range of 'nresults') into (-inf, -2] */ +#define codeNresults(n) (-(n) - 3) +#define decodeNresults(n) (-(n) - 3) + #endif diff --git a/include/lauxlib.h b/include/lauxlib.h index d7c77899b1c7a..c950d038e4124 100644 --- a/include/lauxlib.h +++ b/include/lauxlib.h @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.131 2016/12/06 14:54:31 roberto Exp $ +** $Id: lauxlib.h $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -12,9 +12,17 @@ #include #include +#include "luaconf.h" #include "lua.h" +#include "ios_error.h" +/* global table */ +#define LUA_GNAME "_G" + + +typedef struct luaL_Buffer luaL_Buffer; + /* extra error code for 'luaL_loadfilex' */ #define LUA_ERRFILE (LUA_ERRERR+1) @@ -44,6 +52,7 @@ LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len); LUALIB_API int (luaL_argerror) (lua_State *L, int arg, const char *extramsg); +LUALIB_API int (luaL_typeerror) (lua_State *L, int arg, const char *tname); LUALIB_API const char *(luaL_checklstring) (lua_State *L, int arg, size_t *l); LUALIB_API const char *(luaL_optlstring) (lua_State *L, int arg, @@ -73,6 +82,7 @@ LUALIB_API int (luaL_checkoption) (lua_State *L, int arg, const char *def, LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname); LUALIB_API int (luaL_execresult) (lua_State *L, int stat); + /* predefined references */ #define LUA_NOREF (-2) #define LUA_REFNIL (-1) @@ -93,8 +103,10 @@ LUALIB_API lua_State *(luaL_newstate) (void); LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx); -LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, - const char *r); +LUALIB_API void (luaL_addgsub) (luaL_Buffer *b, const char *s, + const char *p, const char *r); +LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, + const char *p, const char *r); LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup); @@ -120,7 +132,11 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) #define luaL_argcheck(L, cond,arg,extramsg) \ - ((void)((cond) || luaL_argerror(L, (arg), (extramsg)))) + ((void)(luai_likely(cond) || luaL_argerror(L, (arg), (extramsg)))) + +#define luaL_argexpected(L,cond,arg,tname) \ + ((void)(luai_likely(cond) || luaL_typeerror(L, (arg), (tname)))) + #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) @@ -139,19 +155,54 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, #define luaL_loadbuffer(L,s,sz,n) luaL_loadbufferx(L,s,sz,n,NULL) +/* +** Perform arithmetic operations on lua_Integer values with wrap-around +** semantics, as the Lua core does. +*/ +#define luaL_intop(op,v1,v2) \ + ((lua_Integer)((lua_Unsigned)(v1) op (lua_Unsigned)(v2))) + + +/* push the value used to represent failure/error */ +#define luaL_pushfail(L) lua_pushnil(L) + + +/* +** Internal assertions for in-house debugging +*/ +#if !defined(lua_assert) + +#if defined LUAI_ASSERT + #include + #define lua_assert(c) assert(c) +#else + #define lua_assert(c) ((void)0) +#endif + +#endif + + + /* ** {====================================================== ** Generic Buffer manipulation ** ======================================================= */ -typedef struct luaL_Buffer { +struct luaL_Buffer { char *b; /* buffer address */ size_t size; /* buffer size */ size_t n; /* number of characters in buffer */ lua_State *L; - char initb[LUAL_BUFFERSIZE]; /* initial buffer */ -} luaL_Buffer; + union { + LUAI_MAXALIGN; /* ensure maximum alignment for buffer */ + char b[LUAL_BUFFERSIZE]; /* initial buffer */ + } init; +}; + + +#define luaL_bufflen(bf) ((bf)->n) +#define luaL_buffaddr(bf) ((bf)->b) #define luaL_addchar(B,c) \ @@ -160,6 +211,8 @@ typedef struct luaL_Buffer { #define luaL_addsize(B,s) ((B)->n += (s)) +#define luaL_buffsub(B,s) ((B)->n -= (s)) + LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); LUALIB_API char *(luaL_prepbuffsize) (luaL_Buffer *B, size_t sz); LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); @@ -197,21 +250,6 @@ typedef struct luaL_Stream { /* }====================================================== */ - - -/* compatibility with old module system */ -#if defined(LUA_COMPAT_MODULE) - -LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname, - int sizehint); -LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, - const luaL_Reg *l, int nup); - -#define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0)) - -#endif - - /* ** {================================================================== ** "Abstraction Layer" for basic report of messages and errors diff --git a/include/lcode.h b/include/lcode.h index cd306d573aeff..3265824452639 100644 --- a/include/lcode.h +++ b/include/lcode.h @@ -1,5 +1,5 @@ /* -** $Id: lcode.h,v 1.64 2016/01/05 16:22:37 roberto Exp $ +** $Id: lcode.h $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -24,40 +24,53 @@ ** grep "ORDER OPR" if you change these enums (ORDER OP) */ typedef enum BinOpr { + /* arithmetic operators */ OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, - OPR_DIV, - OPR_IDIV, + OPR_DIV, OPR_IDIV, + /* bitwise operators */ OPR_BAND, OPR_BOR, OPR_BXOR, OPR_SHL, OPR_SHR, + /* string operator */ OPR_CONCAT, + /* comparison operators */ OPR_EQ, OPR_LT, OPR_LE, OPR_NE, OPR_GT, OPR_GE, + /* logical operators */ OPR_AND, OPR_OR, OPR_NOBINOPR } BinOpr; +/* true if operation is foldable (that is, it is arithmetic or bitwise) */ +#define foldbinop(op) ((op) <= OPR_SHR) + + +#define luaK_codeABC(fs,o,a,b,c) luaK_codeABCk(fs,o,a,b,c,0) + + typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; /* get (pointer to) instruction of given 'expdesc' */ #define getinstruction(fs,e) ((fs)->f->code[(e)->u.info]) -#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) #define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) #define luaK_jumpto(fs,t) luaK_patchlist(fs, luaK_jump(fs), t) +LUAI_FUNC int luaK_code (FuncState *fs, Instruction i); LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); -LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); -LUAI_FUNC int luaK_codek (FuncState *fs, int reg, int k); +LUAI_FUNC int luaK_codeAsBx (FuncState *fs, OpCode o, int A, int Bx); +LUAI_FUNC int luaK_codeABCk (FuncState *fs, OpCode o, int A, + int B, int C, int k); +LUAI_FUNC int luaK_isKint (expdesc *e); +LUAI_FUNC int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v); LUAI_FUNC void luaK_fixline (FuncState *fs, int line); LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); -LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); -LUAI_FUNC int luaK_intK (FuncState *fs, lua_Integer n); +LUAI_FUNC void luaK_int (FuncState *fs, int reg, lua_Integer n); LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e); @@ -75,14 +88,17 @@ LUAI_FUNC int luaK_jump (FuncState *fs); LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); -LUAI_FUNC void luaK_patchclose (FuncState *fs, int list, int level); LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); LUAI_FUNC int luaK_getlabel (FuncState *fs); LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v, int line); LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2, int line); +LUAI_FUNC void luaK_settablesize (FuncState *fs, int pc, + int ra, int asize, int hsize); LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); +LUAI_FUNC void luaK_finish (FuncState *fs); +LUAI_FUNC l_noret luaK_semerror (LexState *ls, const char *msg); #endif diff --git a/include/lctype.h b/include/lctype.h index 99c7d122376ad..864e1901885df 100644 --- a/include/lctype.h +++ b/include/lctype.h @@ -1,5 +1,5 @@ /* -** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $ +** $Id: lctype.h $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ @@ -13,7 +13,7 @@ /* ** WARNING: the functions defined here do not necessarily correspond ** to the similar functions in the standard C ctype.h. They are -** optimized for the specific needs of Lua +** optimized for the specific needs of Lua. */ #if !defined(LUA_USE_CTYPE) @@ -61,14 +61,20 @@ #define lisprint(c) testprop(c, MASK(PRINTBIT)) #define lisxdigit(c) testprop(c, MASK(XDIGITBIT)) + /* -** this 'ltolower' only works for alphabetic characters +** In ASCII, this 'ltolower' is correct for alphabetic characters and +** for '.'. That is enough for Lua needs. ('check_exp' ensures that +** the character either is an upper-case letter or is unchanged by +** the transformation, which holds for lower-case letters and '.'.) */ -#define ltolower(c) ((c) | ('A' ^ 'a')) +#define ltolower(c) \ + check_exp(('A' <= (c) && (c) <= 'Z') || (c) == ((c) | ('A' ^ 'a')), \ + (c) | ('A' ^ 'a')) -/* two more entries for 0 and -1 (EOZ) */ -LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2]; +/* one entry for each character and for -1 (EOZ) */ +LUAI_DDEC(const lu_byte luai_ctype_[UCHAR_MAX + 2];) #else /* }{ */ diff --git a/include/ldebug.h b/include/ldebug.h index 0e31546b1b4bf..974960e99da07 100644 --- a/include/ldebug.h +++ b/include/ldebug.h @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ +** $Id: ldebug.h $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ @@ -11,15 +11,39 @@ #include "lstate.h" -#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) +#define pcRel(pc, p) (cast_int((pc) - (p)->code) - 1) + + +/* Active Lua function (given call info) */ +#define ci_func(ci) (clLvalue(s2v((ci)->func))) -#define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) #define resethookcount(L) (L->hookcount = L->basehookcount) +/* +** mark for entries in 'lineinfo' array that has absolute information in +** 'abslineinfo' array +*/ +#define ABSLINEINFO (-0x80) + + +/* +** MAXimum number of successive Instructions WiTHout ABSolute line +** information. (A power of two allows fast divisions.) +*/ +#if !defined(MAXIWTHABS) +#define MAXIWTHABS 128 +#endif + +LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc); +LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, + StkId *pos); LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *opname); +LUAI_FUNC l_noret luaG_callerror (lua_State *L, const TValue *o); +LUAI_FUNC l_noret luaG_forerror (lua_State *L, const TValue *o, + const char *what); LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, @@ -33,7 +57,7 @@ LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, int line); LUAI_FUNC l_noret luaG_errormsg (lua_State *L); -LUAI_FUNC void luaG_traceexec (lua_State *L); +LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc); #endif diff --git a/include/ldo.h b/include/ldo.h index 4f5d51c3c7045..911e67f660a16 100644 --- a/include/ldo.h +++ b/include/ldo.h @@ -1,5 +1,5 @@ /* -** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $ +** $Id: ldo.h $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -17,12 +17,15 @@ ** Macro to check stack size and grow stack if needed. Parameters ** 'pre'/'pos' allow the macro to preserve a pointer into the ** stack across reallocations, doing the work only when needed. +** It also allows the running of one GC step when the stack is +** reallocated. ** 'condmovestack' is used in heavy tests to force a stack reallocation ** at every check. */ #define luaD_checkstackaux(L,n,pre,pos) \ - if (L->stack_last - L->top <= (n)) \ - { pre; luaD_growstack(L, n); pos; } else { condmovestack(L,pre,pos); } + if (l_unlikely(L->stack_last - L->top <= (n))) \ + { pre; luaD_growstack(L, n, 1); pos; } \ + else { condmovestack(L,pre,pos); } /* In general, 'pre'/'pos' are empty (nothing to save) */ #define luaD_checkstack(L,n) luaD_checkstackaux(L,n,(void)0,(void)0) @@ -30,24 +33,42 @@ #define savestack(L,p) ((char *)(p) - (char *)L->stack) -#define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) +#define restorestack(L,n) ((StkId)((char *)L->stack + (n))) + + +/* macro to check stack size, preserving 'p' */ +#define checkstackGCp(L,n,p) \ + luaD_checkstackaux(L, n, \ + ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \ + luaC_checkGC(L), /* stack grow uses memory */ \ + p = restorestack(L, t__)) /* 'pos' part: restore 'p' */ + + +/* macro to check stack size and GC */ +#define checkstackGC(L,fsize) \ + luaD_checkstackaux(L, (fsize), luaC_checkGC(L), (void)0) /* type of protected functions, to be ran by 'runprotected' */ typedef void (*Pfunc) (lua_State *L, void *ud); +LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, const char *mode); -LUAI_FUNC void luaD_hook (lua_State *L, int event, int line); -LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); +LUAI_FUNC void luaD_hook (lua_State *L, int event, int line, + int fTransfer, int nTransfer); +LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci); +LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1, int delta); +LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); +LUAI_FUNC StkId luaD_tryfuncTM (lua_State *L, StkId func); +LUAI_FUNC int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status); LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef); -LUAI_FUNC int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, - int nres); -LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); -LUAI_FUNC void luaD_growstack (lua_State *L, int n); +LUAI_FUNC void luaD_poscall (lua_State *L, CallInfo *ci, int nres); +LUAI_FUNC int luaD_reallocstack (lua_State *L, int newsize, int raiseerror); +LUAI_FUNC int luaD_growstack (lua_State *L, int n, int raiseerror); LUAI_FUNC void luaD_shrinkstack (lua_State *L); LUAI_FUNC void luaD_inctop (lua_State *L); diff --git a/include/lfunc.h b/include/lfunc.h index 2eeb0d5a48983..dc1cebccd1bcb 100644 --- a/include/lfunc.h +++ b/include/lfunc.h @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $ +** $Id: lfunc.h $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -11,11 +11,11 @@ #include "lobject.h" -#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ - cast(int, sizeof(TValue)*((n)-1))) +#define sizeCclosure(n) (cast_int(offsetof(CClosure, upvalue)) + \ + cast_int(sizeof(TValue)) * (n)) -#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ - cast(int, sizeof(TValue *)*((n)-1))) +#define sizeLclosure(n) (cast_int(offsetof(LClosure, upvals)) + \ + cast_int(sizeof(TValue *)) * (n)) /* test whether thread is in 'twups' list */ @@ -29,30 +29,33 @@ #define MAXUPVAL 255 +#define upisopen(up) ((up)->v != &(up)->u.value) + + +#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v)) + + /* -** Upvalues for Lua closures +** maximum number of misses before giving up the cache of closures +** in prototypes */ -struct UpVal { - TValue *v; /* points to stack or to its own value */ - lu_mem refcount; /* reference counter */ - union { - struct { /* (when open) */ - UpVal *next; /* linked list */ - int touched; /* mark to avoid cycles with dead threads */ - } open; - TValue value; /* the value (when closed) */ - } u; -}; +#define MAXMISS 10 -#define upisopen(up) ((up)->v != &(up)->u.value) + + +/* special status to close upvalues preserving the top of the stack */ +#define CLOSEKTOP (-1) LUAI_FUNC Proto *luaF_newproto (lua_State *L); -LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); -LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); +LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nupvals); +LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals); LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); -LUAI_FUNC void luaF_close (lua_State *L, StkId level); +LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); +LUAI_FUNC void luaF_closeupval (lua_State *L, StkId level); +LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status, int yy); +LUAI_FUNC void luaF_unlinkupval (UpVal *uv); LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, int pc); diff --git a/include/lgc.h b/include/lgc.h index aed3e18a5f043..4a125634b9eac 100644 --- a/include/lgc.h +++ b/include/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 roberto Exp $ +** $Id: lgc.h $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -12,38 +12,31 @@ #include "lstate.h" /* -** Collectable objects may have one of three colors: white, which -** means the object is not marked; gray, which means the -** object is marked, but its references may be not marked; and -** black, which means that the object and all its references are marked. -** The main invariant of the garbage collector, while marking objects, -** is that a black object can never point to a white one. Moreover, -** any gray object must be in a "gray list" (gray, grayagain, weak, -** allweak, ephemeron) so that it can be visited again before finishing -** the collection cycle. These lists have no meaning when the invariant -** is not being enforced (e.g., sweep phase). +** Collectable objects may have one of three colors: white, which means +** the object is not marked; gray, which means the object is marked, but +** its references may be not marked; and black, which means that the +** object and all its references are marked. The main invariant of the +** garbage collector, while marking objects, is that a black object can +** never point to a white one. Moreover, any gray object must be in a +** "gray list" (gray, grayagain, weak, allweak, ephemeron) so that it +** can be visited again before finishing the collection cycle. (Open +** upvalues are an exception to this rule.) These lists have no meaning +** when the invariant is not being enforced (e.g., sweep phase). */ - -/* how much to allocate before next GC step */ -#if !defined(GCSTEPSIZE) -/* ~100 small strings */ -#define GCSTEPSIZE (cast_int(100 * sizeof(TString))) -#endif - - /* ** Possible states of the Garbage Collector */ #define GCSpropagate 0 -#define GCSatomic 1 -#define GCSswpallgc 2 -#define GCSswpfinobj 3 -#define GCSswptobefnz 4 -#define GCSswpend 5 -#define GCScallfin 6 -#define GCSpause 7 +#define GCSenteratomic 1 +#define GCSatomic 2 +#define GCSswpallgc 3 +#define GCSswpfinobj 4 +#define GCSswptobefnz 5 +#define GCSswpend 6 +#define GCScallfin 7 +#define GCSpause 8 #define issweepphase(g) \ @@ -64,7 +57,7 @@ /* ** some useful bit tricks */ -#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) +#define resetbits(x,m) ((x) &= cast_byte(~(m))) #define setbits(x,m) ((x) |= (m)) #define testbits(x,m) ((x) & (m)) #define bitmask(b) (1<<(b)) @@ -74,12 +67,19 @@ #define testbit(x,b) testbits(x, bitmask(b)) -/* Layout for bit use in 'marked' field: */ -#define WHITE0BIT 0 /* object is white (type 0) */ -#define WHITE1BIT 1 /* object is white (type 1) */ -#define BLACKBIT 2 /* object is black */ -#define FINALIZEDBIT 3 /* object has been marked for finalization */ -/* bit 7 is currently used by tests (luaL_checkmemory) */ +/* +** Layout for bit use in 'marked' field. First three bits are +** used for object "age" in generational mode. Last bit is used +** by tests. +*/ +#define WHITE0BIT 3 /* object is white (type 0) */ +#define WHITE1BIT 4 /* object is white (type 1) */ +#define BLACKBIT 5 /* object is black */ +#define FINALIZEDBIT 6 /* object has been marked for finalization */ + +#define TESTBIT 7 + + #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) @@ -92,13 +92,70 @@ #define tofinalize(x) testbit((x)->marked, FINALIZEDBIT) #define otherwhite(g) ((g)->currentwhite ^ WHITEBITS) -#define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow))) +#define isdeadm(ow,m) ((m) & (ow)) #define isdead(g,v) isdeadm(otherwhite(g), (v)->marked) #define changewhite(x) ((x)->marked ^= WHITEBITS) -#define gray2black(x) l_setbit((x)->marked, BLACKBIT) +#define nw2black(x) \ + check_exp(!iswhite(x), l_setbit((x)->marked, BLACKBIT)) + +#define luaC_white(g) cast_byte((g)->currentwhite & WHITEBITS) + + +/* object age in generational mode */ +#define G_NEW 0 /* created in current cycle */ +#define G_SURVIVAL 1 /* created in previous cycle */ +#define G_OLD0 2 /* marked old by frw. barrier in this cycle */ +#define G_OLD1 3 /* first full cycle as old */ +#define G_OLD 4 /* really old object (not to be visited) */ +#define G_TOUCHED1 5 /* old object touched this cycle */ +#define G_TOUCHED2 6 /* old object touched in previous cycle */ + +#define AGEBITS 7 /* all age bits (111) */ + +#define getage(o) ((o)->marked & AGEBITS) +#define setage(o,a) ((o)->marked = cast_byte(((o)->marked & (~AGEBITS)) | a)) +#define isold(o) (getage(o) > G_SURVIVAL) + +#define changeage(o,f,t) \ + check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) + -#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) +/* Default Values for GC parameters */ +#define LUAI_GENMAJORMUL 100 +#define LUAI_GENMINORMUL 20 + +/* wait memory to double before starting new cycle */ +#define LUAI_GCPAUSE 200 + +/* +** some gc parameters are stored divided by 4 to allow a maximum value +** up to 1023 in a 'lu_byte'. +*/ +#define getgcparam(p) ((p) * 4) +#define setgcparam(p,v) ((p) = (v) / 4) + +#define LUAI_GCMUL 100 + +/* how much to allocate before next GC step (log2) */ +#define LUAI_GCSTEPSIZE 13 /* 8 KB */ + + +/* +** Check whether the declared GC mode is generational. While in +** generational mode, the collector can go temporarily to incremental +** mode to improve performance. This is signaled by 'g->lastatomic != 0'. +*/ +#define isdecGCmodegen(g) (g->gckind == KGC_GEN || g->lastatomic != 0) + + +/* +** Control when GC is running: +*/ +#define GCSTPUSR 1 /* bit true when GC stopped by user */ +#define GCSTPGC 2 /* bit true when GC stopped by itself */ +#define GCSTPCLS 4 /* bit true when closing Lua state */ +#define gcrunning(g) ((g)->gcstp == 0) /* @@ -127,10 +184,6 @@ (isblack(p) && iswhite(o)) ? \ luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0)) -#define luaC_upvalbarrier(L,uv) ( \ - (iscollectable((uv)->v) && !upisopen(uv)) ? \ - luaC_upvalbarrier_(L,uv) : cast_void(0)) - LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); LUAI_FUNC void luaC_freeallobjects (lua_State *L); LUAI_FUNC void luaC_step (lua_State *L); @@ -138,10 +191,9 @@ LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask); LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); -LUAI_FUNC void luaC_barrierback_ (lua_State *L, Table *o); -LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv); +LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o); LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); -LUAI_FUNC void luaC_upvdeccount (lua_State *L, UpVal *uv); +LUAI_FUNC void luaC_changemode (lua_State *L, int newmode); #endif diff --git a/include/llex.h b/include/llex.h index 2363d87e40ea7..389d2f863592a 100644 --- a/include/llex.h +++ b/include/llex.h @@ -1,5 +1,5 @@ /* -** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.h $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -7,11 +7,17 @@ #ifndef llex_h #define llex_h +#include + #include "lobject.h" #include "lzio.h" -#define FIRST_RESERVED 257 +/* +** Single-char tokens (terminal symbols) are represented by their own +** numeric code. Other tokens start at the following value. +*/ +#define FIRST_RESERVED (UCHAR_MAX + 1) #if !defined(LUA_ENV) @@ -37,7 +43,7 @@ enum RESERVED { }; /* number of reserved words */ -#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) +#define NUM_RESERVED (cast_int(TK_WHILE-FIRST_RESERVED + 1)) typedef union { diff --git a/include/llimits.h b/include/llimits.h index f21377fef981c..52a32f92e302e 100644 --- a/include/llimits.h +++ b/include/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.141 2015/11/19 19:16:22 roberto Exp $ +** $Id: llimits.h $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -14,6 +14,7 @@ #include "lua.h" + /* ** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count ** the total memory used by Lua (in bytes). Usually, 'size_t' and @@ -22,7 +23,7 @@ #if defined(LUAI_MEM) /* { external definitions? */ typedef LUAI_UMEM lu_mem; typedef LUAI_MEM l_mem; -#elif LUAI_BITSINT >= 32 /* }{ */ +#elif LUAI_IS32INT /* }{ */ typedef size_t lu_mem; typedef ptrdiff_t l_mem; #else /* 16-bit ints */ /* }{ */ @@ -33,12 +34,13 @@ typedef long l_mem; /* chars used as small naturals (so that 'char' is reserved for characters) */ typedef unsigned char lu_byte; +typedef signed char ls_byte; /* maximum value for size_t */ #define MAX_SIZET ((size_t)(~(size_t)0)) -/* maximum size visible for Lua (must be representable in a lua_Integer */ +/* maximum size visible for Lua (must be representable in a lua_Integer) */ #define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \ : (size_t)(LUA_MAXINTEGER)) @@ -51,6 +53,23 @@ typedef unsigned char lu_byte; #define MAX_INT INT_MAX /* maximum value of an int */ +/* +** floor of the log2 of the maximum signed value for integral type 't'. +** (That is, maximum 'n' such that '2^n' fits in the given signed type.) +*/ +#define log2maxs(t) (sizeof(t) * 8 - 2) + + +/* +** test whether an unsigned value is a power of 2 (or zero) +*/ +#define ispow2(x) (((x) & ((x) - 1)) == 0) + + +/* number of chars of a literal string without the ending \0 */ +#define LL(x) (sizeof(x)/sizeof(char) - 1) + + /* ** conversion of pointer to unsigned integer: ** this is for hashing only; there is no problem if the integer @@ -60,27 +79,20 @@ typedef unsigned char lu_byte; -/* type to ensure maximum alignment */ -#if defined(LUAI_USER_ALIGNMENT_T) -typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; -#else -typedef union { - lua_Number n; - double u; - void *s; - lua_Integer i; - long l; -} L_Umaxalign; -#endif - - - /* types of 'usual argument conversions' for lua_Number and lua_Integer */ typedef LUAI_UACNUMBER l_uacNumber; typedef LUAI_UACINT l_uacInt; -/* internal assertions for in-house debugging */ +/* +** Internal assertions for in-house debugging +*/ +#if defined LUAI_ASSERT +#undef NDEBUG +#include +#define lua_assert(c) assert(c) +#endif + #if defined(lua_assert) #define check_exp(c,e) (lua_assert(c), (e)) /* to avoid problems with conditions too long */ @@ -95,7 +107,7 @@ typedef LUAI_UACINT l_uacInt; ** assertion for checking API calls */ #if !defined(luai_apicheck) -#define luai_apicheck(l,e) lua_assert(e) +#define luai_apicheck(l,e) ((void)l, lua_assert(e)) #endif #define api_check(l,e,msg) luai_apicheck(l,(e) && msg) @@ -111,10 +123,15 @@ typedef LUAI_UACINT l_uacInt; #define cast(t, exp) ((t)(exp)) #define cast_void(i) cast(void, (i)) -#define cast_byte(i) cast(lu_byte, (i)) +#define cast_voidp(i) cast(void *, (i)) #define cast_num(i) cast(lua_Number, (i)) #define cast_int(i) cast(int, (i)) +#define cast_uint(i) cast(unsigned int, (i)) +#define cast_byte(i) cast(lu_byte, (i)) #define cast_uchar(i) cast(unsigned char, (i)) +#define cast_char(i) cast(char, (i)) +#define cast_charp(i) cast(char *, (i)) +#define cast_sizet(i) cast(size_t, (i)) /* cast a signed lua_Integer to lua_Unsigned */ @@ -135,6 +152,8 @@ typedef LUAI_UACINT l_uacInt; /* ** non-return type */ +#if !defined(l_noret) + #if defined(__GNUC__) #define l_noret void __attribute__((noreturn)) #elif defined(_MSC_VER) && _MSC_VER >= 1200 @@ -143,28 +162,35 @@ typedef LUAI_UACINT l_uacInt; #define l_noret void #endif +#endif /* -** maximum depth for nested C calls and syntactical nested non-terminals -** in a program. (Value must fit in an unsigned short int.) +** Inline functions */ -#if !defined(LUAI_MAXCCALLS) -#define LUAI_MAXCCALLS 200 +#if !defined(LUA_USE_C89) +#define l_inline inline +#elif defined(__GNUC__) +#define l_inline __inline__ +#else +#define l_inline /* empty */ #endif +#define l_sinline static l_inline /* ** type for virtual-machine instructions; ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) */ -#if LUAI_BITSINT >= 32 -typedef unsigned int Instruction; +#if LUAI_IS32INT +typedef unsigned int l_uint32; #else -typedef unsigned long Instruction; +typedef unsigned long l_uint32; #endif +typedef l_uint32 Instruction; + /* @@ -206,6 +232,17 @@ typedef unsigned long Instruction; #endif +/* +** Maximum depth for nested C calls, syntactical nested non-terminals, +** and other features implemented through recursion in C. (Value must +** fit in a 16-bit unsigned integer. It must also be compatible with +** the size of the C stack.) +*/ +#if !defined(LUAI_MAXCCALLS) +#define LUAI_MAXCCALLS 200 +#endif + + /* ** macros that are executed whenever program enters the Lua core ** ('lua_lock') and leaves the core ('lua_unlock') @@ -225,8 +262,7 @@ typedef unsigned long Instruction; /* -** these macros allow user-specific actions on threads when you defined -** LUAI_EXTRASPACE and need to do something extra when a thread is +** these macros allow user-specific actions when a thread is ** created/deleted/resumed/yielded. */ #if !defined(luai_userstateopen) @@ -270,20 +306,26 @@ typedef unsigned long Instruction; #endif /* -** modulo: defined as 'a - floor(a/b)*b'; this definition gives NaN when -** 'b' is huge, but the result should be 'a'. 'fmod' gives the result of -** 'a - trunc(a/b)*b', and therefore must be corrected when 'trunc(a/b) -** ~= floor(a/b)'. That happens when the division has a non-integer -** negative result, which is equivalent to the test below. +** modulo: defined as 'a - floor(a/b)*b'; the direct computation +** using this definition has several problems with rounding errors, +** so it is better to use 'fmod'. 'fmod' gives the result of +** 'a - trunc(a/b)*b', and therefore must be corrected when +** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a +** non-integer negative result: non-integer result is equivalent to +** a non-zero remainder 'm'; negative result is equivalent to 'a' and +** 'b' with different signs, or 'm' and 'b' with different signs +** (as the result 'm' of 'fmod' has the same sign of 'a'). */ #if !defined(luai_nummod) #define luai_nummod(L,a,b,m) \ - { (m) = l_mathop(fmod)(a,b); if ((m)*(b) < 0) (m) += (b); } + { (void)L; (m) = l_mathop(fmod)(a,b); \ + if (((m) > 0) ? (b) < 0 : ((m) < 0 && (b) > 0)) (m) += (b); } #endif /* exponentiation */ #if !defined(luai_numpow) -#define luai_numpow(L,a,b) ((void)L, l_mathop(pow)(a,b)) +#define luai_numpow(L,a,b) \ + ((void)L, (b == 2) ? (a)*(a) : l_mathop(pow)(a,b)) #endif /* the others are quite standard operations */ @@ -295,6 +337,8 @@ typedef unsigned long Instruction; #define luai_numeq(a,b) ((a)==(b)) #define luai_numlt(a,b) ((a)<(b)) #define luai_numle(a,b) ((a)<=(b)) +#define luai_numgt(a,b) ((a)>(b)) +#define luai_numge(a,b) ((a)>=(b)) #define luai_numisnan(a) (!luai_numeq((a), (a))) #endif @@ -310,14 +354,14 @@ typedef unsigned long Instruction; #else /* realloc stack keeping its size */ #define condmovestack(L,pre,pos) \ - { int sz_ = (L)->stacksize; pre; luaD_reallocstack((L), sz_); pos; } + { int sz_ = stacksize(L); pre; luaD_reallocstack((L), sz_, 0); pos; } #endif #if !defined(HARDMEMTESTS) #define condchangemem(L,pre,pos) ((void)0) #else #define condchangemem(L,pre,pos) \ - { if (G(L)->gcrunning) { pre; luaC_fullgc(L, 0); pos; } } + { if (gcrunning(G(L))) { pre; luaC_fullgc(L, 0); pos; } } #endif #endif diff --git a/include/lmem.h b/include/lmem.h index 30f484895e7ee..8c75a44beb475 100644 --- a/include/lmem.h +++ b/include/lmem.h @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $ +** $Id: lmem.h $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -14,12 +14,13 @@ #include "lua.h" +#define luaM_error(L) luaD_throw(L, LUA_ERRMEM) + + /* -** This macro reallocs a vector 'b' from 'on' to 'n' elements, where -** each element has size 'e'. In case of arithmetic overflow of the -** product 'n'*'e', it raises an error (calling 'luaM_toobig'). Because -** 'e' is always constant, it avoids the runtime division MAX_SIZET/(e). -** +** This macro tests whether it is safe to multiply 'n' by the size of +** type 't' without overflows. Because 'e' is always constant, it avoids +** the runtime division MAX_SIZET/(e). ** (The macro is somewhat complex to avoid warnings: The 'sizeof' ** comparison avoids a runtime comparison when overflow cannot occur. ** The compiler should be able to optimize the real test by itself, but @@ -27,43 +28,66 @@ ** false due to limited range of data type"; the +1 tricks the compiler, ** avoiding this warning but also this optimization.) */ -#define luaM_reallocv(L,b,on,n,e) \ - (((sizeof(n) >= sizeof(size_t) && cast(size_t, (n)) + 1 > MAX_SIZET/(e)) \ - ? luaM_toobig(L) : cast_void(0)) , \ - luaM_realloc_(L, (b), (on)*(e), (n)*(e))) +#define luaM_testsize(n,e) \ + (sizeof(n) >= sizeof(size_t) && cast_sizet((n)) + 1 > MAX_SIZET/(e)) + +#define luaM_checksize(L,n,e) \ + (luaM_testsize(n,e) ? luaM_toobig(L) : cast_void(0)) + + +/* +** Computes the minimum between 'n' and 'MAX_SIZET/sizeof(t)', so that +** the result is not larger than 'n' and cannot overflow a 'size_t' +** when multiplied by the size of type 't'. (Assumes that 'n' is an +** 'int' or 'unsigned int' and that 'int' is not larger than 'size_t'.) +*/ +#define luaM_limitN(n,t) \ + ((cast_sizet(n) <= MAX_SIZET/sizeof(t)) ? (n) : \ + cast_uint((MAX_SIZET/sizeof(t)))) + /* ** Arrays of chars do not need any test */ #define luaM_reallocvchar(L,b,on,n) \ - cast(char *, luaM_realloc_(L, (b), (on)*sizeof(char), (n)*sizeof(char))) + cast_charp(luaM_saferealloc_(L, (b), (on)*sizeof(char), (n)*sizeof(char))) -#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) -#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) -#define luaM_freearray(L, b, n) luaM_realloc_(L, (b), (n)*sizeof(*(b)), 0) +#define luaM_freemem(L, b, s) luaM_free_(L, (b), (s)) +#define luaM_free(L, b) luaM_free_(L, (b), sizeof(*(b))) +#define luaM_freearray(L, b, n) luaM_free_(L, (b), (n)*sizeof(*(b))) -#define luaM_malloc(L,s) luaM_realloc_(L, NULL, 0, (s)) -#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) -#define luaM_newvector(L,n,t) \ - cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) +#define luaM_new(L,t) cast(t*, luaM_malloc_(L, sizeof(t), 0)) +#define luaM_newvector(L,n,t) cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0)) +#define luaM_newvectorchecked(L,n,t) \ + (luaM_checksize(L,n,sizeof(t)), luaM_newvector(L,n,t)) -#define luaM_newobject(L,tag,s) luaM_realloc_(L, NULL, tag, (s)) +#define luaM_newobject(L,tag,s) luaM_malloc_(L, (s), tag) #define luaM_growvector(L,v,nelems,size,t,limit,e) \ - if ((nelems)+1 > (size)) \ - ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) + ((v)=cast(t *, luaM_growaux_(L,v,nelems,&(size),sizeof(t), \ + luaM_limitN(limit,t),e))) #define luaM_reallocvector(L, v,oldn,n,t) \ - ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) + (cast(t *, luaM_realloc_(L, v, cast_sizet(oldn) * sizeof(t), \ + cast_sizet(n) * sizeof(t)))) + +#define luaM_shrinkvector(L,v,size,fs,t) \ + ((v)=cast(t *, luaM_shrinkvector_(L, v, &(size), fs, sizeof(t)))) LUAI_FUNC l_noret luaM_toobig (lua_State *L); /* not to be called directly */ LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, size_t size); -LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, - size_t size_elem, int limit, +LUAI_FUNC void *luaM_saferealloc_ (lua_State *L, void *block, size_t oldsize, + size_t size); +LUAI_FUNC void luaM_free_ (lua_State *L, void *block, size_t osize); +LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int nelems, + int *size, int size_elem, int limit, const char *what); +LUAI_FUNC void *luaM_shrinkvector_ (lua_State *L, void *block, int *nelem, + int final_n, int size_elem); +LUAI_FUNC void *luaM_malloc_ (lua_State *L, size_t size, int tag); #endif diff --git a/include/lobject.h b/include/lobject.h index 3c042289492bb..0e05b3e42ea92 100644 --- a/include/lobject.h +++ b/include/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.117 2016/08/01 19:51:24 roberto Exp $ +** $Id: lobject.h $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -17,288 +17,358 @@ /* -** Extra tags for non-values +** Extra types for collectable non-values */ -#define LUA_TPROTO LUA_NUMTAGS /* function prototypes */ -#define LUA_TDEADKEY (LUA_NUMTAGS+1) /* removed keys in tables */ +#define LUA_TUPVAL LUA_NUMTYPES /* upvalues */ +#define LUA_TPROTO (LUA_NUMTYPES+1) /* function prototypes */ +#define LUA_TDEADKEY (LUA_NUMTYPES+2) /* removed keys in tables */ + + /* -** number of all possible tags (including LUA_TNONE but excluding DEADKEY) +** number of all possible types (including LUA_TNONE but excluding DEADKEY) */ -#define LUA_TOTALTAGS (LUA_TPROTO + 2) +#define LUA_TOTALTYPES (LUA_TPROTO + 2) /* ** tags for Tagged Values have the following use of bits: -** bits 0-3: actual tag (a LUA_T* value) +** bits 0-3: actual tag (a LUA_T* constant) ** bits 4-5: variant bits ** bit 6: whether value is collectable */ +/* add variant bits to a type */ +#define makevariant(t,v) ((t) | ((v) << 4)) + + /* -** LUA_TFUNCTION variants: -** 0 - Lua function -** 1 - light C function -** 2 - regular C function (closure) +** Union of all Lua values */ +typedef union Value { + struct GCObject *gc; /* collectable objects */ + void *p; /* light userdata */ + lua_CFunction f; /* light C functions */ + lua_Integer i; /* integer numbers */ + lua_Number n; /* float numbers */ +} Value; -/* Variant tags for functions */ -#define LUA_TLCL (LUA_TFUNCTION | (0 << 4)) /* Lua closure */ -#define LUA_TLCF (LUA_TFUNCTION | (1 << 4)) /* light C function */ -#define LUA_TCCL (LUA_TFUNCTION | (2 << 4)) /* C closure */ +/* +** Tagged Values. This is the basic representation of values in Lua: +** an actual value plus a tag with its type. +*/ -/* Variant tags for strings */ -#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */ -#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */ +#define TValuefields Value value_; lu_byte tt_ +typedef struct TValue { + TValuefields; +} TValue; -/* Variant tags for numbers */ -#define LUA_TNUMFLT (LUA_TNUMBER | (0 << 4)) /* float numbers */ -#define LUA_TNUMINT (LUA_TNUMBER | (1 << 4)) /* integer numbers */ +#define val_(o) ((o)->value_) +#define valraw(o) (val_(o)) -/* Bit mark for collectable types */ -#define BIT_ISCOLLECTABLE (1 << 6) -/* mark a tag as collectable */ -#define ctb(t) ((t) | BIT_ISCOLLECTABLE) +/* raw type tag of a TValue */ +#define rawtt(o) ((o)->tt_) + +/* tag with no variants (bits 0-3) */ +#define novariant(t) ((t) & 0x0F) + +/* type tag of a TValue (bits 0-3 for tags + variant bits 4-5) */ +#define withvariant(t) ((t) & 0x3F) +#define ttypetag(o) withvariant(rawtt(o)) +/* type of a TValue */ +#define ttype(o) (novariant(rawtt(o))) + + +/* Macros to test type */ +#define checktag(o,t) (rawtt(o) == (t)) +#define checktype(o,t) (ttype(o) == (t)) + + +/* Macros for internal tests */ + +/* collectable object has the same tag as the original value */ +#define righttt(obj) (ttypetag(obj) == gcvalue(obj)->tt) /* -** Common type for all collectable objects +** Any value being manipulated by the program either is non +** collectable, or the collectable object has the right tag +** and it is not dead. The option 'L == NULL' allows other +** macros using this one to be used where L is not available. */ -typedef struct GCObject GCObject; +#define checkliveness(L,obj) \ + ((void)L, lua_longassert(!iscollectable(obj) || \ + (righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj)))))) + +/* Macros to set values */ + +/* set a value's tag */ +#define settt_(o,t) ((o)->tt_=(t)) + + +/* main macro to copy values (from 'obj2' to 'obj1') */ +#define setobj(L,obj1,obj2) \ + { TValue *io1=(obj1); const TValue *io2=(obj2); \ + io1->value_ = io2->value_; settt_(io1, io2->tt_); \ + checkliveness(L,io1); lua_assert(!isnonstrictnil(io1)); } /* -** Common Header for all collectable objects (in macro form, to be -** included in other objects) +** Different types of assignments, according to source and destination. +** (They are mostly equal now, but may be different in the future.) */ -#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked + +/* from stack to stack */ +#define setobjs2s(L,o1,o2) setobj(L,s2v(o1),s2v(o2)) +/* to stack (not from same stack) */ +#define setobj2s(L,o1,o2) setobj(L,s2v(o1),o2) +/* from table to same table */ +#define setobjt2t setobj +/* to new object */ +#define setobj2n setobj +/* to table */ +#define setobj2t setobj /* -** Common type has only the common header +** Entries in a Lua stack. Field 'tbclist' forms a list of all +** to-be-closed variables active in this stack. Dummy entries are +** used when the distance between two tbc variables does not fit +** in an unsigned short. They are represented by delta==0, and +** their real delta is always the maximum value that fits in +** that field. */ -struct GCObject { - CommonHeader; -}; +typedef union StackValue { + TValue val; + struct { + TValuefields; + unsigned short delta; + } tbclist; +} StackValue; +/* index to stack elements */ +typedef StackValue *StkId; + +/* convert a 'StackValue' to a 'TValue' */ +#define s2v(o) (&(o)->val) -/* -** Tagged Values. This is the basic representation of values in Lua, -** an actual value plus a tag with its type. -*/ /* -** Union of all Lua values +** {================================================================== +** Nil +** =================================================================== */ -typedef union Value { - GCObject *gc; /* collectable objects */ - void *p; /* light userdata */ - int b; /* booleans */ - lua_CFunction f; /* light C functions */ - lua_Integer i; /* integer numbers */ - lua_Number n; /* float numbers */ -} Value; +/* Standard nil */ +#define LUA_VNIL makevariant(LUA_TNIL, 0) -#define TValuefields Value value_; int tt_ +/* Empty slot (which might be different from a slot containing nil) */ +#define LUA_VEMPTY makevariant(LUA_TNIL, 1) +/* Value returned for a key not found in a table (absent key) */ +#define LUA_VABSTKEY makevariant(LUA_TNIL, 2) -typedef struct lua_TValue { - TValuefields; -} TValue; +/* macro to test for (any kind of) nil */ +#define ttisnil(v) checktype((v), LUA_TNIL) -/* macro defining a nil value */ -#define NILCONSTANT {NULL}, LUA_TNIL +/* macro to test for a standard nil */ +#define ttisstrictnil(o) checktag((o), LUA_VNIL) -#define val_(o) ((o)->value_) +#define setnilvalue(obj) settt_(obj, LUA_VNIL) -/* raw type tag of a TValue */ -#define rttype(o) ((o)->tt_) +#define isabstkey(v) checktag((v), LUA_VABSTKEY) -/* tag with no variants (bits 0-3) */ -#define novariant(x) ((x) & 0x0F) -/* type tag of a TValue (bits 0-3 for tags + variant bits 4-5) */ -#define ttype(o) (rttype(o) & 0x3F) +/* +** macro to detect non-standard nils (used only in assertions) +*/ +#define isnonstrictnil(v) (ttisnil(v) && !ttisstrictnil(v)) -/* type tag of a TValue with no variants (bits 0-3) */ -#define ttnov(o) (novariant(rttype(o))) +/* +** By default, entries with any kind of nil are considered empty. +** (In any definition, values associated with absent keys must also +** be accepted as empty.) +*/ +#define isempty(v) ttisnil(v) -/* Macros to test type */ -#define checktag(o,t) (rttype(o) == (t)) -#define checktype(o,t) (ttnov(o) == (t)) -#define ttisnumber(o) checktype((o), LUA_TNUMBER) -#define ttisfloat(o) checktag((o), LUA_TNUMFLT) -#define ttisinteger(o) checktag((o), LUA_TNUMINT) -#define ttisnil(o) checktag((o), LUA_TNIL) -#define ttisboolean(o) checktag((o), LUA_TBOOLEAN) -#define ttislightuserdata(o) checktag((o), LUA_TLIGHTUSERDATA) -#define ttisstring(o) checktype((o), LUA_TSTRING) -#define ttisshrstring(o) checktag((o), ctb(LUA_TSHRSTR)) -#define ttislngstring(o) checktag((o), ctb(LUA_TLNGSTR)) -#define ttistable(o) checktag((o), ctb(LUA_TTABLE)) -#define ttisfunction(o) checktype(o, LUA_TFUNCTION) -#define ttisclosure(o) ((rttype(o) & 0x1F) == LUA_TFUNCTION) -#define ttisCclosure(o) checktag((o), ctb(LUA_TCCL)) -#define ttisLclosure(o) checktag((o), ctb(LUA_TLCL)) -#define ttislcf(o) checktag((o), LUA_TLCF) -#define ttisfulluserdata(o) checktag((o), ctb(LUA_TUSERDATA)) -#define ttisthread(o) checktag((o), ctb(LUA_TTHREAD)) -#define ttisdeadkey(o) checktag((o), LUA_TDEADKEY) +/* macro defining a value corresponding to an absent key */ +#define ABSTKEYCONSTANT {NULL}, LUA_VABSTKEY -/* Macros to access values */ -#define ivalue(o) check_exp(ttisinteger(o), val_(o).i) -#define fltvalue(o) check_exp(ttisfloat(o), val_(o).n) -#define nvalue(o) check_exp(ttisnumber(o), \ - (ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o))) -#define gcvalue(o) check_exp(iscollectable(o), val_(o).gc) -#define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p) -#define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc)) -#define uvalue(o) check_exp(ttisfulluserdata(o), gco2u(val_(o).gc)) -#define clvalue(o) check_exp(ttisclosure(o), gco2cl(val_(o).gc)) -#define clLvalue(o) check_exp(ttisLclosure(o), gco2lcl(val_(o).gc)) -#define clCvalue(o) check_exp(ttisCclosure(o), gco2ccl(val_(o).gc)) -#define fvalue(o) check_exp(ttislcf(o), val_(o).f) -#define hvalue(o) check_exp(ttistable(o), gco2t(val_(o).gc)) -#define bvalue(o) check_exp(ttisboolean(o), val_(o).b) -#define thvalue(o) check_exp(ttisthread(o), gco2th(val_(o).gc)) -/* a dead value may get the 'gc' field, but cannot access its contents */ -#define deadvalue(o) check_exp(ttisdeadkey(o), cast(void *, val_(o).gc)) -#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0)) +/* mark an entry as empty */ +#define setempty(v) settt_(v, LUA_VEMPTY) -#define iscollectable(o) (rttype(o) & BIT_ISCOLLECTABLE) +/* }================================================================== */ -/* Macros for internal tests */ -#define righttt(obj) (ttype(obj) == gcvalue(obj)->tt) -#define checkliveness(L,obj) \ - lua_longassert(!iscollectable(obj) || \ - (righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))) +/* +** {================================================================== +** Booleans +** =================================================================== +*/ -/* Macros to set values */ -#define settt_(o,t) ((o)->tt_=(t)) +#define LUA_VFALSE makevariant(LUA_TBOOLEAN, 0) +#define LUA_VTRUE makevariant(LUA_TBOOLEAN, 1) -#define setfltvalue(obj,x) \ - { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_TNUMFLT); } +#define ttisboolean(o) checktype((o), LUA_TBOOLEAN) +#define ttisfalse(o) checktag((o), LUA_VFALSE) +#define ttistrue(o) checktag((o), LUA_VTRUE) -#define chgfltvalue(obj,x) \ - { TValue *io=(obj); lua_assert(ttisfloat(io)); val_(io).n=(x); } -#define setivalue(obj,x) \ - { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_TNUMINT); } +#define l_isfalse(o) (ttisfalse(o) || ttisnil(o)) -#define chgivalue(obj,x) \ - { TValue *io=(obj); lua_assert(ttisinteger(io)); val_(io).i=(x); } -#define setnilvalue(obj) settt_(obj, LUA_TNIL) +#define setbfvalue(obj) settt_(obj, LUA_VFALSE) +#define setbtvalue(obj) settt_(obj, LUA_VTRUE) -#define setfvalue(obj,x) \ - { TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_TLCF); } +/* }================================================================== */ -#define setpvalue(obj,x) \ - { TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TLIGHTUSERDATA); } -#define setbvalue(obj,x) \ - { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); } +/* +** {================================================================== +** Threads +** =================================================================== +*/ -#define setgcovalue(L,obj,x) \ - { TValue *io = (obj); GCObject *i_g=(x); \ - val_(io).gc = i_g; settt_(io, ctb(i_g->tt)); } +#define LUA_VTHREAD makevariant(LUA_TTHREAD, 0) -#define setsvalue(L,obj,x) \ - { TValue *io = (obj); TString *x_ = (x); \ - val_(io).gc = obj2gco(x_); settt_(io, ctb(x_->tt)); \ - checkliveness(L,io); } +#define ttisthread(o) checktag((o), ctb(LUA_VTHREAD)) -#define setuvalue(L,obj,x) \ - { TValue *io = (obj); Udata *x_ = (x); \ - val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TUSERDATA)); \ - checkliveness(L,io); } +#define thvalue(o) check_exp(ttisthread(o), gco2th(val_(o).gc)) #define setthvalue(L,obj,x) \ { TValue *io = (obj); lua_State *x_ = (x); \ - val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTHREAD)); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \ checkliveness(L,io); } -#define setclLvalue(L,obj,x) \ - { TValue *io = (obj); LClosure *x_ = (x); \ - val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TLCL)); \ - checkliveness(L,io); } +#define setthvalue2s(L,o,t) setthvalue(L,s2v(o),t) -#define setclCvalue(L,obj,x) \ - { TValue *io = (obj); CClosure *x_ = (x); \ - val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TCCL)); \ - checkliveness(L,io); } +/* }================================================================== */ -#define sethvalue(L,obj,x) \ - { TValue *io = (obj); Table *x_ = (x); \ - val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTABLE)); \ - checkliveness(L,io); } -#define setdeadvalue(obj) settt_(obj, LUA_TDEADKEY) +/* +** {================================================================== +** Collectable Objects +** =================================================================== +*/ +/* +** Common Header for all collectable objects (in macro form, to be +** included in other objects) +*/ +#define CommonHeader struct GCObject *next; lu_byte tt; lu_byte marked -#define setobj(L,obj1,obj2) \ - { TValue *io1=(obj1); *io1 = *(obj2); \ - (void)L; checkliveness(L,io1); } +/* Common type for all collectable objects */ +typedef struct GCObject { + CommonHeader; +} GCObject; + + +/* Bit mark for collectable types */ +#define BIT_ISCOLLECTABLE (1 << 6) + +#define iscollectable(o) (rawtt(o) & BIT_ISCOLLECTABLE) + +/* mark a tag as collectable */ +#define ctb(t) ((t) | BIT_ISCOLLECTABLE) + +#define gcvalue(o) check_exp(iscollectable(o), val_(o).gc) + +#define gcvalueraw(v) ((v).gc) + +#define setgcovalue(L,obj,x) \ + { TValue *io = (obj); GCObject *i_g=(x); \ + val_(io).gc = i_g; settt_(io, ctb(i_g->tt)); } + +/* }================================================================== */ /* -** different types of assignments, according to destination +** {================================================================== +** Numbers +** =================================================================== */ -/* from stack to (same) stack */ -#define setobjs2s setobj -/* to stack (not from same stack) */ -#define setobj2s setobj -#define setsvalue2s setsvalue -#define sethvalue2s sethvalue -#define setptvalue2s setptvalue -/* from table to same table */ -#define setobjt2t setobj -/* to new object */ -#define setobj2n setobj -#define setsvalue2n setsvalue +/* Variant tags for numbers */ +#define LUA_VNUMINT makevariant(LUA_TNUMBER, 0) /* integer numbers */ +#define LUA_VNUMFLT makevariant(LUA_TNUMBER, 1) /* float numbers */ + +#define ttisnumber(o) checktype((o), LUA_TNUMBER) +#define ttisfloat(o) checktag((o), LUA_VNUMFLT) +#define ttisinteger(o) checktag((o), LUA_VNUMINT) + +#define nvalue(o) check_exp(ttisnumber(o), \ + (ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o))) +#define fltvalue(o) check_exp(ttisfloat(o), val_(o).n) +#define ivalue(o) check_exp(ttisinteger(o), val_(o).i) + +#define fltvalueraw(v) ((v).n) +#define ivalueraw(v) ((v).i) + +#define setfltvalue(obj,x) \ + { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_VNUMFLT); } -/* to table (define it as an expression to be used in macros) */ -#define setobj2t(L,o1,o2) ((void)L, *(o1)=*(o2), checkliveness(L,(o1))) +#define chgfltvalue(obj,x) \ + { TValue *io=(obj); lua_assert(ttisfloat(io)); val_(io).n=(x); } + +#define setivalue(obj,x) \ + { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); } +#define chgivalue(obj,x) \ + { TValue *io=(obj); lua_assert(ttisinteger(io)); val_(io).i=(x); } +/* }================================================================== */ /* -** {====================================================== -** types and prototypes -** ======================================================= +** {================================================================== +** Strings +** =================================================================== */ +/* Variant tags for strings */ +#define LUA_VSHRSTR makevariant(LUA_TSTRING, 0) /* short strings */ +#define LUA_VLNGSTR makevariant(LUA_TSTRING, 1) /* long strings */ -typedef TValue *StkId; /* index to stack elements */ +#define ttisstring(o) checktype((o), LUA_TSTRING) +#define ttisshrstring(o) checktag((o), ctb(LUA_VSHRSTR)) +#define ttislngstring(o) checktag((o), ctb(LUA_VLNGSTR)) +#define tsvalueraw(v) (gco2ts((v).gc)) +#define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc)) + +#define setsvalue(L,obj,x) \ + { TValue *io = (obj); TString *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(x_->tt)); \ + checkliveness(L,io); } + +/* set a string to the stack */ +#define setsvalue2s(L,o,s) setsvalue(L,s2v(o),s) + +/* set a string to a new object */ +#define setsvalue2n setsvalue /* -** Header for string value; string bytes follow the end of this structure -** (aligned according to 'UTString'; see next). +** Header for a string value. */ typedef struct TString { CommonHeader; @@ -309,75 +379,121 @@ typedef struct TString { size_t lnglen; /* length for long strings */ struct TString *hnext; /* linked list for hash table */ } u; + char contents[1]; } TString; -/* -** Ensures that address after this type is always fully aligned. -*/ -typedef union UTString { - L_Umaxalign dummy; /* ensures maximum alignment for strings */ - TString tsv; -} UTString; - /* ** Get the actual string (array of bytes) from a 'TString'. -** (Access to 'extra' ensures that value is really a 'TString'.) */ -#define getstr(ts) \ - check_exp(sizeof((ts)->extra), cast(char *, (ts)) + sizeof(UTString)) +#define getstr(ts) ((ts)->contents) /* get the actual string (array of bytes) from a Lua value */ #define svalue(o) getstr(tsvalue(o)) /* get string length from 'TString *s' */ -#define tsslen(s) ((s)->tt == LUA_TSHRSTR ? (s)->shrlen : (s)->u.lnglen) +#define tsslen(s) ((s)->tt == LUA_VSHRSTR ? (s)->shrlen : (s)->u.lnglen) /* get string length from 'TValue *o' */ #define vslen(o) tsslen(tsvalue(o)) +/* }================================================================== */ + + +/* +** {================================================================== +** Userdata +** =================================================================== +*/ + + +/* +** Light userdata should be a variant of userdata, but for compatibility +** reasons they are also different types. +*/ +#define LUA_VLIGHTUSERDATA makevariant(LUA_TLIGHTUSERDATA, 0) + +#define LUA_VUSERDATA makevariant(LUA_TUSERDATA, 0) + +#define ttislightuserdata(o) checktag((o), LUA_VLIGHTUSERDATA) +#define ttisfulluserdata(o) checktag((o), ctb(LUA_VUSERDATA)) + +#define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p) +#define uvalue(o) check_exp(ttisfulluserdata(o), gco2u(val_(o).gc)) + +#define pvalueraw(v) ((v).p) + +#define setpvalue(obj,x) \ + { TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_VLIGHTUSERDATA); } + +#define setuvalue(L,obj,x) \ + { TValue *io = (obj); Udata *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VUSERDATA)); \ + checkliveness(L,io); } + + +/* Ensures that addresses after this type are always fully aligned. */ +typedef union UValue { + TValue uv; + LUAI_MAXALIGN; /* ensures maximum alignment for udata bytes */ +} UValue; + /* -** Header for userdata; memory area follows the end of this structure -** (aligned according to 'UUdata'; see next). +** Header for userdata with user values; +** memory area follows the end of this structure. */ typedef struct Udata { CommonHeader; - lu_byte ttuv_; /* user value's tag */ - struct Table *metatable; + unsigned short nuvalue; /* number of user values */ size_t len; /* number of bytes */ - union Value user_; /* user value */ + struct Table *metatable; + GCObject *gclist; + UValue uv[1]; /* user values */ } Udata; /* -** Ensures that address after this type is always fully aligned. +** Header for userdata with no user values. These userdata do not need +** to be gray during GC, and therefore do not need a 'gclist' field. +** To simplify, the code always use 'Udata' for both kinds of userdata, +** making sure it never accesses 'gclist' on userdata with no user values. +** This structure here is used only to compute the correct size for +** this representation. (The 'bindata' field in its end ensures correct +** alignment for binary data following this header.) */ -typedef union UUdata { - L_Umaxalign dummy; /* ensures maximum alignment for 'local' udata */ - Udata uv; -} UUdata; +typedef struct Udata0 { + CommonHeader; + unsigned short nuvalue; /* number of user values */ + size_t len; /* number of bytes */ + struct Table *metatable; + union {LUAI_MAXALIGN;} bindata; +} Udata0; -/* -** Get the address of memory block inside 'Udata'. -** (Access to 'ttuv_' ensures that value is really a 'Udata'.) -*/ -#define getudatamem(u) \ - check_exp(sizeof((u)->ttuv_), (cast(char*, (u)) + sizeof(UUdata))) +/* compute the offset of the memory area of a userdata */ +#define udatamemoffset(nuv) \ + ((nuv) == 0 ? offsetof(Udata0, bindata) \ + : offsetof(Udata, uv) + (sizeof(UValue) * (nuv))) + +/* get the address of the memory block inside 'Udata' */ +#define getudatamem(u) (cast_charp(u) + udatamemoffset((u)->nuvalue)) -#define setuservalue(L,u,o) \ - { const TValue *io=(o); Udata *iu = (u); \ - iu->user_ = io->value_; iu->ttuv_ = rttype(io); \ - checkliveness(L,io); } +/* compute the size of a userdata */ +#define sizeudata(nuv,nb) (udatamemoffset(nuv) + (nb)) +/* }================================================================== */ + + +/* +** {================================================================== +** Prototypes +** =================================================================== +*/ -#define getuservalue(L,u,o) \ - { TValue *io=(o); const Udata *iu = (u); \ - io->value_ = iu->user_; settt_(io, iu->ttuv_); \ - checkliveness(L,io); } +#define LUA_VPROTO makevariant(LUA_TPROTO, 0) /* @@ -387,6 +503,7 @@ typedef struct Upvaldesc { TString *name; /* upvalue name (for debug information) */ lu_byte instack; /* whether it is in stack (register) */ lu_byte idx; /* index of upvalue (in stack or in outer function's list) */ + lu_byte kind; /* kind of corresponding variable */ } Upvaldesc; @@ -401,12 +518,27 @@ typedef struct LocVar { } LocVar; +/* +** Associates the absolute line source for a given instruction ('pc'). +** The array 'lineinfo' gives, for each instruction, the difference in +** lines from the previous instruction. When that difference does not +** fit into a byte, Lua saves the absolute line for that instruction. +** (Lua also saves the absolute line periodically, to speed up the +** computation of a line number: we can use binary search in the +** absolute-line array, but we must traverse the 'lineinfo' array +** linearly to compute a line.) +*/ +typedef struct AbsLineInfo { + int pc; + int line; +} AbsLineInfo; + /* ** Function Prototypes */ typedef struct Proto { CommonHeader; - lu_byte numparams; /* number of fixed parameters */ + lu_byte numparams; /* number of fixed (named) parameters */ lu_byte is_vararg; lu_byte maxstacksize; /* number of registers needed by this function */ int sizeupvalues; /* size of 'upvalues' */ @@ -415,30 +547,86 @@ typedef struct Proto { int sizelineinfo; int sizep; /* size of 'p' */ int sizelocvars; + int sizeabslineinfo; /* size of 'abslineinfo' */ int linedefined; /* debug information */ int lastlinedefined; /* debug information */ TValue *k; /* constants used by the function */ Instruction *code; /* opcodes */ struct Proto **p; /* functions defined inside the function */ - int *lineinfo; /* map from opcodes to source lines (debug information) */ - LocVar *locvars; /* information about local variables (debug information) */ Upvaldesc *upvalues; /* upvalue information */ - struct LClosure *cache; /* last-created closure with this prototype */ + ls_byte *lineinfo; /* information about source lines (debug information) */ + AbsLineInfo *abslineinfo; /* idem */ + LocVar *locvars; /* information about local variables (debug information) */ TString *source; /* used for debug information */ GCObject *gclist; } Proto; +/* }================================================================== */ /* -** Lua Upvalues +** {================================================================== +** Functions +** =================================================================== */ -typedef struct UpVal UpVal; + +#define LUA_VUPVAL makevariant(LUA_TUPVAL, 0) + + +/* Variant tags for functions */ +#define LUA_VLCL makevariant(LUA_TFUNCTION, 0) /* Lua closure */ +#define LUA_VLCF makevariant(LUA_TFUNCTION, 1) /* light C function */ +#define LUA_VCCL makevariant(LUA_TFUNCTION, 2) /* C closure */ + +#define ttisfunction(o) checktype(o, LUA_TFUNCTION) +#define ttisLclosure(o) checktag((o), ctb(LUA_VLCL)) +#define ttislcf(o) checktag((o), LUA_VLCF) +#define ttisCclosure(o) checktag((o), ctb(LUA_VCCL)) +#define ttisclosure(o) (ttisLclosure(o) || ttisCclosure(o)) + + +#define isLfunction(o) ttisLclosure(o) + +#define clvalue(o) check_exp(ttisclosure(o), gco2cl(val_(o).gc)) +#define clLvalue(o) check_exp(ttisLclosure(o), gco2lcl(val_(o).gc)) +#define fvalue(o) check_exp(ttislcf(o), val_(o).f) +#define clCvalue(o) check_exp(ttisCclosure(o), gco2ccl(val_(o).gc)) + +#define fvalueraw(v) ((v).f) + +#define setclLvalue(L,obj,x) \ + { TValue *io = (obj); LClosure *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VLCL)); \ + checkliveness(L,io); } + +#define setclLvalue2s(L,o,cl) setclLvalue(L,s2v(o),cl) + +#define setfvalue(obj,x) \ + { TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_VLCF); } + +#define setclCvalue(L,obj,x) \ + { TValue *io = (obj); CClosure *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VCCL)); \ + checkliveness(L,io); } /* -** Closures +** Upvalues for Lua closures */ +typedef struct UpVal { + CommonHeader; + lu_byte tbc; /* true if it represents a to-be-closed variable */ + TValue *v; /* points to stack or to its own value */ + union { + struct { /* (when open) */ + struct UpVal *next; /* linked list */ + struct UpVal **previous; + } open; + TValue value; /* the value (when closed) */ + } u; +} UpVal; + + #define ClosureHeader \ CommonHeader; lu_byte nupvalues; GCObject *gclist @@ -463,42 +651,81 @@ typedef union Closure { } Closure; -#define isLfunction(o) ttisLclosure(o) - #define getproto(o) (clLvalue(o)->p) +/* }================================================================== */ + /* +** {================================================================== ** Tables +** =================================================================== */ -typedef union TKey { - struct { - TValuefields; - int next; /* for chaining (offset for next node) */ - } nk; - TValue tvk; -} TKey; +#define LUA_VTABLE makevariant(LUA_TTABLE, 0) + +#define ttistable(o) checktag((o), ctb(LUA_VTABLE)) + +#define hvalue(o) check_exp(ttistable(o), gco2t(val_(o).gc)) +#define sethvalue(L,obj,x) \ + { TValue *io = (obj); Table *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \ + checkliveness(L,io); } -/* copy a value into a key without messing up field 'next' */ -#define setnodekey(L,key,obj) \ - { TKey *k_=(key); const TValue *io_=(obj); \ - k_->nk.value_ = io_->value_; k_->nk.tt_ = io_->tt_; \ - (void)L; checkliveness(L,io_); } +#define sethvalue2s(L,o,h) sethvalue(L,s2v(o),h) -typedef struct Node { - TValue i_val; - TKey i_key; +/* +** Nodes for Hash tables: A pack of two TValue's (key-value pairs) +** plus a 'next' field to link colliding entries. The distribution +** of the key's fields ('key_tt' and 'key_val') not forming a proper +** 'TValue' allows for a smaller size for 'Node' both in 4-byte +** and 8-byte alignments. +*/ +typedef union Node { + struct NodeKey { + TValuefields; /* fields for value */ + lu_byte key_tt; /* key type */ + int next; /* for chaining */ + Value key_val; /* key value */ + } u; + TValue i_val; /* direct access to node's value as a proper 'TValue' */ } Node; +/* copy a value into a key */ +#define setnodekey(L,node,obj) \ + { Node *n_=(node); const TValue *io_=(obj); \ + n_->u.key_val = io_->value_; n_->u.key_tt = io_->tt_; \ + checkliveness(L,io_); } + + +/* copy a value from a key */ +#define getnodekey(L,obj,node) \ + { TValue *io_=(obj); const Node *n_=(node); \ + io_->value_ = n_->u.key_val; io_->tt_ = n_->u.key_tt; \ + checkliveness(L,io_); } + + +/* +** About 'alimit': if 'isrealasize(t)' is true, then 'alimit' is the +** real size of 'array'. Otherwise, the real size of 'array' is the +** smallest power of two not smaller than 'alimit' (or zero iff 'alimit' +** is zero); 'alimit' is then used as a hint for #t. +*/ + +#define BITRAS (1 << 7) +#define isrealasize(t) (!((t)->flags & BITRAS)) +#define setrealasize(t) ((t)->flags &= cast_byte(~BITRAS)) +#define setnorealasize(t) ((t)->flags |= BITRAS) + + typedef struct Table { CommonHeader; lu_byte flags; /* 1<

u.key_tt) +#define keyval(node) ((node)->u.key_val) + +#define keyisnil(node) (keytt(node) == LUA_TNIL) +#define keyisinteger(node) (keytt(node) == LUA_VNUMINT) +#define keyival(node) (keyval(node).i) +#define keyisshrstr(node) (keytt(node) == ctb(LUA_VSHRSTR)) +#define keystrval(node) (gco2ts(keyval(node).gc)) + +#define setnilkey(node) (keytt(node) = LUA_TNIL) + +#define keyiscollectable(n) (keytt(n) & BIT_ISCOLLECTABLE) + +#define gckey(n) (keyval(n).gc) +#define gckeyN(n) (keyiscollectable(n) ? gckey(n) : NULL) + /* -** 'module' operation for hashing (size is always a power of 2) +** Dead keys in tables have the tag DEADKEY but keep their original +** gcvalue. This distinguishes them from regular keys but allows them to +** be found when searched in a special way. ('next' needs that to find +** keys removed from a table during a traversal.) */ -#define lmod(s,size) \ - (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1))))) +#define setdeadkey(node) (keytt(node) = LUA_TDEADKEY) +#define keyisdead(node) (keytt(node) == LUA_TDEADKEY) +/* }================================================================== */ -#define twoto(x) (1<<(x)) -#define sizenode(t) (twoto((t)->lsizenode)) /* -** (address of) a fixed nil value +** 'module' operation for hashing (size is always a power of 2) */ -#define luaO_nilobject (&luaO_nilobject_) +#define lmod(s,size) \ + (check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1))))) + +#define twoto(x) (1<<(x)) +#define sizenode(t) (twoto((t)->lsizenode)) -LUAI_DDEC const TValue luaO_nilobject_; /* size of buffer for 'luaO_utf8esc' function */ #define UTF8BUFFSZ 8 -LUAI_FUNC int luaO_int2fb (unsigned int x); -LUAI_FUNC int luaO_fb2int (int x); LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x); LUAI_FUNC int luaO_ceillog2 (unsigned int x); +LUAI_FUNC int luaO_rawarith (lua_State *L, int op, const TValue *p1, + const TValue *p2, TValue *res); LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, - const TValue *p2, TValue *res); + const TValue *p2, StkId res); LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o); LUAI_FUNC int luaO_hexavalue (int c); -LUAI_FUNC void luaO_tostring (lua_State *L, StkId obj); +LUAI_FUNC void luaO_tostring (lua_State *L, TValue *obj); LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp); LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); -LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); +LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t srclen); #endif diff --git a/include/lopcodes.h b/include/lopcodes.h index bbc4b61968aaa..7c27451596065 100644 --- a/include/lopcodes.h +++ b/include/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.149 2016/07/19 17:12:21 roberto Exp $ +** $Id: lopcodes.h $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -11,69 +11,94 @@ /*=========================================================================== - We assume that instructions are unsigned numbers. - All instructions have an opcode in the first 6 bits. - Instructions can have the following fields: - 'A' : 8 bits - 'B' : 9 bits - 'C' : 9 bits - 'Ax' : 26 bits ('A', 'B', and 'C' together) - 'Bx' : 18 bits ('B' and 'C' together) - 'sBx' : signed Bx - - A signed argument is represented in excess K; that is, the number - value is the unsigned value minus K. K is exactly the maximum value - for that argument (so that -max is represented by 0, and +max is - represented by 2*max), which is half the maximum for the corresponding - unsigned argument. + We assume that instructions are unsigned 32-bit integers. + All instructions have an opcode in the first 7 bits. + Instructions can have the following formats: + + 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 + 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +iABC C(8) | B(8) |k| A(8) | Op(7) | +iABx Bx(17) | A(8) | Op(7) | +iAsBx sBx (signed)(17) | A(8) | Op(7) | +iAx Ax(25) | Op(7) | +isJ sJ(25) | Op(7) | + + A signed argument is represented in excess K: the represented value is + the written unsigned value minus K, where K is half the maximum for the + corresponding unsigned argument. ===========================================================================*/ -enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */ +enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */ /* ** size and position of opcode arguments. */ -#define SIZE_C 9 -#define SIZE_B 9 -#define SIZE_Bx (SIZE_C + SIZE_B) +#define SIZE_C 8 +#define SIZE_B 8 +#define SIZE_Bx (SIZE_C + SIZE_B + 1) #define SIZE_A 8 -#define SIZE_Ax (SIZE_C + SIZE_B + SIZE_A) +#define SIZE_Ax (SIZE_Bx + SIZE_A) +#define SIZE_sJ (SIZE_Bx + SIZE_A) -#define SIZE_OP 6 +#define SIZE_OP 7 #define POS_OP 0 + #define POS_A (POS_OP + SIZE_OP) -#define POS_C (POS_A + SIZE_A) -#define POS_B (POS_C + SIZE_C) -#define POS_Bx POS_C +#define POS_k (POS_A + SIZE_A) +#define POS_B (POS_k + 1) +#define POS_C (POS_B + SIZE_B) + +#define POS_Bx POS_k + #define POS_Ax POS_A +#define POS_sJ POS_A + /* ** limits for opcode arguments. -** we use (signed) int to manipulate most arguments, -** so they must fit in LUAI_BITSINT-1 bits (-1 for sign) +** we use (signed) 'int' to manipulate most arguments, +** so they must fit in ints. */ -#if SIZE_Bx < LUAI_BITSINT-1 -#define MAXARG_Bx ((1<>1) /* 'sBx' is signed */ + +/* Check whether type 'int' has at least 'b' bits ('b' < 32) */ +#define L_INTHASBITS(b) ((UINT_MAX >> ((b) - 1)) >= 1) + + +#if L_INTHASBITS(SIZE_Bx) +#define MAXARG_Bx ((1<>1) /* 'sBx' is signed */ + + +#if L_INTHASBITS(SIZE_Ax) #define MAXARG_Ax ((1<> 1) -#define MAXARG_A ((1<> 1) + +#define int2sC(i) ((i) + OFFSET_sC) +#define sC2int(i) ((i) - OFFSET_sC) /* creates a mask with 'n' 1 bits at position 'p' */ @@ -90,33 +115,49 @@ enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */ #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ ((cast(Instruction, o)<>pos) & MASK1(size,0))) +#define checkopm(i,m) (getOpMode(GET_OPCODE(i)) == m) + + +#define getarg(i,pos,size) (cast_int(((i)>>(pos)) & MASK1(size,0))) #define setarg(i,v,pos,size) ((i) = (((i)&MASK0(size,pos)) | \ ((cast(Instruction, v)<> RK(C) */ -OP_UNM,/* A B R(A) := -R(B) */ -OP_BNOT,/* A B R(A) := ~R(B) */ -OP_NOT,/* A B R(A) := not R(B) */ -OP_LEN,/* A B R(A) := length of R(B) */ - -OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ - -OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A - 1) */ -OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ -OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ -OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ - -OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ -OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ - -OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ -OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ -OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ - -OP_FORLOOP,/* A sBx R(A)+=R(A+2); - if R(A) > sC */ +OP_SHLI,/* A B sC R[A] := sC << R[B] */ + +OP_ADD,/* A B C R[A] := R[B] + R[C] */ +OP_SUB,/* A B C R[A] := R[B] - R[C] */ +OP_MUL,/* A B C R[A] := R[B] * R[C] */ +OP_MOD,/* A B C R[A] := R[B] % R[C] */ +OP_POW,/* A B C R[A] := R[B] ^ R[C] */ +OP_DIV,/* A B C R[A] := R[B] / R[C] */ +OP_IDIV,/* A B C R[A] := R[B] // R[C] */ + +OP_BAND,/* A B C R[A] := R[B] & R[C] */ +OP_BOR,/* A B C R[A] := R[B] | R[C] */ +OP_BXOR,/* A B C R[A] := R[B] ~ R[C] */ +OP_SHL,/* A B C R[A] := R[B] << R[C] */ +OP_SHR,/* A B C R[A] := R[B] >> R[C] */ + +OP_MMBIN,/* A B C call C metamethod over R[A] and R[B] (*) */ +OP_MMBINI,/* A sB C k call C metamethod over R[A] and sB */ +OP_MMBINK,/* A B C k call C metamethod over R[A] and K[B] */ + +OP_UNM,/* A B R[A] := -R[B] */ +OP_BNOT,/* A B R[A] := ~R[B] */ +OP_NOT,/* A B R[A] := not R[B] */ +OP_LEN,/* A B R[A] := #R[B] (length operator) */ + +OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */ + +OP_CLOSE,/* A close all upvalues >= R[A] */ +OP_TBC,/* A mark variable A "to be closed" */ +OP_JMP,/* sJ pc += sJ */ +OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */ +OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */ +OP_LE,/* A B k if ((R[A] <= R[B]) ~= k) then pc++ */ + +OP_EQK,/* A B k if ((R[A] == K[B]) ~= k) then pc++ */ +OP_EQI,/* A sB k if ((R[A] == sB) ~= k) then pc++ */ +OP_LTI,/* A sB k if ((R[A] < sB) ~= k) then pc++ */ +OP_LEI,/* A sB k if ((R[A] <= sB) ~= k) then pc++ */ +OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */ +OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */ + +OP_TEST,/* A k if (not R[A] == k) then pc++ */ +OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] (*) */ + +OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */ +OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */ + +OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */ +OP_RETURN0,/* return */ +OP_RETURN1,/* A return R[A] */ + +OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */ +OP_FORPREP,/* A Bx ; + if not to run then pc+=Bx+1; */ + +OP_TFORPREP,/* A Bx create upvalue for R[A + 3]; pc+=Bx */ +OP_TFORCALL,/* A C R[A+4], ... ,R[A+3+C] := R[A](R[A+1], R[A+2]); */ +OP_TFORLOOP,/* A Bx if R[A+2] ~= nil then { R[A]=R[A+2]; pc -= Bx } */ + +OP_SETLIST,/* A B C k R[A][C+i] := R[A+i], 1 <= i <= B */ + +OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */ + +OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */ -OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ - -OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx]) */ - -OP_VARARG,/* A B R(A), R(A+1), ..., R(A+B-2) = vararg */ +OP_VARARGPREP,/*A (adjust vararg parameters) */ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ } OpCode; -#define NUM_OPCODES (cast(int, OP_EXTRAARG) + 1) +#define NUM_OPCODES ((int)(OP_EXTRAARG) + 1) /*=========================================================================== Notes: - (*) In OP_CALL, if (B == 0) then B = top. If (C == 0), then 'top' is - set to last_result+1, so next open instruction (OP_CALL, OP_RETURN, - OP_SETLIST) may use 'top'. - (*) In OP_VARARG, if (B == 0) then use actual number of varargs and + (*) Opcode OP_LFALSESKIP is used to convert a condition to a boolean + value, in a code equivalent to (not cond ? false : true). (It + produces false and skips the next instruction producing true.) + + (*) Opcodes OP_MMBIN and variants follow each arithmetic and + bitwise opcode. If the operation succeeds, it skips this next + opcode. Otherwise, this opcode calls the corresponding metamethod. + + (*) Opcode OP_TESTSET is used in short-circuit expressions that need + both to jump and to produce a value, such as (a = b or c). + + (*) In OP_CALL, if (B == 0) then B = top - A. If (C == 0), then + 'top' is set to last_result+1, so next open instruction (OP_CALL, + OP_RETURN*, OP_SETLIST) may use 'top'. + + (*) In OP_VARARG, if (C == 0) then use actual number of varargs and set top (like in OP_CALL with C == 0). (*) In OP_RETURN, if (B == 0) then return up to 'top'. - (*) In OP_SETLIST, if (B == 0) then B = 'top'; if (C == 0) then next - 'instruction' is EXTRAARG(real C). + (*) In OP_LOADKX and OP_NEWTABLE, the next instruction is always + OP_EXTRAARG. - (*) In OP_LOADKX, the next 'instruction' is always EXTRAARG. + (*) In OP_SETLIST, if (B == 0) then real B = 'top'; if k, then + real C = EXTRAARG _ C (the bits of EXTRAARG concatenated with the + bits of C). - (*) For comparisons, A specifies what condition the test should accept + (*) In OP_NEWTABLE, B is log2 of the hash size (which is always a + power of 2) plus 1, or zero for size zero. If not k, the array size + is C. Otherwise, the array size is EXTRAARG _ C. + + (*) For comparisons, k specifies what condition the test should accept (true or false). + (*) In OP_MMBINI/OP_MMBINK, k means the arguments were flipped + (the constant is the first operand). + (*) All 'skips' (pc++) assume that next instruction is a jump. + (*) In instructions OP_RETURN/OP_TAILCALL, 'k' specifies that the + function builds upvalues, which may need to be closed. C > 0 means + the function is vararg, so that its 'func' must be corrected before + returning; in this case, (C - 1) is its number of fixed parameters. + + (*) In comparisons with an immediate operand, C signals whether the + original operand was a float. (It must be corrected in case of + metamethods.) + ===========================================================================*/ /* ** masks for instruction properties. The format is: -** bits 0-1: op mode -** bits 2-3: C arg mode -** bits 4-5: B arg mode -** bit 6: instruction set register A -** bit 7: operator is a test (next instruction must be a jump) +** bits 0-2: op mode +** bit 3: instruction set register A +** bit 4: operator is a test (next instruction must be a jump) +** bit 5: instruction uses 'L->top' set by previous instruction (when B == 0) +** bit 6: instruction sets 'L->top' for next instruction (when C == 0) +** bit 7: instruction is an MM instruction (call a metamethod) */ -enum OpArgMask { - OpArgN, /* argument is not used */ - OpArgU, /* argument is used */ - OpArgR, /* argument is a register or a jump offset */ - OpArgK /* argument is a constant or register/constant */ -}; +LUAI_DDEC(const lu_byte luaP_opmodes[NUM_OPCODES];) -LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; +#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 7)) +#define testAMode(m) (luaP_opmodes[m] & (1 << 3)) +#define testTMode(m) (luaP_opmodes[m] & (1 << 4)) +#define testITMode(m) (luaP_opmodes[m] & (1 << 5)) +#define testOTMode(m) (luaP_opmodes[m] & (1 << 6)) +#define testMMMode(m) (luaP_opmodes[m] & (1 << 7)) -#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) -#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) -#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3)) -#define testAMode(m) (luaP_opmodes[m] & (1 << 6)) -#define testTMode(m) (luaP_opmodes[m] & (1 << 7)) +/* "out top" (set top for next instruction) */ +#define isOT(i) \ + ((testOTMode(GET_OPCODE(i)) && GETARG_C(i) == 0) || \ + GET_OPCODE(i) == OP_TAILCALL) +/* "in top" (uses top from previous instruction) */ +#define isIT(i) (testITMode(GET_OPCODE(i)) && GETARG_B(i) == 0) -LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ +#define opmode(mm,ot,it,t,a,m) \ + (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m)) /* number of list items to accumulate before a SETLIST instruction */ #define LFIELDS_PER_FLUSH 50 - #endif diff --git a/include/lparser.h b/include/lparser.h index 02e9b03aebcb7..5e4500f181a80 100644 --- a/include/lparser.h +++ b/include/lparser.h @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.76 2015/12/30 18:16:13 roberto Exp $ +** $Id: lparser.h $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -23,63 +23,96 @@ /* kinds of variables/expressions */ typedef enum { - VVOID, /* when 'expdesc' describes the last expression a list, + VVOID, /* when 'expdesc' describes the last expression of a list, this kind means an empty list (so, no expression) */ VNIL, /* constant nil */ VTRUE, /* constant true */ VFALSE, /* constant false */ VK, /* constant in 'k'; info = index of constant in 'k' */ VKFLT, /* floating constant; nval = numerical float value */ - VKINT, /* integer constant; nval = numerical integer value */ + VKINT, /* integer constant; ival = numerical integer value */ + VKSTR, /* string constant; strval = TString address; + (string is fixed by the lexer) */ VNONRELOC, /* expression has its value in a fixed register; info = result register */ - VLOCAL, /* local variable; info = local register */ + VLOCAL, /* local variable; var.ridx = register index; + var.vidx = relative index in 'actvar.arr' */ VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */ + VCONST, /* compile-time variable; + info = absolute index in 'actvar.arr' */ VINDEXED, /* indexed variable; - ind.vt = whether 't' is register or upvalue; - ind.t = table register or upvalue; - ind.idx = key's R/K index */ + ind.t = table register; + ind.idx = key's R index */ + VINDEXUP, /* indexed upvalue; + ind.t = table upvalue; + ind.idx = key's K index */ + VINDEXI, /* indexed variable with constant integer; + ind.t = table register; + ind.idx = key's value */ + VINDEXSTR, /* indexed variable with literal string; + ind.t = table register; + ind.idx = key's K index */ VJMP, /* expression is a test/comparison; info = pc of corresponding jump instruction */ - VRELOCABLE, /* expression can put result in any register; - info = instruction pc */ + VRELOC, /* expression can put result in any register; + info = instruction pc */ VCALL, /* expression is a function call; info = instruction pc */ VVARARG /* vararg expression; info = instruction pc */ } expkind; -#define vkisvar(k) (VLOCAL <= (k) && (k) <= VINDEXED) -#define vkisinreg(k) ((k) == VNONRELOC || (k) == VLOCAL) +#define vkisvar(k) (VLOCAL <= (k) && (k) <= VINDEXSTR) +#define vkisindexed(k) (VINDEXED <= (k) && (k) <= VINDEXSTR) + typedef struct expdesc { expkind k; union { lua_Integer ival; /* for VKINT */ lua_Number nval; /* for VKFLT */ + TString *strval; /* for VKSTR */ int info; /* for generic use */ - struct { /* for indexed variables (VINDEXED) */ - short idx; /* index (R/K) */ + struct { /* for indexed variables */ + short idx; /* index (R or "long" K) */ lu_byte t; /* table (register or upvalue) */ - lu_byte vt; /* whether 't' is register (VLOCAL) or upvalue (VUPVAL) */ } ind; + struct { /* for local variables */ + lu_byte ridx; /* register holding the variable */ + unsigned short vidx; /* compiler index (in 'actvar.arr') */ + } var; } u; int t; /* patch list of 'exit when true' */ int f; /* patch list of 'exit when false' */ } expdesc; -/* description of active local variable */ -typedef struct Vardesc { - short idx; /* variable index in stack */ +/* kinds of variables */ +#define VDKREG 0 /* regular */ +#define RDKCONST 1 /* constant */ +#define RDKTOCLOSE 2 /* to-be-closed */ +#define RDKCTC 3 /* compile-time constant */ + +/* description of an active local variable */ +typedef union Vardesc { + struct { + TValuefields; /* constant value (if it is a compile-time constant) */ + lu_byte kind; + lu_byte ridx; /* register holding the variable */ + short pidx; /* index of the variable in the Proto's 'locvars' array */ + TString *name; /* variable name */ + } vd; + TValue k; /* constant value (if any) */ } Vardesc; + /* description of pending goto statements and label statements */ typedef struct Labeldesc { TString *name; /* label identifier */ int pc; /* position in code */ int line; /* line where it appeared */ - lu_byte nactvar; /* local level where it appears in current block */ + lu_byte nactvar; /* number of active variables in that position */ + lu_byte close; /* goto that escapes upvalues */ } Labeldesc; @@ -93,7 +126,7 @@ typedef struct Labellist { /* dynamic structures used by the parser */ typedef struct Dyndata { - struct { /* list of active local variables */ + struct { /* list of all active local variables */ Vardesc *arr; int n; int size; @@ -115,17 +148,22 @@ typedef struct FuncState { struct BlockCnt *bl; /* chain of current blocks */ int pc; /* next position to code (equivalent to 'ncode') */ int lasttarget; /* 'label' of last 'jump label' */ - int jpc; /* list of pending jumps to 'pc' */ + int previousline; /* last line that was saved in 'lineinfo' */ int nk; /* number of elements in 'k' */ int np; /* number of elements in 'p' */ + int nabslineinfo; /* number of elements in 'abslineinfo' */ int firstlocal; /* index of first local var (in Dyndata array) */ - short nlocvars; /* number of elements in 'f->locvars' */ + int firstlabel; /* index of first label (in 'dyd->label->arr') */ + short ndebugvars; /* number of elements in 'f->locvars' */ lu_byte nactvar; /* number of active local variables */ lu_byte nups; /* number of upvalues */ lu_byte freereg; /* first free register */ + lu_byte iwthabs; /* instructions issued since last absolute line info */ + lu_byte needclose; /* function needs to close upvalues when returning */ } FuncState; +LUAI_FUNC int luaY_nvarstack (FuncState *fs); LUAI_FUNC LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar); diff --git a/include/lprefix.h b/include/lprefix.h index 02daa837f5524..484f2ad6fbfc5 100644 --- a/include/lprefix.h +++ b/include/lprefix.h @@ -1,5 +1,5 @@ /* -** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ +** $Id: lprefix.h $ ** Definitions for Lua code that must come before any other header file ** See Copyright Notice in lua.h */ @@ -33,7 +33,7 @@ /* ** Windows stuff */ -#if defined(_WIN32) /* { */ +#if defined(_WIN32) /* { */ #if !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ diff --git a/include/lstate.h b/include/lstate.h index a469466c44758..61e82cde72530 100644 --- a/include/lstate.h +++ b/include/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstate.h $ ** Global State ** See Copyright Notice in lua.h */ @@ -15,7 +15,6 @@ /* - ** Some notes about garbage-collected objects: All objects in Lua must ** be kept somehow accessible until being freed, so all objects always ** belong to one (and only one) of these lists, using field 'next' of @@ -26,10 +25,95 @@ ** 'tobefnz': all objects ready to be finalized; ** 'fixedgc': all objects that are not to be collected (currently ** only small strings, such as reserved words). +** +** For the generational collector, some of these lists have marks for +** generations. Each mark points to the first element in the list for +** that particular generation; that generation goes until the next mark. +** +** 'allgc' -> 'survival': new objects; +** 'survival' -> 'old': objects that survived one collection; +** 'old1' -> 'reallyold': objects that became old in last collection; +** 'reallyold' -> NULL: objects old for more than one cycle. +** +** 'finobj' -> 'finobjsur': new objects marked for finalization; +** 'finobjsur' -> 'finobjold1': survived """"; +** 'finobjold1' -> 'finobjrold': just old """"; +** 'finobjrold' -> NULL: really old """". +** +** All lists can contain elements older than their main ages, due +** to 'luaC_checkfinalizer' and 'udata2finalize', which move +** objects between the normal lists and the "marked for finalization" +** lists. Moreover, barriers can age young objects in young lists as +** OLD0, which then become OLD1. However, a list never contains +** elements younger than their main ages. +** +** The generational collector also uses a pointer 'firstold1', which +** points to the first OLD1 object in the list. It is used to optimize +** 'markold'. (Potentially OLD1 objects can be anywhere between 'allgc' +** and 'reallyold', but often the list has no OLD1 objects or they are +** after 'old1'.) Note the difference between it and 'old1': +** 'firstold1': no OLD1 objects before this point; there can be all +** ages after it. +** 'old1': no objects younger than OLD1 after this point. +*/ +/* +** Moreover, there is another set of lists that control gray objects. +** These lists are linked by fields 'gclist'. (All objects that +** can become gray have such a field. The field is not the same +** in all objects, but it always has this name.) Any gray object +** must belong to one of these lists, and all objects in these lists +** must be gray (with two exceptions explained below): +** +** 'gray': regular gray objects, still waiting to be visited. +** 'grayagain': objects that must be revisited at the atomic phase. +** That includes +** - black objects got in a write barrier; +** - all kinds of weak tables during propagation phase; +** - all threads. +** 'weak': tables with weak values to be cleared; +** 'ephemeron': ephemeron tables with white->white entries; +** 'allweak': tables with weak keys and/or weak values to be cleared. +** +** The exceptions to that "gray rule" are: +** - TOUCHED2 objects in generational mode stay in a gray list (because +** they must be visited again at the end of the cycle), but they are +** marked black because assignments to them must activate barriers (to +** move them back to TOUCHED1). +** - Open upvales are kept gray to avoid barriers, but they stay out +** of gray lists. (They don't even have a 'gclist' field.) */ + +/* +** About 'nCcalls': This count has two parts: the lower 16 bits counts +** the number of recursive invocations in the C stack; the higher +** 16 bits counts the number of non-yieldable calls in the stack. +** (They are together so that we can change and save both with one +** instruction.) +*/ + + +/* true if this thread does not have non-yieldable calls in the stack */ +#define yieldable(L) (((L)->nCcalls & 0xffff0000) == 0) + +/* real number of C calls */ +#define getCcalls(L) ((L)->nCcalls & 0xffff) + + +/* Increment the number of non-yieldable calls */ +#define incnny(L) ((L)->nCcalls += 0x10000) + +/* Decrement the number of non-yieldable calls */ +#define decnny(L) ((L)->nCcalls -= 0x10000) + +/* Non-yieldable call increment */ +#define nyci (0x10000 | 1) + + + + struct lua_longjmp; /* defined in ldo.c */ @@ -43,16 +127,24 @@ struct lua_longjmp; /* defined in ldo.c */ #endif -/* extra stack space to handle TM calls and some other extras */ +/* +** Extra stack space to handle TM calls and some other extras. This +** space is not included in 'stack_last'. It is used only to avoid stack +** checks, either because the element will be promptly popped or because +** there will be a stack check soon after the push. Function frames +** never use this extra space, so it does not need to be kept clean. +*/ #define EXTRA_STACK 5 #define BASIC_STACK_SIZE (2*LUA_MINSTACK) +#define stacksize(th) cast_int((th)->stack_last - (th)->stack) + /* kinds of Garbage Collection */ -#define KGC_NORMAL 0 -#define KGC_EMERGENCY 1 /* gc was forced by an allocation failure */ +#define KGC_INC 0 /* incremental gc */ +#define KGC_GEN 1 /* generational gc */ typedef struct stringtable { @@ -64,12 +156,18 @@ typedef struct stringtable { /* ** Information about a call. -** When a thread yields, 'func' is adjusted to pretend that the -** top function has only the yielded values in its stack; in that -** case, the actual 'func' value is saved in field 'extra'. -** When a function calls another with a continuation, 'extra' keeps -** the function index so that, in case of errors, the continuation -** function can be called with the correct top. +** About union 'u': +** - field 'l' is used only for Lua functions; +** - field 'c' is used only for C functions. +** About union 'u2': +** - field 'funcidx' is used only by C functions while doing a +** protected call; +** - field 'nyield' is used only while a function is "doing" an +** yield (from the yield until the next resume); +** - field 'nres' is used only while closing tbc variables when +** returning from a function; +** - field 'transferinfo' is used only during call/returnhooks, +** before the function starts or after it ends. */ typedef struct CallInfo { StkId func; /* function index in the stack */ @@ -77,8 +175,9 @@ typedef struct CallInfo { struct CallInfo *previous, *next; /* dynamic call link */ union { struct { /* only for Lua functions */ - StkId base; /* base for this function */ const Instruction *savedpc; + volatile l_signalT trap; + int nextraargs; /* # of extra arguments in vararg functions */ } l; struct { /* only for C functions */ lua_KFunction k; /* continuation in case of yields */ @@ -86,7 +185,15 @@ typedef struct CallInfo { lua_KContext ctx; /* context info. in case of yields */ } c; } u; - ptrdiff_t extra; + union { + int funcidx; /* called-function index */ + int nyield; /* number of values yielded */ + int nres; /* number of values returned */ + struct { /* info about transferred values (for call/return hooks) */ + unsigned short ftransfer; /* offset of first value transferred */ + unsigned short ntransfer; /* number of values transferred */ + } transferinfo; + } u2; short nresults; /* expected number of results from this function */ unsigned short callstatus; } CallInfo; @@ -96,17 +203,40 @@ typedef struct CallInfo { ** Bits in CallInfo status */ #define CIST_OAH (1<<0) /* original value of 'allowhook' */ -#define CIST_LUA (1<<1) /* call is running a Lua function */ -#define CIST_HOOKED (1<<2) /* call is running a debug hook */ -#define CIST_FRESH (1<<3) /* call is running on a fresh invocation - of luaV_execute */ -#define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ +#define CIST_C (1<<1) /* call is running a C function */ +#define CIST_FRESH (1<<2) /* call is on a fresh "luaV_execute" frame */ +#define CIST_HOOKED (1<<3) /* call is running a debug hook */ +#define CIST_YPCALL (1<<4) /* doing a yieldable protected call */ #define CIST_TAIL (1<<5) /* call was tail called */ #define CIST_HOOKYIELD (1<<6) /* last hook called yielded */ -#define CIST_LEQ (1<<7) /* using __lt for __le */ -#define CIST_FIN (1<<8) /* call is running a finalizer */ +#define CIST_FIN (1<<7) /* function "called" a finalizer */ +#define CIST_TRAN (1<<8) /* 'ci' has transfer information */ +#define CIST_CLSRET (1<<9) /* function is closing tbc variables */ +/* Bits 10-12 are used for CIST_RECST (see below) */ +#define CIST_RECST 10 +#if defined(LUA_COMPAT_LT_LE) +#define CIST_LEQ (1<<13) /* using __lt for __le */ +#endif + + +/* +** Field CIST_RECST stores the "recover status", used to keep the error +** status while closing to-be-closed variables in coroutines, so that +** Lua can correctly resume after an yield from a __close method called +** because of an error. (Three bits are enough for error status.) +*/ +#define getcistrecst(ci) (((ci)->callstatus >> CIST_RECST) & 7) +#define setcistrecst(ci,st) \ + check_exp(((st) & 7) == (st), /* status must fit in three bits */ \ + ((ci)->callstatus = ((ci)->callstatus & ~(7 << CIST_RECST)) \ + | ((st) << CIST_RECST))) + + +/* active function is a Lua function */ +#define isLua(ci) (!((ci)->callstatus & CIST_C)) -#define isLua(ci) ((ci)->callstatus & CIST_LUA) +/* call is running Lua code (not a hook) */ +#define isLuacode(ci) (!((ci)->callstatus & (CIST_C | CIST_HOOKED))) /* assume that CIST_OAH has offset 0 and that 'v' is strictly 0/1 */ #define setoah(st,v) ((st) = ((st) & ~CIST_OAH) | (v)) @@ -121,15 +251,23 @@ typedef struct global_State { void *ud; /* auxiliary data to 'frealloc' */ l_mem totalbytes; /* number of bytes currently allocated - GCdebt */ l_mem GCdebt; /* bytes allocated not yet compensated by the collector */ - lu_mem GCmemtrav; /* memory traversed by the GC */ lu_mem GCestimate; /* an estimate of the non-garbage memory in use */ + lu_mem lastatomic; /* see function 'genstep' in file 'lgc.c' */ stringtable strt; /* hash table for strings */ TValue l_registry; + TValue nilvalue; /* a nil value */ unsigned int seed; /* randomized seed for hashes */ lu_byte currentwhite; lu_byte gcstate; /* state of garbage collector */ lu_byte gckind; /* kind of GC running */ - lu_byte gcrunning; /* true if GC is running */ + lu_byte gcstopem; /* stops emergency collections */ + lu_byte genminormul; /* control for minor generational collections */ + lu_byte genmajormul; /* control for major generational collections */ + lu_byte gcstp; /* control whether GC is running */ + lu_byte gcemergency; /* true if this is an emergency collection */ + lu_byte gcpause; /* size of pause between successive GCs */ + lu_byte gcstepmul; /* GC "speed" */ + lu_byte gcstepsize; /* (log2 of) GC granularity */ GCObject *allgc; /* list of all collectable objects */ GCObject **sweepgc; /* current position of sweep in list */ GCObject *finobj; /* list of collectable objects with finalizers */ @@ -140,17 +278,23 @@ typedef struct global_State { GCObject *allweak; /* list of all-weak tables */ GCObject *tobefnz; /* list of userdata to be GC */ GCObject *fixedgc; /* list of objects not to be collected */ + /* fields for generational collector */ + GCObject *survival; /* start of objects that survived one GC cycle */ + GCObject *old1; /* start of old1 objects */ + GCObject *reallyold; /* objects more than one cycle old ("really old") */ + GCObject *firstold1; /* first OLD1 object in the list (if any) */ + GCObject *finobjsur; /* list of survival objects with finalizers */ + GCObject *finobjold1; /* list of old1 objects with finalizers */ + GCObject *finobjrold; /* list of really old objects with finalizers */ struct lua_State *twups; /* list of threads with open upvalues */ - unsigned int gcfinnum; /* number of finalizers to call in each GC step */ - int gcpause; /* size of pause between successive GCs */ - int gcstepmul; /* GC 'granularity' */ lua_CFunction panic; /* to be called in unprotected errors */ struct lua_State *mainthread; - const lua_Number *version; /* pointer to version number */ - TString *memerrmsg; /* memory-error message */ + TString *memerrmsg; /* message for memory-allocation errors */ TString *tmname[TM_N]; /* array with tag-method names */ struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */ TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ + lua_WarnFunction warnf; /* warning function */ + void *ud_warn; /* auxiliary data to 'warnf' */ } global_State; @@ -159,36 +303,47 @@ typedef struct global_State { */ struct lua_State { CommonHeader; - unsigned short nci; /* number of items in 'ci' list */ lu_byte status; + lu_byte allowhook; + unsigned short nci; /* number of items in 'ci' list */ StkId top; /* first free slot in the stack */ global_State *l_G; CallInfo *ci; /* call info for current function */ - const Instruction *oldpc; /* last pc traced */ - StkId stack_last; /* last free slot in the stack */ + StkId stack_last; /* end of stack (last element + 1) */ StkId stack; /* stack base */ UpVal *openupval; /* list of open upvalues in this stack */ + StkId tbclist; /* list of to-be-closed variables */ GCObject *gclist; struct lua_State *twups; /* list of threads with open upvalues */ struct lua_longjmp *errorJmp; /* current error recover point */ CallInfo base_ci; /* CallInfo for first level (C calling Lua) */ volatile lua_Hook hook; ptrdiff_t errfunc; /* current error handling function (stack index) */ - int stacksize; + l_uint32 nCcalls; /* number of nested (non-yieldable | C) calls */ + int oldpc; /* last pc traced */ int basehookcount; int hookcount; - unsigned short nny; /* number of non-yieldable calls in stack */ - unsigned short nCcalls; /* number of nested C calls */ - l_signalT hookmask; - lu_byte allowhook; + volatile l_signalT hookmask; }; #define G(L) (L->l_G) +/* +** 'g->nilvalue' being a nil value flags that the state was completely +** build. +*/ +#define completestate(g) ttisnil(&g->nilvalue) + /* ** Union of all collectable objects (only for conversions) +** ISO C99, 6.5.2.3 p.5: +** "if a union contains several structures that share a common initial +** sequence [...], and if the union object currently contains one +** of these structures, it is permitted to inspect the common initial +** part of any of them anywhere that a declaration of the complete type +** of the union is visible." */ union GCUnion { GCObject gc; /* common header */ @@ -198,27 +353,36 @@ union GCUnion { struct Table h; struct Proto p; struct lua_State th; /* thread */ + struct UpVal upv; }; +/* +** ISO C99, 6.7.2.1 p.14: +** "A pointer to a union object, suitably converted, points to each of +** its members [...], and vice versa." +*/ #define cast_u(o) cast(union GCUnion *, (o)) /* macros to convert a GCObject into a specific value */ #define gco2ts(o) \ check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)) -#define gco2u(o) check_exp((o)->tt == LUA_TUSERDATA, &((cast_u(o))->u)) -#define gco2lcl(o) check_exp((o)->tt == LUA_TLCL, &((cast_u(o))->cl.l)) -#define gco2ccl(o) check_exp((o)->tt == LUA_TCCL, &((cast_u(o))->cl.c)) +#define gco2u(o) check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u)) +#define gco2lcl(o) check_exp((o)->tt == LUA_VLCL, &((cast_u(o))->cl.l)) +#define gco2ccl(o) check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c)) #define gco2cl(o) \ check_exp(novariant((o)->tt) == LUA_TFUNCTION, &((cast_u(o))->cl)) -#define gco2t(o) check_exp((o)->tt == LUA_TTABLE, &((cast_u(o))->h)) -#define gco2p(o) check_exp((o)->tt == LUA_TPROTO, &((cast_u(o))->p)) -#define gco2th(o) check_exp((o)->tt == LUA_TTHREAD, &((cast_u(o))->th)) +#define gco2t(o) check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h)) +#define gco2p(o) check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p)) +#define gco2th(o) check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th)) +#define gco2upv(o) check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv)) -/* macro to convert a Lua object into a GCObject */ -#define obj2gco(v) \ - check_exp(novariant((v)->tt) < LUA_TDEADKEY, (&(cast_u(v)->gc))) +/* +** macro to convert a Lua object into a GCObject +** (The access to 'tt' tries to ensure that 'v' is actually a Lua object.) +*/ +#define obj2gco(v) check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc)) /* actual number of total bytes allocated */ @@ -229,6 +393,11 @@ LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); LUAI_FUNC void luaE_freeCI (lua_State *L); LUAI_FUNC void luaE_shrinkCI (lua_State *L); +LUAI_FUNC void luaE_checkcstack (lua_State *L); +LUAI_FUNC void luaE_incCstack (lua_State *L); +LUAI_FUNC void luaE_warning (lua_State *L, const char *msg, int tocont); +LUAI_FUNC void luaE_warnerror (lua_State *L, const char *where); +LUAI_FUNC int luaE_resetthread (lua_State *L, int status); #endif diff --git a/include/lstring.h b/include/lstring.h index 27efd2077269f..450c2390d1bb2 100644 --- a/include/lstring.h +++ b/include/lstring.h @@ -1,5 +1,5 @@ /* -** $Id: lstring.h,v 1.61 2015/11/03 15:36:01 roberto Exp $ +** $Id: lstring.h $ ** String table (keep all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -12,10 +12,18 @@ #include "lstate.h" -#define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) +/* +** Memory-allocation error message must be preallocated (it cannot +** be created after memory is exhausted) +*/ +#define MEMERRMSG "not enough memory" + -#define sizeludata(l) (sizeof(union UUdata) + (l)) -#define sizeudata(u) sizeludata((u)->len) +/* +** Size of a TString: Size of the header plus space for the string +** itself (including final '\0'). +*/ +#define sizelstring(l) (offsetof(TString, contents) + ((l) + 1) * sizeof(char)) #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ (sizeof(s)/sizeof(char))-1)) @@ -24,13 +32,13 @@ /* ** test whether a string is a reserved word */ -#define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0) +#define isreserved(s) ((s)->tt == LUA_VSHRSTR && (s)->extra > 0) /* ** equality for short strings, which are always internalized */ -#define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b)) +#define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b)) LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); @@ -40,7 +48,7 @@ LUAI_FUNC void luaS_resize (lua_State *L, int newsize); LUAI_FUNC void luaS_clearcache (global_State *g); LUAI_FUNC void luaS_init (lua_State *L); LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); -LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); +LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue); LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); diff --git a/include/ltable.h b/include/ltable.h index 6da9024fe1fc4..7bbbcb213f8b7 100644 --- a/include/ltable.h +++ b/include/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 2.23 2016/12/22 13:08:50 roberto Exp $ +** $Id: ltable.h $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -12,19 +12,15 @@ #define gnode(t,i) (&(t)->node[i]) #define gval(n) (&(n)->i_val) -#define gnext(n) ((n)->i_key.nk.next) +#define gnext(n) ((n)->u.next) -/* 'const' to avoid wrong writings that can mess up field 'next' */ -#define gkey(n) cast(const TValue*, (&(n)->i_key.tvk)) - /* -** writable version of 'gkey'; allows updates to individual fields, -** but not to the whole (which has incompatible type) +** Clear all bits of fast-access metamethods, which means that the table +** may have any of these metamethods. (First access that fails after the +** clearing will set the bit again.) */ -#define wgkey(n) (&(n)->i_key.nk) - -#define invalidateTMcache(t) ((t)->flags = 0) +#define invalidateTMcache(t) ((t)->flags &= ~maskflags) /* true when 't' is using 'dummynode' as its hash part */ @@ -35,9 +31,8 @@ #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t)) -/* returns the key, given the value of a table entry */ -#define keyfromval(v) \ - (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) +/* returns the Node, given the value of a table entry */ +#define nodefromval(v) cast(Node *, (v)) LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); @@ -46,15 +41,20 @@ LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); -LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); -LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); +LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key, + TValue *value); +LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key, + TValue *value); +LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key, + const TValue *slot, TValue *value); LUAI_FUNC Table *luaH_new (lua_State *L); LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, unsigned int nhsize); LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); LUAI_FUNC void luaH_free (lua_State *L, Table *t); LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); -LUAI_FUNC int luaH_getn (Table *t); +LUAI_FUNC lua_Unsigned luaH_getn (Table *t); +LUAI_FUNC unsigned int luaH_realasize (const Table *t); #if defined(LUA_DEBUG) diff --git a/include/ltm.h b/include/ltm.h index 63db7269bbfc4..73b833c605da4 100644 --- a/include/ltm.h +++ b/include/ltm.h @@ -1,5 +1,5 @@ /* -** $Id: ltm.h,v 2.22 2016/02/26 19:20:15 roberto Exp $ +** $Id: ltm.h $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -40,10 +40,26 @@ typedef enum { TM_LE, TM_CONCAT, TM_CALL, + TM_CLOSE, TM_N /* number of elements in the enum */ } TMS; +/* +** Mask with 1 in all fast-access methods. A 1 in any of these bits +** in the flag of a (meta)table means the metatable does not have the +** corresponding metamethod field. (Bit 7 of the flag is used for +** 'isrealasize'.) +*/ +#define maskflags (~(~0u << (TM_EQ + 1))) + + +/* +** Test whether there is no tagmethod. +** (Because tagmethods use raw accesses, the result may be an "empty" nil.) +*/ +#define notm(tm) ttisnil(tm) + #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) @@ -52,7 +68,7 @@ typedef enum { #define ttypename(x) luaT_typenames_[(x) + 1] -LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; +LUAI_DDEC(const char *const luaT_typenames_[LUA_TOTALTYPES];) LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); @@ -63,14 +79,25 @@ LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, LUAI_FUNC void luaT_init (lua_State *L); LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, - const TValue *p2, TValue *p3, int hasres); -LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, - StkId res, TMS event); + const TValue *p2, const TValue *p3); +LUAI_FUNC void luaT_callTMres (lua_State *L, const TValue *f, + const TValue *p1, const TValue *p2, StkId p3); LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, StkId res, TMS event); +LUAI_FUNC void luaT_tryconcatTM (lua_State *L); +LUAI_FUNC void luaT_trybinassocTM (lua_State *L, const TValue *p1, + const TValue *p2, int inv, StkId res, TMS event); +LUAI_FUNC void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, + int inv, StkId res, TMS event); LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, TMS event); +LUAI_FUNC int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, + int inv, int isfloat, TMS event); +LUAI_FUNC void luaT_adjustvarargs (lua_State *L, int nfixparams, + struct CallInfo *ci, const Proto *p); +LUAI_FUNC void luaT_getvarargs (lua_State *L, struct CallInfo *ci, + StkId where, int wanted); #endif diff --git a/include/lua.h b/include/lua.h index 26c0e2d698c41..e6618392cc7e3 100644 --- a/include/lua.h +++ b/include/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.332 2016/12/22 15:51:20 roberto Exp $ +** $Id: lua.h $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -17,13 +17,15 @@ #define LUA_VERSION_MAJOR "5" -#define LUA_VERSION_MINOR "3" -#define LUA_VERSION_NUM 503 +#define LUA_VERSION_MINOR "4" #define LUA_VERSION_RELEASE "4" +#define LUA_VERSION_NUM 504 +#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 4) + #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2017 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2022 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -49,8 +51,7 @@ #define LUA_ERRRUN 2 #define LUA_ERRSYNTAX 3 #define LUA_ERRMEM 4 -#define LUA_ERRGCMM 5 -#define LUA_ERRERR 6 +#define LUA_ERRERR 5 typedef struct lua_State lua_State; @@ -71,7 +72,7 @@ typedef struct lua_State lua_State; #define LUA_TUSERDATA 7 #define LUA_TTHREAD 8 -#define LUA_NUMTAGS 9 +#define LUA_NUMTYPES 9 @@ -124,6 +125,13 @@ typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud); typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); +/* +** Type for warning functions +*/ +typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont); + + + /* ** generic extra include file @@ -145,11 +153,12 @@ extern const char lua_ident[]; LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); LUA_API void (lua_close) (lua_State *L); LUA_API lua_State *(lua_newthread) (lua_State *L); +LUA_API int (lua_resetthread) (lua_State *L); LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); -LUA_API const lua_Number *(lua_version) (lua_State *L); +LUA_API lua_Number (lua_version) (lua_State *L); /* @@ -182,7 +191,7 @@ LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum); LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); LUA_API int (lua_toboolean) (lua_State *L, int idx); LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); -LUA_API size_t (lua_rawlen) (lua_State *L, int idx); +LUA_API lua_Unsigned (lua_rawlen) (lua_State *L, int idx); LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); LUA_API void *(lua_touserdata) (lua_State *L, int idx); LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); @@ -247,9 +256,9 @@ LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n); LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); -LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); +LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue); LUA_API int (lua_getmetatable) (lua_State *L, int objindex); -LUA_API int (lua_getuservalue) (lua_State *L, int idx); +LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n); /* @@ -263,7 +272,7 @@ LUA_API void (lua_rawset) (lua_State *L, int idx); LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n); LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p); LUA_API int (lua_setmetatable) (lua_State *L, int objindex); -LUA_API void (lua_setuservalue) (lua_State *L, int idx); +LUA_API int (lua_setiuservalue) (lua_State *L, int idx, int n); /* @@ -288,13 +297,21 @@ LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip); */ LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k); -LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); +LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg, + int *nres); LUA_API int (lua_status) (lua_State *L); LUA_API int (lua_isyieldable) (lua_State *L); #define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL) +/* +** Warning-related functions +*/ +LUA_API void (lua_setwarnf) (lua_State *L, lua_WarnFunction f, void *ud); +LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont); + + /* ** garbage-collection function and options */ @@ -308,8 +325,10 @@ LUA_API int (lua_isyieldable) (lua_State *L); #define LUA_GCSETPAUSE 6 #define LUA_GCSETSTEPMUL 7 #define LUA_GCISRUNNING 9 +#define LUA_GCGEN 10 +#define LUA_GCINC 11 -LUA_API int (lua_gc) (lua_State *L, int what, int data); +LUA_API int (lua_gc) (lua_State *L, int what, ...); /* @@ -328,6 +347,8 @@ LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s); LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); +LUA_API void (lua_toclose) (lua_State *L, int idx); +LUA_API void (lua_closeslot) (lua_State *L, int idx); /* @@ -377,7 +398,7 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); /* ** {============================================================== -** compatibility macros for unsigned conversions +** compatibility macros ** =============================================================== */ #if defined(LUA_COMPAT_APIINTCASTS) @@ -387,6 +408,13 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); #define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL) #endif + +#define lua_newuserdata(L,s) lua_newuserdatauv(L,s,1) +#define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1) +#define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1) + +#define LUA_NUMTAGS LUA_NUMTYPES + /* }============================================================== */ /* @@ -437,6 +465,7 @@ LUA_API lua_Hook (lua_gethook) (lua_State *L); LUA_API int (lua_gethookmask) (lua_State *L); LUA_API int (lua_gethookcount) (lua_State *L); +LUA_API int (lua_setcstacklimit) (lua_State *L, unsigned int limit); struct lua_Debug { int event; @@ -444,6 +473,7 @@ struct lua_Debug { const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */ const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */ const char *source; /* (S) */ + size_t srclen; /* (S) */ int currentline; /* (l) */ int linedefined; /* (S) */ int lastlinedefined; /* (S) */ @@ -451,6 +481,8 @@ struct lua_Debug { unsigned char nparams;/* (u) number of parameters */ char isvararg; /* (u) */ char istailcall; /* (t) */ + unsigned short ftransfer; /* (r) index of first value transferred */ + unsigned short ntransfer; /* (r) number of transferred values */ char short_src[LUA_IDSIZE]; /* (S) */ /* private part */ struct CallInfo *i_ci; /* active function */ @@ -460,7 +492,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2017 Lua.org, PUC-Rio. +* Copyright (C) 1994-2022 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff --git a/include/luaconf.h b/include/luaconf.h index 16d2f4d4c1ed4..1ca2974347a62 100644 --- a/include/luaconf.h +++ b/include/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp $ +** $Id: luaconf.h $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -14,6 +14,16 @@ /* ** =================================================================== +** General Configuration File for Lua +** +** Some definitions here can be changed externally, through the compiler +** (e.g., with '-D' options): They are commented out or protected +** by '#if !defined' guards. However, several other definitions +** should be changed directly here, either because they affect the +** Lua ABI (by making the changes here, you ensure that all software +** connected to Lua, such as C libraries, will be compiled with the same +** configuration); or because they are seldom changed. +** ** Search for "@@" to find all configurable definitions. ** =================================================================== */ @@ -22,20 +32,10 @@ /* ** {==================================================================== ** System Configuration: macros to adapt (if needed) Lua to some -** particular platform, for instance compiling it with 32-bit numbers or -** restricting it to C89. +** particular platform, for instance restricting it to C89. ** ===================================================================== */ -/* -@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You -** can also define LUA_32BITS in the make file, but changing here you -** ensure that all software connected to Lua will be compiled with the -** same configuration. -*/ -/* #define LUA_32BITS */ - - /* @@ LUA_USE_C89 controls the use of non-ISO-C89 features. ** Define it if you want Lua to avoid the use of a few C99 features @@ -61,14 +61,12 @@ #if defined(LUA_USE_LINUX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ -#define LUA_USE_READLINE /* needs some extra libraries */ #endif #if defined(LUA_USE_MACOSX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* MacOS does not need -ldl */ -#define LUA_USE_READLINE /* needs an extra library: -lreadline */ #endif #if defined(LUA_USE_IOS) @@ -78,33 +76,27 @@ #endif /* -@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for -** C89 ('long' and 'double'); Windows always has '__int64', so it does -** not need to use this case. +@@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. */ -#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) -#define LUA_C89_NUMBERS -#endif +#define LUAI_IS32INT ((UINT_MAX >> 30) >= 3) + +/* }================================================================== */ /* -@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'. +** {================================================================== +** Configuration for Number types. These options should not be +** set externally, because any other code connected to Lua must +** use the same configuration. +** =================================================================== */ -/* avoid undefined shifts */ -#if ((INT_MAX >> 15) >> 15) >= 1 -#define LUAI_BITSINT 32 -#else -/* 'int' always must have at least 16 bits */ -#define LUAI_BITSINT 16 -#endif - /* @@ LUA_INT_TYPE defines the type for Lua integers. @@ LUA_FLOAT_TYPE defines the type for Lua floats. -** Lua should work fine with any mix of these options (if supported -** by your C compiler). The usual configurations are 64-bit integers +** Lua should work fine with any mix of these options supported +** by your C compiler. The usual configurations are 64-bit integers ** and 'double' (the default), 32-bit integers and 'float' (for ** restricted platforms), and 'long'/'double' (for C compilers not ** compliant with C99, which may not have support for 'long long'). @@ -120,43 +112,61 @@ #define LUA_FLOAT_DOUBLE 2 #define LUA_FLOAT_LONGDOUBLE 3 -#if defined(LUA_32BITS) /* { */ + +/* Default configuration ('long long' and 'double', for 64-bit Lua) */ +#define LUA_INT_DEFAULT LUA_INT_LONGLONG +#define LUA_FLOAT_DEFAULT LUA_FLOAT_DOUBLE + + +/* +@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. +*/ +#define LUA_32BITS 0 + + +/* +@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for +** C89 ('long' and 'double'); Windows always has '__int64', so it does +** not need to use this case. +*/ +#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) +#define LUA_C89_NUMBERS 1 +#else +#define LUA_C89_NUMBERS 0 +#endif + + +#if LUA_32BITS /* { */ /* ** 32-bit integers and 'float' */ -#if LUAI_BITSINT >= 32 /* use 'int' if big enough */ +#if LUAI_IS32INT /* use 'int' if big enough */ #define LUA_INT_TYPE LUA_INT_INT #else /* otherwise use 'long' */ #define LUA_INT_TYPE LUA_INT_LONG #endif #define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT -#elif defined(LUA_C89_NUMBERS) /* }{ */ +#elif LUA_C89_NUMBERS /* }{ */ /* ** largest types available for C89 ('long' and 'double') */ #define LUA_INT_TYPE LUA_INT_LONG #define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE -#endif /* } */ +#else /* }{ */ +/* use defaults */ +#define LUA_INT_TYPE LUA_INT_DEFAULT +#define LUA_FLOAT_TYPE LUA_FLOAT_DEFAULT -/* -** default configuration for 64-bit Lua ('long long' and 'double') -*/ -#if !defined(LUA_INT_TYPE) -#define LUA_INT_TYPE LUA_INT_LONGLONG -#endif +#endif /* } */ -#if !defined(LUA_FLOAT_TYPE) -#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE -#endif /* }================================================================== */ - /* ** {================================================================== ** Configuration for Paths. @@ -184,6 +194,7 @@ ** hierarchy or if you want to install your libraries in ** non-conventional directories. */ + #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #if defined(_WIN32) /* { */ /* @@ -193,27 +204,40 @@ #define LUA_LDIR "!\\lua\\" #define LUA_CDIR "!\\" #define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" + +#if !defined(LUA_PATH_DEFAULT) #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ ".\\?.lua;" ".\\?\\init.lua" +#endif + +#if !defined(LUA_CPATH_DEFAULT) #define LUA_CPATH_DEFAULT \ LUA_CDIR"?.dll;" \ LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ LUA_CDIR"loadall.dll;" ".\\?.dll" +#endif #else /* }{ */ #define LUA_ROOT "/usr/local/" #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" + +#if !defined(LUA_PATH_DEFAULT) #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ "./?.lua;" "./?/init.lua" +#endif + +#if !defined(LUA_CPATH_DEFAULT) #define LUA_CPATH_DEFAULT \ LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" +#endif + #endif /* } */ @@ -222,12 +246,16 @@ ** CHANGE it if your machine does not use "/" as the directory separator ** and is not Windows. (On Windows Lua automatically uses "\".) */ +#if !defined(LUA_DIRSEP) + #if defined(_WIN32) #define LUA_DIRSEP "\\" #else #define LUA_DIRSEP "/" #endif +#endif + /* }================================================================== */ @@ -261,16 +289,18 @@ #endif /* } */ -/* more often than not the libs go together with the core */ +/* +** More often than not the libs go together with the core. +*/ #define LUALIB_API LUA_API -#define LUAMOD_API LUALIB_API +#define LUAMOD_API LUA_API /* @@ LUAI_FUNC is a mark for all extern functions that are not to be ** exported to outside modules. -@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables -** that are not to be exported to outside modules (LUAI_DDEF for +@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables, +** none of which to be exported to outside modules (LUAI_DDEF for ** definitions and LUAI_DDEC for declarations). ** CHANGE them if you need to mark them in some special way. Elf/gcc ** (versions 3.2 and later) mark them as "hidden" to optimize access @@ -282,12 +312,12 @@ */ #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ defined(__ELF__) /* { */ -#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#define LUAI_FUNC __attribute__((visibility("internal"))) extern #else /* }{ */ #define LUAI_FUNC extern #endif /* } */ -#define LUAI_DDEC LUAI_FUNC +#define LUAI_DDEC(dec) LUAI_FUNC dec #define LUAI_DDEF /* empty */ /* }================================================================== */ @@ -300,88 +330,43 @@ */ /* -@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2. -@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1. +@@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.3. ** You can define it to get all options, or change specific options ** to fit your specific needs. */ -#if defined(LUA_COMPAT_5_2) /* { */ +#if defined(LUA_COMPAT_5_3) /* { */ /* @@ LUA_COMPAT_MATHLIB controls the presence of several deprecated ** functions in the mathematical library. +** (These functions were already officially removed in 5.3; +** nevertheless they are still available here.) */ #define LUA_COMPAT_MATHLIB -/* -@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'. -*/ -#define LUA_COMPAT_BITLIB - -/* -@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod. -*/ -#define LUA_COMPAT_IPAIRS - /* @@ LUA_COMPAT_APIINTCASTS controls the presence of macros for ** manipulating other integer types (lua_pushunsigned, lua_tounsigned, ** luaL_checkint, luaL_checklong, etc.) +** (These macros were also officially removed in 5.3, but they are still +** available here.) */ #define LUA_COMPAT_APIINTCASTS -#endif /* } */ - - -#if defined(LUA_COMPAT_5_1) /* { */ - -/* Incompatibilities from 5.2 -> 5.3 */ -#define LUA_COMPAT_MATHLIB -#define LUA_COMPAT_APIINTCASTS - -/* -@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. -** You can replace it with 'table.unpack'. -*/ -#define LUA_COMPAT_UNPACK - -/* -@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. -** You can replace it with 'package.searchers'. -*/ -#define LUA_COMPAT_LOADERS /* -@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. -** You can call your C function directly (with light C functions). +@@ LUA_COMPAT_LT_LE controls the emulation of the '__le' metamethod +** using '__lt'. */ -#define lua_cpcall(L,f,u) \ - (lua_pushcfunction(L, (f)), \ - lua_pushlightuserdata(L,(u)), \ - lua_pcall(L,1,0,0)) +#define LUA_COMPAT_LT_LE -/* -@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. -** You can rewrite 'log10(x)' as 'log(x, 10)'. -*/ -#define LUA_COMPAT_LOG10 - -/* -@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base -** library. You can rewrite 'loadstring(s)' as 'load(s)'. -*/ -#define LUA_COMPAT_LOADSTRING - -/* -@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. -*/ -#define LUA_COMPAT_MAXN - /* @@ The following macros supply trivial compatibility for some ** changes in the API. The macros themselves document how to ** change your code to avoid using them. +** (Once more, these macros were officially removed in 5.3, but they are +** still available here.) */ #define lua_strlen(L,i) lua_rawlen(L, (i)) @@ -390,47 +375,31 @@ #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) -/* -@@ LUA_COMPAT_MODULE controls compatibility with previous -** module functions 'module' (Lua) and 'luaL_register' (C). -*/ -#define LUA_COMPAT_MODULE - #endif /* } */ - -/* -@@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a -@@ a float mark ('.0'). -** This macro is not on by default even in compatibility mode, -** because this is not really an incompatibility. -*/ -/* #define LUA_COMPAT_FLOATSTRING */ - /* }================================================================== */ /* ** {================================================================== -** Configuration for Numbers. +** Configuration for Numbers (low-level part). ** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* ** satisfy your needs. ** =================================================================== */ /* -@@ LUA_NUMBER is the floating-point type used by Lua. @@ LUAI_UACNUMBER is the result of a 'default argument promotion' @@ over a floating number. -@@ l_mathlim(x) corrects limit name 'x' to the proper float type +@@ l_floatatt(x) corrects float attribute 'x' to the proper float type ** by prefixing it with one of FLT/DBL/LDBL. @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. @@ LUA_NUMBER_FMT is the format for writing floats. @@ lua_number2str converts a float to a string. @@ l_mathop allows the addition of an 'l' or 'f' to all math operations. @@ l_floor takes the floor of a float. -@@ lua_str2number converts a decimal numeric string to a number. +@@ lua_str2number converts a decimal numeral to a number. */ @@ -442,12 +411,13 @@ l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n)) /* -@@ lua_numbertointeger converts a float number to an integer, or -** returns 0 if float is not within the range of a lua_Integer. -** (The range comparisons are tricky because of rounding. The tests -** here assume a two-complement representation, where MININTEGER always -** has an exact representation as a float; MAXINTEGER may not have one, -** and therefore its conversion to float may have an ill-defined value.) +@@ lua_numbertointeger converts a float number with an integral value +** to an integer, or returns 0 if float is not within the range of +** a lua_Integer. (The range comparisons are tricky because of +** rounding. The tests here assume a two-complement representation, +** where MININTEGER always has an exact representation as a float; +** MAXINTEGER may not have one, and therefore its conversion to float +** may have an ill-defined value.) */ #define lua_numbertointeger(n,p) \ ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \ @@ -461,7 +431,7 @@ #define LUA_NUMBER float -#define l_mathlim(n) (FLT_##n) +#define l_floatatt(n) (FLT_##n) #define LUAI_UACNUMBER double @@ -477,7 +447,7 @@ #define LUA_NUMBER long double -#define l_mathlim(n) (LDBL_##n) +#define l_floatatt(n) (LDBL_##n) #define LUAI_UACNUMBER long double @@ -492,7 +462,7 @@ #define LUA_NUMBER double -#define l_mathlim(n) (DBL_##n) +#define l_floatatt(n) (DBL_##n) #define LUAI_UACNUMBER double @@ -512,16 +482,14 @@ /* -@@ LUA_INTEGER is the integer type used by Lua. -** @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. -** @@ LUAI_UACINT is the result of a 'default argument promotion' -@@ over a lUA_INTEGER. +@@ over a LUA_INTEGER. @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. @@ LUA_INTEGER_FMT is the format for writing integers. @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. +@@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED. @@ lua_integer2str converts an integer to a string. */ @@ -552,6 +520,8 @@ #define LUA_MAXINTEGER INT_MAX #define LUA_MININTEGER INT_MIN +#define LUA_MAXUNSIGNED UINT_MAX + #elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */ #define LUA_INTEGER long @@ -560,6 +530,8 @@ #define LUA_MAXINTEGER LONG_MAX #define LUA_MININTEGER LONG_MIN +#define LUA_MAXUNSIGNED ULONG_MAX + #elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */ /* use presence of macro LLONG_MAX as proxy for C99 compliance */ @@ -572,6 +544,8 @@ #define LUA_MAXINTEGER LLONG_MAX #define LUA_MININTEGER LLONG_MIN +#define LUA_MAXUNSIGNED ULLONG_MAX + #elif defined(LUA_USE_WINDOWS) /* }{ */ /* in Windows, can use specific Windows types */ @@ -581,6 +555,8 @@ #define LUA_MAXINTEGER _I64_MAX #define LUA_MININTEGER _I64_MIN +#define LUA_MAXUNSIGNED _UI64_MAX + #else /* }{ */ #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ @@ -615,7 +591,7 @@ /* -@@ lua_strx2number converts an hexadecimal numeric string to a number. +@@ lua_strx2number converts a hexadecimal numeral to a number. ** In C99, 'strtod' does that conversion. Otherwise, you can ** leave 'lua_strx2number' undefined and Lua will provide its own ** implementation. @@ -626,7 +602,14 @@ /* -@@ lua_number2strx converts a float to an hexadecimal numeric string. +@@ lua_pointer2str converts a pointer to a readable string in a +** non-specified way. +*/ +#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p) + + +/* +@@ lua_number2strx converts a float to a hexadecimal numeral. ** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. ** Otherwise, you can leave 'lua_number2strx' undefined and Lua will ** provide its own implementation. @@ -672,12 +655,40 @@ /* @@ lua_getlocaledecpoint gets the locale "radix character" (decimal point). ** Change that if you do not want to use C locales. (Code using this -** macro must include header 'locale.h'.) +** macro must include the header 'locale.h'.) */ #if !defined(lua_getlocaledecpoint) #define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) #endif + +/* +** macros to improve jump prediction, used mostly for error handling +** and debug facilities. (Some macros in the Lua API use these macros. +** Define LUA_NOBUILTIN if you do not want '__builtin_expect' in your +** code.) +*/ +#if !defined(luai_likely) + +#if defined(__GNUC__) && !defined(LUA_NOBUILTIN) +#define luai_likely(x) (__builtin_expect(((x) != 0), 1)) +#define luai_unlikely(x) (__builtin_expect(((x) != 0), 0)) +#else +#define luai_likely(x) (x) +#define luai_unlikely(x) (x) +#endif + +#endif + + +#if defined(LUA_CORE) || defined(LUA_LIB) +/* shorter names for Lua's own use */ +#define l_likely(x) luai_likely(x) +#define l_unlikely(x) luai_unlikely(x) +#endif + + + /* }================================================================== */ @@ -713,7 +724,7 @@ ** {================================================================== ** Macros that affect the API and must be stable (that is, must be the ** same when you compile Lua and when you compile code that links to -** Lua). You probably do not want/need to change them. +** Lua). ** ===================================================================== */ @@ -722,8 +733,9 @@ ** CHANGE it if you need a different limit. This limit is arbitrary; ** its only purpose is to stop Lua from consuming unlimited stack ** space (and to reserve some numbers for pseudo-indices). +** (It must fit into max(size_t)/32.) */ -#if LUAI_BITSINT >= 32 +#if LUAI_IS32INT #define LUAI_MAXSTACK 1000000 #else #define LUAI_MAXSTACK 15000 @@ -748,27 +760,18 @@ /* @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. -** CHANGE it if it uses too much C-stack space. (For long double, -** 'string.format("%.99f", -1e4932)' needs 5034 bytes, so a -** smaller buffer would force a memory allocation for each call to -** 'string.format'.) */ -#if LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE -#define LUAL_BUFFERSIZE 8192 -#else -#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) -#endif - -/* }================================================================== */ +#define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number))) /* -@@ LUA_QL describes how error messages quote program elements. -** Lua does not use these macros anymore; they are here for -** compatibility only. +@@ LUAI_MAXALIGN defines fields that, when used in a union, ensure +** maximum alignment for the other items in that union. */ -#define LUA_QL(x) "'" x "'" -#define LUA_QS LUA_QL("%s") +#define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l + +/* }================================================================== */ + diff --git a/include/lualib.h b/include/lualib.h index 6c0bc4cb084ea..2625529076a8f 100644 --- a/include/lualib.h +++ b/include/lualib.h @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.45 2017/01/12 17:14:26 roberto Exp $ +** $Id: lualib.h $ ** Lua standard libraries ** See Copyright Notice in lua.h */ @@ -35,9 +35,6 @@ LUAMOD_API int (luaopen_string) (lua_State *L); #define LUA_UTF8LIBNAME "utf8" LUAMOD_API int (luaopen_utf8) (lua_State *L); -#define LUA_BITLIBNAME "bit32" -LUAMOD_API int (luaopen_bit32) (lua_State *L); - #define LUA_MATHLIBNAME "math" LUAMOD_API int (luaopen_math) (lua_State *L); @@ -52,10 +49,4 @@ LUAMOD_API int (luaopen_package) (lua_State *L); LUALIB_API void (luaL_openlibs) (lua_State *L); - -#if !defined(lua_assert) -#define lua_assert(x) ((void)0) -#endif - - #endif diff --git a/include/lundump.h b/include/lundump.h index aa5cc82f1b58c..f3748a9980754 100644 --- a/include/lundump.h +++ b/include/lundump.h @@ -1,5 +1,5 @@ /* -** $Id: lundump.h,v 1.45 2015/09/08 15:41:05 roberto Exp $ +** $Id: lundump.h $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -18,8 +18,12 @@ #define LUAC_INT 0x5678 #define LUAC_NUM cast_num(370.5) -#define MYINT(s) (s[0]-'0') +/* +** Encode major-minor version in one byte, one nibble for each +*/ +#define MYINT(s) (s[0]-'0') /* assume one-digit numerals */ #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) + #define LUAC_FORMAT 0 /* this is the official format */ /* load one chunk; from lundump.c */ diff --git a/include/lvm.h b/include/lvm.h index 422f871949187..1bc16f3a50ba4 100644 --- a/include/lvm.h +++ b/include/lvm.h @@ -1,5 +1,5 @@ /* -** $Id: lvm.h,v 2.41 2016/12/22 13:08:50 roberto Exp $ +** $Id: lvm.h $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -33,15 +33,42 @@ ** integral values) */ #if !defined(LUA_FLOORN2I) -#define LUA_FLOORN2I 0 +#define LUA_FLOORN2I F2Ieq #endif +/* +** Rounding modes for float->integer coercion + */ +typedef enum { + F2Ieq, /* no rounding; accepts only integral values */ + F2Ifloor, /* takes the floor of the number */ + F2Iceil /* takes the ceil of the number */ +} F2Imod; + + +/* convert an object to a float (including string coercion) */ #define tonumber(o,n) \ (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n)) + +/* convert an object to a float (without string coercion) */ +#define tonumberns(o,n) \ + (ttisfloat(o) ? ((n) = fltvalue(o), 1) : \ + (ttisinteger(o) ? ((n) = cast_num(ivalue(o)), 1) : 0)) + + +/* convert an object to an integer (including string coercion) */ #define tointeger(o,i) \ - (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I)) + (l_likely(ttisinteger(o)) ? (*(i) = ivalue(o), 1) \ + : luaV_tointeger(o,i,LUA_FLOORN2I)) + + +/* convert an object to an integer (without string coercion) */ +#define tointegerns(o,i) \ + (l_likely(ttisinteger(o)) ? (*(i) = ivalue(o), 1) \ + : luaV_tointegerns(o,i,LUA_FLOORN2I)) + #define intop(op,v1,v2) l_castU2S(l_castS2U(v1) op l_castS2U(v2)) @@ -49,47 +76,39 @@ /* -** fast track for 'gettable': if 't' is a table and 't[k]' is not nil, -** return 1 with 'slot' pointing to 't[k]' (final result). Otherwise, -** return 0 (meaning it will have to check metamethod) with 'slot' -** pointing to a nil 't[k]' (if 't' is a table) or NULL (otherwise). -** 'f' is the raw get function to use. +** fast track for 'gettable': if 't' is a table and 't[k]' is present, +** return 1 with 'slot' pointing to 't[k]' (position of final result). +** Otherwise, return 0 (meaning it will have to check metamethod) +** with 'slot' pointing to an empty 't[k]' (if 't' is a table) or NULL +** (otherwise). 'f' is the raw get function to use. */ #define luaV_fastget(L,t,k,slot,f) \ (!ttistable(t) \ ? (slot = NULL, 0) /* not a table; 'slot' is NULL and result is 0 */ \ : (slot = f(hvalue(t), k), /* else, do raw access */ \ - !ttisnil(slot))) /* result not nil? */ + !isempty(slot))) /* result not empty? */ + /* -** standard implementation for 'gettable' +** Special case of 'luaV_fastget' for integers, inlining the fast case +** of 'luaH_getint'. */ -#define luaV_gettable(L,t,k,v) { const TValue *slot; \ - if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \ - else luaV_finishget(L,t,k,v,slot); } +#define luaV_fastgeti(L,t,k,slot) \ + (!ttistable(t) \ + ? (slot = NULL, 0) /* not a table; 'slot' is NULL and result is 0 */ \ + : (slot = (l_castS2U(k) - 1u < hvalue(t)->alimit) \ + ? &hvalue(t)->array[k - 1] : luaH_getint(hvalue(t), k), \ + !isempty(slot))) /* result not empty? */ /* -** Fast track for set table. If 't' is a table and 't[k]' is not nil, -** call GC barrier, do a raw 't[k]=v', and return true; otherwise, -** return false with 'slot' equal to NULL (if 't' is not a table) or -** 'nil'. (This is needed by 'luaV_finishget'.) Note that, if the macro -** returns true, there is no need to 'invalidateTMcache', because the -** call is not creating a new entry. +** Finish a fast set operation (when fast get succeeds). In that case, +** 'slot' points to the place to put the value. */ -#define luaV_fastset(L,t,k,slot,f,v) \ - (!ttistable(t) \ - ? (slot = NULL, 0) \ - : (slot = f(hvalue(t), k), \ - ttisnil(slot) ? 0 \ - : (luaC_barrierback(L, hvalue(t), v), \ - setobj2t(L, cast(TValue *,slot), v), \ - 1))) - +#define luaV_finishfastset(L,t,slot,v) \ + { setobj2t(L, cast(TValue *,slot), v); \ + luaC_barrierback(L, gcvalue(t), v); } -#define luaV_settable(L,t,k,v) { const TValue *slot; \ - if (!luaV_fastset(L,t,k,slot,luaH_get,v)) \ - luaV_finishset(L,t,k,v,slot); } @@ -97,16 +116,20 @@ LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); -LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, int mode); +LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, F2Imod mode); +LUAI_FUNC int luaV_tointegerns (const TValue *obj, lua_Integer *p, + F2Imod mode); +LUAI_FUNC int luaV_flttointeger (lua_Number n, lua_Integer *p, F2Imod mode); LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot); LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key, - StkId val, const TValue *slot); + TValue *val, const TValue *slot); LUAI_FUNC void luaV_finishOp (lua_State *L); -LUAI_FUNC void luaV_execute (lua_State *L); +LUAI_FUNC void luaV_execute (lua_State *L, CallInfo *ci); LUAI_FUNC void luaV_concat (lua_State *L, int total); -LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y); +LUAI_FUNC lua_Integer luaV_idiv (lua_State *L, lua_Integer x, lua_Integer y); LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y); +LUAI_FUNC lua_Number luaV_modf (lua_State *L, lua_Number x, lua_Number y); LUAI_FUNC lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y); LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); diff --git a/include/lzio.h b/include/lzio.h index e7b6f34b1e3ca..38f397fd284e8 100644 --- a/include/lzio.h +++ b/include/lzio.h @@ -1,5 +1,5 @@ /* -** $Id: lzio.h,v 1.31 2015/09/08 15:41:05 roberto Exp $ +** $Id: lzio.h $ ** Buffered streams ** See Copyright Notice in lua.h */ diff --git a/nsis/README.txt b/nsis/README.txt index cd4d52ed610a2..2760609e09b68 100644 --- a/nsis/README.txt +++ b/nsis/README.txt @@ -32,12 +32,12 @@ To build the installable .exe: 5. 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 "vim81" directory, + "diff.exe" put it in the "../.." directory (above the "vim82" directory, it's the same for all Vim versions). You can find one in previous Vim versions or in this archive: http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz -6 Also put winpty32.dll and winpty-agent.exe in "../.." (above the "vim81" +6 Also put winpty32.dll and winpty-agent.exe in "../.." (above the "vim82" directory). This is required for the terminal window. 7. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have @@ -66,12 +66,15 @@ To build the installable .exe: 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 + Unpack the images: cd nsis unzip icons.zip -To build then, enter: +Then build gvim.exe: cd nsis makensis gvim.nsi diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index ed53ab5fab66b..d71cffb8b0252 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -39,7 +39,7 @@ Unicode true # Uncomment the next line if you want to include VisVim extension: #!define HAVE_VIS_VIM -# Comment the following line to create a multilanguage installer: +# Comment the following line to create an English-only installer: !define HAVE_MULTI_LANG # Uncomment the next line if you want to create a 64-bit installer. @@ -119,17 +119,18 @@ RequestExecutionLevel highest !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_LICENSEPAGE_CHECKBOX -!define MUI_FINISHPAGE_RUN "$0\gvim.exe" +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_FUNCTION LaunchApplication !define MUI_FINISHPAGE_RUN_TEXT $(str_show_readme) -!define MUI_FINISHPAGE_RUN_PARAMETERS "-R $\"$0\README.txt$\"" # This adds '\Vim' to the user choice automagically. The actual value is # obtained below with CheckOldVim. !ifdef WIN64 -InstallDir "$PROGRAMFILES64\Vim" + !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim" !else -InstallDir "$PROGRAMFILES\Vim" + !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim" !endif +InstallDir ${DEFAULT_INSTDIR} # Types of installs we can perform: InstType $(str_type_typical) @@ -174,8 +175,10 @@ Page custom SetCustom ValidateCustom !include "lang\german.nsi" !include "lang\italian.nsi" !include "lang\japanese.nsi" + !include "lang\russian.nsi" !include "lang\simpchinese.nsi" !include "lang\tradchinese.nsi" + !include "lang\turkish.nsi" !endif ########################################################## @@ -298,6 +301,11 @@ Function CheckOldVim Exch $0 # put $0 on top of stack, restore $0 to original value FunctionEnd +Function LaunchApplication + SetOutPath $0 + ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R "$0\README.txt"' +FunctionEnd + ########################################################## Section "$(str_section_old_ver)" id_section_old_ver SectionIn 1 2 3 RO @@ -339,6 +347,9 @@ Section "$(str_section_exe)" id_section_exe File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe !if /FileExists "${VIMSRC}\vim${BIT}.dll" File ${VIMSRC}\vim${BIT}.dll +!endif +!if /FileExists "${VIMRT}\libsodium.dll" + File ${VIMRT}\libsodium.dll !endif File /oname=install.exe ${VIMSRC}\installw32.exe File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe @@ -349,7 +360,6 @@ Section "$(str_section_exe)" id_section_exe File ..\README.txt File ..\uninstall.txt File ${VIMRT}\*.vim - File ${VIMRT}\rgb.txt File ${VIMTOOLS}\diff.exe File ${VIMTOOLS}\winpty${BIT}.dll @@ -357,6 +367,10 @@ Section "$(str_section_exe)" id_section_exe SetOutPath $0\colors File ${VIMRT}\colors\*.* + SetOutPath $0\colors\tools + File ${VIMRT}\colors\tools\*.* + SetOutPath $0\colors\lists + File ${VIMRT}\colors\lists\*.* SetOutPath $0\compiler File ${VIMRT}\compiler\*.* @@ -389,6 +403,12 @@ Section "$(str_section_exe)" id_section_exe SetOutPath $0\autoload\xml File ${VIMRT}\autoload\xml\*.* + SetOutPath $0\import\dist + File ${VIMRT}\import\dist\*.* + + SetOutPath $0\bitmaps + File ${VIMSRC}\vim.ico + SetOutPath $0\syntax File ${VIMRT}\syntax\*.* @@ -686,14 +706,28 @@ SectionEnd ${EndIf} !macroend +!macro LoadDefaultVimrc out_var reg_value default_value + ClearErrors + ReadRegStr ${out_var} HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} + ${If} ${Errors} + ${OrIf} ${out_var} == "" + StrCpy ${out_var} ${default_value} + ${EndIf} +!macroend + Function .onInit !ifdef HAVE_MULTI_LANG # Select a language (or read from the registry). !insertmacro MUI_LANGDLL_DISPLAY !endif - # Check $VIM - ReadEnvStr $INSTDIR "VIM" + ${If} $INSTDIR == ${DEFAULT_INSTDIR} + # Check $VIM + ReadEnvStr $3 "VIM" + ${If} $3 != "" + StrCpy $INSTDIR $3 + ${EndIf} + ${EndIf} call CheckOldVim Pop $3 @@ -703,24 +737,15 @@ Function .onInit SectionSetInstTypes ${id_section_old_ver} 0 SectionSetText ${id_section_old_ver} "" ${Else} - ${If} $INSTDIR == "" + ${If} $INSTDIR == ${DEFAULT_INSTDIR} StrCpy $INSTDIR $3 ${EndIf} ${EndIf} - # If did not find a path: use the default dir. - ${If} $INSTDIR == "" -!ifdef WIN64 - StrCpy $INSTDIR "$PROGRAMFILES64\Vim" -!else - StrCpy $INSTDIR "$PROGRAMFILES\Vim" -!endif - ${EndIf} - -# Load the selections from the registry (if any). ${If} ${RunningX64} SetRegView 64 ${EndIf} + # Load the selections from the registry (if any). !insertmacro LoadSectionSelection ${id_section_console} "select_console" !insertmacro LoadSectionSelection ${id_section_batch} "select_batch" !insertmacro LoadSectionSelection ${id_section_desktop} "select_desktop" @@ -735,6 +760,10 @@ Function .onInit !ifdef HAVE_NLS !insertmacro LoadSectionSelection ${id_section_nls} "select_nls" !endif + # Load the default _vimrc settings from the registry (if any). + !insertmacro LoadDefaultVimrc $vim_compat_stat "vim_compat" "all" + !insertmacro LoadDefaultVimrc $vim_keymap_stat "vim_keyremap" "default" + !insertmacro LoadDefaultVimrc $vim_mouse_stat "vim_mouse" "default" ${If} ${RunningX64} SetRegView lastused ${EndIf} @@ -798,17 +827,11 @@ Function SetCustom ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_defaults) ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_all) - # Default selection - ${If} $vim_compat_stat == "" - ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_compat" - ${Else} - StrCpy $3 $vim_compat_stat - ${EndIf} - ${If} $3 == "defaults" + ${If} $vim_compat_stat == "defaults" StrCpy $4 2 - ${ElseIf} $3 == "vim" + ${ElseIf} $vim_compat_stat == "vim" StrCpy $4 1 - ${ElseIf} $3 == "vi" + ${ElseIf} $vim_compat_stat == "vi" StrCpy $4 0 ${Else} # default StrCpy $4 3 @@ -827,13 +850,7 @@ Function SetCustom ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default) ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows) - # Default selection - ${If} $vim_keymap_stat == "" - ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_keyremap" - ${Else} - StrCpy $3 $vim_keymap_stat - ${EndIf} - ${If} $3 == "windows" + ${If} $vim_keymap_stat == "windows" StrCpy $4 1 ${Else} # default StrCpy $4 0 @@ -853,15 +870,9 @@ Function SetCustom ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows) ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_unix) - # Default selection - ${If} $vim_mouse_stat == "" - ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_mouse" - ${Else} - StrCpy $3 $vim_mouse_stat - ${EndIf} - ${If} $3 == "xterm" + ${If} $vim_mouse_stat == "xterm" StrCpy $4 2 - ${ElseIf} $3 == "windows" + ${ElseIf} $vim_mouse_stat == "windows" StrCpy $4 1 ${Else} # default StrCpy $4 0 @@ -1036,6 +1047,7 @@ Section "un.$(str_unsection_exe)" id_unsection_exe RMDir /r $0\compiler RMDir /r $0\doc RMDir /r $0\ftplugin + RMDir /r $0\import RMDir /r $0\indent RMDir /r $0\macros RMDir /r $0\pack diff --git a/nsis/gvim_version.nsh b/nsis/gvim_version.nsh index f34feab0a5fa5..92a77866ebeaa 100644 --- a/nsis/gvim_version.nsh +++ b/nsis/gvim_version.nsh @@ -2,5 +2,5 @@ !ifndef __GVIM_VER__NSH__ !define __GVIM_VER__NSH__ !define VER_MAJOR 8 -!define VER_MINOR 1 +!define VER_MINOR 2 !endif diff --git a/nsis/lang/english.nsi b/nsis/lang/english.nsi index 6b7aa28304e48..218c70a47c9d7 100644 --- a/nsis/lang/english.nsi +++ b/nsis/lang/english.nsi @@ -24,7 +24,7 @@ LangString ^UninstallCaption ${LANG_ENGLISH} \ # "Destination Folder (Must end with $\"vim$\")" LangString str_show_readme ${LANG_ENGLISH} \ - "Show README after installation finish" + "Show README after installation finished" # Install types: LangString str_type_typical ${LANG_ENGLISH} \ diff --git a/nsis/lang/italian.nsi b/nsis/lang/italian.nsi index 296bb84c6f3b2..b90e0986cbcc8 100644 --- a/nsis/lang/italian.nsi +++ b/nsis/lang/italian.nsi @@ -58,10 +58,10 @@ LangString str_desc_console ${LANG_ITALIAN} \ "Versione console di Vim (vim.exe)." LangString str_section_batch ${LANG_ITALIAN} \ - "Crea file di invocazione (MS-DOS) .bat" + "Crea file .bat" LangString str_desc_batch ${LANG_ITALIAN} \ - "Crea file di invocazione .bat per varianti di Vim nella directory \ - di Windows, per utilizzo da linea di comando (MS-DOS)." + "Crea file .bat per varianti di Vim nella directory \ + di Windows, per utilizzo da riga di comando." LangString str_group_icons ${LANG_ITALIAN} \ "Crea icone per Vim" diff --git a/nsis/lang/russian.nsi b/nsis/lang/russian.nsi new file mode 100644 index 0000000000000..23458ce4c8356 --- /dev/null +++ b/nsis/lang/russian.nsi @@ -0,0 +1,287 @@ +# vi:set ts=8 sts=4 sw=4 et fdm=marker: +# +# russian.nsi: Russian language strings for gvim NSIS installer. +# +# Locale ID : 1049 +# Locale name : ru-RU +# fileencoding : UTF-8 +# Author : Restorer + +!insertmacro MUI_LANGUAGE "Russian" + + +# Overwrite the default translation. +# These strings should be always English. Otherwise dosinst.c fails. +LangString ^SetupCaption ${LANG_RUSSIAN} \ + "$(^Name) Setup" +LangString ^UninstallCaption ${LANG_RUSSIAN} \ + "$(^Name) Uninstall" + +############################################################################## +# MUI Configuration Strings {{{1 +############################################################################## + +#LangString str_dest_folder ${LANG_RUSSIAN} \ +# "ĐœĐ°Ņ€ŅˆŅ€ŅƒŅ‚ Đē ĐēĐ°Ņ‚Đ°ĐģĐžĐŗŅƒ ŅƒŅŅ‚Đ°ĐŊОвĐēи (Đ´ĐžĐģĐļĐĩĐŊ ĐžĐēаĐŊŅ‡Đ¸Đ˛Đ°Ņ‚ŅŒŅŅ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐžĐŧ $\"vim$\")" + +LangString str_show_readme ${LANG_RUSSIAN} \ + "ĐŸĐžŅĐģĐĩ ĐžĐēĐžĐŊŅ‡Đ°ĐŊĐ¸Ņ ŅƒŅŅ‚Đ°ĐŊОвĐēи ОСĐŊаĐēĐžĐŧĐ¸Ņ‚ŅŒŅŅ ҁ ĐēŅ€Đ°Ņ‚ĐēиĐŧ ĐžĐŋĐ¸ŅĐ°ĐŊиĐĩĐŧ" + +# Install types: +LangString str_type_typical ${LANG_RUSSIAN} \ + "ĐĄŅ‚Đ°ĐŊĐ´Đ°Ņ€Ņ‚ĐŊĐ°Ņ" + +LangString str_type_minimal ${LANG_RUSSIAN} \ + "МиĐŊиĐŧаĐģҌĐŊĐ°Ņ" + +LangString str_type_full ${LANG_RUSSIAN} \ + "ПоĐģĐŊĐ°Ņ" + + +############################################################################## +# Section Titles & Description {{{1 +############################################################################## + +LangString str_section_old_ver ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐŋŅ€ĐĩĐ´Ņ‹Đ´ŅƒŅ‰Đ¸Ņ… вĐĩŅ€ŅĐ¸Đš" +LangString str_desc_old_ver ${LANG_RUSSIAN} \ + "Đ‘ŅƒĐ´ŅƒŅ‚ ŅƒĐ´Đ°ĐģĐĩĐŊŅ‹ ĐŋŅ€ĐĩĐ´Ņ‹Đ´ŅƒŅ‰Đ¸Đĩ ŅƒŅŅ‚Đ°ĐŊОвĐģĐĩĐŊĐŊŅ‹Đĩ вĐĩŅ€ŅĐ¸Đ¸ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" + +LangString str_section_exe ${LANG_RUSSIAN} \ + "Đ“Ņ€Đ°Ņ„Đ¸Ņ‡ĐĩҁĐēиК иĐŊŅ‚ĐĩҀ҄ĐĩĐšŅ и Đ˛ŅĐŋĐžĐŧĐžĐŗĐ°Ņ‚ĐĩĐģҌĐŊŅ‹Đĩ Ņ„Đ°ĐšĐģŅ‹" +LangString str_desc_exe ${LANG_RUSSIAN} \ + "Đ“Ņ€Đ°Ņ„Đ¸Ņ‡ĐĩҁĐēиК иĐŊŅ‚ĐĩҀ҄ĐĩĐšŅ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim и Đ˛ŅĐĩ ĐŊĐĩĐžĐąŅ…ĐžĐ´Đ¸ĐŧŅ‹Đĩ Đ´ĐģŅ ŅŅ‚ĐžĐŗĐž Ņ„Đ°ĐšĐģŅ‹. \ + Đ­Ņ‚Đž ĐžĐąŅĐˇĐ°Ņ‚ĐĩĐģҌĐŊŅ‹Đš ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊŅ‚" + +LangString str_section_console ${LANG_RUSSIAN} \ + "КоĐŊŅĐžĐģҌĐŊĐ°Ņ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧа Vim" +LangString str_desc_console ${LANG_RUSSIAN} \ + "Đ’Đ°Ņ€Đ¸Đ°ĐŊŅ‚ Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim (vim.exe), Đ¸ŅĐŋĐžĐģŅŒĐˇŅƒĐĩĐŧŅ‹Đš в ĐēĐžĐŧаĐŊĐ´ĐŊОК ОйОĐģĐžŅ‡ĐēĐĩ" + +LangString str_section_batch ${LANG_RUSSIAN} \ + "ĐĄĐžĐˇĐ´Đ°Ņ‚ŅŒ ĐēĐžĐŧаĐŊĐ´ĐŊŅ‹Đĩ Ņ„Đ°ĐšĐģŅ‹" +LangString str_desc_batch ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ĐēĐžĐŧаĐŊĐ´ĐŊҋ҅ bat-Ņ„Đ°ĐšĐģОв ĐŋОСвОĐģŅŅŽŅ‰Đ¸Ņ… Ņ€Đ°ĐąĐžŅ‚Đ°Ņ‚ŅŒ ҁ Ņ€ĐĩдаĐēŅ‚ĐžŅ€ĐžĐŧ \ + Vim иС ĐēĐžĐŧаĐŊĐ´ĐŊОК ŅŅ‚Ņ€ĐžĐēи Windows" + +LangString str_group_icons ${LANG_RUSSIAN} \ + "ĐĄĐžĐˇĐ´Đ°Ņ‚ŅŒ ŅŅ€ĐģŅ‹Đēи Đ´ĐģŅ Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim" +LangString str_desc_icons ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ŅŅ€ĐģŅ‹ĐēОв Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim Đ´ĐģŅ ОйĐģĐĩĐŗŅ‡ĐĩĐŊĐ¸Ņ СаĐŋ҃ҁĐēа ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" + +LangString str_section_desktop ${LANG_RUSSIAN} \ + "На Đ Đ°ĐąĐžŅ‡ĐĩĐŧ ŅŅ‚ĐžĐģĐĩ" +LangString str_desc_desktop ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ŅŅ€ĐģŅ‹ĐēОв ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Gvim ĐŊа Đ Đ°ĐąĐžŅ‡ĐĩĐŧ ŅŅ‚ĐžĐģĐĩ" + +LangString str_section_start_menu ${LANG_RUSSIAN} \ + "В ĐŧĐĩĐŊŅŽ ĐēĐŊĐžĐŋĐēи ĐŸŅƒŅĐē" +LangString str_desc_start_menu ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ŅŅ€ĐģŅ‹ĐēОв ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Gvim в ĐŧĐĩĐŊŅŽ ĐēĐŊĐžĐŋĐēи ĐŸŅƒŅĐē" + +#LangString str_section_quick_launch ${LANG_RUSSIAN} \ +# "На ĐŋаĐŊĐĩĐģи ĐąŅ‹ŅŅ‚Ņ€ĐžĐŗĐž СаĐŋ҃ҁĐēа" +#LangString str_desc_quick_launch ${LANG_RUSSIAN} \ +# "ХОСдаĐŊиĐĩ ŅŅ€ĐģŅ‹ĐēОв ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ GVim ĐŊа ĐŋаĐŊĐĩĐģи ĐąŅ‹ŅŅ‚Ņ€ĐžĐŗĐž СаĐŋ҃ҁĐēа" + +LangString str_section_edit_with ${LANG_RUSSIAN} \ + "В ĐēĐžĐŊŅ‚ĐĩĐēҁ҂ĐŊĐžĐŧ ĐŧĐĩĐŊŅŽ" +LangString str_desc_edit_with ${LANG_RUSSIAN} \ + "ДобавĐģĐĩĐŊиĐĩ Đ˛Ņ‹ĐˇĐžĐ˛Đ° ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Gvim в Đŋ҃ĐŊĐēŅ‚ $\"ĐžŅ‚ĐēŅ€Ņ‹Ņ‚ŅŒ ҁ ĐŋĐžĐŧĐžŅ‰ŅŒŅŽ...$\" ĐēĐžĐŊŅ‚ĐĩĐēҁ҂ĐŊĐžĐŗĐž ĐŧĐĩĐŊŅŽ" + +#LangString str_section_edit_with32 ${LANG_RUSSIAN} \ +# "32-Ņ€Đ°ĐˇŅ€ŅĐ´ĐŊĐ°Ņ вĐĩŅ€ŅĐ¸Ņ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" +#LangString str_desc_edit_with32 ${LANG_RUSSIAN} \ +# "ДобавĐģĐĩĐŊиĐĩ Đ˛Ņ‹ĐˇĐžĐ˛Đ° ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Gvim в Đŋ҃ĐŊĐēŅ‚ $\"ĐžŅ‚ĐēŅ€Ņ‹Ņ‚ŅŒ ҁ ĐŋĐžĐŧĐžŅ‰ŅŒŅŽ...$\" ĐēĐžĐŊŅ‚ĐĩĐēҁ҂ĐŊĐžĐŗĐž ĐŧĐĩĐŊŅŽ \ +# Đ´ĐģŅ 32-Ņ€Đ°ĐˇŅ€ŅĐ´ĐŊҋ҅ ĐŋŅ€Đ¸ĐģĐžĐļĐĩĐŊиК" + +#LangString str_section_edit_with64 ${LANG_RUSSIAN} \ +# "64-Ņ€Đ°ĐˇŅ€ŅĐ´ĐŊĐ°Ņ вĐĩŅ€ŅĐ¸Ņ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" +#LangString str_desc_edit_with64 ${LANG_RUSSIAN} \ +# "ДобавĐģĐĩĐŊиĐĩ Đ˛Ņ‹ĐˇĐžĐ˛Đ° ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Gvim в Đŋ҃ĐŊĐēŅ‚ $\"ĐžŅ‚ĐēŅ€Ņ‹Ņ‚ŅŒ ҁ ĐŋĐžĐŧĐžŅ‰ŅŒŅŽ...$\" ĐēĐžĐŊŅ‚ĐĩĐēҁ҂ĐŊĐžĐŗĐž ĐŧĐĩĐŊŅŽ \ +# Đ´ĐģŅ 64-Ņ€Đ°ĐˇŅ€ŅĐ´ĐŊҋ҅ ĐŋŅ€Đ¸ĐģĐžĐļĐĩĐŊиК" + +LangString str_section_vim_rc ${LANG_RUSSIAN} \ + "ĐĐ°ŅŅ‚Ņ€ĐžĐšĐēи ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ ĐŋĐž ҃ĐŧĐžĐģŅ‡Đ°ĐŊĐ¸ŅŽ" +LangString str_desc_vim_rc ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ Ņ„Đ°ĐšĐģа _vimrc ҁ ĐŋŅ€ĐĩĐ´ŅƒŅŅ‚Đ°ĐŊОвĐģĐĩĐŊĐŊŅ‹Đŧи ĐŊĐ°ŅŅ‚Ņ€ĐžĐšĐēаĐŧи, ĐĩҁĐģи ĐŊĐĩŅ‚ Đ´Ņ€ŅƒĐŗĐ¸Ņ… \ + Ņ„Đ°ĐšĐģОв ĐŊĐ°ŅŅ‚Ņ€ĐžĐĩĐē" + +LangString str_group_plugin ${LANG_RUSSIAN} \ + "ĐĄĐžĐˇĐ´Đ°Ņ‚ŅŒ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ Đ´ĐģŅ ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš" +LangString str_desc_plugin ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° Đ´ĐģŅ Ņ€Đ°ĐˇĐŧĐĩ҉ĐĩĐŊĐ¸Ņ ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš, ĐēĐžŅ‚ĐžŅ€Ņ‹Đĩ Ņ€Đ°ŅŅˆĐ¸Ņ€ŅŅŽŅ‚ \ + вОСĐŧĐžĐļĐŊĐžŅŅ‚Đ¸ Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim" + +LangString str_section_plugin_home ${LANG_RUSSIAN} \ + "Đ›Đ¸Ņ‡ĐŊŅ‹Đš ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ" +LangString str_desc_plugin_home ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° Đ´ĐģŅ ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš в Đ´ĐžĐŧĐ°ŅˆĐŊĐĩĐŧ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐĩ ĐŋĐžĐģŅŒĐˇĐžĐ˛Đ°Ņ‚ĐĩĐģŅ" + +LangString str_section_plugin_vim ${LANG_RUSSIAN} \ + "ĐžĐąŅ‰Đ¸Đš ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ" +LangString str_desc_plugin_vim ${LANG_RUSSIAN} \ + "ХОСдаĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° Đ´ĐģŅ ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš в ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐĩ ŅƒŅŅ‚Đ°ĐŊОвĐēи Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim. \ + ĐœĐžĐ´ŅƒĐģи в ŅŅ‚ĐžĐŧ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐĩ ĐąŅƒĐ´ŅƒŅ‚ Đ´ĐžŅŅ‚ŅƒĐŋĐŊŅ‹ Đ´ĐģŅ ĐģŅŽĐąĐžĐŗĐž ĐŋĐžĐģŅŒĐˇĐžĐ˛Đ°Ņ‚ĐĩĐģŅ \ + ĐˇĐ°Ņ€ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ¸Ņ€ĐžĐ˛Đ°Đ˛ŅˆĐĩĐŗĐžŅŅ в ŅĐ¸ŅŅ‚ĐĩĐŧĐĩ" + +LangString str_section_vis_vim ${LANG_RUSSIAN} \ + "ПодĐēĐģŅŽŅ‡Đ°ĐĩĐŧŅ‹Đš ĐŧĐžĐ´ŅƒĐģҌ VisVim" +LangString str_desc_vis_vim ${LANG_RUSSIAN} \ + "ПодĐēĐģŅŽŅ‡Đ°ĐĩĐŧŅ‹Đš ĐŧĐžĐ´ŅƒĐģҌ VisVim Đ¸ŅĐŋĐžĐģŅŒĐˇŅƒĐĩŅ‚ŅŅ Đ´ĐģŅ иĐŊŅ‚ĐĩĐŗŅ€Đ°Ņ†Đ¸Đ¸ ҁ Microsoft Visual Studio" + +LangString str_section_nls ${LANG_RUSSIAN} \ + "ПоддĐĩŅ€ĐļĐēа Ņ€ĐĩĐŗĐ¸ĐžĐŊаĐģҌĐŊҋ҅ ŅĐˇŅ‹ĐēОв" +LangString str_desc_nls ${LANG_RUSSIAN} \ + "ĐŖŅŅ‚Đ°ĐŊОвĐēа Ņ„Đ°ĐšĐģОв Đ´ĐģŅ ĐŋОддĐĩŅ€ĐļĐēи Ņ€ĐĩĐŗĐ¸ĐžĐŊаĐģҌĐŊҋ҅ ŅĐˇŅ‹ĐēОв ĐžĐŋĐĩŅ€Đ°Ņ†Đ¸ĐžĐŊĐŊОК ŅĐ¸ŅŅ‚ĐĩĐŧŅ‹" + +LangString str_unsection_register ${LANG_RUSSIAN} \ + "ĐžŅ‚ĐŧĐĩĐŊĐ¸Ņ‚ŅŒ Ņ€ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ°Ņ†Đ¸ŅŽ ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊŅ‚ĐžĐ˛ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim" +LangString str_desc_unregister ${LANG_RUSSIAN} \ + "ĐžŅ‚ĐŧĐĩĐŊа Ņ€ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ°Ņ†Đ¸Đ¸ ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊŅ‚ĐžĐ˛ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim в ĐžĐŋĐĩŅ€Đ°Ņ†Đ¸ĐžĐŊĐŊОК ŅĐ¸ŅŅ‚ĐĩĐŧĐĩ" + +LangString str_unsection_exe ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐ¸Ņ‚ŅŒ Ņ„Đ°ĐšĐģŅ‹ Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim" +LangString str_desc_rm_exe ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ Đ˛ŅĐĩŅ… Đ¸ŅĐŋĐžĐģĐŊŅĐĩĐŧҋ҅ и Đ˛ŅĐŋĐžĐŧĐžĐŗĐ°Ņ‚ĐĩĐģҌĐŊҋ҅ Ņ„Đ°ĐšĐģОв Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim" + +LangString str_ungroup_plugin ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐ¸Ņ‚ŅŒ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš" +LangString str_desc_rm_plugin ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš, ĐĩҁĐģи в ĐŊŅ‘Đŧ ĐŊĐĩŅ‚ Ņ„Đ°ĐšĐģОв" + +LangString str_unsection_plugin_home ${LANG_RUSSIAN} \ + "Đ›Đ¸Ņ‡ĐŊŅ‹Đš ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ" +LangString str_desc_rm_plugin_home ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš иС Đ´ĐžĐŧĐ°ŅˆĐŊĐĩĐŗĐž ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ĐŋĐžĐģŅŒĐˇĐžĐ˛Đ°Ņ‚ĐĩĐģŅ" + +LangString str_unsection_plugin_vim ${LANG_RUSSIAN} \ + "ĐžĐąŅ‰Đ¸Đš ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ" +LangString str_desc_rm_plugin_vim ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ĐŋОдĐēĐģŅŽŅ‡Đ°ĐĩĐŧҋ҅ ĐŧĐžĐ´ŅƒĐģĐĩĐš иС ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ŅƒŅŅ‚Đ°ĐŊОвĐēи Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim" + +LangString str_unsection_rootdir ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐ¸Ņ‚ŅŒ ĐžŅĐŊОвĐŊОК ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim" +LangString str_desc_rm_rootdir ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐžŅĐŊОвĐŊĐžĐŗĐž ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim. В ŅŅ‚ĐžĐŧ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐĩ ĐŊĐ°Ņ…ĐžĐ´ŅŅ‚ŅŅ Ņ„Đ°ĐšĐģŅ‹ \ + ĐŊĐ°ŅŅ‚Ņ€ĐžĐĩĐē!" + + +############################################################################## +# Messages {{{1 +############################################################################## + +#LangString str_msg_too_many_ver ${LANG_RUSSIAN} \ +# "ОбĐŊĐ°Ņ€ŅƒĐļĐĩĐŊĐž ĐŋŅ€ĐĩĐ´Ņ‹Đ´ŅƒŅ‰Đ¸Ņ… вĐĩŅ€ŅĐ¸Đš ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim: $vim_old_ver_count.$\r$\n\ +# ДаĐŊĐŊĐ°Ņ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧа ŅƒŅŅ‚Đ°ĐŊОвĐēи ĐŧĐžĐļĐĩŅ‚ ŅƒĐ´Đ°ĐģĐ¸Ņ‚ŅŒ ĐŊĐĩ йОĐģĐĩĐĩ ${VIM_MAX_OLD_VER}.$\r$\n\ +# ĐŖĐ´Đ°ĐģĐ¸Ņ‚ŅŒ ĐģĐ¸ŅˆĐŊиĐĩ вĐĩŅ€ŅĐ¸Đ¸ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim и ĐŋĐžĐ˛Ņ‚ĐžŅ€Đ¸Ņ‚Đĩ ŅƒŅŅ‚Đ°ĐŊОвĐē҃" + +#LangString str_msg_invalid_root ${LANG_RUSSIAN} \ +# "НĐĩĐ´ĐžĐŋŅƒŅŅ‚Đ¸ĐŧŅ‹Đš ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ ŅƒŅŅ‚Đ°ĐŊОвĐēи ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim $vim_install_root!$\r$\n\ +# ĐœĐ°Ņ€ŅˆŅ€ŅƒŅ‚ ŅƒŅŅ‚Đ°ĐŊОвĐēи Đ´ĐžĐģĐļĐĩĐŊ ĐžĐēаĐŊŅ‡Đ¸Đ˛Đ°Ņ‚ŅŒŅŅ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐžĐŧ $\"vim$\"" + +#LangString str_msg_bin_mismatch ${LANG_RUSSIAN} \ +# "НĐĩĐ´ĐžĐŋŅƒŅŅ‚Đ¸ĐŧŅ‹Đš ĐŧĐ°Ņ€ŅˆŅ€ŅƒŅ‚ Đē ĐēĐ°Ņ‚Đ°ĐģĐžĐŗŅƒ ҁ Đ¸ŅĐŋĐžĐģĐŊŅĐĩĐŧŅ‹Đŧи Ņ„Đ°ĐšĐģаĐŧи!$\r$\n$\r$\n\ +# ĐœĐ°Ņ€ŅˆŅ€ŅƒŅ‚ Đē ĐēĐ°Ņ‚Đ°ĐģĐžĐŗŅƒ ҁ Đ¸ŅĐŋĐžĐģĐŊŅĐĩĐŧŅ‹Đŧи Ņ„Đ°ĐšĐģаĐŧи Đ´ĐžĐģĐļĐĩĐŊ ĐąŅ‹Ņ‚ŅŒ $\"$vim_bin_path$\",$\r$\n\ +# ĐŊĐž ĐžŅ‚ ĐžĐŋĐĩŅ€Đ°Ņ†Đ¸ĐžĐŊĐŊОК ŅĐ¸ŅŅ‚ĐĩĐŧŅ‹ ĐŋĐžĐģŅƒŅ‡ĐĩĐŊ ĐēаĐē $\"$INSTDIR$\"." + +#LangString str_msg_vim_running ${LANG_RUSSIAN} \ +# "ĐŸŅ€ĐžĐŗŅ€Đ°ĐŧĐŧа Vim ҁĐĩĐšŅ‡Đ°Ņ Ņ€Đ°ĐąĐžŅ‚Đ°ĐĩŅ‚.$\r$\n\ +# ĐŸŅ€ĐĩĐļĐ´Đĩ ҇ĐĩĐŧ ĐŋŅ€ĐžĐ´ĐžĐģĐļĐ¸Ņ‚ŅŒ, СаĐēŅ€ĐžĐšŅ‚Đĩ Đ˛ŅĐĩ Ņ€Đ°ĐąĐžŅ‚Đ°ŅŽŅ‰Đ¸Đĩ Ņ€ĐĩдаĐēŅ‚ĐžŅ€Ņ‹ Vim" + +#LangString str_msg_register_ole ${LANG_RUSSIAN} \ +# "ПоĐŋҋ҂Đēа ĐˇĐ°Ņ€ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ¸Ņ€ĐžĐ˛Đ°Ņ‚ŅŒ ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊ҂ҋ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim в ĐŋŅ€ĐžŅŅ‚Ņ€Đ°ĐŊŅŅ‚Đ˛Đĩ OLE. \ +# Но ĐŊĐĩ ĐŋĐžĐģŅƒŅ‡ĐĩĐŊĐž ŅƒĐ˛ĐĩĐ´ĐžĐŧĐģĐĩĐŊиĐĩ Ой ҃ҁĐŋĐĩ҈ĐŊĐžŅŅ‚Đ¸ даĐŊĐŊОК ĐžĐŋĐĩŅ€Đ°Ņ†Đ¸Đ¸" + +#LangString str_msg_unreg_ole ${LANG_RUSSIAN} \ +# "ПоĐŋҋ҂Đēа ĐžŅ‚ĐŧĐĩĐŊĐ¸Ņ‚ŅŒ Ņ€ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ°Ņ†Đ¸ŅŽ ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊŅ‚ĐžĐ˛ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ Vim в ĐŋŅ€ĐžŅŅ‚Ņ€Đ°ĐŊŅŅ‚Đ˛Đĩ OLE. \ +# Но ĐŊĐĩ ĐŋĐžĐģŅƒŅ‡ĐĩĐŊĐž ŅƒĐ˛ĐĩĐ´ĐžĐŧĐģĐĩĐŊиĐĩ Ой ҃ҁĐŋĐĩ҈ĐŊĐžŅŅ‚Đ¸ даĐŊĐŊОК ĐžĐŋĐĩŅ€Đ°Ņ†Đ¸Đ¸" + +#LangString str_msg_rm_start ${LANG_RUSSIAN} \ +# "Đ’Ņ‹ĐŋĐžĐģĐŊŅĐĩŅ‚ŅŅ ŅƒĐ´Đ°ĐģĐĩĐŊиĐĩ ҁĐģĐĩĐ´ŅƒŅŽŅ‰Đ¸Ņ… вĐĩŅ€ŅĐ¸Đš ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹:" + +#LangString str_msg_rm_fail ${LANG_RUSSIAN} \ +# "ĐŸŅ€ĐžĐ¸ĐˇĐžŅˆŅ‘Đģ ŅĐąĐžĐš ĐŋŅ€Đ¸ Đ˛Ņ‹ĐŋĐžĐģĐŊĐĩĐŊии ŅƒĐ´Đ°ĐģĐĩĐŊĐ¸Ņ ҁĐģĐĩĐ´ŅƒŅŽŅ‰Đ¸Ņ… вĐĩŅ€ŅĐ¸Đš ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹:" + +#LangString str_msg_no_rm_key ${LANG_RUSSIAN} \ +# "НĐĩ ŅƒĐ´Đ°ĐģĐžŅŅŒ ĐŊĐ°ĐšŅ‚Đ¸ Ņ€Đ°ĐˇĐ´ĐĩĐģ Ņ€ĐĩĐĩŅŅ‚Ņ€Đ°, ŅĐžĐ´ĐĩŅ€ĐļĐ°Ņ‰Đ¸Đš иĐŊŅ„ĐžŅ€ĐŧĐ°Ņ†Đ¸ŅŽ Ой ŅƒĐ´Đ°ĐģĐĩĐŊии ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" + +#LangString str_msg_no_rm_reg ${LANG_RUSSIAN} \ +# "НĐĩ ŅƒĐ´Đ°ĐģĐžŅŅŒ ĐŊĐ°ĐšŅ‚Đ¸ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧ҃ Đ˛Ņ‹ĐŋĐžĐģĐŊŅŅŽŅ‰ŅƒŅŽ ŅƒĐ´Đ°ĐģĐĩĐŊиĐĩ, ҃ĐēаСаĐŊĐŊŅƒŅŽ в Ņ€Đ°ĐˇĐ´ĐĩĐģĐĩ Ņ€ĐĩĐĩŅŅ‚Ņ€Đ°" + +#LangString str_msg_no_rm_exe ${LANG_RUSSIAN} \ +# "ĐžŅ‚ŅŅƒŅ‚ŅŅ‚Đ˛ŅƒŅŽŅ‚ ĐŋŅ€Đ°Đ˛Đ° ĐŊа Đ´ĐžŅŅ‚ŅƒĐŋ Đē ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧĐĩ, Đ˛Ņ‹ĐŋĐžĐģĐŊŅŅŽŅ‰ĐĩĐš ŅƒĐ´Đ°ĐģĐĩĐŊиĐĩ" + +#LangString str_msg_rm_copy_fail ${LANG_RUSSIAN} \ +# "ĐŸŅ€ĐžĐ¸ĐˇĐžŅˆĐģа ĐžŅˆĐ¸ĐąĐēа ĐŋŅ€Đ¸ ĐēĐžĐŋĐ¸Ņ€ĐžĐ˛Đ°ĐŊии ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ ŅƒĐ´Đ°ĐģĐĩĐŊĐ¸Ņ вО Đ˛Ņ€ĐĩĐŧĐĩĐŊĐŊŅ‹Đš ĐēĐ°Ņ‚Đ°ĐģĐžĐŗ" + +#LangString str_msg_rm_run_fail ${LANG_RUSSIAN} \ +# "ĐŸŅ€ĐžĐ¸ĐˇĐžŅˆŅ‘Đģ ŅĐąĐžĐš ĐŋŅ€Đ¸ СаĐŋ҃ҁĐēĐĩ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹, Đ˛Ņ‹ĐŋĐžĐģĐŊŅŅŽŅ‰ĐĩĐš ŅƒĐ´Đ°ĐģĐĩĐŊиĐĩ" + +#LangString str_msg_abort_install ${LANG_RUSSIAN} \ +# "ĐŖŅŅ‚Đ°ĐŊОвĐēа ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ ĐąŅ‹Đģа ĐžŅ‚ĐŧĐĩĐŊĐĩĐŊа" + +LangString str_msg_install_fail ${LANG_RUSSIAN} \ + "ĐŸŅ€ĐžĐ¸ĐˇĐžŅˆĐģа ĐžŅˆĐ¸ĐąĐēа ĐŋŅ€Đ¸ ŅƒŅŅ‚Đ°ĐŊОвĐēĐĩ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹. ПоĐŋŅ€ĐžĐąŅƒĐšŅ‚Đĩ ĐŋĐžĐ˛Ņ‚ĐžŅ€Đ¸Ņ‚ŅŒ ŅƒŅŅ‚Đ°ĐŊОвĐē҃ \ + ĐŊĐĩĐŧĐŊĐžĐŗĐž ĐŋĐžĐŋОСĐļĐĩ" +# ĐēĐžĐŗĐ´Đ° Đģ҃ĐŊа ĐąŅƒĐ´ĐĩŅ‚ в Đ´Ņ€ŅƒĐŗĐžĐš Ņ„Đ°ĐˇĐĩ и вĐĩŅ‚ĐĩŅ€ Đ´ĐžĐģĐļĐĩĐŊ Đ´ŅƒŅ‚ŅŒ ҁ ŅŽĐŗĐžâ€ĐˇĐ°Đŋада + +LangString str_msg_rm_exe_fail ${LANG_RUSSIAN} \ + "НĐĩĐēĐžŅ‚ĐžŅ€Ņ‹Đĩ Ņ„Đ°ĐšĐģŅ‹ ĐŊĐĩ ĐąŅ‹Đģи ŅƒĐ´Đ°ĐģĐĩĐŊŅ‹ иС ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° $0 $\r$\n\ + НĐĩĐžĐąŅ…ĐžĐ´Đ¸ĐŧĐž Đ˛Ņ‹ĐŋĐžĐģĐŊĐ¸Ņ‚ŅŒ Đ¸Ņ… ŅƒĐ´Đ°ĐģĐĩĐŊиĐĩ ŅĐ°ĐŧĐžŅŅ‚ĐžŅŅ‚ĐĩĐģҌĐŊĐž" + +#LangString str_msg_rm_root_fail ${LANG_RUSSIAN} \ +# "ВĐŊиĐŧаĐŊиĐĩ! В ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐĩ $\"$vim_install_root$\" ŅĐžĐ´ĐĩŅ€ĐļĐ°Ņ‚ŅŅ Ņ„Đ°ĐšĐģŅ‹. ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐēĐ°Ņ‚Đ°ĐģĐžĐŗĐ° ĐŊĐĩ Đ˛Ņ‹ĐŋĐžĐģĐŊĐĩĐŊĐž" + +LangString str_msg_uninstalling ${LANG_RUSSIAN} \ + "ĐŖĐ´Đ°ĐģĐĩĐŊиĐĩ ĐŋŅ€ĐĩĐ´Ņ‹Đ´ŅƒŅ‰Đ¸Ņ… вĐĩŅ€ŅĐ¸Đš ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧ..." + +LangString str_msg_registering ${LANG_RUSSIAN} \ + "Đ ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ°Ņ†Đ¸Ņ ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊŅ‚ĐžĐ˛ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ в ŅĐ¸ŅŅ‚ĐĩĐŧĐĩ..." + +LangString str_msg_unregistering ${LANG_RUSSIAN} \ + "ĐžŅ‚ĐŧĐĩĐŊа Ņ€ĐĩĐŗĐ¸ŅŅ‚Ņ€Đ°Ņ†Đ¸Đ¸ ĐēĐžĐŧĐŋĐžĐŊĐĩĐŊŅ‚ĐžĐ˛ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ в ŅĐ¸ŅŅ‚ĐĩĐŧĐĩ..." + + +############################################################################## +# Dialog Box {{{1 +############################################################################## + +LangString str_vimrc_page_title ${LANG_RUSSIAN} \ + "ĐŖŅŅ‚Đ°ĐŊОвĐēа ĐŋĐ°Ņ€Đ°ĐŧĐĩŅ‚Ņ€ĐžĐ˛ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" +LangString str_vimrc_page_subtitle ${LANG_RUSSIAN} \ + "ĐŸĐ°Ņ€Đ°ĐŧĐĩ҂Ҁҋ, Đ¸ŅĐŋĐžĐģŅŒĐˇŅƒĐĩĐŧŅ‹Đĩ Đ´ĐģŅ ĐēĐģĐ°Đ˛Đ¸Đ°Ņ‚ŅƒŅ€Ņ‹, ÂĢĐŧŅ‹ŅˆĐ¸Âģ и Ņ„ŅƒĐŊĐēŅ†Đ¸ĐžĐŊаĐģҌĐŊĐžŅŅ‚Đ¸ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" + +LangString str_msg_compat_title ${LANG_RUSSIAN} \ + " Đ’Đ°Ņ€Đ¸Đ°ĐŊ҂ҋ Đ¸ŅĐŋĐžĐģŅŒĐˇĐžĐ˛Đ°ĐŊĐ¸Ņ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹ " +LangString str_msg_compat_desc ${LANG_RUSSIAN} \ + "ХОвĐŧĐĩŅŅ‚Đ¸ĐŧĐžŅŅ‚ŅŒ и Ņ„ŅƒĐŊĐēŅ†Đ¸ĐžĐŊаĐģҌĐŊĐžŅŅ‚ŅŒ ĐŋŅ€ĐžĐŗŅ€Đ°ĐŧĐŧŅ‹" +LangString str_msg_compat_vi ${LANG_RUSSIAN} \ + "Đ Đ°ĐąĐžŅ‚Đ° в Đ˛Đ°Ņ€Đ¸Đ°ĐŊŅ‚Đĩ ŅĐžĐ˛ĐŧĐĩŅŅ‚Đ¸ĐŧĐžŅŅ‚Đ¸ ҁ Ņ€ĐĩдаĐēŅ‚ĐžŅ€ĐžĐŧ Vi" +LangString str_msg_compat_vim ${LANG_RUSSIAN} \ + "Đ Đ°ĐąĐžŅ‚Đ° в Đ˛Đ°Ņ€Đ¸Đ°ĐŊŅ‚Đĩ Ņ„ŅƒĐŊĐēŅ†Đ¸ĐžĐŊаĐģҌĐŊĐžŅŅ‚Đ¸ Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim" +LangString str_msg_compat_defaults ${LANG_RUSSIAN} \ + "Đ Đ°ĐąĐžŅ‚Đ° Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim ҁ ĐŊĐĩĐēĐžŅ‚ĐžŅ€Ņ‹Đŧи ҃ĐģŅƒŅ‡ŅˆĐĩĐŊĐ¸ŅĐŧи (Ņ„Đ°ĐšĐģ defaults.vim)" +LangString str_msg_compat_all ${LANG_RUSSIAN} \ + "Đ Đ°ĐąĐžŅ‚Đ° Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đ° Vim ŅĐž Đ˛ŅĐĩĐŧи ҃ĐģŅƒŅ‡ŅˆĐĩĐŊĐ¸ŅĐŧи (Ņ„Đ°ĐšĐģ vimrc_example.vim). \ + Đ˜ŅĐŋĐžĐģŅŒĐˇŅƒĐĩŅ‚ŅŅ ĐŋĐž ҃ĐŧĐžĐģŅ‡Đ°ĐŊĐ¸ŅŽ" + +LangString str_msg_keymap_title ${LANG_RUSSIAN} \ + " КĐģĐ°Đ˛Đ¸Đ°Ņ‚ŅƒŅ€ĐŊŅ‹Đĩ ĐēĐžĐŧаĐŊĐ´Ņ‹ " +LangString str_msg_keymap_desc ${LANG_RUSSIAN} \ + "КĐģĐ°Đ˛Đ¸Đ°Ņ‚ŅƒŅ€ĐŊŅ‹Đĩ ĐēĐžĐŧаĐŊĐ´Ņ‹ Đ¸ŅĐŋĐžĐģŅŒĐˇŅƒĐĩĐŧŅ‹Đĩ в ОС Windows (CTRL+V, CTRL+C, CTRL+S, CTRL+F и Ņ‚. Đŋ.)" +LangString str_msg_keymap_default ${LANG_RUSSIAN} \ + "НĐĩ иСĐŧĐĩĐŊŅŅ‚ŅŒ ĐēĐģĐ°Đ˛Đ¸Đ°Ņ‚ŅƒŅ€ĐŊŅ‹Đĩ ĐēĐžĐŧаĐŊĐ´Ņ‹. Đ˜ŅĐŋĐžĐģŅŒĐˇĐžĐ˛Đ°Ņ‚ŅŒ ĐŋŅ€Đ¸ĐŊŅŅ‚Ņ‹Đĩ в Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đĩ Vim" +LangString str_msg_keymap_windows ${LANG_RUSSIAN} \ + "ИСĐŧĐĩĐŊĐ¸Ņ‚ŅŒ ҃ĐēаСаĐŊĐŊŅ‹Đĩ ĐēĐģĐ°Đ˛Đ¸Đ°Ņ‚ŅƒŅ€ĐŊŅ‹Đĩ ĐēĐžĐŧаĐŊĐ´Ņ‹" + +LangString str_msg_mouse_title ${LANG_RUSSIAN} \ + " МаĐŊиĐŋ҃ĐģŅŅ‚ĐžŅ€ ÂĢĐŧŅ‹ŅˆŅŒÂģ " +LangString str_msg_mouse_desc ${LANG_RUSSIAN} \ + "ДĐĩĐšŅŅ‚Đ˛Đ¸Đš ĐŋŅ€Đ°Đ˛ĐžĐš и ĐģĐĩвОК ĐēĐŊĐžĐŋĐēи ĐŧаĐŊиĐŋ҃ĐģŅŅ‚ĐžŅ€Đ° ÂĢĐŧŅ‹ŅˆŅŒÂģ" +LangString str_msg_mouse_default ${LANG_RUSSIAN} \ + "ĐŸŅ€Đ°Đ˛Đ°Ņ ĐēĐŊĐžĐŋĐēа — Đ˛ŅĐŋĐģŅ‹Đ˛Đ°ŅŽŅ‰ĐĩĐĩ ĐŧĐĩĐŊŅŽ, ĐģĐĩĐ˛Đ°Ņ ĐēĐŊĐžĐŋĐēа — Ņ€ĐĩĐļиĐŧ Đ˛Đ¸ĐˇŅƒĐ°ĐģҌĐŊŅ‹Đš" +LangString str_msg_mouse_windows ${LANG_RUSSIAN} \ + "ĐŸŅ€Đ°Đ˛Đ°Ņ ĐēĐŊĐžĐŋĐēа — Đ˛ŅĐŋĐģŅ‹Đ˛Đ°ŅŽŅ‰ĐĩĐĩ ĐŧĐĩĐŊŅŽ, ĐģĐĩĐ˛Đ°Ņ ĐēĐŊĐžĐŋĐēа — Ņ€ĐĩĐļиĐŧ Đ˛Ņ‹ĐąĐžŅ€Đēи (ĐēаĐē в ОС Windows)" +LangString str_msg_mouse_unix ${LANG_RUSSIAN} \ + "ĐŸŅ€Đ°Đ˛Đ°Ņ ĐēĐŊĐžĐŋĐēа — Ņ€Đ°ŅŅˆĐ¸Ņ€ŅĐĩĐŧŅ‹Đš Ņ€ĐĩĐļиĐŧ Đ˛Ņ‹ĐąĐžŅ€Đ°, ĐģĐĩĐ˛Đ°Ņ ĐēĐŊĐžĐŋĐēа — Ņ€ĐĩĐļиĐŧ Đ˛Đ¸ĐˇŅƒĐ°ĐģҌĐŊŅ‹Đš (ĐēаĐē в UNIX‐ĐŋОдОйĐŊҋ҅ ОС)" diff --git a/nsis/lang/turkish.nsi b/nsis/lang/turkish.nsi new file mode 100644 index 0000000000000..4c966c5034c4a --- /dev/null +++ b/nsis/lang/turkish.nsi @@ -0,0 +1,190 @@ +# turkish.nsi: Turkish language strings for gvim NSIS installer. +# fileencoding : UTF-8 +# Author : Emir SARI + +!insertmacro MUI_LANGUAGE "Turkish" + +# Overwrite the default translation. +# These strings should be always English. Otherwise dosinst.c fails. +LangString ^SetupCaption ${LANG_TURKISH} \ + "$(^Name) Setup" +LangString ^UninstallCaption ${LANG_TURKISH} \ + "$(^Name) Uninstall" + +LangString str_show_readme ${LANG_TURKISH} \ + "Kurulum bittikten sonra README dosyasÄąnÄą aç" + +# Install types: +LangString str_type_typical ${LANG_TURKISH} \ + "Normal" + +LangString str_type_minimal ${LANG_TURKISH} \ + "KÃŧçÃŧk" + +LangString str_type_full ${LANG_TURKISH} \ + "Tam" + +############################################################################## +# Section Titles & Description {{{1 +############################################################################## + +LangString str_section_old_ver ${LANG_TURKISH} \ + "Eski sÃŧrÃŧmÃŧ kaldÄąr" +LangString str_desc_old_ver ${LANG_TURKISH} \ + "Vim'in eski sÃŧrÃŧmÃŧnÃŧ sisteminizden kaldÄąrÄąr." + +LangString str_section_exe ${LANG_TURKISH} \ + "Vim grafik arabirimi ve çalÄąÅŸma dosyalarÄą" +LangString str_desc_exe ${LANG_TURKISH} \ + "Vim program başlatÄącÄą ve çalÄąÅŸma dosyalarÄą. Bu bileşen zorunludur." + +LangString str_section_console ${LANG_TURKISH} \ + "Vim konsol sÃŧrÃŧmÃŧ" +LangString str_desc_console ${LANG_TURKISH} \ + "Vim'in konsol sÃŧrÃŧmÃŧ (vim.exe)." + +LangString str_section_batch ${LANG_TURKISH} \ + ".bat dosyalarÄą oluştur" +LangString str_desc_batch ${LANG_TURKISH} \ + "Vim için komut satÄąrÄąnda kullanmak Ãŧzere .bat dosyalarÄą oluşturur" + +LangString str_group_icons ${LANG_TURKISH} \ + "Vim için kÄąsayollar oluştur" +LangString str_desc_icons ${LANG_TURKISH} \ + "Kolay erişim için Vim kÄąsayollarÄą oluşturur." + +LangString str_section_desktop ${LANG_TURKISH} \ + "MasaÃŧstÃŧnde" +LangString str_desc_desktop ${LANG_TURKISH} \ + "gVim programÄą için MasaÃŧstÃŧnde kÄąsayol oluşturur." + +LangString str_section_start_menu ${LANG_TURKISH} \ + "Başlat MenÃŧsÃŧ - Programlar klasÃļrÃŧnde" +LangString str_desc_start_menu ${LANG_TURKISH} \ + "Vim kÄąsayolunu Başlat MenÃŧsÃŧne ekler." + +LangString str_section_edit_with ${LANG_TURKISH} \ + "Vim ile Aç" +LangString str_desc_edit_with ${LANG_TURKISH} \ + "Vim'i $\"Birlikte aç$\" sağ tÄąk menÃŧsÃŧne ekler." + + LangString str_section_vim_rc ${LANG_TURKISH} \ + "Bir yapÄąlandÄąrma dosyasÄą oluştur" +LangString str_desc_vim_rc ${LANG_TURKISH} \ + "Eğer yoksa bir yapÄąlandÄąrma dosyasÄą (_vimrc) oluşturur." + +LangString str_group_plugin ${LANG_TURKISH} \ + "Eklenti dizinleri oluştur" +LangString str_desc_plugin ${LANG_TURKISH} \ + "Bu dizinlere Vim eklentilerini yerleştirerek Vim'e yeni \ + Ãļzellikler kazandÄąrabilirsiniz." + +LangString str_section_plugin_home ${LANG_TURKISH} \ + "Gizli" +LangString str_desc_plugin_home ${LANG_TURKISH} \ + "Eklenti dizinlerini EV dizininde oluşturur." + +LangString str_section_plugin_vim ${LANG_TURKISH} \ + "PaylaÅŸÄąlan" +LangString str_desc_plugin_vim ${LANG_TURKISH} \ + "Eklenti dizinlerini Vim yÃŧkleme dizininde oluşturur. Bu eklentilerden \ + bilgisayarÄąn tÃŧm kullanÄącÄąlarÄą yararlanabilir." + +LangString str_section_vis_vim ${LANG_TURKISH} \ + "VisVim eklentisi" +LangString str_desc_vis_vim ${LANG_TURKISH} \ + "Microsoft Visual Studio entegrasyonu için VisVim eklentisi" + +LangString str_section_nls ${LANG_TURKISH} \ + "Ek dil desteği" +LangString str_desc_nls ${LANG_TURKISH} \ + "Mevcut olan Vim yerelleştirmelerini yÃŧkler." + +LangString str_unsection_register ${LANG_TURKISH} \ + "Vim kaydÄąnÄą kaldÄąr" +LangString str_desc_unregister ${LANG_TURKISH} \ + "Vim'in bu bilgisayardaki kaydÄąnÄą kaldÄąrÄąr." + +LangString str_unsection_exe ${LANG_TURKISH} \ + "Vim programÄąnÄą ve çalÄąÅŸtÄąrma dosyalarÄąnÄą kaldÄąr" +LangString str_desc_rm_exe ${LANG_TURKISH} \ + "Vim çalÄąÅŸtÄąrÄąlabilir dosyalarÄąnÄą ve diğer dosyalarÄą kaldÄąrÄąr." + +LangString str_ungroup_plugin ${LANG_TURKISH} \ + "Eklenti dizinlerini kaldÄąr" +LangString str_desc_rm_plugin ${LANG_TURKISH} \ + "Eklenti dizinlerini eğer boş ise kaldÄąrÄąr." + +LangString str_unsection_plugin_home ${LANG_TURKISH} \ + "Gizli" +LangString str_desc_rm_plugin_home ${LANG_TURKISH} \ + "Eklenti dizinlerini EV dizininden kaldÄąrÄąr." + +LangString str_unsection_plugin_vim ${LANG_TURKISH} \ + "PaylaÅŸÄąlan" +LangString str_desc_rm_plugin_vim ${LANG_TURKISH} \ + "Eklenti dizinlerini Vim yÃŧkleme dizininden kaldÄąrÄąr." + +LangString str_unsection_rootdir ${LANG_TURKISH} \ + "Vim kÃļk dizinini kaldÄąr" +LangString str_desc_rm_rootdir ${LANG_TURKISH} \ + "Vim kÃļk dizinini kaldÄąrÄąr. Bu dizin Vim yapÄąlandÄąrma dosyalarÄąnÄą içerir!" + + LangString str_msg_install_fail ${LANG_TURKISH} \ + "YÃŧkleme başarÄąsÄąz oldu. Yeniden deneyin." + +LangString str_msg_rm_exe_fail ${LANG_TURKISH} \ + "$0 içindeki bazÄą dosyalar silinemedi!$\r$\n\ + Bu dosyalarÄą el ile kaldÄąrmalÄąsÄąnÄąz." + + LangString str_msg_uninstalling ${LANG_TURKISH} \ + "Eski sÃŧrÃŧm kaldÄąrÄąlÄąyor..." + +LangString str_msg_registering ${LANG_TURKISH} \ + "Kaydediliyor..." + +LangString str_msg_unregistering ${LANG_TURKISH} \ + "KayÄąt siliniyor..." + + +############################################################################## +# Dialog Box {{{1 +############################################################################## + +LangString str_vimrc_page_title ${LANG_TURKISH} \ + "_vimrc ayarlarÄąnÄą seçin" +LangString str_vimrc_page_subtitle ${LANG_TURKISH} \ + "YÃŧklenecek ek Ãļzellikler, klavye ve fare için ayarlarÄą seçin." + +LangString str_msg_compat_title ${LANG_TURKISH} \ + " Vi / Vim davranÄąÅŸÄą " +LangString str_msg_compat_desc ${LANG_TURKISH} \ + "&Uyumluluk ve ek Ãļzellikler" +LangString str_msg_compat_vi ${LANG_TURKISH} \ + "Vi uyumlu" +LangString str_msg_compat_vim ${LANG_TURKISH} \ + "Vim orijinal" +LangString str_msg_compat_defaults ${LANG_TURKISH} \ + "Vim ve ek olarak bazÄą ek Ãļzellikler (load defaults.vim)" +LangString str_msg_compat_all ${LANG_TURKISH} \ + "Vim ve ek olarak tÃŧm ek Ãļzellikler (load vimrc_example.vim) (Default)" + +LangString str_msg_keymap_title ${LANG_TURKISH} \ + " Klavye İşlevleri " +LangString str_msg_keymap_desc ${LANG_TURKISH} \ + "&Windows için bazÄą dÃŧğmeleri yeniden ayarla (Ctrl-V, Ctrl-C, Ctrl-A, Ctrl-S, Ctrl-F, etc)" +LangString str_msg_keymap_default ${LANG_TURKISH} \ + "DÃŧğme işlevlerini değiştirme (varsayÄąlan)" +LangString str_msg_keymap_windows ${LANG_TURKISH} \ + "BazÄą dÃŧğmeleri yeniden ayarla" + +LangString str_msg_mouse_title ${LANG_TURKISH} \ + " Fare İşlevleri " +LangString str_msg_mouse_desc ${LANG_TURKISH} \ + "&Sağ ve sol dÃŧğme davranÄąÅŸÄą" +LangString str_msg_mouse_default ${LANG_TURKISH} \ + "Sağ: aÃ§ÄąlÄąr menÃŧ, Sol: GÃļrsel Kip (varsayÄąlan)" +LangString str_msg_mouse_windows ${LANG_TURKISH} \ + "Sağ: aÃ§ÄąlÄąr menÃŧ, Sol: seçim kipi (Windows)" +LangString str_msg_mouse_unix ${LANG_TURKISH} \ + "Sağ: seçimi genişlet, Sol: GÃļrsel Kip (Unix)" diff --git a/pixmaps/gen-inline-pixbufs.sh b/pixmaps/gen-inline-pixbufs.sh index 8e11a233ca165..616c547df2835 100644 --- a/pixmaps/gen-inline-pixbufs.sh +++ b/pixmaps/gen-inline-pixbufs.sh @@ -3,11 +3,9 @@ prefix=stock_ list= -for file in "$@" -do - name=`echo "$file" | sed 's|-|_|g; s|^.*/||; s|\..*$||'` +for file in "$@"; do + name=$(echo "$file" | sed 's|-|_|g; s|^.*/||; s|\..*$||') list="$list $prefix$name $file" done gdk-pixbuf-csource --raw --static --build-list $list - diff --git a/runtime/autoload/ada.vim b/runtime/autoload/ada.vim index d04feb925047e..3f1b40398f4ce 100644 --- a/runtime/autoload/ada.vim +++ b/runtime/autoload/ada.vim @@ -67,13 +67,13 @@ if exists ('g:ada_with_gnat_project_files') endfor endif -" Section: add standart exception {{{2 +" Section: add standard exception {{{2 " for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'exception', - \ 'info': 'Ada standart exception.', + \ 'info': 'Ada standard exception.', \ 'kind': 'x', \ 'icase': 1}] endfor @@ -210,7 +210,7 @@ function ada#Word (...) let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' ) " Cope with tag searching for items in comments; if we are, don't loop - " backards looking for previous lines + " backwards looking for previous lines if l:Column_Nr > strlen(l:Line) " We were in a comment let l:Line = getline(l:Line_Nr) diff --git a/runtime/autoload/adacomplete.vim b/runtime/autoload/adacomplete.vim index 2659f51d5c52a..d7bba93d1201a 100644 --- a/runtime/autoload/adacomplete.vim +++ b/runtime/autoload/adacomplete.vim @@ -14,7 +14,7 @@ " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for " autoload -" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc +" 05.11.2006 MK Bram suggested against using setlocal omnifunc " 05.11.2006 MK Bram suggested to save on spaces " Help Page: ft-ada-omni "------------------------------------------------------------------------------ diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index 156b3af0252d0..3bddba7a95109 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,482 +1,520 @@ -" Vim completion script -" Language: C -" Maintainer: Bram Moolenaar -" Last Change: 2018 Aug 20 - -let s:cpo_save = &cpo -set cpo&vim - -" This function is used for the 'omnifunc' option. -function! ccomplete#Complete(findstart, base) - if a:findstart - " Locate the start of the item, including ".", "->" and "[...]". - let line = getline('.') - let start = col('.') - 1 - let lastword = -1 +vim9script noclear + +# Vim completion script +# Language: C +# Maintainer: Bram Moolenaar +# Rewritten in Vim9 script by github user lacygoill +# Last Change: 2022 Jan 31 + +var prepended: string +var grepCache: dict>> + +# This function is used for the 'omnifunc' option. +export def Complete(findstart: bool, abase: string): any # {{{1 + if findstart + # Locate the start of the item, including ".", "->" and "[...]". + var line: string = getline('.') + var start: number = charcol('.') - 1 + var lastword: number = -1 while start > 0 if line[start - 1] =~ '\w' - let start -= 1 + --start elseif line[start - 1] =~ '\.' - if lastword == -1 - let lastword = start - endif - let start -= 1 - elseif start > 1 && line[start - 2] == '-' && line[start - 1] == '>' - if lastword == -1 - let lastword = start - endif - let start -= 2 + if lastword == -1 + lastword = start + endif + --start + elseif start > 1 && line[start - 2] == '-' + && line[start - 1] == '>' + if lastword == -1 + lastword = start + endif + start -= 2 elseif line[start - 1] == ']' - " Skip over [...]. - let n = 0 - let start -= 1 - while start > 0 - let start -= 1 - if line[start] == '[' - if n == 0 - break - endif - let n -= 1 - elseif line[start] == ']' " nested [] - let n += 1 - endif - endwhile + # Skip over [...]. + var n: number = 0 + --start + while start > 0 + --start + if line[start] == '[' + if n == 0 + break + endif + --n + elseif line[start] == ']' # nested [] + ++n + endif + endwhile else - break + break endif endwhile - " Return the column of the last word, which is going to be changed. - " Remember the text that comes before it in s:prepended. + # Return the column of the last word, which is going to be changed. + # Remember the text that comes before it in prepended. if lastword == -1 - let s:prepended = '' - return start + prepended = '' + return byteidx(line, start) endif - let s:prepended = strpart(line, start, lastword - start) - return lastword + prepended = line[start : lastword - 1] + return byteidx(line, lastword) endif - " Return list of matches. + # Return list of matches. - let base = s:prepended . a:base + var base: string = prepended .. abase - " Don't do anything for an empty base, would result in all the tags in the - " tags file. + # Don't do anything for an empty base, would result in all the tags in the + # tags file. if base == '' return [] endif - " init cache for vimgrep to empty - let s:grepCache = {} + # init cache for vimgrep to empty + grepCache = {} - " Split item in words, keep empty word after "." or "->". - " "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc. - " We can't use split, because we need to skip nested [...]. - " "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc. - let items = [] - let s = 0 - let arrays = 0 + # Split item in words, keep empty word after "." or "->". + # "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc. + # We can't use split, because we need to skip nested [...]. + # "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc. + var items: list + var s: number = 0 + var arrays: number = 0 while 1 - let e = match(base, '\.\|->\|\[', s) + var e: number = base->charidx(match(base, '\.\|->\|\[', s)) if e < 0 if s == 0 || base[s - 1] != ']' - call add(items, strpart(base, s)) + items->add(base[s :]) endif break endif if s == 0 || base[s - 1] != ']' - call add(items, strpart(base, s, e - s)) + items->add(base[s : e - 1]) endif if base[e] == '.' - let s = e + 1 " skip over '.' + # skip over '.' + s = e + 1 elseif base[e] == '-' - let s = e + 2 " skip over '->' + # skip over '->' + s = e + 2 else - " Skip over [...]. - let n = 0 - let s = e - let e += 1 - while e < len(base) - if base[e] == ']' - if n == 0 - break - endif - let n -= 1 - elseif base[e] == '[' " nested [...] - let n += 1 - endif - let e += 1 + # Skip over [...]. + var n: number = 0 + s = e + ++e + while e < strcharlen(base) + if base[e] == ']' + if n == 0 + break + endif + --n + elseif base[e] == '[' # nested [...] + ++n + endif + ++e endwhile - let e += 1 - call add(items, strpart(base, s, e - s)) - let arrays += 1 - let s = e + ++e + items->add(base[s : e - 1]) + ++arrays + s = e endif endwhile - " Find the variable items[0]. - " 1. in current function (like with "gd") - " 2. in tags file(s) (like with ":tag") - " 3. in current file (like with "gD") - let res = [] - if searchdecl(items[0], 0, 1) == 0 - " Found, now figure out the type. - " TODO: join previous line if it makes sense - let line = getline('.') - let col = col('.') - if stridx(strpart(line, 0, col), ';') != -1 - " Handle multiple declarations on the same line. - let col2 = col - 1 + # Find the variable items[0]. + # 1. in current function (like with "gd") + # 2. in tags file(s) (like with ":tag") + # 3. in current file (like with "gD") + var res: list> + if items[0]->searchdecl(false, true) == 0 + # Found, now figure out the type. + # TODO: join previous line if it makes sense + var line: string = getline('.') + var col: number = charcol('.') + if line[: col - 1]->stridx(';') >= 0 + # Handle multiple declarations on the same line. + var col2: number = col - 1 while line[col2] != ';' - let col2 -= 1 + --col2 endwhile - let line = strpart(line, col2 + 1) - let col -= col2 + line = line[col2 + 1 :] + col -= col2 endif - if stridx(strpart(line, 0, col), ',') != -1 - " Handle multiple declarations on the same line in a function - " declaration. - let col2 = col - 1 + if line[: col - 1]->stridx(',') >= 0 + # Handle multiple declarations on the same line in a function + # declaration. + var col2: number = col - 1 while line[col2] != ',' - let col2 -= 1 + --col2 endwhile - if strpart(line, col2 + 1, col - col2 - 1) =~ ' *[^ ][^ ]* *[^ ]' - let line = strpart(line, col2 + 1) - let col -= col2 + if line[col2 + 1 : col - 1] =~ ' *[^ ][^ ]* *[^ ]' + line = line[col2 + 1 :] + col -= col2 endif endif if len(items) == 1 - " Completing one word and it's a local variable: May add '[', '.' or - " '->'. - let match = items[0] - let kind = 'v' - if match(line, '\<' . match . '\s*\[') > 0 - let match .= '[' + # Completing one word and it's a local variable: May add '[', '.' or + # '->'. + var match: string = items[0] + var kind: string = 'v' + if match(line, '\<' .. match .. '\s*\[') > 0 + match ..= '[' else - let res = s:Nextitem(strpart(line, 0, col), [''], 0, 1) - if len(res) > 0 - " There are members, thus add "." or "->". - if match(line, '\*[ \t(]*' . match . '\>') > 0 - let match .= '->' - else - let match .= '.' - endif - endif + res = line[: col - 1]->Nextitem([''], 0, true) + if len(res) > 0 + # There are members, thus add "." or "->". + if match(line, '\*[ \t(]*' .. match .. '\>') > 0 + match ..= '->' + else + match ..= '.' + endif + endif endif - let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}] + res = [{match: match, tagline: '', kind: kind, info: line}] elseif len(items) == arrays + 1 - " Completing one word and it's a local array variable: build tagline - " from declaration line - let match = items[0] - let kind = 'v' - let tagline = "\t/^" . line . '$/' - let res = [{'match': match, 'tagline' : tagline, 'kind' : kind, 'info' : line}] + # Completing one word and it's a local array variable: build tagline + # from declaration line + var match: string = items[0] + var kind: string = 'v' + var tagline: string = "\t/^" .. line .. '$/' + res = [{match: match, tagline: tagline, kind: kind, info: line}] else - " Completing "var.", "var.something", etc. - let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) + # Completing "var.", "var.something", etc. + res = line[: col - 1]->Nextitem(items[1 :], 0, true) endif endif if len(items) == 1 || len(items) == arrays + 1 - " Only one part, no "." or "->": complete from tags file. + # Only one part, no "." or "->": complete from tags file. + var tags: list> if len(items) == 1 - let tags = taglist('^' . base) + tags = taglist('^' .. base) else - let tags = taglist('^' . items[0] . '$') + tags = taglist('^' .. items[0] .. '$') endif - " Remove members, these can't appear without something in front. - call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1') - - " Remove static matches in other files. - call filter(tags, '!has_key(v:val, "static") || !v:val["static"] || bufnr("%") == bufnr(v:val["filename"])') - - call extend(res, map(tags, 's:Tag2item(v:val)')) + tags + # Remove members, these can't appear without something in front. + ->filter((_, v: dict): bool => + v->has_key('kind') ? v.kind != 'm' : true) + # Remove static matches in other files. + ->filter((_, v: dict): bool => + !v->has_key('static') + || !v['static'] + || bufnr('%') == bufnr(v['filename'])) + + res = res->extend(tags->map((_, v: dict) => Tag2item(v))) endif if len(res) == 0 - " Find the variable in the tags file(s) - let diclist = taglist('^' . items[0] . '$') - - " Remove members, these can't appear without something in front. - call filter(diclist, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1') - - let res = [] - for i in range(len(diclist)) - " New ctags has the "typeref" field. Patched version has "typename". - if has_key(diclist[i], 'typename') - call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1)) - elseif has_key(diclist[i], 'typeref') - call extend(res, s:StructMembers(diclist[i]['typeref'], items[1:], 1)) + # Find the variable in the tags file(s) + var diclist: list> = taglist('^' .. items[0] .. '$') + # Remove members, these can't appear without something in front. + ->filter((_, v: dict): bool => + v->has_key('kind') ? v.kind != 'm' : true) + + res = [] + for i: number in len(diclist)->range() + # New ctags has the "typeref" field. Patched version has "typename". + if diclist[i]->has_key('typename') + res = res->extend(diclist[i]['typename']->StructMembers(items[1 :], true)) + elseif diclist[i]->has_key('typeref') + res = res->extend(diclist[i]['typeref']->StructMembers(items[1 :], true)) endif - " For a variable use the command, which must be a search pattern that - " shows the declaration of the variable. + # For a variable use the command, which must be a search pattern that + # shows the declaration of the variable. if diclist[i]['kind'] == 'v' - let line = diclist[i]['cmd'] - if line[0] == '/' && line[1] == '^' - let col = match(line, '\<' . items[0] . '\>') - call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1)) - endif + var line: string = diclist[i]['cmd'] + if line[: 1] == '/^' + var col: number = line->charidx(match(line, '\<' .. items[0] .. '\>')) + res = res->extend(line[2 : col - 1]->Nextitem(items[1 :], 0, true)) + endif endif endfor endif - if len(res) == 0 && searchdecl(items[0], 1) == 0 - " Found, now figure out the type. - " TODO: join previous line if it makes sense - let line = getline('.') - let col = col('.') - let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) + if len(res) == 0 && items[0]->searchdecl(true) == 0 + # Found, now figure out the type. + # TODO: join previous line if it makes sense + var line: string = getline('.') + var col: number = charcol('.') + res = line[: col - 1]->Nextitem(items[1 :], 0, true) endif - " If the last item(s) are [...] they need to be added to the matches. - let last = len(items) - 1 - let brackets = '' + # If the last item(s) are [...] they need to be added to the matches. + var last: number = len(items) - 1 + var brackets: string = '' while last >= 0 if items[last][0] != '[' break endif - let brackets = items[last] . brackets - let last -= 1 + brackets = items[last] .. brackets + --last endwhile - return map(res, 's:Tagline2item(v:val, brackets)') -endfunc + return res->map((_, v: dict): dict => Tagline2item(v, brackets)) +enddef -function! s:GetAddition(line, match, memarg, bracket) - " Guess if the item is an array. - if a:bracket && match(a:line, a:match . '\s*\[') > 0 +def GetAddition( # {{{1 + line: string, + match: string, + memarg: list>, + bracket: bool): string + # Guess if the item is an array. + if bracket && match(line, match .. '\s*\[') > 0 return '[' endif - " Check if the item has members. - if len(s:SearchMembers(a:memarg, [''], 0)) > 0 - " If there is a '*' before the name use "->". - if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0 + # Check if the item has members. + if SearchMembers(memarg, [''], false)->len() > 0 + # If there is a '*' before the name use "->". + if match(line, '\*[ \t(]*' .. match .. '\>') > 0 return '->' else return '.' endif endif return '' -endfunction +enddef -" Turn the tag info "val" into an item for completion. -" "val" is is an item in the list returned by taglist(). -" If it is a variable we may add "." or "->". Don't do it for other types, -" such as a typedef, by not including the info that s:GetAddition() uses. -function! s:Tag2item(val) - let res = {'match': a:val['name']} +def Tag2item(val: dict): dict # {{{1 +# Turn the tag info "val" into an item for completion. +# "val" is is an item in the list returned by taglist(). +# If it is a variable we may add "." or "->". Don't do it for other types, +# such as a typedef, by not including the info that GetAddition() uses. + var res: dict = {match: val['name']} - let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename']) + res['extra'] = Tagcmd2extra(val['cmd'], val['name'], val['filename']) - let s = s:Dict2info(a:val) + var s: string = Dict2info(val) if s != '' - let res['info'] = s + res['info'] = s endif - let res['tagline'] = '' - if has_key(a:val, "kind") - let kind = a:val['kind'] - let res['kind'] = kind + res['tagline'] = '' + if val->has_key('kind') + var kind: string = val['kind'] + res['kind'] = kind if kind == 'v' - let res['tagline'] = "\t" . a:val['cmd'] - let res['dict'] = a:val + res['tagline'] = "\t" .. val['cmd'] + res['dict'] = val elseif kind == 'f' - let res['match'] = a:val['name'] . '(' + res['match'] = val['name'] .. '(' endif endif return res -endfunction +enddef -" Use all the items in dictionary for the "info" entry. -function! s:Dict2info(dict) - let info = '' - for k in sort(keys(a:dict)) - let info .= k . repeat(' ', 10 - len(k)) +def Dict2info(dict: dict): string # {{{1 +# Use all the items in dictionary for the "info" entry. + var info: string = '' + for k: string in dict->keys()->sort() + info ..= k .. repeat(' ', 10 - strlen(k)) if k == 'cmd' - let info .= substitute(matchstr(a:dict['cmd'], '/^\s*\zs.*\ze$/'), '\\\(.\)', '\1', 'g') + info ..= dict['cmd'] + ->matchstr('/^\s*\zs.*\ze$/') + ->substitute('\\\(.\)', '\1', 'g') else - let info .= a:dict[k] + var dictk: any = dict[k] + if typename(dictk) != 'string' + info ..= dictk->string() + else + info ..= dictk + endif endif - let info .= "\n" + info ..= "\n" endfor return info -endfunc +enddef -" Parse a tag line and return a dictionary with items like taglist() -function! s:ParseTagline(line) - let l = split(a:line, "\t") - let d = {} +def ParseTagline(line: string): dict # {{{1 +# Parse a tag line and return a dictionary with items like taglist() + var l: list = split(line, "\t") + var d: dict if len(l) >= 3 - let d['name'] = l[0] - let d['filename'] = l[1] - let d['cmd'] = l[2] - let n = 2 + d['name'] = l[0] + d['filename'] = l[1] + d['cmd'] = l[2] + var n: number = 2 if l[2] =~ '^/' - " Find end of cmd, it may contain Tabs. + # Find end of cmd, it may contain Tabs. while n < len(l) && l[n] !~ '/;"$' - let n += 1 - let d['cmd'] .= " " . l[n] + ++n + d['cmd'] ..= ' ' .. l[n] endwhile endif - for i in range(n + 1, len(l) - 1) + for i: number in range(n + 1, len(l) - 1) if l[i] == 'file:' - let d['static'] = 1 + d['static'] = 1 elseif l[i] !~ ':' - let d['kind'] = l[i] + d['kind'] = l[i] else - let d[matchstr(l[i], '[^:]*')] = matchstr(l[i], ':\zs.*') + d[l[i]->matchstr('[^:]*')] = l[i]->matchstr(':\zs.*') endif endfor endif return d -endfunction - -" Turn a match item "val" into an item for completion. -" "val['match']" is the matching item. -" "val['tagline']" is the tagline in which the last part was found. -function! s:Tagline2item(val, brackets) - let line = a:val['tagline'] - let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '') - let res = {'word': a:val['match'] . a:brackets . add } - - if has_key(a:val, 'info') - " Use info from Tag2item(). - let res['info'] = a:val['info'] +enddef + +def Tagline2item(val: dict, brackets: string): dict # {{{1 +# Turn a match item "val" into an item for completion. +# "val['match']" is the matching item. +# "val['tagline']" is the tagline in which the last part was found. + var line: string = val['tagline'] + var add: string = GetAddition(line, val['match'], [val], brackets == '') + var res: dict = {word: val['match'] .. brackets .. add} + + if val->has_key('info') + # Use info from Tag2item(). + res['info'] = val['info'] else - " Parse the tag line and add each part to the "info" entry. - let s = s:Dict2info(s:ParseTagline(line)) + # Parse the tag line and add each part to the "info" entry. + var s: string = ParseTagline(line)->Dict2info() if s != '' - let res['info'] = s + res['info'] = s endif endif - if has_key(a:val, 'kind') - let res['kind'] = a:val['kind'] + if val->has_key('kind') + res['kind'] = val['kind'] elseif add == '(' - let res['kind'] = 'f' + res['kind'] = 'f' else - let s = matchstr(line, '\t\(kind:\)\=\zs\S\ze\(\t\|$\)') + var s: string = line->matchstr('\t\(kind:\)\=\zs\S\ze\(\t\|$\)') if s != '' - let res['kind'] = s + res['kind'] = s endif endif - if has_key(a:val, 'extra') - let res['menu'] = a:val['extra'] + if val->has_key('extra') + res['menu'] = val['extra'] return res endif - " Isolate the command after the tag and filename. - let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)') + # Isolate the command after the tag and filename. + var s: string = line->matchstr('[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)') if s != '' - let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t')) + res['menu'] = s->Tagcmd2extra(val['match'], line->matchstr('[^\t]*\t\zs[^\t]*\ze\t')) endif return res -endfunction - -" Turn a command from a tag line to something that is useful in the menu -function! s:Tagcmd2extra(cmd, name, fname) - if a:cmd =~ '^/^' - " The command is a search command, useful to see what it is. - let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/') - let x = substitute(x, '\<' . a:name . '\>', '@@', '') - let x = substitute(x, '\\\(.\)', '\1', 'g') - let x = x . ' - ' . a:fname - elseif a:cmd =~ '^\d*$' - " The command is a line number, the file name is more useful. - let x = a:fname . ' - ' . a:cmd +enddef + +def Tagcmd2extra( # {{{1 + cmd: string, + name: string, + fname: string): string +# Turn a command from a tag line to something that is useful in the menu + var x: string + if cmd =~ '^/^' + # The command is a search command, useful to see what it is. + x = cmd + ->matchstr('^/^\s*\zs.*\ze$/') + ->substitute('\<' .. name .. '\>', '@@', '') + ->substitute('\\\(.\)', '\1', 'g') + .. ' - ' .. fname + elseif cmd =~ '^\d*$' + # The command is a line number, the file name is more useful. + x = fname .. ' - ' .. cmd else - " Not recognized, use command and file name. - let x = a:cmd . ' - ' . a:fname + # Not recognized, use command and file name. + x = cmd .. ' - ' .. fname endif return x -endfunction - -" Find composing type in "lead" and match items[0] with it. -" Repeat this recursively for items[1], if it's there. -" When resolving typedefs "depth" is used to avoid infinite recursion. -" Return the list of matches. -function! s:Nextitem(lead, items, depth, all) - - " Use the text up to the variable name and split it in tokens. - let tokens = split(a:lead, '\s\+\|\<') - - " Try to recognize the type of the variable. This is rough guessing... - let res = [] - for tidx in range(len(tokens)) - - " Skip tokens starting with a non-ID character. +enddef + +def Nextitem( # {{{1 + lead: string, + items: list, + depth: number, + all: bool): list> +# Find composing type in "lead" and match items[0] with it. +# Repeat this recursively for items[1], if it's there. +# When resolving typedefs "depth" is used to avoid infinite recursion. +# Return the list of matches. + + # Use the text up to the variable name and split it in tokens. + var tokens: list = split(lead, '\s\+\|\<') + + # Try to recognize the type of the variable. This is rough guessing... + var res: list> + for tidx: number in len(tokens)->range() + + # Skip tokens starting with a non-ID character. if tokens[tidx] !~ '^\h' continue endif - " Recognize "struct foobar" and "union foobar". - " Also do "class foobar" when it's C++ after all (doesn't work very well - " though). - if (tokens[tidx] == 'struct' || tokens[tidx] == 'union' || tokens[tidx] == 'class') && tidx + 1 < len(tokens) - let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all) + # Recognize "struct foobar" and "union foobar". + # Also do "class foobar" when it's C++ after all (doesn't work very well + # though). + if (tokens[tidx] == 'struct' + || tokens[tidx] == 'union' + || tokens[tidx] == 'class') + && tidx + 1 < len(tokens) + res = StructMembers(tokens[tidx] .. ':' .. tokens[tidx + 1], items, all) break endif - " TODO: add more reserved words - if index(['int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0 + # TODO: add more reserved words + if ['int', 'short', 'char', 'float', + 'double', 'static', 'unsigned', 'extern']->index(tokens[tidx]) >= 0 continue endif - " Use the tags file to find out if this is a typedef. - let diclist = taglist('^' . tokens[tidx] . '$') - for tagidx in range(len(diclist)) - let item = diclist[tagidx] + # Use the tags file to find out if this is a typedef. + var diclist: list> = taglist('^' .. tokens[tidx] .. '$') + for tagidx: number in len(diclist)->range() + var item: dict = diclist[tagidx] - " New ctags has the "typeref" field. Patched version has "typename". - if has_key(item, 'typeref') - call extend(res, s:StructMembers(item['typeref'], a:items, a:all)) - continue + # New ctags has the "typeref" field. Patched version has "typename". + if item->has_key('typeref') + res = res->extend(item['typeref']->StructMembers(items, all)) + continue endif - if has_key(item, 'typename') - call extend(res, s:StructMembers(item['typename'], a:items, a:all)) - continue + if item->has_key('typename') + res = res->extend(item['typename']->StructMembers(items, all)) + continue endif - " Only handle typedefs here. + # Only handle typedefs here. if item['kind'] != 't' - continue + continue endif - " Skip matches local to another file. - if has_key(item, 'static') && item['static'] && bufnr('%') != bufnr(item['filename']) - continue + # Skip matches local to another file. + if item->has_key('static') && item['static'] + && bufnr('%') != bufnr(item['filename']) + continue endif - " For old ctags we recognize "typedef struct aaa" and - " "typedef union bbb" in the tags file command. - let cmd = item['cmd'] - let ei = matchend(cmd, 'typedef\s\+') + # For old ctags we recognize "typedef struct aaa" and + # "typedef union bbb" in the tags file command. + var cmd: string = item['cmd'] + var ei: number = cmd->charidx(matchend(cmd, 'typedef\s\+')) if ei > 1 - let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<') - if len(cmdtokens) > 1 - if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union' || cmdtokens[0] == 'class' - let name = '' - " Use the first identifier after the "struct" or "union" - for ti in range(len(cmdtokens) - 1) - if cmdtokens[ti] =~ '^\w' - let name = cmdtokens[ti] - break - endif - endfor - if name != '' - call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all)) - endif - elseif a:depth < 10 - " Could be "typedef other_T some_T". - call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all)) - endif - endif + var cmdtokens: list = cmd[ei :]->split('\s\+\|\<') + if len(cmdtokens) > 1 + if cmdtokens[0] == 'struct' + || cmdtokens[0] == 'union' + || cmdtokens[0] == 'class' + var name: string = '' + # Use the first identifier after the "struct" or "union" + for ti: number in (len(cmdtokens) - 1)->range() + if cmdtokens[ti] =~ '^\w' + name = cmdtokens[ti] + break + endif + endfor + if name != '' + res = res->extend(StructMembers(cmdtokens[0] .. ':' .. name, items, all)) + endif + elseif depth < 10 + # Could be "typedef other_T some_T". + res = res->extend(cmdtokens[0]->Nextitem(items, depth + 1, all)) + endif + endif endif endfor if len(res) > 0 @@ -485,153 +523,171 @@ function! s:Nextitem(lead, items, depth, all) endfor return res -endfunction - - -" Search for members of structure "typename" in tags files. -" Return a list with resulting matches. -" Each match is a dictionary with "match" and "tagline" entries. -" When "all" is non-zero find all, otherwise just return 1 if there is any -" member. -function! s:StructMembers(typename, items, all) - " Todo: What about local structures? - let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) +enddef + +def StructMembers( # {{{1 + atypename: string, + items: list, + all: bool): list> + +# Search for members of structure "typename" in tags files. +# Return a list with resulting matches. +# Each match is a dictionary with "match" and "tagline" entries. +# When "all" is true find all, otherwise just return 1 if there is any member. + + # Todo: What about local structures? + var fnames: string = tagfiles() + ->map((_, v: string) => escape(v, ' \#%')) + ->join() if fnames == '' return [] endif - let typename = a:typename - let qflist = [] - let cached = 0 - if a:all == 0 - let n = '1' " stop at first found match - if has_key(s:grepCache, a:typename) - let qflist = s:grepCache[a:typename] - let cached = 1 + var typename: string = atypename + var qflist: list> + var cached: number = 0 + var n: string + if !all + n = '1' # stop at first found match + if grepCache->has_key(typename) + qflist = grepCache[typename] + cached = 1 endif else - let n = '' + n = '' endif if !cached while 1 - exe 'silent! keepj noautocmd ' . n . 'vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames + execute 'silent! keepjumps noautocmd ' + .. n .. 'vimgrep ' .. '/\t' .. typename .. '\(\t\|$\)/j ' + .. fnames - let qflist = getqflist() - if len(qflist) > 0 || match(typename, "::") < 0 - break + qflist = getqflist() + if len(qflist) > 0 || match(typename, '::') < 0 + break endif - " No match for "struct:context::name", remove "context::" and try again. - let typename = substitute(typename, ':[^:]*::', ':', '') + # No match for "struct:context::name", remove "context::" and try again. + typename = typename->substitute(':[^:]*::', ':', '') endwhile - if a:all == 0 - " Store the result to be able to use it again later. - let s:grepCache[a:typename] = qflist + if !all + # Store the result to be able to use it again later. + grepCache[typename] = qflist endif endif - " Skip over [...] items - let idx = 0 + # Skip over [...] items + var idx: number = 0 + var target: string while 1 - if idx >= len(a:items) - let target = '' " No further items, matching all members + if idx >= len(items) + target = '' # No further items, matching all members break endif - if a:items[idx][0] != '[' - let target = a:items[idx] + if items[idx][0] != '[' + target = items[idx] break endif - let idx += 1 + ++idx endwhile - " Put matching members in matches[]. - let matches = [] - for l in qflist - let memb = matchstr(l['text'], '[^\t]*') - if memb =~ '^' . target - " Skip matches local to another file. - if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*')) - let item = {'match': memb, 'tagline': l['text']} - - " Add the kind of item. - let s = matchstr(l['text'], '\t\(kind:\)\=\zs\S\ze\(\t\|$\)') - if s != '' - let item['kind'] = s - if s == 'f' - let item['match'] = memb . '(' - endif - endif - - call add(matches, item) + # Put matching members in matches[]. + var matches: list> + for l: dict in qflist + var memb: string = l['text']->matchstr('[^\t]*') + if memb =~ '^' .. target + # Skip matches local to another file. + if match(l['text'], "\tfile:") < 0 + || bufnr('%') == l['text']->matchstr('\t\zs[^\t]*')->bufnr() + var item: dict = {match: memb, tagline: l['text']} + + # Add the kind of item. + var s: string = l['text']->matchstr('\t\(kind:\)\=\zs\S\ze\(\t\|$\)') + if s != '' + item['kind'] = s + if s == 'f' + item['match'] = memb .. '(' + endif + endif + + matches->add(item) endif endif endfor if len(matches) > 0 - " Skip over next [...] items - let idx += 1 + # Skip over next [...] items + ++idx while 1 - if idx >= len(a:items) - return matches " No further items, return the result. + if idx >= len(items) + return matches # No further items, return the result. endif - if a:items[idx][0] != '[' - break + if items[idx][0] != '[' + break endif - let idx += 1 + ++idx endwhile - " More items following. For each of the possible members find the - " matching following members. - return s:SearchMembers(matches, a:items[idx :], a:all) + # More items following. For each of the possible members find the + # matching following members. + return SearchMembers(matches, items[idx :], all) endif - " Failed to find anything. + # Failed to find anything. return [] -endfunction - -" For matching members, find matches for following items. -" When "all" is non-zero find all, otherwise just return 1 if there is any -" member. -function! s:SearchMembers(matches, items, all) - let res = [] - for i in range(len(a:matches)) - let typename = '' - if has_key(a:matches[i], 'dict') - if has_key(a:matches[i].dict, 'typename') - let typename = a:matches[i].dict['typename'] - elseif has_key(a:matches[i].dict, 'typeref') - let typename = a:matches[i].dict['typeref'] +enddef + +def SearchMembers( # {{{1 + matches: list>, + items: list, + all: bool): list> + +# For matching members, find matches for following items. +# When "all" is true find all, otherwise just return 1 if there is any member. + var res: list> + for i: number in len(matches)->range() + var typename: string = '' + var line: string + if matches[i]->has_key('dict') + if matches[i]['dict']->has_key('typename') + typename = matches[i]['dict']['typename'] + elseif matches[i]['dict']->has_key('typeref') + typename = matches[i]['dict']['typeref'] endif - let line = "\t" . a:matches[i].dict['cmd'] + line = "\t" .. matches[i]['dict']['cmd'] else - let line = a:matches[i]['tagline'] - let e = matchend(line, '\ttypename:') + line = matches[i]['tagline'] + var eb: number = matchend(line, '\ttypename:') + var e: number = charidx(line, eb) if e < 0 - let e = matchend(line, '\ttyperef:') + eb = matchend(line, '\ttyperef:') + e = charidx(line, eb) endif if e > 0 - " Use typename field - let typename = matchstr(line, '[^\t]*', e) + # Use typename field + typename = line->matchstr('[^\t]*', eb) endif endif if typename != '' - call extend(res, s:StructMembers(typename, a:items, a:all)) + res = res->extend(StructMembers(typename, items, all)) else - " Use the search command (the declaration itself). - let s = match(line, '\t\zs/^') + # Use the search command (the declaration itself). + var sb: number = line->match('\t\zs/^') + var s: number = charidx(line, sb) if s > 0 - let e = match(line, '\<' . a:matches[i]['match'] . '\>', s) - if e > 0 - call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0, a:all)) - endif + var e: number = line + ->charidx(match(line, '\<' .. matches[i]['match'] .. '\>', sb)) + if e > 0 + res = res->extend(line[s : e - 1]->Nextitem(items, 0, all)) + endif endif endif - if a:all == 0 && len(res) > 0 + if !all && len(res) > 0 break endif endfor return res -endfunc +enddef +#}}}1 -let &cpo = s:cpo_save -unlet s:cpo_save +# vim: noet sw=2 sts=2 diff --git a/runtime/autoload/clojurecomplete.vim b/runtime/autoload/clojurecomplete.vim index 030785e9017d8..02262a6f917cc 100644 --- a/runtime/autoload/clojurecomplete.vim +++ b/runtime/autoload/clojurecomplete.vim @@ -1,14 +1,15 @@ " Vim completion script -" Language: Clojure -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 18 July 2016 +" Language: Clojure +" Maintainer: Alex Vear +" Former Maintainers: Sung Pae +" URL: https://github.com/clojure-vim/clojure.vim +" License: Vim (see :h license) +" Last Change: 2022-03-24 " -*- COMPLETION WORDS -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.8.0 -let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn","bound-fn*","bound?","butlast","byte","byte-array","bytes","case","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","use","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.11.0 +let s:words = ["&","*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","NaN?","PrintWriter-on","StackTraceElement->vec","Throwable->map","abs","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","case*","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","deftype*","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","extend","extend-protocol","extend-type","extenders","extends?","false","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn*","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","infinite?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iteration","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let*","letfn","letfn*","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop*","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","new","newline","next","nfirst","nil","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","parse-boolean","parse-double","parse-long","parse-uuid","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","quote","rand","rand-int","rand-nth","random-sample","random-uuid","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","reify*","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq-to-map-for-destructuring","seq?","seqable?","seque","sequence","sequential?","set","set!","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-keys","update-proxy","update-vals","uri?","use","uuid?","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] " Simple word completion for special forms and public vars in clojure.core function! clojurecomplete#Complete(findstart, base) diff --git a/runtime/autoload/csscomplete.vim b/runtime/autoload/csscomplete.vim index f6c5a6c391a38..4b673ac9b83d9 100644 --- a/runtime/autoload/csscomplete.vim +++ b/runtime/autoload/csscomplete.vim @@ -4,7 +4,7 @@ " plus CSS Speech Module " Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com ) " Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2018 Jul 02 +" Last Change: 2021 Sep 21 let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom") @@ -38,12 +38,12 @@ function! csscomplete#CompleteCSS(findstart, base) if exists("b:compl_context") let line = getline('.') let compl_begin = col('.') - 2 - let after = line[compl_begin:] + let b:after = line[compl_begin:] let line = b:compl_context unlet! b:compl_context else let line = a:base - let after = '' + let b:after = '' endif let res = [] @@ -311,7 +311,7 @@ function! csscomplete#CompleteCSS(findstart, base) let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"] elseif prop =~ '^\%(height\|width\)$' let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"] - elseif prop =~ '^\%(left\|rigth\)$' + elseif prop =~ '^\%(left\|right\)$' let values = ["auto"] elseif prop == 'image-rendering' let values = ["auto", "crisp-edges", "pixelated"] diff --git a/runtime/autoload/decada.vim b/runtime/autoload/decada.vim index 7741ff0572845..fda2b76dac333 100644 --- a/runtime/autoload/decada.vim +++ b/runtime/autoload/decada.vim @@ -23,9 +23,9 @@ endif function decada#Unit_Name () dict " {{{1 " Convert filename into acs unit: - " 1: remove the file extenstion. + " 1: remove the file extension. " 2: replace all double '_' or '-' with an dot (which denotes a separate) - " 3: remove a trailing '_' (wich denotes a specification) + " 3: remove a trailing '_' (which denotes a specification) return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '') endfunction decada#Unit_Name " }}}1 diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index e85ffc763b584..01cde4631e291 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,113 +1,146 @@ -" Vim functions for file type detection -" -" Maintainer: Bram Moolenaar -" Last Change: 2019 Mar 08 +vim9script -" These functions are moved here from runtime/filetype.vim to make startup -" faster. +# Vim functions for file type detection +# +# Maintainer: Bram Moolenaar +# Last Change: 2022 Apr 13 -" Line continuation is used here, remove 'C' from 'cpoptions' -let s:cpo_save = &cpo -set cpo&vim +# These functions are moved here from runtime/filetype.vim to make startup +# faster. -func dist#ft#Check_inp() +export def Check_inp() if getline(1) =~ '^\*' setf abaqus else - let n = 1 - if line("$") > 500 - let nmax = 500 - else - let nmax = line("$") - endif + var n = 1 + var nmax = line("$") > 500 ? 500 : line("$") while n <= nmax if getline(n) =~? "^header surface data" setf trasys break endif - let n = n + 1 + n += 1 endwhile endif -endfunc +enddef -" This function checks for the kind of assembly that is wanted by the user, or -" can be detected from the first five lines of the file. -func dist#ft#FTasm() - " make sure b:asmsyntax exists +# This function checks for the kind of assembly that is wanted by the user, or +# can be detected from the first five lines of the file. +export def FTasm() + # make sure b:asmsyntax exists if !exists("b:asmsyntax") - let b:asmsyntax = "" + b:asmsyntax = "" endif if b:asmsyntax == "" - call dist#ft#FTasmsyntax() + FTasmsyntax() endif - " if b:asmsyntax still isn't set, default to asmsyntax or GNU + # if b:asmsyntax still isn't set, default to asmsyntax or GNU if b:asmsyntax == "" if exists("g:asmsyntax") - let b:asmsyntax = g:asmsyntax + b:asmsyntax = g:asmsyntax else - let b:asmsyntax = "asm" + b:asmsyntax = "asm" endif endif - exe "setf " . fnameescape(b:asmsyntax) -endfunc + exe "setf " .. fnameescape(b:asmsyntax) +enddef -func dist#ft#FTasmsyntax() - " see if file contains any asmsyntax=foo overrides. If so, change - " b:asmsyntax appropriately - let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4). - \" ".getline(5)." " - let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') +export def FTasmsyntax() + # see if the file contains any asmsyntax=foo overrides. If so, change + # b:asmsyntax appropriately + var head = " " .. getline(1) .. " " .. getline(2) .. " " + .. getline(3) .. " " .. getline(4) .. " " .. getline(5) .. " " + var match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') if match != '' - let b:asmsyntax = match + b:asmsyntax = match elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) - let b:asmsyntax = "vmasm" + b:asmsyntax = "vmasm" + endif +enddef + +var ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' + +# See FTfrm() for Visual Basic form file detection +export def FTbas() + if exists("g:filetype_bas") + exe "setf " .. g:filetype_bas + return endif -endfunc -" Check if one of the first five lines contains "VB_Name". In that case it is -" probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype. -func dist#ft#FTVB(alt) - if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' + # most frequent FreeBASIC-specific keywords in distro files + var fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!' + var fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)' + var fb_comment = "^\\s*/'" + # OPTION EXPLICIT, without the leading underscore, is common to many dialects + var qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)' + + var lines = getline(1, min([line("$"), 100])) + + if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1 + setf freebasic + elseif match(lines, qb64_preproc) > -1 + setf qb64 + elseif match(lines, ft_visual_basic_content) > -1 setf vb else - exe "setf " . a:alt + setf basic endif -endfunc +enddef -func dist#ft#FTbtm() +export def FTbtm() if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm setf dosbatch else setf btm endif -endfunc +enddef -func dist#ft#BindzoneCheck(default) - if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' +export def BindzoneCheck(default = '') + if getline(1) .. getline(2) .. getline(3) .. getline(4) + =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' setf bindzone - elseif a:default != '' - exe 'setf ' . a:default + elseif default != '' + exe 'setf ' .. default + endif +enddef + +# Returns true if file content looks like RAPID +def IsRapid(sChkExt: string = ""): bool + if sChkExt == "cfg" + return getline(1) =~? '\v^%(EIO|MMC|MOC|PROC|SIO|SYS):CFG' endif -endfunc + # called from FTmod, FTprg or FTsys + return getline(nextnonblank(1)) =~? '\v^\s*%(\%{3}|module\s+\k+\s*%(\(|$))' +enddef -func dist#ft#FTlpc() +export def FTcfg() + if exists("g:filetype_cfg") + exe "setf " .. g:filetype_cfg + elseif IsRapid("cfg") + setf rapid + else + setf cfg + endif +enddef + +export def FTlpc() if exists("g:lpc_syntax_for_c") - let lnum = 1 + var lnum = 1 while lnum <= 12 if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)' setf lpc return endif - let lnum = lnum + 1 + lnum += 1 endwhile endif setf c -endfunc +enddef -func dist#ft#FTheader() +export def FTheader() if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 if exists("g:c_syntax_for_h") setf objc @@ -121,15 +154,15 @@ func dist#ft#FTheader() else setf cpp endif -endfunc +enddef -" This function checks if one of the first ten lines start with a '@'. In -" that case it is probably a change file. -" If the first line starts with # or ! it's probably a ch file. -" If a line has "main", "include", "//" or "/*" it's probably ch. -" Otherwise CHILL is assumed. -func dist#ft#FTchange() - let lnum = 1 +# This function checks if one of the first ten lines start with a '@'. In +# that case it is probably a change file. +# If the first line starts with # or ! it's probably a ch file. +# If a line has "main", "include", "//" or "/*" it's probably ch. +# Otherwise CHILL is assumed. +export def FTchange() + var lnum = 1 while lnum <= 10 if getline(lnum)[0] == '@' setf change @@ -147,70 +180,117 @@ func dist#ft#FTchange() setf ch return endif - let lnum = lnum + 1 + lnum += 1 endwhile setf chill -endfunc +enddef -func dist#ft#FTent() - " This function checks for valid cl syntax in the first five lines. - " Look for either an opening comment, '#', or a block start, '{". - " If not found, assume SGML. - let lnum = 1 +export def FTent() + # This function checks for valid cl syntax in the first five lines. + # Look for either an opening comment, '#', or a block start, '{'. + # If not found, assume SGML. + var lnum = 1 while lnum < 6 - let line = getline(lnum) + var line = getline(lnum) if line =~ '^\s*[#{]' setf cl return elseif line !~ '^\s*$' - " Not a blank line, not a comment, and not a block start, - " so doesn't look like valid cl code. + # Not a blank line, not a comment, and not a block start, + # so doesn't look like valid cl code. break endif - let lnum = lnum + 1 - endw + lnum += 1 + endwhile setf dtd -endfunc +enddef + +export def ExCheck() + var lines = getline(1, min([line("$"), 100])) + if exists('g:filetype_euphoria') + exe 'setf ' .. g:filetype_euphoria + elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1 + setf euphoria3 + else + setf elixir + endif +enddef -func dist#ft#EuphoriaCheck() +export def EuphoriaCheck() if exists('g:filetype_euphoria') - exe 'setf ' . g:filetype_euphoria + exe 'setf ' .. g:filetype_euphoria else setf euphoria3 endif -endfunc +enddef -func dist#ft#DtraceCheck() - let lines = getline(1, min([line("$"), 100])) +export def DtraceCheck() + if did_filetype() + # Filetype was already detected + return + endif + var lines = getline(1, min([line("$"), 100])) if match(lines, '^module\>\|^import\>') > -1 - " D files often start with a module and/or import statement. + # D files often start with a module and/or import statement. setf d elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 setf dtrace else setf d endif -endfunc +enddef -func dist#ft#FTe() +export def FTe() if exists('g:filetype_euphoria') - exe 'setf ' . g:filetype_euphoria + exe 'setf ' .. g:filetype_euphoria else - let n = 1 + var n = 1 while n < 100 && n <= line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" setf specman return endif - let n = n + 1 + n += 1 endwhile setf eiffel endif -endfunc +enddef + +export def FTfrm() + if exists("g:filetype_frm") + exe "setf " .. g:filetype_frm + return + endif + + var lines = getline(1, min([line("$"), 5])) + + if match(lines, ft_visual_basic_content) > -1 + setf vb + else + setf form + endif +enddef -" Distinguish between HTML, XHTML and Django -func dist#ft#FThtml() - let n = 1 +# Distinguish between Forth and F#. +# Provided by Doug Kearns. +export def FTfs() + if exists("g:filetype_fs") + exe "setf " .. g:filetype_fs + else + var line = getline(nextnonblank(1)) + # comments and colon definitions + if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$' + \ || line =~ '^\s*: \S' + setf forth + else + setf fsharp + endif + endif +enddef + +# Distinguish between HTML, XHTML and Django +export def FThtml() + var n = 1 while n < 10 && n <= line("$") if getline(n) =~ '\\|@import\>\|//\)' + if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor setf objc return endif + if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' || + \ line =~ '\%(^\|;\)\s*' .. octave_block_terminators + setf octave + return + endif + # TODO: could be Matlab or Octave if line =~ '^\s*%' setf matlab return @@ -279,27 +375,24 @@ func dist#ft#FTm() setf murphi return endif - let n = n + 1 + n += 1 endwhile if saw_comment - " We didn't see anything definitive, but this looks like either Objective C - " or Murphi based on the comment leader. Assume the former as it is more - " common. + # We didn't see anything definitive, but this looks like either Objective C + # or Murphi based on the comment leader. Assume the former as it is more + # common. setf objc - elseif exists("g:filetype_m") - " Use user specified default filetype for .m - exe "setf " . g:filetype_m else - " Default is matlab + # Default is Matlab setf matlab endif -endfunc +enddef -func dist#ft#FTmms() - let n = 1 - while n < 10 - let line = getline(n) +export def FTmms() + var n = 1 + while n < 20 + var line = getline(n) if line =~ '^\s*\(%\|//\)' || line =~ '^\*' setf mmix return @@ -308,74 +401,108 @@ func dist#ft#FTmms() setf make return endif - let n = n + 1 + n += 1 endwhile setf mmix -endfunc +enddef -" This function checks if one of the first five lines start with a dot. In -" that case it is probably an nroff file: 'filetype' is set and 1 is returned. -func dist#ft#FTnroff() - if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.' +# This function checks if one of the first five lines start with a dot. In +# that case it is probably an nroff file: 'filetype' is set and 1 is returned. +export def FTnroff(): number + if getline(1)[0] .. getline(2)[0] .. getline(3)[0] + .. getline(4)[0] .. getline(5)[0] =~ '\.' setf nroff return 1 endif return 0 -endfunc +enddef -func dist#ft#FTmm() - let n = 1 - while n < 10 - let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' +export def FTmm() + var n = 1 + while n < 20 + if getline(n) =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' setf objcpp return endif - let n = n + 1 + n += 1 endwhile setf nroff -endfunc +enddef + +# Returns true if file content looks like LambdaProlog +def IsLProlog(): bool + # skip apparent comments and blank lines, what looks like + # LambdaProlog comment may be RAPID header + var l: number = nextnonblank(1) + while l > 0 && l < line('$') && getline(l) =~ '^\s*%' # LambdaProlog comment + l = nextnonblank(l + 1) + endwhile + # this pattern must not catch a go.mod file + return getline(l) =~ '\") =~ '\' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-' setf prolog else setf perl endif endif -endfunc +enddef -func dist#ft#FTinc() +export def FTinc() if exists("g:filetype_inc") - exe "setf " . g:filetype_inc + exe "setf " .. g:filetype_inc else - let lines = getline(1).getline(2).getline(3) + var lines = getline(1) .. getline(2) .. getline(3) if lines =~? "perlscript" setf aspperl elseif lines =~ "<%" setf aspvbs elseif lines =~ "' + +export def FTprogress_pascal() if exists("g:filetype_p") - exe "setf " . g:filetype_p + exe "setf " .. g:filetype_p return endif - " This function checks for valid Pascal syntax in the first ten lines. - " Look for either an opening comment or a program start. - " If not found, assume Progress. - let lnum = 1 + # This function checks for valid Pascal syntax in the first ten lines. + # Look for either an opening comment or a program start. + # If not found, assume Progress. + var lnum = 1 while lnum <= 10 && lnum < line('$') - let line = getline(lnum) - if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>' - \ || line =~ '^\s*{' || line =~ '^\s*(\*' + var line = getline(lnum) + if line =~ ft_pascal_comments || line =~? ft_pascal_keywords setf pascal return elseif line !~ '^\s*$' || line =~ '^/\*' - " Not an empty line: Doesn't look like valid Pascal code. - " Or it looks like a Progress /* comment + # Not an empty line: Doesn't look like valid Pascal code. + # Or it looks like a Progress /* comment break endif - let lnum = lnum + 1 - endw + lnum += 1 + endwhile setf progress -endfunc +enddef -func dist#ft#FTr() - let max = line("$") > 50 ? 50 : line("$") +export def FTpp() + if exists("g:filetype_pp") + exe "setf " .. g:filetype_pp + else + var line = getline(nextnonblank(1)) + if line =~ ft_pascal_comments || line =~? ft_pascal_keywords + setf pascal + else + setf puppet + endif + endif +enddef + +# Determine if *.prg is ABB RAPID. Can also be Clipper, FoxPro or eviews +export def FTprg() + if exists("g:filetype_prg") + exe "setf " .. g:filetype_prg + elseif IsRapid() + setf rapid + else + # Nothing recognized, assume Clipper + setf clipper + endif +enddef + +export def FTr() + var max = line("$") > 50 ? 50 : line("$") for n in range(1, max) - " Rebol is easy to recognize, check for that first + # Rebol is easy to recognize, check for that first if getline(n) =~? '\' setf rebol return @@ -445,82 +599,82 @@ func dist#ft#FTr() endfor for n in range(1, max) - " R has # comments + # R has # comments if getline(n) =~ '^\s*#' setf r return endif - " Rexx has /* comments */ + # Rexx has /* comments */ if getline(n) =~ '^\s*/\*' setf rexx return endif endfor - " Nothing recognized, use user default or assume Rexx + # Nothing recognized, use user default or assume Rexx if exists("g:filetype_r") - exe "setf " . g:filetype_r + exe "setf " .. g:filetype_r else - " Rexx used to be the default, but R appears to be much more popular. + # Rexx used to be the default, but R appears to be much more popular. setf r endif -endfunc +enddef -func dist#ft#McSetf() - " Rely on the file to start with a comment. - " MS message text files use ';', Sendmail files use '#' or 'dnl' +export def McSetf() + # Rely on the file to start with a comment. + # MS message text files use ';', Sendmail files use '#' or 'dnl' for lnum in range(1, min([line("$"), 20])) - let line = getline(lnum) + var line = getline(lnum) if line =~ '^\s*\(#\|dnl\)' - setf m4 " Sendmail .mc file + setf m4 # Sendmail .mc file return elseif line =~ '^\s*;' - setf msmessages " MS Message text file + setf msmessages # MS Message text file return endif endfor - setf m4 " Default: Sendmail .mc file -endfunc + setf m4 # Default: Sendmail .mc file +enddef -" Called from filetype.vim and scripts.vim. -func dist#ft#SetFileTypeSH(name) +# Called from filetype.vim and scripts.vim. +export def SetFileTypeSH(name: string) if did_filetype() - " Filetype was already detected + # Filetype was already detected return endif if expand("") =~ g:ft_ignore_pat return endif - if a:name =~ '\' - " Some .sh scripts contain #!/bin/csh. - call dist#ft#SetFileTypeShell("csh") + if name =~ '\' + # Some .sh scripts contain #!/bin/csh. + SetFileTypeShell("csh") return - elseif a:name =~ '\' - " Some .sh scripts contain #!/bin/tcsh. - call dist#ft#SetFileTypeShell("tcsh") + elseif name =~ '\' + # Some .sh scripts contain #!/bin/tcsh. + SetFileTypeShell("tcsh") return - elseif a:name =~ '\' - " Some .sh scripts contain #!/bin/zsh. - call dist#ft#SetFileTypeShell("zsh") + elseif name =~ '\' + # Some .sh scripts contain #!/bin/zsh. + SetFileTypeShell("zsh") return - elseif a:name =~ '\' - let b:is_kornshell = 1 + elseif name =~ '\' + b:is_kornshell = 1 if exists("b:is_bash") unlet b:is_bash endif if exists("b:is_sh") unlet b:is_sh endif - elseif exists("g:bash_is_sh") || a:name =~ '\' || a:name =~ '\' - let b:is_bash = 1 + elseif exists("g:bash_is_sh") || name =~ '\' || name =~ '\' + b:is_bash = 1 if exists("b:is_kornshell") unlet b:is_kornshell endif if exists("b:is_sh") unlet b:is_sh endif - elseif a:name =~ '\' - let b:is_sh = 1 + elseif name =~ '\' + b:is_sh = 1 if exists("b:is_kornshell") unlet b:is_kornshell endif @@ -528,75 +682,76 @@ func dist#ft#SetFileTypeSH(name) unlet b:is_bash endif endif - call dist#ft#SetFileTypeShell("sh") -endfunc + SetFileTypeShell("sh") +enddef -" For shell-like file types, check for an "exec" command hidden in a comment, -" as used for Tcl. -" Also called from scripts.vim, thus can't be local to this script. -func dist#ft#SetFileTypeShell(name) +# For shell-like file types, check for an "exec" command hidden in a comment, +# as used for Tcl. +# Also called from scripts.vim, thus can't be local to this script. +export def SetFileTypeShell(name: string) if did_filetype() - " Filetype was already detected + # Filetype was already detected return endif if expand("") =~ g:ft_ignore_pat return endif - let l = 2 + var l = 2 while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)' - " Skip empty and comment lines. - let l = l + 1 + # Skip empty and comment lines. + l += 1 endwhile if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$' - " Found an "exec" line after a comment with continuation - let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '') + # Found an "exec" line after a comment with continuation + var n = substitute(getline(l), '\s*exec\s\+\([^ ]*/\)\=', '', '') if n =~ '\:p') - if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$' +var ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' +export def FTRules() + var path = expand(':p') + if path =~ '/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|\%(usr/\)\=lib/udev/\%(rules\.d/\)\=.*\.rules\)$' setf udevrules return endif if path =~ '^/etc/ufw/' - setf conf " Better than hog + setf conf # Better than hog return endif if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d' setf javascript return endif + var config_lines: list try - let config_lines = readfile('/etc/udev/udev.conf') + config_lines = readfile('/etc/udev/udev.conf') catch /^Vim\%((\a\+)\)\=:E484/ setf hog return endtry - let dir = expand(':p:h') + var dir = expand(':p:h') for line in config_lines - if line =~ s:ft_rules_udev_rules_pattern - let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") + if line =~ ft_rules_udev_rules_pattern + var udev_rules = substitute(line, ft_rules_udev_rules_pattern, '\1', "") if dir == udev_rules setf udevrules endif @@ -604,24 +759,46 @@ func dist#ft#FTRules() endif endfor setf hog -endfunc +enddef -func dist#ft#SQL() +export def SQL() if exists("g:filetype_sql") - exe "setf " . g:filetype_sql + exe "setf " .. g:filetype_sql else setf sql endif -endfunc +enddef -" If the file has an extension of 't' and is in a directory 't' or 'xt' then -" it is almost certainly a Perl test file. -" If the first line starts with '#' and contains 'perl' it's probably a Perl -" file. -" (Slow test) If a file contains a 'use' statement then it is almost certainly -" a Perl file. -func dist#ft#FTperl() - let dirname = expand("%:p:h:t") +# This function checks the first 25 lines of file extension "sc" to resolve +# detection between scala and SuperCollider +export def FTsc() + for lnum in range(1, min([line("$"), 25])) + if getline(lnum) =~# '[A-Za-z0-9]*\s:\s[A-Za-z0-9]\|var\s<\|classvar\s<\|\^this.*\||\w*|\|+\s\w*\s{\|\*ar\s' + setf supercollider + return + endif + endfor + setf scala +enddef + +# This function checks the first line of file extension "scd" to resolve +# detection between scdoc and SuperCollider +export def FTscd() + if getline(1) =~# '\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$' + setf scdoc + else + setf supercollider + endif +enddef + +# If the file has an extension of 't' and is in a directory 't' or 'xt' then +# it is almost certainly a Perl test file. +# If the first line starts with '#' and contains 'perl' it's probably a Perl +# file. +# (Slow test) If a file contains a 'use' statement then it is almost certainly +# a Perl file. +export def FTperl(): number + var dirname = expand("%:p:h:t") if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt') setf perl return 1 @@ -630,86 +807,98 @@ func dist#ft#FTperl() setf perl return 1 endif - let save_cursor = getpos('.') - call cursor(1,1) - let has_use = search('^use\s\s*\k', 'c', 30) + var save_cursor = getpos('.') + call cursor(1, 1) + var has_use = search('^use\s\s*\k', 'c', 30) > 0 call setpos('.', save_cursor) if has_use setf perl return 1 endif return 0 -endfunc - -" Choose context, plaintex, or tex (LaTeX) based on these rules: -" 1. Check the first line of the file for "%&". -" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. -" 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc. -func dist#ft#FTtex() - let firstline = getline(1) +enddef + +export def FTsys() + if exists("g:filetype_sys") + exe "setf " .. g:filetype_sys + elseif IsRapid() + setf rapid + else + setf bat + endif +enddef + +# Choose context, plaintex, or tex (LaTeX) based on these rules: +# 1. Check the first line of the file for "%&". +# 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. +# 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc. +export def FTtex() + var firstline = getline(1) + var format: string if firstline =~ '^%&\s*\a\+' - let format = tolower(matchstr(firstline, '\a\+')) - let format = substitute(format, 'pdf', '', '') + format = tolower(matchstr(firstline, '\a\+')) + format = substitute(format, 'pdf', '', '') if format == 'tex' - let format = 'latex' + format = 'latex' elseif format == 'plaintex' - let format = 'plain' + format = 'plain' endif elseif expand('%') =~ 'tex/context/.*/.*.tex' - let format = 'context' + format = 'context' else - " Default value, may be changed later: - let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' - " Save position, go to the top of the file, find first non-comment line. - let save_cursor = getpos('.') - call cursor(1,1) - let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) - if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. - let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' - let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' - let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', - \ 'cnp', firstNC + 1000) - if kwline == 1 " lpat matched - let format = 'latex' - elseif kwline == 2 " cpat matched - let format = 'context' - endif " If neither matched, keep default set above. - " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) - " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) - " if cline > 0 - " let format = 'context' - " endif - " if lline > 0 && (cline == 0 || cline > lline) - " let format = 'tex' - " endif - endif " firstNC + # Default value, may be changed later: + format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' + # Save position, go to the top of the file, find first non-comment line. + var save_cursor = getpos('.') + call cursor(1, 1) + var firstNC = search('^\s*[^[:space:]%]', 'c', 1000) + if firstNC > 0 + # Check the next thousand lines for a LaTeX or ConTeXt keyword. + var lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' + var cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' + var kwline = search('^\s*\\\%(' .. lpat .. '\)\|^\s*\\\(' .. cpat .. '\)', + 'cnp', firstNC + 1000) + if kwline == 1 # lpat matched + format = 'latex' + elseif kwline == 2 # cpat matched + format = 'context' + endif # If neither matched, keep default set above. + # let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) + # let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) + # if cline > 0 + # let format = 'context' + # endif + # if lline > 0 && (cline == 0 || cline > lline) + # let format = 'tex' + # endif + endif # firstNC call setpos('.', save_cursor) - endif " firstline =~ '^%&\s*\a\+' + endif # firstline =~ '^%&\s*\a\+' - " Translation from formats to file types. TODO: add AMSTeX, RevTex, others? + # Translation from formats to file types. TODO: add AMSTeX, RevTex, others? if format == 'plain' setf plaintex elseif format == 'context' setf context - else " probably LaTeX + else # probably LaTeX setf tex endif return -endfunc +enddef -func dist#ft#FTxml() - let n = 1 +export def FTxml() + var n = 1 while n < 100 && n <= line("$") - let line = getline(n) - " DocBook 4 or DocBook 5. - let is_docbook4 = line =~ '' + if exists("g:filetype_src") + exe "setf " .. g:filetype_src + elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. ft_krl_header .. '|' .. ft_krl_def_or_deffct .. ')' + setf krl + endif +enddef + +# Determine if a *.dat file is Kuka Robot Language +export def FTdat() + var ft_krl_defdat = 'defdat>' + if exists("g:filetype_dat") + exe "setf " .. g:filetype_dat + elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. ft_krl_header .. '|' .. ft_krl_defdat .. ')' + setf krl + endif +enddef + +# Uncomment this line to check for compilation errors early +# defcompile diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim new file mode 100644 index 0000000000000..cd584aa718553 --- /dev/null +++ b/runtime/autoload/dist/man.vim @@ -0,0 +1,196 @@ +" Vim filetype plugin autoload file +" Language: man +" Maintainer: Jason Franklin +" Maintainer: SungHyun Nam +" Autoload Split: Bram Moolenaar +" Last Change: 2022 Jun 18 + +let s:cpo_save = &cpo +set cpo-=C + +let s:man_tag_depth = 0 + +let s:man_sect_arg = "" +let s:man_find_arg = "-w" +try + if !has("win32") && $OSTYPE !~ 'cygwin\|linux' && system('uname -s') =~ "SunOS" && system('uname -r') =~ "^5" + let s:man_sect_arg = "-s" + let s:man_find_arg = "-l" + endif +catch /E145:/ + " Ignore the error in restricted mode +endtry + +func dist#man#PreGetPage(cnt) + if a:cnt == 0 + let old_isk = &iskeyword + if &ft == 'man' + setl iskeyword+=(,) + endif + let str = expand("") + let &l:iskeyword = old_isk + let page = substitute(str, '(*\(\k\+\).*', '\1', '') + let sect = substitute(str, '\(\k\+\)(\([^()]*\)).*', '\2', '') + if match(sect, '^[0-9 ]\+$') == -1 + let sect = "" + endif + if sect == page + let sect = "" + endif + else + let sect = a:cnt + let page = expand("") + endif + call dist#man#GetPage('', sect, page) +endfunc + +func s:GetCmdArg(sect, page) + + if empty(a:sect) + return shellescape(a:page) + endif + + return s:man_sect_arg . ' ' . shellescape(a:sect) . ' ' . shellescape(a:page) +endfunc + +func s:FindPage(sect, page) + let l:cmd = printf('man %s %s', s:man_find_arg, s:GetCmdArg(a:sect, a:page)) + call system(l:cmd) + + if v:shell_error + return 0 + endif + + return 1 +endfunc + +func dist#man#GetPage(cmdmods, ...) + if a:0 >= 2 + let sect = a:1 + let page = a:2 + elseif a:0 >= 1 + let sect = "" + let page = a:1 + else + return + endif + + " To support: nmap K :Man + if page == '' + let page = expand('') + endif + + if !exists('g:ft_man_no_sect_fallback') || (g:ft_man_no_sect_fallback == 0) + if sect != "" && s:FindPage(sect, page) == 0 + let sect = "" + endif + endif + if s:FindPage(sect, page) == 0 + let msg = 'man.vim: no manual entry for "' . page . '"' + if !empty(sect) + let msg .= ' in section ' . sect + endif + echomsg msg + return + endif + exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%") + exec "let s:man_tag_lin_".s:man_tag_depth." = ".line(".") + exec "let s:man_tag_col_".s:man_tag_depth." = ".col(".") + let s:man_tag_depth = s:man_tag_depth + 1 + + let open_cmd = 'edit' + + " Use an existing "man" window if it exists, otherwise open a new one. + if &filetype != "man" + let thiswin = winnr() + exe "norm! \b" + if winnr() > 1 + exe "norm! " . thiswin . "\w" + while 1 + if &filetype == "man" + break + endif + exe "norm! \w" + if thiswin == winnr() + break + endif + endwhile + endif + if &filetype != "man" + if exists("g:ft_man_open_mode") + if g:ft_man_open_mode == 'vert' + let open_cmd = 'vsplit' + elseif g:ft_man_open_mode == 'tab' + let open_cmd = 'tabedit' + else + let open_cmd = 'split' + endif + else + let open_cmd = a:cmdmods . ' split' + endif + endif + endif + + silent execute open_cmd . " $HOME/" . page . '.' . sect . '~' + + " Avoid warning for editing the dummy file twice + setl buftype=nofile noswapfile + + setl fdc=0 ma nofen nonu nornu + %delete _ + let unsetwidth = 0 + if empty($MANWIDTH) + let $MANWIDTH = winwidth(0) + let unsetwidth = 1 + endif + + " Ensure Vim is not recursively invoked (man-db does this) when doing ctrl-[ + " on a man page reference by unsetting MANPAGER. + " Some versions of env(1) do not support the '-u' option, and in such case + " we set MANPAGER=cat. + if !exists('s:env_has_u') + call system('env -u x true') + let s:env_has_u = (v:shell_error == 0) + endif + let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat' + let env_cmd .= ' GROFF_NO_SGR=1' + let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b' + silent exec "r !" . man_cmd + + if unsetwidth + let $MANWIDTH = '' + endif + " Remove blank lines from top and bottom. + while line('$') > 1 && getline(1) =~ '^\s*$' + 1delete _ + endwhile + while line('$') > 1 && getline('$') =~ '^\s*$' + $delete _ + endwhile + 1 + setl ft=man nomod + setl bufhidden=hide + setl nobuflisted + setl noma +endfunc + +func dist#man#PopPage() + if s:man_tag_depth > 0 + let s:man_tag_depth = s:man_tag_depth - 1 + exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth + exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth + exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth + exec s:man_tag_buf."b" + exec s:man_tag_lin + exec "norm! ".s:man_tag_col."|" + exec "unlet s:man_tag_buf_".s:man_tag_depth + exec "unlet s:man_tag_lin_".s:man_tag_depth + exec "unlet s:man_tag_col_".s:man_tag_depth + unlet s:man_tag_buf s:man_tag_lin s:man_tag_col + endif +endfunc + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: set sw=2 ts=8 noet: diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim new file mode 100644 index 0000000000000..86070a0af9077 --- /dev/null +++ b/runtime/autoload/dist/script.vim @@ -0,0 +1,430 @@ +vim9script + +# Vim function for detecting a filetype from the file contents. +# Invoked from "scripts.vim" in 'runtimepath' +# +# Maintainer: Bram Moolenaar +# Last Change: 2022 Feb 13 + +export def DetectFiletype() + var line1 = getline(1) + if line1[0] == '#' && line1[1] == '!' + # File that starts with "#!". + DetectFromHashBang(line1) + else + # File does not start with "#!". + DetectFromText(line1) + endif +enddef + +# Called for a script that has "#!" in the first line. +def DetectFromHashBang(firstline: string) + var line1 = firstline + + # Check for a line like "#!/usr/bin/env {options} bash". Turn it into + # "#!/usr/bin/bash" to make matching easier. + # Recognize only a few {options} that are commonly used. + if line1 =~ '^#!\s*\S*\' + name = substitute(line1, '^#!.*\\s\+\(\i\+\).*', '\1', '') + elseif line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)' + name = substitute(line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '') + else + name = substitute(line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '') + endif + + # tcl scripts may have #!/bin/sh in the first line and "exec wish" in the + # third line. Suggested by Steven Atkinson. + if getline(3) =~ '^exec wish' + name = 'wish' + endif + + # Bourne-like shell scripts: bash bash2 ksh ksh93 sh + if name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>' + call dist#ft#SetFileTypeSH(line1) + + # csh scripts + elseif name =~ '^csh\>' + if exists("g:filetype_csh") + call dist#ft#SetFileTypeShell(g:filetype_csh) + else + call dist#ft#SetFileTypeShell("csh") + endif + + # tcsh scripts + elseif name =~ '^tcsh\>' + call dist#ft#SetFileTypeShell("tcsh") + + # Z shell scripts + elseif name =~ '^zsh\>' + set ft=zsh + + # TCL scripts + elseif name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>' + set ft=tcl + + # Expect scripts + elseif name =~ '^expect\>' + set ft=expect + + # Gnuplot scripts + elseif name =~ '^gnuplot\>' + set ft=gnuplot + + # Makefiles + elseif name =~ 'make\>' + set ft=make + + # Pike + elseif name =~ '^pike\%(\>\|[0-9]\)' + set ft=pike + + # Lua + elseif name =~ 'lua' + set ft=lua + + # Perl + elseif name =~ 'perl' + set ft=perl + + # PHP + elseif name =~ 'php' + set ft=php + + # Python + elseif name =~ 'python' + set ft=python + + # Groovy + elseif name =~ '^groovy\>' + set ft=groovy + + # Raku + elseif name =~ 'raku' + set ft=raku + + # Ruby + elseif name =~ 'ruby' + set ft=ruby + + # JavaScript + elseif name =~ 'node\(js\)\=\>\|js\>' || name =~ 'rhino\>' + set ft=javascript + + # BC calculator + elseif name =~ '^bc\>' + set ft=bc + + # sed + elseif name =~ 'sed\>' + set ft=sed + + # OCaml-scripts + elseif name =~ 'ocaml' + set ft=ocaml + + # Awk scripts; also finds "gawk" + elseif name =~ 'awk\>' + set ft=awk + + # Website MetaLanguage + elseif name =~ 'wml' + set ft=wml + + # Scheme scripts + elseif name =~ 'scheme' + set ft=scheme + + # CFEngine scripts + elseif name =~ 'cfengine' + set ft=cfengine + + # Erlang scripts + elseif name =~ 'escript' + set ft=erlang + + # Haskell + elseif name =~ 'haskell' + set ft=haskell + + # Scala + elseif name =~ 'scala\>' + set ft=scala + + # Clojure + elseif name =~ 'clojure' + set ft=clojure + + # Free Pascal + elseif name =~ 'instantfpc\>' + set ft=pascal + + # Fennel + elseif name =~ 'fennel\>' + set ft=fennel + + # MikroTik RouterOS script + elseif name =~ 'rsc\>' + set ft=routeros + + # Fish shell + elseif name =~ 'fish\>' + set ft=fish + + # Gforth + elseif name =~ 'gforth\>' + set ft=forth + + # Icon + elseif name =~ 'icon\>' + set ft=icon + + endif +enddef + + +# Called for a script that does not have "#!" in the first line. +def DetectFromText(line1: string) + var line2 = getline(2) + var line3 = getline(3) + var line4 = getline(4) + var line5 = getline(5) + + # Bourne-like shell scripts: sh ksh bash bash2 + if line1 =~ '^:$' + call dist#ft#SetFileTypeSH(line1) + + # Z shell scripts + elseif line1 =~ '^#compdef\>' + || line1 =~ '^#autoload\>' + || "\n" .. line1 .. "\n" .. line2 .. "\n" .. line3 .. + "\n" .. line4 .. "\n" .. line5 + =~ '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>' + set ft=zsh + + # ELM Mail files + elseif line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$' + set ft=mail + + # Mason + elseif line1 =~ '^<[%&].*>' + set ft=mason + + # Vim scripts (must have '" vim' as the first line to trigger this) + elseif line1 =~ '^" *[vV]im$' + set ft=vim + + # libcxx and libstdc++ standard library headers like "iostream" do not have + # an extension, recognize the Emacs file mode. + elseif line1 =~? '-\*-.*C++.*-\*-' + set ft=cpp + + # MOO + elseif line1 =~ '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$' + set ft=moo + + # Diff file: + # - "diff" in first line (context diff) + # - "Only in " in first line + # - "--- " in first line and "+++ " in second line (unified diff). + # - "*** " in first line and "--- " in second line (context diff). + # - "# It was generated by makepatch " in the second line (makepatch diff). + # - "Index: " in the first line (CVS file) + # - "=== ", line of "=", "---", "+++ " (SVK diff) + # - "=== ", "--- ", "+++ " (bzr diff, common case) + # - "=== (removed|added|renamed|modified)" (bzr diff, alternative) + # - "# HG changeset patch" in first line (Mercurial export format) + elseif line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)' + || (line1 =~ '^--- ' && line2 =~ '^+++ ') + || (line1 =~ '^\* looking for ' && line2 =~ '^\* comparing to ') + || (line1 =~ '^\*\*\* ' && line2 =~ '^--- ') + || (line1 =~ '^=== ' && ((line2 =~ '^=\{66\}' && line3 =~ '^--- ' && line4 =~ '^+++') || (line2 =~ '^--- ' && line3 =~ '^+++ '))) + || (line1 =~ '^=== \(removed\|added\|renamed\|modified\)') + set ft=diff + + # PostScript Files (must have %!PS as the first line, like a2ps output) + elseif line1 =~ '^%![ \t]*PS' + set ft=postscr + + # M4 scripts: Guess there is a line that starts with "dnl". + elseif line1 =~ '^\s*dnl\>' + || line2 =~ '^\s*dnl\>' + || line3 =~ '^\s*dnl\>' + || line4 =~ '^\s*dnl\>' + || line5 =~ '^\s*dnl\>' + set ft=m4 + + # AmigaDos scripts + elseif $TERM == "amiga" && (line1 =~ "^;" || line1 =~? '^\.bra') + set ft=amiga + + # SiCAD scripts (must have procn or procd as the first line to trigger this) + elseif line1 =~? '^ *proc[nd] *$' + set ft=sicad + + # Purify log files start with "**** Purify" + elseif line1 =~ '^\*\*\*\* Purify' + set ft=purifylog + + # XML + elseif line1 =~ '' + set ft=xml + + # XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN") + elseif line1 =~ '\' + set ft=html + + # PDF + elseif line1 =~ '^%PDF-' + set ft=pdf + + # XXD output + elseif line1 =~ '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} ' + set ft=xxd + + # RCS/CVS log output + elseif line1 =~ '^RCS file:' || line2 =~ '^RCS file:' + set ft=rcslog + + # CVS commit + elseif line2 =~ '^CVS:' || getline("$") =~ '^CVS: ' + set ft=cvs + + # Prescribe + elseif line1 =~ '^!R!' + set ft=prescribe + + # Send-pr + elseif line1 =~ '^SEND-PR:' + set ft=sendpr + + # SNNS files + elseif line1 =~ '^SNNS network definition file' + set ft=snnsnet + elseif line1 =~ '^SNNS pattern definition file' + set ft=snnspat + elseif line1 =~ '^SNNS result file' + set ft=snnsres + + # Virata + elseif line1 =~ '^%.\{-}[Vv]irata' + || line2 =~ '^%.\{-}[Vv]irata' + || line3 =~ '^%.\{-}[Vv]irata' + || line4 =~ '^%.\{-}[Vv]irata' + || line5 =~ '^%.\{-}[Vv]irata' + set ft=virata + + # Strace + elseif line1 =~ '[0-9:.]* *execve(' || line1 =~ '^__libc_start_main' + set ft=strace + + # VSE JCL + elseif line1 =~ '^\* $$ JOB\>' || line1 =~ '^// *JOB\>' + set ft=vsejcl + + # TAK and SINDA + elseif line4 =~ 'K & K Associates' || line2 =~ 'TAK 2000' + set ft=takout + elseif line3 =~ 'S Y S T E M S I M P R O V E D ' + set ft=sindaout + elseif getline(6) =~ 'Run Date: ' + set ft=takcmp + elseif getline(9) =~ 'Node File 1' + set ft=sindacmp + + # DNS zone files + elseif line1 .. line2 .. line3 .. line4 =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' + set ft=bindzone + + # BAAN + elseif line1 =~ '|\*\{1,80}' && line2 =~ 'VRC ' + || line2 =~ '|\*\{1,80}' && line3 =~ 'VRC ' + set ft=baan + + # Valgrind + elseif line1 =~ '^==\d\+== valgrind' || line3 =~ '^==\d\+== Using valgrind' + set ft=valgrind + + # Go docs + elseif line1 =~ '^PACKAGE DOCUMENTATION$' + set ft=godoc + + # Renderman Interface Bytestream + elseif line1 =~ '^##RenderMan' + set ft=rib + + # Scheme scripts + elseif line1 =~ 'exec\s\+\S*scheme' || line2 =~ 'exec\s\+\S*scheme' + set ft=scheme + + # Git output + elseif line1 =~ '^\(commit\|tree\|object\) \x\{40,\}\>\|^tag \S\+$' + set ft=git + + # Gprof (gnu profiler) + elseif line1 == 'Flat profile:' + && line2 == '' + && line3 =~ '^Each sample counts as .* seconds.$' + set ft=gprof + + # Erlang terms + # (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes) + elseif line1 =~? '-\*-.*erlang.*-\*-' + set ft=erlang + + # YAML + elseif line1 =~ '^%YAML' + set ft=yaml + + # MikroTik RouterOS script + elseif line1 =~ '^#.*by RouterOS.*$' + set ft=routeros + + # Sed scripts + # #ncomment is allowed but most likely a false positive so require a space + # before any trailing comment text + elseif line1 =~ '^#n\%($\|\s\)' + set ft=sed + + else + var lnum = 1 + while getline(lnum) =~ "^? " && lnum < line("$") + lnum += 1 + endwhile + if getline(lnum) =~ '^Index:\s\+\f\+$' + # CVS diff + set ft=diff + + # locale input files: Formal Definitions of Cultural Conventions + # filename must be like en_US, fr_FR@euro or en_US.UTF-8 + elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_' + lnum = 1 + while lnum < 100 && lnum < line("$") + if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$' + setf fdcc + break + endif + lnum += 1 + endwhile + endif + endif +enddef diff --git a/runtime/autoload/freebasic.vim b/runtime/autoload/freebasic.vim new file mode 100644 index 0000000000000..428cf1382b93c --- /dev/null +++ b/runtime/autoload/freebasic.vim @@ -0,0 +1,41 @@ +" Vim filetype plugin file +" Language: FreeBASIC +" Maintainer: Doug Kearns +" Last Change: 2021 Mar 16 + +" Dialects can be one of fb, qb, fblite, or deprecated +" Precedence is forcelang > #lang > lang +function! freebasic#GetDialect() abort + if exists("g:freebasic_forcelang") + return g:freebasic_forcelang + endif + + if exists("g:freebasic_lang") + let dialect = g:freebasic_lang + else + let dialect = "fb" + endif + + " override with #lang directive or metacommand + + let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'" + let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"' + + let save_cursor = getcurpos() + call cursor(1, 1) + let lnum = search(pat, 'n', '', '', skip) + call setpos('.', save_cursor) + + if lnum + let word = matchlist(getline(lnum), pat)[1] + if word =~? '\%(fb\|deprecated\|fblite\|qb\)' + let dialect = word + else + echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum) + endif + endif + + return dialect +endfunction + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index 01583136d4db9..1c9e1747587c4 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -22,7 +22,7 @@ if &cp endif if v:version < 702 echohl WarningMsg - echo "***warning*** this version of getscript needs vim 7.2" + echo "***warning*** this version of GetLatestVimScripts needs vim 7.2" echohl Normal finish endif @@ -130,7 +130,7 @@ fun! getscript#GetLatestVimScripts() " insure that wget is executable if executable(g:GetLatestVimScripts_wget) != 1 echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system" -" call Dret("GetLatestVimScripts : wget not executable/availble") +" call Dret("GetLatestVimScripts : wget not executable/available") return endif @@ -348,7 +348,7 @@ fun! s:GetOneScript(...) set t_ti= t_te= nors " put current line on top-of-screen and interpret it into - " a script identifer : used to obtain webpage + " a script identifier : used to obtain webpage " source identifier : used to identify current version " and an associated comment: used to report on what's being considered if a:0 >= 3 diff --git a/runtime/autoload/haskellcomplete.vim b/runtime/autoload/haskellcomplete.vim index 48fbac7f9f0f4..759ff8741a1b1 100644 --- a/runtime/autoload/haskellcomplete.vim +++ b/runtime/autoload/haskellcomplete.vim @@ -54,7 +54,7 @@ function! haskellcomplete#Complete(findstart, base) if b:completingLangExtension if a:base ==? "" - " Return all posible Lang extensions + " Return all possible Lang extensions return s:langExtensions else let l:matches = [] @@ -70,7 +70,7 @@ function! haskellcomplete#Complete(findstart, base) elseif b:completingOptionsGHC if a:base ==? "" - " Return all posible GHC options + " Return all possible GHC options return s:optionsGHC else let l:matches = [] @@ -86,7 +86,7 @@ function! haskellcomplete#Complete(findstart, base) elseif b:completingModule if a:base ==? "" - " Return all posible modules + " Return all possible modules return s:commonModules else let l:matches = [] diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim index 6b9d49a46988e..267889d97fe39 100644 --- a/runtime/autoload/htmlcomplete.vim +++ b/runtime/autoload/htmlcomplete.vim @@ -486,7 +486,7 @@ function! htmlcomplete#CompleteTags(findstart, base) endif endif " Value of attribute completion {{{ - " If attr contains =\s*[\"'] we catched value of attribute + " If attr contains =\s*[\"'] we match value of attribute if attr =~ "=\s*[\"']" || attr =~ "=\s*$" " Let do attribute specific completion let attrname = matchstr(attr, '.*\ze\s*=') diff --git a/runtime/autoload/javascriptcomplete.vim b/runtime/autoload/javascriptcomplete.vim index 14bc3d7ce397a..29b6b16254fa3 100644 --- a/runtime/autoload/javascriptcomplete.vim +++ b/runtime/autoload/javascriptcomplete.vim @@ -1,7 +1,9 @@ " Vim completion script " Language: Java Script -" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2017 Mar 04 +" Maintainer: Jay Sitter (jay@jaysitter.com) +" URL: https://github.com/jsit/javascriptcomplete.vim/ +" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) +" Last Change: 2020 Jul 30 function! javascriptcomplete#CompleteJS(findstart, base) if a:findstart @@ -154,12 +156,30 @@ function! javascriptcomplete#CompleteJS(findstart, base) \ 'text', 'vLink'] let bodys = bodyprop " Document - document. - let docuprop = ['anchors', 'applets', 'childNodes', 'embeds', 'forms', 'images', 'links', 'stylesheets', - \ 'body', 'cookie', 'documentElement', 'domain', 'lastModified', 'referrer', 'title', 'URL'] - let documeth = ['close', 'createAttribute', 'createElement', 'createTextNode', 'focus', 'getElementById', - \ 'getElementsByName', 'getElementsByTagName', 'open', 'write', 'writeln', - \ 'onClick', 'onDblClick', 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp', - \ 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onResize'] + let docuprop = ['anchors', 'body', 'characterSet', 'doctype', + \ 'documentElement', 'documentURI', 'embeds', 'fonts', 'forms', + \ 'head', 'hidden', 'images', 'implementation', 'lastStyleSheetSet', + \ 'links', 'plugins', 'preferredStyleSheetSet', 'scripts', + \ 'scrollingElement', 'selectedStyleSheetSet', 'styleSheetSets', + \ 'timeline', 'visibilityState', 'cookie', 'defaultView', + \ 'designMode', 'dir', 'domain', 'lastModified', 'location', + \ 'readyState', 'referrer', 'title', 'URL', 'activeElement', + \ 'fullscreenElement', 'styleSheets'] + let documeth = ['adoptNode', 'close', 'createAttribute', + \ 'createAttributeNS', 'createCDATASection', 'createComment', + \ 'createDocumentFragment', 'createElement', 'createElementNS', + \ 'createEvent', 'createExpression', 'createNSResolver', + \ 'createNodeIterator', 'createProcessingInstruction', 'createRange', + \ 'createTextNode', 'createTouchList', 'createTreeWalker', + \ 'enableStyleSheetsForSet', 'evaluate', 'focus', 'getElementById', + \ 'getElementById', 'getElementsByClassName', 'getElementsByName', + \ 'getElementsByTagName', 'getElementsByTagNameNS', + \ 'hasStorageAccess', 'importNode', 'onClick', 'onDblClick', + \ 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onMouseDown', + \ 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', + \ 'onResize', 'open', 'querySelector', 'querySelectorAll', + \ 'requestStorageAccess', 'write', 'writeln'] + call map(documeth, 'v:val."("') let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild', \ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', @@ -368,9 +388,11 @@ function! javascriptcomplete#CompleteJS(findstart, base) let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild', \ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue', \ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName'] - let xdomelemmeth = ['appendChild', 'cloneNode', 'getAttribute', 'getAttributeNode', - \ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', 'normalize', - \ 'removeAttribute', 'removeAttributeNode', 'removeChild', 'replaceChild', + let xdomelemmeth = ['appendChild', 'addEventListener', 'cloneNode', + \ 'dispatchEvent', 'getAttribute', 'getAttributeNode', + \ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', + \ 'normalize', 'removeAttribute', 'removeAttributeNode', + \ 'removeChild', 'removeEventListener', 'replaceChild', \ 'setAttribute', 'setAttributeNode'] call map(xdomelemmeth, 'v:val."("') let xdomelems = xdomelemprop + xdomelemmeth diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 130163ae1eaa2..fb8ad952cf522 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,8 +1,8 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Jul 16, 2019 -" Version: 165 -" Maintainer: Charles E Campbell +" Date: Aug 16, 2021 +" Version: 171 +" Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, @@ -13,6 +13,10 @@ " expressed or implied. By using this plugin, you agree that " in no event will the copyright holder be liable for any damages " resulting from the use of this software. +" +" Note: the code here was started in 1999 under a much earlier version of vim. The directory browsing +" code was written using vim v6, which did not have Lists (Lists were first offered with vim-v7). +" "redraw!|call DechoSep()|call inputsave()|call input("Press to continue")|call inputrestore() " " But be doers of the Word, and not only hearers, deluding your own selves {{{1 @@ -39,7 +43,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v165" +let g:loaded_netrw = "v171" if !exists("s:NOTE") let s:NOTE = 0 let s:WARNING = 1 @@ -64,7 +68,7 @@ setl cpo&vim " Usage: netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,"some message",error-number) " netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,["message1","message2",...],error-number) " (this function can optionally take a list of messages) -" Mar 21, 2017 : max errnum currently is 105 +" Dec 2, 2019 : max errnum currently is 106 fun! netrw#ErrorMsg(level,msg,errnum) " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) @@ -82,7 +86,16 @@ fun! netrw#ErrorMsg(level,msg,errnum) endif " call Decho("level=".level,'~'.expand("")) - if g:netrw_use_errorwindow + if g:netrw_use_errorwindow == 2 && (v:version > 802 || (v:version == 802 && has("patch486"))) + " use popup window + if type(a:msg) == 3 + let msg = [level]+a:msg + else + let msg= level.a:msg + endif + let s:popuperr_id = popup_atcursor(msg,{}) + let s:popuperr_text= "" + elseif g:netrw_use_errorwindow " (default) netrw creates a one-line window to show error/warning " messages (reliably displayed) @@ -199,7 +212,11 @@ let g:netrw_localrmdiropt = "" " --------------------------------------------------------------------- " Default values for netrw's global protocol variables {{{2 -call s:NetrwInit("g:netrw_use_errorwindow",1) +if (v:version > 802 || (v:version == 802 && has("patch486"))) && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") && has("mouse") + call s:NetrwInit("g:netrw_use_errorwindow",2) +else + call s:NetrwInit("g:netrw_use_errorwindow",1) +endif if !exists("g:netrw_dav_cmd") if executable("cadaver") @@ -232,12 +249,12 @@ if !exists("g:netrw_ftp_options") let g:netrw_ftp_options= "-i -n" endif if !exists("g:netrw_http_cmd") - if executable("curl") - let g:netrw_http_cmd = "curl" - call s:NetrwInit("g:netrw_http_xcmd","-L -o") - elseif executable("wget") + if executable("wget") let g:netrw_http_cmd = "wget" call s:NetrwInit("g:netrw_http_xcmd","-q -O") + elseif executable("curl") + let g:netrw_http_cmd = "curl" + call s:NetrwInit("g:netrw_http_xcmd","-L -o") elseif executable("elinks") let g:netrw_http_cmd = "elinks" call s:NetrwInit("g:netrw_http_xcmd","-source >") @@ -305,6 +322,7 @@ call s:NetrwInit("g:netrw_banner" , 1) call s:NetrwInit("g:netrw_browse_split", 0) call s:NetrwInit("g:netrw_bufsettings" , "noma nomod nonu nobl nowrap ro nornu") call s:NetrwInit("g:netrw_chgwin" , -1) +call s:NetrwInit("g:netrw_clipboard" , 1) call s:NetrwInit("g:netrw_compress" , "gzip") call s:NetrwInit("g:netrw_ctags" , "ctags") if exists("g:netrw_cursorline") && !exists("g:netrw_cursor") @@ -314,6 +332,7 @@ endif call s:NetrwInit("g:netrw_cursor" , 2) let s:netrw_usercul = &cursorline let s:netrw_usercuc = &cursorcolumn +"call Decho("(netrw) COMBAK: cuc=".&l:cuc." cul=".&l:cul." initialization of s:netrw_cu[cl]") call s:NetrwInit("g:netrw_cygdrive","/cygdrive") " Default values - d-g ---------- {{{3 call s:NetrwInit("s:didstarstar",0) @@ -443,23 +462,9 @@ if !exists("g:netrw_localmovecmd") let g:netrw_localmovecmd= "" endif endif -if v:version < 704 || (v:version == 704 && !has("patch1107")) - " 1109 provides for delete(tmpdir,"d") which is what will be used - if exists("g:netrw_local_rmdir") - let g:netrw_localrmdir= g:netrw_local_rmdir - call netrw#ErrorMsg(s:NOTE,"g:netrw_local_rmdir is deprecated in favor of g:netrw_localrmdir",86) - endif - if has("win32") || has("win95") || has("win64") || has("win16") - if g:netrw_cygwin - call s:NetrwInit("g:netrw_localrmdir","rmdir") - else - let g:netrw_localrmdir = expand("$COMSPEC") - let g:netrw_localrmdiropt= " /c rmdir" - endif - else - call s:NetrwInit("g:netrw_localrmdir","rmdir") - endif -endif +" following serves as an example for how to insert a version&patch specific test +"if v:version < 704 || (v:version == 704 && !has("patch1107")) +"endif call s:NetrwInit("g:netrw_liststyle" , s:THINLIST) " sanity checks if g:netrw_liststyle < 0 || g:netrw_liststyle >= s:MAXLIST @@ -569,6 +574,7 @@ call s:NetrwInit("s:netrw_posn",'{}') if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") " call Decho("installed beval events",'~'.expand("")) let &l:bexpr = "netrw#BalloonHelp()" +" call Decho("&l:bexpr<".&l:bexpr."> buf#".bufnr()) au FileType netrw setl beval au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif au VimEnter * let s:initbeval= &beval @@ -601,7 +607,18 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_ if &ft != "netrw" return "" endif - if !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval) + if exists("s:popuperr_id") && popup_getpos(s:popuperr_id) != {} + " popup error window is still showing + " s:pouperr_id and s:popuperr_text are set up in netrw#ErrorMsg() + if exists("s:popuperr_text") && s:popuperr_text != "" && v:beval_text != s:popuperr_text + " text under mouse hasn't changed; only close window when it changes + call popup_close(s:popuperr_id) + unlet s:popuperr_text + else + let s:popuperr_text= v:beval_text + endif + let mesg= "" + elseif !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval) let mesg= "" elseif v:beval_text == "Netrw" || v:beval_text == "Directory" || v:beval_text == "Listing" let mesg = "i: thin-long-wide-tree gh: quick hide/unhide of dot-files qf: quick file info %:open new file" @@ -688,7 +705,8 @@ fun! netrw#Explore(indx,dosplit,style,...) endif " save registers - if has("clipboard") + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) save @* and @+",'~'.expand("")) sil! let keepregstar = @* sil! let keepregplus = @+ endif @@ -915,9 +933,10 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("")) if !exists("w:netrw_explore_list") " sanity check NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or improperly; see help for netrw-starstar",40) - if has("clipboard") - sil! let @* = keepregstar - sil! let @+ = keepregplus + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash " call Dret("netrw#Explore") @@ -940,9 +959,10 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("")) if !exists("w:netrw_explore_list") " sanity check NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or improperly; see help for netrw-starstar",41) - if has("clipboard") - sil! let @* = keepregstar - sil! let @+ = keepregplus + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash " call Dret("netrw#Explore") @@ -995,9 +1015,10 @@ fun! netrw#Explore(indx,dosplit,style,...) catch /^Vim\%((\a\+)\)\=:E480/ keepalt call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45) if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif - if has("clipboard") - sil! let @* = keepregstar - sil! let @+ = keepregplus + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash " call Dret("netrw#Explore : no files matched pattern") @@ -1031,9 +1052,10 @@ fun! netrw#Explore(indx,dosplit,style,...) if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/') keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no files matched",42) - if has("clipboard") - sil! let @* = keepregstar - sil! let @+ = keepregplus + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash " call Dret("netrw#Explore : no files matched") @@ -1079,9 +1101,10 @@ fun! netrw#Explore(indx,dosplit,style,...) if !exists("g:netrw_quiet") keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44) endif - if has("clipboard") - sil! let @* = keepregstar - sil! let @+ = keepregplus + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash " call Dret("netrw#Explore : missing +path_extra") @@ -1152,9 +1175,10 @@ fun! netrw#Explore(indx,dosplit,style,...) " there's no danger of a late FocusGained event on initialization. " Consequently, set s:netrw_events to 2. let s:netrw_events= 2 - if has("clipboard") - sil! let @* = keepregstar - sil! let @+ = keepregplus + if has("clipboard") && g:netrw_clipboard +" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash " call Dret("netrw#Explore : @/<".@/.">") @@ -1250,6 +1274,10 @@ fun! netrw#Lexplore(count,rightside,...) setlocal winfixwidth let g:netrw_altv = keep_altv let t:netrw_lexbufnr = bufnr("%") + " done to prevent build-up of hidden buffers due to quitting and re-invocation of :Lexplore. + " Since the intended use of :Lexplore is to have an always-present explorer window, the extra + " effort to mis-use :Lex is warranted. + set bh=wipe " call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr) " call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a")) if exists("t:netrw_lexposn") @@ -1528,7 +1556,8 @@ fun! netrw#Obtain(islocal,fname,...) " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password - NetrwKeepj norm! 1Gdd + " Note: using "_dd to delete to the black hole register; avoids messing up @@ + NetrwKeepj norm! 1G"_dd call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options) " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" @@ -1614,7 +1643,8 @@ endfun fun! s:NetrwOptionsSave(vt) " call Dfunc("s:NetrwOptionsSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")." mod=".&mod." ma=".&ma) " call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist"),'~'.expand("")) -" 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("")) +" 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." hid=".&hid,'~'.expand("")) +" call Decho("(s:NetrwOptionsSave) lines=".&lines) if !exists("{a:vt}netrw_optionsave") let {a:vt}netrw_optionsave= 1 @@ -1640,17 +1670,21 @@ fun! s:NetrwOptionsSave(vt) let {a:vt}netrw_cinokeep = &l:cino let {a:vt}netrw_comkeep = &l:com let {a:vt}netrw_cpokeep = &l:cpo + let {a:vt}netrw_cuckeep = &l:cuc + let {a:vt}netrw_culkeep = &l:cul +" call Decho("(s:NetrwOptionsSave) COMBAK: cuc=".&l:cuc." cul=".&l:cul) let {a:vt}netrw_diffkeep = &l:diff let {a:vt}netrw_fenkeep = &l:fen -" call Decho("saving current settings: got here#1",'~'.expand("")) if !exists("g:netrw_ffkeep") || g:netrw_ffkeep let {a:vt}netrw_ffkeep = &l:ff endif let {a:vt}netrw_fokeep = &l:fo " formatoptions let {a:vt}netrw_gdkeep = &l:gd " gdefault + let {a:vt}netrw_gokeep = &l:go " guioptions let {a:vt}netrw_hidkeep = &l:hidden let {a:vt}netrw_imkeep = &l:im let {a:vt}netrw_iskkeep = &l:isk + let {a:vt}netrw_lines = &lines let {a:vt}netrw_lskeep = &l:ls let {a:vt}netrw_makeep = &l:ma let {a:vt}netrw_magickeep = &l:magic @@ -1661,7 +1695,6 @@ fun! s:NetrwOptionsSave(vt) let {a:vt}netrw_rokeep = &l:ro let {a:vt}netrw_selkeep = &l:sel let {a:vt}netrw_spellkeep = &l:spell -" call Decho("saving current settings: got here#2",'~'.expand("")) if !g:netrw_use_noswf let {a:vt}netrw_swfkeep = &l:swf endif @@ -1675,13 +1708,15 @@ fun! s:NetrwOptionsSave(vt) " call Decho("saving a few selected netrw-related variables",'~'.expand("")) if g:netrw_keepdir let {a:vt}netrw_dirkeep = getcwd() +" call Decho("saving to ".a:vt."netrw_dirkeep<".{a:vt}netrw_dirkeep.">",'~'.expand("")) endif - if has("clipboard") + if has("clipboard") && g:netrw_clipboard sil! let {a:vt}netrw_starkeep = @* sil! let {a:vt}netrw_pluskeep = @+ endif sil! let {a:vt}netrw_slashkeep= @/ +" call Decho("(s:NetrwOptionsSave) lines=".&lines) " 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("")) " call Dret("s:NetrwOptionsSave : tab#".tabpagenr()." win#".winnr()) endfun @@ -1706,12 +1741,18 @@ fun! s:NetrwOptionsSafe(islocal) endif call s:NetrwSetSafeSetting("&l:ci",0) call s:NetrwSetSafeSetting("&l:cin",0) - call s:NetrwSetSafeSetting("&l:bh","hide") + if g:netrw_fastbrowse > a:islocal + call s:NetrwSetSafeSetting("&l:bh","hide") + else + call s:NetrwSetSafeSetting("&l:bh","delete") + endif call s:NetrwSetSafeSetting("&l:cino","") call s:NetrwSetSafeSetting("&l:com","") if &cpo =~ 'a' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'a','','g')) | endif if &cpo =~ 'A' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'A','','g')) | endif setl fo=nroql2 + " call s:NetrwSetSafeSetting("&go","begmr") + if &go =~ '\ca' | call s:NetrwSetSafeSetting("&go",substitute(&go,'\ca','','g')) | endif call s:NetrwSetSafeSetting("&l:hid",0) call s:NetrwSetSafeSetting("&l:im",0) setl isk+=@ isk+=* isk+=/ @@ -1725,7 +1766,10 @@ fun! s:NetrwOptionsSafe(islocal) call s:NetrwSetSafeSetting("&l:tw",0) call s:NetrwSetSafeSetting("&l:wig","") setl cedit& - call s:NetrwCursor() + + " set up cuc and cul based on g:netrw_cursor and listing style + " COMBAK -- cuc cul related + call s:NetrwCursor(0) " allow the user to override safe options " call Decho("ft<".&ft."> ei=".&ei,'~'.expand("")) @@ -1743,10 +1787,14 @@ endfun " s:NetrwOptionsRestore: restore options (based on prior s:NetrwOptionsSave) {{{2 fun! s:NetrwOptionsRestore(vt) " call Dfunc("s:NetrwOptionsRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$")) +" call Decho("(s:NetrwOptionsRestore) lines=".&lines) " 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("")) if !exists("{a:vt}netrw_optionsave") -" 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("")) -" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) +" call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("")) +" 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("")) +" call Decho("..ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) " call Dret("s:NetrwOptionsRestore : ".a:vt."netrw_optionsave doesn't exist") return endif @@ -1763,41 +1811,53 @@ fun! s:NetrwOptionsRestore(vt) endif endif endif +" call Decho("(s:NetrwOptionsRestore) #1 lines=".&lines) call s:NetrwRestoreSetting(a:vt."netrw_aikeep","&l:ai") call s:NetrwRestoreSetting(a:vt."netrw_awkeep","&l:aw") call s:NetrwRestoreSetting(a:vt."netrw_blkeep","&l:bl") call s:NetrwRestoreSetting(a:vt."netrw_btkeep","&l:bt") call s:NetrwRestoreSetting(a:vt."netrw_bombkeep","&l:bomb") +" call Decho("(s:NetrwOptionsRestore) #2 lines=".&lines) call s:NetrwRestoreSetting(a:vt."netrw_cedit","&cedit") call s:NetrwRestoreSetting(a:vt."netrw_cikeep","&l:ci") call s:NetrwRestoreSetting(a:vt."netrw_cinkeep","&l:cin") call s:NetrwRestoreSetting(a:vt."netrw_cinokeep","&l:cino") call s:NetrwRestoreSetting(a:vt."netrw_comkeep","&l:com") +" call Decho("(s:NetrwOptionsRestore) #3 lines=".&lines) call s:NetrwRestoreSetting(a:vt."netrw_cpokeep","&l:cpo") call s:NetrwRestoreSetting(a:vt."netrw_diffkeep","&l:diff") call s:NetrwRestoreSetting(a:vt."netrw_fenkeep","&l:fen") if exists("g:netrw_ffkeep") && g:netrw_ffkeep call s:NetrwRestoreSetting(a:vt."netrw_ffkeep")","&l:ff") endif - call s:NetrwRestoreSetting(a:vt."netrw_fokeep","&l:fo") - call s:NetrwRestoreSetting(a:vt."netrw_gdkeep","&l:gd") - call s:NetrwRestoreSetting(a:vt."netrw_hidkeep","&l:hidden") - call s:NetrwRestoreSetting(a:vt."netrw_imkeep","&l:im") - call s:NetrwRestoreSetting(a:vt."netrw_iskkeep","&l:isk") - call s:NetrwRestoreSetting(a:vt."netrw_lskeep","&l:ls") - call s:NetrwRestoreSetting(a:vt."netrw_makeep","&l:ma") +" call Decho("(s:NetrwOptionsRestore) #4 lines=".&lines) + call s:NetrwRestoreSetting(a:vt."netrw_fokeep" ,"&l:fo") + call s:NetrwRestoreSetting(a:vt."netrw_gdkeep" ,"&l:gd") + call s:NetrwRestoreSetting(a:vt."netrw_gokeep" ,"&l:go") + call s:NetrwRestoreSetting(a:vt."netrw_hidkeep" ,"&l:hidden") +" call Decho("(s:NetrwOptionsRestore) #5 lines=".&lines) + call s:NetrwRestoreSetting(a:vt."netrw_imkeep" ,"&l:im") + call s:NetrwRestoreSetting(a:vt."netrw_iskkeep" ,"&l:isk") +" call Decho("(s:NetrwOptionsRestore) #6 lines=".&lines) + call s:NetrwRestoreSetting(a:vt."netrw_lines" ,"&lines") +" call Decho("(s:NetrwOptionsRestore) #7 lines=".&lines) + call s:NetrwRestoreSetting(a:vt."netrw_lskeep" ,"&l:ls") + call s:NetrwRestoreSetting(a:vt."netrw_makeep" ,"&l:ma") call s:NetrwRestoreSetting(a:vt."netrw_magickeep","&l:magic") - call s:NetrwRestoreSetting(a:vt."netrw_modkeep","&l:mod") - call s:NetrwRestoreSetting(a:vt."netrw_nukeep","&l:nu") - call s:NetrwRestoreSetting(a:vt."netrw_rnukeep","&l:rnu") - call s:NetrwRestoreSetting(a:vt."netrw_repkeep","&l:report") - call s:NetrwRestoreSetting(a:vt."netrw_rokeep","&l:ro") - call s:NetrwRestoreSetting(a:vt."netrw_selkeep","&l:sel") + call s:NetrwRestoreSetting(a:vt."netrw_modkeep" ,"&l:mod") + call s:NetrwRestoreSetting(a:vt."netrw_nukeep" ,"&l:nu") +" call Decho("(s:NetrwOptionsRestore) #8 lines=".&lines) + call s:NetrwRestoreSetting(a:vt."netrw_rnukeep" ,"&l:rnu") + call s:NetrwRestoreSetting(a:vt."netrw_repkeep" ,"&l:report") + call s:NetrwRestoreSetting(a:vt."netrw_rokeep" ,"&l:ro") + call s:NetrwRestoreSetting(a:vt."netrw_selkeep" ,"&l:sel") +" call Decho("(s:NetrwOptionsRestore) #9 lines=".&lines) call s:NetrwRestoreSetting(a:vt."netrw_spellkeep","&l:spell") - call s:NetrwRestoreSetting(a:vt."netrw_twkeep","&l:tw") - call s:NetrwRestoreSetting(a:vt."netrw_wigkeep","&l:wig") - call s:NetrwRestoreSetting(a:vt."netrw_wrapkeep","&l:wrap") + call s:NetrwRestoreSetting(a:vt."netrw_twkeep" ,"&l:tw") + call s:NetrwRestoreSetting(a:vt."netrw_wigkeep" ,"&l:wig") + call s:NetrwRestoreSetting(a:vt."netrw_wrapkeep" ,"&l:wrap") call s:NetrwRestoreSetting(a:vt."netrw_writekeep","&l:write") +" call Decho("(s:NetrwOptionsRestore) #10 lines=".&lines) call s:NetrwRestoreSetting("s:yykeep","@@") " former problem: start with liststyle=0; press : result, following line resets l:ts. " Fixed; in s:PerformListing, when w:netrw_liststyle is s:LONGLIST, will use a printf to pad filename with spaces @@ -1828,7 +1888,8 @@ fun! s:NetrwOptionsRestore(vt) unlet {a:vt}netrw_dirkeep endif endif - if has("clipboard") + if has("clipboard") && g:netrw_clipboard +" call Decho("has clipboard",'~'.expand("")) call s:NetrwRestoreSetting(a:vt."netrw_starkeep","@*") call s:NetrwRestoreSetting(a:vt."netrw_pluskeep","@+") endif @@ -1843,9 +1904,11 @@ fun! s:NetrwOptionsRestore(vt) " were having their filetype detect-generated settings overwritten by " NetrwOptionRestore. if &ft != "netrw" -" call Decho("filetype detect (ft=".&ft.")",'~'.expand("")) +" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("")) filetype detect +" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("")) endif +" call Decho("(s:NetrwOptionsRestore) lines=".&lines) " 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("")) " call Dret("s:NetrwOptionsRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) endfun @@ -1890,12 +1953,12 @@ endfun " Used by s:NetrwOptionsRestore() to restore each netrw-senstive setting " keepvars are set up by s:NetrwOptionsSave fun! s:NetrwRestoreSetting(keepvar,setting) -"" call Dfunc("s:NetrwRestoreSetting(a:keepvar<".a:keepvar."> a:setting<".a:setting.">)") +""" call Dfunc("s:NetrwRestoreSetting(a:keepvar<".a:keepvar."> a:setting<".a:setting.">)") " typically called from s:NetrwOptionsRestore " call s:NetrwRestoreSettings(keep-option-variable-name,'associated-option') " ex. call s:NetrwRestoreSetting(a:vt."netrw_selkeep","&l:sel") - " Restores option (if different) from a keepvar + " Restores option (but only if different) from a:keepvar if exists(a:keepvar) exe "let keepvarval= ".a:keepvar exe "let setting= ".a:setting @@ -1905,11 +1968,11 @@ fun! s:NetrwRestoreSetting(keepvar,setting) "" call Decho("fyi: a:setting<".a:setting."> setting<".setting.">") if setting != keepvarval -"" call Decho("restore setting<".a:setting."=".setting."> to keepvarval<".keepvarval.">") +"" call Decho("restore setting<".a:setting."> (currently=".setting.") to keepvarval<".keepvarval.">") if type(a:setting) == 0 exe "let ".a:setting."= ".keepvarval elseif type(a:setting) == 1 - exe "let ".a:setting."= '".keepvarval."'" + exe "let ".a:setting."= '".substitute(keepvarval,"'","''","g")."'" else call netrw#ErrorMsg(s:ERROR,"(s:NetrwRestoreSetting) doesn't know how to restore ".a:keepvar." with a setting of type#".type(a:setting),105) endif @@ -2195,7 +2258,7 @@ fun! netrw#NetRead(mode,...) " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password - NetrwKeepj norm! 1Gdd + NetrwKeepj norm! 1G"_dd call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options) " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" @@ -2295,7 +2358,7 @@ fun! netrw#NetRead(mode,...) NetrwKeepj put ='quit' " perform cadaver operation: - NetrwKeepj norm! 1Gdd + NetrwKeepj norm! 1G"_dd call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd) keepj bd! endif @@ -2611,7 +2674,7 @@ fun! netrw#NetWrite(...) range " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password - NetrwKeepj norm! 1Gdd + NetrwKeepj norm! 1G"_dd call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options) " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" @@ -2677,7 +2740,7 @@ fun! netrw#NetWrite(...) range NetrwKeepj put ='put '.tmpfile.' '.netrw_fname " perform cadaver operation: - NetrwKeepj norm! 1Gdd + NetrwKeepj norm! 1G"_dd call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd) " remove enew buffer (quietly) @@ -2817,14 +2880,16 @@ fun! netrw#SetTreetop(iscmd,...) " call Decho("inittreetop<".(exists("inittreetop")? inittreetop : "n/a").">") if (a:iscmd == 0 || a:1 == "") && exists("inittreetop") - let treedir= s:NetrwTreePath(inittreetop) + let treedir = s:NetrwTreePath(inittreetop) " call Decho("treedir<".treedir.">",'~'.expand("")) else if isdirectory(s:NetrwFile(a:1)) " call Decho("a:1<".a:1."> is a directory",'~'.expand("")) - let treedir= a:1 + let treedir = a:1 + let s:netrw_treetop = treedir elseif exists("b:netrw_curdir") && (isdirectory(s:NetrwFile(b:netrw_curdir."/".a:1)) || a:1 =~ '^\a\{3,}://') - let treedir= b:netrw_curdir."/".a:1 + let treedir = b:netrw_curdir."/".a:1 + let s:netrw_treetop = treedir " call Decho("a:1<".a:1."> is NOT a directory, using treedir<".treedir.">",'~'.expand("")) else " normally the cursor is left in the message window. @@ -2832,7 +2897,8 @@ fun! netrw#SetTreetop(iscmd,...) let netrwbuf= bufnr("%") call netrw#ErrorMsg(s:ERROR,"sorry, ".a:1." doesn't seem to be a directory!",95) exe bufwinnr(netrwbuf)."wincmd w" - let treedir= "." + let treedir = "." + let s:netrw_treetop = getcwd() endif endif " call Decho("treedir<".treedir.">",'~'.expand("")) @@ -2863,7 +2929,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " readcmd=='t': simply do nothing if a:readcmd == 't' " call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Dret("NetrwGetFile : skip read of <".a:tfile.">") +" call Dret("NetrwGetFile : skip read of tfile<".a:tfile.">") return endif @@ -3643,6 +3709,8 @@ fun! s:NetrwBookHistSave() let savefile= s:NetrwHome()."/.netrwhist" " call Decho("savefile<".savefile.">",'~'.expand("")) 1split + + " setting up a new buffer which will become .netrwhist call s:NetrwEnew() " call Decho("case g:netrw_use_noswf=".g:netrw_use_noswf.(exists("+acd")? " +acd" : " -acd"),'~'.expand("")) if g:netrw_use_noswf @@ -4087,6 +4155,7 @@ fun! s:NetrwFileInfo(islocal,fname) elseif g:netrw_sizestyle =~# 'h' let lsopt= "-lsadh --si" endif +" call Decho("(s:NetrwFileInfo) lsopt<".lsopt.">") if (has("unix") || has("macunix")) && executable("/bin/ls") if getline(".") == "../" @@ -4148,9 +4217,10 @@ endfun " s:NetrwGetBuffer: [get a new|find an old netrw] buffer for a netrw listing {{{2 " returns 0=cleared buffer " 1=re-used buffer (buffer not cleared) +" Nov 09, 2020: tst952 shows that when user does :set hidden that NetrwGetBuffer will come up with a [No Name] buffer (hid fix) fun! s:NetrwGetBuffer(islocal,dirname) " call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle) -" 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,'~'.expand("")) +" 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." hid=".&hid,'~'.expand("")) " call Decho("netrwbuf dictionary=".(exists("s:netrwbuf")? string(s:netrwbuf) : 'n/a'),'~'.expand("")) " call Dredir("ls!","s:NetrwGetBuffer") let dirname= a:dirname @@ -4200,17 +4270,26 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif " call Decho(" bufnum#".bufnum,'~'.expand("")) - " highjack the current buffer if - " it has the desired name - " it is empty -" call Decho("deciding if I can highjack the current buffer#".bufnr("%"),'~'.expand("")) -" call Decho("..dirname<".dirname.">",'~'.expand("")) -" call Decho("..bufname<".bufname("%").">",'~'.expand("")) -" call Decho("..getline($)<".getline("$").">",'~'.expand("")) - if dirname == bufname("%") && line("$") == 1 && getline("%") == "" + " hijack the current buffer + " IF the buffer already has the desired name + " AND it is empty + let curbuf = bufname("%") + if curbuf == '.' + let curbuf = getcwd() + endif +" call Dredir("ls!","NetrwGetFile (renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">)") +" call Decho("deciding if netrw may hijack the current buffer#".bufnr("%")."<".curbuf.">",'~'.expand("")) +" call Decho("..dirname<".dirname."> IF dirname == bufname",'~'.expand("")) +" call Decho("..curbuf<".curbuf.">",'~'.expand("")) +" call Decho("..line($)=".line("$")." AND this is 1",'~'.expand("")) +" call Decho("..getline(%)<".getline("%")."> AND this line is empty",'~'.expand("")) + if dirname == curbuf && line("$") == 1 && getline("%") == "" " call Dret("s:NetrwGetBuffer 0 : highjacking buffer#".bufnr("%")) return 0 + else " DEBUG +" call Decho("..did NOT hijack buffer",'~'.expand("")) endif + " Aug 14, 2021: was thinking about looking for a [No Name] buffer here and using it, but that might cause problems " get enew buffer and name it -or- re-use buffer {{{3 if bufnum < 0 " get enew buffer and name it @@ -4361,7 +4440,7 @@ fun! s:NetrwGetWord() let curline= getline('.') if curline =~# '"\s*Sorted by\s' - NetrwKeepj norm! s + NetrwKeepj norm! "_s let s:netrw_skipbrowse= 1 echo 'Pressing "s" also works' @@ -4535,7 +4614,7 @@ fun! s:NetrwListStyle(islocal) " refresh the listing " call Decho("refresh the listing",'~'.expand("")) NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) - NetrwKeepj call s:NetrwCursor() + NetrwKeepj call s:NetrwCursor(0) " repoint t:netrw_lexbufnr if appropriate if exists("repointlexbufnr") @@ -4725,7 +4804,7 @@ endfun " "new directory name" is actually a file, " NetrwBrowseChgDir() edits the file. fun! s:NetrwBrowseChgDir(islocal,newdir,...) -" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") +" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." win#".winnr()." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") " call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) let ykeep= @@ @@ -4741,7 +4820,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif " call Decho("b:netrw_curdir<".b:netrw_curdir.">") - " NetrwBrowseChgDir: save options and initialize {{{3 + " NetrwBrowseChgDir; save options and initialize {{{3 " call Decho("saving options",'~'.expand("")) call s:SavePosn(s:netrw_posn) NetrwKeepj call s:NetrwOptionsSave("s:") @@ -4754,13 +4833,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let newdir = a:newdir let dolockout = 0 let dorestore = 1 +" call Decho("win#".winnr(),'~'.expand("")) " call Decho("dirname<".dirname.">",'~'.expand("")) " call Decho("newdir<".newdir.">",'~'.expand("")) " ignore s when done in the banner " call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("")) if g:netrw_banner -" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("")) +" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("")) if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt if getline(".") =~# 'Quick Help' " call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) @@ -4797,7 +4877,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " ------------------------------ " NetrwBrowseChgDir: edit a file {{{3 " ------------------------------ -" call Decho('(s:NetrwBrowseChgDir) edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("")) +" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("")) " save position for benefit of Rexplore let s:rexposn_{bufnr("%")}= winsaveview() @@ -4808,6 +4888,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)' " call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">",'~'.expand("")) " call Decho("edit-a-file: newdir<".newdir.">",'~'.expand("")) +" let newdir = s:NetrwTreePath(s:netrw_treetop) +" call Decho("edit-a-file: COMBAK why doesn't this recognize file1's directory???") let dirname= s:NetrwTreeDir(a:islocal) "COMBAK : not working for a symlink -- but what about a regular file? a directory? " call Decho("COMBAK : not working for a symlink -- but what about a regular file? a directory?") @@ -4832,7 +4914,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) NetrwKeepj call s:NetrwOptionsRestore("s:") let curdir= b:netrw_curdir if !exists("s:didsplit") -" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("")) +" " call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr()." g:netrw_chgwin=".g:netrw_chgwin",'~'.expand("")) if type(g:netrw_browse_split) == 3 " open file in server " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr] @@ -4840,22 +4922,27 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) call s:NetrwServerEdit(a:islocal,dirname) " call Dret("s:NetrwBrowseChgDir") return + elseif g:netrw_browse_split == 1 " horizontally splitting the window first " call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("")) - keepalt new + let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize + exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s" if !&ea keepalt wincmd _ endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 2 " vertically splitting the window first " call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("")) - keepalt rightb vert new + let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize + exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s" if !&ea keepalt wincmd | endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 3 " open file in new tab " call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("")) @@ -4864,6 +4951,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let b:netrw_curdir= getcwd() endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 4 " act like "P" (ie. open previous window) " call Decho("edit-a-file: use previous window for edit",'~'.expand("")) @@ -4873,13 +4961,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) return endif call s:SetRexDir(a:islocal,curdir) + else " handling a file, didn't split, so remove menu " call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("")) call s:NetrwMenu(0) " optional change to window if g:netrw_chgwin >= 1 -" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("")) +" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("")) if winnr("$")+1 == g:netrw_chgwin " if g:netrw_chgwin is set to one more than the last window, then " vertically split the last window to make that window available. @@ -4892,22 +4981,30 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif call s:SetRexDir(a:islocal,curdir) endif + endif " the point where netrw actually edits the (local) file " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will " no keepalt to support :e # to return to a directory listing + if !&mod + " if e the new file would fail due to &mod, then don't change any of the flags + let dolockout= 1 + endif if a:islocal " call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("")) " some like c-^ to return to the last edited file " others like c-^ to return to the netrw buffer + " Apr 30, 2020: used to have e! here. That can cause loss of a modified file, + " so emit error E37 instead. if exists("g:netrw_altfile") && g:netrw_altfile - exe "NetrwKeepj keepalt e! ".fnameescape(dirname) + exe "NetrwKeepj keepalt e ".fnameescape(dirname) else - exe "NetrwKeepj e! ".fnameescape(dirname) + exe "NetrwKeepj e ".fnameescape(dirname) endif " call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("")) - call s:NetrwCursor() + " COMBAK -- cuc cul related + call s:NetrwCursor(1) if &hidden || &bufhidden == "hide" " file came from vim's hidden storage. Don't "restore" options with it. let dorestore= 0 @@ -4915,7 +5012,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) else " call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("")) endif - let dolockout= 1 " handle g:Netrw_funcref -- call external-to-netrw functions " This code will handle g:Netrw_funcref as an individual function reference @@ -4929,8 +5025,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) elseif type(g:Netrw_funcref) == 3 " call Decho("edit-a-file: handling a list of g:Netrw_funcrefs",'~'.expand("")) for Fncref in g:Netrw_funcref - if type(FncRef) == 2 - NetrwKeepj call FncRef() + if type(Fncref) == 2 + NetrwKeepj call Fncref() endif endfor endif @@ -5196,16 +5292,36 @@ fun! s:NetrwBrowseUpDir(islocal) endfun " --------------------------------------------------------------------- -" netrw#BrowseX: (implements "x") executes a special "viewer" script or program for the {{{2 +" netrw#BrowseX: (implements "x" and "gx") executes a special "viewer" script or program for the {{{2 " given filename; typically this means given their extension. " 0=local, 1=remote fun! netrw#BrowseX(fname,remote) -" call Dfunc("netrw#BrowseX(fname<".a:fname."> remote=".a:remote.")") - - " if its really just a local directory, then do a "gf" instead - if (a:remote == 0 && isdirectory(a:fname)) || (a:remote == 1 && a:fname =~ '/$' && a:fname !~ '^https\=:') + let use_ctrlo= 1 +" call Dfunc("netrw#BrowseX(fname<".a:fname."> remote=".a:remote.") implements x and gx maps") + + if a:remote == 0 && isdirectory(a:fname) + " if its really just a local directory, then do a "gf" instead +" call Decho("remote≡0 and a:fname<".a:fname."> ".(isdirectory(a:fname)? "is a directory" : "is not a directory"),'~'.expand("")) +" call Decho("..appears to be a local directory; using e ".a:fname." instead",'~'.expand("")) + exe "e ".a:fname +" call Dret("netrw#BrowseX") + return + elseif a:remote == 1 && a:fname !~ '^https\=:' && a:fname =~ '/$' + " remote directory, not a webpage access, looks like an attempt to do a directory listing +" call Decho("remote≡1 and a:fname<".a:fname.">",'~'.expand("")) +" call Decho("..and fname ".((a:fname =~ '^https\=:')? 'matches' : 'does not match').'^https\=:','~'.expand("")) +" call Decho("..and fname ".((a:fname =~ '/$')? 'matches' : 'does not match').' /$','~'.expand("")) +" call Decho("..appears to be a remote directory listing request; using gf instead",'~'.expand("")) norm! gf -" call Dret("(netrw#BrowseX) did gf instead") +" call Dret("netrw#BrowseX") + return + endif +" call Decho("not a local file nor a webpage request",'~'.expand("")) + + if exists("g:netrw_browsex_viewer") && exists("g:netrw_browsex_support_remote") && !g:netrw_browsex_support_remote + let remote = a:remote + else + let remote = 0 endif let ykeep = @@ @@ -5252,9 +5368,9 @@ fun! netrw#BrowseX(fname,remote) endif " call Decho("exten<".exten.">",'~'.expand("")) - if a:remote == 1 + if remote == 1 " create a local copy -" call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">",'~'.expand("")) +" call Decho("remote: remote=".remote.": create a local copy of <".a:fname.">",'~'.expand("")) setl bh=delete call netrw#NetRead(3,a:fname) " attempt to rename tempfile @@ -5276,7 +5392,7 @@ fun! netrw#BrowseX(fname,remote) let fname= s:netrw_tmpfile endif else -" call Decho("local: a:remote=".a:remote.": handling local copy of <".a:fname.">",'~'.expand("")) +" call Decho("local: remote=".remote.": handling local copy of <".a:fname.">",'~'.expand("")) let fname= a:fname " special ~ handler for local if fname =~ '^\~' && expand("$HOME") != "" @@ -5304,10 +5420,9 @@ fun! netrw#BrowseX(fname,remote) endif " call Decho("set up redirection: redir{".redir."} srr{".&srr."}",'~'.expand("")) - " extract any viewing options. Assumes that they're set apart by quotes. -" call Decho("extract any viewing options",'~'.expand("")) + " extract any viewing options. Assumes that they're set apart by spaces. if exists("g:netrw_browsex_viewer") -" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) +" call Decho("extract any viewing options from g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) if g:netrw_browsex_viewer =~ '\s' let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','') let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." " @@ -5330,16 +5445,16 @@ fun! netrw#BrowseX(fname,remote) " execute the file handler " call Decho("execute the file handler (if any)",'~'.expand("")) if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-' -" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) +" call Decho("(netrw#BrowseX) g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) let ret= netrwFileHandlers#Invoke(exten,fname) elseif exists("g:netrw_browsex_viewer") && executable(viewer) -" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) +" call Decho("(netrw#BrowseX) g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) call s:NetrwExe("sil !".viewer." ".viewopt.s:ShellEscape(fname,1).redir) let ret= v:shell_error elseif has("win32") || has("win64") -" call Decho("win".(has("win32")? "32" : "64")",'~'.expand("")) +" call Decho("(netrw#BrowseX) win".(has("win32")? "32" : "64"),'~'.expand("")) if executable("start") call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(fname,1)) elseif executable("rundll32") @@ -5347,56 +5462,68 @@ fun! netrw#BrowseX(fname,remote) else call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74) endif - " call inputsave()|call input("Press to continue")|call inputrestore() let ret= v:shell_error elseif has("win32unix") let winfname= 'c:\cygwin'.substitute(fname,'/','\\','g') -" call Decho("cygwin: winfname<".s:ShellEscape(winfname,1).">",'~'.expand("")) +" call Decho("(netrw#BrowseX) cygwin: winfname<".s:ShellEscape(winfname,1).">",'~'.expand("")) if executable("start") +" call Decho("(netrw#BrowseX) win32unix+start",'~'.expand("")) call s:NetrwExe('sil !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(winfname,1)) elseif executable("rundll32") +" call Decho("(netrw#BrowseX) win32unix+rundll32",'~'.expand("")) call s:NetrwExe('sil !rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(winfname,1)) elseif executable("cygstart") +" call Decho("(netrw#BrowseX) win32unix+cygstart",'~'.expand("")) call s:NetrwExe('sil !cygstart '.s:ShellEscape(fname,1)) else call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74) endif - " call inputsave()|call input("Press to continue")|call inputrestore() + let ret= v:shell_error + + elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril") +" call Decho("(netrw#BrowseX) unix and atril",'~'.expand("")) + if a:fname =~ '^https\=://' + " atril does not appear to understand how to handle html -- so use gvim to edit the document + let use_ctrlo= 0 +" call Decho("fname<".fname.">") +" call Decho("a:fname<".a:fname.">") + call s:NetrwExe("sil! !gvim ".fname.' -c "keepj keepalt file '.fnameescape(a:fname).'"') + + else + call s:NetrwExe("sil !atril ".s:ShellEscape(fname,1).redir) + endif let ret= v:shell_error elseif has("unix") && executable("kfmclient") && s:CheckIfKde() -" call Decho("unix and kfmclient",'~'.expand("")) +" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("")) call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir) let ret= v:shell_error elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid") -" call Decho("unix, exo-open, xdg-open",'~'.expand("")) - call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir) - let ret= v:shell_error - - elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril") -" call Decho("unix and atril",'~'.expand("")) - call s:NetrwExe("sil !atril ".s:ShellEscape(fname,1).redir) +" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("")) + call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&') let ret= v:shell_error elseif has("unix") && executable("xdg-open") -" call Decho("unix and xdg-open",'~'.expand("")) - call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir) +" call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("")) + call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&') let ret= v:shell_error elseif has("macunix") && executable("open") -" call Decho("macunix and open",'~'.expand("")) +" call Decho("(netrw#BrowseX) macunix and open",'~'.expand("")) call s:NetrwExe("sil !open ".s:ShellEscape(fname,1)." ".redir) let ret= v:shell_error else " netrwFileHandlers#Invoke() always returns 0 +" call Decho("(netrw#BrowseX) use netrwFileHandlers",'~'.expand("")) let ret= netrwFileHandlers#Invoke(exten,fname) endif " if unsuccessful, attempt netrwFileHandlers#Invoke() if ret +" call Decho("(netrw#BrowseX) ret=".ret," indicates unsuccessful thus far",'~'.expand("")) let ret= netrwFileHandlers#Invoke(exten,fname) endif @@ -5408,18 +5535,19 @@ fun! netrw#BrowseX(fname,remote) " return to prior buffer (directory listing) " Feb 12, 2008: had to de-activiate removal of " temporary file because it wasn't getting seen. -" if a:remote == 1 && fname != a:fname +" if remote == 1 && fname != a:fname "" call Decho("deleting temporary file<".fname.">",'~'.expand("")) " call s:NetrwDelete(fname) " endif - if a:remote == 1 + if remote == 1 setl bh=delete bt=nofile if g:netrw_use_noswf setl noswf endif - exe "sil! NetrwKeepj norm! \" -" redraw! + if use_ctrlo + exe "sil! NetrwKeepj norm! \" + endif endif " call Decho("restoring posn to screenposn<".string(screenposn).">",'~'.expand("")) call winrestview(screenposn) @@ -5448,11 +5576,11 @@ endfun " netrw#BrowseXVis: used by gx in visual mode to select a file for browsing {{{2 fun! netrw#BrowseXVis() " call Dfunc("netrw#BrowseXVis()") - let atkeep = @@ - norm! gvy -" call Decho("@@<".@@.">",'~'.expand("")) - call netrw#BrowseX(@@,netrw#CheckIfRemote(@@)) - let @@ = atkeep + let akeep = @a + norm! gv"ay + let gxfile= @a + let @a = akeep + call netrw#BrowseX(gxfile,netrw#CheckIfRemote(gxfile)) " call Dret("netrw#BrowseXVis") endfun @@ -5471,7 +5599,7 @@ fun! s:NetrwBufRename(newname) let b:junk= 1 " call Decho("rename buffer: sil! keepj keepalt file ".fnameescape(a:newname),'~'.expand("")) exe 'sil! keepj keepalt file '.fnameescape(a:newname) -" call Dredir("ls!","s:NetrwBufRename (before bwipe)") +" call Dredir("ls!","s:NetrwBufRename (before bwipe)~".expand("")) let oldbufnr= bufnr(oldbufname) " call Decho("oldbufname<".oldbufname."> oldbufnr#".oldbufnr,'~'.expand("")) " call Decho("bufnr(%)=".bufnr("%"),'~'.expand("")) @@ -5480,6 +5608,9 @@ fun! s:NetrwBufRename(newname) exe "bwipe! ".oldbufnr " else " Decho " call Decho("did *not* bwipe buf#".oldbufnr,'~'.expand("")) +" call Decho("..reason: if oldbufname<".oldbufname."> is empty",'~'.expand(""))" +" call Decho("..reason: if oldbufnr#".oldbufnr." is -1",'~'.expand(""))" +" call Decho("..reason: if oldbufnr#".oldbufnr." != bufnr(%)#".bufnr("%"),'~'.expand(""))" endif " call Dredir("ls!","s:NetrwBufRename (after rename)") " else " Decho @@ -6072,23 +6203,22 @@ fun! s:NetrwSLeftrelease(islocal) endfun " --------------------------------------------------------------------- -" s:NetrwListHide: uses [range]g~...~d to delete files that match comma {{{2 -" separated patterns given in g:netrw_list_hide +" s:NetrwListHide: uses [range]g~...~d to delete files that match {{{2 +" comma-separated patterns given in g:netrw_list_hide fun! s:NetrwListHide() " call Dfunc("s:NetrwListHide() g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">") " call Decho("initial: ".string(getline(w:netrw_bannercnt,'$'))) let ykeep= @@ -" call DechoBuf(bufnr("%"),"COMBAK#3") " find a character not in the "hide" string to use as a separator for :g and :v commands " How-it-works: take the hiding command, convert it into a range. " Duplicate characters don't matter. " Remove all such characters from the '/~@#...890' string. " Use the first character left as a separator character. -" call Decho("find a character not in the hide string to use as a separator") +" call Decho("find a character not in the hide string to use as a separator",'~'.expand("")) let listhide= g:netrw_list_hide - let sep = strpart(substitute('/~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1) -" call Decho("sep=".sep,'~'.expand("")) + let sep = strpart(substitute('~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1) +" call Decho("sep<".sep."> (sep not in hide string)",'~'.expand("")) while listhide != "" if listhide =~ ',' @@ -6098,10 +6228,19 @@ fun! s:NetrwListHide() let hide = listhide let listhide = "" endif -" call Decho("hide<".hide."> listhide<".listhide.'>','~'.expand("")) +" call Decho("..extracted pattern from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("")) + if g:netrw_sort_by =~ '^[ts]' + if hide =~ '^\^' +" call Decho("..modify hide to handle a \"^...\" pattern",'~'.expand("")) + let hide= substitute(hide,'^\^','^\(\\d\\+/\)','') + elseif hide =~ '^\\(\^' + let hide= substitute(hide,'^\\(\^','\\(^\\(\\d\\+/\\)','') + endif +" call Decho("..hide<".hide."> listhide<".listhide.'>','~'.expand("")) + endif " Prune the list by hiding any files which match -" call Decho("prune the list by hiding any files which ",((g:netrw_hide == 1)? "" : "don't")." match hide<".hide.">") +" call Decho("..prune the list by hiding any files which ".((g:netrw_hide == 1)? "" : "don't")."match hide<".hide.">") if g:netrw_hide == 1 " call Decho("..hiding<".hide.">",'~'.expand("")) exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' @@ -6122,7 +6261,6 @@ fun! s:NetrwListHide() " remove any blank lines that have somehow remained. " This seems to happen under Windows. exe 'sil! NetrwKeepj 1,$g@^\s*$@d' -" call DechoBuf(bufnr("%"),"COMBAK#4") let @@= ykeep " call Dret("s:NetrwListHide") @@ -6330,7 +6468,7 @@ fun! s:NetrwMaps(islocal) " generate default maps {{{3 if !hasmapto('NetrwHide') |nmap a NetrwHide_a|endif - if !hasmapto('NetrwBrowseUpDir') |nmap - NetrwBrowseUpDir |endif + if !hasmapto('NetrwBrowseUpDir') |nmap - NetrwBrowseUpDir|endif if !hasmapto('NetrwOpenFile') |nmap % NetrwOpenFile|endif if !hasmapto('NetrwBadd_cb') |nmap cb NetrwBadd_cb|endif if !hasmapto('NetrwBadd_cB') |nmap cB NetrwBadd_cB|endif @@ -6461,7 +6599,7 @@ fun! s:NetrwMaps(islocal) if !hasmapto('NetrwRefresh') nmap NetrwRefresh endif - nnoremap NetrwRefresh :call NetrwRefresh(1,NetrwBrowseChgDir(1,(w:netrw_liststyle == 3)? w:netrw_treetop : './')) + nnoremap NetrwRefresh :call NetrwRefresh(1,NetrwBrowseChgDir(1,(exists("w:netrw_liststyle") && exists("w:netrw_treetop") && w:netrw_liststyle == 3)? w:netrw_treetop : './')) if s:didstarstar || !mapcheck("","n") nnoremap :Nexplore endif @@ -6647,9 +6785,9 @@ fun! s:NetrwMarkFiles(islocal,...) while i <= a:0 if a:islocal if v:version > 704 || (v:version == 704 && has("patch656")) - let mffiles= glob(fnameescape(a:{i}),0,1,1) + let mffiles= glob(a:{i},0,1,1) else - let mffiles= glob(fnameescape(a:{i}),0,1) + let mffiles= glob(a:{i},0,1) endif else let mffiles= [a:{i}] @@ -6710,7 +6848,7 @@ fun! s:NetrwMarkFile(islocal,fname) " sanity check if empty(a:fname) -" call Dret("s:NetrwMarkFile : emtpy fname") +" call Dret("s:NetrwMarkFile : empty fname") return endif let curdir = s:NetrwGetCurdir(a:islocal) @@ -6790,13 +6928,15 @@ fun! s:NetrwMarkFile(islocal,fname) if index(s:netrwmarkfilelist,dname) == -1 " append new filename to global markfilelist call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname)) -" call Decho("append filename<".a:fname."> to global markfilelist<".string(s:netrwmarkfilelist).">",'~'.expand("")) +" call Decho("append filename<".a:fname."> to global s:markfilelist<".string(s:netrwmarkfilelist).">",'~'.expand("")) else " remove new filename from global markfilelist -" call Decho("filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")",'~'.expand("")) +" call Decho("remove new filename from global s:markfilelist",'~'.expand("")) +" call Decho("..filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")",'~'.expand("")) call filter(s:netrwmarkfilelist,'v:val != "'.dname.'"') -" call Decho("ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">",'~'.expand("")) +" call Decho("..ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">",'~'.expand("")) if s:netrwmarkfilelist == [] +" call Decho("s:netrwmarkfilelist is empty; unlet it",'~'.expand("")) unlet s:netrwmarkfilelist endif endif @@ -6820,7 +6960,8 @@ fun! s:NetrwMarkFile(islocal,fname) endif endif let @@= ykeep -" call Dret("s:NetrwMarkFile : s:netrwmarkfilelist_".curbufnr."<".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist").">") +" call Decho("s:netrwmarkfilelist[".(exists("s:netrwmarkfilelist")? string(s:netrwmarkfilelist) : "")."] (avail in all buffers)",'~'.expand("")) +" call Dret("s:NetrwMarkFile : s:netrwmarkfilelist_".curbufnr."<".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist")."> (buf#".curbufnr."list)") endfun " --------------------------------------------------------------------- @@ -7111,17 +7252,8 @@ fun! s:NetrwMarkFileCopy(islocal,...) " call Dret("s:NetrwMarkFileCopy : lcd failure") return endif - if v:version < 704 || (v:version == 704 && !has("patch1107")) - call s:NetrwExe("sil !".g:netrw_localrmdir.g:netrw_localrmdiropt." ".s:ShellEscape(tmpdir,1)) - if v:shell_error != 0 - call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80) -" " call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1) ) - return - endif - else - if delete(tmpdir,"d") - call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".tmpdir.">!",103) - endif + if delete(tmpdir,"d") + call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".tmpdir.">!",103) endif else if s:NetrwLcd(curdir) @@ -7575,8 +7707,9 @@ fun! s:NetrwMarkFileGrep(islocal) let curdir = s:NetrwGetCurdir(a:islocal) if exists("s:netrwmarkfilelist") -" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">",'~'.expand("")) +" call Decho("using s:netrwmarkfilelist".string(s:netrwmarkfilelist).">",'~'.expand("")) let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "fnameescape(v:val)")) +" call Decho("keeping copy of s:netrwmarkfilelist in function-local variable,'~'.expand(""))" call s:NetrwUnmarkAll() else " call Decho('no marked files, using "*"','~'.expand("")) @@ -7584,6 +7717,7 @@ fun! s:NetrwMarkFileGrep(islocal) endif " ask user for pattern +" call Decho("ask user for search pattern",'~'.expand("")) call inputsave() let pat= input("Enter pattern: ","") call inputrestore() @@ -8093,6 +8227,23 @@ fun! s:NetrwOpenFile(islocal) call inputsave() let fname= input("Enter filename: ") call inputrestore() +" call Decho("(s:NetrwOpenFile) fname<".fname.">",'~'.expand("")) + + " determine if Lexplore is in use + if exists("t:netrw_lexbufnr") + " check if t:netrw_lexbufnr refers to a netrw window +" call Decho("(s:netrwOpenFile) ..t:netrw_lexbufnr=".t:netrw_lexbufnr,'~'.expand("")) + let lexwinnr = bufwinnr(t:netrw_lexbufnr) + if lexwinnr != -1 && exists("g:netrw_chgwin") && g:netrw_chgwin != -1 +" call Decho("(s:netrwOpenFile) ..Lexplore in use",'~'.expand("")) + exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd w" + exe "NetrwKeepj e ".fnameescape(fname) + let @@= ykeep +" call Dret("s:NetrwOpenFile : creating a file with Lexplore mode") + endif + endif + + " Does the filename contain a path? if fname !~ '[/\\]' if exists("b:netrw_curdir") if exists("g:netrw_quiet") @@ -8431,6 +8582,7 @@ fun! s:NetrwPrevWinOpen(islocal) let lastwinnr = winnr("$") let curword = s:NetrwGetWord() let choice = 0 + let s:prevwinopen= 1 " lets s:NetrwTreeDir() know that NetrwPrevWinOpen called it let s:treedir = s:NetrwTreeDir(a:islocal) let curdir = s:treedir " call Decho("winnr($)#".lastwinnr." curword<".curword.">",'~'.expand("")) @@ -8696,7 +8848,7 @@ fun! s:NetrwUpload(fname,tgt,...) " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password - NetrwKeepj norm! 1Gdd + NetrwKeepj norm! 1G"_dd call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options) " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) sil NetrwKeepj g/Local directory now/d @@ -8758,7 +8910,7 @@ fun! s:NetrwPreview(path) range " 0 : 1: top -- preview window is horizontally split off and on the top " 0 : 0: bot -- preview window is horizontally split off and on the bottom " - " Note that the file being previewed is already known to not be a directory, hence we can avoid doing a LocalBrowse() check via + " Note that the file being previewed is already known to not be a directory, hence we can avoid doing a LocalBrowseCheck() check via " the BufEnter event set up in netrwPlugin.vim " call Decho("exe ".(g:netrw_alto? "top " : "bot ").(g:netrw_preview? "vert " : "")."pedit ".fnameescape(a:path),'~'.expand("")) let eikeep = &ei @@ -9189,17 +9341,24 @@ endfun " (full path directory with trailing slash returned) fun! s:NetrwTreeDir(islocal) " call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft) +" call Decho("Determine tree directory given current cursor position") " call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("")) " call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("")) " call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("")) +" call Decho("current line<".getline(".").">") - if exists("s:treedir") + if exists("s:treedir") && exists("s:prevwinopen") " s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early +" call Decho('s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early') let treedir= s:treedir unlet s:treedir -" call Dret("s:NetrwTreeDir ".treedir) + unlet s:prevwinopen +" call Dret("s:NetrwTreeDir ".treedir.": early return since s:treedir existed previously") return treedir endif + if exists("s:prevwinopen") + unlet s:prevwinopen + endif if !exists("b:netrw_curdir") || b:netrw_curdir == "" let b:netrw_curdir= getcwd() @@ -9294,7 +9453,6 @@ fun! s:NetrwTreeDisplay(dir,depth) call setline(line("$")+1,a:depth.shortdir.'/') endif " call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("")) - " append a / to dir if its missing one let dir= a:dir @@ -9308,7 +9466,7 @@ fun! s:NetrwTreeDisplay(dir,depth) let listhide= split(g:netrw_list_hide,',') " call Decho("listhide=".string(listhide)) for pat in listhide - call filter(w:netrw_treedict[dir],'v:val !~ "'.pat.'"') + call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"') endfor elseif g:netrw_hide == 2 @@ -9407,20 +9565,29 @@ endfun " Called by s:PerformListing() fun! s:NetrwTreeListing(dirname) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST -" call Dfunc("NetrwTreeListing() bufname<".expand("%").">") +" call Dfunc("s:NetrwTreeListing() bufname<".expand("%").">") " call Decho("curdir<".a:dirname.">",'~'.expand("")) " call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exist")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"),'~'.expand("")) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("")) " update the treetop -" call Decho("update the treetop",'~'.expand("")) if !exists("w:netrw_treetop") +" call Decho("update the treetop (w:netrw_treetop doesn't exist yet)",'~'.expand("")) let w:netrw_treetop= a:dirname + let s:netrw_treetop= w:netrw_treetop " call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)",'~'.expand("")) elseif (w:netrw_treetop =~ ('^'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop) +" call Decho("update the treetop (override w:netrw_treetop with a:dirname<".a:dirname.">)",'~'.expand("")) let w:netrw_treetop= a:dirname + let s:netrw_treetop= w:netrw_treetop " call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)",'~'.expand("")) endif + if exists("w:netrw_treetop") + let s:netrw_treetop= w:netrw_treetop + else + let w:netrw_treetop= getcwd() + let s:netrw_treetop= w:netrw_treetop + endif if !exists("w:netrw_treedict") " insure that we have a treedict, albeit empty @@ -9446,6 +9613,7 @@ fun! s:NetrwTreeListing(dirname) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("")) " display from treetop on down +" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">") NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"") " call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("")) @@ -9457,7 +9625,7 @@ fun! s:NetrwTreeListing(dirname) exe "setl ".g:netrw_bufsettings -" call Dret("NetrwTreeListing : bufname<".expand("%").">") +" call Dret("s:NetrwTreeListing : bufname<".expand("%").">") return endif endfun @@ -9534,15 +9702,19 @@ fun! s:NetrwWideListing() " fpl: filenames per line " fpc: filenames per column setl ma noro + let keepa= @a " call Decho("setl ma noro",'~'.expand("")) let b:netrw_cpf= 0 if line("$") >= w:netrw_bannercnt + " determine the maximum filename size; use that to set cpf exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif' NetrwKeepj call histdel("/",-1) else + let @a= keepa " call Dret("NetrwWideListing") return endif + " allow for two spaces to separate columns let b:netrw_cpf= b:netrw_cpf + 2 " call Decho("b:netrw_cpf=max_filename_length+2=".b:netrw_cpf,'~'.expand("")) @@ -9561,7 +9733,8 @@ fun! s:NetrwWideListing() let newcolstart = w:netrw_bannercnt + fpc let newcolend = newcolstart + fpc - 1 " call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]",'~'.expand("")) - if has("clipboard") + if has("clipboard") && g:netrw_clipboard +" call Decho("(s:NetrwWideListing) save @* and @+",'~'.expand("")) sil! let keepregstar = @* sil! let keepregplus = @+ endif @@ -9569,17 +9742,19 @@ fun! s:NetrwWideListing() if newcolend > line("$") | let newcolend= line("$") | endif let newcolqty= newcolend - newcolstart exe newcolstart + " COMBAK: both of the visual-mode using lines below are problematic vis-a-vis @* if newcolqty == 0 - exe "sil! NetrwKeepj norm! 0\$hx".w:netrw_bannercnt."G$p" + exe "sil! NetrwKeepj norm! 0\$h\"ax".w:netrw_bannercnt."G$\"ap" else - exe "sil! NetrwKeepj norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' + exe "sil! NetrwKeepj norm! 0\".newcolqty.'j$h"ax'.w:netrw_bannercnt.'G$"ap' endif exe "sil! NetrwKeepj ".newcolstart.','.newcolend.'d _' exe 'sil! NetrwKeepj '.w:netrw_bannercnt endwhile if has("clipboard") - sil! let @*= keepregstar - sil! let @+= keepregplus +" call Decho("(s:NetrwWideListing) restore @* and @+",'~'.expand("")) + if @* != keepregstar | sil! let @* = keepregstar | endif + if @+ != keepregplus | sil! let @+ = keepregplus | endif endif exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/\s\+$//e' NetrwKeepj call histdel("/",-1) @@ -9587,6 +9762,7 @@ fun! s:NetrwWideListing() exe 'nno b :call search(''^.\\|\s\s\zs\S'',''bW'')'."\" " call Decho("NetrwWideListing) setl noma nomod ro",'~'.expand("")) exe "setl ".g:netrw_bufsettings + let @a= keepa " call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) " call Dret("NetrwWideListing") return @@ -9708,7 +9884,7 @@ fun! s:PerformListing(islocal) " Hiding... -or- Showing... {{{3 if g:netrw_banner -" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("")) +" call Decho("--handle hiding/showing in banner (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("")) if g:netrw_list_hide != "" && g:netrw_hide if g:netrw_hide == 1 NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide @@ -9761,7 +9937,7 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("")) if !g:netrw_banner || line("$") >= w:netrw_bannercnt -" call Decho("manipulate directory listing (hide)",'~'.expand("")) +" call Decho("manipulate directory listing (support hide)",'~'.expand("")) " call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("")) if g:netrw_hide && g:netrw_list_hide != "" NetrwKeepj call s:NetrwListHide() @@ -9784,6 +9960,7 @@ fun! s:PerformListing(islocal) exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif endif + " remove priority pattern prefix " call Decho("remove priority pattern prefix",'~'.expand("")) exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e' @@ -9822,6 +9999,7 @@ fun! s:PerformListing(islocal) " call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort!','~'.expand("")) exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif +" call Decho("remove leading digits/ (sorting) information from listing",'~'.expand("")) exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e' NetrwKeepj call histdel("/",-1) endif @@ -9884,6 +10062,7 @@ fun! s:PerformListing(islocal) " call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1),'~'.expand("")) exe "setl ts=".(g:netrw_maxfilenamelen+1) endif +" call Decho("PerformListing buffer:",'~'.expand("")) " call DechoBuf(bufnr("%")) if exists("s:treecurpos") @@ -10600,7 +10779,7 @@ endfun " --------------------------------------------------------------------- " netrw#LocalBrowseCheck: {{{2 fun! netrw#LocalBrowseCheck(dirname) - " This function is called by netrwPlugin.vim's s:LocalBrowse(), s:NetrwRexplore(), + " This function is called by netrwPlugin.vim's s:LocalBrowseCheck(), s:NetrwRexplore(), " and by when atop a listed file/directory (via a buffer-local map) " " unfortunate interaction -- split window debugging can't be used here, must use @@ -10751,7 +10930,7 @@ endfun " Hiding a buffer means that it will be re-used when examined, hence "fast". " (re-using a buffer may not be as accurate) " -" s:netrw_events : doesn't exist, s:LocalFastBrowser() will install autocmds whena med or fast browsing +" s:netrw_events : doesn't exist, s:LocalFastBrowser() will install autocmds with medium-speed or fast browsing " =1: autocmds installed, but ignore next FocusGained event to avoid initial double-refresh of listing. " BufEnter may be first event, then a FocusGained event. Ignore the first FocusGained event. " If :Explore used: it sets s:netrw_events to 2, so no FocusGained events are ignored. @@ -10851,7 +11030,6 @@ fun! s:LocalListing() for filename in filelist " call Decho(" ",'~'.expand("")) " call Decho("for filename in filelist: filename<".filename.">",'~'.expand("")) -" call DechoBuf(bufnr("%"),"COMBAK#1") if getftype(filename) == "link" " indicate a symbolic link @@ -10909,26 +11087,29 @@ fun! s:LocalListing() if w:netrw_liststyle == s:LONGLIST let sz = getfsize(filename) + let fsz = strpart(" ",1,15-strlen(sz)).sz if g:netrw_sizestyle =~# "[hH]" let sz= s:NetrwHumanReadable(sz) endif - let fsz = strpart(" ",1,15-strlen(sz)).sz let longfile= printf("%-".(g:netrw_maxfilenamelen+1)."s",pfile) - let pfile = longfile.fsz." ".strftime(g:netrw_timefmt,getftime(filename)) + let pfile = longfile.sz." ".strftime(g:netrw_timefmt,getftime(filename)) " call Decho("longlist support: sz=".sz." fsz=".fsz,'~'.expand("")) endif if g:netrw_sort_by =~# "^t" " sort by time (handles time up to 1 quintillion seconds, US) + " Decorate listing by prepending a timestamp/ . Sorting will then be done based on time. +" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (time)") " call Decho("getftime(".filename.")=".getftime(filename),'~'.expand("")) let t = getftime(filename) let ft = strpart("000000000000000000",1,18-strlen(t)).t -" call Decho("exe NetrwKeepj put ='".ft.'/'.filename."'",'~'.expand("")) +" call Decho("exe NetrwKeepj put ='".ft.'/'.pfile."'",'~'.expand("")) let ftpfile= ft.'/'.pfile sil! NetrwKeepj put=ftpfile elseif g:netrw_sort_by =~ "^s" " sort by size (handles file sizes up to 1 quintillion bytes, US) +" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (size)") " call Decho("getfsize(".filename.")=".getfsize(filename),'~'.expand("")) let sz = getfsize(filename) if g:netrw_sizestyle =~# "[hH]" @@ -10941,10 +11122,11 @@ fun! s:LocalListing() else " sort by name +" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (name)") " call Decho("exe NetrwKeepj put ='".pfile."'",'~'.expand("")) sil! NetrwKeepj put=pfile endif -" call DechoBuf(bufnr("%"),"COMBAK#2") +" call DechoBuf(bufnr("%"),"bufnr(%)") endfor " cleanup any windows mess at end-of-line @@ -10991,9 +11173,10 @@ fun! s:NetrwLocalRename(path) range " call Dfunc("NetrwLocalRename(path<".a:path.">)") " preparation for removing multiple files/directories - let ykeep = @@ - let ctr = a:firstline - let svpos = winsaveview() + let ykeep = @@ + let ctr = a:firstline + let svpos = winsaveview() + let all = 0 " call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) " rename files given by the markfilelist @@ -11021,6 +11204,23 @@ fun! s:NetrwLocalRename(path) range let newname = substitute(oldname,subfrom,subto,'') endif endif + if !all && filereadable(newname) + call inputsave() + let response= input("File<".newname."> already exists; do you want to overwrite it? (y/all/n) ") + call inputrestore() + if response == "all" + let all= 1 + elseif response != "y" && response != "yes" + " refresh the directory +" call Decho("refresh the directory listing",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) +" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call winrestview(svpos) + let @@= ykeep +" call Dret("NetrwLocalRename") + return + endif + endif call rename(oldname,newname) endfor call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) @@ -11044,14 +11244,14 @@ fun! s:NetrwLocalRename(path) range NetrwKeepj norm! 0 let oldname= s:ComposePath(a:path,curword) -" call Decho("oldname<".oldname.">",'~'.expand("")) +" call Decho("oldname<".oldname.">",'~'.expand("")) call inputsave() let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e')) call inputrestore() call rename(oldname,newname) -" call Decho("renaming <".oldname."> to <".newname.">",'~'.expand("")) +" call Decho("renaming <".oldname."> to <".newname.">",'~'.expand("")) let ctr= ctr + 1 endwhile @@ -11261,7 +11461,9 @@ fun! netrw#Expose(varname) " call Dfunc("netrw#Expose(varname<".a:varname.">)") if exists("s:".a:varname) exe "let retval= s:".a:varname +" call Decho("retval=".retval,'~'.expand("")) if exists("g:netrw_pchk") +" call Decho("type(g:netrw_pchk=".g:netrw_pchk.")=".type(retval),'~'.expand("")) if type(retval) == 3 let retval = copy(retval) let i = 0 @@ -11270,10 +11472,13 @@ fun! netrw#Expose(varname) let i = i + 1 endwhile endif -" call Dret("netrw#Expose ".string(retval)) +" call Dret("netrw#Expose ".string(retval)),'~'.expand("")) return string(retval) + else +" call Decho("g:netrw_pchk doesn't exist",'~'.expand("")) endif else +" call Decho("s:".a:varname." doesn't exist",'~'.expand("")) let retval= "n/a" endif @@ -11640,19 +11845,32 @@ endfun " --------------------------------------------------------------------- " s:NetrwCursor: responsible for setting cursorline/cursorcolumn based upon g:netrw_cursor {{{2 -fun! s:NetrwCursor() +fun! s:NetrwCursor(editfile) if !exists("w:netrw_liststyle") let w:netrw_liststyle= g:netrw_liststyle endif " call Dfunc("s:NetrwCursor() ft<".&ft."> liststyle=".w:netrw_liststyle." g:netrw_cursor=".g:netrw_cursor." s:netrw_usercuc=".s:netrw_usercuc." s:netrw_usercul=".s:netrw_usercul) +" call Decho("(s:NetrwCursor) COMBAK: cuc=".&l:cuc." cul=".&l:cul) + if &ft != "netrw" " if the current window isn't a netrw directory listing window, then use user cursorline/column " settings. Affects when netrw is used to read/write a file using scp/ftp/etc. " call Decho("case ft!=netrw: use user cul,cuc",'~'.expand("")) - let &l:cursorline = s:netrw_usercul - let &l:cursorcolumn = s:netrw_usercuc + elseif g:netrw_cursor == 8 + if w:netrw_liststyle == s:WIDELIST + setl cursorline + setl cursorcolumn + else + setl cursorline + endif + elseif g:netrw_cursor == 7 + setl cursorline + elseif g:netrw_cursor == 6 + if w:netrw_liststyle == s:WIDELIST + setl cursorline + endif elseif g:netrw_cursor == 4 " all styles: cursorline, cursorcolumn " call Decho("case g:netrw_cursor==4: setl cul cuc",'~'.expand("")) @@ -11669,26 +11887,22 @@ fun! s:NetrwCursor() else " call Decho("case g:netrw_cursor==3 and not wide: setl cul (use user's cuc)",'~'.expand("")) setl cursorline - let &l:cursorcolumn = s:netrw_usercuc endif elseif g:netrw_cursor == 2 " thin-long-tree: cursorline, user's cursorcolumn " wide : cursorline, user's cursorcolumn " call Decho("case g:netrw_cursor==2: setl cuc (use user's cul)",'~'.expand("")) - let &l:cursorcolumn = s:netrw_usercuc setl cursorline elseif g:netrw_cursor == 1 " thin-long-tree: user's cursorline, user's cursorcolumn " wide : cursorline, user's cursorcolumn - let &l:cursorcolumn = s:netrw_usercuc if w:netrw_liststyle == s:WIDELIST " call Decho("case g:netrw_cursor==2 and wide: setl cul (use user's cuc)",'~'.expand("")) setl cursorline else " call Decho("case g:netrw_cursor==2 and not wide: (use user's cul,cuc)",'~'.expand("")) - let &l:cursorline = s:netrw_usercul endif else @@ -11698,6 +11912,7 @@ fun! s:NetrwCursor() let &l:cursorcolumn = s:netrw_usercuc endif +" call Decho("(s:NetrwCursor) COMBAK: cuc=".&l:cuc." cul=".&l:cul) " call Dret("s:NetrwCursor : l:cursorline=".&l:cursorline." l:cursorcolumn=".&l:cursorcolumn) endfun @@ -11711,6 +11926,7 @@ fun! s:RestoreCursorline() if exists("s:netrw_usercuc") let &l:cursorcolumn = s:netrw_usercuc endif +" call Decho("(s:RestoreCursorline) COMBAK: cuc=".&l:cuc." cul=".&l:cul) " call Dret("s:RestoreCursorline : restored cul=".&l:cursorline." cuc=".&l:cursorcolumn) endfun @@ -11745,12 +11961,38 @@ fun! s:NetrwDelete(path) return result endfun +" --------------------------------------------------------------------- +" s:NetrwBufRemover: removes a buffer that: {{{2s +" has buffer-id > 1 +" is unlisted +" is unnamed +" does not appear in any window +fun! s:NetrwBufRemover(bufid) +" call Dfunc("s:NetrwBufRemover(".a:bufid.")") +" call Decho("buf#".a:bufid." ".((a:bufid > 1)? ">" : "≯")." must be >1 for removal","~".expand("")) +" call Decho("buf#".a:bufid." is ".(buflisted(a:bufid)? "listed" : "unlisted"),"~".expand("")) +" call Decho("buf#".a:bufid." has name <".bufname(a:bufid).">","~".expand("")) +" call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("")) + + if a:bufid > 1 && !buflisted(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1 +" call Decho("(s:NetrwBufRemover) removing buffer#".a:bufid,"~".expand("")) + exe "bd! ".a:bufid + endif + +" call Dret("s:NetrwBufRemover") +endfun + " --------------------------------------------------------------------- " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2 fun! s:NetrwEnew(...) -" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">") +" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">") " call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("")) + " Clean out the last buffer: + " Check if the last buffer has # > 1, is unlisted, is unnamed, and does not appear in a window + " If so, delete it. + call s:NetrwBufRemover(bufnr("$")) + " grab a function-local-variable copy of buffer variables " call Decho("make function-local copy of netrw variables",'~'.expand("")) if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif @@ -11815,6 +12057,9 @@ fun! s:NetrwEnew(...) endif endif endif + if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") + let &l:bexpr = "netrw#BalloonHelp()" + endif " call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$")) endfun @@ -11834,6 +12079,9 @@ fun! s:NetrwExe(cmd) " call Decho("exe ".a:cmd,'~'.expand("")) exe a:cmd endif + if v:shell_error + call netrw#ErrorMsg(s:WARNING,"shell signalled an error",106) + endif " call Dret("s:NetrwExe : v:shell_error=".v:shell_error) endfun @@ -11871,6 +12119,7 @@ endfun " -1=failed fun! s:NetrwLcd(newdir) " call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)") +" call Decho("changing local directory",'~'.expand("")) let err472= 0 try @@ -11906,6 +12155,8 @@ fun! s:NetrwLcd(newdir) return -1 endif +" call Decho("getcwd <".getcwd().">") +" call Decho("b:netrw_curdir<".b:netrw_curdir.">") " call Dret("s:NetrwLcd 0") return 0 endfun diff --git a/runtime/autoload/netrwFileHandlers.vim b/runtime/autoload/netrwFileHandlers.vim index ed31e29a66537..d07235c107c82 100644 --- a/runtime/autoload/netrwFileHandlers.vim +++ b/runtime/autoload/netrwFileHandlers.vim @@ -1,8 +1,8 @@ " netrwFileHandlers: contains various extension-based file handlers for " netrw's browsers' x command ("eXecute launcher") " Author: Charles E. Campbell -" Date: May 03, 2013 -" Version: 11b ASTRO-ONLY +" Date: Sep 18, 2020 +" Version: 11 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -20,7 +20,7 @@ if exists("g:loaded_netrwFileHandlers") || &cp finish endif -let g:loaded_netrwFileHandlers= "v11b" +let g:loaded_netrwFileHandlers= "v11" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrwFileHandlers needs vim 7.2" diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim index 327db6a540477..61c0ef739e3df 100644 --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/autoload/netrwSettings.vim @@ -1,7 +1,7 @@ " netrwSettings.vim: makes netrw settings simpler -" Date: Nov 09, 2016 -" Maintainer: Charles E Campbell -" Version: 16 +" Date: Aug 12, 2021 +" Maintainer: Charles E Campbell +" Version: 17 ASTRO-ONLY " Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -19,7 +19,7 @@ if exists("g:loaded_netrwSettings") || &cp finish endif -let g:loaded_netrwSettings = "v16" +let g:loaded_netrwSettings = "v17" if v:version < 700 echohl WarningMsg echo "***warning*** this version of netrwSettings needs vim 7.0" @@ -31,7 +31,7 @@ endif " NetrwSettings: {{{1 fun! netrwSettings#NetrwSettings() " this call is here largely just to insure that netrw has been loaded - call netrw#SavePosn() + call netrw#WinPath("") if !exists("g:loaded_netrw") echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None return diff --git a/runtime/autoload/netrw_gitignore.vim b/runtime/autoload/netrw_gitignore.vim index da3f50bca0f8c..1b55e2488a1db 100644 --- a/runtime/autoload/netrw_gitignore.vim +++ b/runtime/autoload/netrw_gitignore.vim @@ -18,61 +18,5 @@ " holder be liable for any damages resulting from the use " of this software. function! netrw_gitignore#Hide(...) - let additional_files = a:000 - - let default_files = ['.gitignore', '.git/info/exclude'] - - " get existing global/system gitignore files - let global_gitignore = expand(substitute(system("git config --global core.excludesfile"), '\n', '', 'g')) - if global_gitignore !=# '' - let default_files = add(default_files, global_gitignore) - endif - let system_gitignore = expand(substitute(system("git config --system core.excludesfile"), '\n', '', 'g')) - if system_gitignore !=# '' - let default_files = add(default_files, system_gitignore) - endif - - " append additional files if given as function arguments - if additional_files !=# [] - let files = extend(default_files, additional_files) - else - let files = default_files - endif - - " keep only existing/readable files - let gitignore_files = [] - for file in files - if filereadable(file) - let gitignore_files = add(gitignore_files, file) - endif - endfor - - " get contents of gitignore patterns from those files - let gitignore_lines = [] - for file in gitignore_files - for line in readfile(file) - " filter empty lines and comments - if line !~# '^#' && line !~# '^$' - let gitignore_lines = add(gitignore_lines, line) - endif - endfor - endfor - - " convert gitignore patterns to Netrw/Vim regex patterns - let escaped_lines = [] - for line in gitignore_lines - let escaped = line - let escaped = substitute(escaped, '\*\*', '*', 'g') - let escaped = substitute(escaped, '\.', '\\.', 'g') - let escaped = substitute(escaped, '\$', '\\$', 'g') - let escaped = substitute(escaped, '*', '.*', 'g') - " correction: dot, dollar and asterisks chars shouldn't be escaped when - " within regex matching groups. - let escaped = substitute(escaped, '\(\[[^]]*\)\zs\\\.', '\.', 'g') - let escaped = substitute(escaped, '\(\[[^]]*\)\zs\\\$', '\$', 'g') - let escaped = substitute(escaped, '\(\[[^]]*\)\zs\.\*', '*', 'g') - let escaped_lines = add(escaped_lines, escaped) - endfor - - return join(escaped_lines, ',') + return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '') endfunction diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 377baa8432823..f9448cbd9bc5f 100644 --- a/runtime/autoload/phpcomplete.vim +++ b/runtime/autoload/phpcomplete.vim @@ -3,13 +3,13 @@ " Maintainer: DÃĄvid SzabÃŗ ( complex857 AT gmail DOT com ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " URL: https://github.com/shawncplus/phpcomplete.vim -" Last Change: 2018 Oct 10 +" Last Change: 2021 Feb 08 " " OPTIONS: " " let g:phpcomplete_relax_static_constraint = 1/0 [default 0] " Enables completion for non-static methods when completing for static context (::). -" This generates E_STRICT level warning, but php calls these methods nontheless. +" This generates E_STRICT level warning, but php calls these methods nonetheless. " " let g:phpcomplete_complete_for_unknown_classes = 1/0 [default 0] " Enables completion of variables and functions in "everything under the sun" fashion @@ -28,7 +28,7 @@ " This option controls the number of characters the user needs to type before " the tags will be searched for namespaces and classes in typed out namespaces in " "use ..." context. Setting this to 0 is not recommended because that means the code -" have to scan every tag, and vim's taglist() function runs extremly slow with a +" have to scan every tag, and vim's taglist() function runs extremely slow with a " "match everything" pattern. " " let g:phpcomplete_parse_docblock_comments = 1/0 [default 0] @@ -122,7 +122,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ endif endif - " If exists b:php_menu it means completion was already constructed we " don't need to do anything more if exists("b:php_menu") @@ -148,8 +147,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ try let eventignore = &eventignore let &eventignore = 'all' - let winheight = winheight(0) - let winnr = winnr() let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.'))) @@ -183,7 +180,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ endif if filereadable(classlocation) - let classfile = readfile(classlocation) let classcontent = '' let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname) let sccontent = split(classcontent, "\n") @@ -217,7 +213,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ return phpcomplete#CompleteGeneral(a:base, current_namespace, imports) endif finally - silent! exec winnr.'resize '.winheight let &eventignore = eventignore endtry endfunction @@ -268,7 +263,7 @@ function! phpcomplete#CompleteUse(base) " {{{ call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename }) endif endfor - " if it seems that the tags file have namespace informations we can safely throw + " if it seems that the tags file have namespace information we can safely throw " away namespaceless tag matches since we can be sure they are invalid if patched_ctags_detected no_namespace_matches = [] @@ -810,7 +805,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports) endif endfor - " resolve the typed in part with namespaces (if theres a \ in it) + " resolve the typed in part with namespaces (if there's a \ in it) let [tag_match_pattern, namespace_for_class] = phpcomplete#ExpandClassName(a:base, a:current_namespace, a:imports) let tags = [] @@ -926,11 +921,11 @@ function! s:getNextCharWithPos(filelines, current_pos) " {{{ endfunction " }}} function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{ - " if theres no modifier, and no modifier is allowed and no modifier is required + " if there's no modifier, and no modifier is allowed and no modifier is required if len(a:modifiers) == 0 && len(a:required_modifiers) == 0 return 1 else - " check if every requred modifier is present + " check if every required modifier is present for required_modifier in a:required_modifiers if index(a:modifiers, required_modifier) == -1 return 0 @@ -1025,7 +1020,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) " let c_var = '$'.c_var endif let c_variables[c_var] = '' - if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index)) > 0 + if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index, '')) > 0 let c_doc[c_var] = phpcomplete#GetDocBlock(a:sccontent, variables[var_index]) endif let var_index += 1 @@ -1258,7 +1253,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) " endif endif - " save the coma position for later use if theres a "naked" , possibly separating a parameter and it is not in a parented part + " save the coma position for later use if there's a "naked" , possibly separating a parameter and it is not in a parented part if first_coma_break_pos == -1 && current_char == ',' let first_coma_break_pos = len(instruction) endif @@ -1304,7 +1299,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) " " there were a "naked" coma in the instruction if first_coma_break_pos != -1 - if instruction !~? '^use' && instruction !~? '^class' " use ... statements and class delcarations should not be broken up by comas + if instruction !~? '^use' && instruction !~? '^class' " use ... statements and class declarations should not be broken up by comas let pos = (-1 * first_coma_break_pos) + 1 let instruction = instruction[pos :] endif @@ -1316,7 +1311,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) " " clear everything up until the first ( let instruction = substitute(instruction, '^\(if\|while\|foreach\|for\)\s*(\s*', '', '') - " lets iterate trough the instruction until we can find the pair for the opening ( + " lets iterate through the instruction until we can find the pair for the opening ( let i = 0 let depth = 1 while i < len(instruction) @@ -1424,7 +1419,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat let parts = split(substitute(type, '^\\', '', ''), '\') let class_candidate_namespace = join(parts[0:-2], '\') let classname_candidate = parts[-1] - " check for renamed namepsace in imports + " check for renamed namespace in imports if has_key(classstructure.imports, class_candidate_namespace) let class_candidate_namespace = classstructure.imports[class_candidate_namespace].name endif @@ -2023,7 +2018,7 @@ function! phpcomplete#GetCachedClassContents(classlocation, class_name) " {{{ if getftime(classstructure.file) != classstructure.mtime let valid = 0 " we could break here, but the time required for checking probably worth - " the the memory we can free by checking every file in the cached hirearchy + " the the memory we can free by checking every file in the cached hierarchy call phpcomplete#ClearCachedClassContents(classstructure.file) endif endfor @@ -2037,7 +2032,7 @@ function! phpcomplete#GetCachedClassContents(classlocation, class_name) " {{{ call remove(s:cache_classstructures, cache_key) call phpcomplete#ClearCachedClassContents(full_file_path) - " fall trough for the read from files path + " fall through for the read from files path endif else call phpcomplete#ClearCachedClassContents(full_file_path) @@ -2082,26 +2077,17 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam " ... " ] " - let full_file_path = fnamemodify(a:file_path, ':p') let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' - let cfile = join(a:file_lines, "\n") + let full_file_path = fnamemodify(a:file_path, ':p') let result = [] - " We use new buffer and (later) normal! because - " this is the most efficient way. The other way - " is to go through the looong string looking for - " matching {} - - " remember the window we started at - let phpcomplete_original_window = winnr() - - silent! below 1new - silent! 0put =cfile - call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)') - let cfline = line('.') - call search('{') - let endline = line('.') - - let content = join(getline(cfline, endline), "\n") + let popup_id = popup_create(a:file_lines, {'hidden': v:true}) + + call win_execute(popup_id, 'call search(''\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)'')') + call win_execute(popup_id, "let cfline = line('.')") + call win_execute(popup_id, "call search('{')") + call win_execute(popup_id, "let endline = line('.')") + + call win_execute(popup_id, 'let content = join(getline('.cfline.', '.endline.'), "\n")') " Catch extends if content =~? 'extends' let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)') @@ -2117,14 +2103,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam else let implemented_interfaces = [] endif - call searchpair('{', '', '}', 'W') - let class_closing_bracket_line = line('.') + + call win_execute(popup_id, 'let [class_closing_bracket_line, class_closing_bracket_col] = searchpairpos("{", "", "}", "W")') " Include class docblock let doc_line = cfline - 1 - if getline(doc_line) =~? '^\s*\*/' + call win_execute(popup_id, 'let l = getline('.doc_line.')') + if l =~? '^\s*\*/' while doc_line != 0 - if getline(doc_line) =~? '^\s*/\*\*' + call win_execute(popup_id, 'let l = getline('.doc_line.')') + if l =~? '^\s*/\*\*' let cfline = doc_line break endif @@ -2132,50 +2120,48 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam endwhile endif - let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") + call win_execute(popup_id, 'let classcontent = join(getline('.cfline.', '.class_closing_bracket_line.'), "\n")') let used_traits = [] " move back to the line next to the class's definition - call cursor(endline + 1, 1) + call win_execute(popup_id, 'call cursor('.(endline + 1).', 1)') let keep_searching = 1 while keep_searching != 0 " try to grab "use..." keywords - let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line) - let syn_name = synIDattr(synID(lnum, col, 0), "name") + call win_execute(popup_id, 'let [lnum, col] = searchpos(''\c^\s\+use\s\+'.class_name_pattern.''', "cW", '.class_closing_bracket_line.')') + call win_execute(popup_id, 'let syn_name = synIDattr(synID('.lnum.', '.col.', 0), "name")') if syn_name =~? 'string\|comment' - call cursor(lnum + 1, 1) + call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)') continue endif - let trait_line = getline(lnum) + call win_execute(popup_id, 'let trait_line = getline('.lnum.')') if trait_line !~? ';' " try to find the next line containing ';' let l = lnum let search_line = trait_line - " add lines from the file until theres no ';' in them + " add lines from the file until there's no ';' in them while search_line !~? ';' && l > 0 " file lines are reversed so we need to go backwards let l += 1 - let search_line = getline(l) + call win_execute(popup_id, 'let search_line = getline('.l.')') let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') endwhile endif let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;') let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")') - call cursor(lnum + 1, 1) + call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)') if [lnum, col] == [0, 0] let keep_searching = 0 endif endwhile - silent! bw! % + call popup_close(popup_id) let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline]) - " go back to original window - exe phpcomplete_original_window.'wincmd w' call add(result, { \ 'class': a:class_name, \ 'content': classcontent, @@ -2532,40 +2518,37 @@ function! phpcomplete#FormatDocBlock(info) " {{{ endif return res -endfunction! +endfunction " }}} function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ - let original_window = winnr() - - silent! below 1new - silent! 0put =a:file_lines - normal! G + let popup_id = popup_create(a:file_lines, {'hidden': v:true}) + call win_execute(popup_id, 'normal! G') " clear out classes, functions and other blocks while 1 - let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web') + call win_execute(popup_id, 'let block_start_pos = searchpos(''\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{'', "Web")') if block_start_pos == [0, 0] break endif - let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') + call win_execute(popup_id, 'let block_end_pos = searchpairpos("{", "", ''}\|\%$'', "W", ''synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'')') + let popup_lines = winbufnr(popup_id)->getbufline(1, '$') if block_end_pos != [0, 0] " end of the block found, just delete it - silent! exec block_start_pos[0].','.block_end_pos[0].'d _' + call remove(popup_lines, block_start_pos[0] - 1, block_end_pos[0] - 1) else " block pair not found, use block start as beginning and the end " of the buffer instead - silent! exec block_start_pos[0].',$d _' + call remove(popup_lines, block_start_pos[0] - 1, -1) endif + call popup_settext(popup_id, popup_lines) endwhile - normal! G + call win_execute(popup_id, 'normal! G', 'silent!') " grab the remains - let file_lines = reverse(getline(1, line('.') - 1)) - - silent! bw! % - exe original_window.'wincmd w' + call win_execute(popup_id, "let file_lines = reverse(getline(1, line('.')-1))") + call popup_close(popup_id) let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' let i = 0 @@ -2590,7 +2573,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let search_line = line let use_line = line - " add lines from the file until theres no ';' in them + " add lines from the file until there's no ';' in them while search_line !~? ';' && l > 0 " file lines are reversed so we need to go backwards let l -= 1 @@ -2622,7 +2605,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ " find kind flags from tags or built in methods for the objects we extracted " they can be either classes, interfaces or namespaces, no other thing is importable in php for [key, import] in items(imports) - " if theres a \ in the name we have it's definitely not a built in thing, look for tags + " if there's a \ in the name we have it's definitely not a built in thing, look for tags if import.name =~ '\\' let patched_ctags_detected = 0 let [classname, namespace_for_classes] = phpcomplete#ExpandClassName(import.name, '\', {}) @@ -2679,10 +2662,10 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let import['kind'] = 'i' let import['builtin'] = 1 else - " or can be a tag with exactly matchign name + " or can be a tag with exactly matching name let tags = phpcomplete#GetTaglist('^'.import['name'].'$') for tag in tags - " search for the first matchin namespace, class, interface with no namespace + " search for the first matching namespace, class, interface with no namespace if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') call extend(import, tag) let import['builtin'] = 0 @@ -2900,7 +2883,7 @@ for [ext, data] in items(php_builtin['functions']) call extend(g:php_builtin_functions, data) endfor -" Built in classs +" Built in class let g:php_builtin_classes = {} for [ext, data] in items(php_builtin['classes']) call extend(g:php_builtin_classes, data) @@ -2918,10 +2901,10 @@ for [ext, data] in items(php_builtin['constants']) call extend(g:php_constants, data) endfor -" When the classname not found or found but the tags dosen't contain that -" class we will try to complate any method of any builtin class. To speed up +" When the classname not found or found but the tags doesn't contain that +" class we will try to complete any method of any builtin class. To speed up " that lookup we compile a 'ClassName::MethodName':'info' dictionary from the -" builtin class informations +" builtin class information let g:php_builtin_object_functions = {} " When completing for 'everyting imaginable' (no class context, not a diff --git a/runtime/autoload/python3complete.vim b/runtime/autoload/python3complete.vim index f0f3aaddb3d03..ea0a3313692ad 100644 --- a/runtime/autoload/python3complete.vim +++ b/runtime/autoload/python3complete.vim @@ -1,7 +1,8 @@ "python3complete.vim - Omni Completion for python -" Maintainer: Aaron Griffin +" Maintainer: +" Previous Maintainer: Aaron Griffin " Version: 0.9 -" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian) +" Last Updated: 2022 Mar 30 " " Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim " @@ -83,13 +84,16 @@ function! python3complete#Complete(findstart, base) break endif endwhile - execute "py3 vimpy3complete('" . cword . "', '" . a:base . "')" + execute "py3 vimpy3complete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')" return g:python3complete_completions endif endfunction function! s:DefPython() py3 << PYTHONEOF +import warnings +warnings.simplefilter(action='http://github.com/ignore', category=FutureWarning) + import sys, tokenize, io, types from token import NAME, DEDENT, NEWLINE, STRING @@ -172,7 +176,7 @@ class Completer(object): pass if len(arg_text) == 0: # The doc string sometimes contains the function signature - # this works for alot of C modules that are part of the + # this works for a lot of C modules that are part of the # standard library doc = func_obj.__doc__ if doc: diff --git a/runtime/autoload/pythoncomplete.vim b/runtime/autoload/pythoncomplete.vim index ecc36646d9d8a..aa28bb721fa86 100644 --- a/runtime/autoload/pythoncomplete.vim +++ b/runtime/autoload/pythoncomplete.vim @@ -1,7 +1,8 @@ "pythoncomplete.vim - Omni Completion for python -" Maintainer: Aaron Griffin +" Maintainer: +" Previous Maintainer: Aaron Griffin " Version: 0.9 -" Last Updated: 18 Jun 2009 +" Last Updated: 2020 Oct 9 " " Changes " TODO: @@ -81,7 +82,7 @@ function! pythoncomplete#Complete(findstart, base) break endif endwhile - execute "python vimcomplete('" . cword . "', '" . a:base . "')" + execute "python vimcomplete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')" return g:pythoncomplete_completions endif endfunction @@ -190,7 +191,7 @@ class Completer(object): pass if len(arg_text) == 0: # The doc string sometimes contains the function signature - # this works for alot of C modules that are part of the + # this works for a lot of C modules that are part of the # standard library doc = func_obj.__doc__ if doc: diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index ea184702326c6..3677b25aebac7 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Mark Guzman " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns -" Last Change: 2019 Jan 06 +" Last Change: 2020 Apr 12 " ---------------------------------------------------------------------------- " " Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) @@ -53,6 +53,23 @@ if !exists("g:rubycomplete_include_objectspace") endif " }}} configuration failsafe initialization +" {{{ regex patterns + +" Regex that defines the start-match for the 'end' keyword. +let s:end_start_regex = + \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . + \ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' . + \ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' . + \ '\|\%(^\|[^.:@$]\)\@<=\' + +" Regex that defines the middle-match for the 'end' keyword. +let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\\|when\|elsif\):\@!\>' + +" Regex that defines the end-match for the 'end' keyword. +let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\' + +" }}} regex patterns + " {{{ vim-side support functions let s:rubycomplete_debug = 0 @@ -103,7 +120,7 @@ function! s:GetBufferRubyEntity( name, type, ... ) endif let curpos = getpos(".") - let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' ) + let [enum,ecol] = searchpairpos( s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'W' ) call cursor(lastpos[1], lastpos[2]) if lnum > enum @@ -128,19 +145,28 @@ function! s:IsPosInClassDef(pos) return ret endfunction +function! s:IsInComment(pos) + let stack = synstack(a:pos[0], a:pos[1]) + if !empty(stack) + return synIDattr(stack[0], 'name') =~ 'ruby\%(.*Comment\|Documentation\)' + else + return 0 + endif +endfunction + function! s:GetRubyVarType(v) let stopline = 1 let vtp = '' - let pos = getpos('.') + let curpos = getpos('.') let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$' let [lnum,lcol] = searchpos(sstr,'nb',stopline) if lnum != 0 && lcol != 0 - call setpos('.',pos) + call setpos('.',curpos) let str = getline(lnum) let vtp = substitute(str,sstr,'\1','') return vtp endif - call setpos('.',pos) + call setpos('.',curpos) let ctors = '\(now\|new\|open\|get_instance' if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1 let ctors = ctors.'\|find\|create' @@ -150,9 +176,13 @@ function! s:GetRubyVarType(v) let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr - let [lnum,lcol] = searchpos(sstr,'nb',stopline) - if lnum != 0 && lcol != 0 - let str = matchstr(getline(lnum),fstr,lcol) + let pos = searchpos(sstr,'bW') + while pos != [0,0] && s:IsInComment(pos) + let pos = searchpos(sstr,'bW') + endwhile + if pos != [0,0] + let [lnum, col] = pos + let str = matchstr(getline(lnum),fstr,col) let str = substitute(str,'^=\s*','','') call setpos('.',pos) @@ -174,7 +204,7 @@ function! s:GetRubyVarType(v) end return '' endif - call setpos('.',pos) + call setpos('.',curpos) return '' endfunction @@ -471,13 +501,8 @@ class VimRubyCompletion return if rails_base == nil $:.push rails_base unless $:.index( rails_base ) - rails_config = rails_base + "config/" - rails_lib = rails_base + "lib/" - $:.push rails_config unless $:.index( rails_config ) - $:.push rails_lib unless $:.index( rails_lib ) - - bootfile = rails_config + "boot.rb" - envfile = rails_config + "environment.rb" + bootfile = rails_base + "config/boot.rb" + envfile = rails_base + "config/environment.rb" if File.exists?( bootfile ) && File.exists?( envfile ) begin require bootfile @@ -671,11 +696,10 @@ class VimRubyCompletion methods.delete_if { |c| c.match( /'/ ) } end - when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods + when /^::([A-Z][^:\.\(]*)?$/ # Absolute Constant or class methods dprint "const or cls" receiver = $1 - methods = Object.constants - methods.grep(/^#{receiver}/).collect{|e| "::" + e} + methods = Object.constants.collect{ |c| c.to_s }.grep(/^#{receiver}/) when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods receiver = $1 @@ -684,13 +708,13 @@ class VimRubyCompletion load_buffer_class( receiver ) load_buffer_module( receiver ) begin - classes = eval("#{receiver}.constants") - #methods = eval("#{receiver}.methods") + constants = eval("#{receiver}.constants").collect{ |c| c.to_s }.grep(/^#{message}/) + methods = eval("#{receiver}.methods").collect{ |m| m.to_s }.grep(/^#{message}/) rescue Exception dprint "exception: %s" % $! + constants = [] methods = [] end - methods.grep(/^#{message}/).collect{|e| receiver + "::" + e} when /^(:[^:.]+)\.([^.]*)$/ # Symbol dprint "symbol" diff --git a/runtime/autoload/spellfile.vim b/runtime/autoload/spellfile.vim index 4e43cea142034..dcf9ed220b4ac 100644 --- a/runtime/autoload/spellfile.vim +++ b/runtime/autoload/spellfile.vim @@ -1,15 +1,11 @@ " Vim script to download a missing spell file " Maintainer: Bram Moolenaar -" Last Change: 2012 Jan 08 +" Last Change: 2020 Jul 10 if !exists('g:spellfile_URL') - " Prefer using http:// when netrw should be able to use it, since - " more firewalls let this through. - if executable("curl") || executable("wget") || executable("fetch") - let g:spellfile_URL = 'http://ftp.vim.org/pub/vim/runtime/spell' - else - let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell' - endif + " Always use https:// because it's secure. The certificate is for nluug.nl, + " thus we can't use the alias ftp.vim.org here. + let g:spellfile_URL = 'https://ftp.nluug.nl/pub/vim/runtime/spell' endif let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset. diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim index ef5ce2e6e21ea..adbdbab894c2d 100644 --- a/runtime/autoload/sqlcomplete.vim +++ b/runtime/autoload/sqlcomplete.vim @@ -17,7 +17,7 @@ " and complete it. " " Version 16.0 (Dec 2015) -" - NF: If reseting the cache and table, procedure or view completion +" - NF: If resetting the cache and table, procedure or view completion " had been used via dbext, have dbext delete or recreate the " dictionary so that new objects are picked up for the " next completion. @@ -554,7 +554,7 @@ function! sqlcomplete#PreCacheSyntax(...) let syn_group_arr = g:omni_sql_precache_syntax_groups endif " For each group specified in the list, precache all - " the sytnax items. + " the syntax items. if !empty(syn_group_arr) for group_name in syn_group_arr let syn_items = extend( syn_items, s:SQLCGetSyntaxList(group_name) ) @@ -577,7 +577,7 @@ function! sqlcomplete#ResetCacheSyntax(...) let syn_group_arr = g:omni_sql_precache_syntax_groups endif " For each group specified in the list, precache all - " the sytnax items. + " the syntax items. if !empty(syn_group_arr) for group_name in syn_group_arr let list_idx = index(s:syn_list, group_name, 0, &ignorecase) @@ -617,7 +617,7 @@ function! sqlcomplete#DrillIntoTable() else " If the popup is not visible, simple perform the normal " key behaviour. - " Must use exec since they key must be preceeded by "\" + " Must use exec since the key must be preceded by "\" " or feedkeys will simply push each character of the string " rather than the "key press". exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_right.'", "n")' @@ -634,7 +634,7 @@ function! sqlcomplete#DrillOutOfColumns() else " If the popup is not visible, simple perform the normal " key behaviour. - " Must use exec since they key must be preceeded by "\" + " Must use exec since the key must be preceded by "\" " or feedkeys will simply push each character of the string " rather than the "key press". exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_left.'", "n")' @@ -843,7 +843,7 @@ function! s:SQLCGetColumns(table_name, list_type) let curline = line(".") let curcol = col(".") - " Do not let searchs wrap + " Do not let searches wrap setlocal nowrapscan " If . was entered, look at the word just before the . " We are looking for something like this: @@ -863,7 +863,7 @@ function! s:SQLCGetColumns(table_name, list_type) " Search forward until one of the following: " 1. Another select/update/delete statement " 2. A ; at the end of a line (the delimiter) - " 3. The end of the file (incase no delimiter) + " 3. The end of the file (in case no delimiter) " Yank the visually selected text into the "y register. exec 'silent! normal! vl/\c\(\\|\\|\\|;\s*$\|\%$\)'."\n".'"yy' diff --git a/runtime/autoload/syntaxcomplete.vim b/runtime/autoload/syntaxcomplete.vim index 98584b407409d..396193d8b0203 100644 --- a/runtime/autoload/syntaxcomplete.vim +++ b/runtime/autoload/syntaxcomplete.vim @@ -1,12 +1,20 @@ " Vim completion script " Language: All languages, uses existing syntax highlighting rules " Maintainer: David Fishburn -" Version: 13.0 -" Last Change: 2019 Aug 08 +" Version: 15.0 +" Last Change: 2021 Apr 27 " Usage: For detailed help, ":help ft-syntax-omni" " History " +" Version 15.0 +" - SyntaxComplete ignored all buffer specific overrides, always used global +" https://github.com/vim/vim/issues/8153 +" +" Version 14.0 +" - Fixed issue with single quotes and is_keyword +" https://github.com/vim/vim/issues/7463 +" " Version 13.0 " - Extended the option omni_syntax_group_include_{filetype} " to accept a comma separated list of regex's rather than @@ -38,7 +46,7 @@ " let g:omni_syntax_use_single_byte = 1 " - This by default will only allow single byte ASCII " characters to be added and an additional check to ensure -" the charater is printable (see documentation for isprint). +" the character is printable (see documentation for isprint). " " Version 9.0 " - Add the check for cpo. @@ -86,7 +94,7 @@ endif if exists('g:loaded_syntax_completion') finish endif -let g:loaded_syntax_completion = 130 +let g:loaded_syntax_completion = 150 " Turn on support for line continuations when creating the script let s:cpo_save = &cpo @@ -141,14 +149,10 @@ let s:prepended = '' " This function is used for the 'omnifunc' option. function! syntaxcomplete#Complete(findstart, base) - " Only display items in the completion window that are at least - " this many characters in length - if !exists('b:omni_syntax_ignorecase') - if exists('g:omni_syntax_ignorecase') - let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase - else - let b:omni_syntax_ignorecase = &ignorecase - endif + " Allow user to override ignorecase per buffer + let l:omni_syntax_ignorecase = g:omni_syntax_ignorecase + if exists('b:omni_syntax_ignorecase') + let l:omni_syntax_ignorecase = b:omni_syntax_ignorecase endif if a:findstart @@ -179,7 +183,7 @@ function! syntaxcomplete#Complete(findstart, base) endif " let base = s:prepended . a:base - let base = s:prepended + let base = substitute(s:prepended, "'", "''", 'g') let filetype = substitute(&filetype, '\.', '_', 'g') let list_idx = index(s:cache_name, filetype, 0, &ignorecase) @@ -195,13 +199,13 @@ function! syntaxcomplete#Complete(findstart, base) if base != '' " let compstr = join(compl_list, ' ') - " let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*' + " let expr = (l:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*' " let compstr = substitute(compstr, expr, '', 'g') " let compl_list = split(compstr, '\s\+') " Filter the list based on the first few characters the user " entered - let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'" + let expr = 'v:val '.(l:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'" let compl_list = filter(deepcopy(compl_list), expr) endif @@ -222,6 +226,26 @@ function! syntaxcomplete#OmniSyntaxList(...) endif endfunc +function! syntaxcomplete#OmniSyntaxClearCache() + let s:cache_name = [] + let s:cache_list = [] +endfunction + +" To retrieve all syntax items regardless of syntax group: +" echo OmniSyntaxList( [] ) +" +" To retrieve only the syntax items for the sqlOperator syntax group: +" echo OmniSyntaxList( ['sqlOperator'] ) +" +" To retrieve all syntax items for both the sqlOperator and sqlType groups: +" echo OmniSyntaxList( ['sqlOperator', 'sqlType'] ) +" +" A regular expression can also be used: +" echo OmniSyntaxList( ['sql\w\+'] ) +" +" From within a plugin, you would typically assign the output to a List: > +" let myKeywords = [] +" let myKeywords = OmniSyntaxList( ['sqlKeyword'] ) function! OmniSyntaxList(...) let list_parms = [] if a:0 > 0 @@ -239,37 +263,25 @@ function! OmniSyntaxList(...) " let use_dictionary = a:1 " endif - " Only display items in the completion window that are at least - " this many characters in length - if !exists('b:omni_syntax_use_iskeyword') - if exists('g:omni_syntax_use_iskeyword') - let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword - else - let b:omni_syntax_use_iskeyword = 1 - endif - endif - - " Only display items in the completion window that are at least - " this many characters in length - if !exists('b:omni_syntax_minimum_length') - if exists('g:omni_syntax_minimum_length') - let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length - else - let b:omni_syntax_minimum_length = 0 - endif - endif - let saveL = @l let filetype = substitute(&filetype, '\.', '_', 'g') if empty(list_parms) + " Allow user to override per buffer + if exists('g:omni_syntax_group_include_'.filetype) + let l:omni_syntax_group_include_{filetype} = g:omni_syntax_group_include_{filetype} + endif + if exists('b:omni_syntax_group_include_'.filetype) + let l:omni_syntax_group_include_{filetype} = b:omni_syntax_group_include_{filetype} + endif + " Default the include group to include the requested syntax group let syntax_group_include_{filetype} = '' " Check if there are any overrides specified for this filetype - if exists('g:omni_syntax_group_include_'.filetype) + if exists('l:omni_syntax_group_include_'.filetype) let syntax_group_include_{filetype} = - \ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g') - let list_parms = split(g:omni_syntax_group_include_{filetype}, ',') + \ substitute( l:omni_syntax_group_include_{filetype},'\s\+','','g') + let list_parms = split(l:omni_syntax_group_include_{filetype}, ',') if syntax_group_include_{filetype} =~ '\w' let syntax_group_include_{filetype} = \ substitute( syntax_group_include_{filetype}, @@ -324,11 +336,20 @@ function! OmniSyntaxList(...) else " Default the exclude group to nothing let syntax_group_exclude_{filetype} = '' - " Check if there are any overrides specified for this filetype + + " Allow user to override per buffer if exists('g:omni_syntax_group_exclude_'.filetype) + let l:omni_syntax_group_exclude_{filetype} = g:omni_syntax_group_exclude_{filetype} + endif + if exists('b:omni_syntax_group_exclude_'.filetype) + let l:omni_syntax_group_exclude_{filetype} = b:omni_syntax_group_exclude_{filetype} + endif + + " Check if there are any overrides specified for this filetype + if exists('l:omni_syntax_group_exclude_'.filetype) let syntax_group_exclude_{filetype} = - \ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g') - let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',') + \ substitute( l:omni_syntax_group_exclude_{filetype},'\s\+','','g') + let list_exclude_groups = split(l:omni_syntax_group_exclude_{filetype}, ',') if syntax_group_exclude_{filetype} =~ '\w' let syntax_group_exclude_{filetype} = \ substitute( syntax_group_exclude_{filetype}, @@ -524,6 +545,30 @@ endfunction function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) + " Allow user to override iskeyword per buffer + let l:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword + if exists('b:omni_syntax_use_iskeyword') + let l:omni_syntax_use_iskeyword = b:omni_syntax_use_iskeyword + endif + + " Allow user to override iskeyword_numeric per buffer + let l:omni_syntax_use_iskeyword_numeric = g:omni_syntax_use_iskeyword_numeric + if exists('b:omni_syntax_use_iskeyword_numeric') + let l:omni_syntax_use_iskeyword_numeric = b:omni_syntax_use_iskeyword_numeric + endif + + " Allow user to override iskeyword_numeric per buffer + let l:omni_syntax_use_single_byte = g:omni_syntax_use_single_byte + if exists('b:omni_syntax_use_single_byte') + let l:omni_syntax_use_single_byte = b:omni_syntax_use_single_byte + endif + + " Allow user to override minimum_length per buffer + let l:omni_syntax_minimum_length = g:omni_syntax_minimum_length + if exists('b:omni_syntax_minimum_length') + let l:omni_syntax_minimum_length = b:omni_syntax_minimum_length + endif + let syn_list = "" " From the full syntax listing, strip out the portion for the @@ -548,7 +593,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' ) " let syn_list = substitute( @l, '^.*xxx\s*', "", '' ) - " We only want the words for the lines begining with + " We only want the words for the lines beginning with " containedin, but there could be other items. " Tried to remove all lines that do not begin with contained @@ -642,14 +687,23 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) \ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)' \ , "", 'g' \ ) - - if b:omni_syntax_use_iskeyword == 0 + + if l:omni_syntax_use_iskeyword == 0 " There are a number of items which have non-word characters in " them, *'T_F1'*. vim.vim is one such file. " This will replace non-word characters with spaces. + " setlocal filetype=forth + " let g:omni_syntax_use_iskeyword = 1 + " let g:omni_syntax_use_iskeyword_numeric = 1 + " You will see entries like + " #>> + " (.local) + " These were found doing a grep in vim82\syntax + " grep iskeyword * + " forth.vim:setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' ) else - if g:omni_syntax_use_iskeyword_numeric == 1 + if l:omni_syntax_use_iskeyword_numeric == 1 " iskeyword can contain value like this " 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 " Numeric values convert to their ASCII equivalent using the @@ -669,7 +723,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " cycle through each character within the range let [b:start, b:end] = split(item, '-') for range_item in range( b:start, b:end ) - if range_item <= 127 || g:omni_syntax_use_single_byte == 0 + if range_item <= 127 || l:omni_syntax_use_single_byte == 0 if nr2char(range_item) =~ '\p' let accepted_chars = accepted_chars . nr2char(range_item) endif @@ -677,13 +731,13 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) endfor elseif item =~ '^\d\+$' " Only numeric, translate to a character - if item < 127 || g:omni_syntax_use_single_byte == 0 + if item < 127 || l:omni_syntax_use_single_byte == 0 if nr2char(item) =~ '\p' let accepted_chars = accepted_chars . nr2char(item) endif endif else - if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0 + if char2nr(item) < 127 || l:omni_syntax_use_single_byte == 0 if item =~ '\p' let accepted_chars = accepted_chars . item endif @@ -719,9 +773,9 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) endif endif - if b:omni_syntax_minimum_length > 0 + if l:omni_syntax_minimum_length > 0 " If the user specified a minimum length, enforce it - let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g') + let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.l:omni_syntax_minimum_length.'}\ze ', ' ', 'g') endif else let syn_list = '' @@ -751,5 +805,6 @@ function! OmniSyntaxShowChars(spec) endfor return join(map(result, 'nr2char(v:val)'), ', ') endfunction + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index dc670dbd1489b..e495e8262a93f 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,13 +1,13 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Apr 17, 2013 -" Version: 29 -" Maintainer: Charles E Campbell -" License: Vim License (see vim's :help license) +" Date: Jan 07, 2020 +" Version: 32 +" Maintainer: Charles E Campbell +" License: Vim License (see vim's :help license) " " Contains many ideas from Michael Toren's " -" Copyright: Copyright (C) 2005-2011 Charles E. Campbell {{{1 +" Copyright: Copyright (C) 2005-2017 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_tar") finish endif -let g:loaded_tar= "v29" +let g:loaded_tar= "v32" if v:version < 702 echohl WarningMsg echo "***warning*** this version of tar needs vim 7.2" @@ -48,6 +48,9 @@ endif if !exists("g:tar_writeoptions") let g:tar_writeoptions= "uf" endif +if !exists("g:tar_delfile") + let g:tar_delfile="--delete -f" +endif if !exists("g:netrw_cygwin") if has("win32") || has("win95") || has("win64") || has("win16") if &shell =~ '\%(\\|\\)\%(\.exe\)\=$' @@ -109,6 +112,7 @@ fun! tar#Browse(tarfile) " sanity checks if !executable(g:tar_cmd) redraw! +" call Decho('***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system') echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' let &report= repkeep " call Dret("tar#Browse") @@ -119,6 +123,7 @@ fun! tar#Browse(tarfile) if a:tarfile !~# '^\a\+://' " if it's an url, don't complain, let url-handlers such as vim do its thing redraw! +" call Decho("***error*** (tar#Browse) File not readable<".a:tarfile.">") echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None endif let &report= repkeep @@ -152,12 +157,29 @@ fun! tar#Browse(tarfile) " assuming cygwin let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif - let curlast= line("$") - if tarfile =~# '\.\(gz\|tgz\)$' - let gzip_command = s:get_gzip_command(tarfile) + + if tarfile =~# '\.\(gz\)$' " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + + elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' || tarfile =~# '\.\(tzs\)$' + if has("unix") && executable("file") + let filekind= system("file ".shellescape(tarfile,1)) =~ "bzip2" + else + let filekind= "" + endif + + if filekind =~ "bzip2" + exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif filekind =~ "XZ" + exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif filekind =~ "Zstandard" + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + else + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + endif + elseif tarfile =~# '\.lrp' " call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " @@ -170,6 +192,8 @@ fun! tar#Browse(tarfile) elseif tarfile =~# '\.\(xz\|txz\)$' " call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.\(zst\|tzs\)$' + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -184,7 +208,7 @@ fun! tar#Browse(tarfile) " call Dret("tar#Browse : a:tarfile<".a:tarfile.">") return endif - if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)') + if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~# '\c\%(warning\|error\|inappropriate\|unrecognized\)') redraw! echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None keepj sil! %d @@ -197,8 +221,13 @@ fun! tar#Browse(tarfile) return endif + " set up maps supported for tar setlocal noma nomod ro - noremap :call TarBrowseSelect() + noremap :call TarBrowseSelect() + noremap x :call tar#Extract() + if &mouse != "" + noremap :call TarBrowseSelect() + endif let &report= repkeep " call Dret("tar#Browse : b:tarfile<".b:tarfile.">") @@ -235,7 +264,8 @@ fun! s:TarBrowseSelect() let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif - new + " open a new window (tar#Read will read a file into it) + noswapfile new if !exists("g:tar_nomax") || g:tar_nomax == 0 wincmd _ endif @@ -267,7 +297,7 @@ fun! tar#Read(fname,mode) if fname =~ '\.bz2$' && executable("bzcat") let decmp= "|bzcat" let doro = 1 - elseif fname =~ '\.gz$' && executable("zcat") + elseif fname =~ '\.t\=gz$' && executable("zcat") let decmp= "|zcat" let doro = 1 elseif fname =~ '\.lzma$' && executable("lzcat") @@ -276,6 +306,9 @@ fun! tar#Read(fname,mode) elseif fname =~ '\.xz$' && executable("xzcat") let decmp= "|xzcat" let doro = 1 + elseif fname =~ '\.zst$' && executable("zstdcat") + let decmp= "|zstdcat" + let doro = 1 else let decmp="" let doro = 0 @@ -291,20 +324,31 @@ fun! tar#Read(fname,mode) endif if tarfile =~# '\.bz2$' -" call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - elseif tarfile =~# '\.\(gz\|tgz\)$' - let gzip_command = s:get_gzip_command(tarfile) -" call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) - exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif tarfile =~# '\.\(gz\)$' + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + + elseif tarfile =~# '\(\.tgz\|\.tbz\|\.txz\)' + if has("unix") && executable("file") + let filekind= system("file ".shellescape(tarfile,1)) + else + let filekind= "" + endif + if filekind =~ "bzip2" + exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif filekind =~ "XZ" + exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif filekind =~ "Zstandard" + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + else + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + endif + elseif tarfile =~# '\.lrp$' -" call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lzma$' -" call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.\(xz\|txz\)$' -" call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp else if tarfile =~ '^\s*-' @@ -348,13 +392,14 @@ fun! tar#Write(fname) " sanity checks if !executable(g:tar_cmd) redraw! - echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' +" call Decho('***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system') let &report= repkeep " call Dret("tar#Write") return endif if !exists("*mkdir") redraw! +" call Decho("***error*** (tar#Write) sorry, mkdir() doesn't work on your system") echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None let &report= repkeep " call Dret("tar#Write") @@ -375,6 +420,7 @@ fun! tar#Write(fname) exe "cd ".fnameescape(tmpdir) catch /^Vim\%((\a\+)\)\=:E344/ redraw! +" call Decho("***error*** (tar#Write) cannot cd to temporary directory") echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None let &report= repkeep " call Dret("tar#Write") @@ -393,8 +439,6 @@ fun! tar#Write(fname) let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','') - let gzip_command = s:get_gzip_command(tarfile) - " handle compressed archives if tarfile =~# '\.bz2' call system("bzip2 -d -- ".shellescape(tarfile,0)) @@ -402,12 +446,12 @@ fun! tar#Write(fname) let compress= "bzip2 -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") elseif tarfile =~# '\.gz' - call system(gzip_command . " -d -- ".shellescape(tarfile,0)) + call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.gz','','e') let compress= "gzip -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") elseif tarfile =~# '\.tgz' - call system(gzip_command . " -d -- ".shellescape(tarfile,0)) + call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.tgz','.tar','e') let compress= "gzip -- ".shellescape(tarfile,0) let tgz = 1 @@ -417,6 +461,10 @@ fun! tar#Write(fname) let tarfile = substitute(tarfile,'\.xz','','e') let compress= "xz -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") + elseif tarfile =~# '\.zst' + call system("zstd --decompress -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.zst','','e') + let compress= "zstd -- ".shellescape(tarfile,0) elseif tarfile =~# '\.lzma' call system("lzma -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.lzma','','e') @@ -427,6 +475,7 @@ fun! tar#Write(fname) if v:shell_error != 0 redraw! +" call Decho("***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname) echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None else @@ -459,10 +508,11 @@ fun! tar#Write(fname) endif " delete old file from tarfile -" call Decho("system(".g:tar_cmd." --delete -f ".shellescape(tarfile,0)." -- ".shellescape(fname,0).")") - call system(g:tar_cmd." --delete -f ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) +" call Decho("system(".g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0)." -- ".shellescape(fname,0).")") + call system(g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) if v:shell_error != 0 redraw! +" call Decho("***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname)) echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None else @@ -471,6 +521,7 @@ fun! tar#Write(fname) call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) if v:shell_error != 0 redraw! +" call Decho("***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname)) echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None elseif exists("compress") " call Decho("call system(".compress.")") @@ -486,11 +537,11 @@ fun! tar#Write(fname) if s:tblfile_{winnr()} =~ '^\a\+://' " call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">") let tblfile= s:tblfile_{winnr()} - 1split|enew + 1split|noswapfile enew let binkeep= &l:binary let eikeep = &ei set binary ei=all - exe "e! ".fnameescape(tarfile) + exe "noswapfile e! ".fnameescape(tarfile) call netrw#NetWrite(tblfile) let &ei = eikeep let &l:binary = binkeep @@ -524,7 +575,7 @@ fun! tar#Diff(userfname,fname) " sets up b:tardiff_otherbuf variables so each buffer knows about the other (for closing purposes) diffthis wincmd v - exe "e ".fnameescape(fname) + exe "noswapfile e ".fnameescape(fname) diffthis else redraw! @@ -533,6 +584,141 @@ fun! tar#Diff(userfname,fname) " call Dret("tar#Diff") endfun +" --------------------------------------------------------------------- +" tar#Extract: extract a file from a (possibly compressed) tar archive {{{2 +fun! tar#Extract() +" call Dfunc("tar#Extract()") + + let repkeep= &report + set report=10 + let fname= getline(".") +" call Decho("fname<".fname.">") + + if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-' + redraw! + echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"' +" call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"') + return + endif + + " sanity check + if fname =~ '^"' + let &report= repkeep +" call Dret("TarBrowseSelect") + return + endif + + let tarball = expand("%") +" call Decho("tarball<".tarball.">") + let tarbase = substitute(tarball,'\..*$','','') +" call Decho("tarbase<".tarbase.">") + + let extractcmd= netrw#WinPath(g:tar_extractcmd) + if filereadable(tarbase.".tar") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tar ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tgz") + let extractcmd= substitute(extractcmd,"-","-z","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tgz ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tgz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tgz ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd."t ".tarbase.".tgz ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tar.gz") + let extractcmd= substitute(extractcmd,"-","-z","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.gz ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tar.gz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.gz ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tar.gz ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tbz") + let extractcmd= substitute(extractcmd,"-","-j","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tbz ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tbz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tbz ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd."j ".tarbase.".tbz ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tar.bz2") + let extractcmd= substitute(extractcmd,"-","-j","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.bz2 ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tar.bz2 ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tar.bz2 ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd."j ".tarbase.".tar.bz2 ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".txz") + let extractcmd= substitute(extractcmd,"-","-J","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".txz ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".txz ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tar.xz") + let extractcmd= substitute(extractcmd,"-","-J","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.xz ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tar.xz ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tzs") + let extractcmd= substitute(extractcmd,"-","--zstd","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tzs ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tzs ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tzs ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tar.zst") + let extractcmd= substitute(extractcmd,"-","--zstd","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.zst ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + endif + + " restore option + let &report= repkeep + +" call Dret("tar#Extract") +endfun + " --------------------------------------------------------------------- " s:Rmdir: {{{2 fun! s:Rmdir(fname) @@ -587,15 +773,12 @@ fun! tar#Vimuntar(...) " if necessary, decompress the tarball; then, extract it if tartail =~ '\.tgz' - let gzip_command = s:get_gzip_command(tarfile) - if executable(gzip_command) - silent exe "!" . gzip_command . " -d ".shellescape(tartail) - elseif executable("gunzip") + if executable("gunzip") silent exe "!gunzip ".shellescape(tartail) elseif executable("gzip") silent exe "!gzip -d ".shellescape(tartail) else - echoerr "unable to decompress<".tartail."> on this sytem" + echoerr "unable to decompress<".tartail."> on this system" if simplify(curdir) != simplify(tarhome) " remove decompressed tarball, restore directory " call Decho("delete(".tartail.".tar)") @@ -628,28 +811,6 @@ fun! tar#Vimuntar(...) " call Dret("tar#Vimuntar") endfun -func s:get_gzip_command(file) - " Try using the "file" command to get the actual compression type, since - " there is no standard way for the naming: ".tgz", ".tbz", ".txz", etc. - " If the "file" command doesn't work fall back to just using the file name. - if a:file =~# 'z$' - let filetype = system('file ' . a:file) - if filetype =~ 'bzip2 compressed' && executable('bzip2') - return 'bzip2' - endif - if filetype =~ 'XZ compressed' && executable('xz') - return 'xz' - endif - endif - if a:file =~# 'bz2$' - return 'bzip2' - endif - if a:file =~# 'xz$' - return 'xz' - endif - return 'gzip' -endfunc - " ===================================================================== " Modelines And Restoration: {{{1 let &cpo= s:keepcpo diff --git a/runtime/autoload/tohtml.vim b/runtime/autoload/tohtml.vim index 2d874c690da6d..799cf0e582bbc 100644 --- a/runtime/autoload/tohtml.vim +++ b/runtime/autoload/tohtml.vim @@ -1,6 +1,6 @@ " Vim autoload file for the tohtml plugin. " Maintainer: Ben Fritz -" Last Change: 2018 Nov 11 +" Last Change: 2019 Aug 16 " " Additional contributors: " @@ -364,6 +364,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ let body_line = '' let html = [] + let s:html5 = 0 if s:settings.use_xhtml call add(html, xml_line) endif @@ -371,8 +372,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ call add(html, "") call add(html, '') elseif s:settings.use_css && !s:settings.no_pre - call add(html, "") + call add(html, "") call add(html, '') + let s:html5 = 1 else call add(html, '') @@ -383,7 +385,11 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " include encoding as close to the top as possible, but only if not already " contained in XML information if s:settings.encoding != "" && !s:settings.use_xhtml - call add(html, "diff') @@ -392,6 +398,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ call add(html, '') let body_line_num = len(html) - if !empty(s:settings.prevent_copy) - call add(html, "") - call add(html, "") - call add(html, "

0
") - call add(html, "
") - call add(html, "
") - else - call add(html, '') - endif - call add(html, "") + call add(html, '') + call add(html, "
") call add(html, '') for buf in a:win_list @@ -443,7 +442,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " Grab the style information. Some of this will be duplicated so only insert " it if it's not already there. {{{ 1 - let style_start = search('^') if style_start > 0 && style_end > 0 @@ -481,7 +480,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " TODO: restore using grabbed lines if undolevel is 1? normal! 2u if s:settings.use_css - call add(html, '
') + call add(html, '
') elseif s:settings.use_xhtml call add(html, '
') else @@ -515,7 +514,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ let name = substitute(name, '\d*\.x\?html$', '', '') . i . '.' . fnamemodify(copy(name), ":t:e") let i += 1 endwhile + + let s:ei_sav = &eventignore + set eventignore+=FileType exe "topleft new " . name + let &eventignore=s:ei_sav + unlet s:ei_sav + setlocal modifiable " just in case some user autocmd creates content in the new buffer, make sure @@ -544,7 +549,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " add required javascript in reverse order so we can just call append again " and again without adjusting {{{ - let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy) + let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids " insert script closing tag if needed if s:uses_script @@ -555,31 +560,6 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ \ ]) endif - " insert script which corrects the size of small input elements in - " prevent_copy mode. See 2html.vim for details on why this is needed and how - " it works. - if !empty(s:settings.prevent_copy) - call append(style_start, [ - \ '', - \ '/* simulate a "ch" unit by asking the browser how big a zero character is */', - \ 'function FixCharWidth() {', - \ ' /* get the hidden element which gives the width of a single character */', - \ ' var goodWidth = document.getElementById("oneCharWidth").clientWidth;', - \ ' /* get all input elements, we''ll filter on class later */', - \ ' var inputTags = document.getElementsByTagName("input");', - \ ' var ratio = 5;', - \ ' var inputWidth = document.getElementById("oneInputWidth").clientWidth;', - \ ' var emWidth = document.getElementById("oneEmWidth").clientWidth;', - \ ' if (inputWidth > goodWidth) {', - \ ' while (ratio < 100*goodWidth/emWidth && ratio < 100) {', - \ ' ratio += 5;', - \ ' }', - \ ' document.getElementById("vimCodeElement'.s:settings.id_suffix.'").className = "em"+ratio;', - \ ' }', - \ '}' - \ ]) - endif - " insert javascript to get IDs from line numbers, and to open a fold before " jumping to any lines contained therein if s:settings.line_ids @@ -659,10 +639,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ endif if s:uses_script - " insert script tag; javascript is always needed for the line number - " normalization for URL hashes + " insert script tag if needed call append(style_start, [ - \ "
text @@ -23,4 +33,45 @@ bar"> text
+
+
+dd text +
+
+dt text +
+
+
+text +
+ + + + " END_INDENT + +% START_INDENT +% INDENT_EXE let g:html_indent_style1 = "inc" +% INDENT_EXE let g:html_indent_script1 = "zero" +% INDENT_EXE let g:html_indent_attribute = 1 +% INDENT_EXE call HtmlIndent_CheckUserSettings() + + + + +
+text +
+ + +% END_INDENT diff --git a/runtime/indent/testdir/html.ok b/runtime/indent/testdir/html.ok index ad819333ccbc3..938e965d8cc5b 100644 --- a/runtime/indent/testdir/html.ok +++ b/runtime/indent/testdir/html.ok @@ -1,26 +1,77 @@ -" vim: set ft=html sw=4 : +" vim: set ft=html sw=4 ts=8 : " START_INDENT -
-
- text -
-
- -
- text -
- -
- text -
- -
- text -
+ + + + +
+
+ text +
+
+ +
+ text +
+ +
+ text +
+ +
+ text +
+ +
+
+ dd text +
+
+ dt text +
+
+
+ text +
+ + + " END_INDENT + +% START_INDENT +% INDENT_EXE let g:html_indent_style1 = "inc" +% INDENT_EXE let g:html_indent_script1 = "zero" +% INDENT_EXE let g:html_indent_attribute = 1 +% INDENT_EXE call HtmlIndent_CheckUserSettings() + + + + +
+ text +
+ + +% END_INDENT diff --git a/runtime/indent/testdir/krl.in b/runtime/indent/testdir/krl.in new file mode 100644 index 0000000000000..ec90feb08b45c --- /dev/null +++ b/runtime/indent/testdir/krl.in @@ -0,0 +1,148 @@ +; vim: set ft=krl : + +; START_INDENT + +def One() +int i +If i==1 then +While i>=1 +For i=1 to 5 step 2 +Loop +i = i+1 +EndLoop +EndFor +EndWhile +Else +Repeat +Switch i +Case 1 +Skip 123 +i = i+1 +EndSkip 123 +Spline with $acc=100, $vel.cp=3 +slin {x 100} +scirc {x 110, y 110}, {x 120, y 90} +slin {x 200} c_dis +Time_Block Start +slin {x 300} c_dis +Time_Block Part = 22.2 +slin {y 400} c_dis +Time_Block Part = 33.3 +Time_Block End = 10 +slin {y 200} c_dis +Const_Vel Start +100 OnStart +slin {y 300} c_dis +slin {x 100} +Const_Vel End -5.5 +slin {y 200} c_dis +EndSpline +Case 2,3 +PTP_Spline with $acc=100, $vel.ptp=100 +sptp {a1 0} c_ptp +sptp {a1 90} +EndSpline c_spl +Default +i = i+1 +EndSwitch +Continue +Until False +EndIf +end + +DEF Two() +int i +END + +global def Three() +int i +end + +GLOBAL DEF Four() +int i +END + +Global Def Five() +int i +End + +deffct bool fOne() +int i +endfct + +DEFFCT bool fTwo() +int i +ENDFCT + +global deffct bool fThree() +int i +endfct + +GLOBAL DEFFCT bool fFour() +int i +ENDFCT + +Global DefFct bool fFive() +int i +EndFct + +DefDat datfile() +global int i=1 +; don't indent column 1 comments unless g:krlCommentIndent is set +; global int o=2 +EndDat + +; END_INDENT + +; START_INDENT +; INDENT_EXE let g:krlSpaceIndent = 0 +; INDENT_EXE set shiftwidth=4 + +def bla() +int i +end + +; END_INDENT + +; START_INDENT +; INDENT_EXE let g:krlCommentIndent = 1 +def bla() +; indent this first column comment because of g:krlCommentIndent=1 +end +; END_INDENT + +; START_INDENT +; INDENT_EXE let g:krlIndentBetweenDef = 0 +def bla() +int i ; don't indent this line because of g:krlIndentBetweenDef=0 +end +; END_INDENT + +; START_INDENT +; INDENT_AT this-line +def Some() +int f +if true then +f = 1 ; this-line +endif +end +; END_INDENT + +; START_INDENT +; INDENT_NEXT next-line +def Some() + int i + ; next-line +i = 1 ; should get indent of line 'int i' above +end +; END_INDENT + +; START_INDENT +; INDENT_PREV prev-line +def Some() +int f +if true then +f = 1 +; prev-line +endif +end +; END_INDENT diff --git a/runtime/indent/testdir/krl.ok b/runtime/indent/testdir/krl.ok new file mode 100644 index 0000000000000..34dc0f57b11a8 --- /dev/null +++ b/runtime/indent/testdir/krl.ok @@ -0,0 +1,148 @@ +; vim: set ft=krl : + +; START_INDENT + +def One() + int i + If i==1 then + While i>=1 + For i=1 to 5 step 2 + Loop + i = i+1 + EndLoop + EndFor + EndWhile + Else + Repeat + Switch i + Case 1 + Skip 123 + i = i+1 + EndSkip 123 + Spline with $acc=100, $vel.cp=3 + slin {x 100} + scirc {x 110, y 110}, {x 120, y 90} + slin {x 200} c_dis + Time_Block Start + slin {x 300} c_dis + Time_Block Part = 22.2 + slin {y 400} c_dis + Time_Block Part = 33.3 + Time_Block End = 10 + slin {y 200} c_dis + Const_Vel Start +100 OnStart + slin {y 300} c_dis + slin {x 100} + Const_Vel End -5.5 + slin {y 200} c_dis + EndSpline + Case 2,3 + PTP_Spline with $acc=100, $vel.ptp=100 + sptp {a1 0} c_ptp + sptp {a1 90} + EndSpline c_spl + Default + i = i+1 + EndSwitch + Continue + Until False + EndIf +end + +DEF Two() + int i +END + +global def Three() + int i +end + +GLOBAL DEF Four() + int i +END + +Global Def Five() + int i +End + +deffct bool fOne() + int i +endfct + +DEFFCT bool fTwo() + int i +ENDFCT + +global deffct bool fThree() + int i +endfct + +GLOBAL DEFFCT bool fFour() + int i +ENDFCT + +Global DefFct bool fFive() + int i +EndFct + +DefDat datfile() + global int i=1 +; don't indent column 1 comments unless g:krlCommentIndent is set +; global int o=2 +EndDat + +; END_INDENT + +; START_INDENT +; INDENT_EXE let g:krlSpaceIndent = 0 +; INDENT_EXE set shiftwidth=4 + +def bla() + int i +end + +; END_INDENT + +; START_INDENT +; INDENT_EXE let g:krlCommentIndent = 1 +def bla() + ; indent this first column comment because of g:krlCommentIndent=1 +end +; END_INDENT + +; START_INDENT +; INDENT_EXE let g:krlIndentBetweenDef = 0 +def bla() +int i ; don't indent this line because of g:krlIndentBetweenDef=0 +end +; END_INDENT + +; START_INDENT +; INDENT_AT this-line +def Some() +int f +if true then + f = 1 ; this-line +endif +end +; END_INDENT + +; START_INDENT +; INDENT_NEXT next-line +def Some() + int i + ; next-line + i = 1 ; should get indent of line 'int i' above +end +; END_INDENT + +; START_INDENT +; INDENT_PREV prev-line +def Some() +int f +if true then + f = 1 +; prev-line +endif +end +; END_INDENT diff --git a/runtime/indent/testdir/matlab.in b/runtime/indent/testdir/matlab.in index 5bba1a56ddfd1..b997ec8d5709a 100644 --- a/runtime/indent/testdir/matlab.in +++ b/runtime/indent/testdir/matlab.in @@ -37,6 +37,7 @@ end % START_INDENT if true A(1:end - 1) +C{1:end - 1} disp foo end % END_INDENT @@ -49,6 +50,14 @@ disp foo disp bar % END_INDENT +% START_INDENT +if true +% end +%% end +disp foo +end +% END_INDENT + % START_INDENT % INDENT_EXE let b:MATLAB_function_indent = 0 function foo diff --git a/runtime/indent/testdir/matlab.ok b/runtime/indent/testdir/matlab.ok index b1112263b2067..df4e7b2e33971 100644 --- a/runtime/indent/testdir/matlab.ok +++ b/runtime/indent/testdir/matlab.ok @@ -37,6 +37,7 @@ end % START_INDENT if true A(1:end - 1) + C{1:end - 1} disp foo end % END_INDENT @@ -49,6 +50,14 @@ A = [{ disp bar % END_INDENT +% START_INDENT +if true + % end + %% end + disp foo +end +% END_INDENT + % START_INDENT % INDENT_EXE let b:MATLAB_function_indent = 0 function foo diff --git a/runtime/indent/testdir/runtest.vim b/runtime/indent/testdir/runtest.vim index 9502c42f3e828..6bbd33cacdb55 100644 --- a/runtime/indent/testdir/runtest.vim +++ b/runtime/indent/testdir/runtest.vim @@ -10,6 +10,7 @@ filetype indent on syn on set nowrapscan set report=9999 +set modeline au! SwapExists * call HandleSwapExists() func HandleSwapExists() @@ -116,6 +117,7 @@ for fname in glob('testdir/*.in', 1, 1) echoerr 'Test ' . fname . ' FAILED!' else exe 'write ' . root . '.out' + echo "Test " . fname . " OK\n" endif quit! " close the indented file diff --git a/runtime/indent/testdir/sshconfig.in b/runtime/indent/testdir/sshconfig.in new file mode 100644 index 0000000000000..87b998e4653c1 --- /dev/null +++ b/runtime/indent/testdir/sshconfig.in @@ -0,0 +1,53 @@ +# vim: set filetype=sshconfig shiftwidth=4 expandtab : + +# START_INDENT +Host myhost +User myuser +PasswordAuthentication no +# END_INDENT + +# START_INDENT +Host aaa +User bbb +Host ccc +Host ddd +# END_INDENT + +# START_INDENT +host aaa +HOST bbb +hoSt ccc +match ddd +MATCH eee +MatCH fff +# END_INDENT + +# START_INDENT +Host aaa +User host +PasswordAuthentication no +Host * +User user +PasswordAuthentication no +Host match +User bbb +# END_INDENT + +# START_INDENT +Host tab +User myuser +# END_INDENT + +# START_INDENT +Host mix +User myuser +# END_INDENT + +# START_INDENT +Host aaa +User bbb +Match ccc +User ddd +HostKeyAlgorithms ssh-ed25519 +Match eee +# END_INDENT diff --git a/runtime/indent/testdir/sshconfig.ok b/runtime/indent/testdir/sshconfig.ok new file mode 100644 index 0000000000000..b24b7cf4e1fe4 --- /dev/null +++ b/runtime/indent/testdir/sshconfig.ok @@ -0,0 +1,53 @@ +# vim: set filetype=sshconfig shiftwidth=4 expandtab : + +# START_INDENT +Host myhost + User myuser + PasswordAuthentication no +# END_INDENT + +# START_INDENT +Host aaa + User bbb +Host ccc +Host ddd +# END_INDENT + +# START_INDENT +host aaa +HOST bbb +hoSt ccc +match ddd +MATCH eee +MatCH fff +# END_INDENT + +# START_INDENT +Host aaa + User host + PasswordAuthentication no +Host * + User user + PasswordAuthentication no +Host match + User bbb +# END_INDENT + +# START_INDENT +Host tab + User myuser +# END_INDENT + +# START_INDENT +Host mix + User myuser +# END_INDENT + +# START_INDENT +Host aaa + User bbb +Match ccc + User ddd + HostKeyAlgorithms ssh-ed25519 +Match eee +# END_INDENT diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in index ca105f6eda72a..873045bc2c752 100644 --- a/runtime/indent/testdir/vim.in +++ b/runtime/indent/testdir/vim.in @@ -10,6 +10,32 @@ let cmd = \ 'some ' \ 'string' +if 1 +let x = [ +\ ] +endif + +" TODO: add searchpair() to find matching { +"for x in [ +"{ +"key: 'value' +"}, +"] +"eval 0 +"endfor + +for x in [ +{key: 'value'}, +] +eval 0 +endfor + +let t = [ +\ { +\ 'k': 'val', +\ }, +\ ] + " END_INDENT " START_INDENT @@ -21,8 +47,27 @@ let cmd = " END_INDENT +" START_INDENT +" INDENT_EXE let g:vim_indent_cont = 5 + +let list = [ +\ 'one', +\ 'two'] + +" END_INDENT + " START_INDENT " INDENT_EXE unlet g:vim_indent_cont + +let list = [ +'one', +'two', +] +echo + +" END_INDENT + +" START_INDENT " INDENT_AT this-line func Some() let f = x " this-line @@ -44,3 +89,18 @@ let f = x " prev-line endfunc " END_INDENT + +" START_INDENT +let a =<< END +nothing +END +" END_INDENT + +" START_INDENT +" INDENT_AT this-line +let a=<< trim END + blah + blah + blah this-line +END +" END_INDENT diff --git a/runtime/indent/testdir/vim.ok b/runtime/indent/testdir/vim.ok index 542861ec9c95f..8e70abe619392 100644 --- a/runtime/indent/testdir/vim.ok +++ b/runtime/indent/testdir/vim.ok @@ -10,6 +10,32 @@ let cmd = \ 'some ' \ 'string' +if 1 + let x = [ + \ ] +endif + +" TODO: add searchpair() to find matching { +"for x in [ +"{ +"key: 'value' +"}, +"] +"eval 0 +"endfor + +for x in [ + {key: 'value'}, + ] + eval 0 +endfor + +let t = [ + \ { + \ 'k': 'val', + \ }, + \ ] + " END_INDENT " START_INDENT @@ -21,8 +47,27 @@ let cmd = " END_INDENT +" START_INDENT +" INDENT_EXE let g:vim_indent_cont = 5 + +let list = [ + \ 'one', + \ 'two'] + +" END_INDENT + " START_INDENT " INDENT_EXE unlet g:vim_indent_cont + +let list = [ + 'one', + 'two', + ] +echo + +" END_INDENT + +" START_INDENT " INDENT_AT this-line func Some() let f = x " this-line @@ -44,3 +89,18 @@ func Some() " prev-line endfunc " END_INDENT + +" START_INDENT +let a =<< END + nothing +END +" END_INDENT + +" START_INDENT +" INDENT_AT this-line +let a=<< trim END + blah + blah + blah this-line +END +" END_INDENT diff --git a/runtime/indent/testdir/xml.in b/runtime/indent/testdir/xml.in index b6333340e2ac1..88ad51e484177 100644 --- a/runtime/indent/testdir/xml.in +++ b/runtime/indent/testdir/xml.in @@ -15,7 +15,7 @@ text comment +end comment --> diff --git a/runtime/indent/testdir/xml.ok b/runtime/indent/testdir/xml.ok index cfdf701c11813..d5e2289cb3292 100644 --- a/runtime/indent/testdir/xml.ok +++ b/runtime/indent/testdir/xml.ok @@ -15,7 +15,7 @@ + end comment --> diff --git a/runtime/indent/testdir/yaml.in b/runtime/indent/testdir/yaml.in index e3d77e2543a53..bf99668da294a 100644 --- a/runtime/indent/testdir/yaml.in +++ b/runtime/indent/testdir/yaml.in @@ -12,3 +12,9 @@ map2: map: &anchor map: val # END_INDENT + +# START_INDENT +map: | +line1 +line2 +# END_INDENT diff --git a/runtime/indent/testdir/yaml.ok b/runtime/indent/testdir/yaml.ok index b97b2e58961b2..8b38633e71488 100644 --- a/runtime/indent/testdir/yaml.ok +++ b/runtime/indent/testdir/yaml.ok @@ -12,3 +12,9 @@ map2: map: &anchor map: val # END_INDENT + +# START_INDENT +map: | + line1 + line2 +# END_INDENT diff --git a/runtime/indent/tex.vim b/runtime/indent/tex.vim index a748cfbb408f8..d356ba905bc14 100644 --- a/runtime/indent/tex.vim +++ b/runtime/indent/tex.vim @@ -64,14 +64,17 @@ " style) is supported. Thanks Miles Wheeler for reporting. " 2018/02/07 by Yichao Zhou " (*) Make indentation more smart in the normal mode +" 2020/04/26 by Yichao Zhou +" (*) Fix a bug related to \[ & \]. Thanks Manuel Boni for +" reporting. " " }}} " Document: {{{ " -" To set the following options (ok, currently it's just one), add a line like -" let g:tex_indent_items = 1 -" to your ~/.vimrc. +" For proper latex experience, please put +" let g:tex_flavor = "latex" +" into your vimrc. " " * g:tex_indent_brace " @@ -184,13 +187,18 @@ function! GetTeXIndent() " {{{ let line = substitute(getline(lnum), '\s*%.*', '','g') " last line let cline = substitute(getline(v:lnum), '\s*%.*', '', 'g') " current line + let ccol = 1 + while cline[ccol] =~ '\s' + let ccol += 1 + endwhile + " We are in verbatim, so do what our user what. - if synIDattr(synID(v:lnum, indent(v:lnum), 1), "name") == "texZone" + if synIDattr(synID(v:lnum, ccol, 1), "name") == "texZone" if empty(cline) return indent(lnum) else return indent(v:lnum) - end + endif endif if lnum == 0 @@ -253,13 +261,13 @@ function! GetTeXIndent() " {{{ let stay = 0 endif - if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum)) + if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, ccol) let ind -= shiftwidth() let stay = 0 endif if line !~ '^\s*\\\?[\]}]' - for i in range(indent(lnum)+1, strlen(line)-1) + for i in range(1, strlen(line)-1) let char = line[i] if char == ']' || char == '}' if s:CheckPairedIsLastCharacter(lnum, i) @@ -280,7 +288,7 @@ function! GetTeXIndent() " {{{ let ind = ind - shiftwidth() let stay = 0 endif - " lines following to '\item' are intented once again: + " lines following to '\item' are indented once again: if line =~ g:tex_items let ind = ind + shiftwidth() let stay = 0 diff --git a/runtime/indent/tf.vim b/runtime/indent/tf.vim index a98053850611b..bb40bf6f01c0d 100644 --- a/runtime/indent/tf.vim +++ b/runtime/indent/tf.vim @@ -2,7 +2,7 @@ " Language: tf (TinyFugue) " Maintainer: Christian J. Robinson " URL: http://www.vim.org/scripts/script.php?script_id=174 -" Last Change: 2017 Feb 25 +" Last Change: 2022 Apr 25 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -14,6 +14,8 @@ setlocal indentexpr=GetTFIndent() setlocal indentkeys-=0{,0} indentkeys-=0# indentkeys-=: setlocal indentkeys+==/endif,=/then,=/else,=/done,0; +let b:undo_indent = "setlocal indentexpr< indentkeys<" + " Only define the function once: if exists("*GetTFIndent") finish diff --git a/runtime/indent/tilde.vim b/runtime/indent/tilde.vim index 13082c86925b2..8658035f7235c 100644 --- a/runtime/indent/tilde.vim +++ b/runtime/indent/tilde.vim @@ -1,7 +1,8 @@ "Description: Indent scheme for the tilde weblanguage -"Author: Tobias RundstrīŋŊm +"Author: Tobias RundstrÃļm (Invalid email address) "URL: http://tilde.tildesoftware.net "Last Change: May 8 09:15:09 CEST 2002 +" 2022 April: b:undo_indent added by Doug Kearns if exists ("b:did_indent") finish @@ -13,6 +14,8 @@ setlocal autoindent setlocal indentexpr=GetTildeIndent(v:lnum) setlocal indentkeys=o,O,) +let b:undo_indent = "setl ai< inde< indk<" + if exists("*GetTildeIndent") finish endif diff --git a/runtime/indent/treetop.vim b/runtime/indent/treetop.vim index 2c6eecf5c4731..6c39c69687028 100644 --- a/runtime/indent/treetop.vim +++ b/runtime/indent/treetop.vim @@ -1,7 +1,8 @@ " Vim indent file -" Language: Treetop -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2011-03-14 +" Language: Treetop +" Maintainer: Doug Kearns +" Previous Maintainer: Nikolai Weibull +" Last Change: 2022 April 25 if exists("b:did_indent") finish @@ -12,6 +13,8 @@ setlocal indentexpr=GetTreetopIndent() setlocal indentkeys=0{,0},!^F,o,O,=end setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetTreetopIndent") finish endif @@ -34,5 +37,5 @@ function GetTreetopIndent() let ind -= shiftwidth() end - retur ind + return ind endfunction diff --git a/runtime/indent/typescript.vim b/runtime/indent/typescript.vim index b6b2cb5acf3a4..e899f83d0f3a9 100644 --- a/runtime/indent/typescript.vim +++ b/runtime/indent/typescript.vim @@ -460,7 +460,7 @@ function! Fixedgq(lnum, count) return 1 endif - " Put all the lines on one line and do normal spliting after that + " Put all the lines on one line and do normal splitting after that if l:count > 1 while l:count > 1 let l:count -= 1 diff --git a/runtime/indent/verilog.vim b/runtime/indent/verilog.vim index ab3d0ba3e04bc..e81197c3b41e4 100644 --- a/runtime/indent/verilog.vim +++ b/runtime/indent/verilog.vim @@ -76,7 +76,7 @@ function GetVerilogIndent() let vverb = 0 endif - " Indent accoding to last line + " Indent according to last line " End of multiple-line comment if last_line =~ '\*/\s*$' && last_line !~ '/\*.\{-}\*/' let ind = ind - offset_comment1 @@ -219,7 +219,7 @@ function GetVerilogIndent() endif - " Return the indention + " Return the indentation return ind endfunction diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index cd735c3a3c89b..8a2502a275ded 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar -" Last Change: 2016 Jun 27 +" Last Change: 2022 Jun 24 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -10,7 +10,9 @@ endif let b:did_indent = 1 setlocal indentexpr=GetVimIndent() -setlocal indentkeys+==end,=else,=cat,=fina,=END,0\\,0=\"\\\ +setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=},=else,=cat,=finall,=END,0\\,0=\"\\\ +setlocal indentkeys-=0# +setlocal indentkeys-=: let b:undo_indent = "setl indentkeys< indentexpr<" @@ -34,13 +36,23 @@ endfunc let s:lineContPat = '^\s*\(\\\|"\\ \)' function GetVimIndentIntern() + " If the current line has line continuation and the previous one too, use + " the same indent. This does not skip empty lines. + let cur_text = getline(v:lnum) + let cur_has_linecont = cur_text =~ s:lineContPat + if cur_has_linecont && v:lnum > 1 && getline(v:lnum - 1) =~ s:lineContPat + return indent(v:lnum - 1) + endif + " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) + " The previous line, ignoring line continuation + let prev_text_end = lnum > 0 ? getline(lnum) : '' + " If the current line doesn't start with '\' or '"\ ' and below a line that " starts with '\' or '"\ ', use the indent of the line above it. - let cur_text = getline(v:lnum) - if cur_text !~ s:lineContPat + if !cur_has_linecont while lnum > 0 && getline(lnum) =~ s:lineContPat let lnum = lnum - 1 endwhile @@ -50,13 +62,43 @@ function GetVimIndentIntern() if lnum == 0 return 0 endif + + " the start of the previous line, skipping over line continuation let prev_text = getline(lnum) + let found_cont = 0 " Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function " and :else. Add it three times for a line that starts with '\' or '"\ ' " after a line that doesn't (or g:vim_indent_cont if it exists). let ind = indent(lnum) + + " In heredoc indenting works completely differently. + if has('syntax_items') + let syn_here = synIDattr(synID(v:lnum, 1, 1), "name") + if syn_here =~ 'vimLetHereDocStop' + " End of heredoc: use indent of matching start line + let lnum = v:lnum - 1 + while lnum > 0 + let attr = synIDattr(synID(lnum, 1, 1), "name") + if attr != '' && attr !~ 'vimLetHereDoc' + return indent(lnum) + endif + let lnum -= 1 + endwhile + return 0 + endif + if syn_here =~ 'vimLetHereDoc' + if synIDattr(synID(lnum, 1, 1), "name") !~ 'vimLetHereDoc' + " First line in heredoc: increase indent + return ind + shiftwidth() + endif + " Heredoc continues: no change in indent + return ind + endif + endif + if cur_text =~ s:lineContPat && v:lnum > 1 && prev_text !~ s:lineContPat + let found_cont = 1 if exists("g:vim_indent_cont") let ind = ind + g:vim_indent_cont else @@ -66,12 +108,15 @@ function GetVimIndentIntern() let ind = ind + shiftwidth() else " A line starting with :au does not increment/decrement indent. - if prev_text !~ '^\s*au\%[tocmd]' - let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>') + " A { may start a block or a dict. Assume that when a } follows it's a + " terminated dict. + " ":function" starts a block but "function(" doesn't. + if prev_text !~ '^\s*au\%[tocmd]' && prev_text !~ '^\s*{.*}' + let i = match(prev_text, '\(^\||\)\s*\(export\s\+\)\?\({\|\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\|finall\%[y]\|def\|el\%[seif]\)\>\|fu\%[nction][! ]\)') if i >= 0 let ind += shiftwidth() if strpart(prev_text, i, 1) == '|' && has('syntax_items') - \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$' + \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\|PatSep\)$' let ind -= shiftwidth() endif endif @@ -88,13 +133,62 @@ function GetVimIndentIntern() endif endif + " For a line starting with "}" find the matching "{". If it is at the start + " of the line align with it, probably end of a block. + " Use the mapped "%" from matchit to find the match, otherwise we may match + " a { inside a comment or string. + if cur_text =~ '^\s*}' + if maparg('%') != '' + exe v:lnum + silent! normal % + if line('.') < v:lnum && getline('.') =~ '^\s*{' + let ind = indent('.') + endif + else + " todo: use searchpair() to find a match + endif + endif + + " Below a line starting with "}" find the matching "{". If it is at the + " end of the line we must be below the end of a dictionary. + if prev_text =~ '^\s*}' + if maparg('%') != '' + exe lnum + silent! normal % + if line('.') == lnum || getline('.') !~ '^\s*{' + let ind = ind - shiftwidth() + endif + else + " todo: use searchpair() to find a match + endif + endif - " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry, - " :endfun, :else and :augroup END. - if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s\+[eE][nN][dD]\)' + " Below a line starting with "]" we must be below the end of a list. + " Include a "}" and "},} in case a dictionary ends too. + if prev_text_end =~ '^\s*\(},\=\s*\)\=]' let ind = ind - shiftwidth() endif + let ends_in_comment = has('syntax_items') + \ && synIDattr(synID(lnum, len(getline(lnum)), 1), "name") =~ '\(Comment\|String\)$' + + " A line ending in "{" or "[" is most likely the start of a dict/list literal, + " indent the next line more. Not for a continuation line or {{{. + if !ends_in_comment && prev_text_end =~ '\s[{[]\s*$' && !found_cont + let ind = ind + shiftwidth() + endif + + " Subtract a 'shiftwidth' on a :endif, :endwhile, :endfor, :catch, :finally, + " :endtry, :endfun, :enddef, :else and :augroup END. + " Although ":en" would be enough only match short command names as in + " 'indentkeys'. + if cur_text =~ '^\s*\(endif\|endwh\|endfor\|endtry\|endfu\|enddef\|cat\|finall\|else\|aug\%[roup]\s\+[eE][nN][dD]\)' + let ind = ind - shiftwidth() + if ind < 0 + let ind = 0 + endif + endif + return ind endfunction diff --git a/runtime/indent/xf86conf.vim b/runtime/indent/xf86conf.vim index 5a8bc0fec1279..834eb00b25685 100644 --- a/runtime/indent/xf86conf.vim +++ b/runtime/indent/xf86conf.vim @@ -1,7 +1,8 @@ " Vim indent file -" Language: XFree86 Configuration File -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2006-12-20 +" Language: XFree86 Configuration File +" Maintainer: Doug Kearns +" Previous Maintainer: Nikolai Weibull +" Last Change: 2022 April 25 if exists("b:did_indent") finish @@ -12,6 +13,8 @@ setlocal indentexpr=GetXF86ConfIndent() setlocal indentkeys=!^F,o,O,=End setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetXF86ConfIndent") finish endif diff --git a/runtime/indent/xinetd.vim b/runtime/indent/xinetd.vim index 977ee3d33b965..21000b7bc4328 100644 --- a/runtime/indent/xinetd.vim +++ b/runtime/indent/xinetd.vim @@ -1,7 +1,8 @@ " Vim indent file -" Language: xinetd.conf(5) configuration file -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2006-12-20 +" Language: xinetd.conf(5) configuration file +" Maintainer: Doug Kearns +" Previous Maintainer: Nikolai Weibull +" Last Change: 2022 April 25 if exists("b:did_indent") finish @@ -12,6 +13,8 @@ setlocal indentexpr=GetXinetdIndent() setlocal indentkeys=0{,0},!^F,o,O setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetXinetdIndent") finish endif diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim index ce992c589aa1b..5bf53ad1f8f5d 100644 --- a/runtime/indent/xml.vim +++ b/runtime/indent/xml.vim @@ -2,8 +2,10 @@ " Maintainer: Christian Brabandt " Repository: https://github.com/chrisbra/vim-xml-ftplugin " Previous Maintainer: Johannes Zellner -" Last Changed: 2019 Oct 24 +" Last Changed: 2020 Nov 4th " Last Change: +" 20200529 - Handle empty closing tags correctly +" 20191202 - Handle docbk filetype " 20190726 - Correctly handle non-tagged data " 20190204 - correctly handle wrap tags " https://github.com/chrisbra/vim-xml-ftplugin/issues/5 @@ -37,6 +39,8 @@ setlocal indentkeys=o,O,*,<>>,<<>,/,{,},!^F " autoindent: used when the indentexpr returns -1 setlocal autoindent +let b:undo_indent = "setl ai< inde< indk<" + if !exists('b:xml_indent_open') let b:xml_indent_open = '.\{-}<[:A-Z_a-z]' " pre tag, e.g.
@@ -44,11 +48,15 @@ if !exists('b:xml_indent_open') endif if !exists('b:xml_indent_close') - let b:xml_indent_close = '.\{-}.\{-}' " end pre tag, e.g.
" let b:xml_indent_close = '.\{-}XmlIndentSum(line, style, add) - if IsXMLContinuation(a:line) && a:style == 0 + if IsXMLContinuation(a:line) && a:style == 0 && !IsXMLEmptyClosingTag(a:line) " no complete tag, add one additional indent level " but only for the current line return a:add + shiftwidth() @@ -130,13 +138,25 @@ fun! XmlIndentGet(lnum, use_syntax_check) endif let syn_name_end = synIDattr(synID(a:lnum, strlen(curline) - 1, 1), 'name') let syn_name_start = synIDattr(synID(a:lnum, match(curline, '\S') + 1, 1), 'name') + let prev_syn_name_end = synIDattr(synID(ptag, strlen(pline) - 1, 1), 'name') + " not needed (yet?) + " let prev_syn_name_start = synIDattr(synID(ptag, match(pline, '\S') + 1, 1), 'name') endif if syn_name_end =~ 'Comment' && syn_name_start =~ 'Comment' return XmlIndentComment(a:lnum) - elseif empty(syn_name_start) && empty(syn_name_end) + elseif empty(syn_name_start) && empty(syn_name_end) && a:use_syntax_check " non-xml tag content: use indent from 'autoindent' - return pind + shiftwidth() + if pline =~ b:xml_indent_close + return pind + elseif !empty(prev_syn_name_end) + " only indent by an extra shiftwidth, if the previous line ends + " with an XML like tag + return pind + shiftwidth() + else + " no extra indent, looks like a text continuation line + return pind + endif endif " Get indent from previous tag line @@ -148,7 +168,7 @@ endfun func! IsXMLContinuation(line) " Checks, whether or not the line matches a start-of-tag - return a:line !~ '^\s*<' + return a:line !~ '^\s*<' && &ft =~# b:xml_indent_continuation_filetype endfunc func! HasNoTagEnd(line) @@ -156,15 +176,28 @@ func! HasNoTagEnd(line) return a:line !~ '>\s*$' endfunc +func! IsXMLEmptyClosingTag(line) + " Checks whether the line ends with an empty closing tag such as + return a:line =~? '<[^>]*/>\s*$' +endfunc + " return indent for a commented line, " the middle part might be indented one additional level func! XmlIndentComment(lnum) - let ptagopen = search(b:xml_indent_open, 'bnW') + let ptagopen = search('.\{-}<[:A-Z_a-z]\_[^/]\{-}>.\{-}', 'bnW') let ptagclose = search(b:xml_indent_close, 'bnW') if getline(a:lnum) =~ '', - \ '']) - " TODO: IE7 doesn't *actually* support XHTML, maybe we should remove this. - " But if it's served up as tag soup, maybe the following will work, so - " leave it in for now. - call extend(s:lines, [ + \ ".closed-fold:hover > .Folded { display: none; }"]) + " TODO: IE6 is REALLY old and I can't even test it anymore. Maybe we + " should remove this? Leave it in for now, it was working at one point, + " and doesn't affect any modern browsers. Even newer IE versions should + " support the above code and ignore the following. + let s:ieonly = [ \ "", - \]) + \] else " if we aren't doing hover_unfold, use CSS 1 only call extend(s:lines, [ - \ "' \]) endif - else - " if we aren't doing any dynamic folding, no need for any special rules - call extend(s:lines, [ - \ "", \]) - endif + call extend(s:lines, s:ieonly) + unlet s:ieonly endif -let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy) +let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids " insert script tag if needed if s:uses_script call extend(s:lines, [ \ "", - \ "+ contains=@AspVBScriptTop diff --git a/runtime/syntax/asterisk.vim b/runtime/syntax/asterisk.vim index 4a922d3f11162..4b3d246e39257 100644 --- a/runtime/syntax/asterisk.vim +++ b/runtime/syntax/asterisk.vim @@ -19,7 +19,7 @@ syn match asteriskComment ";.*" contains=asteriskTodo syn match asteriskContext "\[.\{-}\]" syn match asteriskExten "^\s*\zsexten\s*=>\?\s*[^,]\+\ze," contains=asteriskPattern nextgroup=asteriskPriority syn match asteriskExten "^\s*\zssame\s*=>\?\s*\ze" nextgroup=asteriskPriority -syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|\(no\)\?load\)\s*=>\?" +syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|l\?e\?switch\|\(no\)\?load\)\s*=>\?" syn match asteriskPattern "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained syn match asteriskPattern "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained syn match asteriskApp ",\zs[a-zA-Z]\+\ze$" @@ -39,7 +39,7 @@ syn match asteriskVarLen "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)} syn match asteriskVarLen "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp syn match asteriskExp "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp syn match asteriskCodecsPermit "^\s*\(allow\|disallow\)\s*=\s*.*$" contains=asteriskCodecs -syn match asteriskCodecs "\(g723\|gsm\|ulaw\|alaw\|g726\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|all\s*$\)" +syn match asteriskCodecs "\(vp9\|vp8\|h264\|h263p\|h263\|h261\|jpeg\|opus\|g722\|g723\|gsm\|ulaw\|alaw\|g719\|g726\|g726aal2\|siren7\|siren14\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|wav\|all\s*$\)" syn match asteriskError "^\(type\|auth\|permit\|deny\|bindaddr\|host\)\s*=.*$" syn match asteriskType "^\zstype=\ze\<\(peer\|user\|friend\)\>$" contains=asteriskTypeType syn match asteriskTypeType "\<\(peer\|user\|friend\)\>" contained diff --git a/runtime/syntax/autoit.vim b/runtime/syntax/autoit.vim index 1b9ab7458e722..6b6048aadc8dc 100644 --- a/runtime/syntax/autoit.vim +++ b/runtime/syntax/autoit.vim @@ -5,6 +5,7 @@ " Authored By: Riccardo Casini " Script URL: http://www.vim.org/scripts/script.php?script_id=1239 " ChangeLog: Please visit the script URL for detailed change information +" Included change from #970. " Quit when a syntax file was already loaded. if exists("b:current_syntax") @@ -932,7 +933,7 @@ syn match autoitConst "\$SD_POWERDOWN" " constants - string syn match autoitConst "\$STR_NOCASESENSE" syn match autoitConst "\$STR_CASESENSE" -syn match autoitConst "\STR_STRIPLEADING" +syn match autoitConst "\$STR_STRIPLEADING" syn match autoitConst "\$STR_STRIPTRAILING" syn match autoitConst "\$STR_STRIPSPACES" syn match autoitConst "\$STR_STRIPALL" diff --git a/runtime/syntax/awk.vim b/runtime/syntax/awk.vim index 7c0682ce9f26c..3082c1cb5cf86 100644 --- a/runtime/syntax/awk.vim +++ b/runtime/syntax/awk.vim @@ -1,7 +1,8 @@ " Vim syntax file -" Language: awk, nawk, gawk, mawk -" Maintainer: Antonio Colombo -" Last Change: 2016 Sep 05 +" Language: awk, nawk, gawk, mawk +" Maintainer: Doug Kearns +" Previous Maintainer: Antonio Colombo +" Last Change: 2020 Aug 18 " AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger " The AWK Programming Language, Addison-Wesley, 1988 @@ -9,7 +10,7 @@ " GAWK ref. is: Arnold D. Robbins " Effective AWK Programming, Third Edition, O'Reilly, 2001 " Effective AWK Programming, Fourth Edition, O'Reilly, 2015 -" (also available and updated with the gawk source distribution) +" (up-to-date version available with the gawk source distribution) " MAWK is a "new awk" meaning it implements AWK ref. " mawk conforms to the Posix 1003.2 (draft 11.3) @@ -27,20 +28,27 @@ endif let s:cpo_save = &cpo set cpo&vim +syn iskeyword @,48-57,_,192-255,@-@ + " A bunch of useful Awk keywords " AWK ref. p. 188 syn keyword awkStatement break continue delete exit syn keyword awkStatement function getline next syn keyword awkStatement print printf return " GAWK ref. Chapter 7-9 -syn keyword awkStatement switch nextfile +syn keyword awkStatement case default switch nextfile syn keyword awkStatement func +" GAWK ref. Chapter 2.7, Including Other Files into Your Program +" GAWK ref. Chapter 2.8, Loading Dynamic Extensions into Your Program +" GAWK ref. Chapter 15, Namespaces +" Directives +syn keyword awkStatement @include @load @namespace " " GAWK ref. Chapter 9, Functions " Numeric Functions -syn keyword awkFunction atan2 cos exp int intdiv log rand sin sqrt srand +syn keyword awkFunction atan2 cos exp int log rand sin sqrt srand " String Manipulation Functions -syn keyword awkFunction asort asort1 gensub gsub index length match +syn keyword awkFunction asort asorti gensub gsub index length match syn keyword awkFunction patsplit split sprintf strtonum sub substr syn keyword awkFunction tolower toupper " Input Output Functions @@ -49,7 +57,7 @@ syn keyword awkFunction close fflush system syn keyword awkFunction mktime strftime systime " Bit Manipulation Functions syn keyword awkFunction and compl lshift or rshift xor -" Getting Type Functions +" Getting Type Information Functions syn keyword awkFunction isarray typeof " String-Translation Functions syn keyword awkFunction bindtextdomain dcgettext dcngetext diff --git a/runtime/syntax/basic.vim b/runtime/syntax/basic.vim index 488ddc0ec47be..7fe411a869a65 100644 --- a/runtime/syntax/basic.vim +++ b/runtime/syntax/basic.vim @@ -1,14 +1,17 @@ " Vim syntax file -" Language: BASIC -" Maintainer: Allan Kelly -" Last Change: 2011 Dec 25 by Thilo Six +" Language: BASIC (QuickBASIC 4.5) +" Maintainer: Doug Kearns +" Previous Maintainer: Allan Kelly +" Contributors: Thilo Six +" Last Change: 2021 Aug 08 " First version based on Micro$soft QBASIC circa 1989, as documented in " 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989. -" This syntax file not a complete implementation yet. Send suggestions to the -" maintainer. +" +" Second version attempts to match Microsoft QuickBASIC 4.5 while keeping FreeBASIC +" (-lang qb) and QB64 (excluding extensions) in mind. -- DJK -" quit when a syntax file was already loaded +" Prelude {{{1 if exists("b:current_syntax") finish endif @@ -16,151 +19,362 @@ endif let s:cpo_save = &cpo set cpo&vim -" A bunch of useful BASIC keywords -syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave -syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute -syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir -syn keyword basicStatement CIRCLE circle Circle CLEAR clear Clear -syn keyword basicStatement CLOSE close Close CLS cls Cls COLOR color Color -syn keyword basicStatement COM com Com COMMON common Common -syn keyword basicStatement CONST const Const DATA data Data -syn keyword basicStatement DECLARE declare Declare DEF def Def -syn keyword basicStatement DEFDBL defdbl Defdbl DEFINT defint Defint -syn keyword basicStatement DEFLNG deflng Deflng DEFSNG defsng Defsng -syn keyword basicStatement DEFSTR defstr Defstr DIM dim Dim -syn keyword basicStatement DO do Do LOOP loop Loop -syn keyword basicStatement DRAW draw Draw END end End -syn keyword basicStatement ENVIRON environ Environ ERASE erase Erase -syn keyword basicStatement ERROR error Error EXIT exit Exit -syn keyword basicStatement FIELD field Field FILES files Files -syn keyword basicStatement FOR for For NEXT next Next -syn keyword basicStatement FUNCTION function Function GET get Get -syn keyword basicStatement GOSUB gosub Gosub GOTO goto Goto -syn keyword basicStatement IF if If THEN then Then ELSE else Else -syn keyword basicStatement INPUT input Input INPUT# input# Input# -syn keyword basicStatement IOCTL ioctl Ioctl KEY key Key -syn keyword basicStatement KILL kill Kill LET let Let -syn keyword basicStatement LINE line Line LOCATE locate Locate -syn keyword basicStatement LOCK lock Lock UNLOCK unlock Unlock -syn keyword basicStatement LPRINT lprint Lprint USING using Using -syn keyword basicStatement LSET lset Lset MKDIR mkdir Mkdir -syn keyword basicStatement NAME name Name ON on On -syn keyword basicStatement ERROR error Error OPEN open Open -syn keyword basicStatement OPTION option Option BASE base Base -syn keyword basicStatement OUT out Out PAINT paint Paint -syn keyword basicStatement PALETTE palette Palette PCOPY pcopy Pcopy -syn keyword basicStatement PEN pen Pen PLAY play Play -syn keyword basicStatement PMAP pmap Pmap POKE poke Poke -syn keyword basicStatement PRESET preset Preset PRINT print Print -syn keyword basicStatement PRINT# print# Print# USING using Using -syn keyword basicStatement PSET pset Pset PUT put Put -syn keyword basicStatement RANDOMIZE randomize Randomize READ read Read -syn keyword basicStatement REDIM redim Redim RESET reset Reset -syn keyword basicStatement RESTORE restore Restore RESUME resume Resume -syn keyword basicStatement RETURN return Return RMDIR rmdir Rmdir -syn keyword basicStatement RSET rset Rset RUN run Run -syn keyword basicStatement SEEK seek Seek SELECT select Select -syn keyword basicStatement CASE case Case SHARED shared Shared -syn keyword basicStatement SHELL shell Shell SLEEP sleep Sleep -syn keyword basicStatement SOUND sound Sound STATIC static Static -syn keyword basicStatement STOP stop Stop STRIG strig Strig -syn keyword basicStatement SUB sub Sub SWAP swap Swap -syn keyword basicStatement SYSTEM system System TIMER timer Timer -syn keyword basicStatement TROFF troff Troff TRON tron Tron -syn keyword basicStatement TYPE type Type UNLOCK unlock Unlock -syn keyword basicStatement VIEW view View WAIT wait Wait -syn keyword basicStatement WHILE while While WEND wend Wend -syn keyword basicStatement WIDTH width Width WINDOW window Window -syn keyword basicStatement WRITE write Write DATE$ date$ Date$ -syn keyword basicStatement MID$ mid$ Mid$ TIME$ time$ Time$ - -syn keyword basicFunction ABS abs Abs ASC asc Asc -syn keyword basicFunction ATN atn Atn CDBL cdbl Cdbl -syn keyword basicFunction CINT cint Cint CLNG clng Clng -syn keyword basicFunction COS cos Cos CSNG csng Csng -syn keyword basicFunction CSRLIN csrlin Csrlin CVD cvd Cvd -syn keyword basicFunction CVDMBF cvdmbf Cvdmbf CVI cvi Cvi -syn keyword basicFunction CVL cvl Cvl CVS cvs Cvs -syn keyword basicFunction CVSMBF cvsmbf Cvsmbf EOF eof Eof -syn keyword basicFunction ERDEV erdev Erdev ERL erl Erl -syn keyword basicFunction ERR err Err EXP exp Exp -syn keyword basicFunction FILEATTR fileattr Fileattr FIX fix Fix -syn keyword basicFunction FRE fre Fre FREEFILE freefile Freefile -syn keyword basicFunction INP inp Inp INSTR instr Instr -syn keyword basicFunction INT int Int LBOUND lbound Lbound -syn keyword basicFunction LEN len Len LOC loc Loc -syn keyword basicFunction LOF lof Lof LOG log Log -syn keyword basicFunction LPOS lpos Lpos PEEK peek Peek -syn keyword basicFunction PEN pen Pen POINT point Point -syn keyword basicFunction POS pos Pos RND rnd Rnd -syn keyword basicFunction SADD sadd Sadd SCREEN screen Screen -syn keyword basicFunction SEEK seek Seek SETMEM setmem Setmem -syn keyword basicFunction SGN sgn Sgn SIN sin Sin -syn keyword basicFunction SPC spc Spc SQR sqr Sqr -syn keyword basicFunction STICK stick Stick STRIG strig Strig -syn keyword basicFunction TAB tab Tab TAN tan Tan -syn keyword basicFunction UBOUND ubound Ubound VAL val Val -syn keyword basicFunction VALPTR valptr Valptr VALSEG valseg Valseg -syn keyword basicFunction VARPTR varptr Varptr VARSEG varseg Varseg -syn keyword basicFunction CHR$ Chr$ chr$ COMMAND$ command$ Command$ -syn keyword basicFunction DATE$ date$ Date$ ENVIRON$ environ$ Environ$ -syn keyword basicFunction ERDEV$ erdev$ Erdev$ HEX$ hex$ Hex$ -syn keyword basicFunction INKEY$ inkey$ Inkey$ INPUT$ input$ Input$ -syn keyword basicFunction IOCTL$ ioctl$ Ioctl$ LCASES$ lcases$ Lcases$ -syn keyword basicFunction LAFT$ laft$ Laft$ LTRIM$ ltrim$ Ltrim$ -syn keyword basicFunction MID$ mid$ Mid$ MKDMBF$ mkdmbf$ Mkdmbf$ -syn keyword basicFunction MKD$ mkd$ Mkd$ MKI$ mki$ Mki$ -syn keyword basicFunction MKL$ mkl$ Mkl$ MKSMBF$ mksmbf$ Mksmbf$ -syn keyword basicFunction MKS$ mks$ Mks$ OCT$ oct$ Oct$ -syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$ -syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$ -syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$ -syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$ -syn keyword basicTodo contained TODO - -"integer number, or floating point number without a dot. -syn match basicNumber "\<\d\+\>" -"floating point number, with dot -syn match basicNumber "\<\d\+\.\d*\>" -"floating point number, starting with a dot -syn match basicNumber "\.\d\+\>" - -" String and Character contstants -syn match basicSpecial contained "\\\d\d\d\|\\." -syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial - -syn region basicComment start="REM" end="$" contains=basicTodo -syn region basicComment start="^[ \t]*'" end="$" contains=basicTodo -syn region basicLineNumber start="^\d" end="\s" -syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 -" Used with OPEN statement -syn match basicFilenumber "#\d\+" +syn iskeyword @,48-57,.,!,#,%,&,$ +syn case ignore + +" Whitespace Errors {{{1 +if exists("basic_space_errors") + if !exists("basic_no_trail_space_error") + syn match basicSpaceError display excludenl "\s\+$" + endif + if !exists("basic_no_tab_space_error") + syn match basicSpaceError display " \+\t"me=e-1 + endif +endif + +" Comment Errors {{{1 +if !exists("basic_no_comment_errors") + syn match basicCommentError "\.*" +endif + +" Not Top Cluster {{{1 +syn cluster basicNotTop contains=@basicLineIdentifier,basicDataString,basicDataSeparator,basicTodo + +" Statements {{{1 + +syn cluster basicStatements contains=basicStatement,basicDataStatement,basicMetaRemStatement,basicPutStatement,basicRemStatement + +let s:statements =<< trim EOL " {{{2 + beep + bload + bsave + call + calls + case + chain + chdir + circle + clear + close + cls + color + com + common + const + declare + def + def\s\+seg + defdbl + defint + deflng + defsng + defstr + dim + do + draw + elseif + end + end\s\+\%(def\|function\|if\|select\|sub\|type\) + environ + erase + error + exit\s\+\%(def\|do\|for\|function\|sub\) + field + files + for + function + get + gosub + goto + if + input + ioctl + key + kill + let + line + line\s\+input + locate + lock + loop + lprint + lset + mkdir + name + next + on + on\s\+error + on\s\+uevent + open + open\s\+com + option + out + paint + palette + palette\s\+using + pcopy + pen + pmap + poke + preset + print + pset + randomize + read + redim + reset + restore + resume + return + rmdir + rset + run + select\s\+case + shared + shell + sleep + sound + static + stop + strig + sub + swap + system + troff + tron + type + uevent + unlock + using + view + view\s\+print + wait + wend + while + width + window + write +EOL +" }}} + +for s in s:statements + exe 'syn match basicStatement "\<' .. s .. '\>" contained' +endfor + +syn match basicStatement "\<\%(then\|else\)\>" nextgroup=@basicStatements skipwhite + +" DATA Statement +syn match basicDataSeparator "," contained +syn region basicDataStatement matchgroup=basicStatement start="\" matchgroup=basicStatementSeparator end=":\|$" contained contains=basicDataSeparator,basicDataString,basicNumber,basicFloat,basicString + +if !exists("basic_no_data_fold") + syn region basicMultilineData start="^\s*\.*\n\%(^\s*\\)\@=" end="^\s*\.*\n\%(^\s*\\)\@!" contains=basicDataStatement transparent fold keepend +endif + +" PUT File I/O and Graphics statements - needs special handling for graphics +" action verbs +syn match basicPutAction "\<\%(pset\|preset\|and\|or\|xor\)\>" contained +syn region basicPutStatement matchgroup=basicStatement start="\" matchgroup=basicStatementSeparator end=":\|$" contained contains=basicKeyword,basicPutAction,basicFilenumber + +" Keywords {{{1 +let s:keywords =<< trim EOL " {{{2 + absolute + access + alias + append + as + base + binary + byval + cdecl + com + def + do + for + function + gosub + goto + input + int86old + int86xold + interrupt + interruptx + is + key + len + list + local + lock + lprint + next + off + on + output + pen + play + random + read + resume + screen + seg + shared + signal + static + step + stop + strig + sub + timer + to + until + using + while + write +EOL +" }}} + +for k in s:keywords + exe 'syn match basicKeyword "\<' .. k .. '\>"' +endfor + +" Functions {{{1 +syn keyword basicFunction abs asc atn cdbl chr$ cint clng command$ cos csng +syn keyword basicFunction csrlin cvd cvdmbf cvi cvl cvs cvsmbf environ$ eof +syn keyword basicFunction erdev erdev$ erl err exp fileattr fix fre freefile +syn keyword basicFunction hex$ inkey$ inp input$ instr int ioctl$ left$ lbound +syn keyword basicFunction lcase$ len loc lof log lpos ltrim$ mkd$ mkdmbf$ mki$ +syn keyword basicFunction mkl$ mks$ mksmbf$ oct$ peek pen point pos right$ rnd +syn keyword basicFunction rtrim$ sadd setmem sgn sin space$ spc sqr stick str$ +syn keyword basicFunction strig string$ tab tan ubound ucase$ val valptr +syn keyword basicFunction valseg varptr varptr$ varseg + +" Functions and statements (same name) {{{1 +syn match basicStatement "\<\%(date\$\|mid\$\|play\|screen\|seek\|time\$\|timer\)\>" contained +syn match basicFunction "\<\%(date\$\|mid\$\|play\|screen\|seek\|time\$\|timer\)\>" + +" Types {{{1 +syn keyword basicType integer long single double string any + +" Strings {{{1 + +" Unquoted DATA strings - anything except [:,] and leading or trailing whitespace +" Needs lower priority than numbers +syn match basicDataString "[^[:space:],:]\+\%(\s\+[^[:space:],:]\+\)*" contained + +syn region basicString start=+"+ end=+"+ oneline + +" Booleans {{{1 +if exists("basic_booleans") + syn keyword basicBoolean true false +endif + +" Numbers {{{1 + +" Integers +syn match basicNumber "-\=&o\=\o\+[%&]\=\>" +syn match basicNumber "-\=&h\x\+[%&]\=\>" +syn match basicNumber "-\=\<\d\+[%&]\=\>" + +" Floats +syn match basicFloat "-\=\<\d\+\.\=\d*\%(\%([ed][+-]\=\d*\)\|[!#]\)\=\>" +syn match basicFloat "-\=\<\.\d\+\%(\%([ed][+-]\=\d*\)\|[!#]\)\=\>" + +" Statement anchors {{{1 +syn match basicLineStart "^" nextgroup=@basicStatements,@basicLineIdentifier skipwhite +syn match basicStatementSeparator ":" nextgroup=@basicStatements skipwhite + +" Line numbers and labels {{{1 + +" QuickBASIC limits these to 65,529 and 40 chars respectively +syn match basicLineNumber "\d\+" nextgroup=@basicStatements skipwhite contained +syn match basicLineLabel "\a[[:alnum:]]*\ze\s*:" nextgroup=@basicStatements skipwhite contained + +syn cluster basicLineIdentifier contains=basicLineNumber,basicLineLabel + +" Line Continuation {{{1 +syn match basicLineContinuation "\s*\zs_\ze\s*$" + +" Type suffixes {{{1 +if exists("basic_type_suffixes") + syn match basicTypeSuffix "\a[[:alnum:].]*\zs[$%&!#]" +endif + +" File numbers {{{1 +syn match basicFilenumber "#\d\+" +syn match basicFilenumber "#\a[[:alnum:].]*[%&!#]\=" + +" Operators {{{1 +if exists("basic_operators") + syn match basicArithmeticOperator "[-+*/\\^]" + syn match basicRelationalOperator "<>\|<=\|>=\|[><=]" +endif +syn match basicLogicalOperator "\<\%(not\|and\|or\|xor\|eqv\|imp\)\>" +syn match basicArithmeticOperator "\" + +" Metacommands {{{1 +" Note: No trailing word boundaries. Text may be freely mixed however there +" must be only leading whitespace prior to the first metacommand +syn match basicMetacommand "$INCLUDE\s*:\s*'[^']\+'" contained containedin=@basicMetaComments +syn match basicMetacommand "$\%(DYNAMIC\|STATIC\)" contained containedin=@basicMetaComments + +" Comments {{{1 +syn keyword basicTodo TODO FIXME XXX NOTE contained + +syn region basicRemStatement matchgroup=basicStatement start="REM\>" end="$" contains=basicTodo,@Spell contained +syn region basicComment start="'" end="$" contains=basicTodo,@Spell + +if !exists("basic_no_comment_fold") + syn region basicMultilineComment start="^\s*'.*\n\%(\s*'\)\@=" end="^\s*'.*\n\%(\s*'\)\@!" contains=@basicComments transparent fold keepend +endif + +" Metacommands +syn region basicMetaRemStatement matchgroup=basicStatement start="REM\>\s*\$\@=" end="$" contains=basicTodo contained +syn region basicMetaComment start="'\s*\$\@=" end="$" contains=basicTodo + +syn cluster basicMetaComments contains=basicMetaComment,basicMetaRemStatement +syn cluster basicComments contains=basicComment,basicMetaComment + "syn sync ccomment basicComment -" syn match basicMathsOperator "[<>+\*^/\\=-]" -syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" - -" Define the default highlighting. -" Only when an item doesn't have highlighting yet - -hi def link basicLabel Label -hi def link basicConditional Conditional -hi def link basicRepeat Repeat -hi def link basicLineNumber Comment -hi def link basicNumber Number -hi def link basicError Error -hi def link basicStatement Statement -hi def link basicString String -hi def link basicComment Comment -hi def link basicSpecial Special -hi def link basicTodo Todo -hi def link basicFunction Identifier -hi def link basicTypeSpecifier Type -hi def link basicFilenumber basicTypeSpecifier -"hi basicMathsOperator term=bold cterm=bold gui=bold +" Default Highlighting {{{1 +hi def link basicArithmeticOperator basicOperator +hi def link basicBoolean Boolean +hi def link basicComment Comment +hi def link basicCommentError Error +hi def link basicDataString basicString +hi def link basicFilenumber basicTypeSuffix " TODO: better group +hi def link basicFloat Float +hi def link basicFunction Identifier +hi def link basicKeyword Keyword +hi def link basicLineIdentifier LineNr +hi def link basicLineContinuation Special +hi def link basicLineLabel basicLineIdentifier +hi def link basicLineNumber basicLineIdentifier +hi def link basicLogicalOperator basicOperator +hi def link basicMetacommand SpecialComment +hi def link basicMetaComment Comment +hi def link basicMetaRemStatement Comment +hi def link basicNumber Number +hi def link basicOperator Operator +hi def link basicPutAction Keyword +hi def link basicRelationalOperator basicOperator +hi def link basicRemStatement Comment +hi def link basicSpaceError Error +hi def link basicStatementSeparator Special +hi def link basicStatement Statement +hi def link basicString String +hi def link basicTodo Todo +hi def link basicType Type +hi def link basicTypeSuffix Special +if exists("basic_legacy_syntax_groups") + hi def link basicTypeSpecifier Type + hi def link basicTypeSuffix basicTypeSpecifier +endif +" Postscript {{{1 let b:current_syntax = "basic" let &cpo = s:cpo_save unlet s:cpo_save -" vim: ts=8 + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/syntax/bsdl.vim b/runtime/syntax/bsdl.vim new file mode 100644 index 0000000000000..75c69558e59e4 --- /dev/null +++ b/runtime/syntax/bsdl.vim @@ -0,0 +1,17 @@ +" Vim syntax file +" Language: Boundary Scan Description Language (BSDL) +" Maintainer: Daniel Kho +" Last Changed: 2020 Mar 19 by Daniel Kho + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" Read in VHDL syntax files +runtime! syntax/vhdl.vim +unlet b:current_syntax + +let b:current_syntax = "bsdl" + +" vim: ts=8 diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index 2a14ae0c46f55..890e9ae1a7098 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: C " Maintainer: Bram Moolenaar -" Last Change: 2019 Apr 23 +" Last Change: 2022 Apr 24 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -11,7 +11,10 @@ endif let s:cpo_save = &cpo set cpo&vim -let s:ft = matchstr(&ft, '^\([^.]\)\+') +let s:ft = matchstr(&ft, '^\%([^.]\)\+') + +" check if this was included from cpp.vim +let s:in_cpp_family = exists("b:filetype_in_cpp_family") " Optional embedded Autodoc parsing " To enable it add: let g:c_autodoc = 1 @@ -39,26 +42,26 @@ syn cluster cCommentGroup contains=cTodo,cBadContinuation " String and Character constants " Highlight special characters (those which have a backslash) differently -syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" +syn match cSpecial display contained "\\\%(x\x\+\|\o\{1,3}\|.\|$\)" if !exists("c_no_utf") - syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)" + syn match cSpecial display contained "\\\%(u\x\{4}\|U\x\{8}\)" endif if !exists("c_no_cformat") " Highlight % items in strings. if !exists("c_no_c99") " ISO C99 - syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained + syn match cFormat display "%\%(\d\+\$\)\=[-+' #0*]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjzt]\|ll\|hh\)\=\%([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained else - syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained + syn match cFormat display "%\%(\d\+\$\)\=[-+' #0*]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlL]\|ll\)\=\%([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained endif syn match cFormat display "%%" contained endif " cCppString: same as cString, but ends at end of line -if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat") +if s:in_cpp_family && !exists("cpp_no_cpp11") && !exists("c_no_cformat") " ISO C++11 - syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend - syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell + syn region cString start=+\%(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend + syn region cCppString start=+\%(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell elseif s:ft ==# "c" && !exists("c_no_c11") && !exists("c_no_cformat") " ISO C99 syn region cString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend @@ -70,7 +73,7 @@ else syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell endif -syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip +syn region cCppSkip contained start="^\s*\%(%:\|#\)\s*\%(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip syn cluster cStringGroup contains=cCppString,cCppSkip @@ -87,7 +90,7 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'" syn match cSpecialCharacter display "'\\x\x\{1,2}'" syn match cSpecialCharacter display "L'\\x\x\+'" -if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11")) +if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) " ISO C11 or ISO C++ 11 if exists("c_no_cformat") syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend @@ -130,21 +133,21 @@ endif " But avoid matching <::. syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom if exists("c_no_curly_error") - if s:ft ==# 'cpp' && !exists("cpp_no_cpp11") + if s:in_cpp_family && !exists("cpp_no_cpp11") syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell syn match cParenError display ")" syn match cErrInParen display contained "^^<%\|^%>" else - syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell + syn region cParen transparent start='(' end=')' contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell syn match cParenError display ")" syn match cErrInParen display contained "^[{}]\|^<%\|^%>" endif elseif exists("c_no_bracket_error") - if s:ft ==# 'cpp' && !exists("cpp_no_cpp11") + if s:in_cpp_family && !exists("cpp_no_cpp11") syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell @@ -158,7 +161,7 @@ elseif exists("c_no_bracket_error") syn match cErrInParen display contained "[{}]\|<%\|%>" endif else - if s:ft ==# 'cpp' && !exists("cpp_no_cpp11") + if s:in_cpp_family && !exists("cpp_no_cpp11") syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell @@ -187,17 +190,16 @@ syn case ignore syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal " Same, but without octal error (for comments) syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal -syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" "hex number -syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" " Flag the first zero of an octal number as something special -syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero +syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero syn match cOctalZero display contained "\<0" -syn match cFloat display contained "\d\+f" "floating point number, with dot, optional exponent -syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" +syn match cFloat display contained "\d\+\.\d*\%(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent -syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" +syn match cFloat display contained "\.\d\+\%(e[-+]\=\d\+\)\=[fl]\=\>" "floating point number, without dot, with exponent syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" if !exists("c_no_c99") @@ -217,7 +219,7 @@ if exists("c_comment_strings") " need to use a special type of cString: cCommentString, which also ends on " "*/", and sees a "*" at the start of the line as comment again. " Unfortunately this doesn't very well work for // type of comments :-( - syn match cCommentSkip contained "^\s*\*\($\|\s\+\)" + syn match cCommentSkip contained "^\s*\*\%($\|\s\+\)" syn region cCommentString contained start=+L\=\\\@" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError -syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>" +syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +syn match cPreConditMatch display "^\s*\zs\%(%:\|#\)\s*\%(else\|endif\)\>" if !exists("c_no_if0") syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip - syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold - syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse + syn region cCppOutWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0\+\s*\%($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold + syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\%(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse if !exists("c_no_if0_fold") - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold else - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif - syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit - syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold - syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit + syn region cCppInWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\%($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold + syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\%(%:\|#\)\s*endif\>" contains=TOP,cPreCondit if !exists("c_no_if0_fold") - syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold else - syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 endif - syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell - syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip - syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + syn region cCppOutSkip contained start="^\s*\%(%:\|#\)\s*\%(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip + syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(if\s\+\%(\d\+\s*\%($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc endif syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match cIncluded display contained "<[^>]*>" -syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +syn match cInclude display "^\s*\zs\%(%:\|#\)\s*include\>\s*["<]" contains=cIncluded "syn match cLineSkip "\\$" syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock -syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell -syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell +syn region cDefine start="^\s*\zs\%(%:\|#\)\s*\%(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell +syn region cPreProc start="^\s*\zs\%(%:\|#\)\s*\%(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell " Optional embedded Autodoc parsing if exists("c_autodoc") @@ -409,6 +414,9 @@ if exists("c_autodoc") syn cluster cPreProcGroup add=cAutodocReal endif +" be able to fold #pragma regions +syn region cPragma start="^\s*#pragma\s\+region\>" end="^\s*#pragma\s\+endregion\>" transparent keepend extend fold + " Highlight User Labels syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString if s:ft ==# 'c' || exists("cpp_no_cpp11") @@ -418,7 +426,7 @@ endif syn cluster cLabelGroup contains=cUserLabel syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup -if s:ft ==# 'cpp' +if s:in_cpp_family syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup else @@ -475,6 +483,7 @@ hi def link cSpecialError cError hi def link cCurlyError cError hi def link cOperator Operator hi def link cStructure Structure +hi def link cTypedef Structure hi def link cStorageClass StorageClass hi def link cInclude Include hi def link cPreProc PreProc diff --git a/runtime/syntax/cabal.vim b/runtime/syntax/cabal.vim index 8af47d404209b..92e6b8331e5c3 100644 --- a/runtime/syntax/cabal.vim +++ b/runtime/syntax/cabal.vim @@ -4,7 +4,7 @@ " Maintainer: Marcin Szamotulski " Previous Maintainer: Vincent Berthoux " File Types: .cabal -" Last Change: 15 May 2018 +" Last Change: 21 Nov 2020 " v1.5: Incorporated changes from " https://github.com/sdiehl/haskell-vim-proto/blob/master/vim/syntax/cabal.vim " Use `syn keyword` instead of `syn match`. @@ -62,11 +62,12 @@ syn keyword cabalCategory contained \ source-repository \ flag \ custom-setup + \ common syn match cabalCategoryTitle contained /[^{]*\ze{\?/ syn match cabalCategoryRegion \ contains=cabalCategory,cabalCategoryTitle \ nextgroup=cabalCategory skipwhite - \ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|custom-setup\)\+\s*\%(.*$\|$\)/ + \ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|custom-setup\|common\)\+\s*\%(.*$\|$\)/ syn keyword cabalTruth true false " cabalStatementRegion which limits the scope of cabalStatement keywords, this @@ -76,10 +77,14 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion \ default-language \ default-extensions \ author + \ autogen-modules + \ asm-sources + \ asm-options \ branch \ bug-reports \ build-depends \ build-tools + \ build-tools-depends \ build-type \ buildable \ c-sources @@ -87,32 +92,46 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion \ category \ cc-options \ copyright + \ cmm-sources + \ cmm-options \ cpp-options + \ cxx-sources \ data-dir \ data-files \ default + \ default-extensions \ description \ executable \ exposed-modules \ exposed \ extensions - \ extra-tmp-files + \ extra-bundled-libraries \ extra-doc-files + \ extra-dynamic-library-flavours + \ extra-framework-dirs + \ extra-ghci-libraries \ extra-lib-dirs \ extra-libraries + \ extra-library-flavours \ extra-source-files - \ exta-tmp-files + \ extra-tmp-files \ for example \ frameworks \ ghc-options \ ghc-prof-options \ ghc-shared-options + \ ghcjs-options + \ ghcjs-prof-options + \ ghcjs-shared-options \ homepage + \ hs-source-dir \ hs-source-dirs \ hugs-options + \ import \ include-dirs \ includes \ install-includes + \ js-sources \ ld-options \ license \ license-file @@ -120,10 +139,13 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion \ main-is \ maintainer \ manual + \ mixins \ module \ name \ nhc98-options \ other-extensions + \ other-language + \ other-languages \ other-modules \ package-url \ pkgconfig-depends diff --git a/runtime/syntax/cabalconfig.vim b/runtime/syntax/cabalconfig.vim new file mode 100644 index 0000000000000..0165725c06ae6 --- /dev/null +++ b/runtime/syntax/cabalconfig.vim @@ -0,0 +1,30 @@ +" Vim syntax file +" Language: Cabal Config +" Maintainer: profunctor@pm.me +" Last Change: Marcin Szamotulski +" Original Author: Marcin Szamotulski + +if exists("b:current_syntax") + finish +endif + +syn match CabalConfigSection /^\S[[:alpha:]]\+\%(-[[:alpha:]]\+\)*[^:]*$/ +syn region CabalConfigRegion matchgroup=CabalConfigKey start=/^\s*[[:alpha:]]\+\%(-[[:alpha:]]\+\)*:/ matchgroup=NONE end=/$/ contains=CabalConfigSeparator,CabalConfigKeyword,CabalConfigPath keepend +syn match CabalConfigComment /^\s*--.*$/ +syn match CabalConfigValue /.*$/ contained +syn match CabalConfigKey /[[:alpha:]]\+\%(-[[:alpha:]]\+\)*\ze:/ +syn keyword CabalConfigSeparator : contained +syn match CabalConfigVariable /\$[[:alpha:]]\+/ +syn keyword CabalConfigKeyword True False ghc +syn match CabalConfigPath /\%([[:alpha:]]\+:\)\?\%(\/[[:print:]]\+\)\+/ + +hi def link CabalConfigComment Comment +hi def link CabalConfigSection Title +hi def link CabalConfigKey Statement +hi def link CabalConfigSeparator NonText +hi def link CabalConfigValue Normal +hi def link CabalConfigVariable Identifier +hi def link CabalConfigKeyword Keyword +hi def link CabalConfigPath Directory + +let b:current_syntax = "cabal.config" diff --git a/runtime/syntax/cabalproject.vim b/runtime/syntax/cabalproject.vim new file mode 100644 index 0000000000000..12143b9ee9518 --- /dev/null +++ b/runtime/syntax/cabalproject.vim @@ -0,0 +1,28 @@ +" Vim syntax file +" Language: Cabal Project +" Maintainer: profunctor@pm.me +" Last Change: Marcin Szamotulski +" Original Author: Marcin Szamotulski + +if exists("b:current_syntax") + finish +endif + +syn match CabalProjectComment /^\s*--.*/ contains=@Spell +syn match CabalProjectField /^\w\%(\w\|-\)\+/ contains=@NoSpell + +syn keyword CabalProjectBoolean true false True False +syn keyword CabalProjectCompiler ghc ghcjs jhc lhc uhc haskell-suite +syn match CabalProjectNat /\<\d\+\>/ +syn keyword CabalProjectJobs $ncpus +syn keyword CabalProjectProfilingLevel default none exported-functions toplevel-functions all-functions + +hi def link CabalProjectComment Comment +hi def link CabalProjectField Statement +hi def link CabalProjectBoolean Boolean +hi def link CabalProjectCompiler Identifier +hi def link CabalProjectNat Number +hi def link CabalProjectJobs Number +hi def link CabalProjectProfilingLevel Statement + +let b:current_syntax = "cabal.project" diff --git a/runtime/syntax/cfg.vim b/runtime/syntax/cfg.vim index a50297d418fd2..f347b1379fff0 100644 --- a/runtime/syntax/cfg.vim +++ b/runtime/syntax/cfg.vim @@ -32,7 +32,7 @@ syn match CfgComment "#.*" syn match CfgComment ";.*" syn match CfgComment "\/\/.*" -" Define the default hightlighting. +" Define the default highlighting. " Only when an item doesn't have highlighting yet hi def link CfgOnOff Label hi def link CfgComment Comment diff --git a/runtime/syntax/chicken.vim b/runtime/syntax/chicken.vim index c3f949f823493..f53d872e745b5 100644 --- a/runtime/syntax/chicken.vim +++ b/runtime/syntax/chicken.vim @@ -1,8 +1,9 @@ " Vim syntax file " Language: Scheme (CHICKEN) -" Last Change: 2018-02-05 +" Last Change: 2021 Oct 01 " Author: Evan Hanson " Maintainer: Evan Hanson +" Repository: https://git.foldling.org/vim-scheme.git " URL: https://foldling.org/vim/syntax/chicken.vim " Notes: This is supplemental syntax, to be loaded after the core Scheme " syntax file (syntax/scheme.vim). Enable it by setting b:is_chicken=1 @@ -36,9 +37,23 @@ if len(s:c) syn region c matchgroup=schemeComment start=/#>/ end=/<#/ contains=@c endif +" SRFI 26 +syn match schemeSyntax /\(([ \t\n]*\)\@<=\(cut\|cute\)\>/ + +syn keyword schemeSyntax and-let* syn keyword schemeSyntax define-record +syn keyword schemeSyntax set!-values +syn keyword schemeSyntax fluid-let +syn keyword schemeSyntax let-optionals +syn keyword schemeSyntax let-optionals* +syn keyword schemeSyntax letrec-values +syn keyword schemeSyntax nth-value +syn keyword schemeSyntax receive syn keyword schemeLibrarySyntax declare +syn keyword schemeLibrarySyntax define-interface +syn keyword schemeLibrarySyntax functor +syn keyword schemeLibrarySyntax include-relative syn keyword schemeLibrarySyntax module syn keyword schemeLibrarySyntax reexport syn keyword schemeLibrarySyntax require-library @@ -52,10 +67,12 @@ syn keyword schemeTypeSyntax define-specialization syn keyword schemeTypeSyntax define-type syn keyword schemeTypeSyntax the -syn keyword schemeExtraSyntax and-let* syn keyword schemeExtraSyntax match syn keyword schemeExtraSyntax match-lambda syn keyword schemeExtraSyntax match-lambda* +syn keyword schemeExtraSyntax match-let +syn keyword schemeExtraSyntax match-let* +syn keyword schemeExtraSyntax match-letrec syn keyword schemeSpecialSyntax define-compiler-syntax syn keyword schemeSpecialSyntax define-constant diff --git a/runtime/syntax/chordpro.vim b/runtime/syntax/chordpro.vim index 5ccec26508554..41a0a1e9d1643 100644 --- a/runtime/syntax/chordpro.vim +++ b/runtime/syntax/chordpro.vim @@ -1,8 +1,7 @@ " Vim syntax file -" Language: ChordPro (v. 3.6.2) +" Language: ChordPro 6 (https://www.chordpro.org) " Maintainer: Niels Bo Andersen -" Last Change: 2006 Apr 30 -" Remark: Requires VIM version 6.00 or greater +" Last Change: 2022-04-15 " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -12,54 +11,161 @@ endif let s:cpo_save = &cpo set cpo&vim -setlocal iskeyword+=- - syn case ignore -syn keyword chordproDirective contained - \ start_of_chorus soc end_of_chorus eoc new_song ns no_grid ng grid g - \ new_page np new_physical_page npp start_of_tab sot end_of_tab eot - \ column_break colb - -syn keyword chordproDirWithOpt contained - \ comment c comment_italic ci comment_box cb title t subtitle st define - \ textfont textsize chordfont chordsize columns col - -syn keyword chordproDefineKeyword contained base-fret frets +" Include embedded abc syntax +syn include @Abc syntax/abc.vim + +" Lilypond and Pango syntaxes could be embedded as well, but they are not +" available in the distribution. + +" Directives without arguments +syn keyword chordproDirective contained nextgroup=chordproConditional + \ new_song ns + \ start_of_chorus soc + \ chorus + \ start_of_verse sov + \ start_of_bridge sob + \ start_of_tab sot + \ start_of_grid sog + \ start_of_abc + \ start_of_ly + \ end_of_chorus eoc + \ end_of_verse eov + \ end_of_bridge eob + \ end_of_tab eot + \ end_of_grid eog + \ end_of_abc + \ end_of_ly + \ new_page np + \ new_physical_page npp + \ column_break cb + \ grid g + \ no_grid ng + \ transpose + \ chordfont cf chordsize cs chordcolour + \ footerfont footersize footercolour + \ gridfont gridsize gridcolour + \ tabfont tabsize tabcolour + \ tocfont tocsize toccolour + \ textfont tf textsize ts textcolour + \ titlefont titlesize titlecolour + +" Directives with arguments. Some directives are in both groups, as they can +" be used both with and without arguments +syn keyword chordproDirWithArg contained nextgroup=chordproConditional + \ title t + \ subtitle st + \ sorttitle + \ artist + \ composer + \ lyricist + \ arranger + \ copyright + \ album + \ year + \ key + \ time + \ tempo + \ duration + \ capo + \ comment c + \ highlight + \ comment_italic ci + \ comment_box cb + \ image + \ start_of_chorus soc + \ chorus + \ start_of_verse sov + \ start_of_bridge sob + \ start_of_tab sot + \ start_of_grid sog + \ start_of_abc + \ start_of_ly + \ define + \ chord + \ transpose + \ chordfont cf chordsize cs chordcolour + \ footerfont footersize footercolour + \ gridfont gridsize gridcolour + \ tabfont tabsize tabcolour + \ tocfont tocsize toccolour + \ textfont tf textsize ts textcolour + \ titlefont titlesize titlecolour + \ pagetype + \ titles + \ columns col + +syn keyword chordproMetaKeyword contained meta +syn keyword chordproMetadata contained title sorttitle subtitle artist composer lyricist arranger copyright album year key time tempo duration capo +syn keyword chordproStandardMetadata contained songindex page pages pagerange today tuning instrument user +syn match chordproStandardMetadata /instrument\.type/ contained +syn match chordproStandardMetadata /instrument\.description/ contained +syn match chordproStandardMetadata /user\.name/ contained +syn match chordproStandardMetadata /user\.fullname/ contained + +syn keyword chordproDefineKeyword contained frets fingers +syn match chordproDefineKeyword /base-fret/ contained + +syn match chordproArgumentsNumber /\d\+/ contained + +syn match chordproCustom /x_\w\+/ contained + +syn match chordproDirMatch /{\w\+\(-\w\+\)\?}/ contains=chordproDirective contained transparent +syn match chordproDirArgMatch /{\w\+\(-\w\+\)\?[: ]/ contains=chordproDirWithArg contained transparent +syn match chordproMetaMatch /{meta\(-\w\+\)\?[: ]\+\w\+/ contains=chordproMetaKeyword,chordproMetadata contained transparent +syn match chordproCustomMatch /{x_\w\+\(-\w\+\)\?[: ]/ contains=chordproCustom contained transparent + +syn match chordproConditional /-\w\+/ contained + +syn match chordproMetaDataOperator /[=|]/ contained +syn match chordproMetaDataValue /%{\w*/ contains=chordproMetaData,chordproStandardMetadata contained transparent +" Handles nested metadata tags, but the end of the containing chordproTag is +" not highlighted correctly, if there are more than two levels of nesting +syn region chordproMetaDataTag start=/%{\w*/ skip=/%{[^}]*}/ end=/}/ contains=chordproMetaDataValue,chordproMetaDataOperator,chordproMetadataTag contained + +syn region chordproArguments start=/{\w\+\(-\w\+\)\?[: ]/hs=e+1 skip=/%{[^}]*}/ end=/}/he=s-1 contains=chordproDirArgMatch,chordproArgumentsNumber,chordproMetaDataTag contained +syn region chordproArguments start=/{\(define\|chord\)\(-\w\+\)\?[: ]/hs=e+1 end=/}/he=s-1 contains=chordproDirArgMatch,chordproDefineKeyword,chordproArgumentsNumber contained +syn region chordproArguments start=/{meta\(-\w\+\)\?[: ]/hs=e+1 skip=/%{[^}]*}/ end=/}/he=s-1 contains=chordproMetaMatch,chordproMetaDataTag contained +syn region chordproArguments start=/{x_\w\+\(-\w\+\)\?[: ]/hs=e+1 end=/}/he=s-1 contains=chordproCustomMatch contained + +syn region chordproTag start=/{/ skip=/%{[^}]*}/ end=/}/ contains=chordproDirMatch,chordproArguments oneline -syn match chordproDirMatch /{\w*}/ contains=chordproDirective contained transparent -syn match chordproDirOptMatch /{\w*:/ contains=chordproDirWithOpt contained transparent +syn region chordproChord matchgroup=chordproBracket start=/\[/ end=/]/ oneline -" Workaround for a bug in VIM 6, which causes incorrect coloring of the first { -if version < 700 - syn region chordproOptions start=/{\w*:/ end=/}/ contains=chordproDirOptMatch contained transparent - syn region chordproOptions start=/{define:/ end=/}/ contains=chordproDirOptMatch, chordproDefineKeyword contained transparent -else - syn region chordproOptions start=/{\w*:/hs=e+1 end=/}/he=s-1 contains=chordproDirOptMatch contained - syn region chordproOptions start=/{define:/hs=e+1 end=/}/he=s-1 contains=chordproDirOptMatch, chordproDefineKeyword contained -endif +syn region chordproAnnotation matchgroup=chordproBracket start=/\[\*/ end=/]/ oneline -syn region chordproTag start=/{/ end=/}/ contains=chordproDirMatch,chordproOptions oneline +syn region chordproTab start=/{start_of_tab\(-\w\+\)\?\([: ].\+\)\?}\|{sot\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_tab}\|{eot}/me=s-1 contains=chordproTag,chordproComment keepend -syn region chordproChord matchgroup=chordproBracket start=/\[/ end=/]/ oneline +syn region chordproChorus start=/{start_of_chorus\(-\w\+\)\?\([: ].\+\)\?}\|{soc\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_chorus}\|{eoc}/me=s-1 contains=chordproTag,chordproChord,chordproAnnotation,chordproComment keepend -syn region chordproTab start=/{start_of_tab}\|{sot}/hs=e+1 end=/{end_of_tab}\|{eot}/he=s-1 contains=chordproTag,chordproComment keepend +syn region chordproBridge start=/{start_of_bridge\(-\w\+\)\?\([: ].\+\)\?}\|{sob\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_bridge}\|{eob}/me=s-1 contains=chordproTag,chordproChord,chordproAnnotation,chordproComment keepend -syn region chordproChorus start=/{start_of_chorus}\|{soc}/hs=e+1 end=/{end_of_chorus}\|{eoc}/he=s-1 contains=chordproTag,chordproChord,chordproComment keepend +syn region chordproAbc start=/{start_of_abc\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_abc}/me=s-1 contains=chordproTag,@Abc keepend syn match chordproComment /^#.*/ " Define the default highlighting. hi def link chordproDirective Statement -hi def link chordproDirWithOpt Statement -hi def link chordproOptions Special +hi def link chordproDirWithArg Statement +hi def link chordproConditional Statement +hi def link chordproCustom Statement +hi def link chordproMetaKeyword Statement +hi def link chordproMetaDataOperator Operator +hi def link chordproMetaDataTag Function +hi def link chordproArguments Special +hi def link chordproArgumentsNumber Number hi def link chordproChord Type +hi def link chordproAnnotation Identifier hi def link chordproTag Constant hi def link chordproTab PreProc hi def link chordproComment Comment hi def link chordproBracket Constant -hi def link chordproDefineKeyword Type +hi def link chordproDefineKeyword Identifier +hi def link chordproMetadata Identifier +hi def link chordproStandardMetadata Identifier hi def chordproChorus term=bold cterm=bold gui=bold +hi def chordproBridge term=italic cterm=italic gui=italic let b:current_syntax = "chordpro" diff --git a/runtime/syntax/clojure.vim b/runtime/syntax/clojure.vim index ffdd5c2ab0f53..0d63728250709 100644 --- a/runtime/syntax/clojure.vim +++ b/runtime/syntax/clojure.vim @@ -1,15 +1,13 @@ -" Vim syntax file -" Language: Clojure -" Authors: Toralf Wittner -" modified by Meikel Brandmeyer -" URL: http://kotka.de/projects/clojure/vimclojure.html -" -" Contributors: Joel Holdbrooks (Regexp support, bug fixes) -" -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 18 July 2016 +" Vim indent file +" Language: Clojure +" Maintainer: Alex Vear +" Former Maintainers: Sung Pae +" Meikel Brandmeyer +" Toralf Wittner +" Contributors: Joel Holdbrooks (Regexp support, bug fixes) +" URL: https://github.com/clojure-vim/clojure.vim +" License: Vim (see :h license) +" Last Change: 2022-03-24 if exists("b:current_syntax") finish @@ -23,20 +21,20 @@ if has("folding") && exists("g:clojure_fold") && g:clojure_fold > 0 endif " -*- KEYWORDS -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.8.0 +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.11.0 let s:clojure_syntax_keywords = { - \ 'clojureBoolean': ["false","true"] - \ , 'clojureCond': ["case","clojure.core/case","clojure.core/cond","clojure.core/cond->","clojure.core/cond->>","clojure.core/condp","clojure.core/if-let","clojure.core/if-not","clojure.core/if-some","clojure.core/when","clojure.core/when-first","clojure.core/when-let","clojure.core/when-not","clojure.core/when-some","cond","cond->","cond->>","condp","if-let","if-not","if-some","when","when-first","when-let","when-not","when-some"] - \ , 'clojureConstant': ["nil"] - \ , 'clojureDefine': ["clojure.core/definline","clojure.core/definterface","clojure.core/defmacro","clojure.core/defmethod","clojure.core/defmulti","clojure.core/defn","clojure.core/defn-","clojure.core/defonce","clojure.core/defprotocol","clojure.core/defrecord","clojure.core/defstruct","clojure.core/deftype","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype"] - \ , 'clojureException': ["catch","finally","throw","try"] - \ , 'clojureFunc': ["*","*'","+","+'","-","-'","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","/","<","<=","=","==",">",">=","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","ancestors","apply","array-map","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn*","bound?","butlast","byte","byte-array","bytes","cast","cat","char","char-array","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","clojure.core/*","clojure.core/*'","clojure.core/+","clojure.core/+'","clojure.core/-","clojure.core/-'","clojure.core/->ArrayChunk","clojure.core/->Eduction","clojure.core/->Vec","clojure.core/->VecNode","clojure.core/->VecSeq","clojure.core/-cache-protocol-fn","clojure.core/-reset-methods","clojure.core//","clojure.core/<","clojure.core/<=","clojure.core/=","clojure.core/==","clojure.core/>","clojure.core/>=","clojure.core/Throwable->map","clojure.core/accessor","clojure.core/aclone","clojure.core/add-classpath","clojure.core/add-watch","clojure.core/agent","clojure.core/agent-error","clojure.core/agent-errors","clojure.core/aget","clojure.core/alength","clojure.core/alias","clojure.core/all-ns","clojure.core/alter","clojure.core/alter-meta!","clojure.core/alter-var-root","clojure.core/ancestors","clojure.core/apply","clojure.core/array-map","clojure.core/aset","clojure.core/aset-boolean","clojure.core/aset-byte","clojure.core/aset-char","clojure.core/aset-double","clojure.core/aset-float","clojure.core/aset-int","clojure.core/aset-long","clojure.core/aset-short","clojure.core/assoc","clojure.core/assoc!","clojure.core/assoc-in","clojure.core/associative?","clojure.core/atom","clojure.core/await","clojure.core/await-for","clojure.core/await1","clojure.core/bases","clojure.core/bean","clojure.core/bigdec","clojure.core/bigint","clojure.core/biginteger","clojure.core/bit-and","clojure.core/bit-and-not","clojure.core/bit-clear","clojure.core/bit-flip","clojure.core/bit-not","clojure.core/bit-or","clojure.core/bit-set","clojure.core/bit-shift-left","clojure.core/bit-shift-right","clojure.core/bit-test","clojure.core/bit-xor","clojure.core/boolean","clojure.core/boolean-array","clojure.core/booleans","clojure.core/bound-fn*","clojure.core/bound?","clojure.core/butlast","clojure.core/byte","clojure.core/byte-array","clojure.core/bytes","clojure.core/cast","clojure.core/cat","clojure.core/char","clojure.core/char-array","clojure.core/char?","clojure.core/chars","clojure.core/chunk","clojure.core/chunk-append","clojure.core/chunk-buffer","clojure.core/chunk-cons","clojure.core/chunk-first","clojure.core/chunk-next","clojure.core/chunk-rest","clojure.core/chunked-seq?","clojure.core/class","clojure.core/class?","clojure.core/clear-agent-errors","clojure.core/clojure-version","clojure.core/coll?","clojure.core/commute","clojure.core/comp","clojure.core/comparator","clojure.core/compare","clojure.core/compare-and-set!","clojure.core/compile","clojure.core/complement","clojure.core/completing","clojure.core/concat","clojure.core/conj","clojure.core/conj!","clojure.core/cons","clojure.core/constantly","clojure.core/construct-proxy","clojure.core/contains?","clojure.core/count","clojure.core/counted?","clojure.core/create-ns","clojure.core/create-struct","clojure.core/cycle","clojure.core/dec","clojure.core/dec'","clojure.core/decimal?","clojure.core/dedupe","clojure.core/delay?","clojure.core/deliver","clojure.core/denominator","clojure.core/deref","clojure.core/derive","clojure.core/descendants","clojure.core/destructure","clojure.core/disj","clojure.core/disj!","clojure.core/dissoc","clojure.core/dissoc!","clojure.core/distinct","clojure.core/distinct?","clojure.core/doall","clojure.core/dorun","clojure.core/double","clojure.core/double-array","clojure.core/doubles","clojure.core/drop","clojure.core/drop-last","clojure.core/drop-while","clojure.core/eduction","clojure.core/empty","clojure.core/empty?","clojure.core/ensure","clojure.core/ensure-reduced","clojure.core/enumeration-seq","clojure.core/error-handler","clojure.core/error-mode","clojure.core/eval","clojure.core/even?","clojure.core/every-pred","clojure.core/every?","clojure.core/ex-data","clojure.core/ex-info","clojure.core/extend","clojure.core/extenders","clojure.core/extends?","clojure.core/false?","clojure.core/ffirst","clojure.core/file-seq","clojure.core/filter","clojure.core/filterv","clojure.core/find","clojure.core/find-keyword","clojure.core/find-ns","clojure.core/find-protocol-impl","clojure.core/find-protocol-method","clojure.core/find-var","clojure.core/first","clojure.core/flatten","clojure.core/float","clojure.core/float-array","clojure.core/float?","clojure.core/floats","clojure.core/flush","clojure.core/fn?","clojure.core/fnext","clojure.core/fnil","clojure.core/force","clojure.core/format","clojure.core/frequencies","clojure.core/future-call","clojure.core/future-cancel","clojure.core/future-cancelled?","clojure.core/future-done?","clojure.core/future?","clojure.core/gensym","clojure.core/get","clojure.core/get-in","clojure.core/get-method","clojure.core/get-proxy-class","clojure.core/get-thread-bindings","clojure.core/get-validator","clojure.core/group-by","clojure.core/hash","clojure.core/hash-combine","clojure.core/hash-map","clojure.core/hash-ordered-coll","clojure.core/hash-set","clojure.core/hash-unordered-coll","clojure.core/identical?","clojure.core/identity","clojure.core/ifn?","clojure.core/in-ns","clojure.core/inc","clojure.core/inc'","clojure.core/init-proxy","clojure.core/instance?","clojure.core/int","clojure.core/int-array","clojure.core/integer?","clojure.core/interleave","clojure.core/intern","clojure.core/interpose","clojure.core/into","clojure.core/into-array","clojure.core/ints","clojure.core/isa?","clojure.core/iterate","clojure.core/iterator-seq","clojure.core/juxt","clojure.core/keep","clojure.core/keep-indexed","clojure.core/key","clojure.core/keys","clojure.core/keyword","clojure.core/keyword?","clojure.core/last","clojure.core/line-seq","clojure.core/list","clojure.core/list*","clojure.core/list?","clojure.core/load","clojure.core/load-file","clojure.core/load-reader","clojure.core/load-string","clojure.core/loaded-libs","clojure.core/long","clojure.core/long-array","clojure.core/longs","clojure.core/macroexpand","clojure.core/macroexpand-1","clojure.core/make-array","clojure.core/make-hierarchy","clojure.core/map","clojure.core/map-entry?","clojure.core/map-indexed","clojure.core/map?","clojure.core/mapcat","clojure.core/mapv","clojure.core/max","clojure.core/max-key","clojure.core/memoize","clojure.core/merge","clojure.core/merge-with","clojure.core/meta","clojure.core/method-sig","clojure.core/methods","clojure.core/min","clojure.core/min-key","clojure.core/mix-collection-hash","clojure.core/mod","clojure.core/munge","clojure.core/name","clojure.core/namespace","clojure.core/namespace-munge","clojure.core/neg?","clojure.core/newline","clojure.core/next","clojure.core/nfirst","clojure.core/nil?","clojure.core/nnext","clojure.core/not","clojure.core/not-any?","clojure.core/not-empty","clojure.core/not-every?","clojure.core/not=","clojure.core/ns-aliases","clojure.core/ns-imports","clojure.core/ns-interns","clojure.core/ns-map","clojure.core/ns-name","clojure.core/ns-publics","clojure.core/ns-refers","clojure.core/ns-resolve","clojure.core/ns-unalias","clojure.core/ns-unmap","clojure.core/nth","clojure.core/nthnext","clojure.core/nthrest","clojure.core/num","clojure.core/number?","clojure.core/numerator","clojure.core/object-array","clojure.core/odd?","clojure.core/parents","clojure.core/partial","clojure.core/partition","clojure.core/partition-all","clojure.core/partition-by","clojure.core/pcalls","clojure.core/peek","clojure.core/persistent!","clojure.core/pmap","clojure.core/pop","clojure.core/pop!","clojure.core/pop-thread-bindings","clojure.core/pos?","clojure.core/pr","clojure.core/pr-str","clojure.core/prefer-method","clojure.core/prefers","clojure.core/print","clojure.core/print-ctor","clojure.core/print-dup","clojure.core/print-method","clojure.core/print-simple","clojure.core/print-str","clojure.core/printf","clojure.core/println","clojure.core/println-str","clojure.core/prn","clojure.core/prn-str","clojure.core/promise","clojure.core/proxy-call-with-super","clojure.core/proxy-mappings","clojure.core/proxy-name","clojure.core/push-thread-bindings","clojure.core/quot","clojure.core/rand","clojure.core/rand-int","clojure.core/rand-nth","clojure.core/random-sample","clojure.core/range","clojure.core/ratio?","clojure.core/rational?","clojure.core/rationalize","clojure.core/re-find","clojure.core/re-groups","clojure.core/re-matcher","clojure.core/re-matches","clojure.core/re-pattern","clojure.core/re-seq","clojure.core/read","clojure.core/read-line","clojure.core/read-string","clojure.core/reader-conditional","clojure.core/reader-conditional?","clojure.core/realized?","clojure.core/record?","clojure.core/reduce","clojure.core/reduce-kv","clojure.core/reduced","clojure.core/reduced?","clojure.core/reductions","clojure.core/ref","clojure.core/ref-history-count","clojure.core/ref-max-history","clojure.core/ref-min-history","clojure.core/ref-set","clojure.core/refer","clojure.core/release-pending-sends","clojure.core/rem","clojure.core/remove","clojure.core/remove-all-methods","clojure.core/remove-method","clojure.core/remove-ns","clojure.core/remove-watch","clojure.core/repeat","clojure.core/repeatedly","clojure.core/replace","clojure.core/replicate","clojure.core/require","clojure.core/reset!","clojure.core/reset-meta!","clojure.core/resolve","clojure.core/rest","clojure.core/restart-agent","clojure.core/resultset-seq","clojure.core/reverse","clojure.core/reversible?","clojure.core/rseq","clojure.core/rsubseq","clojure.core/run!","clojure.core/satisfies?","clojure.core/second","clojure.core/select-keys","clojure.core/send","clojure.core/send-off","clojure.core/send-via","clojure.core/seq","clojure.core/seq?","clojure.core/seque","clojure.core/sequence","clojure.core/sequential?","clojure.core/set","clojure.core/set-agent-send-executor!","clojure.core/set-agent-send-off-executor!","clojure.core/set-error-handler!","clojure.core/set-error-mode!","clojure.core/set-validator!","clojure.core/set?","clojure.core/short","clojure.core/short-array","clojure.core/shorts","clojure.core/shuffle","clojure.core/shutdown-agents","clojure.core/slurp","clojure.core/some","clojure.core/some-fn","clojure.core/some?","clojure.core/sort","clojure.core/sort-by","clojure.core/sorted-map","clojure.core/sorted-map-by","clojure.core/sorted-set","clojure.core/sorted-set-by","clojure.core/sorted?","clojure.core/special-symbol?","clojure.core/spit","clojure.core/split-at","clojure.core/split-with","clojure.core/str","clojure.core/string?","clojure.core/struct","clojure.core/struct-map","clojure.core/subs","clojure.core/subseq","clojure.core/subvec","clojure.core/supers","clojure.core/swap!","clojure.core/symbol","clojure.core/symbol?","clojure.core/tagged-literal","clojure.core/tagged-literal?","clojure.core/take","clojure.core/take-last","clojure.core/take-nth","clojure.core/take-while","clojure.core/test","clojure.core/the-ns","clojure.core/thread-bound?","clojure.core/to-array","clojure.core/to-array-2d","clojure.core/trampoline","clojure.core/transduce","clojure.core/transient","clojure.core/tree-seq","clojure.core/true?","clojure.core/type","clojure.core/unchecked-add","clojure.core/unchecked-add-int","clojure.core/unchecked-byte","clojure.core/unchecked-char","clojure.core/unchecked-dec","clojure.core/unchecked-dec-int","clojure.core/unchecked-divide-int","clojure.core/unchecked-double","clojure.core/unchecked-float","clojure.core/unchecked-inc","clojure.core/unchecked-inc-int","clojure.core/unchecked-int","clojure.core/unchecked-long","clojure.core/unchecked-multiply","clojure.core/unchecked-multiply-int","clojure.core/unchecked-negate","clojure.core/unchecked-negate-int","clojure.core/unchecked-remainder-int","clojure.core/unchecked-short","clojure.core/unchecked-subtract","clojure.core/unchecked-subtract-int","clojure.core/underive","clojure.core/unreduced","clojure.core/unsigned-bit-shift-right","clojure.core/update","clojure.core/update-in","clojure.core/update-proxy","clojure.core/use","clojure.core/val","clojure.core/vals","clojure.core/var-get","clojure.core/var-set","clojure.core/var?","clojure.core/vary-meta","clojure.core/vec","clojure.core/vector","clojure.core/vector-of","clojure.core/vector?","clojure.core/volatile!","clojure.core/volatile?","clojure.core/vreset!","clojure.core/with-bindings*","clojure.core/with-meta","clojure.core/with-redefs-fn","clojure.core/xml-seq","clojure.core/zero?","clojure.core/zipmap","coll?","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","dedupe","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","double","double-array","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn?","fnext","fnil","force","format","frequencies","future-call","future-cancel","future-cancelled?","future-done?","future?","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","identical?","identity","ifn?","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","long","long-array","longs","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy-call-with-super","proxy-mappings","proxy-name","push-thread-bindings","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","use","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","with-bindings*","with-meta","with-redefs-fn","xml-seq","zero?","zipmap"] - \ , 'clojureMacro': ["->","->>","..","amap","and","areduce","as->","assert","binding","bound-fn","clojure.core/->","clojure.core/->>","clojure.core/..","clojure.core/amap","clojure.core/and","clojure.core/areduce","clojure.core/as->","clojure.core/assert","clojure.core/binding","clojure.core/bound-fn","clojure.core/comment","clojure.core/declare","clojure.core/delay","clojure.core/dosync","clojure.core/doto","clojure.core/extend-protocol","clojure.core/extend-type","clojure.core/for","clojure.core/future","clojure.core/gen-class","clojure.core/gen-interface","clojure.core/import","clojure.core/io!","clojure.core/lazy-cat","clojure.core/lazy-seq","clojure.core/letfn","clojure.core/locking","clojure.core/memfn","clojure.core/ns","clojure.core/or","clojure.core/proxy","clojure.core/proxy-super","clojure.core/pvalues","clojure.core/refer-clojure","clojure.core/reify","clojure.core/some->","clojure.core/some->>","clojure.core/sync","clojure.core/time","clojure.core/vswap!","clojure.core/with-bindings","clojure.core/with-in-str","clojure.core/with-loading-context","clojure.core/with-local-vars","clojure.core/with-open","clojure.core/with-out-str","clojure.core/with-precision","clojure.core/with-redefs","comment","declare","delay","dosync","doto","extend-protocol","extend-type","for","future","gen-class","gen-interface","import","io!","lazy-cat","lazy-seq","letfn","locking","memfn","ns","or","proxy","proxy-super","pvalues","refer-clojure","reify","some->","some->>","sync","time","vswap!","with-bindings","with-in-str","with-loading-context","with-local-vars","with-open","with-out-str","with-precision","with-redefs"] - \ , 'clojureRepeat': ["clojure.core/doseq","clojure.core/dotimes","clojure.core/while","doseq","dotimes","while"] - \ , 'clojureSpecial': [".","clojure.core/fn","clojure.core/let","clojure.core/loop","def","do","fn","if","let","loop","monitor-enter","monitor-exit","new","quote","recur","set!","var"] - \ , 'clojureVariable': ["*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","EMPTY-NODE","char-escape-string","char-name-string","clojure.core/*1","clojure.core/*2","clojure.core/*3","clojure.core/*agent*","clojure.core/*allow-unresolved-vars*","clojure.core/*assert*","clojure.core/*clojure-version*","clojure.core/*command-line-args*","clojure.core/*compile-files*","clojure.core/*compile-path*","clojure.core/*compiler-options*","clojure.core/*data-readers*","clojure.core/*default-data-reader-fn*","clojure.core/*e","clojure.core/*err*","clojure.core/*file*","clojure.core/*flush-on-newline*","clojure.core/*fn-loader*","clojure.core/*in*","clojure.core/*math-context*","clojure.core/*ns*","clojure.core/*out*","clojure.core/*print-dup*","clojure.core/*print-length*","clojure.core/*print-level*","clojure.core/*print-meta*","clojure.core/*print-readably*","clojure.core/*read-eval*","clojure.core/*source-path*","clojure.core/*suppress-read*","clojure.core/*unchecked-math*","clojure.core/*use-context-classloader*","clojure.core/*verbose-defrecords*","clojure.core/*warn-on-reflection*","clojure.core/EMPTY-NODE","clojure.core/char-escape-string","clojure.core/char-name-string","clojure.core/default-data-readers","clojure.core/primitives-classnames","clojure.core/unquote","clojure.core/unquote-splicing","default-data-readers","primitives-classnames","unquote","unquote-splicing"] - \ } + \ 'clojureBoolean': ["false","true"], + \ 'clojureCond': ["case","case*","clojure.core/case","clojure.core/cond","clojure.core/cond->","clojure.core/cond->>","clojure.core/condp","clojure.core/if-let","clojure.core/if-not","clojure.core/if-some","clojure.core/when","clojure.core/when-first","clojure.core/when-let","clojure.core/when-not","clojure.core/when-some","cond","cond->","cond->>","condp","if","if-let","if-not","if-some","when","when-first","when-let","when-not","when-some"], + \ 'clojureConstant': ["nil"], + \ 'clojureDefine': ["clojure.core/definline","clojure.core/definterface","clojure.core/defmacro","clojure.core/defmethod","clojure.core/defmulti","clojure.core/defn","clojure.core/defn-","clojure.core/defonce","clojure.core/defprotocol","clojure.core/defrecord","clojure.core/defstruct","clojure.core/deftype","def","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","deftype*"], + \ 'clojureException': ["catch","finally","throw","try"], + \ 'clojureFunc': ["*","*'","+","+'","-","-'","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","/","<","<=","=","==",">",">=","NaN?","PrintWriter-on","StackTraceElement->vec","Throwable->map","abs","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","ancestors","any?","apply","array-map","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","cast","cat","char","char-array","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","clojure.core/*","clojure.core/*'","clojure.core/+","clojure.core/+'","clojure.core/-","clojure.core/-'","clojure.core/->ArrayChunk","clojure.core/->Eduction","clojure.core/->Vec","clojure.core/->VecNode","clojure.core/->VecSeq","clojure.core/-cache-protocol-fn","clojure.core/-reset-methods","clojure.core//","clojure.core/<","clojure.core/<=","clojure.core/=","clojure.core/==","clojure.core/>","clojure.core/>=","clojure.core/NaN?","clojure.core/PrintWriter-on","clojure.core/StackTraceElement->vec","clojure.core/Throwable->map","clojure.core/abs","clojure.core/accessor","clojure.core/aclone","clojure.core/add-classpath","clojure.core/add-tap","clojure.core/add-watch","clojure.core/agent","clojure.core/agent-error","clojure.core/agent-errors","clojure.core/aget","clojure.core/alength","clojure.core/alias","clojure.core/all-ns","clojure.core/alter","clojure.core/alter-meta!","clojure.core/alter-var-root","clojure.core/ancestors","clojure.core/any?","clojure.core/apply","clojure.core/array-map","clojure.core/aset","clojure.core/aset-boolean","clojure.core/aset-byte","clojure.core/aset-char","clojure.core/aset-double","clojure.core/aset-float","clojure.core/aset-int","clojure.core/aset-long","clojure.core/aset-short","clojure.core/assoc","clojure.core/assoc!","clojure.core/assoc-in","clojure.core/associative?","clojure.core/atom","clojure.core/await","clojure.core/await-for","clojure.core/await1","clojure.core/bases","clojure.core/bean","clojure.core/bigdec","clojure.core/bigint","clojure.core/biginteger","clojure.core/bit-and","clojure.core/bit-and-not","clojure.core/bit-clear","clojure.core/bit-flip","clojure.core/bit-not","clojure.core/bit-or","clojure.core/bit-set","clojure.core/bit-shift-left","clojure.core/bit-shift-right","clojure.core/bit-test","clojure.core/bit-xor","clojure.core/boolean","clojure.core/boolean-array","clojure.core/boolean?","clojure.core/booleans","clojure.core/bound-fn*","clojure.core/bound?","clojure.core/bounded-count","clojure.core/butlast","clojure.core/byte","clojure.core/byte-array","clojure.core/bytes","clojure.core/bytes?","clojure.core/cast","clojure.core/cat","clojure.core/char","clojure.core/char-array","clojure.core/char?","clojure.core/chars","clojure.core/chunk","clojure.core/chunk-append","clojure.core/chunk-buffer","clojure.core/chunk-cons","clojure.core/chunk-first","clojure.core/chunk-next","clojure.core/chunk-rest","clojure.core/chunked-seq?","clojure.core/class","clojure.core/class?","clojure.core/clear-agent-errors","clojure.core/clojure-version","clojure.core/coll?","clojure.core/commute","clojure.core/comp","clojure.core/comparator","clojure.core/compare","clojure.core/compare-and-set!","clojure.core/compile","clojure.core/complement","clojure.core/completing","clojure.core/concat","clojure.core/conj","clojure.core/conj!","clojure.core/cons","clojure.core/constantly","clojure.core/construct-proxy","clojure.core/contains?","clojure.core/count","clojure.core/counted?","clojure.core/create-ns","clojure.core/create-struct","clojure.core/cycle","clojure.core/dec","clojure.core/dec'","clojure.core/decimal?","clojure.core/dedupe","clojure.core/delay?","clojure.core/deliver","clojure.core/denominator","clojure.core/deref","clojure.core/derive","clojure.core/descendants","clojure.core/destructure","clojure.core/disj","clojure.core/disj!","clojure.core/dissoc","clojure.core/dissoc!","clojure.core/distinct","clojure.core/distinct?","clojure.core/doall","clojure.core/dorun","clojure.core/double","clojure.core/double-array","clojure.core/double?","clojure.core/doubles","clojure.core/drop","clojure.core/drop-last","clojure.core/drop-while","clojure.core/eduction","clojure.core/empty","clojure.core/empty?","clojure.core/ensure","clojure.core/ensure-reduced","clojure.core/enumeration-seq","clojure.core/error-handler","clojure.core/error-mode","clojure.core/eval","clojure.core/even?","clojure.core/every-pred","clojure.core/every?","clojure.core/ex-cause","clojure.core/ex-data","clojure.core/ex-info","clojure.core/ex-message","clojure.core/extend","clojure.core/extenders","clojure.core/extends?","clojure.core/false?","clojure.core/ffirst","clojure.core/file-seq","clojure.core/filter","clojure.core/filterv","clojure.core/find","clojure.core/find-keyword","clojure.core/find-ns","clojure.core/find-protocol-impl","clojure.core/find-protocol-method","clojure.core/find-var","clojure.core/first","clojure.core/flatten","clojure.core/float","clojure.core/float-array","clojure.core/float?","clojure.core/floats","clojure.core/flush","clojure.core/fn?","clojure.core/fnext","clojure.core/fnil","clojure.core/force","clojure.core/format","clojure.core/frequencies","clojure.core/future-call","clojure.core/future-cancel","clojure.core/future-cancelled?","clojure.core/future-done?","clojure.core/future?","clojure.core/gensym","clojure.core/get","clojure.core/get-in","clojure.core/get-method","clojure.core/get-proxy-class","clojure.core/get-thread-bindings","clojure.core/get-validator","clojure.core/group-by","clojure.core/halt-when","clojure.core/hash","clojure.core/hash-combine","clojure.core/hash-map","clojure.core/hash-ordered-coll","clojure.core/hash-set","clojure.core/hash-unordered-coll","clojure.core/ident?","clojure.core/identical?","clojure.core/identity","clojure.core/ifn?","clojure.core/in-ns","clojure.core/inc","clojure.core/inc'","clojure.core/indexed?","clojure.core/infinite?","clojure.core/init-proxy","clojure.core/inst-ms","clojure.core/inst-ms*","clojure.core/inst?","clojure.core/instance?","clojure.core/int","clojure.core/int-array","clojure.core/int?","clojure.core/integer?","clojure.core/interleave","clojure.core/intern","clojure.core/interpose","clojure.core/into","clojure.core/into-array","clojure.core/ints","clojure.core/isa?","clojure.core/iterate","clojure.core/iteration","clojure.core/iterator-seq","clojure.core/juxt","clojure.core/keep","clojure.core/keep-indexed","clojure.core/key","clojure.core/keys","clojure.core/keyword","clojure.core/keyword?","clojure.core/last","clojure.core/line-seq","clojure.core/list","clojure.core/list*","clojure.core/list?","clojure.core/load","clojure.core/load-file","clojure.core/load-reader","clojure.core/load-string","clojure.core/loaded-libs","clojure.core/long","clojure.core/long-array","clojure.core/longs","clojure.core/macroexpand","clojure.core/macroexpand-1","clojure.core/make-array","clojure.core/make-hierarchy","clojure.core/map","clojure.core/map-entry?","clojure.core/map-indexed","clojure.core/map?","clojure.core/mapcat","clojure.core/mapv","clojure.core/max","clojure.core/max-key","clojure.core/memoize","clojure.core/merge","clojure.core/merge-with","clojure.core/meta","clojure.core/method-sig","clojure.core/methods","clojure.core/min","clojure.core/min-key","clojure.core/mix-collection-hash","clojure.core/mod","clojure.core/munge","clojure.core/name","clojure.core/namespace","clojure.core/namespace-munge","clojure.core/nat-int?","clojure.core/neg-int?","clojure.core/neg?","clojure.core/newline","clojure.core/next","clojure.core/nfirst","clojure.core/nil?","clojure.core/nnext","clojure.core/not","clojure.core/not-any?","clojure.core/not-empty","clojure.core/not-every?","clojure.core/not=","clojure.core/ns-aliases","clojure.core/ns-imports","clojure.core/ns-interns","clojure.core/ns-map","clojure.core/ns-name","clojure.core/ns-publics","clojure.core/ns-refers","clojure.core/ns-resolve","clojure.core/ns-unalias","clojure.core/ns-unmap","clojure.core/nth","clojure.core/nthnext","clojure.core/nthrest","clojure.core/num","clojure.core/number?","clojure.core/numerator","clojure.core/object-array","clojure.core/odd?","clojure.core/parents","clojure.core/parse-boolean","clojure.core/parse-double","clojure.core/parse-long","clojure.core/parse-uuid","clojure.core/partial","clojure.core/partition","clojure.core/partition-all","clojure.core/partition-by","clojure.core/pcalls","clojure.core/peek","clojure.core/persistent!","clojure.core/pmap","clojure.core/pop","clojure.core/pop!","clojure.core/pop-thread-bindings","clojure.core/pos-int?","clojure.core/pos?","clojure.core/pr","clojure.core/pr-str","clojure.core/prefer-method","clojure.core/prefers","clojure.core/print","clojure.core/print-ctor","clojure.core/print-dup","clojure.core/print-method","clojure.core/print-simple","clojure.core/print-str","clojure.core/printf","clojure.core/println","clojure.core/println-str","clojure.core/prn","clojure.core/prn-str","clojure.core/promise","clojure.core/proxy-call-with-super","clojure.core/proxy-mappings","clojure.core/proxy-name","clojure.core/push-thread-bindings","clojure.core/qualified-ident?","clojure.core/qualified-keyword?","clojure.core/qualified-symbol?","clojure.core/quot","clojure.core/rand","clojure.core/rand-int","clojure.core/rand-nth","clojure.core/random-sample","clojure.core/random-uuid","clojure.core/range","clojure.core/ratio?","clojure.core/rational?","clojure.core/rationalize","clojure.core/re-find","clojure.core/re-groups","clojure.core/re-matcher","clojure.core/re-matches","clojure.core/re-pattern","clojure.core/re-seq","clojure.core/read","clojure.core/read+string","clojure.core/read-line","clojure.core/read-string","clojure.core/reader-conditional","clojure.core/reader-conditional?","clojure.core/realized?","clojure.core/record?","clojure.core/reduce","clojure.core/reduce-kv","clojure.core/reduced","clojure.core/reduced?","clojure.core/reductions","clojure.core/ref","clojure.core/ref-history-count","clojure.core/ref-max-history","clojure.core/ref-min-history","clojure.core/ref-set","clojure.core/refer","clojure.core/release-pending-sends","clojure.core/rem","clojure.core/remove","clojure.core/remove-all-methods","clojure.core/remove-method","clojure.core/remove-ns","clojure.core/remove-tap","clojure.core/remove-watch","clojure.core/repeat","clojure.core/repeatedly","clojure.core/replace","clojure.core/replicate","clojure.core/require","clojure.core/requiring-resolve","clojure.core/reset!","clojure.core/reset-meta!","clojure.core/reset-vals!","clojure.core/resolve","clojure.core/rest","clojure.core/restart-agent","clojure.core/resultset-seq","clojure.core/reverse","clojure.core/reversible?","clojure.core/rseq","clojure.core/rsubseq","clojure.core/run!","clojure.core/satisfies?","clojure.core/second","clojure.core/select-keys","clojure.core/send","clojure.core/send-off","clojure.core/send-via","clojure.core/seq","clojure.core/seq-to-map-for-destructuring","clojure.core/seq?","clojure.core/seqable?","clojure.core/seque","clojure.core/sequence","clojure.core/sequential?","clojure.core/set","clojure.core/set-agent-send-executor!","clojure.core/set-agent-send-off-executor!","clojure.core/set-error-handler!","clojure.core/set-error-mode!","clojure.core/set-validator!","clojure.core/set?","clojure.core/short","clojure.core/short-array","clojure.core/shorts","clojure.core/shuffle","clojure.core/shutdown-agents","clojure.core/simple-ident?","clojure.core/simple-keyword?","clojure.core/simple-symbol?","clojure.core/slurp","clojure.core/some","clojure.core/some-fn","clojure.core/some?","clojure.core/sort","clojure.core/sort-by","clojure.core/sorted-map","clojure.core/sorted-map-by","clojure.core/sorted-set","clojure.core/sorted-set-by","clojure.core/sorted?","clojure.core/special-symbol?","clojure.core/spit","clojure.core/split-at","clojure.core/split-with","clojure.core/str","clojure.core/string?","clojure.core/struct","clojure.core/struct-map","clojure.core/subs","clojure.core/subseq","clojure.core/subvec","clojure.core/supers","clojure.core/swap!","clojure.core/swap-vals!","clojure.core/symbol","clojure.core/symbol?","clojure.core/tagged-literal","clojure.core/tagged-literal?","clojure.core/take","clojure.core/take-last","clojure.core/take-nth","clojure.core/take-while","clojure.core/tap>","clojure.core/test","clojure.core/the-ns","clojure.core/thread-bound?","clojure.core/to-array","clojure.core/to-array-2d","clojure.core/trampoline","clojure.core/transduce","clojure.core/transient","clojure.core/tree-seq","clojure.core/true?","clojure.core/type","clojure.core/unchecked-add","clojure.core/unchecked-add-int","clojure.core/unchecked-byte","clojure.core/unchecked-char","clojure.core/unchecked-dec","clojure.core/unchecked-dec-int","clojure.core/unchecked-divide-int","clojure.core/unchecked-double","clojure.core/unchecked-float","clojure.core/unchecked-inc","clojure.core/unchecked-inc-int","clojure.core/unchecked-int","clojure.core/unchecked-long","clojure.core/unchecked-multiply","clojure.core/unchecked-multiply-int","clojure.core/unchecked-negate","clojure.core/unchecked-negate-int","clojure.core/unchecked-remainder-int","clojure.core/unchecked-short","clojure.core/unchecked-subtract","clojure.core/unchecked-subtract-int","clojure.core/underive","clojure.core/unreduced","clojure.core/unsigned-bit-shift-right","clojure.core/update","clojure.core/update-in","clojure.core/update-keys","clojure.core/update-proxy","clojure.core/update-vals","clojure.core/uri?","clojure.core/use","clojure.core/uuid?","clojure.core/val","clojure.core/vals","clojure.core/var-get","clojure.core/var-set","clojure.core/var?","clojure.core/vary-meta","clojure.core/vec","clojure.core/vector","clojure.core/vector-of","clojure.core/vector?","clojure.core/volatile!","clojure.core/volatile?","clojure.core/vreset!","clojure.core/with-bindings*","clojure.core/with-meta","clojure.core/with-redefs-fn","clojure.core/xml-seq","clojure.core/zero?","clojure.core/zipmap","coll?","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","dedupe","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","extend","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn?","fnext","fnil","force","format","frequencies","future-call","future-cancel","future-cancelled?","future-done?","future?","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","ifn?","in-ns","inc","inc'","indexed?","infinite?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","isa?","iterate","iteration","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","long","long-array","longs","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","parents","parse-boolean","parse-double","parse-long","parse-uuid","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy-call-with-super","proxy-mappings","proxy-name","push-thread-bindings","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","random-uuid","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq-to-map-for-destructuring","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unreduced","unsigned-bit-shift-right","update","update-in","update-keys","update-proxy","update-vals","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","with-bindings*","with-meta","with-redefs-fn","xml-seq","zero?","zipmap"], + \ 'clojureMacro': ["->","->>","..","amap","and","areduce","as->","assert","binding","bound-fn","clojure.core/->","clojure.core/->>","clojure.core/..","clojure.core/amap","clojure.core/and","clojure.core/areduce","clojure.core/as->","clojure.core/assert","clojure.core/binding","clojure.core/bound-fn","clojure.core/comment","clojure.core/declare","clojure.core/delay","clojure.core/dosync","clojure.core/doto","clojure.core/extend-protocol","clojure.core/extend-type","clojure.core/for","clojure.core/future","clojure.core/gen-class","clojure.core/gen-interface","clojure.core/import","clojure.core/io!","clojure.core/lazy-cat","clojure.core/lazy-seq","clojure.core/locking","clojure.core/memfn","clojure.core/ns","clojure.core/or","clojure.core/proxy","clojure.core/proxy-super","clojure.core/pvalues","clojure.core/refer-clojure","clojure.core/reify","clojure.core/some->","clojure.core/some->>","clojure.core/sync","clojure.core/time","clojure.core/vswap!","clojure.core/with-bindings","clojure.core/with-in-str","clojure.core/with-loading-context","clojure.core/with-local-vars","clojure.core/with-open","clojure.core/with-out-str","clojure.core/with-precision","clojure.core/with-redefs","comment","declare","delay","dosync","doto","extend-protocol","extend-type","for","future","gen-class","gen-interface","import","io!","lazy-cat","lazy-seq","locking","memfn","ns","or","proxy","proxy-super","pvalues","refer-clojure","reify","some->","some->>","sync","time","vswap!","with-bindings","with-in-str","with-loading-context","with-local-vars","with-open","with-out-str","with-precision","with-redefs"], + \ 'clojureRepeat': ["clojure.core/doseq","clojure.core/dotimes","clojure.core/loop","clojure.core/while","doseq","dotimes","loop","loop*","recur","while"], + \ 'clojureSpecial': ["&",".","clojure.core/fn","clojure.core/import*","clojure.core/let","clojure.core/letfn","do","fn","fn*","let","let*","letfn","letfn*","monitor-enter","monitor-exit","new","quote","reify*","set!","var"], + \ 'clojureVariable': ["*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","EMPTY-NODE","Inst","char-escape-string","char-name-string","clojure.core/*1","clojure.core/*2","clojure.core/*3","clojure.core/*agent*","clojure.core/*allow-unresolved-vars*","clojure.core/*assert*","clojure.core/*clojure-version*","clojure.core/*command-line-args*","clojure.core/*compile-files*","clojure.core/*compile-path*","clojure.core/*compiler-options*","clojure.core/*data-readers*","clojure.core/*default-data-reader-fn*","clojure.core/*e","clojure.core/*err*","clojure.core/*file*","clojure.core/*flush-on-newline*","clojure.core/*fn-loader*","clojure.core/*in*","clojure.core/*math-context*","clojure.core/*ns*","clojure.core/*out*","clojure.core/*print-dup*","clojure.core/*print-length*","clojure.core/*print-level*","clojure.core/*print-meta*","clojure.core/*print-namespace-maps*","clojure.core/*print-readably*","clojure.core/*read-eval*","clojure.core/*reader-resolver*","clojure.core/*source-path*","clojure.core/*suppress-read*","clojure.core/*unchecked-math*","clojure.core/*use-context-classloader*","clojure.core/*verbose-defrecords*","clojure.core/*warn-on-reflection*","clojure.core/EMPTY-NODE","clojure.core/Inst","clojure.core/char-escape-string","clojure.core/char-name-string","clojure.core/default-data-readers","clojure.core/primitives-classnames","clojure.core/print-dup","clojure.core/print-method","clojure.core/unquote","clojure.core/unquote-splicing","default-data-readers","primitives-classnames","print-dup","print-method","unquote","unquote-splicing"] + \ } function! s:syntax_keyword(dict) for key in keys(a:dict) @@ -70,40 +68,21 @@ delfunction s:syntax_keyword " * Must not end in a : or / " * Must not have two adjacent colons except at the beginning " * Must not contain any reader metacharacters except for ' and # -syntax match clojureKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\t()\[\]{}";@^`~\\%/]+:@" +syntax match clojureKeyword "\v<:{1,2}([^ \n\r\t()\[\]{}";@^`~\\/]+/)*[^ \n\r\t()\[\]{}";@^`~\\/]+:@1" syntax match clojureStringEscape "\v\\%([\\btnfr"]|u\x{4}|[0-3]\o{2}|\o{1,2})" contained syntax region clojureString matchgroup=clojureStringDelimiter start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape,@Spell -syntax match clojureCharacter "\\." -syntax match clojureCharacter "\\o\%([0-3]\o\{2\}\|\o\{1,2\}\)" -syntax match clojureCharacter "\\u\x\{4\}" -syntax match clojureCharacter "\\space" -syntax match clojureCharacter "\\tab" -syntax match clojureCharacter "\\newline" -syntax match clojureCharacter "\\return" -syntax match clojureCharacter "\\backspace" -syntax match clojureCharacter "\\formfeed" - -syntax match clojureSymbol "\v%([a-zA-Z!$&*_+=|<.>?-]|[^\x00-\x7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x00-\x7F]))*[#:]@"' -endfor -unlet! s:radix_chars s:radix - -syntax match clojureNumber "\v<[-+]?%(0\o*|0x\x+|[1-9]\d*)N?>" -syntax match clojureNumber "\v<[-+]?%(0|[1-9]\d*|%(0|[1-9]\d*)\.\d*)%(M|[eE][-+]?\d+)?>" -syntax match clojureNumber "\v<[-+]?%(0|[1-9]\d*)/%(0|[1-9]\d*)>" - -syntax match clojureVarArg "&" - -syntax match clojureQuote "'" -syntax match clojureQuote "`" -syntax match clojureUnquote "\~" -syntax match clojureUnquote "\~@" +syntax match clojureCharacter "\v\\%(o%([0-3]\o{2}|\o{1,2})|u\x{4}|newline|tab|space|return|backspace|formfeed|.)" + +syntax match clojureSymbol "\v%([a-zA-Z!$&*_+=|<.>?-]|[^\x00-\x7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x00-\x7F]))*[#:]@1" + +syntax match clojureQuote "\v['`]" +syntax match clojureUnquote "\v\~\@?" syntax match clojureMeta "\^" syntax match clojureDeref "@" syntax match clojureDispatch "\v#[\^'=<_]?" @@ -116,16 +95,16 @@ syntax region clojureRegexpQuoted start=/\\Q/ms=e+1 skip=/\\\\\|\\"/ end=/\\E/me syntax region clojureRegexpQuote start=/\\Q/ skip=/\\\\\|\\"/ end=/\\E/ end=/"/me=s-1 contains=clojureRegexpQuoted keepend contained " -*- CHARACTER PROPERTY CLASSES -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj -" Java version 1.8.0_92 +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj +" Java version 17.0.2 syntax match clojureRegexpPosixCharClass "\v\\[pP]\{%(Cntrl|A%(l%(pha|num)|SCII)|Space|Graph|Upper|P%(rint|unct)|Blank|XDigit|Digit|Lower)\}" contained display syntax match clojureRegexpJavaCharClass "\v\\[pP]\{java%(Whitespace|JavaIdentifier%(Part|Start)|SpaceChar|Mirrored|TitleCase|I%(SOControl|de%(ographic|ntifierIgnorable))|D%(efined|igit)|U%(pperCase|nicodeIdentifier%(Part|Start))|L%(etter%(OrDigit)?|owerCase)|Alphabetic)\}" contained display syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\cIs%(l%(owercase|etter)|hex%(digit|_digit)|w%(hite%(_space|space)|ord)|noncharacter%(_code_point|codepoint)|p%(rint|unctuation)|ideographic|graph|a%(l%(num|phabetic)|ssigned)|uppercase|join%(control|_control)|titlecase|blank|digit|control)\}" contained display syntax match clojureRegexpUnicodeCharClass "\v\\[pP][NSCMZPL]" contained display syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{%(N[dlo]?|P[dcifeos]?|C[ncfos]?|M[nce]?|Z[lsp]?|S[mcko]?|L[muCDlto]?)\}" contained display syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{%(Is|gc\=|general_category\=)?%(N[dlo]?|P[dcifeos]?|C[ncfos]?|M[nce]?|Z[lsp]?|S[mcko]?|L[muCDlto]?)\}" contained display -syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\c%(Is|sc\=|script\=)%(l%(epc%(ha)?|y%([dc]i%(an)?)|a%(t%(n|in)|na|oo?)|i%(n%(b|ear_b)|mbu?|su))|p%(rti|lrd|h%(oenician|li|ag%(s_pa)?|nx))|vaii?|d%(srt|e%(seret|va%(nagari)?))|g%(lag%(olitic)?|eor%(gian)?|oth%(ic)?|re%(k|ek)|u%(j%(arati|r)|r%(u|mukhi)))|u%(gar%(itic)?|nknown)|a%(r%(ab%(ic)?|m%([ni]|enian))|v%(st|estan))|e%(thi%(opic)?|gyp%(tian_hieroglyphs)?)|z%(inh|yyy|zzz)|r%(un%(ic|r)|ejang|jng)|s%(inh%(ala)?|h%(rd|a%(vian|rada|w))|a%(ur%(ashtra)?|m%(r|aritan)|rb)|y%(r%(c|iac)|lo%(ti_nagri)?)|und%(anese)?|ora%(_sompeng)?)|i%(n%(scriptional_pa%(rthian|hlavi)|herited)|mperial_aramaic|tal)|b%(eng%(ali)?|a%(t%(ak|k)|li%(nese)?|mum?)|ra%(i%(lle)?|h%(mi)?)|opo%(mofo)?|u%(gi%(nese)?|h%(d|id)))|o%(g%(am|ham)|r%(iya|kh|ya)|sma%(nya)?|l%(d_%(south_arabian|persian|italic|turkic)|ck|_chiki))|k%(h%(m%(r|er)|ar%(oshthi)?)|nda|a%(li|n%(a|nada)|takana|yah_li|ithi)|thi)|m%(a%(nd%(aic)?|layalam)|lym|y%(anmar|mr)|tei|e%(r%(c|o%(itic_%(hieroglyphs|cursive))?)|etei_mayek)|ong%(olian)?|iao)|yi%(ii)?|x%(peo|sux)|n%(ew_tai_lue|koo?)|h%(ira%(gana)?|an%([io]|unoo|g%(ul)?)?|ebr%(ew)?)|c%(y%(priot|r%(l|illic))|a%(km|n%(adian_aboriginal|s)|ri%(an)?)|prt|h%(er%(okee)?|a%(m|kma))|uneiform|o%(pt%(ic)?|mmon))|t%(elu%(gu)?|i%(finagh|b%(t|etan))|ha%(i|a%(na)?)|a%(i_%(le|tham|viet)|g%(alog|b%(anwa)?)|vt|kri?|l[ue]|m%(il|l))|fng|glg)|java%(nese)?)\}" contained display -syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\c%(In|blk\=|block\=)%(javanese|h%(a%(lfwidth%( and fullwidth forms|andfullwidthforms|_and_fullwidth_forms)|n%(unoo|gul%(compatibilityjamo|syllables|jamo%(extended\-[ab])?|_%(syllables|jamo%(_extended_[ab])?|compatibility_jamo)| %(syllables|compatibility jamo|jamo%( extended\-[ab])?))))|i%(ragana|gh%( %(private use surrogates|surrogates)|_%(private_use_surrogates|surrogates)|surrogates|privateusesurrogates))|ebrew)|i%(pa%([ _]extensions|extensions)|deographic%( description characters|_description_characters|descriptioncharacters)|nscriptional%(%([ _]pa%(rthian|hlavi))|pa%(rthian|hlavi))|mperial%(aramaic|[_ ]aramaic))|l%(e%(tterlike%([_ ]symbols|symbols)|pcha)|ow%([_ ]surrogates|surrogates)|i%(mbu|near%(_b_%(ideograms|syllabary)|b%(ideograms|syllabary)| b %(ideograms|syllabary))|su)|a%(tin%(extended%(additional|\-[dacb])| extended%( additional|\-[dacb])|\-1%(supplement| supplement)|_%(extended_%([dcb]|a%(dditional)?)|1_supplement))|o)|y[cd]ian)|b%(u%(ginese|hid)|ra%(hmi|ille%(patterns|[_ ]patterns))|o%(x%([ _]drawing|drawing)|pomofo%([ _]extended|extended)?)|lock%([ _]elements|elements)|yzantine%( musical symbols|musicalsymbols|_musical_symbols)|engali|a%(linese|mum%(supplement|[ _]supplement)?|tak|sic%([ _]latin|latin)))|e%(gyptian%([ _]hieroglyphs|hieroglyphs)|moticons|nclosed%( %(cjk letters and months|ideographic supplement|alphanumeric%( supplement|s))|cjklettersandmonths|_%(ideographic_supplement|alphanumeric%(_supplement|s)|cjk_letters_and_months)|alphanumerics%(upplement)?|ideographicsupplement)|thiopic%(supplement|_%(supplement|extended%(_a)?)| %(supplement|extended%(\-a)?)|extended%(\-a)?)?)|k%(h%(aroshthi|mer%([_ ]symbols|symbols)?)|a%(takana%(_phonetic_extensions|phoneticextensions| phonetic extensions)?|n%(gxi%([_ ]radicals|radicals)|a%(supplement|[ _]supplement)|bun|nada)|ithi|yah%([ _]li|li)))|m%(i%(ao|scellaneous%(technical|symbols%(and%(pictographs|arrows))?|mathematicalsymbols\-[ab]| %(technical|mathematical symbols\-[ab]|symbols%( and %(pictographs|arrows))?)|_%(technical|symbols%(_and_%(pictographs|arrows))?|mathematical_symbols_[ab])))|usical%([_ ]symbols|symbols)|e%(etei%(mayek%(extensions)?|_mayek%(_extensions)?| mayek%( extensions)?)|roitic%(hieroglyphs|%([_ ]%(hieroglyphs|cursive))|cursive))|a%(ndaic|hjong%([ _]tiles|tiles)|layalam|thematical%(alphanumericsymbols| %(alphanumeric symbols|operators)|_%(alphanumeric_symbols|operators)|operators))|yanmar%(extended\-a|_extended_a| extended\-a)?|o%(difier%(_tone_letters| tone letters|toneletters)|ngolian))|r%(u%(nic|mi%(numeralsymbols| numeral symbols|_numeral_symbols))|ejang)|n%(umber%(forms|[ _]forms)|ko|ew%(_tai_lue|tailue| tai lue))|c%(o%(ntrol%(pictures|[ _]pictures)|m%(bining%(diacriticalmarks%(supplement|forsymbols)?|halfmarks| %(diacritical marks%( %(supplement|for symbols))?|half marks|marks for symbols)|marksforsymbols|_%(marks_for_symbols|half_marks|diacritical_marks%(_supplement)?))|mon%(_indic_number_forms|indicnumberforms| indic number forms))|ptic|unting%( rod numerals|_rod_numerals|rodnumerals))|y%(rillic%(extended\-[ab]|_%(extended_[ab]|supplementary)|supplement%(ary)?| %(extended\-[ab]|supplement%(ary)?))?|priot%(syllabary|[ _]syllabary))|u%(rrency%([_ ]symbols|symbols)|neiform%(_numbers_and_punctuation|numbersandpunctuation| numbers and punctuation)?)|h%(a%(m|kma)|erokee)|arian|jk%(s%(ymbolsandpunctuation|trokes)|compatibility%(forms|ideographs%(supplement)?)?|radicalssupplement| %(compatibility%( %(ideographs%( supplement)?|forms))?|radicals supplement|unified ideographs%( extension [dacb])?|s%(ymbols and punctuation|trokes))|_%(s%(trokes|ymbols_and_punctuation)|radicals_supplement|compatibility%(_%(forms|ideographs%(_supplement)?))?|unified_ideographs%(_extension_[dacb])?)|unifiedideographs%(extension[dacb])?))|d%(e%(seret|vanagari%([ _]extended|extended)?)|ingbats|omino%([ _]tiles|tiles))|yi%(syllables|%([_ ]%(syllables|radicals))|radicals|jing%(hexagramsymbols| hexagram symbols|_hexagram_symbols))|s%(mall%( form variants|formvariants|_form_variants)|p%(acing%(_modifier_letters| modifier letters|modifierletters)|ecials)|ora%(sompeng|[ _]sompeng)|ha%(vian|rada)|a%(maritan|urashtra)|inhala|y%(riac|loti%([_ ]nagri|nagri))|u%(ndanese%(supplement|[ _]supplement)?|p%(erscripts%(_and_subscripts|andsubscripts| and subscripts)|plementa%(ry%(_private_use_area_[ab]|privateusearea\-[ab]| private use area\-[ab])|l%(_%(arrows_[ab]|mathematical_operators|punctuation)| %(mathematical operators|punctuation|arrows\-[ab])|mathematicaloperators|punctuation|arrows\-[ab])))|rrogates_area))|p%(h%(o%(enician|netic%( extensions%( supplement)?|extensions%(supplement)?|_extensions%(_supplement)?))|a%(istos%([ _]disc|disc)|gs[_\-]pa))|laying%(cards|[_ ]cards)|rivate%(usearea| use area|_use_area))|o%(smanya|l%([ _]chiki|d%( %(south arabian|persian|italic|turkic)|southarabian|_%(south_arabian|persian|italic|turkic)|persian|italic|turkic)|chiki)|riya|ptical%( character recognition|_character_recognition|characterrecognition)|gham)|g%(u%(jarati|rmukhi)|othic|lagolitic|e%(o%(rgian%(supplement|[ _]supplement)?|metric%(shapes|[ _]shapes))|neral%([_ ]punctuation|punctuation))|reek%( %(and coptic|extended)|andcoptic|_extended|extended)?)|t%(i%(betan|finagh)|elugu|ransport%( and map symbols|_and_map_symbols|andmapsymbols)|a%(mil|kri|i%(xuanjingsymbols|_%(le|xuan_jing_symbols|tham|viet)|le| %(xuan jing symbols|le|tham|viet)|tham|viet)|g%(alog|s|banwa))|ha%(i|ana))|a%(l%(chemical%([_ ]symbols|symbols)|phabetic%( presentation forms|_presentation_forms|presentationforms))|r%(menian|abic%(extended\-a|mathematicalalphabeticsymbols|supplement|_%(presentation_forms_[ab]|supplement|extended_a|mathematical_alphabetic_symbols)| %(extended\-a|mathematical alphabetic symbols|supplement|presentation forms\-[ab])|presentationforms\-[ab])?|rows)|ncient%(_%(greek_%(musical_notation|numbers)|symbols)|greek%(numbers|musicalnotation)| %(greek %(numbers|musical notation)|symbols)|symbols)|egean%(numbers|[ _]numbers)|vestan)|u%(garitic|nified%(canadianaboriginalsyllabics%(extended)?|_canadian_aboriginal_syllabics%(_extended)?| canadian aboriginal syllabics%( extended)?))|v%(a%(i|riation%( selectors%( supplement)?|selectors%(supplement)?|_selectors%(_supplement)?))|e%(rtical%(forms|[ _]forms)|dic%([ _]extensions|extensions))))\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\c%(Is|sc\=|script\=)%(k%(its|h%(oj%(ki)?|m%(r|er)|itan_small_script|udawadi|ar%(oshthi)?)|a%(li|n%(a|nada)|takana%(_or_hiragana)?|yah_li|ithi)|nda|thi)|r%(ohg|un%(ic|r)|ejang|jng)|l%(epc%(ha)?|i%(mbu?|n%([ab]|ear_[ab])|su)|y%([dc]i%(an)?)|a%(t%(n|in)|na|oo?))|t%(elu%(gu)?|ha%(i|a%(na)?)|i%(finagh|rh%(uta)?|b%(t|etan))|fng|glg|a%(i_%(le|tham|viet)|g%(alog|b%(anwa)?)|vt|kri?|ng%(ut)?|l[ue]|m%(il|l)))|vaii?|y%(i%(ii)?|ezi%(di)?)|e%(thi%(opic)?|l%(ym%(aic)?|ba%(san)?)|gyp%(tian_hieroglyphs)?)|u%(gar%(itic)?|nknown)|h%(ung|ira%(gana)?|rkt|mn[gp]|a%(n%(i%(fi_rohingya)?|unoo|o|g%(ul)?)?|tr%(an)?)|luw|ebr%(ew)?)|g%(r%(e%(k|ek)|an%(tha)?)|lag%(olitic)?|eor%(gian)?|o%(n[mg]|th%(ic)?)|u%(j%(arati|r)|r%(u|mukhi)|njala_gondi))|m%(lym|a%(n%(d%(aic)?|i%(chaean)?)|saram_gondi|h%(ajani|j)|ka%(sar)?|rc%(hen)?|layalam)|o%(di|ng%(olian)?)|e%(r%(c|o%(itic_%(hieroglyphs|cursive))?)|etei_mayek|nd%(e_kikakui)?|d%(f|efaidrin))|roo?|y%(anmar|mr)|tei|iao|ult%(ani)?)|d%(upl%(oyan)?|srt|i%(ak|ves_akuru)|ogra?|e%(seret|va%(nagari)?))|z%(an%(abazar_square|b)|inh|yyy|zzz)|n%(yiakeng_puachue_hmong|bat|koo?|ew%(_tai_lue|a)|ushu|shu|a%(bataean|rb|nd%(inagari)?))|s%(h%(rd|a%(vian|rada|w))|o%(yo%(mbo)?|g%(d%(ian)?|o)|ra%(_sompeng)?)|i%(n%(d|h%(ala)?)|dd%(ham)?|gnwriting)|a%(ur%(ashtra)?|m%(r|aritan)|rb)|y%(r%(c|iac)|lo%(ti_nagri)?)|und%(anese)?|gnw)|w%(cho|a%(ncho|ra%(ng_citi)?))|c%(y%(priot|r%(l|illic))|h%(er%(okee)?|a%(m|kma)|rs|orasmian)|a%(km|ucasian_albanian|n%(adian_aboriginal|s)|ri%(an)?)|prt|uneiform|o%(pt%(ic)?|mmon))|i%(n%(scriptional_pa%(rthian|hlavi)|herited)|mperial_aramaic|tal)|p%(h%(l[ip]|oenician|ag%(s_pa)?|nx)|a%(lm%(yrene)?|u%(_cin_hau|c)|hawh_hmong)|rti|salter_pahlavi|lrd|erm)|x%(peo|sux)|b%(eng%(ali)?|ra%(i%(lle)?|h%(mi)?)|opo%(mofo)?|u%(gi%(nese)?|h%(d|id))|h%(ks|aiksuki)|a%(ss%(a_vah)?|t%(ak|k)|li%(nese)?|mum?))|java%(nese)?|o%(g%(am|ham)|s%(age|ge|ma%(nya)?)|l%(d_%(hungarian|north_arabian|so%(gdian|uth_arabian)|per%(mic|sian)|italic|turkic)|ck|_chiki)|r%(iya|kh|ya))|a%(r%(ab%(ic)?|m%([ni]|enian))|dl%(m|am)|natolian_hieroglyphs|hom|v%(st|estan)|ghb))\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\c%(In|blk\=|block\=)%(zanabazar%([ _]square|square)|javanese|h%(a%(lfwidth%( and fullwidth forms|andfullwidthforms|_and_fullwidth_forms)|tran|n%(unoo|gul%(compatibilityjamo|syllables|jamo%(extended\-[ab])?|_%(syllables|jamo%(_extended_[ab])?|compatibility_jamo)| %(syllables|compatibility jamo|jamo%( extended\-[ab])?))|ifi%([_ ]rohingya|rohingya)))|i%(ragana|gh%( %(private use surrogates|surrogates)|_%(private_use_surrogates|surrogates)|surrogates|privateusesurrogates))|ebrew)|i%(pa%([ _]extensions|extensions)|n%(scriptional%(%([ _]pa%(rthian|hlavi))|pa%(rthian|hlavi))|dic%(siyaqnumbers|_siyaq_numbers| siyaq numbers))|deographic%(symbolsandpunctuation|_%(description_characters|symbols_and_punctuation)| %(description characters|symbols and punctuation)|descriptioncharacters)|mperial%(aramaic|[_ ]aramaic))|c%(o%(ntrol%(pictures|[ _]pictures)|ptic%(epactnumbers|_epact_numbers| epact numbers)?|m%(mon%(_indic_number_forms|indicnumberforms| indic number forms)|bining%(halfmarks|_%(diacritical_marks%(_%(supplement|for_symbols|extended))?|marks_for_symbols|half_marks)| %(half marks|diacritical marks%( %(supplement|for symbols|extended))?|marks for symbols)|diacriticalmarks%(supplement|forsymbols|extended)?|marksforsymbols))|unting%( rod numerals|_rod_numerals|rodnumerals))|a%(rian|ucasian%([ _]albanian|albanian))|jk%(unifiedideographs%(extension[dgacfbe])?|s%(ymbolsandpunctuation|trokes)|_%(s%(trokes|ymbols_and_punctuation)|radicals_supplement|unified_ideographs%(_extension_[dgacfbe])?|compatibility%(_%(forms|ideographs%(_supplement)?))?)|compatibility%(forms|ideographs%(supplement)?)?|radicalssupplement| %(compatibility%( %(ideographs%( supplement)?|forms))?|unified ideographs%( extension [dgacfbe])?|radicals supplement|s%(ymbols and punctuation|trokes)))|y%(rillic%(supplement%(ary)?| %(supplement%(ary)?|extended\-[acb])|extended\-[acb]|_%(extended_[acb]|supplement%(ary)?))?|priot%(syllabary|[ _]syllabary))|u%(rrency%([_ ]symbols|symbols)|neiform%(_numbers_and_punctuation|numbersandpunctuation| numbers and punctuation)?)|h%(e%(ss%([_ ]symbols|symbols)|rokee%(supplement|[ _]supplement)?)|a%(m|kma)|orasmian))|g%(othic|u%(njala%(gondi|[_ ]gondi)|jarati|rmukhi)|lagolitic%(supplement|[ _]supplement)?|e%(o%(rgian%(supplement|%([_ ]%(supplement|extended))|extended)?|metric%( shapes%( extended)?|shapes%(extended)?|_shapes%(_extended)?))|neral%([_ ]punctuation|punctuation))|r%(eek%( %(and coptic|extended)|andcoptic|_%(and_coptic|extended)|extended)?|antha))|s%(h%(orthand%( format controls|_format_controls|formatcontrols)|a%(vian|rada))|u%(ndanese%(supplement|[ _]supplement)?|p%(erscripts%(_and_subscripts|andsubscripts| and subscripts)|plementa%(ry%(_private_use_area_[ab]|privateusearea\-[ab]| private use area\-[ab])|l%( %(mathematical operators|symbols and pictographs|punctuation|arrows\-[acb])|symbolsandpictographs|mathematicaloperators|punctuation|arrows\-[acb]|_%(arrows_[acb]|symbols_and_pictographs|mathematical_operators|punctuation))))|tton%(signwriting|[_ ]signwriting))|i%(nhala%( archaic numbers|archaicnumbers|_archaic_numbers)?|ddham)|y%(loti%([_ ]nagri|nagri)|mbols%( %(for legacy computing|and pictographs extended\-a)|forlegacycomputing|andpictographsextended\-a|_%(and_pictographs_extended_a|for_legacy_computing))|riac%(supplement|[ _]supplement)?)|p%(acing%(_modifier_letters| modifier letters|modifierletters)|ecials)|a%(maritan|urashtra)|o%(yombo|gdian|ra%(sompeng|[ _]sompeng))|mall%(kanaextension| %(kana extension|form variants)|_%(kana_extension|form_variants)|formvariants))|y%(i%(syllables|%([_ ]%(syllables|radicals))|radicals|jing%(hexagramsymbols| hexagram symbols|_hexagram_symbols))|ezidi)|p%(h%(o%(enician|netic%( extensions%( supplement)?|extensions%(supplement)?|_extensions%(_supplement)?))|a%(istos%([ _]disc|disc)|gs[_\-]pa))|laying%(cards|[_ ]cards)|rivate%(usearea| use area|_use_area)|a%(hawh%(hmong|[_ ]hmong)|u%(_cin_hau|cinhau| cin hau)|lmyrene)|salter%(pahlavi|[ _]pahlavi))|e%(l%(basan|ymaic)|arly%(_dynastic_cuneiform|dynasticcuneiform| dynastic cuneiform)|moticons|gyptian%(hieroglyph%(formatcontrols|s)| hieroglyph%( format controls|s)|_hieroglyph%(_format_controls|s))|nclosed%( %(cjk letters and months|ideographic supplement|alphanumeric%( supplement|s))|cjklettersandmonths|_%(ideographic_supplement|alphanumeric%(_supplement|s)|cjk_letters_and_months)|alphanumerics%(upplement)?|ideographicsupplement)|thiopic%(supplement|_%(supplement|extended%(_a)?)| %(supplement|extended%(\-a)?)|extended%(\-a)?)?)|r%(u%(nic|mi%(numeralsymbols| numeral symbols|_numeral_symbols))|ejang)|d%(o%(gra|mino%([ _]tiles|tiles))|e%(seret|vanagari%([ _]extended|extended)?)|uployan|i%(ngbats|ves%([_ ]akuru|akuru)))|m%(e%(defaidrin|nde%([ _]kikakui|kikakui)|etei%(mayek%(extensions)?|_mayek%(_extensions)?| mayek%( extensions)?)|roitic%(hieroglyphs|%([_ ]%(hieroglyphs|cursive))|cursive))|o%(ngolian%(supplement|[ _]supplement)?|di%(fier%(_tone_letters| tone letters|toneletters))?)|ro|u%(ltani|sical%([_ ]symbols|symbols))|i%(ao|scellaneous%(technical|symbols%(and%(pictographs|arrows))?|mathematicalsymbols\-[ab]| %(technical|mathematical symbols\-[ab]|symbols%( and %(pictographs|arrows))?)|_%(technical|symbols%(_and_%(pictographs|arrows))?|mathematical_symbols_[ab])))|yanmar%( extended\-[ab]|extended\-[ab]|_extended_[ab])?|a%(h%(ajani|jong%([ _]tiles|tiles))|rchen|n%(daic|ichaean)|yan%([_ ]numerals|numerals)|saram%(gondi|[_ ]gondi)|layalam|thematical%(alphanumericsymbols| %(alphanumeric symbols|operators)|_%(alphanumeric_symbols|operators)|operators)|kasar))|o%(s%(age|manya)|ttoman%(siyaqnumbers|_siyaq_numbers| siyaq numbers)|r%(namental%([ _]dingbats|dingbats)|iya)|ptical%( character recognition|_character_recognition|characterrecognition)|gham|l%([ _]chiki|d%(hungarian| %(hungarian|so%(uth arabian|gdian)|per%(mic|sian)|north arabian|italic|turkic)|per%(mic|sian)|so%(utharabian|gdian)|italic|turkic|_%(hungarian|north_arabian|so%(gdian|uth_arabian)|per%(mic|sian)|italic|turkic)|northarabian)|chiki))|n%(ew%(_tai_lue|a|tailue| tai lue)|ko|yiakeng%( puachue hmong|puachuehmong|_puachue_hmong)|a%(bataean|ndinagari)|u%(shu|mber%(forms|[ _]forms)))|b%(u%(ginese|hid)|a%(s%(sa%([ _]vah|vah)|ic%([ _]latin|latin))|linese|mum%(supplement|[ _]supplement)?|tak)|ra%(hmi|ille%(patterns|[_ ]patterns))|o%(x%([ _]drawing|drawing)|pomofo%([ _]extended|extended)?)|lock%([ _]elements|elements)|haiksuki|yzantine%( musical symbols|musicalsymbols|_musical_symbols)|engali)|l%(i%(mbu|near%(a| %(a|b %(ideograms|syllabary))|b%(ideograms|syllabary)|_%(a|b_%(ideograms|syllabary)))|su%(supplement|[ _]supplement)?)|a%(tin%(extended%(\-[dacbe]|additional)|_%(extended_%([dcbe]|a%(dditional)?)|1_supplement)|\-1%(supplement| supplement)| extended%(\-[dacbe]| additional))|o)|e%(tterlike%([_ ]symbols|symbols)|pcha)|ow%([_ ]surrogates|surrogates)|y[cd]ian)|k%(h%(aroshthi|ojki|mer%([_ ]symbols|symbols)?|udawadi|itan%( small script|smallscript|_small_script))|a%(takana%(_phonetic_extensions|phoneticextensions| phonetic extensions)?|n%(gxi%([_ ]radicals|radicals)|a%(extended\-a|supplement| %(extended\-a|supplement)|_%(supplement|extended_a))|bun|nada)|ithi|yah%([ _]li|li)))|wa%(ncho|rang%(citi|[ _]citi))|t%(elugu|ransport%( and map symbols|_and_map_symbols|andmapsymbols)|i%(rhuta|betan|finagh)|a%(mil%(supplement|[ _]supplement)?|kri|ngut%(supplement|%([ _]%(supplement|components))|components)?|i%(xuanjingsymbols|_%(le|xuan_jing_symbols|tham|viet)|le| %(xuan jing symbols|le|tham|viet)|tham|viet)|g%(alog|s|banwa))|ha%(i|ana))|a%(l%(chemical%([_ ]symbols|symbols)|phabetic%( presentation forms|_presentation_forms|presentationforms))|n%(cient%(_%(greek_%(musical_notation|numbers)|symbols)|greek%(numbers|musicalnotation)| %(greek %(numbers|musical notation)|symbols)|symbols)|atolian%([ _]hieroglyphs|hieroglyphs))|dlam|r%(menian|abic%(extended\-a|mathematicalalphabeticsymbols|supplement|_%(presentation_forms_[ab]|supplement|extended_a|mathematical_alphabetic_symbols)| %(extended\-a|mathematical alphabetic symbols|supplement|presentation forms\-[ab])|presentationforms\-[ab])?|rows)|egean%(numbers|[ _]numbers)|vestan|hom)|u%(garitic|nified%(canadianaboriginalsyllabics%(extended)?|_canadian_aboriginal_syllabics%(_extended)?| canadian aboriginal syllabics%( extended)?))|v%(a%(i|riation%( selectors%( supplement)?|selectors%(supplement)?|_selectors%(_supplement)?))|e%(rtical%(forms|[ _]forms)|dic%([ _]extensions|extensions))))\}" contained display syntax match clojureRegexpPredefinedCharClass "\v%(\\[dDsSwW]|\.)" contained display syntax cluster clojureRegexpCharPropertyClasses contains=clojureRegexpPosixCharClass,clojureRegexpJavaCharClass,clojureRegexpUnicodeCharClass @@ -136,26 +115,40 @@ syntax match clojureRegexpBoundary "[$^]" contained display syntax match clojureRegexpQuantifier "[?*+][?+]\=" contained display syntax match clojureRegexpQuantifier "\v\{\d+%(,|,\d+)?}\??" contained display syntax match clojureRegexpOr "|" contained display -syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-Z]+\>)" contained display +syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[[:alpha:]]+\>)" contained display " Mode modifiers, mode-modified spans, lookaround, regular and atomic " grouping, and named-capturing. syntax match clojureRegexpMod "\v\(@<=\?:" contained display syntax match clojureRegexpMod "\v\(@<=\?[xdsmiuU]*-?[xdsmiuU]+:?" contained display syntax match clojureRegexpMod "\v\(@<=\?%(\)" contained display -syntax match clojureRegexpMod "\v\(@<=\?\<[a-zA-Z]+\>" contained display +syntax match clojureRegexpMod "\v\(@<=\?\<[[:alpha:]]+\>" contained display syntax region clojureRegexpGroup start="(" skip=/\\\\\|\\)/ end=")" matchgroup=clojureRegexpGroup contained contains=clojureRegexpMod,clojureRegexpQuantifier,clojureRegexpBoundary,clojureRegexpEscape,@clojureRegexpCharClasses -syntax region clojureRegexp start=/\#"/ skip=/\\\\\|\\"/ end=/"/ contains=@clojureRegexpCharClasses,clojureRegexpEscape,clojureRegexpQuote,clojureRegexpBoundary,clojureRegexpQuantifier,clojureRegexpOr,clojureRegexpBackRef,clojureRegexpGroup keepend +syntax region clojureRegexp matchgroup=clojureRegexpDelimiter start=/\#"/ skip=/\\\\\|\\"/ end=/"/ contains=@clojureRegexpCharClasses,clojureRegexpEscape,clojureRegexpQuote,clojureRegexpBoundary,clojureRegexpQuantifier,clojureRegexpOr,clojureRegexpBackRef,clojureRegexpGroup keepend -syntax keyword clojureCommentTodo contained FIXME XXX TODO FIXME: XXX: TODO: +syntax keyword clojureCommentTodo contained FIXME XXX TODO BUG NOTE HACK FIXME: XXX: TODO: BUG: NOTE: HACK: syntax match clojureComment ";.*$" contains=clojureCommentTodo,@Spell syntax match clojureComment "#!.*$" +syntax match clojureComment "," + +" Comment out discarded forms. +if exists('g:clojure_discard_macro') && g:clojure_discard_macro + syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*/ end=/[, \t\n()\[\]{}";]/me=e-1 + syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*"/ skip=/\\[\\"]/ end=/"/ + syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*(/ end=/)/ contains=clojureDiscardForm + syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*\[/ end=/\]/ contains=clojureDiscardForm + syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*{/ end=/}/ contains=clojureDiscardForm + + syntax region clojureDiscardForm start="(" end=")" contained contains=clojureDiscardForm + syntax region clojureDiscardForm start="{" end="}" contained contains=clojureDiscardForm + syntax region clojureDiscardForm start="\[" end="\]" contained contains=clojureDiscardForm +endif " -*- TOP CLUSTER -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj -syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVarArg,clojureVariable,clojureVector +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj +syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDiscard,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVariable,clojureVector syntax region clojureSexp matchgroup=clojureParen start="(" end=")" contains=@clojureTop fold syntax region clojureVector matchgroup=clojureParen start="\[" end="]" contains=@clojureTop fold @@ -176,6 +169,7 @@ highlight default link clojureStringDelimiter String highlight default link clojureStringEscape Character highlight default link clojureRegexp Constant +highlight default link clojureRegexpDelimiter Constant highlight default link clojureRegexpEscape Character highlight default link clojureRegexpCharClass SpecialChar highlight default link clojureRegexpPosixCharClass clojureRegexpCharClass @@ -200,7 +194,6 @@ highlight default link clojureMacro Macro highlight default link clojureRepeat Repeat highlight default link clojureSpecial Special -highlight default link clojureVarArg Special highlight default link clojureQuote SpecialChar highlight default link clojureUnquote SpecialChar highlight default link clojureMeta SpecialChar @@ -210,6 +203,8 @@ highlight default link clojureDispatch SpecialChar highlight default link clojureComment Comment highlight default link clojureCommentTodo Todo +highlight default link clojureDiscard clojureComment +highlight default link clojureDiscardForm clojureDiscard highlight default link clojureError Error diff --git a/runtime/syntax/coco.vim b/runtime/syntax/coco.vim index ae32348bcb3de..dc21314e353c9 100644 --- a/runtime/syntax/coco.vim +++ b/runtime/syntax/coco.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Coco/R " Maintainer: Ashish Shukla -" Last Change: 2007 Aug 10 +" Last Change: 2022 Jun 14 " Remark: Coco/R syntax partially implemented. " License: Vim license @@ -30,3 +30,4 @@ hi def link cocoOperator Operator hi def link cocoProductionCode Statement hi def link cocoPragma Special +let b:current_syntax = 'coco' diff --git a/runtime/syntax/conf.vim b/runtime/syntax/conf.vim index 9b8a6361bc4c3..6a78ef8c6e9c3 100644 --- a/runtime/syntax/conf.vim +++ b/runtime/syntax/conf.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: generic configure file " Maintainer: Bram Moolenaar -" Last Change: 2005 Jun 20 +" Last Change: 2021 May 01 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -10,8 +10,8 @@ endif syn keyword confTodo contained TODO FIXME XXX " Avoid matching "text#text", used in /etc/disktab and /etc/gettytab -syn match confComment "^#.*" contains=confTodo -syn match confComment "\s#.*"ms=s+1 contains=confTodo +syn match confComment "^#.*" contains=confTodo,@Spell +syn match confComment "\s#.*"ms=s+1 contains=confTodo,@Spell syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline diff --git a/runtime/syntax/confini.vim b/runtime/syntax/confini.vim new file mode 100644 index 0000000000000..823d417a819d7 --- /dev/null +++ b/runtime/syntax/confini.vim @@ -0,0 +1,12 @@ +" Vim syntax file +" Language: confini + +" Quit if a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" Use the cfg syntax for now, it's similar. +runtime! syntax/cfg.vim + +let b:current_syntax = 'confini' diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim index 9cb0860e84398..5437580a0ac36 100644 --- a/runtime/syntax/cpp.vim +++ b/runtime/syntax/cpp.vim @@ -2,13 +2,16 @@ " Language: C++ " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp) " Previous Maintainer: Ken Shan -" Last Change: 2017 Jun 05 +" Last Change: 2021 Aug 23 " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif +" inform C syntax that the file was included from cpp.vim +let b:filetype_in_cpp_family = 1 + " Read the C syntax to start with runtime! syntax/c.vim unlet b:current_syntax @@ -41,16 +44,59 @@ if !exists("cpp_no_cpp11") syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE - syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell + syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"\(sv\|s\|_[_a-zA-Z][_a-zA-Z0-9]*\)\=+ contains=@Spell + syn match cppCast "\<\(const\|static\|dynamic\)_pointer_cast\s*<"me=e-1 + syn match cppCast "\<\(const\|static\|dynamic\)_pointer_cast\s*$" endif " C++ 14 extensions if !exists("cpp_no_cpp14") - syn case ignore - syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>" - syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" contains=cFloat - syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>" - syn case match + syn match cppNumbers display transparent "\<\d\|\.\d" contains=cppNumber,cppFloat + syn match cppNumber display contained "\<0\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppNumber display contained "\<0\o\+\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppFloat display contained "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppFloat display contained "\<\.\d\+\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppFloat display contained "\<\d\+e[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn region cppString start=+\(L\|u\|u8\|U\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"\(sv\|s\|_\i*\)\=+ end='$' contains=cSpecial,cFormat,@Spell +endif + +" C++ 17 extensions +if !exists("cpp_no_cpp17") + syn match cppCast "\" + syn match cppFloat display contained "\<0x\x\+\.\=p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + + " TODO: push this up to c.vim if/when supported in C23 + syn match cppCharacter "u8'[^\\]'" + syn match cppCharacter "u8'[^']*'" contains=cSpecial + if exists("c_gnu") + syn match cppSpecialError "u8'\\[^'\"?\\abefnrtv]'" + syn match cppSpecialCharacter "u8'\\['\"?\\abefnrtv]'" + else + syn match cppSpecialError "u8'\\[^'\"?\\abfnrtv]'" + syn match cppSpecialCharacter "u8'\\['\"?\\abfnrtv]'" + endif + syn match cppSpecialCharacter display "u8'\\\o\{1,3}'" + syn match cppSpecialCharacter display "u8'\\x\x\+'" + +endif + +" C++ 20 extensions +if !exists("cpp_no_cpp20") + syn match cppNumber display contained "\<0\(y\|d\)\>" + syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\(y\|d\)\>" + syn match cppNumber display contained "\<0\o\+\(y\|d\)\>" + syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\(y\|d\)\>" + syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\(y\|d\)\>" + syn keyword cppStatement co_await co_return co_yield requires + syn keyword cppStorageClass consteval constinit + syn keyword cppStructure concept + syn keyword cppType char8_t + syn keyword cppModule import module export endif " The minimum and maximum operators in GNU C++ @@ -67,10 +113,16 @@ hi def link cppType Type hi def link cppStorageClass StorageClass hi def link cppStructure Structure hi def link cppBoolean Boolean +hi def link cppCharacter cCharacter +hi def link cppSpecialCharacter cSpecialCharacter +hi def link cppSpecialError cSpecialError hi def link cppConstant Constant hi def link cppRawStringDelimiter Delimiter hi def link cppRawString String +hi def link cppString String hi def link cppNumber Number +hi def link cppFloat Number +hi def link cppModule Include let b:current_syntax = "cpp" diff --git a/runtime/syntax/cs.vim b/runtime/syntax/cs.vim index eeb990215de21..722ddbedf638c 100644 --- a/runtime/syntax/cs.vim +++ b/runtime/syntax/cs.vim @@ -3,13 +3,16 @@ " Maintainer: Nick Jensen " Former Maintainers: Anduin Withers " Johannes Zellner -" Last Change: 2019-08-01 +" Last Change: 2022-03-01 " Filenames: *.cs " License: Vim (see :h license) " Repository: https://github.com/nickspoons/vim-cs " -" REFERENCES: -" [1] ECMA TC39: C# Language Specification (WD13Oct01.doc) +" References: +" - ECMA-334 5th Edition: C# Language Specification +" https://www.ecma-international.org/publications-and-standards/standards/ecma-334/ +" - C# Language Design: Draft 6th Edition and later proposals +" https://github.com/dotnet/csharplang if exists('b:current_syntax') finish @@ -18,38 +21,73 @@ endif let s:save_cpo = &cpoptions set cpoptions&vim - syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic -syn keyword csStorage delegate enum interface namespace struct +syn keyword csType nint nuint " contextual + +syn keyword csStorage enum interface namespace struct +syn match csStorage "\" syn keyword csRepeat break continue do for foreach goto return while syn keyword csConditional else if switch syn keyword csLabel case default -syn match csOperatorError display +::+ -syn match csGlobal display +global::+ -" user labels (see [1] 8.6 Statements) -syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+ -syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile -syn keyword csConstant false null true + +syn match csNamespaceAlias "@\=\h\w*\ze\_s*::" display +syn match csGlobalNamespaceAlias "global\ze\_s*::" display +syn cluster csNamespaceAlias contains=csGlobalNamespaceAlias,csNamespaceAlias,csNamespaceAliasQualifier + +" user labels +syn match csLabel display +^\s*\I\i*\s*:\%([^:]\)\@=+ + +" Function pointers +syn match csType "\" +syn keyword csAccessModifier internal private protected public +" TODO: in new out +syn keyword csModifier abstract const event override readonly sealed static virtual volatile +syn match csModifier "\<\%(extern\|fixed\|unsafe\)\>" +syn match csModifier "\" + syn keyword csException try catch finally throw when -syn keyword csLinq ascending by descending equals from group in into join let on orderby select where -syn keyword csAsync async await +syn keyword csLinq ascending by descending equals from group in into join let on orderby select +syn match csLinq "\" -syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this unchecked unsafe using -syn keyword csUnsupportedStatement add remove value -syn keyword csUnspecifiedKeyword explicit implicit +" Type parameter constraint clause +syn match csStorage "\\ze\_s\+@\=\h\w*\_s*:" + +" Async +syn keyword csAsyncModifier async +syn keyword csAsyncOperator await + +syn match csStorage "\" +syn match csStorage "\%(\" + +syn match csStatement "\<\%(checked\|unchecked\|unsafe\)\ze\_s*{" +syn match csStatement "\" + +syn match csAccessor "\<\%(get\|set\|init\|add\|remove\)\ze\_s*\%([;{]\|=>\)" + +syn keyword csAccess base +syn match csAccess "\" -" Contextual Keywords -syn match csContextualStatement /\[^:]\+:/me=s+5 +" Extension method parameter modifier +syn match csModifier "\' + syn region csPreProcInclude start="^\s*\zs#\s*\%(load\|r\)\>" end="$" contains=csLineComment keepend + syn match csShebang "\%^#!.*" display +endif -" [1] 9.5 Pre-processing directives -syn region csPreCondit start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)" skip="\\$" end="$" contains=csComment keepend -syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$" end="^\s*#\s*endregion" transparent fold contains=TOP -syn region csSummary start="^\s*/// " display -syn match csNumber "\<0[xX]\x\+[lL]\=\>" display -syn match csNumber "\<\d\+[lL]\=\>" display -syn match csNumber "\<\d\+\.\d*\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display -syn match csNumber "\.\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display -syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" display -syn match csNumber "\<\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\>" display - -syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ end=+$+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell -syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBracketed,csInterpolationAlign,csInterpolationFormat +" Numbers +syn case ignore +syn match csInteger "\<0b[01_]*[01]\%([lu]\|lu\|ul\)\=\>" display +syn match csInteger "\<\d\+\%(_\+\d\+\)*\%([lu]\|lu\|ul\)\=\>" display +syn match csInteger "\<0x[[:xdigit:]_]*\x\%([lu]\|lu\|ul\)\=\>" display +syn match csReal "\<\d\+\%(_\+\d\+\)*\.\d\+\%(_\+\d\+\)*\%\(e[-+]\=\d\+\%(_\+\d\+\)*\)\=[fdm]\=" display +syn match csReal "\.\d\+\%(_\+\d\+\)*\%(e[-+]\=\d\+\%(_\+\d\+\)*\)\=[fdm]\=\>" display +syn match csReal "\<\d\+\%(_\+\d\+\)*e[-+]\=\d\+\%(_\+\d\+\)*[fdm]\=\>" display +syn match csReal "\<\d\+\%(_\+\d\+\)*[fdm]\>" display +syn case match +syn cluster csNumber contains=csInteger,csReal + +syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell + +syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBraced,csBracketed,csInterpolationAlign,csInterpolationFormat syn match csEscapedInterpolation "{{" transparent contains=NONE display syn match csEscapedInterpolation "}}" transparent contains=NONE display -syn region csInterpolationAlign matchgroup=csInterpolationAlignDel start=+,+ end=+}+ end=+:+me=e-1 contained contains=csNumber,csConstant,csCharacter,csParens,csOpSymbols,csString,csBracketed display +syn region csInterpolationAlign matchgroup=csInterpolationAlignDel start=+,+ end=+}+ end=+:+me=e-1 contained contains=@csNumber,csBoolean,csConstant,csCharacter,csParens,csOpSymbols,csString,csBracketed display syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFormatDel display syn match csInterpolationAlignDel +,+ contained display syn match csInterpolationFormatDel +:+ contained display syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"+ skip=+""+ extend contains=csVerbatimQuote,@Spell syn match csVerbatimQuote +""+ contained -syn match csQuoteError +@$"+he=s+2,me=s+2 -syn region csInterVerbString matchgroup=csQuote start=+\$@"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell +syn region csInterVerbString matchgroup=csQuote start=+$@"+ start=+@$"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell + +syn cluster csString contains=csString,csInterpolatedString,csVerbatimString,csInterVerbString + +syn cluster csLiteral contains=csBoolean,@csNumber,csCharacter,@csString,csNull + +syn region csBracketed matchgroup=csParens start=+(+ end=+)+ extend contained transparent contains=@csAll,csBraced,csBracketed +syn region csBraced matchgroup=csParens start=+{+ end=+}+ extend contained transparent contains=@csAll,csBraced,csBracketed -syn region csBracketed matchgroup=csParens start=+(+ end=+)+ contained transparent contains=@csAll,csBracketed +syn cluster csAll contains=@csLiteral,csClassType,@csComment,csEndColon,csIsType,csLabel,csLogicSymbols,csNewType,csOpSymbols,csParens,@csPreProcessor,csSummary,@csNamespaceAlias,csType,csUnicodeNumber,csUserType,csUserIdentifier,csUserInterface,csUserMethod -syn cluster csAll contains=csCharacter,csClassType,csComment,csContextualStatement,csEndColon,csInterpolatedString,csIsType,csLabel,csLogicSymbols,csNewType,csConstant,csNumber,csOpSymbols,csOperatorError,csParens,csPreCondit,csRegion,csString,csSummary,csType,csUnicodeNumber,csUnicodeSpecifier,csVerbatimString,csUserType,csUserIdentifier,csUserInterface,csUserMethod +" Keyword identifiers +syn match csIdentifier "@\h\w*" " The default highlighting. +hi def link csUnspecifiedStatement Statement +hi def link csUnsupportedStatement Statement +hi def link csUnspecifiedKeyword Keyword + +hi def link csGlobalNamespaceAlias Include + hi def link csType Type hi def link csClassType Type hi def link csIsType Type + hi def link csStorage Structure hi def link csClass Structure +hi def link csNew Statement +hi def link csIsAs Keyword +hi def link csAccessor Keyword +hi def link csAccess Keyword + +hi def link csLinq Statement + +hi def link csStatement Statement hi def link csRepeat Repeat hi def link csConditional Conditional hi def link csLabel Label -hi def link csModifier StorageClass -hi def link csConstant Constant hi def link csException Exception -hi def link csTypeOf Keyword -hi def link csTypeOfStatement Typedef -hi def link csUnspecifiedStatement Statement -hi def link csUnsupportedStatement Statement -hi def link csUnspecifiedKeyword Keyword -hi def link csNew Statement -hi def link csLinq Statement -hi def link csIsAs Keyword -hi def link csAsync Keyword -hi def link csContextualStatement Statement -hi def link csOperatorError Error + +hi def link csModifier StorageClass +hi def link csAccessModifier csModifier +hi def link csAsyncModifier csModifier +hi def link csManagedModifier csModifier +hi def link csUsingModifier csModifier hi def link csTodo Todo hi def link csComment Comment - +hi def link csLineComment csComment +hi def link csBlockComment csComment + +hi def link csKeywordOperator Keyword +hi def link csAsyncOperator csKeywordOperator +hi def link csTypeOf csKeywordOperator +hi def link csTypeOfOperand Typedef +hi def link csTypeOfError Error hi def link csOpSymbols Operator hi def link csLogicSymbols Operator @@ -188,15 +276,29 @@ hi def link csSpecialError Error hi def link csSpecialCharError Error hi def link csString String hi def link csQuote String -hi def link csQuoteError Error hi def link csInterpolatedString String hi def link csVerbatimString String hi def link csInterVerbString String hi def link csVerbatimQuote SpecialChar -hi def link csPreCondit PreCondit + +hi def link csPreProc PreProc +hi def link csPreProcDeclaration Define +hi def link csPreProcConditional PreCondit +hi def link csPreProcLine csPreProc +hi def link csPreProcDiagnostic csPreProc +hi def link csPreProcRegion csPreProc +hi def link csPreProcPragma csPreProc +hi def link csPreProcNullable csPreProc +hi def link csPreProcInclude csPreProc +hi def link csShebang csPreProc + +hi def link csConstant Constant +hi def link csNull Constant +hi def link csBoolean Boolean hi def link csCharacter Character hi def link csSpecialChar SpecialChar -hi def link csNumber Number +hi def link csInteger Number +hi def link csReal Float hi def link csUnicodeNumber SpecialChar hi def link csUnicodeSpecifier SpecialChar hi def link csInterpolationDelimiter Delimiter @@ -207,9 +309,12 @@ hi def link csInterpolationFormatDel csInterpolationDelimiter hi def link csGenericBraces csBraces " xml markup -hi def link csXmlCommentLeader Comment -hi def link csXmlComment Comment +hi def link csXmlLineCommentLeader Comment +hi def link csXmlLineComment Comment +hi def link csXmlBlockComment Comment +hi def link csXmlBlockCommentMiddle csXmlBlockComment hi def link csXmlTag Statement +hi def link csXmlAttrib Statement let b:current_syntax = 'cs' diff --git a/runtime/syntax/csc.vim b/runtime/syntax/csc.vim index 6e5d8b9f3711c..b1bc4d6a7bb2c 100644 --- a/runtime/syntax/csc.vim +++ b/runtime/syntax/csc.vim @@ -141,7 +141,7 @@ sy keyword cscBPMacro contained EndLoop AllMembers SelectedMembers If Else EndIf sy match cscBPMacro contained "!" sy match cscBPW "!\s*\a*" contains=cscBPmacro -" when wanted, highlighting lhs members or erros in asignments (may lag the editing) +" when wanted, highlighting lhs members or errors in assignments (may lag the editing) if exists("csc_asignment") sy match cscEqError '\("[^"]*"\s*\|[^][\t !%()*+,--/:;<=>{}~]\+\s*\|->\s*\)*=\([^=]\@=\|$\)' sy region cscFormula transparent matchgroup=cscVarName start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\s*=\([^=]\@=\|\n\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition diff --git a/runtime/syntax/csh.vim b/runtime/syntax/csh.vim index c134aa7ef399e..6a056c7004747 100644 --- a/runtime/syntax/csh.vim +++ b/runtime/syntax/csh.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: C-shell (csh) -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Aug 31, 2016 -" Version: 13 +" Version: 14 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH " quit when a syntax file was already loaded diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim index 73bbd8d03ffea..564dc151bc36e 100644 --- a/runtime/syntax/css.vim +++ b/runtime/syntax/css.vim @@ -1,12 +1,13 @@ " Vim syntax file " Language: Cascading Style Sheets " Previous Contributor List: -" Claudio Fleiner (Maintainer) +" Jules Wang +" Claudio Fleiner " Yeti (Add full CSS2, HTML4 support) " Nikolai Weibull (Add CSS2 support) -" URL: https://github.com/JulesWang/css.vim -" Maintainer: Jules Wang -" Last Change: 2019 Jul. 29 +" URL: https://github.com/vim-language-dept/css-syntax.vim +" Maintainer: Jay Sitter +" Last Change: 2021 Oct 20 " quit when a syntax file was already loaded if !exists("main_syntax") @@ -22,6 +23,8 @@ let s:cpo_save = &cpo set cpo&vim syn case ignore +" Add dash to allowed keyword characters. +syn iskeyword @,48-57,_,192-255,- " HTML4 tags syn keyword cssTagName abbr address area a b base @@ -31,7 +34,7 @@ syn keyword cssTagName dfn div dl dt em fieldset form syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i syn keyword cssTagName iframe input ins isindex kbd label legend li syn keyword cssTagName link map menu meta noscript ol optgroup -syn keyword cssTagName option p param pre q s samp script small +syn keyword cssTagName option p param picture pre q s samp script small syn keyword cssTagName span strong sub sup tbody td syn keyword cssTagName textarea tfoot th thead title tr ul u var syn keyword cssTagName object svg @@ -60,7 +63,7 @@ syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot syn match cssClassNameDot contained '\.' try -syn match cssIdentifier "#[A-Za-zīŋŊ-īŋŊ_@][A-Za-zīŋŊ-īŋŊ0-9_@-]*" +syn match cssIdentifier "#[A-Za-zÀ-Ãŋ_@][A-Za-zÀ-Ãŋ0-9_@-]*" catch /^.*/ syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" endtry @@ -68,7 +71,7 @@ endtry " digits syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators -syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|fr\|vw\|vh\|vmin\|vmax\)\>" contains=cssUnitDecorators +syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|fr\|vw\|vh\|vmin\|vmax\|ch\)\>" contains=cssUnitDecorators syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=%" contains=cssUnitDecorators syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators @@ -113,7 +116,7 @@ syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFac syn case ignore syn match cssImportant contained "!\s*important\>" -syn match cssCustomProp contained "--[a-zA-Z0-9-_]*" +syn match cssCustomProp contained "\<--[a-zA-Z0-9-_]*\>" syn match cssColor contained "\" syn match cssColor contained "\" @@ -123,17 +126,20 @@ syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline +syn region cssMathGroup contained matchgroup=cssMathParens start="(" end=")" containedin=cssFunction,cssMathGroup contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction -syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\|conic-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(blur\|brightness\|contrast\|drop-shadow\|grayscale\|hue-rotate\|invert\|opacity\|saturate\|sepia\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at syn match cssFunctionComma contained "," " Common Prop and Attr syn keyword cssCommonAttr contained auto none inherit all default normal syn keyword cssCommonAttr contained top bottom center stretch hidden visible +syn match cssCommonAttr contained "\<\(max-\|min-\|fit-\)content\>" "------------------------------------------------ " CSS Animations " http://www.w3.org/TR/css3-animations/ @@ -217,7 +223,7 @@ syn keyword cssFlexibleBoxProp contained order syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>" syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center syn match cssFlexibleBoxAttr contained "\" -syn match cssFlexibleBoxAttr contained "\" +syn match cssFlexibleBoxAttr contained "\" " CSS Fonts Module Level 3 " http://www.w3.org/TR/css-fonts-3/ @@ -231,9 +237,7 @@ syn keyword cssFontAttr contained larger smaller syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>" syn match cssFontAttr contained "\" " font-family attributes -syn match cssFontAttr contained "\<\(sans-\)\=serif\>" -syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf -syn keyword cssFontAttr contained cursive fantasy monospace +syn keyword cssFontAttr contained sans-serif serif cursive fantasy monospace " font-feature-settings attributes syn keyword cssFontAttr contained on off " font-stretch attributes @@ -280,6 +284,7 @@ syn match cssGridProp contained "\" syn match cssGridProp contained "\" syn match cssGridProp contained "\" syn match cssGridProp contained "\" +syn match cssGridProp contained "\" syn match cssGridProp contained "\" syn match cssHyerlinkProp contained "\" @@ -291,6 +296,10 @@ syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic syn keyword cssListAttr contained disc circle square hebrew armenian georgian syn keyword cssListAttr contained inside outside +" object-fit https://www.w3.org/TR/css-images-3/#the-object-fit +syn match cssObjectProp contained "\" +syn keyword cssObjectAttr contained fill contain cover scale-down + syn keyword cssPositioningProp contained bottom clear clip display float left syn keyword cssPositioningProp contained position right top visibility syn match cssPositioningProp contained "\" @@ -300,7 +309,7 @@ syn keyword cssPositioningAttr contained left right both syn match cssPositioningAttr contained "\" syn match cssPositioningAttr contained "\" syn match cssPositioningAttr contained "\" -syn keyword cssPositioningAttr contained static relative absolute fixed subgrid +syn keyword cssPositioningAttr contained static relative absolute fixed subgrid sticky syn keyword cssPrintAttr contained landscape portrait crop cross always @@ -387,9 +396,9 @@ syn match cssUIAttr contained '\' syn match cssIEUIAttr contained '\' " Webkit/iOS specific properties -syn match cssUIProp contained '\' +syn match cssUIProp contained '\<\(tap-highlight-color\|user-select\|touch-callout\)\>' " IE specific properties -syn match cssIEUIProp contained '\' +syn match cssIEUIProp contained '\<\(interpolation-mode\|zoom\|filter\)\>' " Webkit/Firebox specific properties/attributes syn keyword cssUIProp contained appearance @@ -415,11 +424,15 @@ syn keyword cssAuralAttr contained male female child code digits continuous syn match cssMobileTextProp contained "\" syn keyword cssMediaProp contained width height orientation scan -syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/ -syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/ -syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/ -syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ +syn keyword cssMediaProp contained any-hover any-pointer color-gamut grid hover +syn keyword cssMediaProp contained overflow-block overflow-inline pointer update +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio\>/ +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-pixel-ratio\>/ +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-\(height\|width\)\>/ +syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)\>/ syn keyword cssMediaAttr contained portrait landscape progressive interlace +syn keyword cssMediaAttr contained coarse fast fine hover infinite p3 paged +syn keyword cssMediaAttr contained rec2020 scroll slow srgb syn match cssKeyFrameProp contained /\(\d\+\(\.\d\+\)\?%\|\(\\)\)/ nextgroup=cssDefinition syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition syn keyword cssPageProp contained content size @@ -437,17 +450,17 @@ syn match cssBraceError "}" syn match cssAttrComma "," " Pseudo class -" http://www.w3.org/TR/css3-selectors/ +" https://www.w3.org/TR/selectors-4/ syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn syn keyword cssPseudoClassId contained link visited active hover before after left right -syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid +syn keyword cssPseudoClassId contained root empty target enabled disabled checked invalid syn match cssPseudoClassId contained "\" syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>" -syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ +syn match cssPseudoClassId contained "\" +syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|is\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ,cssTagName,cssAttributeSelector,cssClassName,cssIdentifier " ------------------------------------ " Vendor specific properties syn match cssPseudoClassId contained "\" -syn match cssPseudoClassId contained "\" syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>" " Misc highlight groups @@ -545,6 +558,7 @@ hi def link cssMarqueeProp cssProp hi def link cssMultiColumnProp cssProp hi def link cssPagedMediaProp cssProp hi def link cssPositioningProp cssProp +hi def link cssObjectProp cssProp hi def link cssPrintProp cssProp hi def link cssRubyProp cssProp hi def link cssSpeechProp cssProp @@ -578,6 +592,7 @@ hi def link cssMultiColumnAttr cssAttr hi def link cssPaddingAttr cssAttr hi def link cssPagedMediaAttr cssAttr hi def link cssPositioningAttr cssAttr +hi def link cssObjectAttr cssAttr hi def link cssGradientAttr cssAttr hi def link cssPrintAttr cssAttr hi def link cssRubyAttr cssAttr @@ -646,5 +661,5 @@ endif let &cpo = s:cpo_save unlet s:cpo_save -" vim: ts=8 +" vim: ts=8 diff --git a/runtime/syntax/cupl.vim b/runtime/syntax/cupl.vim index 5b93b0db936d7..54495f8ba52e5 100644 --- a/runtime/syntax/cupl.vim +++ b/runtime/syntax/cupl.vim @@ -23,7 +23,7 @@ syn keyword cuplTodo contained TODO XXX FIXME " cuplHeaderContents uses default highlighting except for numbers syn match cuplHeaderContents ".\+;"me=e-1 contains=cuplNumber contained -" String contstants +" String constants syn region cuplString start=+'+ end=+'+ syn region cuplString start=+"+ end=+"+ diff --git a/runtime/syntax/cvs.vim b/runtime/syntax/cvs.vim index 3eac19163770e..e1e413fcf9822 100644 --- a/runtime/syntax/cvs.vim +++ b/runtime/syntax/cvs.vim @@ -1,7 +1,6 @@ " Vim syntax file " Language: CVS commit file -" Maintainer: Matt Dunford (zoot@zotikos.com) -" URL: http://www.zotikos.com/downloads/cvs.vim +" Maintainer: Matt Dunford (zenmatic@gmail.com) " Last Change: Sat Nov 24 23:25:11 CET 2001 " quit when a syntax file was already loaded diff --git a/runtime/syntax/dcl.vim b/runtime/syntax/dcl.vim index 73df8e1bac57d..530fbdb59929b 100644 --- a/runtime/syntax/dcl.vim +++ b/runtime/syntax/dcl.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: DCL (Digital Command Language - vms) -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Mar 26, 2019 -" Version: 12 +" Version: 13 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_DCL " quit when a syntax file was already loaded diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim index 2d612061f3856..2efd91977205d 100644 --- a/runtime/syntax/debchangelog.vim +++ b/runtime/syntax/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2019 Sep 07 +" Last Change: 2022 May 01 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim " Standard syntax initialization @@ -17,11 +17,35 @@ syn case ignore let s:urgency='urgency=\(low\|medium\|high\|emergency\|critical\)\( [^[:space:],][^,]*\)\=' let s:binNMU='binary-only=yes' +let s:cpo = &cpo +set cpo-=C +let s:supported = [ + \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', + \ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm', + \ 'trixie', 'sid', 'rc-buggy', + \ + \ 'trusty', 'xenial', 'bionic', 'focal', 'impish', 'jammy', 'kinetic', + \ 'devel' + \ ] +let s:unsupported = [ + \ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', + \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy', + \ + \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', + \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', + \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', + \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic', + \ 'disco', 'eoan', 'hirsute', 'groovy' + \ ] +let &cpo=s:cpo + " Define some common expressions we can use later on syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"' exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"' -syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|%(squeeze|wheezy|jessie)-%(backports%(-sloppy)=|lts|security)|stretch%(-backports%(-sloppy)=|-security)=|buster%(-backports|-security)=|bullseye|bookworm|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco|eoan)%(-%(security|proposed|updates|backports|commercial|partner))=)+" +exe 'syn match debchangelogTarget contained "\%( \%('.join(s:supported, '\|').'\)\>[-[:alnum:]]*\)\+"' +exe 'syn match debchangelogUnsupportedTarget contained "\%( \%('.join(s:unsupported, '\|').'\)\>[-[:alnum:]]*\)\+"' +syn match debchangelogUnreleased contained / UNRELEASED/ syn match debchangelogVersion contained "(.\{-})" syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" @@ -29,7 +53,7 @@ syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" syn match debchangelogEmail contained "<.\{-}>" " Define the entries that make up the changelog -syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline +syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogUnsupportedTarget,debchangelogUnreleased,debchangelogVersion,debchangelogBinNMU oneline syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline @@ -44,6 +68,8 @@ hi def link debchangelogOtherKV Identifier hi def link debchangelogName Comment hi def link debchangelogVersion Identifier hi def link debchangelogTarget Identifier +hi def link debchangelogUnsupportedTarget Identifier +hi def link debchangelogUnreleased WarningMsg hi def link debchangelogEmail Special let b:current_syntax = 'debchangelog' diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index 9085cd01d5f30..4c7fb5dd63cad 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2018 Aug 11 +" Last Change: 2022 May 11 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcontrol.vim " Standard syntax initialization @@ -17,7 +17,7 @@ set cpo&vim " Should match case except for the keys of each field syn case match -syn iskeyword @,48-57,-,/ +syn iskeyword @,48-57,- " Everything that is not explicitly matched by the rules below syn match debcontrolElse "^.*$" @@ -47,22 +47,24 @@ exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs) unlet s:kernels s:archs s:pairs +" Keep in sync with https://metadata.ftp-master.org/sections.822 +" curl -q https://metadata.ftp-master.debian.org/sections.822 2>/dev/null| grep-dctrl -n --not -FSection -sSection / - let s:sections = [ \ 'admin', 'cli-mono', 'comm', 'database', 'debian-installer', 'debug' \, 'devel', 'doc', 'editors', 'education', 'electronics', 'embedded' - \, 'fonts', 'games', 'gnome', 'gnustep', 'gnu-r', 'golang', 'graphics' + \, 'fonts', 'games', 'gnome', 'gnu-r', 'gnustep', 'golang', 'graphics' \, 'hamradio', 'haskell', 'httpd', 'interpreters', 'introspection' - \, 'java\%(script\)\=', 'kde', 'kernel', 'libs', 'libdevel', 'lisp' - \, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net' - \, 'news', 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python' - \, 'ruby', 'rust', 'science', 'shells', 'sound', 'text', 'tex' + \, 'java', 'javascript', 'kde', 'kernel', 'libdevel', 'libs', 'lisp' + \, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net', 'news' + \, 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python', 'raku' + \, 'ruby', 'rust', 'science', 'shells', 'sound', 'tasks', 'tex', 'text' \, 'utils', 'vcs', 'video', 'web', 'x11', 'xfce', 'zope' \ ] syn keyword debcontrolMultiArch contained no foreign allowed same syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" syn keyword debcontrolPriority contained extra important optional required standard -exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\%('.join(s:sections, '\|').'\)"' +exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\<\%('.join(s:sections, '\|').'\)\>"' syn keyword debcontrolPackageType contained udeb deb syn match debcontrolVariable contained "\${.\{-}}" syn keyword debcontrolDmUpload contained yes @@ -89,6 +91,11 @@ syn case ignore " Handle all fields from deb-src-control(5) +" 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 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 syn region debcontrolStrictField matchgroup=debcontrolKey start="^Architecture: *" end="$" contains=debcontrolArchitecture,debcontrolSpace oneline syn region debcontrolStrictField matchgroup=debcontrolKey start="^Multi-Arch: *" end="$" contains=debcontrolMultiArch oneline @@ -97,20 +104,15 @@ syn region debcontrolStrictField matchgroup=debcontrolKey start="^Priority: *" e syn region debcontrolStrictField matchgroup=debcontrolKey start="^Section: *" end="$" contains=debcontrolSection oneline syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XC-\)\=Package-Type: *" end="$" contains=debcontrolPackageType oneline syn region debcontrolStrictField matchgroup=debcontrolKey start="^Homepage: *" end="$" contains=debcontrolHTTPUrl oneline keepend -syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\): *" end="$" contains=debcontrolHTTPUrl oneline keepend -syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-Svn: *" end="$" contains=debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend -syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-Cvs: *" end="$" contains=debcontrolVcsCvs oneline keepend -syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-Git: *" end="$" contains=debcontrolVcsGit oneline keepend +syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\): *" end="$" contains=debcontrolHTTPUrl oneline keepend +syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-Svn: *" end="$" contains=debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend +syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-Cvs: *" end="$" contains=debcontrolVcsCvs oneline keepend +syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-Git: *" end="$" contains=debcontrolVcsGit oneline keepend syn region debcontrolStrictField matchgroup=debcontrolKey start="^Rules-Requires-Root: *" end="$" contains=debcontrolR3 oneline syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(Build-\)\=Essential: *" end="$" contains=debcontrolYesNo oneline syn region debcontrolStrictField matchgroup=debcontrolDeprecatedKey start="^\%(XS-\)\=DM-Upload-Allowed: *" end="$" contains=debcontrolDmUpload oneline -" Catch-all for the other 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 debcontrolMultiFieldSpell matchgroup=debcontrolKey start="^Description: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell - " Associate our matches and regions with pretty colours hi def link debcontrolKey Keyword hi def link debcontrolField Normal diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index 97acbf60fc21a..e3ec6e65989a9 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers " Former Maintainer: Matthijs Mohlmann -" Last Change: 2019 Sep 07 +" Last Change: 2022 May 01 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim " Standard syntax initialization @@ -23,19 +23,21 @@ let s:cpo = &cpo set cpo-=C let s:supported = [ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', - \ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm', - \ 'sid', 'rc-buggy', + \ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm', + \ 'trixie', 'sid', 'rc-buggy', \ - \ 'trusty', 'xenial', 'bionic', 'disco', 'eoan', 'devel' + \ 'trusty', 'xenial', 'bionic', 'focal', 'impish', 'jammy', 'kinetic', + \ 'devel' \ ] let s:unsupported = [ \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', - \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', + \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy', \ \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', - \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic' + \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic', + \ 'disco', 'eoan', 'hirsute', 'groovy' \ ] let &cpo=s:cpo diff --git a/runtime/syntax/dep3patch.vim b/runtime/syntax/dep3patch.vim new file mode 100644 index 0000000000000..cb0eda89316a9 --- /dev/null +++ b/runtime/syntax/dep3patch.vim @@ -0,0 +1,57 @@ +" Vim syntax file +" Language: Debian DEP3 Patch headers +" Maintainer: Gabriel Filion +" Last Change: 2022 Apr 06 +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/dep3patch.vim +" +" Specification of the DEP3 patch header format is available at: +" https://dep-team.pages.debian.net/deps/dep3/ + +" Standard syntax initialization +if exists('b:current_syntax') + finish +endif + +runtime! syntax/diff.vim +unlet! b:current_syntax + +let s:cpo_save = &cpo +set cpo&vim + +syn region dep3patchHeaders start="\%^" end="^\%(---\)\@=" contains=dep3patchKey,dep3patchMultiField + +syn case ignore + +syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Description\|Subject\)\ze: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contained contains=@Spell +syn region dep3patchMultiField matchgroup=dep3patchKey start="^Origin\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID,dep3patchOriginCategory oneline keepend +syn region dep3patchMultiField matchgroup=dep3patchKey start="^Bug\%(-[[:graph:]]\+\)\?\ze: *" end="$" contained contains=dep3patchHTTPUrl oneline keepend +syn region dep3patchMultiField matchgroup=dep3patchKey start="^Forwarded\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchForwardedShort oneline keepend +syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Author\|From\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend +syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Reviewed-by\|Acked-by\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend +syn region dep3patchMultiField matchgroup=dep3patchKey start="^Last-Update\ze: *" end="$" contained contains=dep3patchISODate oneline keepend +syn region dep3patchMultiField matchgroup=dep3patchKey start="^Applied-Upstream\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID oneline keepend + +syn match dep3patchHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" +syn match dep3patchCommitID contained "commit:[[:alnum:]]\+" +syn match dep3patchOriginCategory contained "\%(upstream\|backport\|vendor\|other\), " +syn match dep3patchForwardedShort contained "\%(yes\|no\|not-needed\), " +syn match dep3patchEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+" +syn match dep3patchEmail "<.\{-}>" +syn match dep3patchISODate "[[:digit:]]\{4}-[[:digit:]]\{2}-[[:digit:]]\{2}" + +" Associate our matches and regions with pretty colours +hi def link dep3patchKey Keyword +hi def link dep3patchOriginCategory Keyword +hi def link dep3patchForwardedShort Keyword +hi def link dep3patchMultiField Normal +hi def link dep3patchHTTPUrl Identifier +hi def link dep3patchCommitID Identifier +hi def link dep3patchEmail Identifier +hi def link dep3patchISODate Identifier + +let b:current_syntax = 'dep3patch' + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 sw=2 diff --git a/runtime/syntax/desktop.vim b/runtime/syntax/desktop.vim index 915107887a635..2c1102238d733 100644 --- a/runtime/syntax/desktop.vim +++ b/runtime/syntax/desktop.vim @@ -1,107 +1,267 @@ " Vim syntax file -" Language: .desktop, .directory files -" according to freedesktop.org specification 0.9.4 -" http://pdx.freedesktop.org/Standards/desktop-entry-spec/desktop-entry-spec-0.9.4.html -" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2016 Apr 02 -" (added "Keywords") -" Version Info: desktop.vim 0.9.4-1.2 +" Language: XDG desktop entry +" Filenames: *.desktop, *.directory +" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) +" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) +" Last Change: 2020-06-11 +" Version Info: desktop.vim 1.5 +" References: +" - https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.5.html (2020-04-27) +" - https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-0.11.html (2006-02-07) " quit when a syntax file was already loaded if exists("b:current_syntax") - finish + finish endif +let s:cpo_save = &cpo +set cpo&vim +syn case match + +" Variable {{{1 " This syntax file can be used to all *nix configuration files similar to dos -" ini format (eg. .xawtv, .radio, kde rc files) - this is default mode. But -" you can also enforce strict following of freedesktop.org standard for -" .desktop and .directory files . Set (eg. in vimrc) -" let enforce_freedesktop_standard = 1 -" and nonstandard extensions not following X- notation will not be highlighted. -if exists("enforce_freedesktop_standard") - let b:enforce_freedesktop_standard = 1 +" ini format (eg. .xawtv, .radio, kde rc files) - this is default mode. +" By default strict following of freedesktop.org standard is enforced. +" To highlight nonstandard extensions that does not begin with X-, set +" let g:desktop_enable_nonstd = v:true +" Note that this may cause wrong highlight. +" To highlight KDE-reserved features, set +" let g:desktop_enable_kde = v:true +" g:desktop_enable_kde follows g:desktop_enable_nonstd if not supplied + +if exists("g:desktop_enable_nonstd") && g:desktop_enable_nonstd + let s:desktop_enable_nonstd = v:true else - let b:enforce_freedesktop_standard = 0 + let s:desktop_enable_nonstd = v:false endif -" case on -syn case match +if exists("g:desktop_enable_kde") && g:desktop_enable_kde || s:desktop_enable_nonstd + let s:desktop_enable_kde = v:true +else + let s:desktop_enable_kde = v:false +endif + +" Comment {{{1 +syn match dtComment /^#.*$/ -" General -if b:enforce_freedesktop_standard == 0 - syn match dtNotStLabel "^.\{-}=\@=" nextgroup=dtDelim +" Error {{{1 +syn match dtError /\%(^\s.*\|\s\+$\)/ + +" Group Header {{{1 +" ASCII printable characters except for brackets [ (0x5B) and ] (0x5D) +syn match dtGroup /^\[[\x20-\x5A\x5C\x5E-\x7E]\+\]$/ + +" Entries {{{1 +syn match dtDelim /=/ contained +" lang_territory.codeset@modifier +syn match dtLocaleSuffix + \ /\[\%(C\|POSIX\|[a-z]\{2,4}\%(_[A-Z0-9]\{2,3}\)\?\)\%(\.[A-Za-z0-9_-]\+\)\?\%(@[A-Za-z]\+\)\?\]\ze\s*=/ + \ contained + +" Boolean Value {{{2 +syn match dtBoolean + \ /^\%(DBusActivatable\|Hidden\|NoDisplay\|PrefersNonDefaultGPU\|StartupNotify\|Terminal\)\s*=\s*\%(true\|false\)/ + \ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent +syn keyword dtBooleanKey + \ DBusActivatable Hidden NoDisplay PrefersNonDefaultGPU StartupNotify Terminal + \ contained nextgroup=dtDelim + +if s:desktop_enable_kde + syn match dtBoolean + \ /^ReadOnly\s*=\s*\%(true\|false\)/ + \ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent + syn keyword dtBooleanKey + \ ReadOnly + \ contained nextgroup=dtDelim endif +syn keyword dtBooleanValue true false contained -syn match dtGroup /^\s*\[.*\]/ -syn match dtComment /^\s*#.*$/ -syn match dtDelim /=/ contained +" Numeric Value {{{2 +" icon theme +syn match dtNumeric /^\%(MaxSize\|MinSize\|Size\|Threshold\)\s*=\s*\d\+/ contains=dtNumericKey,dtDelim,dtNumericDecimal +syn keyword dtNumericKey + \ MaxSize MinSize Size Threshold + \ contained nextgroup=dtDelim -" Locale -syn match dtLocale /^\s*\<\(Name\|GenericName\|Comment\|SwallowTitle\|Icon\|UnmountIcon\)\>.*/ contains=dtLocaleKey,dtLocaleName,dtDelim transparent -syn keyword dtLocaleKey Name GenericName Comment SwallowTitle Icon UnmountIcon nextgroup=dtLocaleName containedin=dtLocale -syn match dtLocaleName /\(\[.\{-}\]\s*=\@=\|\)/ nextgroup=dtDelim containedin=dtLocale contained +if s:desktop_enable_kde + syn match dtNumeric /^InitialPreference\s*=\s*\d\+/ contains=dtNumericKey,dtDelim,dtNumericDecimal + syn keyword dtNumericKey + \ InitialPreference + \ contained nextgroup=dtDelim +endif + +syn match dtNumericDecimal /\<\d\+$/ contained -" Numeric -syn match dtNumeric /^\s*\/ contains=dtNumericKey,dtDelim -syn keyword dtNumericKey Version nextgroup=dtDelim containedin=dtNumeric contained +" String Value {{{2 +syn match dtString + \ /^\%(Actions\|Implements\|MimeType\|NotShowIn\|OnlyShowIn\|Path\|StartupWMClass\|URL\)\s*=.*\S/ + \ contains=dtStringKey,dtDelim transparent +syn keyword dtStringKey + \ Actions Implements MimeType NotShowIn OnlyShowIn Path StartupWMClass URL Version + \ contained nextgroup=dtDelim -" Boolean -syn match dtBoolean /^\s*\<\(StartupNotify\|ReadOnly\|Terminal\|Hidden\|NoDisplay\)\>.*/ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent -syn keyword dtBooleanKey StartupNotify ReadOnly Terminal Hidden NoDisplay nextgroup=dtDelim containedin=dtBoolean contained -syn keyword dtBooleanValue true false containedin=dtBoolean contained +" icon theme +syn match dtString + \ /^\%(Context\|Directories\|Example\|Inherits\)\s*=.*\S/ + \ contains=dtStringKey,dtDelim transparent +syn keyword dtStringKey + \ Context Directories Example Inherits + \ contained nextgroup=dtDelim -" String -syn match dtString /^\s*\<\(Encoding\|Icon\|Path\|Actions\|FSType\|MountPoint\|UnmountIcon\|URL\|Keywords\|Categories\|OnlyShowIn\|NotShowIn\|StartupWMClass\|FilePattern\|MimeType\)\>.*/ contains=dtStringKey,dtDelim transparent -syn keyword dtStringKey Type Encoding TryExec Exec Path Actions FSType MountPoint URL Keywords Categories OnlyShowIn NotShowIn StartupWMClass FilePattern MimeType nextgroup=dtDelim containedin=dtString contained +if s:desktop_enable_kde + syn match dtString + \ /^\%(Dev\|DocPath\|FSType\|MountPoint\|ServiceTypes\)\s*=.*\S/ + \ contains=dtStringKey,dtDelim transparent + syn keyword dtStringKey + \ Dev DocPath FSType MountPoint ServiceTypes + \ contained nextgroup=dtDelim +endif -" Exec -syn match dtExec /^\s*\<\(Exec\|TryExec\|SwallowExec\)\>.*/ contains=dtExecKey,dtDelim,dtExecParam transparent -syn keyword dtExecKey Exec TryExec SwallowExec nextgroup=dtDelim containedin=dtExec contained -syn match dtExecParam /%[fFuUnNdDickv]/ containedin=dtExec contained +" Categories {{{3 +" https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry +syn match dtCategories /^Categories\s*=.\+\S/ contains=dtCategoriesKey,dtDelim,dtCategoriesValue transparent +syn keyword dtCategoriesKey + \ Categories + \ contained nextgroup=dtDelim -" Type -syn match dtType /^\s*\.*/ contains=dtTypeKey,dtDelim,dtTypeValue transparent -syn keyword dtTypeKey Type nextgroup=dtDelim containedin=dtType contained -syn keyword dtTypeValue Application Link FSDevice Directory containedin=dtType contained +" Main Categories +syn keyword dtCategoriesValue + \ Audio AudioVideo Development Education Game Graphics Network Office + \ Settings System Utility Video + \ contained -" X-Addition -syn match dtXAdd /^\s*X-.*/ contains=dtXAddKey,dtDelim transparent -syn match dtXAddKey /^\s*X-.\{-}\s*=\@=/ nextgroup=dtDelim containedin=dtXAdd contains=dtXLocale contained +" Additional Categories +syn keyword dtCategoriesValue + \ BoardGame Chat Clock Geoscience Presentation 2DGraphics 3DGraphics + \ Accessibility ActionGame AdventureGame Amusement ArcadeGame Archiving + \ Art ArtificialIntelligence Astronomy AudioVideoEditing Biology + \ BlocksGame BoardGame Building Calculator Calendar CardGame Chart Chat + \ Chemistry Clock Compression ComputerScience ConsoleOnly Construction + \ ContactManagement Core DataVisualization Database Debugger + \ DesktopSettings Dialup Dictionary DiscBurning Documentation Economy + \ Electricity Electronics Email Emulator Engineering FileManager + \ FileTools FileTransfer Filesystem Finance FlowChart GNOME GTK + \ GUIDesigner Geography Geology Geoscience HamRadio HardwareSettings + \ History IDE IRCClient ImageProcessing InstantMessaging Java KDE + \ KidsGame Languages Literature LogicGame Math MedicalSoftware Midi + \ Mixer Monitor Motif Music News NumericalAnalysis OCR P2P PDA + \ PackageManager ParallelComputing Photography Physics Player + \ Presentation Printing Profiling ProjectManagement Publishing Qt + \ RasterGraphics Recorder RemoteAccess RevisionControl Robotics + \ RolePlaying Scanning Science Security Sequencer Simulation Sports + \ SportsGame Spreadsheet StrategyGame TV Telephony TelephonyTools + \ TerminalEmulator TextEditor TextTools Translation Tuner VectorGraphics + \ VideoConference Viewer WebBrowser WebDevelopment WordProcessor + \ contained -" Locale for X-Addition -syn match dtXLocale /\[.\{-}\]\s*=\@=/ containedin=dtXAddKey contained +" Reserved Category +syn keyword dtCategoriesValue + \ Applet Screensaver Shell TrayIcon + \ contained + +" Exec/TryExec {{{3 +syn match dtExec /^\%(Exec\|TryExec\)\s*=.\+\S/ contains=dtExecKey,dtDelim,dtExecParam transparent +syn keyword dtExecKey + \ Exec TryExec + \ contained nextgroup=dtDelim +" code for file(s), URL(s), etc +syn match dtExecParam /\s\zs%[fFuUick]\ze\%(\W\|$\)/ contained + +" Type {{{3 +syn match dtType /^Type\s*=\s*\S\+/ contains=dtTypeKey,dtDelim,dtTypeValue transparent +syn keyword dtTypeKey + \ Type + \ contained nextgroup=dtDelim +syn keyword dtTypeValue + \ Application Directory Link + \ contained + +if s:desktop_enable_kde + syn keyword dtTypeValue + \ FSDevice Service ServiceType + \ contained +endif + + +" Version {{{3 +syn match dtVersion /^Version\s*=\s*\S\+/ contains=dtVersionKey,dtDelim,dtVersionValue transparent +syn keyword dtVersionKey + \ Version + \ contained nextgroup=dtDelim +syn match dtVersionValue /[0-9]\+\%(\.[0-9]\+\)\{1,2}$/ contained + +" Localestring Value {{{2 +syn match dtLocalestring + \ /^\%(Comment\|GenericName\|Keywords\|Name\)\%(\[.\{-}\]\)\?\s*=.*\S/ + \ contains=dtLocalestringKey,dtLocaleSuffix,dtDelim transparent +syn keyword dtLocalestringKey + \ Comment GenericName Keywords Name + \ contained nextgroup=dtLocaleSuffix,dtDelim skipwhite + +" Iconstring Value {{{2 +syn match dtIconstring + \ /^Icon\s*=.*\S/ + \ contains=dtIconstringKey,dtDelim transparent +syn keyword dtIconstringKey + \ Icon + \ contained nextgroup=dtDelim skipwhite + +if s:desktop_enable_kde + syn match dtIconstring + \ /^UnmountIcon\>\%(\[.\{-}\]\)\?\s*=.*\S/ + \ contains=dtIconstringKey,dtLocaleSuffix,dtDelim transparent + syn keyword dtIconstringKey + \ UnmountIcon + \ contained nextgroup=dtLocaleSuffix,dtDelim skipwhite +endif + +" X-Extension {{{2 +syn match dtXExtension /^X-[0-9A-Za-z-]*\%(\[.\{-}\]\)\?\s*=.*\S/ + \ contains=dtXExtensionKey,dtLocaleSuffix,dtDelim transparent +syn match dtXExtensionKey /^X-[0-9A-Za-z-]*/ contained nextgroup=dtLocaleSuffix,dtDelim + +" non standard {{{2 +if s:desktop_enable_nonstd + syn match dtNonStdLabel /^[0-9A-Za-z-]\+\%(\[.\{-}\]\)\?\s*=.*\S/ + \ contains=dtNonStdLabelKey,dtLocaleSuffix,dtDelim transparent + syn match dtNonStdLabelKey /^[0-9A-Za-z-]\+/ contained nextgroup=dtLocaleSuffix,dtDelim +endif -" Locale for all -syn match dtALocale /\[.\{-}\]\s*=\@=/ containedin=ALL +" Highlight {{{1 +hi def link dtComment Comment +hi def link dtError Error +hi def link dtGroup Special -" Define the default highlighting. -" Only when an item doesn't have highlighting yet +hi def link dtDelim Delimiter +hi def link dtLocaleSuffix Identifier -hi def link dtGroup Special -hi def link dtComment Comment -hi def link dtDelim String +hi def link dtBooleanKey Type +hi def link dtBooleanValue Boolean -hi def link dtLocaleKey Type -hi def link dtLocaleName Identifier -hi def link dtXLocale Identifier -hi def link dtALocale Identifier +hi def link dtNumericKey Type +hi def link dtNumericDecimal Number -hi def link dtNumericKey Type +hi def link dtStringKey Type +hi def link dtCategoriesKey Type +hi def link dtCategoriesValue Constant +hi def link dtExecKey Type +hi def link dtExecParam Special +hi def link dtTypeKey Type +hi def link dtTypeValue Constant +hi def link dtVersionKey Type +hi def link dtVersionValue Constant -hi def link dtBooleanKey Type -hi def link dtBooleanValue Constant +hi def link dtLocalestringKey Type -hi def link dtStringKey Type +hi def link dtIconStringKey Type -hi def link dtExecKey Type -hi def link dtExecParam Special -hi def link dtTypeKey Type -hi def link dtTypeValue Constant -hi def link dtNotStLabel Type -hi def link dtXAddKey Type +hi def link dtXExtensionKey Type +hi def link dtNonStdLabelKey Type +" Clean Up {{{1 let b:current_syntax = "desktop" +let &cpo = s:cpo_save -" vim:ts=8 +" vim:ts=8:sw=2:fdm=marker diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim index b656cd97a6be2..408556ac13e08 100644 --- a/runtime/syntax/diff.vim +++ b/runtime/syntax/diff.vim @@ -2,7 +2,7 @@ " Language: Diff (context or unified) " Maintainer: Bram Moolenaar " Translations by Jakson Alves de Aquino. -" Last Change: 2016 Apr 02 +" Last Change: 2020 Dec 30 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -346,11 +346,18 @@ syn match diffLine "^---$" syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*" syn match diffFile "^diff\>.*" -syn match diffFile "^+++ .*" syn match diffFile "^Index: .*" syn match diffFile "^==== .*" -syn match diffOldFile "^\*\*\* .*" -syn match diffNewFile "^--- .*" + +if search('^@@ -\S\+ +\S\+ @@', 'nw', '', 100) + " unified + syn match diffOldFile "^--- .*" + syn match diffNewFile "^+++ .*" +else + " context / old style + syn match diffOldFile "^\*\*\* .*" + syn match diffNewFile "^--- .*" +endif " Used by git syn match diffIndexLine "^index \x\x\x\x.*" diff --git a/runtime/syntax/dirpager.vim b/runtime/syntax/dirpager.vim index 1a600637989d4..dc8b9867ab273 100644 --- a/runtime/syntax/dirpager.vim +++ b/runtime/syntax/dirpager.vim @@ -6,7 +6,7 @@ " Description: display directory content inside Vim with syntax " highlighting " File: runtime/syntax/dirpager.vim -" Last Change: 2012 May 19 +" Last Change: 2022 Jun 14 " Modeline: vim: ts=8:sw=2:sts=2: " " Credits: dirpager.vim is derived from Nikolai Weibulls dircolors.vim diff --git a/runtime/syntax/django.vim b/runtime/syntax/django.vim index d3ca4de0e232b..76b47d2e59775 100644 --- a/runtime/syntax/django.vim +++ b/runtime/syntax/django.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Django template " Maintainer: Dave Hodder -" Last Change: 2014 Jul 13 +" Last Change: 2021 Nov 29 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -31,6 +31,7 @@ syn keyword djangoStatement contained closecomment widthratio url with endwith syn keyword djangoStatement contained get_current_language trans noop blocktrans syn keyword djangoStatement contained endblocktrans get_available_languages syn keyword djangoStatement contained get_current_language_bidi plural +syn keyword djangoStatement contained translate blocktranslate endblocktranslate " Django templete built-in filters syn keyword djangoFilter contained add addslashes capfirst center cut date diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim index 4cf50d999f925..ce52e697cdad9 100644 --- a/runtime/syntax/dockerfile.vim +++ b/runtime/syntax/dockerfile.vim @@ -1,26 +1,45 @@ " dockerfile.vim - Syntax highlighting for Dockerfiles " Maintainer: Honza Pokorny -" Version: 0.6 -" Last Change: 2019 Aug 16 +" Last Change: 2020 Feb 11 " License: BSD +" https://docs.docker.com/engine/reference/builder/ if exists("b:current_syntax") finish endif -let b:current_syntax = "dockerfile" +syntax include @JSON syntax/json.vim +unlet b:current_syntax + +syntax include @Shell syntax/sh.vim +unlet b:current_syntax syntax case ignore +syntax match dockerfileLinePrefix /\v^\s*(ONBUILD\s+)?\ze\S/ contains=dockerfileKeyword nextgroup=dockerfileInstruction skipwhite +syntax region dockerfileFrom matchgroup=dockerfileKeyword start=/\v^\s*(FROM)\ze(\s|$)/ skip=/\v\\\_./ end=/\v((^|\s)AS(\s|$)|$)/ contains=dockerfileOption -syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s/ +syntax keyword dockerfileKeyword contained ADD ARG CMD COPY ENTRYPOINT ENV EXPOSE HEALTHCHECK LABEL MAINTAINER ONBUILD RUN SHELL STOPSIGNAL USER VOLUME WORKDIR +syntax match dockerfileOption contained /\v(^|\s)\zs--\S+/ -syntax match dockerfileKeyword /\v(AS)/ +syntax match dockerfileInstruction contained /\v<(\S+)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileValue +syntax match dockerfileInstruction contained /\v<(ADD|COPY)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileJSON +syntax match dockerfileInstruction contained /\v<(HEALTHCHECK)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileInstruction +syntax match dockerfileInstruction contained /\v<(CMD|ENTRYPOINT|RUN)>/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileShell +syntax match dockerfileInstruction contained /\v<(CMD|ENTRYPOINT|RUN)>\ze\s+\[/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileJSON +syntax match dockerfileInstruction contained /\v<(SHELL|VOLUME)>/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileJSON -syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ +syntax region dockerfileString contained start=/\v"/ skip=/\v\\./ end=/\v"/ +syntax region dockerfileJSON contained keepend start=/\v\[/ skip=/\v\\\_./ end=/\v$/ contains=@JSON +syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=@Shell +syntax region dockerfileValue contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=dockerfileString -syntax match dockerfileComment "\v^\s*#.*$" +syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/ +set commentstring=#\ %s hi def link dockerfileString String hi def link dockerfileKeyword Keyword hi def link dockerfileComment Comment +hi def link dockerfileOption Special + +let b:current_syntax = "dockerfile" diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim index 249e6f7c469b7..f003a65909f73 100644 --- a/runtime/syntax/dosbatch.vim +++ b/runtime/syntax/dosbatch.vim @@ -1,5 +1,5 @@ " Vim syntax file -" Language: MSDOS batch file (with NT command extensions) +" Language: MS-DOS batch file (with NT command extensions) " Maintainer: Mike Williams " Filenames: *.bat " Last Change: 6th September 2009 diff --git a/runtime/syntax/dot.vim b/runtime/syntax/dot.vim index 0fdd6ea080169..68a0f57a98b59 100644 --- a/runtime/syntax/dot.vim +++ b/runtime/syntax/dot.vim @@ -1,16 +1,22 @@ -" Vim syntax file " Language: Dot " Filenames: *.dot " Maintainer: Markus Mottl " URL: http://www.ocaml.info/vim/syntax/dot.vim -" Last Change: 2011 May 17 - improved identifier matching + two new keywords +" Last Change: 2021 Mar 24 - better attr + escape string matching, new keywords (Farbod Salamat-Zadeh) +" 2011 May 17 - improved identifier matching + two new keywords " 2001 May 04 - initial version -" quit when a syntax file was already loaded -if exists("b:current_syntax") +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") finish endif +let s:keepcpo = &cpo +set cpo&vim + " Errors syn match dotParErr ")" syn match dotBrackErr "]" @@ -29,39 +35,43 @@ syn keyword dotTodo contained TODO FIXME XXX " Strings syn region dotString start=+"+ skip=+\\\\\|\\"+ end=+"+ -" General keywords -syn keyword dotKeyword digraph node edge subgraph - -" Graph attributes -syn keyword dotType center layers margin mclimit name nodesep nslimit -syn keyword dotType ordering page pagedir rank rankdir ranksep ratio -syn keyword dotType rotate size - -" Node attributes -syn keyword dotType distortion fillcolor fontcolor fontname fontsize -syn keyword dotType height layer orientation peripheries regular -syn keyword dotType shape shapefile sides skew width +" Escape strings +syn match dotEscString /\v\\(N|G|E|T|H|L)/ containedin=dotString +syn match dotEscString /\v\\(n|l|r)/ containedin=dotString -" Edge attributes -syn keyword dotType arrowhead arrowsize arrowtail constraint decorateP -syn keyword dotType dir headclip headlabel headport labelangle labeldistance -syn keyword dotType labelfontcolor labelfontname labelfontsize -syn keyword dotType minlen port_label_distance samehead sametail -syn keyword dotType tailclip taillabel tailport weight - -" Shared attributes (graphs, nodes, edges) -syn keyword dotType color - -" Shared attributes (graphs and edges) -syn keyword dotType bgcolor label URL - -" Shared attributes (nodes and edges) -syn keyword dotType fontcolor fontname fontsize layer style +" General keywords +syn keyword dotKeyword graph digraph subgraph node edge strict + +" Node, edge and graph attributes +syn keyword dotType _background area arrowhead arrowsize arrowtail bb bgcolor + \ center charset class clusterrank color colorscheme comment compound + \ concentrate constraint Damping decorate defaultdist dim dimen dir + \ diredgeconstraints distortion dpi edgehref edgetarget edgetooltip + \ edgeURL epsilon esep fillcolor fixedsize fontcolor fontname fontnames + \ fontpath fontsize forcelabels gradientangle group head_lp headclip + \ headhref headlabel headport headtarget headtooltip headURL height href + \ id image imagepath imagepos imagescale inputscale K label label_scheme + \ labelangle labeldistance labelfloat labelfontcolor labelfontname + \ labelfontsize labelhref labeljust labelloc labeltarget labeltooltip + \ labelURL landscape layer layerlistsep layers layerselect layersep + \ layout len levels levelsgap lhead lheight lp ltail lwidth margin + \ maxiter mclimit mindist minlen mode model mosek newrank nodesep + \ nojustify normalize notranslate nslimit nslimit1 ordering orientation + \ outputorder overlap overlap_scaling overlap_shrink pack packmode pad + \ page pagedir pencolor penwidth peripheries pin pos quadtree quantum + \ rank rankdir ranksep ratio rects regular remincross repulsiveforce + \ resolution root rotate rotation samehead sametail samplepoints scale + \ searchsize sep shape shapefile showboxes sides size skew smoothing + \ sortv splines start style stylesheet tail_lp tailclip tailhref + \ taillabel tailport tailtarget tailtooltip tailURL target tooltip + \ truecolor URL vertices viewport voro_margin weight width xdotversion + \ xlabel xlp z " Special chars syn match dotKeyChar "=" syn match dotKeyChar ";" syn match dotKeyChar "->" +syn match dotKeyChar "--" " Identifier syn match dotIdentifier /\<\w\+\(:\w\+\)\?\>/ @@ -71,27 +81,41 @@ syn sync minlines=50 syn sync maxlines=500 " Define the default highlighting. -" Only when an item doesn't have highlighting yet - -hi def link dotParErr Error -hi def link dotBraceErr Error -hi def link dotBrackErr Error - -hi def link dotComment Comment -hi def link dotTodo Todo - -hi def link dotParEncl Keyword -hi def link dotBrackEncl Keyword -hi def link dotBraceEncl Keyword - -hi def link dotKeyword Keyword -hi def link dotType Type -hi def link dotKeyChar Keyword - -hi def link dotString String -hi def link dotIdentifier Identifier - +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_dot_syntax_inits") + if version < 508 + let did_dot_syntax_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink dotParErr Error + HiLink dotBraceErr Error + HiLink dotBrackErr Error + + HiLink dotComment Comment + HiLink dotTodo Todo + + HiLink dotParEncl Keyword + HiLink dotBrackEncl Keyword + HiLink dotBraceEncl Keyword + + HiLink dotKeyword Keyword + HiLink dotType Type + HiLink dotKeyChar Keyword + + HiLink dotString String + HiLink dotEscString Keyword + HiLink dotIdentifier Identifier + + delcommand HiLink +endif let b:current_syntax = "dot" +let &cpo = s:keepcpo +unlet s:keepcpo + " vim: ts=8 diff --git a/runtime/syntax/doxygen.vim b/runtime/syntax/doxygen.vim index adc0c41dd631b..357c4302cf337 100644 --- a/runtime/syntax/doxygen.vim +++ b/runtime/syntax/doxygen.vim @@ -1,11 +1,11 @@ -" DoxyGen syntax hilighting extension for c/c++/idl/java +" DoxyGen syntax highlighting extension for c/c++/idl/java " Language: doxygen on top of c, cpp, idl, java, php " Maintainer: Michael Geddes " Author: Michael Geddes -" Last Change: November 2017 (\throws by Candy Gumdrop) -" Version: 1.27 +" Last Change: December 2020 +" Version: 1.30 " -" Copyright 2004-2017 Michael Geddes +" Copyright 2004-2020 Michael Geddes " Please feel free to use, modify & distribute all or part of this script, " providing this copyright message remains. " I would appreciate being acknowledged in any derived scripts, and would @@ -54,7 +54,7 @@ let s:cpo_save = &cpo try set cpo&vim - " Start of Doxygen syntax hilighting: + " Start of Doxygen syntax highlighting: " " C/C++ Style line comments @@ -120,7 +120,7 @@ try " end=+\(\n\s*\*\=\s*\([@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+ "syn region doxygenBriefLine contained start=+\<\k+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contains=doxygenContinueCommentWhite,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenHyperLink,doxygenHashLink,@Spell skipwhite keepend matchgroup=xxx -syn region doxygenBriefLine contained start=+\<\k+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ skipwhite keepend matchgroup=xxx +syn region doxygenBriefLine contained start=+\<\k+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ skipwhite keepend matchgroup=xxx contains=@Spell " syn region doxygenBriefLine matchgroup=xxxy contained start=+\<\k.\++ skip=+^\s*\k+ end=+end+ skipwhite keepend "doxygenFindBriefSpecial, "" syn region doxygenSpecialMultilineDesc start=+.\++ contained contains=doxygenSpecialContinueCommentWhite,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell skipwhite keepend @@ -170,7 +170,7 @@ endif fun! s:DxyCreateSmallSpecial( kword, name ) - let mx='[-:0-9A-Za-z_%=&+*/!~>|]\@|#]\+[-0-9A-Za-z_%=+*/!~>|]\@!\|\\[\\<>&.]@\|[.,][0-9a-zA-Z_]\@=\|::\|([^)]*)\|&[0-9a-zA-Z]\{2,7};\)\+' + let mx='[-:0-9A-Za-z_%=&+*/!~>|]\@|#]\+[-0-9A-Za-z_%=+*/!~>|]\@!\|\\[\\<>&.]@\|[.,]\w\@=\|::\|([^)]*)\|&[0-9a-zA-Z]\{2,7};\)\+' exe 'syn region doxygenSpecial'.a:name.'Word contained start=+'.a:kword.'+ end=+\(\_s\+'.mx.'\)\@<=[-a-zA-Z_0-9+*/^%|~!=&\\]\@!+ skipwhite contains=doxygenContinueCommentWhite,doxygen'.a:name.'Word' exe 'syn match doxygen'.a:name.'Word contained "\_s\@<='.mx.'" contains=doxygenHtmlSpecial,@Spell keepend' endfun @@ -186,7 +186,7 @@ endif syn match doxygenSmallSpecial contained +[@\\]\(\<[npcbea]\>\|\\|\\|\\|f\$\|[$\\&<>#]\)\@=+ nextgroup=doxygenOtherLink,doxygenHyperLink,doxygenHashLink,doxygenFormula,doxygenSymbol,doxygenSpecial.*Word " Now for special characters - syn match doxygenSpecial contained +[@\\]\(\<[npcbea]\>\|\\|\\>\|\#]\)\@!+ nextgroup=doxygenParam,doxygenRetval,doxygenBriefWord,doxygenBold,doxygenBOther,doxygenOther,doxygenOtherTODO,doxygenOtherWARN,doxygenOtherBUG,doxygenPage,doxygenGroupDefine,doxygenCodeRegion,doxygenVerbatimRegion,doxygenDotRegion + syn match doxygenSpecial contained +[@\\]\(\<[npcbea]\>\|\\|\\>\|\#]\)\@!+ nextgroup=doxygenParam,doxygenTParam,doxygenRetval,doxygenBriefWord,doxygenBold,doxygenBOther,doxygenOther,doxygenOtherTODO,doxygenOtherWARN,doxygenOtherBUG,doxygenPage,doxygenGroupDefine,doxygenCodeRegion,doxygenVerbatimRegion,doxygenDotRegion " doxygenOtherLink,doxygenSymbol,doxygenFormula,doxygenErrorSpecial,doxygenSpecial.*Word " syn match doxygenGroupDefine contained +@\@<=[{}]+ @@ -199,13 +199,14 @@ endif syn keyword doxygenParam contained param nextgroup=doxygenParamName,doxygenParamDirection skipwhite syn keyword doxygenTParam contained tparam nextgroup=doxygenParamName skipwhite syn match doxygenParamName contained +[A-Za-z0-9_:]\++ nextgroup=doxygenSpecialMultilineDesc skipwhite - syn keyword doxygenRetval contained retval throw throws exception nextgroup=doxygenParamName skipwhite + syn keyword doxygenRetval contained retval throw throws exception nextgroup=doxygenReturnValue skipwhite + syn match doxygenReturnValue contained +\S\++ nextgroup=doxygenSpecialMultilineDesc skipwhite " Match one line identifiers. syn keyword doxygenOther contained addindex anchor \ dontinclude endhtmlonly endlatexonly showinitializer hideinitializer - \ example htmlonly image include includelineno ingroup internal latexonly line - \ overload relates relatesalso sa skip skipline + \ example htmlonly image include includelineno ingroup latexonly line + \ overload relates related relatesalso relatedalso sa skip skipline \ until verbinclude version addtogroup htmlinclude copydoc dotfile \ xmlonly endxmlonly \ nextgroup=doxygenSpecialOnelineDesc copybrief copydetails copyright dir extends @@ -241,8 +242,8 @@ endif syn keyword doxygenOther contained par nextgroup=doxygenHeaderLine syn region doxygenHeaderLine start=+.+ end=+^+ contained skipwhite nextgroup=doxygenSpecialMultilineDesc - - syn keyword doxygenOther contained arg author authors date deprecated li return returns see invariant note post pre remarks since test nextgroup=doxygenSpecialMultilineDesc + " Match the start of other multiline comments. + syn keyword doxygenOther contained arg author authors date deprecated li return returns result see invariant note post pre remarks since test internal nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOtherTODO contained todo attention nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOtherWARN contained warning nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOtherBUG contained bug nextgroup=doxygenSpecialMultilineDesc @@ -255,8 +256,8 @@ endif syn match doxygenLinkRest +[^*@\\]\|\*/\@!\|[@\\]\(endlink\>\)\@!+ contained skipnl nextgroup=doxygenLinkRest,doxygenContinueLinkComment syn match doxygenContinueLinkComment contained +^\s*\*\=[^/]+me=e-1 nextgroup=doxygenLinkRest syn match doxygenLinkError "\*/" contained - " #Link hilighting. - syn match doxygenHashLink /\([a-zA-Z_][0-9a-zA-Z_]*\)\?#\(\.[0-9a-zA-Z_]\@=\|[a-zA-Z0-9_]\+\|::\|()\)\+/ contained contains=doxygenHashSpecial + " #Link highlighting. + syn match doxygenHashLink /\(\h\w*\)\?#\(\.\w\@=\|\w\+\|::\|()\)\+/ contained contains=doxygenHashSpecial syn match doxygenHashSpecial /#/ contained syn match doxygenHyperLink /\(\s\|^\s*\*\?\)\@<=\(http\|https\|ftp\):\/\/[-0-9a-zA-Z_?&=+#%/.!':;@~]\+/ contained @@ -264,12 +265,12 @@ endif syn match doxygenPage "[\\@]page\>"me=s+1 contained skipwhite nextgroup=doxygenPagePage syn keyword doxygenPagePage page contained skipwhite nextgroup=doxygenPageIdent syn region doxygenPageDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend skipwhite skipnl nextgroup=doxygenBody - syn match doxygenPageIdent "\<[a-zA-Z_0-9]\+\>" contained nextgroup=doxygenPageDesc + syn match doxygenPageIdent "\<\w\+\>" contained nextgroup=doxygenPageDesc " Handle section syn keyword doxygenOther defgroup section subsection subsubsection weakgroup contained skipwhite nextgroup=doxygenSpecialIdent syn region doxygenSpecialSectionDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend skipwhite skipnl nextgroup=doxygenContinueCommentWhite - syn match doxygenSpecialIdent "\<[a-zA-Z_0-9]\+\>" contained nextgroup=doxygenSpecialSectionDesc + syn match doxygenSpecialIdent "\<\w\+\>" contained nextgroup=doxygenSpecialSectionDesc " Does the one-line description for the one-line type identifiers. syn region doxygenSpecialTypeOnelineDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend @@ -305,7 +306,7 @@ endif syn region doxygenFormula contained matchgroup=doxygenFormulaEnds start=+f\[+ end=+[@\\]f]+ contains=doxygenFormulaSpecial,doxygenFormulaOperator,doxygenAtom syn region doxygenAtom contained transparent matchgroup=doxygenFormulaOperator start=+{+ end=+}+ contains=doxygenAtom,doxygenFormulaSpecial,doxygenFormulaOperator - " Add TODO hilighting. + " Add TODO highlighting. syn keyword doxygenTODO contained TODO README XXX FIXME " Supported HTML subset. Not perfect, but okay. @@ -421,7 +422,7 @@ endif if &guifont == '' let font="font='FreeSerif 12'" else - let font="font='".substitute(&guifont, '^.\{-}\([0-9]\+\)$', 'FreeSerif \1','')."'" + let font="font='".substitute(&guifont, '^.\{-}\(\d\+\)$', 'FreeSerif \1','')."'" endif elseif has('gui_win32') || has('gui_win16') || has('gui_win95') @@ -475,6 +476,7 @@ endif SynColor doxygenSpecialHeading cterm=bold ctermfg=LightBlue guifg=LightBlue gui=bold SynColor doxygenPrev ctermfg=LightGreen guifg=LightGreen endif + SynLink doxygenValue doxygenParamName else SynLink doxygenComment SpecialComment SynLink doxygenBrief Statement @@ -486,19 +488,26 @@ endif SynLink doxygenSpecialOnelineDesc Statement SynLink doxygenSpecialHeading Statement SynLink doxygenPrev SpecialComment + SynLink doxygenValue Constant endif + SynLink doxygenTParam doxygenParam + endfun call s:Doxygen_Hilights() syn match doxygenLeadingWhite +\(^\s*\*\)\@<=\s*+ contained - " This is still a proposal, but won't do any harm. - aug doxygengroup - au! - au Syntax UserColor_reset nested call s:Doxygen_Hilights_Base() - au Syntax UserColor_{on,reset,enable} nested call s:Doxygen_Hilights() - aug END + " This is still a proposal, but it is probably fine. However, it doesn't + " work when 'syntax' is set in a modeline, catch the security error. + try + aug doxygengroup + au! + au Syntax UserColor_reset nested call s:Doxygen_Hilights_Base() + au Syntax UserColor_{on,reset,enable} nested call s:Doxygen_Hilights() + aug END + catch /E12:/ + endtry SynLink doxygenBody Comment @@ -550,6 +559,7 @@ endif SynLink doxygenLinkRest doxygenSpecialMultilineDesc SynLink doxygenHyperLink doxygenLinkWord SynLink doxygenHashLink doxygenLinkWord + SynLink doxygenReturnValue doxygenValue SynLink doxygenPage doxygenSpecial SynLink doxygenPagePage doxygenBOther diff --git a/runtime/syntax/dtd.vim b/runtime/syntax/dtd.vim index ef0592e1d1b0f..58f07c98ddb13 100644 --- a/runtime/syntax/dtd.vim +++ b/runtime/syntax/dtd.vim @@ -45,7 +45,7 @@ if !exists("dtd_no_tag_errors") syn region dtdError contained start=++ endif -" if this is a html like comment hightlight also +" if this is a html like comment highlight also " the opening as Comment. syn region dtdComment start=++ contains=dtdTodo,@Spell @@ -99,8 +99,8 @@ syn match dtdEntity "&[^; \t]*;" contains=dtdEntityPunct syn match dtdEntityPunct contained "[&.;]" " Strings are between quotes -syn region dtdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard -syn region dtdString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard +syn region dtdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dtdAttrDef,dtdAttrType,dtdParamEntityInst,dtdEntity,dtdCard +syn region dtdString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=dtdAttrDef,dtdAttrType,dtdParamEntityInst,dtdEntity,dtdCard " Enumeration of elements or data between parenthesis " diff --git a/runtime/syntax/dts.vim b/runtime/syntax/dts.vim index cd4bd776b74c5..be51ab5b10001 100644 --- a/runtime/syntax/dts.vim +++ b/runtime/syntax/dts.vim @@ -1,15 +1,16 @@ " Vim syntax file " Language: dts/dtsi (device tree files) " Maintainer: Daniel Mack -" Last Change: 2013 Oct 20 +" Last Change: 2022 Jun 14 if exists("b:current_syntax") finish endif +let b:current_syntax = 'dts' syntax region dtsComment start="/\*" end="\*/" syntax match dtsReference "&[[:alpha:][:digit:]_]\+" -syntax region dtsBinaryProperty start="\[" end="\]" +syntax region dtsBinaryProperty start="\[" end="\]" syntax match dtsStringProperty "\".*\"" syntax match dtsKeyword "/.\{-1,\}/" syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:" @@ -18,6 +19,38 @@ syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinar syntax region dtsCommentInner start="/\*" end="\*/" syntax match dtsCommentLine "//.*$" +" Accept %: for # (C99) +syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>" +if !exists("c_no_if0") + syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip + syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold + syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse + if !exists("c_no_if0_fold") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + endif + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit + syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold + syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit + if !exists("c_no_if0_fold") + syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + else + syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + endif + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip + syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc +endif +syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match cIncluded display contained "<[^>]*>" +syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +"syn match cLineSkip "\\$" +syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock +syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell +syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell + hi def link dtsCellProperty Number hi def link dtsBinaryProperty Number hi def link dtsStringProperty String @@ -26,5 +59,21 @@ hi def link dtsLabel Label hi def link dtsNode Structure hi def link dtsReference Macro hi def link dtsComment Comment -hi def link dtsCommentInner Comment +hi def link dtsCommentInner Comment hi def link dtsCommentLine Comment + +hi def link cInclude Include +hi def link cPreProc PreProc +hi def link cDefine Macro +hi def link cIncluded cString +hi def link cString String + +hi def link cCppInWrapper cCppOutWrapper +hi def link cCppOutWrapper cPreCondit +hi def link cPreConditMatch cPreCondit +hi def link cPreCondit PreCondit +hi def link cCppOutSkip cCppOutIf2 + +hi def link cCppInElse2 cCppOutIf2 +hi def link cCppOutIf2 cCppOut +hi def link cCppOut Comment diff --git a/runtime/syntax/dune.vim b/runtime/syntax/dune.vim index f901813d24d62..b4254057c0755 100644 --- a/runtime/syntax/dune.vim +++ b/runtime/syntax/dune.vim @@ -1,7 +1,8 @@ +" Vim syntax file " Language: Dune buildsystem " Maintainer: Markus Mottl " Anton Kochkov -" URL: https://github.com/rgrinberg/vim-ocaml +" URL: https://github.com/ocaml/vim-ocaml " Last Change: " 2019 Feb 27 - Add newer keywords to the syntax (Simon Cruanes) " 2018 May 8 - Check current_syntax (Kawahara Satoru) @@ -28,7 +29,7 @@ syn keyword lispKey ppx_runtime_libraries virtual_deps js_of_ocaml link_flags syn keyword lispKey javascript_files flags ocamlc_flags ocamlopt_flags pps staged_pps syn keyword lispKey library_flags c_flags c_library_flags kind package action syn keyword lispKey deps targets locks fallback -syn keyword lispKey inline_tests tests names +syn keyword lispKey inline_tests tests test names syn keyword lispAtom true false diff --git a/runtime/syntax/elf.vim b/runtime/syntax/elf.vim index e695dbc79ae7a..c8e5a61bd1c5e 100644 --- a/runtime/syntax/elf.vim +++ b/runtime/syntax/elf.vim @@ -1,6 +1,6 @@ " Vim syntax file " Language: ELF -" Maintainer: Christian V. J. BrīŋŊssow +" Maintainer: Christian V. J. BrÃŧssow " Last Change: Son 22 Jun 2003 20:43:14 CEST " Filenames: *.ab,*.am " URL: http://www.cvjb.de/comp/vim/elf.vim diff --git a/runtime/syntax/elm.vim b/runtime/syntax/elm.vim new file mode 100644 index 0000000000000..1277827f57de1 --- /dev/null +++ b/runtime/syntax/elm.vim @@ -0,0 +1,105 @@ +" Vim syntax file +" Language: Elm +" Maintainer: Andreas Scharf +" Original Author: Joseph Hager +" Copyright: Joseph Hager +" License: BSD3 +" Latest Revision: 2020-05-29 + +if exists('b:current_syntax') + finish +endif + +" Keywords +syn keyword elmConditional else if of then case +syn keyword elmAlias alias +syn keyword elmTypedef contained type port +syn keyword elmImport exposing as import module where + +" Operators +" elm/core +syn match elmOperator contained "\(<|\||>\|||\|&&\|==\|/=\|<=\|>=\|++\|::\|+\|-\|*\|/\|//\|^\|<>\|>>\|<<\|<\|>\|%\)" +" elm/parser +syn match elmOperator contained "\(|.\||=\)" +" elm/url +syn match elmOperator contained "\(\|\)" + +" Types +syn match elmType "\<[A-Z][0-9A-Za-z_-]*" +syn keyword elmNumberType number + +" Modules +syn match elmModule "\<\([A-Z][0-9A-Za-z_'-\.]*\)\+\.[A-Za-z]"me=e-2 +syn match elmModule "^\(module\|import\)\s\+[A-Z][0-9A-Za-z_'-\.]*\(\s\+as\s\+[A-Z][0-9A-Za-z_'-\.]*\)\?\(\s\+exposing\)\?" contains=elmImport + +" Delimiters +syn match elmDelimiter "[,;]" +syn match elmBraces "[()[\]{}]" + +" Functions +syn match elmTupleFunction "\((,\+)\)" + +" Comments +syn keyword elmTodo TODO FIXME XXX contained +syn match elmLineComment "--.*" contains=elmTodo,@spell +syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell fold + +" Strings +syn match elmStringEscape "\\u[0-9a-fA-F]\{4}" contained +syn match elmStringEscape "\\[nrfvbt\\\"]" contained +syn region elmString start="\"" skip="\\\"" end="\"" contains=elmStringEscape,@spell +syn region elmTripleString start="\"\"\"" skip="\\\"" end="\"\"\"" contains=elmStringEscape,@spell +syn match elmChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" + +" Lambda +syn region elmLambdaFunc start="\\"hs=s+1 end="->"he=e-2 + +" Debug +syn match elmDebug "Debug.\(log\|todo\|toString\)" + +" Numbers +syn match elmInt "-\?\<\d\+\>" +syn match elmFloat "-\?\(\<\d\+\.\d\+\>\)" + +" Identifiers +syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\s\)\+" contains=elmOperator +syn match elmFuncName /^\l\w*/ + +" Folding +syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold +syn region elmTopLevelFunction start="^[a-zA-Z].\+\n[a-zA-Z].\+=" end="^\(\n\+\)\@=" contains=ALL fold +syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\n\z1\@!\(\n\n\)\@=" contains=ALL fold +syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold +syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\" end="\" contains=ALL fold + +hi def link elmFuncName Function +hi def link elmCaseBlockDefinition Conditional +hi def link elmCaseBlockItemDefinition Conditional +hi def link elmLetBlockDefinition TypeDef +hi def link elmTopLevelDecl Function +hi def link elmTupleFunction Normal +hi def link elmTodo Todo +hi def link elmComment Comment +hi def link elmLineComment Comment +hi def link elmString String +hi def link elmTripleString String +hi def link elmChar String +hi def link elmStringEscape Special +hi def link elmInt Number +hi def link elmFloat Float +hi def link elmDelimiter Delimiter +hi def link elmBraces Delimiter +hi def link elmTypedef TypeDef +hi def link elmImport Include +hi def link elmConditional Conditional +hi def link elmAlias Delimiter +hi def link elmOperator Operator +hi def link elmType Type +hi def link elmNumberType Identifier +hi def link elmLambdaFunc Function +hi def link elmDebug Debug +hi def link elmModule Type + +syn sync minlines=500 + +let b:current_syntax = 'elm' diff --git a/runtime/syntax/elmfilt.vim b/runtime/syntax/elmfilt.vim index ec97af038df8f..d995853e8e2e4 100644 --- a/runtime/syntax/elmfilt.vim +++ b/runtime/syntax/elmfilt.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Elm Filter rules -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Aug 31, 2016 -" Version: 8 +" Version: 9 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_ELMFILT " quit when a syntax file was already loaded diff --git a/runtime/syntax/erlang.vim b/runtime/syntax/erlang.vim index 870fcca10669d..b8cbf07bb2625 100644 --- a/runtime/syntax/erlang.vim +++ b/runtime/syntax/erlang.vim @@ -2,7 +2,7 @@ " Language: Erlang (http://www.erlang.org) " Maintainer: Csaba Hoch " Contributor: Adam Rutkowski -" Last Update: 2017-Mar-05 +" Last Update: 2020-May-26 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -44,7 +44,7 @@ setlocal iskeyword+=$,@-@ " Comments syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo -syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained +syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|param\|private\|equiv\|spec\|throws\)' contained syn match erlangCommentAnnotation /`[^']*'/ contained syn keyword erlangTodo TODO FIXME XXX contained @@ -79,6 +79,7 @@ syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\ syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*' syn match erlangMacro '??\=[[:alnum:]_@]\+' syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+' +syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier syn match erlangMap '#' syn match erlangRecord '#\s*\l[[:alnum:]_@]*' syn region erlangQuotedRecord start=/#\s*'/ end=/'/ contains=erlangQuotedAtomModifier @@ -91,7 +92,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary " Constants and Directives syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment -syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\)\>' contains=erlangComment +syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\)\>' contains=erlangComment syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment @@ -116,14 +117,14 @@ syn keyword erlangBIF garbage_collect get get_keys group_leader contained syn keyword erlangBIF halt hd integer_to_binary integer_to_list contained syn keyword erlangBIF iolist_to_binary iolist_size is_alive contained syn keyword erlangBIF is_atom is_binary is_bitstring is_boolean contained -syn keyword erlangBIF is_float is_function is_integer is_list contained +syn keyword erlangBIF is_float is_function is_integer is_list is_map is_map_key contained syn keyword erlangBIF is_number is_pid is_port is_process_alive contained syn keyword erlangBIF is_record is_reference is_tuple length link contained syn keyword erlangBIF list_to_atom list_to_binary contained syn keyword erlangBIF list_to_bitstring list_to_existing_atom contained syn keyword erlangBIF list_to_float list_to_integer list_to_pid contained -syn keyword erlangBIF list_to_tuple load_module make_ref max min contained -syn keyword erlangBIF module_loaded monitor monitor_node node contained +syn keyword erlangBIF list_to_tuple load_module make_ref map_size max contained +syn keyword erlangBIF min module_loaded monitor monitor_node node contained syn keyword erlangBIF nodes now open_port pid_to_list port_close contained syn keyword erlangBIF port_command port_connect pre_loaded contained syn keyword erlangBIF process_flag process_flag process_info contained @@ -191,6 +192,7 @@ hi def link erlangGlobalFuncCall Function hi def link erlangGlobalFuncRef Function hi def link erlangVariable Normal hi def link erlangMacro Normal +hi def link erlangQuotedMacro Normal hi def link erlangRecord Normal hi def link erlangQuotedRecord Normal hi def link erlangMap Normal @@ -202,6 +204,7 @@ hi def link erlangGlobalFuncCall Normal hi def link erlangGlobalFuncRef Normal hi def link erlangVariable Identifier hi def link erlangMacro Macro +hi def link erlangQuotedMacro Macro hi def link erlangRecord Structure hi def link erlangQuotedRecord Structure hi def link erlangMap Structure diff --git a/runtime/syntax/eruby.vim b/runtime/syntax/eruby.vim index 6bb24fe5624a2..3d1bf715dbbfa 100644 --- a/runtime/syntax/eruby.vim +++ b/runtime/syntax/eruby.vim @@ -3,9 +3,9 @@ " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns -" Last Change: 2018 Jul 04 +" Last Change: 2022 Mar 18 -if &syntax !~# '\' || get(b:, 'current_syntax') =~# '\' +if exists("b:current_syntax") finish endif @@ -19,8 +19,6 @@ endif if &filetype =~ '^eruby\.' let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') -elseif &filetype =~ '^.*\.eruby\>' - let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>') elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') @@ -54,10 +52,10 @@ if !b:eruby_nest_level let b:eruby_nest_level = 1 endif -if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>' +if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby' exe "runtime! syntax/".b:eruby_subtype.".vim" + unlet! b:current_syntax endif -unlet! b:current_syntax syn include @rubyTop syntax/ruby.vim syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment @@ -72,7 +70,7 @@ exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:erub hi def link erubyDelimiter PreProc hi def link erubyComment Comment -let b:current_syntax = matchstr(&syntax, '^.*\') +let b:current_syntax = 'eruby' if main_syntax == 'eruby' unlet main_syntax diff --git a/runtime/syntax/exports.vim b/runtime/syntax/exports.vim index 55efbb1e5095c..05a3f1acfe3f9 100644 --- a/runtime/syntax/exports.vim +++ b/runtime/syntax/exports.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: exports -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Aug 31, 2016 -" Version: 7 +" Version: 8 " Notes: This file includes both SysV and BSD 'isms " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_EXPORTS diff --git a/runtime/syntax/focexec.vim b/runtime/syntax/focexec.vim index a75aed47cb50d..187fd50dbf7a9 100644 --- a/runtime/syntax/focexec.vim +++ b/runtime/syntax/focexec.vim @@ -8,7 +8,7 @@ " this is a very simple syntax file - I will be improving it " one thing is how to do computes " I don't like that &vars and FUSE() functions highlight to the same color -" I think some of these things should get different hilights - +" I think some of these things should get different highlights - " should MODIFY commands look different than TABLE? " quit when a syntax file was already loaded diff --git a/runtime/syntax/forth.vim b/runtime/syntax/forth.vim index a1912461e60e8..721bceb367dcc 100644 --- a/runtime/syntax/forth.vim +++ b/runtime/syntax/forth.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: FORTH " Current Maintainer: Johan Kotlinski -" Previous Maintainer: Christian V. J. BrīŋŊssow +" Previous Maintainer: Christian V. J. BrÃŧssow " Last Change: 2018-03-29 " Filenames: *.fs,*.ft " URL: https://github.com/jkotlinski/forth.vim @@ -181,7 +181,7 @@ syn keyword forthMath DECIMAL HEX BASE syn match forthInteger '\<-\=[0-9]\+.\=\>' syn match forthInteger '\<&-\=[0-9]\+.\=\>' " recognize hex and binary numbers, the '$' and '%' notation is for gforth -syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess +syn match forthInteger '\<\$\x*\x\+\>' " *1* --- don't mess syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order! syn match forthInteger '\<%[0-1]*[0-1]\+\>' syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe]\d\+\>' diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim index 4c26e78f16824..b5c9b1ef8dbd0 100644 --- a/runtime/syntax/fortran.vim +++ b/runtime/syntax/fortran.vim @@ -1,17 +1,17 @@ " Vim syntax file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77) -" Version: 100 -" Last Change: 2016 Oct. 29 +" Version: (v104) 2021 April 06 " Maintainer: Ajit J. Thakkar ; " Usage: For instructions, do :help fortran-syntax from Vim " Credits: -" Version 0.1 (April 2000) for Fortran 95 was based on the Fortran 77 syntax file by -" Mario Eusebio and Preben Guldberg. Since then, useful suggestions and contributions -" have been made, in chronological order, by: +" Version 0.1 for Fortran 95 was created in April 2000 by Ajit Thakkar from an +" older Fortran 77 syntax file by Mario Eusebio and Preben Guldberg. +" Since then, useful suggestions and contributions have been made, in order, by: " Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile, -" Walter DieudonnīŋŊ, Alexander Wagner, Roman Bertle, Charles Rendleman, +" Walter Dieudonne, Alexander Wagner, Roman Bertle, Charles Rendleman, " Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann, -" Stefano Zaghi, Vishnu V. Krishnan and JudicaīŋŊl Grasset +" Stefano Zaghi, Vishnu V. Krishnan, Judicael Grasset, Takuma Yoshida, +" Eisuke Kawashima, Andre Chalella, and Fritz Reese. if exists("b:current_syntax") finish @@ -53,10 +53,10 @@ if !exists("b:fortran_fixed_source") elseif exists("fortran_fixed_source") " User guarantees fixed source form for all fortran files let b:fortran_fixed_source = 1 - elseif expand("%:e") ==? "f\<90\|95\|03\|08\>" + elseif expand("%:e") =~? '^f\%(90\|95\|03\|08\)$' " Free-form file extension defaults as in Intel ifort, gcc(gfortran), NAG, Pathscale, and Cray compilers let b:fortran_fixed_source = 0 - elseif expand("%:e") ==? "f\|f77\|for" + elseif expand("%:e") =~? '^\%(f\|f77\|for\)$' " Fixed-form file extension defaults let b:fortran_fixed_source = 1 else @@ -92,15 +92,17 @@ else syn match fortranConstructName "^\s*\zs\a\w*\ze\s*:" endif if exists("fortran_more_precise") - syn match fortranConstructName "\(\" syn match fortranType "\" syn match fortranType "\" syn match fortranType "\" +syn match fortranType "\" +syn match fortranType "\" syn keyword fortranType intrinsic syn match fortranType "\" syn keyword fortranStructure dimension @@ -148,11 +150,9 @@ syn keyword fortranExtraIntrinsic algama cdabs cdcos cdexp cdlog cdsin cdsqrt cq syn keyword fortranIntrinsic abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh syn match fortranIntrinsic "\" syn match fortranIntrinsic "\" +syn match fortranType "\" +syn match fortranType "\" "Numbers of various sorts " Integers @@ -167,6 +167,12 @@ syn match fortranFloatIll display "\<\d\+\.\([deq][-+]\=\d\+\)\=\(_\a\w*\)\=\>" syn match fortranFloatIll display "\<\d\+\.\d\+\([dq][-+]\=\d\+\)\=\(_\a\w*\)\=\>" " floating point number syn match fortranFloat display "\<\d\+\.\d\+\(e[-+]\=\d\+\)\=\(_\a\w*\)\=\>" +" binary number +syn match fortranBinary display "b["'][01]\+["']" +" octal number +syn match fortranOctal display "o["'][0-7]\+["']" +" hexadecimal number +syn match fortranHex display "z["'][0-9A-F]\+["']" " Numbers in formats syn match fortranFormatSpec display "\d*f\d\+\.\d\+" syn match fortranFormatSpec display "\d*e[sn]\=\d\+\.\d\+\(e\d+\>\)\=" @@ -185,8 +191,8 @@ syn match fortranLabelNumber display "^ \d\s"ms=s+4,me=e-1 if exists("fortran_more_precise") " Numbers as targets syn match fortranTarget display "\(\" - syn match fortranTarget display "\(\" - syn match fortranTarget display "\(\" + syn match fortranTarget display "\(\" + syn match fortranTarget display "\(\" endif syn keyword fortranTypeR external @@ -214,7 +220,6 @@ syn match fortranUnitHeader "\" syn keyword fortranUnitHeader use only contains syn keyword fortranUnitHeader result operator assignment syn match fortranUnitHeader "\" -syn match fortranUnitHeader "\" syn keyword fortranKeyword allocate deallocate nullify cycle exit syn match fortranConditional "\" syn keyword fortranConditional case default where elsewhere @@ -273,8 +278,9 @@ syn keyword fortranIntrinsic null cpu_time syn match fortranType "\" syn match fortranType "\" syn match fortranType "\" +syn match fortranType "\" if exists("fortran_more_precise") - syn match fortranConstructName "\(\" + syn match fortranConstructName "\(\" endif if b:fortran_dialect == "f08" @@ -354,8 +360,15 @@ syn cluster fortranCommentGroup contains=fortranTodo if (b:fortran_fixed_source == 1) if !exists("fortran_have_tabs") - "Flag items beyond column 72 - syn match fortranSerialNumber excludenl "^.\{73,}$"lc=72 + " Fixed format requires a textwidth of 72 for code, + " but some vendor extensions allow longer lines + if exists("fortran_extended_line_length") + syn match fortranSerialNumber excludenl "^.\{133,}$"lc=132 + elseif exists("fortran_cardimage_line_length") + syn match fortranSerialNumber excludenl "^.\{81,}$"lc=80 + else + syn match fortranSerialNumber excludenl "^.\{73,}$"lc=72 + endif "Flag left margin errors syn match fortranLabelError "^.\{-,4}[^0-9 ]" contains=fortranTab syn match fortranLabelError "^.\{4}\d\S" @@ -375,7 +388,8 @@ syn match cPreProc "^\s*#\s*\(define\|ifdef\)\>.*" syn match cPreProc "^\s*#\s*\(elif\|if\)\>.*" syn match cPreProc "^\s*#\s*\(ifndef\|undef\)\>.*" syn match cPreCondit "^\s*#\s*\(else\|endif\)\>.*" -syn region cIncluded contained start=+"[^(]+ skip=+\\\\\|\\"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber +syn region cIncluded contained start=+"[^("]+ skip=+\\\\\|\\"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber +"syn region cIncluded contained start=+"[^("]+ skip=+\\\\\|\\"+ end=+"+ syn match cIncluded contained "<[^>]*>" syn match cInclude "^\s*#\s*include\>\s*["<]" contains=cIncluded @@ -451,6 +465,9 @@ hi def link fortranTodo Todo hi def link fortranContinueMark Special hi def link fortranString String hi def link fortranNumber Number +hi def link fortranBinary Number +hi def link fortranOctal Number +hi def link fortranHex Number hi def link fortranOperator Operator hi def link fortranBoolean Boolean hi def link fortranLabelError Error diff --git a/runtime/syntax/fpcmake.vim b/runtime/syntax/fpcmake.vim new file mode 100644 index 0000000000000..bbc6f1d77078c --- /dev/null +++ b/runtime/syntax/fpcmake.vim @@ -0,0 +1,58 @@ +" Vim syntax file +" Language: Free Pascal Makefile Definition Files +" Maintainer: Doug Kearns +" Last Change: 2021 Apr 23 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/make.vim + +" NOTE: using start-of-line anchored syn-match groups is simpler than other +" alternatives when interacting with the sourced make.vim syntax groups + +" Sections +syn region fpcmakeSection matchgroup=fpcmakeSectionDelimiter start="^\s*\[" end="]" contains=fpcmakeSectionName + +syn keyword fpcmakeSectionName contained clean compiler default dist install +syn keyword fpcmakeSectionName contained lib package prerules require rules +syn keyword fpcmakeSectionName contained shared target + +" [clean] +syn match fpcmakeRule "^\s*\(units\|files\)\>" +" [compiler] +syn match fpcmakeRule "^\s*\(options\|version\|unitdir\|librarydir\|objectdir\)\>" +syn match fpcmakeRule "^\s*\(targetdir\|sourcedir\|unittargetdir\|includedir\)\>" +" [default] +syn match fpcmakeRule "^\s*\(cpu\|dir\|fpcdir\|rule\|target\)\>" +" [dist] +syn match fpcmakeRule "^\s*\(destdir\|zipname\|ziptarget\)\>" +" [install] +syn match fpcmakeRule "^\s*\(basedir\|datadir\|fpcpackage\|files\|prefix\)\>" +syn match fpcmakeRule "^\s*\(units\)\>" +" [package] +syn match fpcmakeRule "^\s*\(name\|version\|main\)\>" +" [requires] +syn match fpcmakeRule "^\s*\(fpcmake\|packages\|libc\|nortl\|unitdir\)\>" +syn match fpcmakeRule "^\s*\(packagedir\|tools\)\>" +" [shared] +syn match fpcmakeRule "^\s*\(build\|libname\|libversion\|libunits\)\>" +" [target] +syn match fpcmakeRule "^\s*\(dirs\|exampledirs\|examples\|loaders\|programs\)\>" +syn match fpcmakeRule "^\s*\(rsts\|units\)\>" + +" Comments +syn keyword fpcmakeTodo TODO FIXME XXX contained +syn match fpcmakeComment "#.*" contains=fpcmakeTodo,@Spell + +" Default highlighting +hi def link fpcmakeSectionDelimiter Delimiter +hi def link fpcmakeSectionName Type +hi def link fpcmakeComment Comment +hi def link fpcmakeTodo Todo +hi def link fpcmakeRule Identifier + +let b:current_syntax = "fpcmake" + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index e416a9abfca64..318488713b0df 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: fstab file " Maintainer: Radu Dineiu -" URL: https://raw.github.com/rid9/vim-fstab/master/fstab.vim -" Last Change: 2019 Jun 06 -" Version: 1.3 +" URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim +" Last Change: 2020 Dec 30 +" Version: 1.4 " " Credits: " David Necas (Yeti) @@ -68,7 +68,7 @@ syn match fsOptionsString /[a-zA-Z0-9_-]\+/ syn keyword fsOptionsYesNo yes no syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck syn keyword fsOptionsSize 512 1024 2048 -syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail +syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail failok syn match fsOptionsGeneral /_netdev/ " Options: adfs diff --git a/runtime/syntax/gdb.vim b/runtime/syntax/gdb.vim index 25a21d184e786..c820ba40a9974 100644 --- a/runtime/syntax/gdb.vim +++ b/runtime/syntax/gdb.vim @@ -2,7 +2,8 @@ " Language: GDB command files " Maintainer: Claudio Fleiner " URL: http://www.fleiner.com/vim/syntax/gdb.vim -" Last Change: 2012 Oct 05 +" Last Change: 2021 Nov 15 +" Additional changes by Simon Sobisch " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -21,19 +22,19 @@ syn match gdbInfo contained "all-registers" syn keyword gdbStatement contained actions apply attach awatch backtrace break bt call catch cd clear collect commands -syn keyword gdbStatement contained complete condition continue delete detach directory disable disassemble display down +syn keyword gdbStatement contained complete condition continue delete detach directory disable disas[semble] disp[lay] down syn keyword gdbStatement contained echo else enable end file finish frame handle hbreak help if ignore syn keyword gdbStatement contained inspect jump kill list load maintenance make next nexti ni output overlay -syn keyword gdbStatement contained passcount path print printf ptype pwd quit rbreak remote return run rwatch -syn keyword gdbStatement contained search section set sharedlibrary shell show si signal source step stepi stepping +syn keyword gdbStatement contained passcount path print printf ptype python pwd quit rbreak remote return run rwatch +syn keyword gdbStatement contained search section set sharedlibrary shell show si signal skip source step stepi stepping syn keyword gdbStatement contained stop target tbreak tdump tfind thbreak thread tp trace tstart tstatus tstop -syn keyword gdbStatement contained tty undisplay unset until up watch whatis where while ws x +syn keyword gdbStatement contained tty und[isplay] unset until up watch whatis where while ws x syn match gdbFuncDef "\.*" syn match gdbStatmentContainer "^\s*\S\+" contains=gdbStatement,gdbFuncDef syn match gdbStatement "^\s*info" nextgroup=gdbInfo skipwhite skipempty " some commonly used abbreviations -syn keyword gdbStatement c disp undisp disas p +syn keyword gdbStatement c cont p py syn region gdbDocument matchgroup=gdbFuncDef start="\.*$" matchgroup=gdbFuncDef end="^end\s*$" diff --git a/runtime/syntax/gemtext.vim b/runtime/syntax/gemtext.vim new file mode 100644 index 0000000000000..8c2bd299282c3 --- /dev/null +++ b/runtime/syntax/gemtext.vim @@ -0,0 +1,24 @@ +" Vim syntax file +" Language: Gemtext markup language +" Maintainer: Suneel Freimuth +" Latest Revision: 2020-11-21 +" Filenames: *.gmi + +if exists('b:current_syntax') + finish +endif + +syntax match Heading /^#\{1,3}.\+$/ +syntax match List /^\* / +syntax match LinkURL /^=>\s*\S\+/ +syntax match Quote /^>.\+/ +syntax region Preformatted start=/^```/ end=/```/ + +highlight default link Heading Special +highlight default link List Statement +highlight default link LinkURL Underlined +highlight default link Quote Constant +highlight default link Preformatted Identifier + +let b:current_syntax = 'gemtext' + diff --git a/runtime/syntax/gift.vim b/runtime/syntax/gift.vim new file mode 100644 index 0000000000000..3f8d631ec0544 --- /dev/null +++ b/runtime/syntax/gift.vim @@ -0,0 +1,216 @@ +" Vim syntax file +" +" Language: Moodle GIFT (General Import Format Template) +" Maintainer: Selim Temizer (http://selimtemizer.com) +" Creation: November 28, 2020 +" Latest Revision: December 21, 2020 +" Note: The order of entities in this file is important! + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + + +setlocal conceallevel=1 + +"----------------------------------------------- +" GIFT entities + +syn match giftS "\~" contained "GIFT special characters +syn match giftS "=" contained +syn match giftS "#" contained +syn match giftS "{" contained +syn match giftS "}" contained +syn match giftS ":" contained + +syn match giftES "\\\~" contained conceal cchar=~ "GIFT escaped special characters +syn match giftES "\\=" contained conceal cchar== +syn match giftES "\\#" contained conceal cchar=# +syn match giftES "\\{" contained conceal cchar={ +syn match giftES "\\}" contained conceal cchar=} +syn match giftES "\\:" contained conceal cchar=: + +syn match giftEN "\\n" contained conceal cchar=n "GIFT escaped newline + +syn match giftFormat "\[html]" contained "GIFT formats +syn match giftFormat "\[plain]" contained +syn match giftFormat "\[moodle]" contained +syn match giftFormat "\[markdown]" contained + +"-------------------------------------------------------- +" HTML entities + +syn match giftH "<" contained "HTML characters that might need to be handled/escaped +syn match giftH ">" contained +syn match giftH "&" contained + +syn match giftEH "<" contained conceal cchar=< "HTML escaped characters +syn match giftEH ">" contained conceal cchar=> +syn match giftEH "&" contained conceal cchar=& +syn match giftEH " " contained conceal cchar=_ + +"------------------------------------------------------- +" Answer components: Feedback and general feedback + +syn match giftFB "#\_.\{-}\(\_^\|[^\\]\)\ze\(=\|\~\|#\|####\|}\)" contained contains=giftF "Feedback block +syn match giftF "#\zs\_.\{-}\(\_^\|[^\\]\)\ze\(=\|\~\|#\|####\|}\)" contained contains=@giftCEF "Feedback + +syn match giftGFB "####\_.\{-}\(\_^\|[^\\]\)\ze}" contained contains=giftGF "General feedback block +syn match giftGF "####\zs\_.\{-}\(\_^\|[^\\]\)\ze}" contained contains=@giftCEF "General feedback + +"------------------------------------------------------ +" Answer components: Other components + +syn keyword giftTF T TRUE F FALSE contained + +syn match giftNum1 "[-+]\=[.0-9]\+" contained "Something matching a number + +syn match giftNum2 "[-+]\=[.0-9]\+\s*:\s*[-+]\=[.0-9]\+" contained contains=giftNum2D "Number with error margin +syn match giftNum2D ":" contained "Associated delimiter + +syn match giftNum3 "[-+]\=[.0-9]\+\s*\.\.\s*[-+]\=[.0-9]\+" contained contains=giftNum3D "Number as min/max range +syn match giftNum3D "\.\." contained "Associated delimiter + +syn match giftWeightB "%-*[0-9]\{1,2}\.\?[0-9]*%" contained contains=giftWeight "Weight block +syn match giftWeight "%\zs-*[0-9]\{1,2}\.\?[0-9]*\ze%" contained "Weight + +"----------------------------------------------------- +" Answer choices + +syn match giftWrongNum "\~\zs\_.\{-}\(\_^\|[^\\]\)\ze\(####\|}\)" contained contains=@giftCEFF "Wrong numeric choice +syn match giftRightNum "=\zs\_.\{-}\(\_^\|[^\\]\)\ze\(=\|\~\|####\|}\)" contained contains=@giftCEFFW,@giftNums "Right numeric choice + +syn match giftWrong "\~\zs\_.\{-}\(\_^\|[^\\]\)\ze\(=\|\~\|####\|}\)" contained contains=@giftCEFFW "Wrong choice +syn match giftRight "=\zs\_.\{-}\(\ze->\|\(\_^\|[^\\]\)\ze\(=\|\~\|####\|}\)\)" contained contains=@giftCEFFW "Right choice +syn match giftMatchB "->\_.\{-}\(\_^\|[^\\]\)\ze\(=\|\~\|####\|}\)" contained contains=giftMatch "Match choice block +syn match giftMatch "->\zs\_.\{-}\(\_^\|[^\\]\)\ze\(=\|\~\|####\|}\)" contained contains=@giftCE "Match choice + +"---------------------------------------------------- +" Answer + +syn match giftAnswer "{\_.\{-}\(\_^\|[^\\]\)}" contained keepend contains=@giftA "General answer +syn match giftAnswer "{}" contained "Minimal answer + +syn match giftAnswerNum "{\_[[:space:]]*#\_[^#]\_.\{-}\(\_^\|[^\\]\)}" contained keepend contains=@giftANum "Numeric answer +syn match giftAnswerNumD "{\zs\_[[:space:]]*#" contained "Associated delimiter + +"--------------------------------------------------- +" Question + +" The first pattern matches the last question at the end of the file (in case there is no empty line coming after). +" However, it slows down parsing (and especially scrolling up), therefore it is commented out. + +"syn match giftQuestion "[^{[:space:]]\_.\{-}\%$" keepend contains=@giftCEF,giftAnswer,giftAnswerNum + syn match giftQuestion "[^{[:space:]]\_.\{-}\n\(\s*\n\)\+" keepend contains=@giftCEF,giftAnswer,giftAnswerNum + +"-------------------------------------------------- +" Question name + +syn match giftName "::\_.\{-}::" contains=@giftCE,giftNameD "Question name +syn match giftNameD "::" contained "Associated delimiter + +"------------------------------------------------- +" Category + +syn match giftCategoryB "^\s*\$CATEGORY:.*\n\+" contains=giftCategory "Category block +syn match giftCategory "^\s*\$CATEGORY:\zs.*\ze\n" contained "Category + +"------------------------------------------------ +" Comments (may need to be the last entity) + +syn keyword giftTodo FIXME TODO NOTE FIX XXX contained + +syn match giftIdB "\[id:\(\\]\|[^][:cntrl:]]\)\+]" contained contains=giftId "Id block +syn match giftId "\[id:\zs\(\\]\|[^][:cntrl:]]\)\+\ze]" contained "Id + +syn match giftTagB "\[tag:\(\\]\|[^]<>`[:cntrl:]]\)\+]" contained contains=giftTag "Tag block +syn match giftTag "\[tag:\zs\(\\]\|[^]<>`[:cntrl:]]\)\+\ze]" contained "Tag + +syn match giftComment "^\s*//.*" contains=giftTodo,giftIdB,giftTagB + +"----------------------------------------------- +" Clusters + +"Comments and entities (to be escaped) +syn cluster giftCE contains=giftComment,giftS,giftES,giftEN,giftH,giftEH + +"The above plus format +syn cluster giftCEF contains=@giftCE,giftFormat + +"The above plus feedback block +syn cluster giftCEFF contains=@giftCEF,giftFB + +"The above plus weight block +syn cluster giftCEFFW contains=@giftCEFF,giftWeightB + +"Possible numerical representations +syn cluster giftNums contains=giftNum1,giftNum2,giftNum3 + +"Possible contents of answers +syn cluster giftA contains=giftComment,giftTF,giftWrong,giftRight,giftMatchB,giftFB,giftGFB + +"Possible contents of numerical answers +syn cluster giftANum contains=giftAnswerNumD,giftComment,@giftNums,giftWrongNum,giftRightNum,giftFB,giftGFB + +"----------------------------------------------- + +let b:current_syntax = "gift" + +"----------------------------------------------- + +hi Conceal ctermbg=NONE ctermfg=Blue guibg=NONE guifg=Blue +hi Feedback ctermbg=NONE ctermfg=DarkCyan guibg=NONE guifg=DarkCyan +hi GFeedback ctermbg=NONE ctermfg=DarkGreen guibg=NONE guifg=DarkGreen +hi WeightB ctermbg=NONE ctermfg=DarkYellow guibg=NONE guifg=DarkYellow + +"----------------------------------------------- + +hi def link giftS Error +hi def link giftES Conceal +hi def link giftEN Conceal +hi def link giftFormat LineNr + +hi def link giftH Error +hi def link giftEH Conceal + +hi def link giftFB PreProc +hi def link giftF Feedback +hi def link giftGFB Title +hi def link giftGF GFeedback + +hi def link giftTF Question +hi def link giftNum1 Question +hi def link giftNum2 Question +hi def link giftNum2D Special +hi def link giftNum3 Question +hi def link giftNum3D Special +hi def link giftWeightB WeightB +hi def link giftWeight Identifier + +hi def link giftWrongNum Constant +hi def link giftRightNum Question +hi def link giftWrong Constant +hi def link giftRight Question +hi def link giftMatchB ModeMsg +hi def link giftMatch Constant + +hi def link giftAnswer MoreMsg +hi def link giftAnswerNum MoreMsg +hi def link giftAnswerNumD Identifier + +hi def link giftQuestion Identifier + +hi def link giftName PreProc +hi def link giftNameD Directory + +hi def link giftCategoryB LineNr +hi def link giftCategory Directory + +hi def link giftTodo Todo +hi def link giftIdB LineNr +hi def link giftId Title +hi def link giftTagB LineNr +hi def link giftTag Constant +hi def link giftComment Comment diff --git a/runtime/syntax/git.vim b/runtime/syntax/git.vim index 48264c7bf2687..bf013ce195da7 100644 --- a/runtime/syntax/git.vim +++ b/runtime/syntax/git.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: generic git output " Maintainer: Tim Pope -" Last Change: 2010 May 21 +" Last Change: 2022 Jan 05 if exists("b:current_syntax") finish @@ -12,12 +12,28 @@ syn sync minlines=50 syn include @gitDiff syntax/diff.vim -syn region gitHead start=/\%^/ end=/^$/ -syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/ - -" For git reflog and git show ...^{tree}, avoid sync issues -syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/ -syn match gitHead /^\x\{40\} \x\{40}\t.*/ +syn region gitHead start=/\%^\%(tag \|tree \|object \)\@=/ end=/^$/ contains=@NoSpell +syn region gitHead start=/\%(^commit\%( \x\{4,\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/ contains=@NoSpell +" git log --oneline +" minimize false positives by verifying contents of buffer +if getline(1) =~# '^\x\{7,\} ' && getline('$') =~# '^\x\{7,\} ' + syn match gitHashAbbrev /^\x\{7,\} \@=/ contains=@NoSpell +elseif getline(1) =~# '^[|\/\\_ ]\{-\}\*[|\/\\_ ]\{-\} \x\{7,\} ' + syn match gitHashAbbrev /^[|\/\\_ ]\{-\}\*[|\/\\_ ]\{-\} \zs\x\{7,\} \@=/ contains=@NoSpell +endif +" git log --graph +syn region gitGraph start=/\%(^[|\/\\_ ]*\*[|\/\\_ ]\{-\} commit\%( \x\{4,\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^\%([|\/\\_ ]*$\)\@=/ contains=@NoSpell +" git blame --porcelain +syn region gitHead start=/\%(^\x\{40,\} \d\+ \d\+\%( \d\+\)\=$\)\@=/ end=/^\t\@=/ contains=@NoSpell +" git ls-tree +syn match gitMode /^\d\{6\}\%( \%(blob\|tree\) \x\{4,\}\t\)\@=/ nextgroup=gitType skipwhite contains=@NoSpell +" git ls-files --stage +syn match gitMode /^\d\{6\}\%( \x\{4,\} [0-3]\t\)\@=/ nextgroup=gitHashStage skipwhite contains=@NoSpell +" .git/HEAD, .git/refs/ +syn match gitKeyword /\%^ref: \@=/ nextgroup=gitReference skipwhite contains=@NoSpell +syn match gitHash /\%^\x\{40,}\%$/ skipwhite contains=@NoSpell +" .git/logs/ +syn match gitReflog /^\x\{40,\} \x\{40,\} .\{-\}\d\+\s-\d\{4\}\t.*/ skipwhite contains=@NoSpell,gitReflogOld syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff @@ -25,33 +41,47 @@ syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge +syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge +syn match gitDiffRemoved "\[-[^]]*-\]" contained containedin=gitDiff + +syn match gitKeyword /^commit \@=/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitKeyword /^\%(object\|tree\|parent\|encoding\|gpgsig\%(-\w\+\)\=\|previous\) \@=/ contained containedin=gitHead nextgroup=gitHash skipwhite contains=@NoSpell +syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitIdentityKeyword /^\%(author\|committer\|tagger\) \@=/ contained containedin=gitHead nextgroup=gitIdentity skipwhite contains=@NoSpell +syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite contains=@NoSpell +syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite contains=@NoSpell -syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite -syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite -syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite -syn match gitMode /^\d\{6\}/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite -syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite -syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite -syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite +syn match gitKeyword /^[*|\/\\_ ]\+\zscommit \@=/ contained containedin=gitGraph nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitKeyword /^[|\/\\_ ]\+\zs\%(object\|tree\|parent\|encoding\|gpgsig\%(-\w\+\)\=\|previous\) \@=/ contained containedin=gitGraph nextgroup=gitHash skipwhite contains=@NoSpell +syn match gitKeyword /^[|\/\\_ ]\+\zsMerge:/ contained containedin=gitGraph nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitIdentityKeyword /^[|\/\\_ ]\+\zs\%(author\|committer\|tagger\) \@=/ contained containedin=gitGraph nextgroup=gitIdentity skipwhite contains=@NoSpell +syn match gitIdentityHeader /^[|\/\\_ ]\+\zs\%(Author\|Commit\|Tagger\):/ contained containedin=gitGraph nextgroup=gitIdentity skipwhite contains=@NoSpell +syn match gitDateHeader /^[|\/\\_ ]\+\zs\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitGraph nextgroup=gitDate skipwhite contains=@NoSpell -syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite -syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite -syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity +syn match gitKeyword /^type \@=/ contained containedin=gitHead nextgroup=gitType skipwhite contains=@NoSpell +syn match gitKeyword /^\%(summary\|boundary\|filename\|\%(author\|committer\)-\%(time\|tz\)\) \@=/ contained containedin=gitHead skipwhite contains=@NoSpell +syn match gitKeyword /^tag \@=/ contained containedin=gitHead nextgroup=gitReference skipwhite contains=@NoSpell +syn match gitIdentityKeyword /^\%(author\|committer\)-mail \@=/ contained containedin=gitHead nextgroup=gitEmail skipwhite contains=@NoSpell +syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite contains=@NoSpell +syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite contains=@NoSpell +syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity contains=@NoSpell -syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained -syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained -syn match gitDate /\<\d\+ \l\+ ago\>/ contained -syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHash skipwhite -syn match gitStage /\<\d\t\@=/ contained -syn match gitReference /\S\+\S\@!/ contained -syn match gitHash /\<\x\{40\}\>/ contained nextgroup=gitIdentity,gitStage,gitHash skipwhite -syn match gitHash /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite -syn match gitHashAbbrev /\<\x\{4,40\}\>/ contained nextgroup=gitHashAbbrev skipwhite -syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite +syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite contains=@NoSpell +syn region gitEmail matchgroup=gitEmailDelimiter start=// keepend oneline contained containedin=gitIdentity contains=@NoSpell +syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained contains=@NoSpell +syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained contains=@NoSpell +syn match gitDate /\<\d\+ \l\+ ago\>/ contained contains=@NoSpell +syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitReference /\S\+\S\@!/ contained contains=@NoSpell +syn match gitHash /\<\x\{40,\}\>/ contained nextgroup=gitIdentity,gitHash skipwhite contains=@NoSpell +syn match gitReflogOld /^\x\{40,\} \@=/ contained nextgroup=gitReflogNew skipwhite contains=@NoSpell +syn match gitReflogNew /\<\x\{40,\} \@=/ contained nextgroup=gitIdentity skipwhite contains=@NoSpell +syn match gitHashAbbrev /\<\x\{4,\}\>/ contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell +syn match gitHashStage /\<\x\{4,\}\>/ contained nextgroup=gitStage skipwhite contains=@NoSpell +syn match gitStage /\<\d\t\@=/ contained contains=@NoSpell -syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite -syn region gitEmail matchgroup=gitEmailDelimiter start=// keepend oneline contained containedin=gitIdentity syn match gitNotesHeader /^Notes:\ze\n / @@ -66,7 +96,10 @@ hi def link gitEmailDelimiter Delimiter hi def link gitEmail Special hi def link gitDate Number hi def link gitMode Number +hi def link gitHashStage gitHash hi def link gitHashAbbrev gitHash +hi def link gitReflogOld gitHash +hi def link gitReflogNew gitHash hi def link gitHash Identifier hi def link gitReflogMiddle gitReference hi def link gitReference Function diff --git a/runtime/syntax/gitcommit.vim b/runtime/syntax/gitcommit.vim index 5e0642fbcc741..42c8d4414f0f0 100644 --- a/runtime/syntax/gitcommit.vim +++ b/runtime/syntax/gitcommit.vim @@ -2,64 +2,87 @@ " Language: git commit file " Maintainer: Tim Pope " Filenames: *.git/COMMIT_EDITMSG -" Last Change: 2016 Aug 29 +" Last Change: 2022 Jan 05 if exists("b:current_syntax") finish endif +scriptencoding utf-8 + syn case match syn sync minlines=50 +syn sync linebreaks=1 if has("spell") syn spell toplevel endif syn include @gitcommitDiff syntax/diff.vim -syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff +syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@gitcommitDiff -syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl -syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell +syn match gitcommitSummary "^.*\%<51v." contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell syn match gitcommitOverflow ".*" contained contains=@Spell -syn match gitcommitBlank "^[^#].*" contained contains=@Spell -syn match gitcommitComment "^#.*" -syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent -syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite -syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite +syn match gitcommitBlank "^.\+" contained contains=@Spell +syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank,gitcommitComment skipnl + +let s:scissors = 0 +let s:l = search('^[#;@!$%^&|:] -\{24,\} >8 -\{24,\}$', 'cnW', '', 100) +if s:l == 0 + let s:l = line('$') +elseif getline(s:l)[0] !=# getline(s:l - 1)[0] + let s:scissors = 1 +endif +let s:comment = escape((matchstr(getline(s:l), '^[#;@!$%^&|:]\S\@!') . '#')[0], '^$.*[]~\"/') + +if s:scissors + let s:comment .= ' -\{24,\} >8 -\{24,\}$' + exe 'syn region gitcommitComment start="^' . s:comment . '" end="\%$" contains=gitcommitDiff' +else + exe 'syn match gitcommitComment "^' . s:comment . '.*"' +endif +exe 'syn match gitcommitTrailers "\n\@<=\n\%([[:alnum:]-]\+\s*:.*\|(cherry picked from commit .*\)\%(\n\s.*\|\n[[:alnum:]-]\+\s*:.*\|\n(cherry picked from commit .*\)*\%(\n\n*\%(' . s:comment . '\)\|\n*\%$\)\@="' + +unlet s:l s:comment s:scissors + +syn match gitcommitTrailerToken "^[[:alnum:]-]\+\s*:" contained containedin=gitcommitTrailers + +syn match gitcommitHash "\<\x\{40,}\>" contains=@NoSpell display +syn match gitcommitOnBranch "\%(^. \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite +syn match gitcommitOnBranch "\%(^. \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite syn match gitcommitBranch "[^ ']\+" contained -syn match gitcommitNoBranch "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment -syn match gitcommitHeader "\%(^# \)\@<=.*:$" contained containedin=gitcommitComment -syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^# \)\@<=\%(Author\|Committer\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent -syn match gitcommitNoChanges "\%(^# \)\@<=No changes$" contained containedin=gitcommitComment +syn match gitcommitNoBranch "\%(^. \)\@<=Not currently on any branch." contained containedin=gitcommitComment +syn match gitcommitHeader "\%(^. \)\@<=\S.*[:īŧš]\%(\n^$\)\@!$" contained containedin=gitcommitComment +syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^. \)\@<=\%(Author\|Committer\|Date\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent +syn match gitcommitHeader "\%(^. \)\@<=commit\%( \x\{40,\}$\)\@=" contained containedin=gitcommitComment nextgroup=gitcommitHash skipwhite +syn match gitcommitNoChanges "\%(^. \)\@<=No changes$" contained containedin=gitcommitComment -syn region gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold -syn match gitcommitUntrackedFile "\t\@<=.*" contained +syn match gitcommitType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/:īŧš]*[^[:punct:][:space:]][:īŧš]\ze "he=e-1 contained containedin=gitcommitComment nextgroup=gitcommitFile skipwhite +syn match gitcommitFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitArrow +syn match gitcommitArrow " -> " contained nextgroup=gitcommitFile +syn match gitcommitUntrackedFile "\%(^.\t\)\@<=[^:īŧš/]*\%(/.*\)\=$" contained containedin=gitcommitComment -syn region gitcommitDiscarded start=/^# Change\%(s not staged for commit\|d but not updated\):/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold -syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold -syn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold +syn region gitcommitUntracked start=/^\z(.\) Untracked files:$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader containedin=gitcommitComment containedin=gitcommitComment contained transparent fold +syn region gitcommitDiscarded start=/^\z(.\) Change\%(s not staged for commit\|d but not updated\):$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader,gitcommitDiscardedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold +syn region gitcommitSelected start=/^\z(.\) Changes to be committed:$/ end=/^\z1$\|^\z1\@!/ contains=gitcommitHeader,gitcommitSelectedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold +syn region gitcommitUnmerged start=/^\z(.\) Unmerged paths:$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader,gitcommitUnmergedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold +syn match gitcommitUntrackedFile "\%(^.\t\)\@<=.*" contained containedin=gitcommitUntracked -syn match gitcommitDiscardedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite -syn match gitcommitSelectedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite -syn match gitcommitUnmergedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite -syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow -syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow -syn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow +syn match gitcommitDiscardedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/:īŧš]*[^[:punct:][:space:]][:īŧš]\ze "he=e-1 contained nextgroup=gitcommitDiscardedFile skipwhite +syn match gitcommitSelectedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/:īŧš]*[^[:punct:][:space:]][:īŧš]\ze "he=e-1 contained nextgroup=gitcommitSelectedFile skipwhite +syn match gitcommitUnmergedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/:īŧš]*[^[:punct:][:space:]][:īŧš]\ze "he=e-1 contained nextgroup=gitcommitUnmergedFile skipwhite +syn match gitcommitDiscardedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow +syn match gitcommitSelectedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow +syn match gitcommitUnmergedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitUnmergedArrow syn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile syn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile -syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitSelectedFile - -syn match gitcommitWarning "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl -syn match gitcommitWarning "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained -syn match gitcommitWarning "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$" +syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitUnmergedFile hi def link gitcommitSummary Keyword +hi def link gitcommitTrailerToken Label hi def link gitcommitComment Comment -hi def link gitcommitUntracked gitcommitComment -hi def link gitcommitDiscarded gitcommitComment -hi def link gitcommitSelected gitcommitComment -hi def link gitcommitUnmerged gitcommitComment +hi def link gitcommitHash Identifier hi def link gitcommitOnBranch Comment hi def link gitcommitBranch Special hi def link gitcommitNoBranch gitCommitBranch diff --git a/runtime/syntax/gitconfig.vim b/runtime/syntax/gitconfig.vim index 668764eac1fc5..e5eaf10f94c6f 100644 --- a/runtime/syntax/gitconfig.vim +++ b/runtime/syntax/gitconfig.vim @@ -2,24 +2,22 @@ " Language: git config file " Maintainer: Tim Pope " Filenames: gitconfig, .gitconfig, *.git/config -" Last Change: 2019 Sep 27 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish endif -setlocal iskeyword+=- -setlocal iskeyword-=_ syn case ignore syn sync minlines=10 syn match gitconfigComment "[#;].*" contains=@Spell syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]" syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]' -syn match gitconfigVariable "\%(^\s*\)\@<=\a\k*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite +syn match gitconfigVariable "\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite syn region gitconfigAssignment matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend syn keyword gitconfigBoolean true false yes no contained -syn match gitconfigNumber "\d\+" contained +syn match gitconfigNumber "\<\d\+\>" contained syn region gitconfigString matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError syn match gitconfigError +\\.+ contained syn match gitconfigEscape +\\[\\"ntb]+ contained @@ -32,7 +30,7 @@ hi def link gitconfigBoolean Boolean hi def link gitconfigNumber Number hi def link gitconfigString String hi def link gitconfigDelim Delimiter -hi def link gitconfigEscape Delimiter +hi def link gitconfigEscape Special hi def link gitconfigError Error let b:current_syntax = "gitconfig" diff --git a/runtime/syntax/gitrebase.vim b/runtime/syntax/gitrebase.vim index a944c14dd7eae..13f157b005548 100644 --- a/runtime/syntax/gitrebase.vim +++ b/runtime/syntax/gitrebase.vim @@ -2,7 +2,7 @@ " Language: git rebase --interactive " Maintainer: Tim Pope " Filenames: git-rebase-todo -" Last Change: 2016 Aug 29 +" Last Change: 2022 Jan 05 if exists("b:current_syntax") finish @@ -10,31 +10,53 @@ endif syn case match -syn match gitrebaseHash "\v<\x{7,40}>" contained -syn match gitrebaseCommit "\v<\x{7,40}>" nextgroup=gitrebaseSummary skipwhite +let s:c = escape((matchstr(getline('$'), '^[#;@!$%^&|:]\S\@!') . '#')[0], '^$.*[]~\"/') + +syn match gitrebaseHash "\v<\x{7,}>" contained contains=@NoSpell +syn match gitrebaseCommit "\v<\x{7,}>" nextgroup=gitrebaseSummary skipwhite contains=@NoSpell syn match gitrebasePick "\v^p%(ick)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite +syn match gitrebaseBreak "\v^b%(reak)=>" syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseNoop "\v^noop>" +syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,gitrebaseName skipwhite +syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite +syn match gitrebaseReset "\v^(t|reset)=>" nextgroup=gitrebaseName skipwhite syn match gitrebaseSummary ".*" contains=gitrebaseHash contained syn match gitrebaseCommand ".*" contained -syn match gitrebaseComment "^#.*" contains=gitrebaseHash +exe 'syn match gitrebaseComment " \@<=' . s:c . ' empty$" containedin=gitrebaseSummary contained' +exe 'syn match gitrebaseComment "^\s*' . s:c . '.*" contains=gitrebaseHash' syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseMergeOption "\v-[Cc]>" nextgroup=gitrebaseMergeCommit skipwhite contained +syn match gitrebaseMergeCommit "\v<\x{7,}>" nextgroup=gitrebaseName skipwhite contained +syn match gitrebaseName "\v[^[:space:].*?i:^~/-]\S+" nextgroup=gitrebaseMergeComment skipwhite contained +exe 'syn match gitrebaseMergeComment "' . s:c . '" nextgroup=gitrebaseSummary skipwhite contained' + +unlet s:c hi def link gitrebaseCommit gitrebaseHash hi def link gitrebaseHash Identifier -hi def link gitrebasePick Statement -hi def link gitrebaseReword Number +hi def link gitrebasePick Type +hi def link gitrebaseReword Conditional hi def link gitrebaseEdit PreProc -hi def link gitrebaseSquash Type -hi def link gitrebaseFixup Special -hi def link gitrebaseExec Function +hi def link gitrebaseSquash Statement +hi def link gitrebaseFixup Repeat +hi def link gitrebaseExec Operator +hi def link gitrebaseBreak Macro hi def link gitrebaseDrop Comment +hi def link gitrebaseNoop Comment +hi def link gitrebaseMerge Exception +hi def link gitrebaseLabel Label +hi def link gitrebaseReset Keyword hi def link gitrebaseSummary String hi def link gitrebaseComment Comment hi def link gitrebaseSquashError Error +hi def link gitrebaseMergeCommit gitrebaseCommit +hi def link gitrebaseMergeComment gitrebaseComment +hi def link gitrebaseName Tag let b:current_syntax = "gitrebase" diff --git a/runtime/syntax/gnuplot.vim b/runtime/syntax/gnuplot.vim index 7777cc9e4629d..b5092d7555325 100644 --- a/runtime/syntax/gnuplot.vim +++ b/runtime/syntax/gnuplot.vim @@ -3,7 +3,8 @@ " Maintainer: Josh Wainwright " Last Maintainer: Andrew Rasmussen andyras@users.sourceforge.net " Original Maintainer: John Hoelzel johnh51@users.sourceforge.net -" Last Change: 2015-08-25 +" Last Change: 2021 Nov 16 +" additional changes from PR #8949 " Filenames: *.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot " URL: http://www.vim.org/scripts/script.php?script_id=4873 " Original URL: http://johnh51.get.to/vim/syntax/gnuplot.vim @@ -32,22 +33,22 @@ syn match gnuplotSpecial "\\." contained " syn match gnuplotSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[a-z\\]" contained " measurements in the units in, cm and pt are special -syn match gnuplotUnit "[0-9]+in" -syn match gnuplotUnit "[0-9]+cm" -syn match gnuplotUnit "[0-9]+pt" +syn match gnuplotUnit "\d+in" +syn match gnuplotUnit "\d+cm" +syn match gnuplotUnit "\d+pt" " external (shell) commands are special -syn region gnuplotExternal start="!" end="$" +syn region gnuplotExternal start="^\s*!" end="$" " ---- Comments ---- " -syn region gnuplotComment start="#" end="$" contains=gnuplotTodo +syn region gnuplotComment start="#" end="$" contains=gnuplotTodo,@Spell " ---- Constants ---- " " strings -syn region gnuplotString start=+"+ skip=+\\"+ end=+"+ contains=gnuplotSpecial -syn region gnuplotString start="'" end="'" +syn region gnuplotString start=+"+ skip=+\\"+ end=+"+ contains=gnuplotSpecial,@Spell +syn region gnuplotString start="'" end="'" contains=@Spell " built-in variables syn keyword gnuplotNumber GNUTERM GPVAL_TERM GPVAL_TERMOPTIONS GPVAL_SPLOT @@ -76,7 +77,7 @@ syn keyword gnuplotNumber GPVAL_TERM_YSIZE GPVAL_VIEW_MAP GPVAL_VIEW_ROT_X syn keyword gnuplotNumber GPVAL_VIEW_ROT_Z GPVAL_VIEW_SCALE " function name variables -syn match gnuplotNumber "GPFUN_[a-zA-Z_]*" +syn match gnuplotNumber "GPFUN_\h*" " stats variables syn keyword gnuplotNumber STATS_records STATS_outofrange STATS_invalid @@ -104,23 +105,23 @@ syn keyword gnuplotError FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT " integer number, or floating point number without a dot and with "f". syn case ignore -syn match gnuplotNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>" +syn match gnuplotNumber "\<\d\+\(u\=l\=\|lu\|f\)\>" " floating point number, with dot, optional exponent -syn match gnuplotFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>" +syn match gnuplotFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>" " floating point number, starting with a dot, optional exponent -syn match gnuplotFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>" +syn match gnuplotFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" " floating point number, without dot, with exponent -syn match gnuplotFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>" +syn match gnuplotFloat "\<\d\+e[-+]\=\d\+[fl]\=\>" " hex number -syn match gnuplotNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>" +syn match gnuplotNumber "\<0x\x\+\(u\=l\=\|lu\)\>" syn case match " flag an octal number with wrong digits by not highlighting -syn match gnuplotOctalError "\<0[0-7]*[89]" +syn match gnuplotOctalError "\<0\o*[89]" " ---- Identifiers: Functions ---- " @@ -374,8 +375,8 @@ syn keyword gnuplotKeyword nohead nooutliers nowedge off opaque outliers syn keyword gnuplotKeyword palette pattern pi pointinterval pointsize syn keyword gnuplotKeyword pointtype ps pt radius range rectangle syn keyword gnuplotKeyword rowstacked screen separation size solid sorted -syn keyword gnuplotKeyword textbox transparent units unsorted userstyles -syn keyword gnuplotKeyword wedge x x2 xx xy yy +syn keyword gnuplotKeyword textbox units unsorted userstyles wedge +syn keyword gnuplotKeyword x x2 xx xy yy " set surface syn keyword gnuplotKeyword surface implicit explicit " set table @@ -477,9 +478,13 @@ syn keyword gnuplotKeyword nooutput " keywords for 'test' command syn keyword gnuplotKeyword terminal palette rgb rbg grb gbr brg bgr +" The transparent gnuplot keyword cannot use 'syn keyword' as transparent +" has a special meaning in :syntax commands. +syn match gnuplotKeyword "\" + " ---- Macros ---- " -syn region gnuplotMacro start="@" end=" " +syn match gnuplotMacro "@\w*" " ---- Todos ---- " diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim index e78f8cf27c48f..0c326254b8174 100644 --- a/runtime/syntax/go.vim +++ b/runtime/syntax/go.vim @@ -1,58 +1,109 @@ -" Vim syntax file -" Language: Go -" Maintainer: David Barnett (https://github.com/google/vim-ft-go) -" Last Change: 2014 Aug 16 - -" Options: -" There are some options for customizing the highlighting; the recommended -" settings are the default values, but you can write: -" let OPTION_NAME = 0 -" in your ~/.vimrc file to disable particular options. You can also write: -" let OPTION_NAME = 1 -" to enable particular options. At present, all options default to on. +" Copyright 2009 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. " -" - g:go_highlight_array_whitespace_error -" Highlights white space after "[]". -" - g:go_highlight_chan_whitespace_error -" Highlights white space around the communications operator that don't -" follow the standard style. -" - g:go_highlight_extra_types -" Highlights commonly used library types (io.Reader, etc.). -" - g:go_highlight_space_tab_error -" Highlights instances of tabs following spaces. -" - g:go_highlight_trailing_whitespace_error -" Highlights trailing white space. +" go.vim: Vim syntax file for Go. +" Language: Go +" Maintainer: Billie Cleek +" Latest Revision: 2021-09-18 +" License: BSD-style. See LICENSE file in source repository. +" Repository: https://github.com/fatih/vim-go " Quit when a (custom) syntax file was already loaded -if exists('b:current_syntax') +if exists("b:current_syntax") finish endif -if !exists('g:go_highlight_array_whitespace_error') - let g:go_highlight_array_whitespace_error = 1 -endif -if !exists('g:go_highlight_chan_whitespace_error') - let g:go_highlight_chan_whitespace_error = 1 -endif -if !exists('g:go_highlight_extra_types') - let g:go_highlight_extra_types = 1 -endif -if !exists('g:go_highlight_space_tab_error') - let g:go_highlight_space_tab_error = 1 -endif -if !exists('g:go_highlight_trailing_whitespace_error') - let g:go_highlight_trailing_whitespace_error = 1 -endif +let s:keepcpo = &cpo +set cpo&vim + +function! s:FoldEnable(...) abort + if a:0 > 0 + return index(s:FoldEnable(), a:1) > -1 + endif + return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment']) +endfunction + +function! s:HighlightArrayWhitespaceError() abort + return get(g:, 'go_highlight_array_whitespace_error', 0) +endfunction + +function! s:HighlightChanWhitespaceError() abort + return get(g:, 'go_highlight_chan_whitespace_error', 0) +endfunction + +function! s:HighlightExtraTypes() abort + return get(g:, 'go_highlight_extra_types', 0) +endfunction + +function! s:HighlightSpaceTabError() abort + return get(g:, 'go_highlight_space_tab_error', 0) +endfunction + +function! s:HighlightTrailingWhitespaceError() abort + return get(g:, 'go_highlight_trailing_whitespace_error', 0) +endfunction + +function! s:HighlightOperators() abort + return get(g:, 'go_highlight_operators', 0) +endfunction + +function! s:HighlightFunctions() abort + return get(g:, 'go_highlight_functions', 0) +endfunction + +function! s:HighlightFunctionParameters() abort + return get(g:, 'go_highlight_function_parameters', 0) +endfunction + +function! s:HighlightFunctionCalls() abort + return get(g:, 'go_highlight_function_calls', 0) +endfunction + +function! s:HighlightFields() abort + return get(g:, 'go_highlight_fields', 0) +endfunction + +function! s:HighlightTypes() abort + return get(g:, 'go_highlight_types', 0) +endfunction + +function! s:HighlightBuildConstraints() abort + return get(g:, 'go_highlight_build_constraints', 0) +endfunction + +function! s:HighlightStringSpellcheck() abort + return get(g:, 'go_highlight_string_spellcheck', 1) +endfunction + +function! s:HighlightFormatStrings() abort + return get(g:, 'go_highlight_format_strings', 1) +endfunction + +function! s:HighlightGenerateTags() abort + return get(g:, 'go_highlight_generate_tags', 0) +endfunction + +function! s:HighlightVariableAssignments() abort + return get(g:, 'go_highlight_variable_assignments', 0) +endfunction + +function! s:HighlightVariableDeclarations() abort + return get(g:, 'go_highlight_variable_declarations', 0) +endfunction syn case match -syn keyword goDirective package import -syn keyword goDeclaration var const type -syn keyword goDeclType struct interface +syn keyword goPackage package +syn keyword goImport import contained +syn keyword goVar var contained +syn keyword goConst const contained -hi def link goDirective Statement +hi def link goPackage Statement +hi def link goImport Statement +hi def link goVar Keyword +hi def link goConst Keyword hi def link goDeclaration Keyword -hi def link goDeclType Keyword " Keywords within functions syn keyword goStatement defer go goto return break continue fallthrough @@ -78,28 +129,38 @@ hi def link goUnsignedInts Type hi def link goFloats Type hi def link goComplexes Type -" Treat func specially: it's a declaration at the start of a line, but a type -" elsewhere. Order matters here. -syn match goType /\/ -syn match goDeclaration /^func\>/ - " Predefined functions and values -syn keyword goBuiltins append cap close complex copy delete imag len -syn keyword goBuiltins make new panic print println real recover -syn keyword goConstants iota true false nil +syn keyword goBuiltins append cap close complex copy delete imag len +syn keyword goBuiltins make new panic print println real recover +syn keyword goBoolean true false +syn keyword goPredefinedIdentifiers nil iota -hi def link goBuiltins Keyword -hi def link goConstants Keyword +hi def link goBuiltins Identifier +hi def link goBoolean Boolean +hi def link goPredefinedIdentifiers goBoolean " Comments; their contents syn keyword goTodo contained TODO FIXME XXX BUG syn cluster goCommentGroup contains=goTodo -syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell -syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell + +syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell +if s:FoldEnable('comment') + syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold + syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold +else + syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell +endif hi def link goComment Comment hi def link goTodo Todo +if s:HighlightGenerateTags() + syn match goGenerateVariables contained /\%(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/ + syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables + hi def link goGenerate PreProc + hi def link goGenerateVariables Special +endif + " Go escapes syn match goEscapeOctal display contained "\\[0-7]\{3}" syn match goEscapeC display contained +\\[abfnrtv\\'"]+ @@ -118,8 +179,30 @@ hi def link goEscapeError Error " Strings and their contents syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError -syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup -syn region goRawString start=+`+ end=+`+ +if s:HighlightStringSpellcheck() + syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell + syn region goRawString start=+`+ end=+`+ contains=@Spell +else + syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup + syn region goRawString start=+`+ end=+`+ +endif + +if s:HighlightFormatStrings() + " [n] notation is valid for specifying explicit argument indexes + " 1. Match a literal % not preceded by a %. + " 2. Match any number of -, #, 0, space, or + + " 3. Match * or [n]* or any number or nothing before a . + " 4. Match * or [n]* or any number or nothing after a . + " 5. Match [n] or nothing before a verb + " 6. Match a formatting verb + syn match goFormatSpecifier /\ + \%([^%]\%(%%\)*\)\ + \@<=%[-#0 +]*\ + \%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\ + \%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\ + \%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGspw]/ contained containedin=goString,goRawString + hi def link goFormatSpecifier goSpecialString +endif hi def link goString String hi def link goRawString String @@ -131,71 +214,263 @@ syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains= hi def link goCharacter Character " Regions -syn region goBlock start="{" end="}" transparent fold syn region goParen start='(' end=')' transparent +if s:FoldEnable('block') + syn region goBlock start="{" end="}" transparent fold +else + syn region goBlock start="{" end="}" transparent +endif + +" import +if s:FoldEnable('import') + syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment +else + syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment +endif + +" var, const +if s:FoldEnable('varconst') + syn region goVar start='var (' end='^\s*)$' transparent fold + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator + syn region goConst start='const (' end='^\s*)$' transparent fold + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator +else + syn region goVar start='var (' end='^\s*)$' transparent + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator + syn region goConst start='const (' end='^\s*)$' transparent + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator +endif + +" Single-line var, const, and import. +syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst " Integers -syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>" -syn match goHexadecimalInt "\<0x\x\+\>" -syn match goOctalInt "\<0\o\+\>" -syn match goOctalError "\<0\o*[89]\d*\>" +syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>" +syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>" +syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>" +syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>" +syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>" +syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>" +syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>" +syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>" hi def link goDecimalInt Integer +hi def link goDecimalError Error hi def link goHexadecimalInt Integer +hi def link goHexadecimalError Error hi def link goOctalInt Integer +hi def link goOctalError Error +hi def link goBinaryInt Integer +hi def link goBinaryError Error hi def link Integer Number " Floating point -syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" -syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>" -syn match goFloat "\<\d\+[Ee][-+]\d\+\>" +syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>" +syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>" hi def link goFloat Float " Imaginary literals -syn match goImaginary "\<\d\+i\>" -syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" -syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" -syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>" +syn match goImaginary "\<-\=\d\+i\>" +syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>" +syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>" +syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>" hi def link goImaginary Number +hi def link goImaginaryFloat Float " Spaces after "[]" -if go_highlight_array_whitespace_error != 0 - syn match goSpaceError display "\(\[\]\)\@<=\s\+" +if s:HighlightArrayWhitespaceError() + syn match goSpaceError display "\%(\[\]\)\@<=\s\+" endif " Spacing errors around the 'chan' keyword -if go_highlight_chan_whitespace_error != 0 +if s:HighlightChanWhitespaceError() " receive-only annotation on chan type - syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@=" + " + " \(\\)\@\)\@\)\@=" + " send-only annotation on chan type - syn match goSpaceError display "\(\ (only pick chan when it doesn't come after an arrow) + " this prevents picking up '<-chan <-chan' but not 'chan <-' + syn match goSpaceError display "\%(\%(<-\)\@\)\@<=\s\+\%(<-\)\@=" + " value-ignoring receives in a few contexts - syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+" + syn match goSpaceError display "\%(\%(^\|[={(,;]\)\s*<-\)\@<=\s\+" endif " Extra types commonly seen -if go_highlight_extra_types != 0 - syn match goExtraType /\/ - syn match goExtraType /\/ - syn match goExtraType /\/ +if s:HighlightExtraTypes() + syn match goExtraType /\/ + syn match goExtraType /\/ + syn match goExtraType /\/ + syn match goExtraType /\/ syn match goExtraType /\/ endif " Space-tab error -if go_highlight_space_tab_error != 0 +if s:HighlightSpaceTabError() syn match goSpaceError display " \+\t"me=e-1 endif " Trailing white space error -if go_highlight_trailing_whitespace_error != 0 +if s:HighlightTrailingWhitespaceError() syn match goSpaceError display excludenl "\s\+$" endif hi def link goExtraType Type hi def link goSpaceError Error + + +" included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim +" +" Comments; their contents +syn keyword goTodo contained NOTE +hi def link goTodo Todo + +syn match goVarArgs /\.\.\./ + +" Operators; +if s:HighlightOperators() + " match single-char operators: - + % < > ! & | ^ * = + " and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= == + syn match goOperator /[-+%<>!&|^*=]=\?/ + " match / and /= + syn match goOperator /\/\%(=\|\ze[^/*]\)/ + " match two-char operators: << >> &^ + " and corresponding three-char operators: <<= >>= &^= + syn match goOperator /\%(<<\|>>\|&^\)=\?/ + " match remaining two-char operators: := && || <- ++ -- + syn match goOperator /:=\|||\|<-\|++\|--/ + " match ... + + hi def link goPointerOperator goOperator + hi def link goVarArgs goOperator +endif +hi def link goOperator Operator + +" Functions; +if s:HighlightFunctions() || s:HighlightFunctionParameters() + syn match goDeclaration /\/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl + syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained + syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl + syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl + syn match goReceiverType /\w\+/ contained + if s:HighlightFunctionParameters() + syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl + syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl + syn match goParamName /\w\+\%(\s*,\s*\w\+\)*\ze\s\+\%(\w\|\.\|\*\|\[\)/ contained nextgroup=goParamType skipwhite skipnl + syn match goParamType /\%([^,)]\|\_s\)\+,\?/ contained nextgroup=goParamName skipwhite skipnl + \ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock + hi def link goReceiverVar goParamName + hi def link goParamName Identifier + endif + syn match goReceiver /(\s*\w\+\%(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl +else + syn keyword goDeclaration func +endif +hi def link goFunction Function + +" Function calls; +if s:HighlightFunctionCalls() + syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration +endif +hi def link goFunctionCall Type + +" Fields; +if s:HighlightFields() + " 1. Match a sequence of word characters coming after a '.' + " 2. Require the following but dont match it: ( \@= see :h E59) + " - The symbols: / - + * % OR + " - The symbols: [] {} <> ) OR + " - The symbols: \n \r space OR + " - The symbols: , : . + " 3. Have the start of highlight (hs) be the start of matched + " pattern (s) offsetted one to the right (+1) (see :h E401) + syn match goField /\.\w\+\ + \%(\%([\/\-\+*%]\)\|\ + \%([\[\]{}<\>\)]\)\|\ + \%([\!=\^|&]\)\|\ + \%([\n\r\ ]\)\|\ + \%([,\:.]\)\)\@=/hs=s+1 +endif +hi def link goField Identifier + +" Structs & Interfaces; +if s:HighlightTypes() + syn match goTypeConstructor /\<\w\+{\@=/ + syn match goTypeDecl /\/ nextgroup=goTypeName skipwhite skipnl + syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl + syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl + hi def link goReceiverType Type +else + syn keyword goDeclType struct interface + syn keyword goDeclaration type +endif +hi def link goTypeConstructor Type +hi def link goTypeName Type +hi def link goTypeDecl Keyword +hi def link goDeclType Keyword + +" Variable Assignments +if s:HighlightVariableAssignments() + syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/ + hi def link goVarAssign Special +endif + +" Variable Declarations +if s:HighlightVariableDeclarations() + syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/ + hi def link goVarDefs Special +endif + +" Build Constraints +if s:HighlightBuildConstraints() + syn match goBuildKeyword display contained "+build\|go:build" + " Highlight the known values of GOOS, GOARCH, and other +build options. + syn keyword goBuildDirectives contained + \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 + \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 + \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc + \ s390 s390x sparc sparc64 cgo ignore race + + " Other words in the build directive are build tags not listed above, so + " avoid highlighting them as comments by using a matchgroup just for the + " start of the comment. + " The rs=s+2 option lets the \s*+build portion be part of the inner region + " instead of the matchgroup so it will be highlighted as a goBuildKeyword. + syn region goBuildComment matchgroup=goBuildCommentStart + \ start="//\s*+build\s"rs=s+2 end="$" + \ contains=goBuildKeyword,goBuildDirectives + hi def link goBuildCommentStart Comment + hi def link goBuildDirectives Type + hi def link goBuildKeyword PreProc +endif + +if s:HighlightBuildConstraints() || s:FoldEnable('package_comment') + " One or more line comments that are followed immediately by a "package" + " declaration are treated like package documentation, so these must be + " matched as comments to avoid looking like working build constraints. + " The he, me, and re options let the "package" itself be highlighted by + " the usual rules. + exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/' + \ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7' + \ . ' contains=@goCommentGroup,@Spell' + \ . (s:FoldEnable('package_comment') ? ' fold' : '') + exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/' + \ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7' + \ . ' contains=@goCommentGroup,@Spell' + \ . (s:FoldEnable('package_comment') ? ' fold' : '') + hi def link goPackageComment Comment +endif + +" :GoCoverage commands +hi def link goCoverageNormalText Comment + " Search backwards for a global declaration to start processing the syntax. "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ @@ -203,6 +478,9 @@ hi def link goSpaceError Error " following as a more expensive/less precise workaround. syn sync minlines=500 -let b:current_syntax = 'go' +let b:current_syntax = "go" + +let &cpo = s:keepcpo +unlet s:keepcpo " vim: sw=2 sts=2 et diff --git a/runtime/syntax/gprof.vim b/runtime/syntax/gprof.vim index 381a3c63b048f..d2c5cb4cabd46 100644 --- a/runtime/syntax/gprof.vim +++ b/runtime/syntax/gprof.vim @@ -1,15 +1,16 @@ " Vim syntax file " Language: Syntax for Gprof Output " Maintainer: Dominique Pelle -" Last Change: 2013 Jun 09 +" Last Change: 2021 Sep 19 " Quit when a syntax file was already loaded if exists("b:current_syntax") - finish + finish endif let s:keepcpo= &cpo set cpo&vim +syn spell notoplevel syn case match syn sync minlines=100 @@ -28,7 +29,7 @@ syn match gprofCallGraphTitle "Call graph (explanation follows)" syn region gprofCallGraphHeader \ start="^granularity: each sample hit covers.*" \ end="^\s*index % time\s\+self\s\+children\s\+called\s\+name$" -syn match gprofCallGraphFunction "\s\+\(\d\+\.\d\+\s\+\)\{3}\([0-9+]\+\)\?\s\+[a-zA-Z_<].*\ze\[" +syn match gprofCallGraphFunction "\<\(\d\+\.\d\+\s\+\)\{3}\([0-9+]\+\)\?\s\+[a-zA-Z_<].*\ze\[" syn match gprofCallGraphSeparator "^-\+$" syn region gprofCallGraphTrailer \ start="This table describes the call tree of the program" @@ -41,7 +42,7 @@ syn region gprofIndex syn match gprofIndexFunctionTitle "^Index by function name$" -syn match gprofNumbers "^\s\+[0-9 ./+]\+" +syn match gprofNumbers "^\s*[0-9 ./+]\+" syn match gprofFunctionIndex "\[\d\+\]" syn match gprofSpecial "<\(spontaneous\|cycle \d\+\)>" diff --git a/runtime/syntax/groff.vim b/runtime/syntax/groff.vim index d4dc0cc4f7c8c..c076c8d973125 100644 --- a/runtime/syntax/groff.vim +++ b/runtime/syntax/groff.vim @@ -1,7 +1,7 @@ " VIM syntax file " Language: groff -" Maintainer: Alejandro LīŋŊpez-Valencia -" URL: http://dradul.tripod.com/vim +" Maintainer: John Marshall +" Previous Maintainer: Pedro Alejandro LÃŗpez-Valencia " Last Change: 2003-05-08-12:41:13 GMT-5. " This uses the nroff.vim syntax file. diff --git a/runtime/syntax/groovy.vim b/runtime/syntax/groovy.vim index 2245b79d04c7a..41495e668284a 100644 --- a/runtime/syntax/groovy.vim +++ b/runtime/syntax/groovy.vim @@ -1,10 +1,10 @@ " Vim syntax file " Language: Groovy -" Original Author: Alessio Pace -" Maintainer: Tobias Rapp -" Version: 0.1.16 +" Original Author: Alessio Pace +" Maintainer: Tobias Rapp +" Version: 0.1.18 " URL: http://www.vim.org/scripts/script.php?script_id=945 -" Last Change: 2016 May 23 +" Last Change: 2021 Feb 03 " THE ORIGINAL AUTHOR'S NOTES: " @@ -253,7 +253,8 @@ if exists("groovy_regex_strings") endif " syn region groovyELExpr start=+${+ end=+}+ keepend contained syn match groovyELExpr /\${.\{-}}/ contained -syn match groovyELExpr /\$[a-zA-Z_][a-zA-Z0-9_.]*/ contained +" Fix: force use of the NFA regexp engine (2), see GitHub issue #7280 +syn match groovyELExpr /\%#=2\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained hi def link groovyELExpr Identifier " TODO: better matching. I am waiting to understand how it really works in groovy diff --git a/runtime/syntax/gvpr.vim b/runtime/syntax/gvpr.vim new file mode 100644 index 0000000000000..a7378916f9387 --- /dev/null +++ b/runtime/syntax/gvpr.vim @@ -0,0 +1,85 @@ +" Vim syntax file +" Language: Graphviz program +" Maintainer: Matthew Fernandez +" Last Change: Tue, 28 Jul 2020 17:20:44 -0700 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn keyword gvArg ARGC ARGV +syn keyword gvBeg BEGIN BEG_G N E END END_G +syn keyword gvFunc + \ graph fstsubg isDirect isStrict isSubg nEdges nNodes nxtsubg subg + \ degreeOf fstnode indegreeOf isNode isSubnode node nxtnode nxtnode_sg + \ outDegreeOf subnode + \ edge edge_sg fstedge fstedge_sg fstin fstin_sg fstout fstout_sg isEdge + \ isEdge_sg isSubedge nxtedge nxtedge_sg nxtin nxtin_sg nxtout nxtout_sg opp + \ subedge + \ freadG fwriteG readG write[] writeG + \ aget aset clone cloneG compOf copy[] copyA delete[] fstAttr getDflt hasAttr + \ induce isAttr isIn kindOf lock[] nxtAttr setDflt + \ canon gsub html index ishtml length llOf match[] rindex split[] sprintf + \ sscanf strcmp sub substr tokens tolower toupper urOf xOf yOf + \ closeF openF print[] printf scanf readL + \ atan2 cos exp log MAX MIN pow sin[] sqrt + \ in[] unset + \ colorx exit[] rand srand system +syn keyword gvCons + \ NULL TV_bfs TV_dfs TV_en TV_flat TV_fwd TV_ne TV_prepostdfs TV_prepostfwd + \ TV_prepostrev TV_postdfs TV_postfwd tv_postrev TV_rev +syn keyword gvType char double float int long unsigned void + \ string + \ edge_t graph_t node_t obj_t +syn match gvVar + \ "\$\(\(F\|G\|NG\|O\|T\|tgtname\|tvedge\|tvnext\|tvroot\|tvtype\)\>\)\?\(\<\)\@!" +syn keyword gvWord break continue else for forr if return switch while + +" numbers adapted from c.vim's cNumbers and friends +syn match gvNums transparent "\<\d\|\.\d" contains=gvNumber,gvFloat,gvOctal +syn match gvNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match gvNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" +syn match gvOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=gvOctalZero +syn match gvOctalZero contained "\<0" +syn match gvFloat contained "\d\+f" +syn match gvFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" +syn match gvFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" +syn match gvFloat contained "\d\+e[-+]\=\d\+[fl]\=\>" + +syn region gvString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gvFormat,gvSpecial extend +syn region gvString start="'" skip="\\\\\|\\'" end="'" contains=gvFormat,gvSpecial extend + +" adapted from c.vim's cFormat for c_no_c99 +syn match gvFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained + +syn match gvSpecial "\\." contained + +syn region gvCComment start="//" skip="\\$" end="$" keepend +syn region gvCPPComment start="#" skip="\\$" end="$" keepend +syn region gvCXXComment start="/\*" end="\*/" fold + +hi def link gvArg Identifier +hi def link gvBeg Keyword +hi def link gvFloat Number +hi def link gvFunc Identifier +hi def link gvCons Number +hi def link gvNumber Number +hi def link gvType Type +hi def link gvVar Statement +hi def link gvWord Keyword + +hi def link gvString String +hi def link gvFormat Special +hi def link gvSpecial Special + +hi def link gvCComment Comment +hi def link gvCPPComment Comment +hi def link gvCXXComment Comment + +let b:current_syntax = "gvpr" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/haml.vim b/runtime/syntax/haml.vim index 5369695c22843..c14b88f5027fe 100644 --- a/runtime/syntax/haml.vim +++ b/runtime/syntax/haml.vim @@ -2,7 +2,7 @@ " Language: Haml " Maintainer: Tim Pope " Filenames: *.haml -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -38,7 +38,7 @@ syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser, syn match hamlSelfCloser "/" contained syn match hamlClassChar "\." contained nextgroup=hamlClass syn match hamlIdChar "#{\@!" contained nextgroup=hamlId -syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent +syn match hamlClass "\%(\w\|-\|\:\)\+" contained nextgroup=@hamlComponent syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent syn region hamlDocType start="^\s*!!!" end="$" diff --git a/runtime/syntax/hamster.vim b/runtime/syntax/hamster.vim index 64d9598a71bfa..975562da0f0e2 100644 --- a/runtime/syntax/hamster.vim +++ b/runtime/syntax/hamster.vim @@ -9,7 +9,7 @@ " It allows the use of multiple news- and mailserver and combines them to one " mail- and newsserver for the news/mail-client. It load faster than a normal " newsreader because many threads can run simultaneous. It contains scorefile -" for news and mail, a build-in script language, the GUI allows translation to +" for news and mail, a built-in script language, the GUI allows translation to " other languages, it can be used in a network and that's not all features... " " quit when a syntax file was already loaded diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim index e5128a12ab8bb..1b70b9344ace8 100644 --- a/runtime/syntax/haskell.vim +++ b/runtime/syntax/haskell.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Haskell " Maintainer: Haskell Cafe mailinglist -" Last Change: 2018 Mar 29 by Marcin Szamotulski +" Last Change: 2020 Oct 4 by Marcin Szamotulski " Original Author: John Williams " " Thanks to Ryan Crumley for suggestions and John Meacham for @@ -38,8 +38,8 @@ if exists("b:current_syntax") endif " (Qualified) identifiers (no default highlighting) -syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" contains=@NoSpell -syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" contains=@NoSpell +syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)*\<[A-Z][a-zA-Z0-9_']*\>" contains=@NoSpell +syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)*\<[a-z][a-zA-Z0-9_']*\>" contains=@NoSpell " Infix operators--most punctuation characters and any (qualified) identifier " enclosed in `backquotes`. An operator starting with : is a constructor, @@ -49,8 +49,11 @@ syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*" syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`" syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`" +" (Non-qualified) identifiers which start with # are labels +syn match hsLabel "#[a-z][a-zA-Z0-9_']*\>" + " Reserved symbols--cannot be overloaded. -syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}" +syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|{\|}" " Strings and constants syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)" @@ -62,37 +65,41 @@ syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hs syn match hsNumber "\v<[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*>|<0[oO]_*%(_*[0-7])*>|<0[bB]_*[01]%(_*[01])*>" syn match hsFloat "\v<[0-9]%(_*[0-9])*\.[0-9]%(_*[0-9])*%(_*[eE][-+]?[0-9]%(_*[0-9])*)?>|<[0-9]%(_*[0-9])*_*[eE][-+]?[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*\.[0-9a-fA-F]%(_*[0-9a-fA-F])*%(_*[pP][-+]?[0-9]%(_*[0-9])*)?>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*_*[pP][-+]?[0-9]%(_*[0-9])*>" -" Keyword definitions. These must be patterns instead of keywords -" because otherwise they would match as keywords at the start of a -" "literate" comment (see lhs.vim). -syn match hsModule "\" -syn match hsImport "\.*"he=s+6 contains=hsImportMod,hsLineComment,hsBlockComment,@NoSpell -syn match hsImportMod contained "\<\(as\|qualified\|hiding\)\>" contains=@NoSpell -syn match hsInfix "\<\(infix\|infixl\|infixr\)\>" -syn match hsStructure "\<\(class\|data\|deriving\|instance\|default\|where\)\>" -syn match hsTypedef "\<\(type\|newtype\)\>" -syn match hsStatement "\<\(do\|case\|of\|let\|in\)\>" -syn match hsConditional "\<\(if\|then\|else\)\>" +" Keyword definitions. +syn keyword hsModule module +syn match hsImportGroup "\.*" contains=hsImport,hsImportModuleName,hsImportMod,hsLineComment,hsBlockComment,hsImportList,@NoSpell nextgroup=hsImport +syn keyword hsImport import contained nextgroup=hsImportModuleName +syn match hsImportModuleName '\<[A-Z][A-Za-z.]*' contained +syn region hsImportList start='(' skip='([^)]\{-})' end=')' keepend contained contains=ConId,VarId,hsDelimiter,hsBlockComment,hsTypedef,@NoSpell + +syn keyword hsImportMod contained as qualified hiding +syn keyword hsInfix infix infixl infixr +syn keyword hsStructure class data deriving instance default where +syn keyword hsTypedef type +syn keyword hsNewtypedef newtype +syn keyword hsTypeFam family +syn keyword hsStatement mdo do case of let in +syn keyword hsConditional if then else " Not real keywords, but close. if exists("hs_highlight_boolean") " Boolean constants from the standard prelude. - syn match hsBoolean "\<\(True\|False\)\>" + syn keyword hsBoolean True False endif if exists("hs_highlight_types") " Primitive types from the standard prelude and libraries. - syn match hsType "\<\(Int\|Integer\|Char\|Bool\|Float\|Double\|IO\|Void\|Addr\|Array\|String\)\>" + syn keyword hsType Int Integer Char Bool Float Double IO Void Addr Array String endif if exists("hs_highlight_more_types") " Types from the standard prelude libraries. - syn match hsType "\<\(Maybe\|Either\|Ratio\|Complex\|Ordering\|IOError\|IOResult\|ExitCode\)\>" - syn match hsMaybe "\" - syn match hsExitCode "\<\(ExitSuccess\)\>" - syn match hsOrdering "\<\(GT\|LT\|EQ\)\>" + syn keyword hsType Maybe Either Ratio Complex Ordering IOError IOResult ExitCode + syn keyword hsMaybe Nothing + syn keyword hsExitCode ExitSuccess + syn keyword hsOrdering GT LT EQ endif if exists("hs_highlight_debug") " Debugging functions from the standard prelude. - syn match hsDebug "\<\(undefined\|error\|trace\)\>" + syn keyword hsDebug undefined error trace endif @@ -133,12 +140,14 @@ hi def link hsImportMod hsImport hi def link hsInfix PreProc hi def link hsStructure Structure hi def link hsStatement Statement -hi def link hsConditional Conditional -hi def link hsSpecialChar SpecialChar +hi def link hsConditional Conditional +hi def link hsSpecialChar SpecialChar hi def link hsTypedef Typedef +hi def link hsNewtypedef Typedef hi def link hsVarSym hsOperator hi def link hsConSym hsOperator hi def link hsOperator Operator +hi def link hsTypeFam Structure if exists("hs_highlight_delimiters") " Some people find this highlighting distracting. hi def link hsDelimiter Delimiter @@ -160,22 +169,22 @@ hi def link hsMaybe hsEnumConst hi def link hsOrdering hsEnumConst hi def link hsEnumConst Constant hi def link hsDebug Debug - -hi def link cCppString hsString -hi def link cCommentStart hsComment -hi def link cCommentError hsError -hi def link cCommentStartError hsError -hi def link cInclude Include -hi def link cPreProc PreProc -hi def link cDefine Macro -hi def link cIncluded hsString -hi def link cError Error -hi def link cPreCondit PreCondit -hi def link cComment Comment -hi def link cCppSkip cCppOut -hi def link cCppOut2 cCppOut -hi def link cCppOut Comment - +hi def link hsLabel Special + +hi def link cCppString hsString +hi def link cCommentStart hsComment +hi def link cCommentError hsError +hi def link cCommentStartError hsError +hi def link cInclude Include +hi def link cPreProc PreProc +hi def link cDefine Macro +hi def link cIncluded hsString +hi def link cError Error +hi def link cPreCondit PreCondit +hi def link cComment Comment +hi def link cCppSkip cCppOut +hi def link cCppOut2 cCppOut +hi def link cCppOut Comment let b:current_syntax = "haskell" diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim index 673a54f988b3f..aa76906d7b5d5 100644 --- a/runtime/syntax/help.vim +++ b/runtime/syntax/help.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Vim help file " Maintainer: Bram Moolenaar (Bram@vim.org) -" Last Change: 2019 May 12 +" Last Change: 2022 May 15 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -11,7 +11,7 @@ endif let s:cpo_save = &cpo set cpo&vim -syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*[ \t]\+\*"me=e-1 +syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*\ze\(\s\+\*\|$\)" syn match helpSectionDelim "^===.*===$" syn match helpSectionDelim "^---.*--$" if has("conceal") @@ -76,6 +76,7 @@ syn match helpSpecial "\[line]" syn match helpSpecial "\[count]" syn match helpSpecial "\[offset]" syn match helpSpecial "\[cmd]" +syn match helpNormal "vim9\[cmd]" syn match helpSpecial "\[num]" syn match helpSpecial "\[+num]" syn match helpSpecial "\[-num]" @@ -90,6 +91,7 @@ syn match helpSpecial "\[group]" syn match helpNormal "\[\(readonly\|fifo\|socket\|converted\|crypted\)]" syn match helpSpecial "CTRL-." +syn match helpSpecial "CTRL-SHIFT-." syn match helpSpecial "CTRL-Break" syn match helpSpecial "CTRL-PageUp" syn match helpSpecial "CTRL-PageDown" @@ -213,6 +215,12 @@ hi def link helpError Error hi def link helpTodo Todo hi def link helpURL String +if has('textprop') && expand('%:p') =~ '[/\\]doc[/\\]syntax.txt' + " highlight groups with their respective color + import 'dist/vimhelp.vim' + call vimhelp.HighlightGroups() +endif + let b:current_syntax = "help" let &cpo = s:cpo_save diff --git a/runtime/syntax/help_ru.vim b/runtime/syntax/help_ru.vim new file mode 100644 index 0000000000000..67df7e1240737 --- /dev/null +++ b/runtime/syntax/help_ru.vim @@ -0,0 +1,65 @@ +" Vim syntax file +" Language: Russian Vim program help files *.rux +" Maintainer: Restorer (restorers@users.sourceforge.net DEFUNCT) +" Last Change: 04 Aprl 2017 +" + +" ĐŸŅ€ĐžĐ˛ĐĩŅ€ŅĐĩĐŧ ŅĐˇŅ‹Đē ĐģĐžĐēаĐģи и ŅƒŅŅ‚Đ°ĐŊОвĐēи ĐžĐŋŅ†Đ¸Đ¸ 'helplang' +" Đ•ŅĐģи ĐŊĐĩ Ņ€ŅƒŅŅĐēиК, Ņ‚Đž Đ˛Ņ‹Ņ…ĐžĐ´Đ¸Đŧ иС ҁĐēŅ€Đ¸ĐŋŅ‚Đ°. +if (v:lang !~? 'ru' || v:lang !~? 'russian') && &helplang !~? 'ru' + finish +endif + +" ĐŸĐžĐ´ŅĐ˛ĐĩŅ‚Đēа Ņ€ŅƒŅŅĐēĐ¸Ņ… ĐŗĐ¸ĐŋĐĩҀҁҁҋĐģĐžĐē +syntax match helpHyperTextJump "\\\@" +"ŅŅ‚Đ°Ņ€Ņ‹Đš ĐˇĐ°ĐŗĐžĐģОвОĐē +syntax match helpVim "\<СПРАВОЧНИК ПО .*" +" ĐŊĐžĐ˛Ņ‹Đš ĐˇĐ°ĐŗĐžĐģОвОĐē +"syntax match helpVim "\<Đ ĐŖĐšĐžĐ’ĐžĐ”ĐĄĐĸВО ПОЛĐŦЗОВАĐĸĐ•Đ›Đ¯ РЕДАКĐĸОРОМ VIM\>" +"syntax match helpVim "\<Đ°Đ˛Ņ‚ĐžŅ€\%[Ņ‹:] .*$" +"ŅŅ‚Đ°Ņ€Ņ‹Đš ĐˇĐ°ĐŗĐžĐģОвОĐē +syntax match helpVim "\<Đ ĐŖĐšĐžĐ’ĐžĐ”ĐĄĐĸВО ПОЛĐŦЗОВАĐĸĐ•Đ›Đ¯ .*" +" ĐŸĐžĐ´ŅĐ˛ĐĩŅ‚Đēа ĐŋŅ€Đ¸ĐŧĐĩŅ‡Đ°ĐŊиК в Ņ‚ĐĩĐēҁ҂Đĩ, ĐŊĐ°Ņ‡Đ°Đģа ĐŋŅ€Đ¸ĐŧĐĩŅ€ĐžĐ˛ и Ņ‚.Đŋ. +syntax keyword helpNote ĐŸŅ€Đ¸ĐŧĐĩŅ‡Đ°ĐŊиĐĩ. ХОвĐĩŅ‚. ĐŸŅ€Đ¸ĐŧĐĩŅ€. ĐŸŅ€Đ¸ĐŧĐĩҀҋ: +syntax keyword helpWarning ВĐŊиĐŧаĐŊиĐĩ! +" в ŅŅ‚Đ°Ņ€ĐžĐš вĐĩŅ€ŅĐ¸Đ¸ Đ´ĐžĐē҃ĐŧĐĩĐŊŅ‚Đ°Ņ†Đ¸Đ¸ +syntax keyword helpNote ЗаĐŧĐĩŅ‡Đ°ĐŊиĐĩ: +" в ŅŅ‚Đ°Ņ€ĐžĐš вĐĩŅ€ŅĐ¸Đ¸ Đ´ĐžĐē҃ĐŧĐĩĐŊŅ‚Đ°Ņ†Đ¸Đ¸ +syntax keyword helpWarning ВНИМАНИЕ! ĐŸŅ€ĐĩĐ´ŅƒĐŋŅ€ĐĩĐļĐ´ĐĩĐŊиĐĩ: +" ĐŸĐžĐ´ŅĐ˛ĐĩŅ‚Đēа Ex-ĐēĐžĐŧаĐŊĐ´ в Đ´ĐžĐē҃ĐŧĐĩĐŊŅ‚Đ°Ņ†Đ¸Đ¸ Vim +syntax match helpCommand "\":[A-Za-z!]\+\""hs=s+1,he=e-1 +" ĐŸĐžĐ´ŅĐ˛ĐĩŅ‚Đēа ҁĐŋĐĩŅ†Đ¸Đ°ĐģҌĐŊҋ҅ ОйОСĐŊĐ°Ņ‡ĐĩĐŊиК +syntax match helpSpecial "{[-а-ŅŅ‘Đ-Đ¯Đ0-9'":%#=[\]<>.,]\+}" +syntax match helpSpecial "{[-а-ŅŅ‘Đ-Đ¯Đ0-9'"*+/:%#=[\]<>.,]\+}" +syntax match helpSpecial "\s\[[-а-ŅŅ‘^А-Đ¯Đ0-9_]\{2,}]"ms=s+1 +syntax match helpSpecial "<[-а-ŅŅ‘Đ-Đ¯Đ0-9_]\+>" +syntax match helpSpecial "\[диаĐŋаСОĐŊ]" +syntax match helpSpecial "\[ŅŅ‡Ņ‘Ņ‚Ņ‡Đ¸Đē]" +syntax match helpSpecial "\[Ņ‡Đ¸ŅĐģĐž]" +syntax match helpSpecial "\[+Ņ‡Đ¸ŅĐģĐž]" +syntax match helpSpecial "\[-Ņ‡Đ¸ŅĐģĐž]" +syntax match helpSpecial "\[ĐēĐžĐģ-вО]" +syntax match helpSpecial "\[ŅŅ‚Ņ€ĐžĐēа]" +syntax match helpSpecial "\[ҁĐŧĐĩ҉ĐĩĐŊиĐĩ]" +syntax match helpSpecial "\[ĐŋĐ°Ņ€Đ°ĐŧĐĩ҂Ҁ]" +syntax match helpSpecial "\[ĐŋĐ°Ņ€Đ°ĐŧĐĩ҂Ҁҋ]" +syntax match helpSpecial "CTRL-{ŅĐ¸ĐŧвОĐģ}" +syntax region helpNotVi start="{Đ”ĐžŅŅ‚ŅƒĐŋĐŊĐž Ņ‚ĐžĐģҌĐēĐž" start="{В Ņ€ĐĩĐ´ĐēŅ‚ĐžŅ€Đĩ Vim" start="{В Ņ€ĐĩдаĐēŅ‚ĐžŅ€Đĩ Vi" end="}" contains=helpLeadBlank,helpHyperTextJump +" ĐŸĐžĐ´ŅĐ˛ĐĩŅ‚Đēа ĐŋŅ€Đ¸ĐŧĐĩŅ‡Đ°ĐŊиК ĐŋĐĩŅ€ĐĩĐ˛ĐžĐ´Ņ‡Đ¸Đēа +syntax region helpTrnsNote start="\[ĐŸŅ€Đ¸Đŧ. ĐŋĐĩŅ€ĐĩвОд." end="]" contains=helpComment +" ОĐŋŅ€ĐĩĐ´ĐĩĐģĐĩĐŊиĐĩ ĐŗŅ€ŅƒĐŋĐŋŅ‹ ĐŋĐžĐ´ŅĐ˛ĐĩŅ‚Đēи Ex-ĐēĐžĐŧаĐŊĐ´ в Đ´ĐžĐē҃ĐŧĐĩĐŊŅ‚Đ°Ņ†Đ¸Đ¸ Vim +"hi def link helpCommand vimCommand +" ОĐŋŅ€ĐĩĐ´ĐĩĐģĐĩĐŊиĐĩ ĐŗŅ€ŅƒĐŋĐŋŅ‹ ĐŋĐžĐ´ŅĐ˛ĐĩŅ‚Đēи ĐŋŅ€Đ¸ĐŧĐĩŅ‡Đ°ĐŊиК ĐŋĐĩŅ€ĐĩĐ˛ĐžĐ´Ņ‡Đ¸Đēа +hi def link helpTrnsNote Comment +" hi def link helpTrnsNote Comment +" +" vim: ts=8 sw=2 diff --git a/runtime/syntax/hollywood.vim b/runtime/syntax/hollywood.vim index 34fbb45c54cee..ce5ba295536be 100644 --- a/runtime/syntax/hollywood.vim +++ b/runtime/syntax/hollywood.vim @@ -1,8 +1,8 @@ " Vim syntax file -" Language: Hollywood 8.0 +" Language: Hollywood 9.0 " Maintainer: Tom Crecelius " First Author: Tom Crecelius -" Last Change: 2018 May 18 +" Last Change: 2021 April 13 " Highlighting Issues: " Depending on your colour schema, Strings or Comments might be highlighted in " a way, you don't like. If so, try one of the following settings after @@ -30,7 +30,7 @@ let s:cpo_save = &cpo set cpo&vim if !exists("hw_version") - let hw_version = 8 + let hw_version = 9 let hw_subversion = 0 elseif !exists("hw_subversion") let hw_subversion = 0 @@ -109,12 +109,11 @@ syn match hwOperator "\%(&\|\*\|+\|-\|\.\||\|//\|/\|:\|<\|=\|>\|<>\|<=\|=>\|\^\| syn keyword hwConstant Nil syn keyword hwConstant True False " predefined preprocessing commands -syn match hwPreProcessor "@\<\%(BGPIC\|BRUSH\|ANIM\|SPRITE\|SAMPLE\|MUSIC\|FILE\|FONT\|VIDEO\|VERSION\|APPTITLE\|APPAUTHOR\|APPCOPYRIGHT\|APPDESCRIPTION\|APPVERSION\|APPICON\|BACKFILL\|SCREEN\|DISPLAY\|INCLUDE\|OPTIONS\|REQUIRE\|MENU\|APPIDENTIFIER\|WARNING\|ERROR\|IF\|ELSEIF\|ELSE\|ENDIF\)\>"ms=s+1 +syn match hwPreProcessor "@\<\%(ANIM\|APPAUTHOR\|APPCOPYRIGHT\|APPDESCRIPTION\|APPICON\|APPIDENTIFIER\|APPTITLE\|APPVERSION\|BACKFILL\|BGPIC\|BRUSH\|CATALOG\|DIRECTORY\|DISPLAY\|ELSE\|ELSEIF\|ENDIF\|ERROR\|FILE\|FONT\|ICON\|IF\|INCLUDE\|LINKER\|MENU\|MUSIC\|OPTIONS\|PALETTE\|REQUIRE\|SAMPLE\|SCREEN\|SPRITE\|VERSION\|VIDEO\|WARNING\)\>"ms=s+1 " predefined constants -syn match hwConstant "#\<\%(ERR_PORTNOTAVAIL\|SEEK_END\|ERR_CREATESHORTCUT\|PURPLE\|ERR_ALLOCCHANNEL\|PRGTYPE_SCRIPT\|ERR_NORETVAL\|ERR_DDRECVIDEO\|ERR_FINDPATH\|LANGUAGE_RUNDI\|ERR_STRINGCST\|COUNTRY_COLOMBIA\|LANGUAGE_KOREAN\|ERR_USERABORT\|ERR_WENDWOWHILE\|FONT\|FILEATTR_WRITE_OTH\|ERR_MODIFYABGPIC\|COUNTRY_DRCONGO\|LANGUAGE_KIRGHIZ\|LANGUAGE_ROMANSH\|FILEATTR_EXECUTE_GRP\|ERR_READVIDEOPIXELS\|SCROLLTOP\|ERR_ANIMDISK\|COUNTRY_IVORYCOAST\|LANGUAGE_GUJARATI\|SHORT\|COUNTRY_SOUTHAFRICA\|VIDEO\|ERR_BLKWOENDBLK\|ERR_WRONGHEX\|SPRITE_VS_BRUSH\|LANGUAGE_HIRIMOTU\|ZOOMSOUTHEAST\|COUNTRY_SLOVAKIA\|COUNTRY_GIBRALTAR\|ERR_INVALIDDATE\|RTS_ON\|PIXELZOOM1\|ATTRFRAMEDELAY\|AQUA\|ATTRFONTSCALABLE\|FILEATTR_NORMAL\|COUNTRY_ALBANIA\|COUNTRY_JAMAICA\|FONTWEIGHT_MEDIUM\|ERR_MALFORMPAT1\|COUNTRY_FRENCHGUIANA\|ERR_MAXPARAMS\|ERR_FORWONEXT\|COUNTRY_CONGO\|COUNTRY_GAMBIA\|UPNDOWN\|COUNTRY_ANDORRA\|BRUSH\|ERR_SELECTALPHACHANNEL\|MODLCOMMAND\|CLIENT\|COUNTRY_TRINIDADANDTOBAGO\|DIRECTORY\|LANGUAGE_ESPERANTO\|ATTRRAWHEIGHT\|COUNTRY_DENMARK\|FILETYPE_SOUND\|CLIPBOARD_TEXT\|LANGUAGE_FULAH\|ATTRPOSITION\|PLUGINCAPS_CONVERT\|ERR_APPLETVERSION\|COUNTRY_VANUATU\|COUNTDIRECTORIES\|ATTRNOHIDE\|VSTRIPES64\|AMIGAICON_SETPOSITION\|PUSHBOTTOM\|ERR_BACKFILL\|COUNTRY_MOROCCO\|ERR_FILEFORMAT\|COUNTRY_CHILE\|ATTRHOSTSCALEY\|ERR_AHI\|HW_VERSION\|ERR_ALRDYDECLRD\|ATTRRAWWIDTH\|ERR_PIXELFORMAT\|IMGFMT_PLUGIN\|LANGUAGE_HEBREW\|ERR_SETMENU\|ERR_NOLAYERS\|CRUSHTOP\|ERR_MAXLINES\|ATTRHASMASK\|LEFT\|ERR_SELECTANIM\|WALLPAPERLEFT\|TEXTOBJECT\|ERR_AFILEPROP\|LANGUAGE_CZECH\|LANGUAGE_XHOSA\|ERR_PIPE\|LANGUAGE_MANX\|ERR_EXECUTE\|ERR_ENDDOUBLEBUFFER\|ATTRGROUP\|ERR_NAMETOOLONG\|ATTRBORDERRIGHT\|COUNTRY_BOSNIAANDHERZEGOVINA\|ATTRMARGINRIGHT\|RTS_OFF\|LANGUAGE_MARSHALLESE\|LANGUAGE_AZERBAIJANI\|LANGUAGE_TAHITIAN\|JOINMITER\|ATTRNOCLOSE\|REQICON_WARNING\|ERR_NOTPROTRACKER\|LANGUAGE_LAO\|ERR_EMPTYPATH\|ERR_NOCALLBACK\|COUNTRY_UGANDA\|ERR_READFUNC\|IMGFMT_UNKNOWN\|ADF_ANIM\|ERR_LAYERSWITCH\|ERR_RECVCLOSED\|ERR_CTRLSTRUCT\|ERR_TABLEOVERFLOW\|SCROLLBOTTOM\|VSTRIPES\|ERR_VAREXPECTED\|ERR_NOTIGER\|BEEPSYSTEM\|ERR_LOWFREQ\|COUNTFILES\|COUNTRY_MONACO\|BLUE\|ERR_VFONT\|STRUDEL\|REQ_GALLERY\|ERR_NOCOORDCST\|MENU\|HSTRIPES64\|COUNTRY_COCOSISLANDS\|LANGUAGE_SOUTHNDEBELE\|COUNTRY_FALKLANDISLANDS\|COUNTRY_UAE\|LANGUAGE_KANNADA\|ERR_VIDRECMULTI\|FILETYPE_VIDEO\|LANGUAGE_ESTONIAN\|COUNTRY_CAYMANISLANDS\|ERR_BADINTEGER\|MONO16\|COUNTRY_CAMEROON\|COUNTRY_GUAM\|ERR_DISPLAYDESKTOP\|ERR_SETENV\|ERR_INTERNAL\|MASKVISIBLE\|ERR_OPENFONT\|LANGUAGE_WELSH\|ATTRRAWXPOS\|LANGUAGE_THAI\|ATTRHOSTMONITORS\|LANGUAGE_GALICIAN\|COUNTRY_GUATEMALA\|ATTRYPOS\|COUNTRY_UZBEKISTAN\|ERR_ELSEIFAFTERELSE\|MODRCONTROL\|BAUD_4800\|JOYDOWNRIGHT\|COUNTRY_LUXEMBOURG\|COUNTRY_MOZAMBIQUE\|ERR_PAKFORMAT\|LANGUAGE_TAJIK\|LANGUAGE_PANJABI\|ERR_MISSINGFIELD\|PLUGINCAPS_LIBRARY\|ERR_FUNCARGS\|LANGUAGE_MALAY\|COUNTRY_PORTUGAL\|COUNTRY_JAPAN\|ERR_ICONPARMS\|COUNTRY_NEWCALEDONIA\|REMOVELAYER\|MOVEWINDOW\|ATTRFONTASCENDER\|PLUGINCAPS_DIRADAPTER\|ERR_VARLENGTH\|ATTRSIZEABLE\|ERR_SENDUNKNOWN\|MENUITEM_RADIO\|COUNTRY_BELIZE\|ERR_LABELDOUBLE\|QUADRECT\|VBLINDS8\|ERR_UNKNOWNCMD\|SCROLLEAST\|ONBUTTONCLICKALL\|RECTNORTHEAST\|FONTWEIGHT_EXTRABOLD\|COUNTRY_SAINTKITTSANDNEVIS\|ERR_CLOSEDDISPLAY\|PLUGINCAPS_SAVEANIM\|ERR_WINDOW\|LANGUAGE_ZHUANG\|CAPROUND\|ERR_OUTOFRANGE\|REQ_CAMERA\|ERR_WARPOS\|COUNTRY_ELSALVADOR\|ERR_GROUPNAMEUSED\|COUNTRY_GUYANA\|ERR_ALREADYASYNC\|COUNTRY_PALESTINE\|DISPMODE_FAKEFULLSCREEN\|ERR_SYNTAXLEVELS\|ERR_BADPLATFORM\|ERR_VERSION\|ATTRVISIBLE\|HSTRETCHCENTER\|COUNTRY_REUNION\|COUNTRY_INDIA\|STRETCHLEFT\|ERR_ZERODIVISION\|LANGUAGE_NORTHERNSAMI\|SIMPLEBUTTON\|ERR_FINDMENU\|ERR_EMPTYOBJ\|LANGUAGE_BIHARI\|LANGUAGE_LIMBURGAN\|LANGUAGE_BOSNIAN\|ERR_SYSTOOOLD\|ERR_WRITEJPEG\|STOP_1\|COPYFILE_OVERWRITE\|ERR_REVDWORD\|PLUGINCAPS_ANIM\|ERR_ASSERTFAILED\|ERR_BRACEOPEN\|ERR_NEEDMORPHOS2\|BLACK\|LANGUAGE_SWEDISH\|ERR_DBLENCODING\|COPYFILE_STATUS\|ERR_WRONGOPCST\|ERR_BADIP\|ERR_UNKNOWNSEQ\|LANGUAGE_LUXEMBOURGISH\|ERR_WITHWOENDWITH\|ERR_LABINIF\|LANGUAGE_TATAR\|ERR_VIDEOLAYERDRV\|ERR_LEGACYPTMOD\|ERR_SAVEPNG\|NOTRANSPARENCY\|ATTRMASKMODE\|LANGUAGE_VENDA\|ERR_NEWHWPLUGIN\|LANGUAGE_LATIN\|LANGUAGE_EWE\|MENUITEM_TOGGLE\|ERR_BRACKETOPEN\|JOYUP\|COUNTRY_SENEGAL\|LANGUAGE_CHURCHSLAVIC\|ERR_ZLIBIO\|RECTBACKNORTHWEST\|MOVELIST\|ERR_TEXTARG\|ONBUTTONOVER\|VIDDRV_HOLLYWOOD\|IMGFMT_JPEG\|REQ_MULTISELECT\|COUNTRY_NIGERIA\|LANGUAGE_GUARANI\|LANGUAGE_POLISH\|ERR_ICONSTANDARD\|REQ_HIDEICONS\|LANGUAGE_CORSICAN\|DISPMODE_MODEREQUESTER\|ERR_NOABSPATH\|LANGUAGE_GERMAN\|ERR_RANDOMIZE\|ERR_ARGS\|PLUGINCAPS_AUDIOADAPTER\|IMAGETYPE_VECTOR\|LANGUAGE_GREEK\|COUNTRY_HOLYSEE\|COUNTRY_NORTHKOREA\|LANGUAGE_MALAYALAM\|COUNTRY_BOTSWANA\|LANGUAGE_CREE\|ATTRNUMENTRIES\|REQICON_ERROR\|IMGFMT_GIF\|FTPBINARY\|WORD\|VIDDRV_OS\|ATTRDURATION\|LANGUAGE_AKAN\|ERR_FTPERROR\|PLUGINCAPS_VIDEO\|ERR_EXAMINE\|HSTRIPES8\|COUNTRY_OMAN\|CIRCLE\|ERR_BRUSHLINK\|ERR_STREAMASSAMPLE\|ERR_DISPLAYSIZE\|ERR_WRONGFLOAT\|PLUGINCAPS_FILEADAPTER\|ERR_UNSUPPORTEDFEAT\|DISPLAY\|ERR_MUSPAUSED\|INTEGER\|COUNTRY_BOLIVIA\|ERR_RECVTIMEOUT\|ATTRMONITOR\|LANGUAGE_INUKTITUT\|ATTRPAUSED\|LANGUAGE_LITHUANIAN\|DATEYEAR\|JOYUPRIGHT\|ERR_LAYERSOFF\|ERR_EMPTYSCRIPT\|LIGHTUSERDATA\|ERR_FINDTIMER\|ALPHACHANNEL\|LANGUAGE_WALLOON\|ERR_ADFWRONGDISP\|ERR_HTTPERROR\|ERR_REWINDDIR\|ERR_LOCKEDOBJ\|COUNTRY_NEPAL\|HSTRIPES2\|RECTSOUTH\|ERR_UNKPROTOCOL\|COUNTRY_CANADA\|COUNTRY_VENEZUELA\|COUNTRY_MALDIVES\|ERR_SQBRACKETCLOSE\|ERR_HTTPTE\|VSTRIPES2\|COUNTRY_NORWAY\|ERR_FIRSTPREPROC\|SNAPDESKTOP\|LANGUAGE_FINNISH\|COUNTRY_TURKEY\|LANGUAGE_VIETNAMESE\|VBLINDS64\|ERR_FONTFORMAT\|ERR_PIXELRANGE\|LANGUAGE_AVESTAN\|ERR_SYSIMAGE\|BIGSINE\|CLIPBOARD_EMPTY\|ERR_WRONGCLIPREG\|AMIGAICON_NONE\|FONTWEIGHT_EXTRABLACK\|LANGUAGE_IDO\|ATTRFORMAT\|ERR_FUNCJMP\|PARITY_NONE\|ATTRHOSTDEPTH\|ERR_RENDERCALLBACK\|ERR_FINDPORT\|LANGUAGE_NEPALI\|COUNTRY_AMERICANSAMOA\|ERR_MISSINGSEPARTR\|MODRALT\|COUNTRY_BESISLANDS\|LANGUAGE_AVARIC\|ERR_VIDNOTPAUSED\|TOPOUT\|ERR_VALUEEXPECTED\|ERR_WRONGUSAGE\|TURNDOWNLEFT\|ERR_ICONDIMS\|LANGUAGE_HAUSA\|ERR_TRANSBGMOBILE\|SEEK_CURRENT\|ERR_MONITORRANGE\|COUNTRY_FAROEISLANDS\|SHAPE\|COUNTRY_SOLOMONISLANDS\|NAVY\|ERR_PREPROCSYM\|COUNTRY_GEORGIA\|LANGUAGE_OSSETIAN\|ERR_THREAD\|DATA_5\|ERR_INISYNTAX\|ERR_MUSFMTSUPPORT\|LANGUAGE_YIDDISH\|ATTRLAYERS\|SMOOTHOUT\|LANGUAGE_KONGO\|COUNTRY_KYRGYZSTAN\|ATTRDOUBLEBUFFER\|TOP\|ERR_SYSBUTTON\|ERR_DATATYPESAVE\|COUNTRY_LIBYA\|ERR_FUNCWOENDFUNC\|ANIMSTREAM\|ATTRUSERDATA\|LANGUAGE_NORTHNDEBELE\|UDPCLIENT\|ERR_MUSNOTPLYNG\|FILEATTR_READ_OTH\|ERR_EVNTEXPCTED\|ERR_BADDIMENSIONS\|ATTROUTPUTDEVICE\|LANGUAGE_BULGARIAN\|LANGUAGE_SPANISH\|DISPMODE_FULLSCREENSCALE\|LANGUAGE_INTERLINGUE\|FASTSPEED\|ERR_NODISPMODES\|LANGUAGE_CHAMORRO\|ATTRACTIVE\|COUNTRY_TOGO\|INACTIVEWINDOW\|ERR_CREATEEVENT\|COUNTRY_SAUDIARABIA\|FILEATTR_EXECUTE_OTH\|IPAUTO\|SHDWNORTHEAST\|MEMORY\|ERR_XF86VIDMODEEXT\|ARC\|TIMER\|COUNTRY_ICELAND\|FUCHSIA\|NETWORKUDP\|ERR_FINDCLIPREGION\|NETWORKSERVER\|NETWORKCONNECTION\|ATTRFONTNAME\|UDPOBJECT\|ERR_UNTERMINTDSTR\|LANGUAGE_NORWEGIANNYNORSK\|RECTBACKCENTER\|COUNTRY_BANGLADESH\|UPLOADFILE_RESPONSE\|COUNTRY_ITALY\|MASKINVISIBLE\|UPLOADFILE_STATUS\|ERR_FOREVERWOREPEAT\|STRETCHBOTTOM\|STRETCHRIGHT\|MOVEFILE_COPY\|FTPASCII\|RECEIVELINE\|RECEIVEBYTES\|ERR_DRAWPATH\|ATTRFONTAA\|VSTRANGEPUSH\|ERR_BADBASE64\|ERR_NOCLIPREG\|SCROLLNORTHWEST\|RECEIVEALL\|ERR_PLUGINARCH\|DTR_OFF\|HEXNUMERICAL\|FLOW_XON_XOFF\|ERR_LAYERSUPPORT2\|FLOW_HARDWARE\|LANGUAGE_GAELIC\|FLOW_OFF\|COUNTRY_ANTARCTICA\|ERR_REQAUTH\|STOP_2\|SERIF\|ERR_FINDANIM\|PARITY_ODD\|DATA_8\|VSTRIPES32\|COUNTRY_FRANCE\|DATA_6\|BAUD_460800\|HKEY_CURRENT_USER\|COUNTRY_BELARUS\|BAUD_115200\|BAUD_57600\|BAUD_38400\|BAUD_19200\|VSTRIPES4\|COUNTRY_ALANDISLANDS\|LANGUAGE_UKRAINIAN\|ERR_ICONSIZE\|BAUD_9600\|COUNTRY_SYRIA\|COUNTRY_NICARAGUA\|COUNTRY_PERU\|ERR_SIGNAL\|BAUD_2400\|JOYDOWN\|BAUD_300\|FILLRULEEVENODD\|ERR_COMMODITY\|ERR_UNKNOWN\|LANGUAGE_CORNISH\|FONTWEIGHT_LIGHT\|ERR_BAD8SVX\|ONBUTTONOVERALL\|CROSSFADE\|CAPSQUARE\|CAPBUTT\|ERR_STRORNUM\|LANGUAGE_SINDHI\|BEEPQUESTION\|JOINBEVEL\|ERR_PLUGINDOUBLET\|JOINROUND\|LANGUAGE_WESTERNFRISIAN\|ERR_PROTMETATABLE\|LANGUAGE_TURKISH\|BOTTOM\|ZOOMNORTH\|ERR_DATATYPEALPHA\|ERR_FINDUDPOBJECT\|SUN\|TURNDOWNRIGHT\|UDPSERVER\|MODRCOMMAND\|LANGUAGE_SWATI\|COUNTRY_MALAWI\|KEEPASPRAT\|DEFAULTICON\|LANGUAGE_TONGA\|ERR_NUMCALLBACK\|STRING\|ATTRPITCH\|ERR_ELSEWOIF\|COUNTRY_SAMOA\|LANGUAGE_PASHTO\|CARDTOP\|DENSITY_NONE\|ITALIC\|PLUGINCAPS_DISPLAYADAPTER\|FILEATTR_READ_USR\|LANGUAGE_UIGHUR\|ERR_EMPTYTABLE\|COUNTRY_CAPEVERDE\|ERR_FGRABVIDSTATE\|ERR_LOCK2\|LANGUAGE_ICELANDIC\|LIME\|ATTRCURSUBSONG\|CENTER\|ERR_VECGFXPLUGIN\|THREAD\|SLIDERIGHT\|NORMALSPEED\|SELMODE_LAYERS\|SLIDELEFT\|HLOWFLIPCOIN\|HFLIPCOIN\|VLOWFLIPCOIN\|ERR_INVCAPIDX\|VFLIPCOIN\|ASYNCDRAW\|ERR_INCOMPATBRUSH\|RECTBACKWEST\|FILEATTR_WRITE_USR\|ATTRONSCREEN\|CRUSHRIGHT\|LANGUAGE_BRETON\|ERR_REPEATWOUNTIL\|ERR_NOLOOP\|ATTRDISPLAY\|ERR_FILENOTFOUND\|ATTRDENSITY\|ERR_GETMONITORINFO\|ERR_POINTERFORMAT\|ZOOMIN\|PIXELZOOM2\|HSTRANGEPUSH\|FILEATTR_SYSTEM\|ERR_COLORSPACE\|LANGUAGE_ZULU\|ATTRHOSTWIDTH\|LANGUAGE_SANGO\|ERR_SOCKET\|STAR\|ERR_FINDBUTTON\|CLOCKWIPE\|FILLCOLOR\|USELAYERPOSITION\|LANGUAGE_BELARUSIAN\|COUNTRY_MICRONESIA\|COPYFILE_UNPROTECT\|DISSOLVE\|UNDERLINED\|WATER4\|COUNTRY_BURKINAFASO\|LANGUAGE_LINGALA\|WATER3\|MASK\|ATTRNOMODESWITCH\|ERR_SETFILEATTR\|LANGUAGE_KASHMIRI\|FILEATTR_HIDDEN\|DELETEFILE_UNPROTECT\|COUNTRY_CUBA\|HKEY_USERS\|ATTRKEYBOARD\|COUNTBOTH\|ROLLLEFT\|HSTRIPES\|CRUSHBOTTOM\|RECTBACKSOUTHWEST\|LANGUAGE_TSONGA\|RECTBACKSOUTH\|ERR_DIFFDEPTH\|RECTBACKSOUTHEAST\|RECTBACKEAST\|ERR_TRIALLIMIT\|ERR_FINDMOVE\|ERR_SCREEN\|ERR_FINDPLUGIN\|LANGUAGE_ITALIAN\|ERR_MULTIBGPIC\|ERR_BADLAYERTYPE\|JUSTIFIED\|ERR_ADDAPPWIN\|LANGUAGE_NAURU\|ERR_UNKNOWNFILTER\|RECTBACKNORTHEAST\|JOYDOWNLEFT\|RECTBACKNORTH\|WALLPAPERTOP\|ROLLTOP\|ERR_NOFALLTHROUGH\|BRUSH_VS_BOX\|USERDATA\|RANDOMPARAMETER\|IMAGETYPE_RASTER\|NATIVE\|DIAGONAL\|COUNTRY_SUDAN\|PUZZLE\|ERR_ENDIFWOIF\|ERR_MEM\|ERR_OPENSERIAL\|PUSHRIGHT\|NEXTFRAME\|DOSTYPE_FILE\|PUSHLEFT\|ERR_SORTFUNC\|ENCODING_ISO8859_1\|VOPENGATE\|ERR_XFIXES\|HCLOSEGATE\|ZOOMSOUTHWEST\|HOPENGATE\|VFLOWRIGHT\|ERR_BADBYTECODE\|VFLOWLEFT\|HFLOWBOTTOM\|HFLOWTOP\|ERR_DLOPEN\|ZOOMNORTHWEST\|ZOOMWEST\|ERR_NODOUBLEBUFFER\|ZOOMSOUTH\|ZOOMEAST\|ZOOMNORTHEAST\|COUNTRY_UK\|ZOOMCENTER\|ERR_FINDMEMBLK\|ERR_BGPICBUTTON\|VSTRETCHCENTER\|ERR_FREEABGPIC\|STRETCHTOP\|SCROLLNORTHEAST\|ATTRFUNCTION\|ERR_TABLEINDEX\|ERR_MULDISMOBILE\|COUNTRY_INDONESIA\|SCROLLSOUTHEAST\|NOCOLOR\|ERR_SELECTBGPIC2\|JOYUPLEFT\|MASKAND\|CLIPBOARD_SOUND\|SCROLLSOUTH\|SCROLLNORTH\|ERR_NOMENU\|ERR_NOANMLAYER\|SCROLLWEST\|ERR_CHANNELRANGE\|ERR_STRTABLEARG\|SCROLLRIGHT\|SCROLLLEFT\|RECTNORTHWEST\|ERR_BEGINREFRESH\|COUNTRY_SPAIN\|RECTSOUTHWEST\|COUNTRY_PHILIPPINES\|RECTSOUTHEAST\|ERR_LOADSOUND\|RECTEAST\|RECTNORTH\|LANGUAGE_ARABIC\|COUNTRY_JORDAN\|RECTCENTER\|ERR_TRANSBRUSH\|BLEND\|ERR_PLUGINVER\|RANDOMEFFECT\|FILLRULEWINDING\|ANMFMT_GIF\|VLINES\|ERR_LABINFOR\|DISPMODE_SYSTEMSCALE\|VLINES2\|ERR_NOARGBVISUAL\|COUNTRY_YEMEN\|HSTRIPES32\|ERR_SAVESAMPLE\|ERR_CHRCSTEMPTY\|LANGUAGE_CATALAN\|ERR_SEEK\|SANS\|LANGUAGE_JAVANESE\|ATTRLAYERID\|ERR_BRACECLOSE\|ERR_CONSOLEARG\|ATTRXPOS\|PLUGINCAPS_REQUESTERADAPTER\|REVEALRIGHT\|ERR_FINDFONT2\|REVEALLEFT\|LANGUAGE_DUTCH\|ERR_CHRCSTLEN\|HCLOSECURTAIN\|ERR_SELECTBGPIC\|ERR_MAGICKEY\|SELMODE_COMBO\|HOPENCURTAIN\|ERR_ZLIBSTREAM\|CARDBOTTOM\|VBLINDS16\|HBLINDS128\|HBLINDS64\|DURATION_SHORT\|COUNTRY_GREECE\|COUNTRY_MARSHALLISLANDS\|LANGUAGE_KAZAKH\|ERR_BADCONSTANT\|MODLCONTROL\|HBLINDS16\|COUNTRY_NAURU\|HBLINDS8\|SILVER\|DATA_7\|DAMPED\|ATTRORIENTATION\|COUNTRY_UNKNOWN\|COUNTRY_CZECHREPUBLIC\|LANGUAGE_INDONESIAN\|LANGUAGE_NAVAJO\|ERR_NOBLOCKBREAK\|ERR_8OR16BITONLY\|BOLD\|VSTRIPES8\|ERR_FUNCEXPECTED\|COUNTRY_AZERBAIJAN\|COUNTRY_KAZAKHSTAN\|ERR_FINDFONT\|QUARTERS\|WATER1\|HSTRIPES4\|COUNTRY_BRUNEI\|VOPENCURTAIN\|MONO8\|ERR_ICONENTRY\|PLUGINCAPS_VECTOR\|ATTRFIXED\|ALPHABETICAL\|VANILLACOPY\|MASKOR\|MASKXOR\|ERR_STAT\|SMPFMT_WAVE\|HSPLIT\|LANGUAGE_ABKHAZIAN\|COUNTRY_GABON\|ERR_ADDSYSEVENT\|ERR_INTEXPECTED\|COUNTRY_ECUADOR\|STEREO16\|ERR_UPDATEICON\|ERR_LABELDECLA\|MENUITEM_DISABLED\|ERR_FILEEXIST\|LANGUAGE_DIVEHI\|ATTRHOSTTASKBAR\|ERR_FINDOBJECTDATA\|ERR_BADENCODING\|ERR_GTK\|DENSITY_MEDIUM\|DENSITY_LOW\|VSPLIT\|ORIENTATION_LANDSCAPEREV\|TEAL\|ERR_COMMENTSTRUCT\|ORIENTATION_LANDSCAPE\|ERR_FT2\|ORIENTATION_PORTRAITREV\|DATELOCALNATIVE\|ERR_MAXLOCALS\|POLYGON\|BRUSHPART\|COUNTRY_CHINA\|ORIENTATION_NONE\|ERR_FIELDINIT\|CLIPREGION\|ERR_DELETEFILE\|LANGUAGE_SLOVENIAN\|SCALEMODE_LAYER\|MILLISECONDS\|COUNTRY_MALI\|SCALEMODE_AUTO\|LAYERBUTTON\|ERR_LOADICON\|COUNTRY_AUSTRIA\|ERR_NOFUNCTION\|COUNTRY_MALTA\|HLINES\|ERR_NUMSTRCMP\|ERR_SQBRACKETOPEN\|ERR_MODIFYABG\|LANGUAGE_GEORGIAN\|DISPMODE_ASK\|ERR_READRANGE\|ERR_UNTILWOREPEAT\|DISPMODE_WINDOWED\|FONTWEIGHT_REGULAR\|LANGUAGE_QUECHUA\|DISPSTATE_MINIMIZED\|DISPSTATE_CLOSED\|DISPSTATE_OPEN\|ERR_FREECURPOINTER\|DEINTERLACE_DOUBLE\|DEINTERLACE_DEFAULT\|ENCODING_AMIGA\|ENCODING_UTF8\|ENCODING_RAW\|FONTSLANT_OBLIQUE\|ERR_STRTOOSHORT\|ANMFMT_MJPEG\|ERR_CLIPWRITE\|FONTSLANT_ROMAN\|PERMREQ_READEXTERNAL\|TURNDOWNBOTTOM\|FONTWEIGHT_HEAVY\|ATTRPLAYING\|FONTWEIGHT_ULTRABOLD\|LANGUAGE_RUSSIAN\|FONTWEIGHT_BOLD\|FONTWEIGHT_DEMIBOLD\|REQICON_QUESTION\|COUNTRY_TANZANIA\|COUNTRY_SAINTBARTHELEMY\|DISPMODE_FULLSCREEN\|FONTWEIGHT_NORMAL\|ERR_GUIGFX\|ERR_LOADFRAME\|HIDELAYER\|COUNTRY_SAOTOMEANDPRINCIPE\|FONTWEIGHT_ULTRALIGHT\|ERR_GRABSCREEN\|SPIRAL\|FONTWEIGHT_THIN\|FONTENGINE_INBUILT\|COUNTRY_TIMOR\|ATTRDRIVER\|MONOSPACE\|ERR_SYNTAXERROR\|PRGTYPE_APPLET\|COUNTRY_URUGUAY\|PARITY_EVEN\|COUNTRY_ERITREA\|MODE_READ\|LANGUAGE_CENTRALKHMER\|ERR_SHORTIF\|BITMAP_DEFAULT\|ERR_ESCREPLACE\|ERR_FINDMUSIC\|ERR_MEMCODE\|ATTRMENU\|ERR_DISPMINIMIZED\|JOYNODIR\|ATTRMODE\|ERR_FINDDISPLAY\|ERR_BADWAVE\|LANGUAGE_PERSIAN\|SHDWSOUTHWEST\|ERR_ADDTASK\|ERR_NAMEUSED\|ERR_CLIPREAD\|LANGUAGE_TSWANA\|ATTRBORDERBOTTOM\|SPRITE\|ERR_DOUBLEMENU\|ERR_TOKENEXPECTED\|EDGE\|FILLTEXTURE\|IO_BUFFERED\|ERR_JAVAMETHOD\|GRAY\|NUMERICAL\|ERR_VFONTTYPE\|COUNTRY_LIECHTENSTEIN\|COUNTRY_GHANA\|ERR_LAYERSON\|LANGUAGE_BASQUE\|SERIAL\|ALL\|ERR_SELECTMASK\|COUNTRY_CYPRUS\|LANGUAGE_MAORI\|ERR_DBTRANSWIN\|ATTRID\|ERR_NUMBEREXPECTED\|ANTIALIAS\|SCROLLSOUTHWEST\|ERR_PLUGINSUPPORT\|ERR_WRONGID\|COUNTRY_SRILANKA\|ERR_SENDTIMEOUT\|ERR_EQUALEXPECTED\|ERR_SERIALIO\|COUNTRY_LESOTHO\|ERR_CREATEDOCKY\|ERR_INITSERIAL\|COUNTRY_SLOVENIA\|COUNTRY_AFGHANISTAN\|ERR_FUNCDECLA\|HW_REVISION\|ERR_MALFORMPAT2\|ERR_RENDERER\|COUNTRY_KUWAIT\|ERR_SURFACE\|ERR_FINDARRAY\|ERR_MULTIDISPLAYS\|ERR_TEXTSYNTAX\|ERR_ICONVECTOR\|ERR_BRACKETCLOSE\|SELMODE_NORMAL\|SCALEMODE_NONE\|LANGUAGE_KINYARWANDA\|ERR_CORETEXT\|COUNTRY_MONTENEGRO\|ERR_VIDEOINIT\|LANGUAGE_LUBAKATANGA\|ERR_TRIALINCLUDE\|ERR_READFILE\|ERR_TRIALSAVEVID\|ERR_ATSUI\|ERR_TRIALCOMPILE\|ERR_RADIOTOGGLEMENU\|LANGUAGE_MALAGASY\|COUNTRY_ALGERIA\|ERR_TABEXPECTED3\|LANGUAGE_TIBETAN\|ERR_ELSETWICE\|ERR_FINDSELECTOR\|ERR_FRAMEGRABBER\|ERR_COREFOUNDATION\|COUNTRY_HONDURAS\|ERR_FINDICON\|FILEATTR_READONLY\|ERR_INVALIDUTF8ARG\|ERR_DIFFENCODING\|COUNTRY_BARBADOS\|ERR_INVALIDUTF8\|ERR_INVREPLACE\|ERR_COMPLEXPATTERN\|ERR_AMIGAGUIDE\|LANGUAGE_AFRIKAANS\|ERR_LINKPLUGIN\|ERR_STACK\|MASKVANILLACOPY\|MODE_READWRITE\|ERR_FILESIZE\|ERR_MUSPLAYING\|ERR_VIDNOTPLAYING\|COUNTRY_DJIBOUTI\|ERR_ALLOCMASK\|ERR_ALLOCALPHA\|ERR_KEYFILE\|ERR_VISUALINFO\|ERR_FINDCLIENT\|ERR_SENDDATA\|LANGUAGE_NDONGA\|COUNTRY_DOMINICANREPUBLIC\|ERR_UNEXPECTEDSYM\|ERR_FULLSCREEN\|ERR_SCREENMODE\|ATTRBORDERLEFT\|COUNTRY_SWEDEN\|ERR_TFIMAGE\|ERR_LOCKBMAP\|ERR_FINDMONITOR\|COUNTRY_ROMANIA\|ATTRCURSORX\|ERR_NOCONTEXTMENU\|ERR_ACCELERATOR\|ERR_VECTORBRUSH\|FILEATTR_ARCHIVE\|ERR_ENDWITHWOWITH\|ERR_CONTEXTMENU\|SHDWNORTH\|SHDWNORTHWEST\|ERR_EMPTYMENUTREE\|ERR_FINDMENUITEM\|COUNTRY_RUSSIA\|ERR_DEFFONT\|ERR_CREATEMENU\|ANIM\|COUNTRY_ETHIOPIA\|ERR_MENUCOMPLEXITY\|MODLALT\|ERR_WRONGCMDRECVIDEO\|ERR_REGISTRYWRITE\|HIDEBRUSH\|ERR_SENDMESSAGE\|COUNTRY_LIBERIA\|ERR_FINDAPPLICATION\|ERR_NEEDAPPLICATION\|ERR_COORDSRANGE\|JOYRIGHT\|ERR_UNKNOWNATTR\|ERR_APPLICATION\|COUNTRY_FIJI\|ERR_SEEKFILE\|ERR_TABLEDECLA\|ERR_FINDDIR\|AMIGAICON_DRAWER\|COUNTRY_COMOROS\|ERR_MODIFYSPRITE\|STEREO8\|ERR_DDMOBILE\|ERR_HWBMCLOSEDISP\|ERR_HWDBFREEDISP\|BOTTOMOUT\|ERR_FINDBGPIC\|ERR_RETWOGOSUB\|ERR_BITMAP\|ERR_REQUIREPLUGIN\|ERR_DISPLAYADAPTERSUPPORT\|ERR_SOCKNAME\|RED\|ERR_SCRPIXFMT\|PI\|ERR_FINDSPRITE\|LANGUAGE_OJIBWA\|ERR_REQUIREFIELD\|COUNTRY_TAJIKISTAN\|ERR_WRITEONLY\|ERR_VIDLAYERFUNC\|ERR_VIDSTOPPED\|ERR_VIDEOLAYER\|ERR_CMDASVAR\|ERR_REGCLASS\|AMIGAICON_TOOL\|RECTWEST\|ERR_FINDACTIVITY\|ERR_JAVA\|ERR_UDEXPECTED\|LANGUAGE_CHICHEWA\|ERR_NOMIMEVIEWER\|ACTIVEWINDOW\|FILEATTR_SCRIPT\|ERR_GETSHORTCUT\|IMGFMT_PNG\|LAYER_VS_BOX\|LANGUAGE_MALTESE\|ATTRXSERVER\|ERR_CREATEICON\|LANGUAGE_DANISH\|ERR_SATFREEDISP\|ERR_PERCENTFORMATSTR\|COUNTRY_BELGIUM\|ERR_VIDPLAYING\|ERR_VIDPAUSED\|SECONDS\|ERR_SAVERALPHA\|ATTRMAXWIDTH\|ERR_HWBRUSHFUNC\|COUNTRY_ARGENTINA\|LANGUAGE_TIGRINYA\|SLOWSPEED\|LANGUAGE_NORWEGIAN\|ERR_HWBRUSH\|COUNTRY_BENIN\|DENSITY_HIGH\|ERR_PLUGINSYMBOL\|BARS\|ERR_UNKNOWNSMPOUT\|ERR_SAVEANIM\|ERR_FINDPOINTER\|ERR_UNKNOWNANMOUT\|LANGUAGE_FRENCH\|ERR_SAVEIMAGE\|ATTRSCALEMODE\|ERR_UNKNOWNIMGOUT\|CONICAL\|ERR_NOFMBHANDLER\|ERR_NOMUSICCB\|FILETYPE_ANIM\|LANGUAGE_SOMALI\|ATTRFONTSIZE\|COUNTRY_PARAGUAY\|COUNTRY_TURKMENISTAN\|ERR_SEEKFORMAT\|ERR_DBVIDEOLAYER\|LANGUAGE_IRISH\|COUNTRY_MAYOTTE\|ERR_BADCALLBACKRET\|YELLOW\|ERR_MODIFYPSMP\|DELETEFILE_STATUS\|ERR_DSOUNDNOTIPOS\|ERR_READONLY\|ERR_MOBILE\|ERR_MONITORFULLSCREEN\|ERR_WRONGDTYPE\|COUNTRY_CHAD\|LINEAR\|ONKEYDOWNALL\|ERR_INVNEXTKEY\|WHITE\|ATTRSIZE\|ATTRMAXHEIGHT\|ERR_FINDSERIAL\|LITTLEENDIAN\|ERR_NOCOLON\|ERR_LOADPLUGIN\|ERR_VIDEOTRANS\|COUNTRY_TUNISIA\|ERR_WRITE\|COUNTRY_PALAU\|ERR_SELECTBG\|ERR_VIDEOFRAME\|LANGUAGE_BURMESE\|SWISS\|COUNTRY_GREENLAND\|ERR_VIDATTACHED\|PLOT\|ERR_SOCKOPT\|ERR_QUICKTIME\|LANGUAGE_ARMENIAN\|REQICON_INFORMATION\|ERR_OLDAPPLET\|ERR_LOADVIDEO\|ERR_MOVEFILE\|ERR_ENDBLKWOBLK\|ERR_NOTENOUGHPIXELS\|ATTRSCALEHEIGHT\|LANGUAGE_SAMOAN\|VCLOSECURTAIN\|COUNTRY_IRELAND\|ERR_OPENAUDIO\|ERR_NOFILTERNAME\|ATTRMAXIMIZED\|ADF_FX\|COUNTRY_SAINTVINCENT\|RECEIVEDATA_PACKET\|COUNTRY_ARUBA\|ERR_UNSETENV\|ERR_ALSAPCM\|ERR_XCURSOR\|LANGUAGE_ALBANIAN\|HLINES2\|LANGUAGE_KURDISH\|ERR_CREATEGC\|ERR_TOOSMALL2\|COUNTRY_TUVALU\|BIGENDIAN\|LANGUAGE_GREENLANDIC\|ERR_UPLOADFORBIDDEN\|ERR_DINPUT\|TICKS\|ERR_NOCOMPRESS\|ERR_BADURL\|ERR_NOLOOPCONT\|ERR_HOSTNAME\|ERR_PEERNAME\|DOUBLE\|ERR_FINDSERVER\|ERR_OPENSOCKET\|ATTRHOSTSCALE\|ERR_XDISPLAY\|ERR_TFVBRUSH\|ERR_TOOMANYARGS\|DATELOCAL\|ERR_DEMO\|ERR_NOJOYATPORT\|COUNTRY_USA\|ERR_RENDERADLAYER\|ERR_OPENLIB\|COUNTRY_EGYPT\|DTR_ON\|FADE\|COUNTRY_MARTINIQUE\|HKEY_CLASSES_ROOT\|ERR_NOACCESS\|ERR_TFVBGPICBRUSH\|ERR_CLOSEFILE\|ERR_BGPICTYPE\|LANGUAGE_AFAR\|ERR_DEMO2\|VCLOSEGATE\|ERR_LINKFONT\|ERR_FTPAUTH\|ERR_WRONGSPRITESIZE\|ERR_SPRITELINK\|ERR_ADFFREEDISP\|ERR_MONITORDIR\|ERR_REGISTRYREAD\|ERR_REMADLAYER\|ERR_FINDINTERVAL\|ATTRSTATE\|ERR_FINDLAYER\|FONTSLANT_ITALIC\|ERR_SCALEBGPIC\|SHDWSOUTHEAST\|ERR_CLIPOPEN\|ERR_BRUSHTYPE\|ERR_CLIPFORMAT\|ERR_LOADPICTURE2\|ERR_OPENSOUND2\|ATTRZPOS\|ERR_OPENANIM2\|ERR_NEEDOS41\|LANGUAGE_JAPANESE\|ERR_TABEXPECTED\|ATTRTEXT\|ERR_FINDBRUSH\|COUNTRY_BRAZIL\|COUNTRY_SINGAPORE\|LANGUAGE_SANSKRIT\|ERR_ADDAPPICON\|LOWERCURVE\|ERR_FREEADISPLAY\|ERR_ARRAYDECLA\|ERR_SMODEALPHA\|ERR_FINDANIMSTREAM\|ATTRSCALEWIDTH\|ERR_MODIFYAANIM\|CLIPBOARD_UNKNOWN\|ERR_FONTPATH\|COUNTRY_BAHAMAS\|ERR_NEGCOORDS\|ERR_JOYSTICK\|ERR_CASECST\|LANGUAGE_TAGALOG\|LANGUAGE_KANURI\|COUNTRY_PITCAIRN\|NONE\|ERR_WRONGVSTRATEGY\|ERR_APPLET\|ERR_VIDEOSTRATEGY\|ERR_READTABLE\|COUNTRY_SWAZILAND\|BEEPWARNING\|BOUNCE\|LANGUAGE_SLOVAK\|LANGUAGE_SERBIAN\|ERR_FINDASYNCDRAW\|ERR_SPRITEONSCREEN2\|ERR_NOHWFUNC\|ERR_POINTERIMG\|ERR_MUSNOTPLYNG2\|ERR_NODISLAYERS\|ERR_NUMCONCAT\|COUNTRY_PUERTORICO\|ERR_DDAUTOSCALE\|ERR_DIRECTSHOW\|ATTRALPHAINTENSITY\|FILLNONE\|SHDWSOUTH\|ERR_ZLIBVERSION\|IMGFMT_BMP\|LANGUAGE_BENGALI\|COUNTRY_HAITI\|COUNTRY_GRENADA\|VBLINDS128\|ERR_TABCALLBACK\|FILETYPE_IMAGE\|BOOLEAN\|ERR_TEXTCONVERT\|ERR_MSGPORT\|ERR_LOADPICTURE\|VSTRIPES16\|ERR_SEMAPHORE\|ERR_MASKNALPHA\|ERR_TIMER\|PRINT\|ERR_HEXPOINT\|ERR_NODIRPATTERN\|ONBUTTONRIGHTCLICKALL\|ERR_NOTXTLAYER\|ERR_STRCALLBACK\|ERR_CONCAT\|ERR_COMPLEXWHILE\|REQ_NORMAL\|ERR_NOCHANNEL\|FONTWEIGHT_EXTRALIGHT\|COUNTRY_FRENCHPOLYNESIA\|FILEATTR_PURE\|ERR_SETFILEDATE\|HSTRIPES16\|COUNTRY_SEYCHELLES\|ERR_DEMO3\|COUNTRY_HONGKONG\|FASTMEMORY\|ERR_KEYNOTFOUND\|FONTWEIGHT_BOOK\|ERR_DATATYPESAVE2\|ERR_ZLIBDATA\|TEXTOUT\|ATTRCOUNT\|SHDWWEST\|ERR_RENAME\|ERR_CMPUNSUPPORTED\|COUNTRY_MAURITIUS\|ERR_DSOUNDPLAY\|ERR_UNIMPLCMD\|AMIGAICON_DISK\|ERR_NOREXX\|COUNTRY_LAOS\|LANGUAGE_ENGLISH\|ERR_ANTIALIAS\|ERR_MENUATTACHED\|COUNTRY_MAURITANIA\|LANGUAGE_TAMIL\|ERR_UNKTEXTFMT\|ERR_NOTADIR\|ERR_REQUIRETAGFMT\|COUNTRY_CROATIA\|ERR_CACHEERROR\|ERR_TASKSETUP\|LANGUAGE_YORUBA\|ERR_CSTDOUBLEDEF\|NATIVEENDIAN\|ATTRNUMFRAMES\|ATTRSTANDARD\|LANGUAGE_SICHUANYI\|LANGUAGE_WOLOF\|LANGUAGE_SHONA\|ONKEYDOWN\|VOID\|COUNTRY_NIUE\|ERR_UNKNOWNMUSFMT\|ATTRSPRITES\|ERR_MIXMUSMOD\|ERR_SEEKRANGE\|COUNTRY_NEWZEALAND\|LANGUAGE_PALI\|FILLGRADIENT\|ERR_NOKEYWORDS\|ERR_UNKNOWNTAG\|COUNTRY_MYANMAR\|STDPTR_BUSY\|RIGHTOUT\|COUNTRY_JERSEY\|MOVEFILE_UNPROTECT\|IPUNKNOWN\|ERR_FUNCREMOVED\|MENUITEM_SELECTED\|COUNTRY_NORFOLKISLAND\|ERR_OPENANIM\|CHIPMEMORY\|COUNTRY_MADAGASCAR\|ERR_NUMTABLEARG\|ATTRCLIPREGION\|LANGUAGE_SUNDANESE\|ERR_TOOMANYCAPTURES\|ERR_NOALPHA\|ERR_BADSIGNATURE\|ERR_BADUPVALUES\|FILEATTR_DELETE_USR\|COUNTRY_LATVIA\|REQ_SAVEMODE\|ERR_VMMISMATCH\|ERR_NUMEXPECTED\|ERR_UNEXPECTEDEOF\|ERR_UNKNOWNCOND\|ERR_STRINGEXPECTED\|DURATION_LONG\|LANGUAGE_GANDA\|PRGTYPE_PROGRAM\|COUNTRY_CENTRALAFRICANREPUBLIC\|CLIPBOARD_IMAGE\|ERR_LOCK\|ERR_INVINSERT\|ERR_LAYERSUPPORT\|LANGUAGE_ASSAMESE\|COUNTRY_ANTIGUAANDBARBUDA\|FLOAT\|COUNTRY_RWANDA\|FILEATTR_READ_GRP\|LANGUAGE_TELUGU\|COUNTRY_GUINEABISSAU\|JOYLEFT\|SHDWEAST\|BGPIC\|ERR_VARSYNTAX\|ATTRNUMSUBSONGS\|PLUGINCAPS_TIMERADAPTER\|ERR_UNMPARENTHESES\|ERR_ERRORCALLED\|ERR_PERCENTFORMAT\|COUNTRY_GERMANY\|LANGUAGE_BISLAMA\|UNDO\|ERR_FINDFILE\|LANGUAGE_URDU\|PLUGINCAPS_REQUIRE\|SINE\|ERR_FINDTEXTOBJECT\|LANGUAGE_AMHARIC\|REVEALTOP\|COUNTRY_SAINTLUCIA\|ERR_DIRLOCK\|MODE_WRITE\|LANGUAGE_TURKMEN\|ERR_VIDRECTRANS\|LINE\|COUNTRY_NAMIBIA\|FILETYPEFLAGS_SAVE\|LANGUAGE_SARDINIAN\|ERR_NOMASKBRUSH\|ERR_MUSNOTPAUSED\|IPV4\|ERR_UNKNUMFMT\|ERR_DOUBLEDECLA\|ERR_INVPATCAP\|LANGUAGE_HUNGARIAN\|COUNTRY_MONTSERRAT\|LANGUAGE_FAROESE\|LANGUAGE_DZONGKHA\|ERR_LOOPRANGE\|ATTRHASALPHA\|ERR_ENDSWCHWOSWCH\|POINTER\|COUNTRY_BOUVETISLAND\|BYTE\|FILE\|ATTRRAWYPOS\|FONTWEIGHT_ULTRABLACK\|ERR_EXETYPE\|ERR_UNBALANCEDPAT\|COUNTRY_NIGER\|EOF\|ERR_LABMAINBLK\|RIGHT\|LANGUAGE_KUANYAMA\|KEEPPOSITION\|ERR_BRUSHSIZE\|LANGUAGE_KIKUYU\|CLOSEWINDOW\|ERR_CREATEPORT\|ZOOMOUT\|ERR_MODIFYABR\|IMGFMT_TIFF\|ERR_MISSINGPARAMTR\|NORMAL\|STDPTR_CUSTOM\|ERR_MEMRANGE\|LEFTOUT\|LANGUAGE_CHECHEN\|COUNTRY_BERMUDA\|MOVEFILE_DELETE\|SPRITE_VS_BOX\|LANGUAGE_BASHKIR\|ERR_SPRITEONSCREEN\|ERR_SETADAPTER\|LANGUAGE_INUPIAQ\|ALPHANUMERICAL\|COUNTRY_MACEDONIA\|COUNTRY_KENYA\|COUNTRY_PAKISTAN\|BGPICPART\|IO_UNBUFFERED\|FILETYPEFLAGS_ALPHA\|COUNTRY_ZAMBIA\|ERR_STREXPECTED\|ATTRTITLE\|UPPERCURVE\|ERR_MEMCST\|ERR_SELECTBRUSH\|ERR_NOTRANSPARENCY\|COUNTRY_SWITZERLAND\|ERR_INTERNAL1\|LANGUAGE_SINHALA\|ERR_UNKNOWNSEC\|ATTRCANSEEK\|COUNTRY_ISRAEL\|COUNTRY_SANMARINO\|VECTORPATH\|ERR_PLUGINTYPE\|ERR_CONFIG2\|ERR_SWCHWOENDSWCH\|DOUBLEBUFFER\|ERR_TABLEORNIL\|DOSTYPE_DIRECTORY\|MAROON\|ATTRBORDERTOP\|SAMPLE\|ATTRBGPIC\|PLUGINCAPS_SAVESAMPLE\|ERR_SCREENSIZE\|AMIGAICON_PROJECT\|SNAPDISPLAY\|COUNTRY_GUINEA\|SHADOW\|ERR_MAXUPVALS\|ORIENTATION_PORTRAIT\|COUNTRY_CAMBODIA\|ERR_TABEXPECTED2\|ERR_NOCHAR\|ERR_DSOUNDNOTIFY\|ERR_UNFINISHEDCAPTURE\|ATTRBITRATE\|ERR_NOCOMMA\|ERR_IFWOENDIF\|STDPTR_SYSTEM\|LANGUAGE_IGBO\|HKEY_CURRENT_CONFIG\|LANGUAGE_INTERLINGUA\|AMIGAICON_SHOW\|IPV6\|ERR_CONFIG\|ERR_COMPLEXEXPR\|ERR_FINDSAMPLE\|MODLSHIFT\|ERR_ENDFUNCWOFUNC\|PLUGINCAPS_IMAGE\|UDPNONE\|LANGUAGE_OROMO\|ERR_NEEDCOMPOSITE\|ATTRBORDERLESS\|ERR_SETFILECOMMENT\|LANGUAGE_MARATHI\|ERR_LFSYNTAX\|COUNTRY_BULGARIA\|ERR_FINDTIMEOUT\|ERR_RECVUNKNOWN\|ERR_RENDER\|ERR_CREATEDIR\|WATER2\|SLIDETOP\|ERR_PALSCREEN\|CRUSHLEFT\|COUNTRY_UKRAINE\|RADIAL\|ERR_WRONGOP\|COUNTRY_CURACAO\|ERR_NOCONSTANTS\|COUNTRY_IRAN\|FONTWEIGHT_BLACK\|REVEALBOTTOM\|ERR_PLAYERCOMP\|COUNTRY_PANAMA\|COUNTRY_ARMENIA\|INSERTBRUSH\|LANGUAGE_KOMI\|DATEDAY\|TABLE\|ATTRHARDWARE\|ONBUTTONRIGHTCLICK\|AMIGAICON_HIDE\|ERR_OPENSOUND\|SIZEWINDOW\|ATTRHOSTSCALEX\|FONTENGINE_NATIVE\|COUNTRY_IRAQ\|COUNTRY_ISLEOFMAN\|NUMBER\|HOLLYWOOD\|COUNTRY_SERBIA\|AMIGAICON_SETTITLE\|ERR_NEXTWOFOR\|FUNCTION\|ERR_GETDISKOBJ\|MODRSHIFT\|ERR_WRITEFILE\|LANGUAGE_ARAGONESE\|FILEATTR_WRITE_GRP\|LANGUAGE_UNKNOWN\|ERR_KICKSTART\|ERR_KEYWORD\|PLUGINCAPS_SAVEIMAGE\|FREESPACE\|COUNTRY_BHUTAN\|ERR_AUDIOCONVERTER\|TIMEOUT\|PERMREQ_WRITEEXTERNAL\|ERR_FINDCST\|ATTRTYPE\|ATTRHOSTTITLEBARHEIGHT\|ERR_TEXTURE\|OLIVE\|ERR_SATELLITE\|USEDSPACE\|LANGUAGE_HAITIAN\|COUNTRY_SOUTHSUDAN\|ERR_LABINWHILE\|COUNTRY_BAHRAIN\|ERR_WHILEWOWEND\|LANGUAGE_CROATIAN\|LANGUAGE_TWI\|ERR_NOAPPLET\|COUNTRY_QATAR\|ONBUTTONCLICK\|PUSHTOP\|ERR_READ\|BOX\|ADF_MOVEOBJECT\|COUNTRY_COSTARICA\|COUNTRY_POLAND\|ERR_NONE\|INTERVAL\|SLIDEBOTTOM\|HBLINDS32\|LANGUAGE_CHUVASH\|VBLINDS32\|BEEPINFORMATION\|COUNTRY_NETHERLANDS\|BEEPERROR\|FILETYPEFLAGS_FPS\|ATTRADAPTER\|COUNTRY_TONGA\|LANGUAGE_HINDI\|ERR_UNKNOWNMIMETYPE\|ERR_ANIMFRAME\|ERR_NOSPRITES\|IMGFMT_NATIVE\|LAYER\|MUSIC\|COUNTRY_LITHUANIA\|PLUGINCAPS_SOUND\|ELLIPSE\|COUNTRY_VIETNAM\|LANGUAGE_NORWEGIANBOKMAL\|ERR_IMAGEERROR\|REQICON_NONE\|FONTWEIGHT_SEMIBOLD\|SNAPWINDOW\|ATTRLOADER\|ATTRCURFRAME\|LANGUAGE_PORTUGUESE\|NEXTFRAME2\|COUNTRY_SURINAME\|ATTRXDPI\|LANGUAGE_CHINESE\|DATEMONTH\|ATTRMARGINLEFT\|COUNTRY_SOMALIA\|ERR_CONITEMS\|LANGUAGE_FIJIAN\|COUNTRY_SIERRALEONE\|LANGUAGE_OCCITAN\|LANGUAGE_SOUTHERNSOTHO\|COUNTRY_DOMINICA\|LANGUAGE_HERERO\|LANGUAGE_SWAHILI\|COUNTRY_PAPUANEWGUINEA\|COUNTRY_COOKISLANDS\|ATTRFONTDESCENDER\|COUNTRY_HUNGARY\|ERR_MODIFYSPRITE2\|DEFAULTSPEED\|TRUETYPE_DEFAULT\|LANGUAGE_AYMARA\|COUNTRY_MONGOLIA\|ATTRCURSORY\|COUNTRY_MOLDOVA\|COUNTRY_MEXICO\|ERR_PUBSCREEN\|ERR_LAYERRANGE\|ATTRLAYERSON\|DOWNLOADFILE_STATUS\|NIL\|COUNTRY_MALAYSIA\|LONG\|COUNTRY_MACAO\|LANGUAGE_LATVIAN\|COUNTRY_LEBANON\|SERVER\|COUNTRY_SOUTHKOREA\|COUNTRY_KIRIBATI\|COUNTRY_ESTONIA\|COUNTRY_ANGUILLA\|COUNTRY_TAIWAN\|ERR_TAGEXPECTED\|ATTRHEIGHT\|ERR_TFVBRUSHBGPIC\|ATTRYDPI\|COUNTRY_EQUATORIALGUINEA\|DATETIME\|LANGUAGE_BAMBARA\|EVENTHANDLER\|ATTRPOINTER\|FILETYPEFLAGS_QUALITY\|ERR_FINDVIDEO\|TURNDOWNTOP\|COUNTRY_CHRISTMASISLAND\|COUNTRY_BURUNDI\|COUNTRY_FINLAND\|ERR_MISSINGBRACKET\|LANGUAGE_ORIYA\|LANGUAGE_MONGOLIAN\|COUNTRY_THAILAND\|HKEY_LOCAL_MACHINE\|ATTRTRANSPARENTCOLOR\|COUNTRY_AUSTRALIA\|LANGUAGE_UZBEK\|ERR_SMPRANGE\|ATTRHOSTHEIGHT\|LANGUAGE_ROMANIAN\|LANGUAGE_MACEDONIAN\|COUNTRY_ANGOLA\|SEEK_BEGINNING\|IMGFMT_ILBM\|COUNTRY_GUADELOUPE\|DATEUTC\|ERR_REXXERR\|ATTRWIDTH\|FILEATTR_EXECUTE_USR\|COUNTRY_SAINTHELENA\|ICON\|ERR_LABINFUNC\|ATTRPUBSCREEN\|COUNTRY_GUERNSEY\|ERR_FINDLAYERDATA\|GREEN\|ERR_MISSINGOPBRACK\|HW_AMIGA\|HW_MACOS\|HW_LINUX\|HW_WINDOWS\|HW_ANDROID\|HW_IOS\|HW_LITTLE_ENDIAN\|HW_64BIT\|HW_AMIGAOS4\|HW_MORPHOS\|HW_AROS\|HW_WARPOS\|HW_AMIGAOS3\)\>" - +syn match hwConstant "#\<\%(ACTIVEWINDOW\|ADF_ANIM\|ADF_FX\|ADF_MOVEOBJECT\|ALL\|ALPHABETICAL\|ALPHACHANNEL\|ALPHANUMERICAL\|AMIGAICON_DEVICE\|AMIGAICON_DISK\|AMIGAICON_DRAWER\|AMIGAICON_GARBAGE\|AMIGAICON_HIDE\|AMIGAICON_KICKSTART\|AMIGAICON_NONE\|AMIGAICON_PROJECT\|AMIGAICON_SETPOSITION\|AMIGAICON_SETTITLE\|AMIGAICON_SHOW\|AMIGAICON_TOOL\|ANIM\|ANIMSTREAM\|ANIMTYPE_RASTER\|ANIMTYPE_VECTOR\|ANMFMT_GIF\|ANMFMT_IFF\|ANMFMT_MJPEG\|ANTIALIAS\|AQUA\|ARC\|ASYNCDRAW\|ASYNCOBJ\|ATTRACTIVE\|ATTRADAPTER\|ATTRALPHAINTENSITY\|ATTRBGPIC\|ATTRBITRATE\|ATTRBORDERBOTTOM\|ATTRBORDERLEFT\|ATTRBORDERLESS\|ATTRBORDERPEN\|ATTRBORDERRIGHT\|ATTRBORDERTOP\|ATTRBULLETPEN\|ATTRCANSEEK\|ATTRCLIPREGION\|ATTRCOUNT\|ATTRCURFRAME\|ATTRCURSORX\|ATTRCURSORY\|ATTRCURSUBSONG\|ATTRCYCLE\|ATTRDENSITY\|ATTRDEPTH\|ATTRDISPLAY\|ATTRDITHERMODE\|ATTRDOUBLEBUFFER\|ATTRDRIVER\|ATTRDURATION\|ATTRELAPSE\|ATTRENCODING\|ATTRFIXED\|ATTRFONTAA\|ATTRFONTASCENDER\|ATTRFONTCHARMAP\|ATTRFONTDEPTH\|ATTRFONTDESCENDER\|ATTRFONTENGINE\|ATTRFONTNAME\|ATTRFONTPALETTE\|ATTRFONTSCALABLE\|ATTRFONTSIZE\|ATTRFONTTRANSPARENTPEN\|ATTRFONTTYPE\|ATTRFORMAT\|ATTRFRAMEDELAY\|ATTRFUNCTION\|ATTRGROUP\|ATTRHARDWARE\|ATTRHASALPHA\|ATTRHASMASK\|ATTRHEIGHT\|ATTRHOSTDEPTH\|ATTRHOSTHEIGHT\|ATTRHOSTMONITORS\|ATTRHOSTSCALE\|ATTRHOSTSCALEX\|ATTRHOSTSCALEY\|ATTRHOSTTASKBAR\|ATTRHOSTTITLEBARHEIGHT\|ATTRHOSTWIDTH\|ATTRID\|ATTRIMMERSIVEMODE\|ATTRINTERPOLATE\|ATTRKEYBOARD\|ATTRLAYERID\|ATTRLAYERS\|ATTRLAYERSON\|ATTRLOADER\|ATTRMARGINLEFT\|ATTRMARGINRIGHT\|ATTRMASKMODE\|ATTRMAXHEIGHT\|ATTRMAXIMIZED\|ATTRMAXWIDTH\|ATTRMENU\|ATTRMODE\|ATTRMONITOR\|ATTRNOCLOSE\|ATTRNOHIDE\|ATTRNOMODESWITCH\|ATTRNUMENTRIES\|ATTRNUMFRAMES\|ATTRNUMSUBSONGS\|ATTRONSCREEN\|ATTRORIENTATION\|ATTROUTPUTDEVICE\|ATTRPALETTE\|ATTRPALETTEMODE\|ATTRPAUSED\|ATTRPEN\|ATTRPITCH\|ATTRPLAYING\|ATTRPOINTER\|ATTRPOSITION\|ATTRPUBSCREEN\|ATTRRAWHEIGHT\|ATTRRAWWIDTH\|ATTRRAWXPOS\|ATTRRAWYPOS\|ATTRSCALEHEIGHT\|ATTRSCALEMODE\|ATTRSCALESWITCH\|ATTRSCALEWIDTH\|ATTRSHADOWPEN\|ATTRSIZE\|ATTRSIZEABLE\|ATTRSPRITES\|ATTRSTANDARD\|ATTRSTATE\|ATTRSYSTEMBARS\|ATTRTEXT\|ATTRTITLE\|ATTRTRANSPARENTCOLOR\|ATTRTRANSPARENTPEN\|ATTRTYPE\|ATTRUSERDATA\|ATTRVISIBLE\|ATTRWIDTH\|ATTRXDPI\|ATTRXPOS\|ATTRXSERVER\|ATTRYDPI\|ATTRYPOS\|ATTRZPOS\|BARS\|BAUD_115200\|BAUD_1200\|BAUD_19200\|BAUD_2400\|BAUD_300\|BAUD_38400\|BAUD_460800\|BAUD_4800\|BAUD_57600\|BAUD_600\|BAUD_9600\|BEEPERROR\|BEEPINFORMATION\|BEEPQUESTION\|BEEPSYSTEM\|BEEPWARNING\|BGPIC\|BGPICPART\|BIGENDIAN\|BIGSINE\|BITMAP_DEFAULT\|BLACK\|BLEND\|BLUE\|BOLD\|BOOLEAN\|BORDER\|BOTTOM\|BOTTOMOUT\|BOUNCE\|BOX\|BRUSH\|BRUSH_VS_BOX\|BRUSHPART\|BULLET_ARROW\|BULLET_BOX\|BULLET_CHECKMARK\|BULLET_CIRCLE\|BULLET_CROSS\|BULLET_DASH\|BULLET_DIAMOND\|BULLET_LALPHA\|BULLET_LALPHADOUBLE\|BULLET_LALPHASINGLE\|BULLET_LROMAN\|BULLET_LROMANDOUBLE\|BULLET_LROMANSINGLE\|BULLET_NONE\|BULLET_NUMERIC\|BULLET_NUMERICDOUBLE\|BULLET_NUMERICSINGLE\|BULLET_UALPHA\|BULLET_UALPHADOUBLE\|BULLET_UALPHASINGLE\|BULLET_UROMAN\|BULLET_UROMANDOUBLE\|BULLET_UROMANSINGLE\|BYTE\|CAPBUTT\|CAPROUND\|CAPSQUARE\|CARDBOTTOM\|CARDTOP\|CENTER\|CHARMAP_ADOBECUSTOM\|CHARMAP_ADOBEEXPERT\|CHARMAP_ADOBELATIN1\|CHARMAP_ADOBESTANDARD\|CHARMAP_APPLEROMAN\|CHARMAP_BIG5\|CHARMAP_DEFAULT\|CHARMAP_JOHAB\|CHARMAP_MSSYMBOL\|CHARMAP_OLDLATIN2\|CHARMAP_SJIS\|CHARMAP_UNICODE\|CHARMAP_WANSUNG\|CHIPMEMORY\|CIRCLE\|CLIENT\|CLIPBOARD_EMPTY\|CLIPBOARD_IMAGE\|CLIPBOARD_SOUND\|CLIPBOARD_TEXT\|CLIPBOARD_UNKNOWN\|CLIPREGION\|CLOCKWIPE\|CLOSEWINDOW\|CONICAL\|COPYFILE_FAILED\|COPYFILE_OVERWRITE\|COPYFILE_STATUS\|COPYFILE_UNPROTECT\|COUNTBOTH\|COUNTDIRECTORIES\|COUNTFILES\|COUNTRY_AFGHANISTAN\|COUNTRY_ALANDISLANDS\|COUNTRY_ALBANIA\|COUNTRY_ALGERIA\|COUNTRY_AMERICANSAMOA\|COUNTRY_ANDORRA\|COUNTRY_ANGOLA\|COUNTRY_ANGUILLA\|COUNTRY_ANTARCTICA\|COUNTRY_ANTIGUAANDBARBUDA\|COUNTRY_ARGENTINA\|COUNTRY_ARMENIA\|COUNTRY_ARUBA\|COUNTRY_AUSTRALIA\|COUNTRY_AUSTRIA\|COUNTRY_AZERBAIJAN\|COUNTRY_BAHAMAS\|COUNTRY_BAHRAIN\|COUNTRY_BANGLADESH\|COUNTRY_BARBADOS\|COUNTRY_BELARUS\|COUNTRY_BELGIUM\|COUNTRY_BELIZE\|COUNTRY_BENIN\|COUNTRY_BERMUDA\|COUNTRY_BESISLANDS\|COUNTRY_BHUTAN\|COUNTRY_BOLIVIA\|COUNTRY_BOSNIAANDHERZEGOVINA\|COUNTRY_BOTSWANA\|COUNTRY_BOUVETISLAND\|COUNTRY_BRAZIL\|COUNTRY_BRUNEI\|COUNTRY_BULGARIA\|COUNTRY_BURKINAFASO\|COUNTRY_BURUNDI\|COUNTRY_CAMBODIA\|COUNTRY_CAMEROON\|COUNTRY_CANADA\|COUNTRY_CAPEVERDE\|COUNTRY_CAYMANISLANDS\|COUNTRY_CENTRALAFRICANREPUBLIC\|COUNTRY_CHAD\|COUNTRY_CHILE\|COUNTRY_CHINA\|COUNTRY_CHRISTMASISLAND\|COUNTRY_COCOSISLANDS\|COUNTRY_COLOMBIA\|COUNTRY_COMOROS\|COUNTRY_CONGO\|COUNTRY_COOKISLANDS\|COUNTRY_COSTARICA\|COUNTRY_CROATIA\|COUNTRY_CUBA\|COUNTRY_CURACAO\|COUNTRY_CYPRUS\|COUNTRY_CZECHREPUBLIC\|COUNTRY_DENMARK\|COUNTRY_DJIBOUTI\|COUNTRY_DOMINICA\|COUNTRY_DOMINICANREPUBLIC\|COUNTRY_DRCONGO\|COUNTRY_ECUADOR\|COUNTRY_EGYPT\|COUNTRY_ELSALVADOR\|COUNTRY_EQUATORIALGUINEA\|COUNTRY_ERITREA\|COUNTRY_ESTONIA\|COUNTRY_ETHIOPIA\|COUNTRY_FALKLANDISLANDS\|COUNTRY_FAROEISLANDS\|COUNTRY_FIJI\|COUNTRY_FINLAND\|COUNTRY_FRANCE\|COUNTRY_FRENCHGUIANA\|COUNTRY_FRENCHPOLYNESIA\|COUNTRY_GABON\|COUNTRY_GAMBIA\|COUNTRY_GEORGIA\|COUNTRY_GERMANY\|COUNTRY_GHANA\|COUNTRY_GIBRALTAR\|COUNTRY_GREECE\|COUNTRY_GREENLAND\|COUNTRY_GRENADA\|COUNTRY_GUADELOUPE\|COUNTRY_GUAM\|COUNTRY_GUATEMALA\|COUNTRY_GUERNSEY\|COUNTRY_GUINEA\|COUNTRY_GUINEABISSAU\|COUNTRY_GUYANA\|COUNTRY_HAITI\|COUNTRY_HOLYSEE\|COUNTRY_HONDURAS\|COUNTRY_HONGKONG\|COUNTRY_HUNGARY\|COUNTRY_ICELAND\|COUNTRY_INDIA\|COUNTRY_INDONESIA\|COUNTRY_IRAN\|COUNTRY_IRAQ\|COUNTRY_IRELAND\|COUNTRY_ISLEOFMAN\|COUNTRY_ISRAEL\|COUNTRY_ITALY\|COUNTRY_IVORYCOAST\|COUNTRY_JAMAICA\|COUNTRY_JAPAN\|COUNTRY_JERSEY\|COUNTRY_JORDAN\|COUNTRY_KAZAKHSTAN\|COUNTRY_KENYA\|COUNTRY_KIRIBATI\|COUNTRY_KUWAIT\|COUNTRY_KYRGYZSTAN\|COUNTRY_LAOS\|COUNTRY_LATVIA\|COUNTRY_LEBANON\|COUNTRY_LESOTHO\|COUNTRY_LIBERIA\|COUNTRY_LIBYA\|COUNTRY_LIECHTENSTEIN\|COUNTRY_LITHUANIA\|COUNTRY_LUXEMBOURG\|COUNTRY_MACAO\|COUNTRY_MACEDONIA\|COUNTRY_MADAGASCAR\|COUNTRY_MALAWI\|COUNTRY_MALAYSIA\|COUNTRY_MALDIVES\|COUNTRY_MALI\|COUNTRY_MALTA\|COUNTRY_MARSHALLISLANDS\|COUNTRY_MARTINIQUE\|COUNTRY_MAURITANIA\|COUNTRY_MAURITIUS\|COUNTRY_MAYOTTE\|COUNTRY_MEXICO\|COUNTRY_MICRONESIA\|COUNTRY_MOLDOVA\|COUNTRY_MONACO\|COUNTRY_MONGOLIA\|COUNTRY_MONTENEGRO\|COUNTRY_MONTSERRAT\|COUNTRY_MOROCCO\|COUNTRY_MOZAMBIQUE\|COUNTRY_MYANMAR\|COUNTRY_NAMIBIA\|COUNTRY_NAURU\|COUNTRY_NEPAL\|COUNTRY_NETHERLANDS\|COUNTRY_NEWCALEDONIA\|COUNTRY_NEWZEALAND\|COUNTRY_NICARAGUA\|COUNTRY_NIGER\|COUNTRY_NIGERIA\|COUNTRY_NIUE\|COUNTRY_NORFOLKISLAND\|COUNTRY_NORTHKOREA\|COUNTRY_NORWAY\|COUNTRY_OMAN\|COUNTRY_PAKISTAN\|COUNTRY_PALAU\|COUNTRY_PALESTINE\|COUNTRY_PANAMA\|COUNTRY_PAPUANEWGUINEA\|COUNTRY_PARAGUAY\|COUNTRY_PERU\|COUNTRY_PHILIPPINES\|COUNTRY_PITCAIRN\|COUNTRY_POLAND\|COUNTRY_PORTUGAL\|COUNTRY_PUERTORICO\|COUNTRY_QATAR\|COUNTRY_REUNION\|COUNTRY_ROMANIA\|COUNTRY_RUSSIA\|COUNTRY_RWANDA\|COUNTRY_SAINTBARTHELEMY\|COUNTRY_SAINTHELENA\|COUNTRY_SAINTKITTSANDNEVIS\|COUNTRY_SAINTLUCIA\|COUNTRY_SAINTVINCENT\|COUNTRY_SAMOA\|COUNTRY_SANMARINO\|COUNTRY_SAOTOMEANDPRINCIPE\|COUNTRY_SAUDIARABIA\|COUNTRY_SENEGAL\|COUNTRY_SERBIA\|COUNTRY_SEYCHELLES\|COUNTRY_SIERRALEONE\|COUNTRY_SINGAPORE\|COUNTRY_SLOVAKIA\|COUNTRY_SLOVENIA\|COUNTRY_SOLOMONISLANDS\|COUNTRY_SOMALIA\|COUNTRY_SOUTHAFRICA\|COUNTRY_SOUTHKOREA\|COUNTRY_SOUTHSUDAN\|COUNTRY_SPAIN\|COUNTRY_SRILANKA\|COUNTRY_SUDAN\|COUNTRY_SURINAME\|COUNTRY_SWAZILAND\|COUNTRY_SWEDEN\|COUNTRY_SWITZERLAND\|COUNTRY_SYRIA\|COUNTRY_TAIWAN\|COUNTRY_TAJIKISTAN\|COUNTRY_TANZANIA\|COUNTRY_THAILAND\|COUNTRY_TIMOR\|COUNTRY_TOGO\|COUNTRY_TONGA\|COUNTRY_TRINIDADANDTOBAGO\|COUNTRY_TUNISIA\|COUNTRY_TURKEY\|COUNTRY_TURKMENISTAN\|COUNTRY_TUVALU\|COUNTRY_UAE\|COUNTRY_UGANDA\|COUNTRY_UK\|COUNTRY_UKRAINE\|COUNTRY_UNKNOWN\|COUNTRY_URUGUAY\|COUNTRY_USA\|COUNTRY_UZBEKISTAN\|COUNTRY_VANUATU\|COUNTRY_VENEZUELA\|COUNTRY_VIETNAM\|COUNTRY_YEMEN\|COUNTRY_ZAMBIA\|COUNTSEPARATE\|CR_DEAD\|CR_RUNNING\|CR_SUSPENDED\|CROSSFADE\|CRUSHBOTTOM\|CRUSHLEFT\|CRUSHRIGHT\|CRUSHTOP\|DAMPED\|DATA_5\|DATA_6\|DATA_7\|DATA_8\|DATEDAY\|DATELOCAL\|DATELOCALNATIVE\|DATEMONTH\|DATETIME\|DATEUTC\|DATEYEAR\|DEFAULTICON\|DEFAULTSPEED\|DEINTERLACE_DEFAULT\|DEINTERLACE_DOUBLE\|DELETEFILE_FAILED\|DELETEFILE_STATUS\|DELETEFILE_UNPROTECT\|DENSITY_HIGH\|DENSITY_LOW\|DENSITY_MEDIUM\|DENSITY_NONE\|DIAGONAL\|DIRECTORY\|DIRMONITOR_ADD\|DIRMONITOR_CHANGE\|DIRMONITOR_REMOVE\|DISPLAY\|DISPMODE_ASK\|DISPMODE_FAKEFULLSCREEN\|DISPMODE_FULLSCREEN\|DISPMODE_FULLSCREENSCALE\|DISPMODE_MODEREQUESTER\|DISPMODE_MODESWITCH\|DISPMODE_SYSTEMSCALE\|DISPMODE_WINDOWED\|DISPSTATE_CLOSED\|DISPSTATE_MINIMIZED\|DISPSTATE_OPEN\|DISSOLVE\|DITHERMODE_FLOYDSTEINBERG\|DITHERMODE_NONE\|DOSTYPE_DIRECTORY\|DOSTYPE_FILE\|DOUBLE\|DOUBLEBUFFER\|DOWNLOADFILE_STATUS\|DTR_OFF\|DTR_ON\|DURATION_LONG\|DURATION_SHORT\|EDGE\|ELLIPSE\|ENCODING_AMIGA\|ENCODING_ISO8859_1\|ENCODING_RAW\|ENCODING_UTF8\|EOF\|ERR_8OR16BITONLY\|ERR_ACCELERATOR\|ERR_ADDAPPICON\|ERR_ADDAPPWIN\|ERR_ADDSYSEVENT\|ERR_ADDTASK\|ERR_ADFFREEDISP\|ERR_ADFWRONGDISP\|ERR_AFILEPROP\|ERR_AHI\|ERR_ALLOCALPHA\|ERR_ALLOCCHANNEL\|ERR_ALLOCCHUNKY\|ERR_ALLOCMASK\|ERR_ALRDYDECLRD\|ERR_ALREADYASYNC\|ERR_ALSAPCM\|ERR_AMIGAGUIDE\|ERR_ANIMDISK\|ERR_ANIMFRAME\|ERR_ANTIALIAS\|ERR_APPLET\|ERR_APPLETVERSION\|ERR_APPLICATION\|ERR_ARGS\|ERR_ARRAYDECLA\|ERR_ASSERTFAILED\|ERR_ATSUI\|ERR_AUDIOCONVERTER\|ERR_BACKFILL\|ERR_BAD8SVX\|ERR_BADBASE64\|ERR_BADBYTECODE\|ERR_BADCALLBACKRET\|ERR_BADCONSTANT\|ERR_BADDIMENSIONS\|ERR_BADENCODING\|ERR_BADINTEGER\|ERR_BADIP\|ERR_BADLAYERTYPE\|ERR_BADPLATFORM\|ERR_BADSIGNATURE\|ERR_BADUPVALUES\|ERR_BADURL\|ERR_BADWAVE\|ERR_BADYIELD\|ERR_BEGINREFRESH\|ERR_BGPICBUTTON\|ERR_BGPICPALETTE\|ERR_BGPICTYPE\|ERR_BITMAP\|ERR_BLKWOENDBLK\|ERR_BRACECLOSE\|ERR_BRACEOPEN\|ERR_BRACKETCLOSE\|ERR_BRACKETOPEN\|ERR_BRUSHLINK\|ERR_BRUSHSIZE\|ERR_BRUSHTYPE\|ERR_CACHEERROR\|ERR_CASECST\|ERR_CHANGEDIR\|ERR_CHANNELRANGE\|ERR_CHRCSTEMPTY\|ERR_CHRCSTLEN\|ERR_CLIPFORMAT\|ERR_CLIPOPEN\|ERR_CLIPREAD\|ERR_CLIPWRITE\|ERR_CLOSEDDISPLAY\|ERR_CLOSEFILE\|ERR_CMDASVAR\|ERR_CMPUNSUPPORTED\|ERR_COLORSPACE\|ERR_COMMENTSTRUCT\|ERR_COMMODITY\|ERR_COMPLEXEXPR\|ERR_COMPLEXPATTERN\|ERR_COMPLEXWHILE\|ERR_CONCAT\|ERR_CONFIG\|ERR_CONFIG2\|ERR_CONITEMS\|ERR_CONSOLEARG\|ERR_CONTEXTMENU\|ERR_COORDSRANGE\|ERR_COREFOUNDATION\|ERR_CORETEXT\|ERR_CREATEDIR\|ERR_CREATEDOCKY\|ERR_CREATEEVENT\|ERR_CREATEGC\|ERR_CREATEICON\|ERR_CREATEMENU\|ERR_CREATEPORT\|ERR_CREATESHORTCUT\|ERR_CSTDOUBLEDEF\|ERR_CTRLSTRUCT\|ERR_CYIELD\|ERR_DATATYPEALPHA\|ERR_DATATYPESAVE\|ERR_DATATYPESAVE2\|ERR_DBLENCODING\|ERR_DBPALETTE\|ERR_DBTRANSWIN\|ERR_DBVIDEOLAYER\|ERR_DDAUTOSCALE\|ERR_DDMOBILE\|ERR_DDRECVIDEO\|ERR_DEADRESUME\|ERR_DEFFONT\|ERR_DELETEFILE\|ERR_DEMO\|ERR_DEMO2\|ERR_DEMO3\|ERR_DEPTHMISMATCH\|ERR_DEPTHRANGE\|ERR_DESERIALIZE\|ERR_DIFFDEPTH\|ERR_DIFFENCODING\|ERR_DINPUT\|ERR_DIRECTSHOW\|ERR_DIRLOCK\|ERR_DISPLAYADAPTERSUPPORT\|ERR_DISPLAYDESKTOP\|ERR_DISPLAYDESKTOPPAL\|ERR_DISPLAYSIZE\|ERR_DISPMINIMIZED\|ERR_DLOPEN\|ERR_DOUBLEDECLA\|ERR_DOUBLEMENU\|ERR_DRAWPATH\|ERR_DSOUNDNOTIFY\|ERR_DSOUNDNOTIPOS\|ERR_DSOUNDPLAY\|ERR_ELSEIFAFTERELSE\|ERR_ELSETWICE\|ERR_ELSEWOIF\|ERR_EMPTYMENUTREE\|ERR_EMPTYOBJ\|ERR_EMPTYPATH\|ERR_EMPTYSCRIPT\|ERR_EMPTYTABLE\|ERR_ENDBLKWOBLK\|ERR_ENDDOUBLEBUFFER\|ERR_ENDFUNCWOFUNC\|ERR_ENDIFWOIF\|ERR_ENDSWCHWOSWCH\|ERR_ENDWITHWOWITH\|ERR_EQUALEXPECTED\|ERR_ERRORCALLED\|ERR_ESCREPLACE\|ERR_EVNTEXPCTED\|ERR_EXAMINE\|ERR_EXECUTE\|ERR_EXETYPE\|ERR_FGRABVIDSTATE\|ERR_FIELDINIT\|ERR_FILEEXIST\|ERR_FILEFORMAT\|ERR_FILENOTFOUND\|ERR_FILESIZE\|ERR_FINDACTIVITY\|ERR_FINDANIM\|ERR_FINDANIMSTREAM\|ERR_FINDAPPLICATION\|ERR_FINDARRAY\|ERR_FINDASYNCDRAW\|ERR_FINDASYNCOBJ\|ERR_FINDBGPIC\|ERR_FINDBRUSH\|ERR_FINDBUTTON\|ERR_FINDCLIENT\|ERR_FINDCLIPREGION\|ERR_FINDCST\|ERR_FINDDIR\|ERR_FINDDISPLAY\|ERR_FINDFILE\|ERR_FINDFONT\|ERR_FINDFONT2\|ERR_FINDICON\|ERR_FINDINTERVAL\|ERR_FINDLAYER\|ERR_FINDLAYERDATA\|ERR_FINDMEMBLK\|ERR_FINDMENU\|ERR_FINDMENUITEM\|ERR_FINDMONITOR\|ERR_FINDMOVE\|ERR_FINDMUSIC\|ERR_FINDOBJECTDATA\|ERR_FINDPALETTE\|ERR_FINDPATH\|ERR_FINDPLUGIN\|ERR_FINDPOINTER\|ERR_FINDPORT\|ERR_FINDSAMPLE\|ERR_FINDSELECTOR\|ERR_FINDSERIAL\|ERR_FINDSERVER\|ERR_FINDSPRITE\|ERR_FINDTEXTOBJECT\|ERR_FINDTIMEOUT\|ERR_FINDTIMER\|ERR_FINDUDPOBJECT\|ERR_FINDVIDEO\|ERR_FIRSTPREPROC\|ERR_FONTFORMAT\|ERR_FONTPATH\|ERR_FONTPATH2\|ERR_FORBIDMODAL\|ERR_FOREVERWOREPEAT\|ERR_FORWONEXT\|ERR_FRAMEGRABBER\|ERR_FREEABGPIC\|ERR_FREEADISPLAY\|ERR_FREECURPOINTER\|ERR_FT2\|ERR_FTPAUTH\|ERR_FTPERROR\|ERR_FULLSCREEN\|ERR_FUNCARGS\|ERR_FUNCDECLA\|ERR_FUNCEXPECTED\|ERR_FUNCJMP\|ERR_FUNCREMOVED\|ERR_FUNCTABLEARG\|ERR_FUNCWOENDFUNC\|ERR_GETDISKOBJ\|ERR_GETIFADDRS\|ERR_GETMONITORINFO\|ERR_GETSHORTCUT\|ERR_GRABSCREEN\|ERR_GROUPNAMEUSED\|ERR_GTK\|ERR_GUIGFX\|ERR_HEXPOINT\|ERR_HOSTNAME\|ERR_HTTPERROR\|ERR_HTTPTE\|ERR_HWBMCLOSEDISP\|ERR_HWBRUSH\|ERR_HWBRUSHFUNC\|ERR_HWDBFREEDISP\|ERR_ICONDIMS\|ERR_ICONENTRY\|ERR_ICONPARMS\|ERR_ICONSIZE\|ERR_ICONSTANDARD\|ERR_ICONVECTOR\|ERR_IFWOENDIF\|ERR_IMAGEERROR\|ERR_INCOMPATBRUSH\|ERR_INISYNTAX\|ERR_INITSERIAL\|ERR_INTERNAL\|ERR_INTERNAL1\|ERR_INTEXPECTED\|ERR_INVALIDDATE\|ERR_INVALIDUTF8\|ERR_INVALIDUTF8ARG\|ERR_INVCAPIDX\|ERR_INVINSERT\|ERR_INVNEXTKEY\|ERR_INVPATCAP\|ERR_INVREPLACE\|ERR_JAVA\|ERR_JAVAMETHOD\|ERR_JOYSTICK\|ERR_KEYFILE\|ERR_KEYNOTFOUND\|ERR_KEYWORD\|ERR_KICKSTART\|ERR_LABELDECLA\|ERR_LABELDOUBLE\|ERR_LABINFOR\|ERR_LABINFUNC\|ERR_LABINIF\|ERR_LABINWHILE\|ERR_LABMAINBLK\|ERR_LAYERRANGE\|ERR_LAYERSOFF\|ERR_LAYERSON\|ERR_LAYERSUPPORT\|ERR_LAYERSUPPORT2\|ERR_LAYERSWITCH\|ERR_LEGACYPTMOD\|ERR_LFSYNTAX\|ERR_LINKFONT\|ERR_LINKPLUGIN\|ERR_LOADFRAME\|ERR_LOADICON\|ERR_LOADPICTURE\|ERR_LOADPICTURE2\|ERR_LOADPLUGIN\|ERR_LOADSOUND\|ERR_LOADVIDEO\|ERR_LOCK\|ERR_LOCK2\|ERR_LOCKBMAP\|ERR_LOCKEDOBJ\|ERR_LOOPRANGE\|ERR_LOWFREQ\|ERR_MAGICKEY\|ERR_MALFORMPAT1\|ERR_MALFORMPAT2\|ERR_MASKNALPHA\|ERR_MAXLINES\|ERR_MAXLOCALS\|ERR_MAXPARAMS\|ERR_MAXUPVALS\|ERR_MEDIAFOUNDATION\|ERR_MEM\|ERR_MEMCODE\|ERR_MEMCST\|ERR_MEMRANGE\|ERR_MENUATTACHED\|ERR_MENUCOMPLEXITY\|ERR_MISSINGBRACKET\|ERR_MISSINGFIELD\|ERR_MISSINGOPBRACK\|ERR_MISSINGPARAMTR\|ERR_MISSINGSEPARTR\|ERR_MIXMUSMOD\|ERR_MOBILE\|ERR_MODIFYAANIM\|ERR_MODIFYABG\|ERR_MODIFYABGPIC\|ERR_MODIFYABR\|ERR_MODIFYPSMP\|ERR_MODIFYSPRITE\|ERR_MODIFYSPRITE2\|ERR_MONITORDIR\|ERR_MONITORFULLSCREEN\|ERR_MONITORRANGE\|ERR_MOVEFILE\|ERR_MSGPORT\|ERR_MULDISMOBILE\|ERR_MULTIBGPIC\|ERR_MULTIDISPLAYS\|ERR_MUSFMTSUPPORT\|ERR_MUSNOTPAUSED\|ERR_MUSNOTPLYNG\|ERR_MUSNOTPLYNG2\|ERR_MUSPAUSED\|ERR_MUSPLAYING\|ERR_NAMETOOLONG\|ERR_NAMEUSED\|ERR_NEEDAPPLICATION\|ERR_NEEDCOMPOSITE\|ERR_NEEDMORPHOS2\|ERR_NEEDOS41\|ERR_NEEDPALETTEIMAGE\|ERR_NEGCOORDS\|ERR_NEWHWPLUGIN\|ERR_NEXTWOFOR\|ERR_NOABSPATH\|ERR_NOACCESS\|ERR_NOALPHA\|ERR_NOANMLAYER\|ERR_NOAPPLET\|ERR_NOARGBVISUAL\|ERR_NOBLOCKBREAK\|ERR_NOCALLBACK\|ERR_NOCHANNEL\|ERR_NOCHAR\|ERR_NOCLIPREG\|ERR_NOCOLON\|ERR_NOCOMMA\|ERR_NOCOMPRESS\|ERR_NOCONSTANTS\|ERR_NOCONTEXTMENU\|ERR_NOCOORDCST\|ERR_NODIRPATTERN\|ERR_NODISLAYERS\|ERR_NODISPMODES\|ERR_NODOUBLEBUFFER\|ERR_NOFALLTHROUGH\|ERR_NOFILTERNAME\|ERR_NOFMBHANDLER\|ERR_NOFUNCTION\|ERR_NOHWFUNC\|ERR_NOJOYATPORT\|ERR_NOKEYWORDS\|ERR_NOLAYERS\|ERR_NOLOOP\|ERR_NOLOOPCONT\|ERR_NOMASKBRUSH\|ERR_NOMENU\|ERR_NOMIMEVIEWER\|ERR_NOMUSICCB\|ERR_NONE\|ERR_NONSUSPENDEDRESUME\|ERR_NOPALETTE\|ERR_NOPALETTEIMAGE\|ERR_NOPALETTEMODE\|ERR_NORETVAL\|ERR_NOREXX\|ERR_NOSPRITES\|ERR_NOTADIR\|ERR_NOTENOUGHPIXELS\|ERR_NOTIGER\|ERR_NOTPROTRACKER\|ERR_NOTRANSPARENCY\|ERR_NOTXTLAYER\|ERR_NUMBEREXPECTED\|ERR_NUMCALLBACK\|ERR_NUMCONCAT\|ERR_NUMEXPECTED\|ERR_NUMSTRCMP\|ERR_NUMTABLEARG\|ERR_OLDAPPLET\|ERR_OPENANIM\|ERR_OPENANIM2\|ERR_OPENAUDIO\|ERR_OPENFONT\|ERR_OPENLIB\|ERR_OPENSERIAL\|ERR_OPENSOCKET\|ERR_OPENSOUND\|ERR_OPENSOUND2\|ERR_OUTOFRANGE\|ERR_PAKFORMAT\|ERR_PALETTEFILL\|ERR_PALETTEMODE\|ERR_PALSCREEN\|ERR_PEERNAME\|ERR_PENRANGE\|ERR_PERCENTFORMAT\|ERR_PERCENTFORMATSTR\|ERR_PIPE\|ERR_PIXELFORMAT\|ERR_PIXELRANGE\|ERR_PLAYERCOMP\|ERR_PLAYVIDEO\|ERR_PLUGINARCH\|ERR_PLUGINDOUBLET\|ERR_PLUGINSUPPORT\|ERR_PLUGINSYMBOL\|ERR_PLUGINTYPE\|ERR_PLUGINVER\|ERR_POINTERFORMAT\|ERR_POINTERIMG\|ERR_PORTNOTAVAIL\|ERR_PREPROCSYM\|ERR_PROTMETATABLE\|ERR_PUBSCREEN\|ERR_QUICKTIME\|ERR_RADIOTOGGLEMENU\|ERR_RANDOMIZE\|ERR_READ\|ERR_READFILE\|ERR_READFUNC\|ERR_READONLY\|ERR_READRANGE\|ERR_READTABLE\|ERR_READVIDEOPIXELS\|ERR_RECVCLOSED\|ERR_RECVTIMEOUT\|ERR_RECVUNKNOWN\|ERR_REGCLASS\|ERR_REGISTRYREAD\|ERR_REGISTRYWRITE\|ERR_REMADLAYER\|ERR_RENAME\|ERR_RENDER\|ERR_RENDERADLAYER\|ERR_RENDERCALLBACK\|ERR_RENDERER\|ERR_REPEATWOUNTIL\|ERR_REQAUTH\|ERR_REQUIREFIELD\|ERR_REQUIREPLUGIN\|ERR_REQUIRETAGFMT\|ERR_RETWOGOSUB\|ERR_REVDWORD\|ERR_REWINDDIR\|ERR_REXXERR\|ERR_SATELLITE\|ERR_SATFREEDISP\|ERR_SAVEANIM\|ERR_SAVEICON\|ERR_SAVEIMAGE\|ERR_SAVEPNG\|ERR_SAVERALPHA\|ERR_SAVESAMPLE\|ERR_SCALEBGPIC\|ERR_SCREEN\|ERR_SCREENMODE\|ERR_SCREENSIZE\|ERR_SCRPIXFMT\|ERR_SEEK\|ERR_SEEKFILE\|ERR_SEEKFORMAT\|ERR_SEEKRANGE\|ERR_SELECTALPHACHANNEL\|ERR_SELECTANIM\|ERR_SELECTBG\|ERR_SELECTBGPIC\|ERR_SELECTBGPIC2\|ERR_SELECTBRUSH\|ERR_SELECTMASK\|ERR_SEMAPHORE\|ERR_SENDDATA\|ERR_SENDMESSAGE\|ERR_SENDTIMEOUT\|ERR_SENDUNKNOWN\|ERR_SERIALIO\|ERR_SERIALIZE\|ERR_SERIALIZETYPE\|ERR_SETADAPTER\|ERR_SETENV\|ERR_SETFILEATTR\|ERR_SETFILECOMMENT\|ERR_SETFILEDATE\|ERR_SETMENU\|ERR_SHORTIF\|ERR_SIGNAL\|ERR_SMODEALPHA\|ERR_SMPRANGE\|ERR_SOCKET\|ERR_SOCKNAME\|ERR_SOCKOPT\|ERR_SORTFUNC\|ERR_SPRITELINK\|ERR_SPRITEONSCREEN\|ERR_SPRITEONSCREEN2\|ERR_SQBRACKETCLOSE\|ERR_SQBRACKETOPEN\|ERR_STACK\|ERR_STAT\|ERR_STRCALLBACK\|ERR_STREAMASSAMPLE\|ERR_STREXPECTED\|ERR_STRINGCST\|ERR_STRINGEXPECTED\|ERR_STRORNUM\|ERR_STRTABLEARG\|ERR_STRTOOSHORT\|ERR_SURFACE\|ERR_SWCHWOENDSWCH\|ERR_SYNTAXERROR\|ERR_SYNTAXLEVELS\|ERR_SYSBUTTON\|ERR_SYSIMAGE\|ERR_SYSTOOOLD\|ERR_TABCALLBACK\|ERR_TABEXPECTED\|ERR_TABEXPECTED2\|ERR_TABEXPECTED3\|ERR_TABLEDECLA\|ERR_TABLEINDEX\|ERR_TABLEORNIL\|ERR_TABLEOVERFLOW\|ERR_TAGEXPECTED\|ERR_TASKSETUP\|ERR_TEXTARG\|ERR_TEXTCONVERT\|ERR_TEXTCONVERT2\|ERR_TEXTSYNTAX\|ERR_TEXTURE\|ERR_TFIMAGE\|ERR_TFVANIM\|ERR_TFVBGPICBRUSH\|ERR_TFVBRUSH\|ERR_TFVBRUSHBGPIC\|ERR_THREAD\|ERR_THREADEXPECTED\|ERR_TIMER\|ERR_TOKENEXPECTED\|ERR_TOOMANYARGS\|ERR_TOOMANYCAPTURES\|ERR_TOOSMALL2\|ERR_TRANSBGMOBILE\|ERR_TRANSBRUSH\|ERR_TRAYICON\|ERR_TRIALCOMPILE\|ERR_TRIALINCLUDE\|ERR_TRIALLIMIT\|ERR_TRIALSAVEVID\|ERR_UDEXPECTED\|ERR_UNBALANCEDPAT\|ERR_UNEXPECTEDEOF\|ERR_UNEXPECTEDSYM\|ERR_UNFINISHEDCAPTURE\|ERR_UNIMPLCMD\|ERR_UNKNOWN\|ERR_UNKNOWNANMOUT\|ERR_UNKNOWNATTR\|ERR_UNKNOWNCMD\|ERR_UNKNOWNCOND\|ERR_UNKNOWNFILTER\|ERR_UNKNOWNICNOUT\|ERR_UNKNOWNIMGOUT\|ERR_UNKNOWNMIMETYPE\|ERR_UNKNOWNMUSFMT\|ERR_UNKNOWNPALETTE\|ERR_UNKNOWNSEC\|ERR_UNKNOWNSEQ\|ERR_UNKNOWNSMPOUT\|ERR_UNKNOWNTAG\|ERR_UNKNUMFMT\|ERR_UNKPROTOCOL\|ERR_UNKTEXTFMT\|ERR_UNMPARENTHESES\|ERR_UNSETENV\|ERR_UNSUPPORTEDFEAT\|ERR_UNTERMINTDSTR\|ERR_UNTILWOREPEAT\|ERR_UPDATEICON\|ERR_UPLOADFORBIDDEN\|ERR_USERABORT\|ERR_VALUEEXPECTED\|ERR_VAREXPECTED\|ERR_VARLENGTH\|ERR_VARSYNTAX\|ERR_VECGFXPLUGIN\|ERR_VECTORANIM\|ERR_VECTORBRUSH\|ERR_VERSION\|ERR_VFONT\|ERR_VFONTTYPE\|ERR_VIDATTACHED\|ERR_VIDEOFRAME\|ERR_VIDEOINIT\|ERR_VIDEOLAYER\|ERR_VIDEOLAYERDRV\|ERR_VIDEOSTRATEGY\|ERR_VIDEOTRANS\|ERR_VIDLAYERFUNC\|ERR_VIDNOTPAUSED\|ERR_VIDNOTPLAYING\|ERR_VIDPAUSED\|ERR_VIDPLAYING\|ERR_VIDRECMULTI\|ERR_VIDRECTRANS\|ERR_VIDSTOPPED\|ERR_VISUALINFO\|ERR_VMMISMATCH\|ERR_WARPOS\|ERR_WENDWOWHILE\|ERR_WHILEWOWEND\|ERR_WINDOW\|ERR_WITHWOENDWITH\|ERR_WRITE\|ERR_WRITEFILE\|ERR_WRITEJPEG\|ERR_WRITEONLY\|ERR_WRONGCLIPREG\|ERR_WRONGCMDRECVIDEO\|ERR_WRONGDTYPE\|ERR_WRONGFLOAT\|ERR_WRONGHEX\|ERR_WRONGID\|ERR_WRONGOP\|ERR_WRONGOPCST\|ERR_WRONGSPRITESIZE\|ERR_WRONGUSAGE\|ERR_WRONGVSTRATEGY\|ERR_XCURSOR\|ERR_XDISPLAY\|ERR_XF86VIDMODEEXT\|ERR_XFIXES\|ERR_YIELD\|ERR_ZERODIVISION\|ERR_ZLIBDATA\|ERR_ZLIBIO\|ERR_ZLIBSTREAM\|ERR_ZLIBVERSION\|EVENTHANDLER\|FADE\|FASTMEMORY\|FASTSPEED\|FILE\|FILEATTR_ARCHIVE\|FILEATTR_DELETE_USR\|FILEATTR_EXECUTE_GRP\|FILEATTR_EXECUTE_OTH\|FILEATTR_EXECUTE_USR\|FILEATTR_HIDDEN\|FILEATTR_NORMAL\|FILEATTR_PURE\|FILEATTR_READ_GRP\|FILEATTR_READ_OTH\|FILEATTR_READ_USR\|FILEATTR_READONLY\|FILEATTR_SCRIPT\|FILEATTR_SYSTEM\|FILEATTR_WRITE_GRP\|FILEATTR_WRITE_OTH\|FILEATTR_WRITE_USR\|FILETYPE_ANIM\|FILETYPE_ICON\|FILETYPE_IMAGE\|FILETYPE_SOUND\|FILETYPE_VIDEO\|FILETYPEFLAGS_ALPHA\|FILETYPEFLAGS_FPS\|FILETYPEFLAGS_QUALITY\|FILETYPEFLAGS_SAVE\|FILLCOLOR\|FILLGRADIENT\|FILLNONE\|FILLRULEEVENODD\|FILLRULEWINDING\|FILLTEXTURE\|FLOAT\|FLOW_HARDWARE\|FLOW_OFF\|FLOW_XON_XOFF\|FONT\|FONTENGINE_INBUILT\|FONTENGINE_NATIVE\|FONTSLANT_ITALIC\|FONTSLANT_OBLIQUE\|FONTSLANT_ROMAN\|FONTTYPE_BITMAP\|FONTTYPE_COLOR\|FONTTYPE_VECTOR\|FONTWEIGHT_BLACK\|FONTWEIGHT_BOLD\|FONTWEIGHT_BOOK\|FONTWEIGHT_DEMIBOLD\|FONTWEIGHT_EXTRABLACK\|FONTWEIGHT_EXTRABOLD\|FONTWEIGHT_EXTRALIGHT\|FONTWEIGHT_HEAVY\|FONTWEIGHT_LIGHT\|FONTWEIGHT_MEDIUM\|FONTWEIGHT_NORMAL\|FONTWEIGHT_REGULAR\|FONTWEIGHT_SEMIBOLD\|FONTWEIGHT_THIN\|FONTWEIGHT_ULTRABLACK\|FONTWEIGHT_ULTRABOLD\|FONTWEIGHT_ULTRALIGHT\|FRAMEMODE_FULL\|FRAMEMODE_SINGLE\|FREESPACE\|FTPASCII\|FTPBINARY\|FUCHSIA\|FUNCTION\|GRAY\|GREEN\|HBLINDS128\|HBLINDS16\|HBLINDS32\|HBLINDS64\|HBLINDS8\|HCLOSECURTAIN\|HCLOSEGATE\|HEXNUMERICAL\|HFLIPCOIN\|HFLOWBOTTOM\|HFLOWTOP\|HIDEBRUSH\|HIDELAYER\|HKEY_CLASSES_ROOT\|HKEY_CURRENT_CONFIG\|HKEY_CURRENT_USER\|HKEY_LOCAL_MACHINE\|HKEY_USERS\|HLINES\|HLINES2\|HLOWFLIPCOIN\|HOLLYWOOD\|HOPENCURTAIN\|HOPENGATE\|HSPLIT\|HSTRANGEPUSH\|HSTRETCHCENTER\|HSTRIPES\|HSTRIPES16\|HSTRIPES2\|HSTRIPES32\|HSTRIPES4\|HSTRIPES64\|HSTRIPES8\|HW_64BIT\|HW_AMIGA\|HW_AMIGAOS3\|HW_AMIGAOS4\|HW_ANDROID\|HW_AROS\|HW_IOS\|HW_LINUX\|HW_LITTLE_ENDIAN\|HW_MACOS\|HW_MORPHOS\|HW_REVISION\|HW_VERSION\|HW_WARPOS\|HW_WINDOWS\|ICNFMT_HOLLYWOOD\|ICON\|IMAGETYPE_RASTER\|IMAGETYPE_VECTOR\|IMGFMT_BMP\|IMGFMT_GIF\|IMGFMT_ILBM\|IMGFMT_JPEG\|IMGFMT_NATIVE\|IMGFMT_PLUGIN\|IMGFMT_PNG\|IMGFMT_TIFF\|IMGFMT_UNKNOWN\|IMMERSIVE_LEANBACK\|IMMERSIVE_NONE\|IMMERSIVE_NORMAL\|IMMERSIVE_STICKY\|INACTIVEWINDOW\|INF\|INSERTBRUSH\|INTEGER\|INTERVAL\|IO_BUFFERED\|IO_FAKE64\|IO_LITTLEENDIAN\|IO_SIGNED\|IO_UNBUFFERED\|IO_UNSIGNED\|IPAUTO\|IPUNKNOWN\|IPV4\|IPV6\|ITALIC\|JOINBEVEL\|JOINMITER\|JOINROUND\|JOYDOWN\|JOYDOWNLEFT\|JOYDOWNRIGHT\|JOYLEFT\|JOYNODIR\|JOYRIGHT\|JOYUP\|JOYUPLEFT\|JOYUPRIGHT\|JUSTIFIED\|KEEPASPRAT\|KEEPPOSITION\|LANGUAGE_ABKHAZIAN\|LANGUAGE_AFAR\|LANGUAGE_AFRIKAANS\|LANGUAGE_AKAN\|LANGUAGE_ALBANIAN\|LANGUAGE_AMHARIC\|LANGUAGE_ARABIC\|LANGUAGE_ARAGONESE\|LANGUAGE_ARMENIAN\|LANGUAGE_ASSAMESE\|LANGUAGE_AVARIC\|LANGUAGE_AVESTAN\|LANGUAGE_AYMARA\|LANGUAGE_AZERBAIJANI\|LANGUAGE_BAMBARA\|LANGUAGE_BASHKIR\|LANGUAGE_BASQUE\|LANGUAGE_BELARUSIAN\|LANGUAGE_BENGALI\|LANGUAGE_BIHARI\|LANGUAGE_BISLAMA\|LANGUAGE_BOSNIAN\|LANGUAGE_BRETON\|LANGUAGE_BULGARIAN\|LANGUAGE_BURMESE\|LANGUAGE_CATALAN\|LANGUAGE_CENTRALKHMER\|LANGUAGE_CHAMORRO\|LANGUAGE_CHECHEN\|LANGUAGE_CHICHEWA\|LANGUAGE_CHINESE\|LANGUAGE_CHURCHSLAVIC\|LANGUAGE_CHUVASH\|LANGUAGE_CORNISH\|LANGUAGE_CORSICAN\|LANGUAGE_CREE\|LANGUAGE_CROATIAN\|LANGUAGE_CZECH\|LANGUAGE_DANISH\|LANGUAGE_DIVEHI\|LANGUAGE_DUTCH\|LANGUAGE_DZONGKHA\|LANGUAGE_ENGLISH\|LANGUAGE_ESPERANTO\|LANGUAGE_ESTONIAN\|LANGUAGE_EWE\|LANGUAGE_FAROESE\|LANGUAGE_FIJIAN\|LANGUAGE_FINNISH\|LANGUAGE_FRENCH\|LANGUAGE_FULAH\|LANGUAGE_GAELIC\|LANGUAGE_GALICIAN\|LANGUAGE_GANDA\|LANGUAGE_GEORGIAN\|LANGUAGE_GERMAN\|LANGUAGE_GREEK\|LANGUAGE_GREENLANDIC\|LANGUAGE_GUARANI\|LANGUAGE_GUJARATI\|LANGUAGE_HAITIAN\|LANGUAGE_HAUSA\|LANGUAGE_HEBREW\|LANGUAGE_HERERO\|LANGUAGE_HINDI\|LANGUAGE_HIRIMOTU\|LANGUAGE_HUNGARIAN\|LANGUAGE_ICELANDIC\|LANGUAGE_IDO\|LANGUAGE_IGBO\|LANGUAGE_INDONESIAN\|LANGUAGE_INTERLINGUA\|LANGUAGE_INTERLINGUE\|LANGUAGE_INUKTITUT\|LANGUAGE_INUPIAQ\|LANGUAGE_IRISH\|LANGUAGE_ITALIAN\|LANGUAGE_JAPANESE\|LANGUAGE_JAVANESE\|LANGUAGE_KANNADA\|LANGUAGE_KANURI\|LANGUAGE_KASHMIRI\|LANGUAGE_KAZAKH\|LANGUAGE_KIKUYU\|LANGUAGE_KINYARWANDA\|LANGUAGE_KIRGHIZ\|LANGUAGE_KOMI\|LANGUAGE_KONGO\|LANGUAGE_KOREAN\|LANGUAGE_KUANYAMA\|LANGUAGE_KURDISH\|LANGUAGE_LAO\|LANGUAGE_LATIN\|LANGUAGE_LATVIAN\|LANGUAGE_LIMBURGAN\|LANGUAGE_LINGALA\|LANGUAGE_LITHUANIAN\|LANGUAGE_LUBAKATANGA\|LANGUAGE_LUXEMBOURGISH\|LANGUAGE_MACEDONIAN\|LANGUAGE_MALAGASY\|LANGUAGE_MALAY\|LANGUAGE_MALAYALAM\|LANGUAGE_MALTESE\|LANGUAGE_MANX\|LANGUAGE_MAORI\|LANGUAGE_MARATHI\|LANGUAGE_MARSHALLESE\|LANGUAGE_MONGOLIAN\|LANGUAGE_NAURU\|LANGUAGE_NAVAJO\|LANGUAGE_NDONGA\|LANGUAGE_NEPALI\|LANGUAGE_NORTHERNSAMI\|LANGUAGE_NORTHNDEBELE\|LANGUAGE_NORWEGIAN\|LANGUAGE_NORWEGIANBOKMAL\|LANGUAGE_NORWEGIANNYNORSK\|LANGUAGE_OCCITAN\|LANGUAGE_OJIBWA\|LANGUAGE_ORIYA\|LANGUAGE_OROMO\|LANGUAGE_OSSETIAN\|LANGUAGE_PALI\|LANGUAGE_PANJABI\|LANGUAGE_PASHTO\|LANGUAGE_PERSIAN\|LANGUAGE_POLISH\|LANGUAGE_PORTUGUESE\|LANGUAGE_QUECHUA\|LANGUAGE_ROMANIAN\|LANGUAGE_ROMANSH\|LANGUAGE_RUNDI\|LANGUAGE_RUSSIAN\|LANGUAGE_SAMOAN\|LANGUAGE_SANGO\|LANGUAGE_SANSKRIT\|LANGUAGE_SARDINIAN\|LANGUAGE_SERBIAN\|LANGUAGE_SHONA\|LANGUAGE_SICHUANYI\|LANGUAGE_SINDHI\|LANGUAGE_SINHALA\|LANGUAGE_SLOVAK\|LANGUAGE_SLOVENIAN\|LANGUAGE_SOMALI\|LANGUAGE_SOUTHERNSOTHO\|LANGUAGE_SOUTHNDEBELE\|LANGUAGE_SPANISH\|LANGUAGE_SUNDANESE\|LANGUAGE_SWAHILI\|LANGUAGE_SWATI\|LANGUAGE_SWEDISH\|LANGUAGE_TAGALOG\|LANGUAGE_TAHITIAN\|LANGUAGE_TAJIK\|LANGUAGE_TAMIL\|LANGUAGE_TATAR\|LANGUAGE_TELUGU\|LANGUAGE_THAI\|LANGUAGE_TIBETAN\|LANGUAGE_TIGRINYA\|LANGUAGE_TONGA\|LANGUAGE_TSONGA\|LANGUAGE_TSWANA\|LANGUAGE_TURKISH\|LANGUAGE_TURKMEN\|LANGUAGE_TWI\|LANGUAGE_UIGHUR\|LANGUAGE_UKRAINIAN\|LANGUAGE_UNKNOWN\|LANGUAGE_URDU\|LANGUAGE_UZBEK\|LANGUAGE_VENDA\|LANGUAGE_VIETNAMESE\|LANGUAGE_WALLOON\|LANGUAGE_WELSH\|LANGUAGE_WESTERNFRISIAN\|LANGUAGE_WOLOF\|LANGUAGE_XHOSA\|LANGUAGE_YIDDISH\|LANGUAGE_YORUBA\|LANGUAGE_ZHUANG\|LANGUAGE_ZULU\|LAYER\|LAYER_VS_BOX\|LAYERBUTTON\|LEFT\|LEFTOUT\|LIGHTUSERDATA\|LIME\|LINE\|LINEAR\|LITTLEENDIAN\|LONG\|LOWERCURVE\|MAROON\|MASK\|MASKAND\|MASKINVISIBLE\|MASKOR\|MASKVANILLACOPY\|MASKVISIBLE\|MASKXOR\|MEMORY\|MENU\|MENUITEM_DISABLED\|MENUITEM_RADIO\|MENUITEM_SELECTED\|MENUITEM_TOGGLE\|MILLISECONDS\|MODE_READ\|MODE_READWRITE\|MODE_WRITE\|MODLALT\|MODLCOMMAND\|MODLCONTROL\|MODLSHIFT\|MODRALT\|MODRCOMMAND\|MODRCONTROL\|MODRSHIFT\|MONO16\|MONO8\|MONOSPACE\|MOVEFILE_COPY\|MOVEFILE_COPYFAILED\|MOVEFILE_DELETE\|MOVEFILE_DELETEFAILED\|MOVEFILE_UNPROTECT\|MOVELIST\|MOVEWINDOW\|MUSIC\|NAN\|NATIVE\|NATIVEENDIAN\|NAVY\|NETWORKCONNECTION\|NETWORKSERVER\|NETWORKUDP\|NEXTFRAME\|NEXTFRAME2\|NIL\|NOCOLOR\|NONE\|NOPEN\|NORMAL\|NORMALSPEED\|NOTRANSPARENCY\|NUMBER\|NUMERICAL\|OLIVE\|ONBUTTONCLICK\|ONBUTTONCLICKALL\|ONBUTTONOVER\|ONBUTTONOVERALL\|ONBUTTONRIGHTCLICK\|ONBUTTONRIGHTCLICKALL\|ONKEYDOWN\|ONKEYDOWNALL\|ORIENTATION_LANDSCAPE\|ORIENTATION_LANDSCAPEREV\|ORIENTATION_NONE\|ORIENTATION_PORTRAIT\|ORIENTATION_PORTRAITREV\|PALETTE\|PALETTE_AGA\|PALETTE_CGA\|PALETTE_DEFAULT\|PALETTE_EGA\|PALETTE_GRAY128\|PALETTE_GRAY16\|PALETTE_GRAY256\|PALETTE_GRAY32\|PALETTE_GRAY4\|PALETTE_GRAY64\|PALETTE_GRAY8\|PALETTE_MACINTOSH\|PALETTE_MONOCHROME\|PALETTE_OCS\|PALETTE_WINDOWS\|PALETTE_WORKBENCH\|PALETTEMODE_PEN\|PALETTEMODE_REMAP\|PARITY_EVEN\|PARITY_NONE\|PARITY_ODD\|PERMREQ_READEXTERNAL\|PERMREQ_WRITEEXTERNAL\|PI\|PIXELZOOM1\|PIXELZOOM2\|PLOT\|PLUGINCAPS_ANIM\|PLUGINCAPS_AUDIOADAPTER\|PLUGINCAPS_CONVERT\|PLUGINCAPS_DIRADAPTER\|PLUGINCAPS_DISPLAYADAPTER\|PLUGINCAPS_EXTENSION\|PLUGINCAPS_FILEADAPTER\|PLUGINCAPS_ICON\|PLUGINCAPS_IMAGE\|PLUGINCAPS_IPCADAPTER\|PLUGINCAPS_LIBRARY\|PLUGINCAPS_NETWORKADAPTER\|PLUGINCAPS_REQUESTERADAPTER\|PLUGINCAPS_REQUIRE\|PLUGINCAPS_SAVEANIM\|PLUGINCAPS_SAVEICON\|PLUGINCAPS_SAVEIMAGE\|PLUGINCAPS_SAVESAMPLE\|PLUGINCAPS_SERIALIZE\|PLUGINCAPS_SOUND\|PLUGINCAPS_TIMERADAPTER\|PLUGINCAPS_VECTOR\|PLUGINCAPS_VIDEO\|POINTER\|POLYGON\|PRGTYPE_APPLET\|PRGTYPE_PROGRAM\|PRGTYPE_SCRIPT\|PRINT\|PURPLE\|PUSHBOTTOM\|PUSHLEFT\|PUSHRIGHT\|PUSHTOP\|PUZZLE\|QUADRECT\|QUARTERS\|RADIAL\|RANDOMEFFECT\|RANDOMPARAMETER\|RECEIVEALL\|RECEIVEBYTES\|RECEIVEDATA_PACKET\|RECEIVELINE\|RECTBACKCENTER\|RECTBACKEAST\|RECTBACKNORTH\|RECTBACKNORTHEAST\|RECTBACKNORTHWEST\|RECTBACKSOUTH\|RECTBACKSOUTHEAST\|RECTBACKSOUTHWEST\|RECTBACKWEST\|RECTCENTER\|RECTEAST\|RECTNORTH\|RECTNORTHEAST\|RECTNORTHWEST\|RECTSOUTH\|RECTSOUTHEAST\|RECTSOUTHWEST\|RECTWEST\|RED\|REMOVELAYER\|REQ_CAMERA\|REQ_GALLERY\|REQ_HIDEICONS\|REQ_MULTISELECT\|REQ_NORMAL\|REQ_SAVEMODE\|REQICON_ERROR\|REQICON_INFORMATION\|REQICON_NONE\|REQICON_QUESTION\|REQICON_WARNING\|REVEALBOTTOM\|REVEALLEFT\|REVEALRIGHT\|REVEALTOP\|RIGHT\|RIGHTOUT\|ROLLLEFT\|ROLLTOP\|RTS_OFF\|RTS_ON\|SAMPLE\|SANS\|SCALEMODE_AUTO\|SCALEMODE_LAYER\|SCALEMODE_NONE\|SCROLLBOTTOM\|SCROLLEAST\|SCROLLLEFT\|SCROLLNORTH\|SCROLLNORTHEAST\|SCROLLNORTHWEST\|SCROLLRIGHT\|SCROLLSOUTH\|SCROLLSOUTHEAST\|SCROLLSOUTHWEST\|SCROLLTOP\|SCROLLWEST\|SECONDS\|SEEK_BEGINNING\|SEEK_CURRENT\|SEEK_END\|SELMODE_COMBO\|SELMODE_LAYERS\|SELMODE_NORMAL\|SERIAL\|SERIF\|SERVER\|SHADOW\|SHAPE\|SHDWEAST\|SHDWNORTH\|SHDWNORTHEAST\|SHDWNORTHWEST\|SHDWSOUTH\|SHDWSOUTHEAST\|SHDWSOUTHWEST\|SHDWWEST\|SHORT\|SILVER\|SIMPLEBUTTON\|SINE\|SIZEWINDOW\|SLIDEBOTTOM\|SLIDELEFT\|SLIDERIGHT\|SLIDETOP\|SLOWSPEED\|SMOOTHOUT\|SMPFMT_WAVE\|SNAPDESKTOP\|SNAPDISPLAY\|SNAPWINDOW\|SPIRAL\|SPRITE\|SPRITE_VS_BOX\|SPRITE_VS_BRUSH\|STAR\|STDERR\|STDIN\|STDOUT\|STDPTR_BUSY\|STDPTR_CUSTOM\|STDPTR_SYSTEM\|STEREO16\|STEREO8\|STOP_1\|STOP_2\|STRETCHBOTTOM\|STRETCHLEFT\|STRETCHRIGHT\|STRETCHTOP\|STRING\|STRUDEL\|SUN\|SWISS\|TABLE\|TEAL\|TEXTOBJECT\|TEXTOUT\|THREAD\|TICKS\|TIMEOUT\|TIMER\|TOP\|TOPOUT\|TRUETYPE_DEFAULT\|TURNDOWNBOTTOM\|TURNDOWNLEFT\|TURNDOWNRIGHT\|TURNDOWNTOP\|UDPCLIENT\|UDPNONE\|UDPOBJECT\|UDPSERVER\|UNDERLINED\|UNDO\|UPLOADFILE_RESPONSE\|UPLOADFILE_STATUS\|UPNDOWN\|UPPERCURVE\|USEDSPACE\|USELAYERPOSITION\|USERDATA\|VANILLACOPY\|VBLINDS128\|VBLINDS16\|VBLINDS32\|VBLINDS64\|VBLINDS8\|VCLOSECURTAIN\|VCLOSEGATE\|VECTORPATH\|VFLIPCOIN\|VFLOWLEFT\|VFLOWRIGHT\|VIDDRV_HOLLYWOOD\|VIDDRV_OS\|VIDEO\|VIEWMODE_DATE\|VIEWMODE_ICONS\|VIEWMODE_NAME\|VIEWMODE_NONE\|VIEWMODE_SIZE\|VIEWMODE_TYPE\|VLINES\|VLINES2\|VLOWFLIPCOIN\|VOID\|VOPENCURTAIN\|VOPENGATE\|VSPLIT\|VSTRANGEPUSH\|VSTRETCHCENTER\|VSTRIPES\|VSTRIPES16\|VSTRIPES2\|VSTRIPES32\|VSTRIPES4\|VSTRIPES64\|VSTRIPES8\|WALLPAPERLEFT\|WALLPAPERTOP\|WATER1\|WATER2\|WATER3\|WATER4\|WHITE\|WORD\|YELLOW\|ZOOMCENTER\|ZOOMEAST\|ZOOMIN\|ZOOMNORTH\|ZOOMNORTHEAST\|ZOOMNORTHWEST\|ZOOMOUT\|ZOOMSOUTH\|ZOOMSOUTHEAST\|ZOOMSOUTHWEST\|ZOOMWEST\)\>" " Hollywood Functions -syn keyword hwFunction LowerStr UpperStr Val StrStr UnrightStr UnleftStr Chr MidStr RightStr LeftStr FindStr AddStr HexStr Asc StrLen ReplaceStr BinStr SplitStr PadNum StrToArray TrimStr ToString ToNumber UnmidStr CountStr InsertStr RepeatStr MD5Str CRC32Str FormatStr PatternFindStr PatternReplaceStr Eval PatternFindStrDirect PatternFindStrShort ArrayToStr Base64Str ToUserData ByteOffset CharOffset CharWidth ValidateStr ConvertStr ReverseStr ByteLen IsAlNum IsAlpha IsCntrl IsDigit IsGraph IsLower IsPrint IsPunct IsSpace IsUpper IsXDigit CompareStr ByteAsc ByteChr StartsWith EndsWith StripStr EmptyStr ByteVal ByteStrStr Abs Sin Cos Tan ASin ACos ATan ATan2 Ceil Floor Mod FrExp LdExp Sqrt Min Max Log Ld Ln Exp Deg Pow Rad Rnd RndF Add Sub Div Mul Round Int Frac Shr Shl Rt Wrap Limit BitSet BitTest BitClear BitXor BitComplement Sgn Sar Ror Rol Cast Hypot EndianSwap RndStrong Red Green Blue RGB ARGB MovePointer HidePointer SetPointer ShowPointer GetAttribute GetPen VWait SetFPSLimit GetFPSLimit IsPicture GetRealColor SaveSnapshot MixRGB CreateClipRegion SetClipRegion FreeClipRegion CreatePointer FreePointer AsyncDrawFrame CancelAsyncDraw FinishAsyncDraw DumpVideoTime GetRandomColor SetDrawTagsDefault BeginRefresh EndRefresh Intersection Box Plot Ellipse Line Circle Polygon SetFillStyle ReadPixel Cls Arc SetFormStyle SetLineWidth GetFillStyle GetFormStyle GetLineWidth MoveBrush MoveAnim MoveTextObject MoveLayer MoveSprite OpenFile Eof ReadChr ReadLine ReadString Seek WriteChr WriteLine WriteString Exists FileSize PathPart FilePart MakeDirectory GetVolumeInfo DeleteFile Execute Run ChangeDirectory GetVolumeName CloseFile ReadDirectory FullPath CopyFile Rename IsDirectory CRC32 WriteShort WriteInt WriteFloat ReadShort ReadInt ReadFloat FilePos MatchPattern FlushFile SetIOMode GetFileAttributes SetFileAttributes GetTempFileName FileLength CompressFile DecompressFile OpenDirectory CloseDirectory NextDirectoryEntry WriteFunction ReadFunction DefineVirtualFile ReadTable WriteTable GetCurrentDirectory ApplyPatch DefineVirtualFileFromString UndefineVirtualStringFile FileToString StringToFile GetEnv SetEnv UnsetEnv MD5 FileLines FileAttributes GetAsset ReadByte WriteByte ReadBytes WriteBytes DirectoryItems MoveFile UseCarriageReturn HaveVolume GetDirectoryEntry RewindDirectory CountDirectoryEntries MonitorDirectory WaitLeftMouse WaitRightMouse WaitKeyDown IsKeyDown WhileRightMouseDown WhileMouseDown WhileKeyDown IsLeftMouse IsRightMouse BreakWhileMouseOn SetEventTimeout GetEventCode LeftMouseQuit EscapeQuit CtrlCQuit EnableEvent DisableEvent RemoveButton RemoveKeyDown ModifyButton ModifyKeyDown WhileMouseOn CreateButton CreateKeyDown FreeEventCache ClearEvents CheckEvent WaitEvent MouseX MouseY MakeButton DeleteButton DisableButton EnableButton InstallEventHandler SetInterval SetTimeout ClearInterval ClearTimeout ChangeInterval DumpButtons WaitMidMouse IsMidMouse ResetKeyStates JoyDir JoyFire CountJoysticks BreakEventHandler CheckEvents CreatePort SendMessage ShowKeyboard HideKeyboard Wait OpenCatalog CloseCatalog GetCatalogString GetDate GetTime GetWeekday GetDateNum GetTimer PauseTimer ResumeTimer StartTimer StopTimer SystemRequest GetMemoryInfo End GetErrorName Sort DebugStr DebugVal DebugPrint ExitOnError GetLastError DebugOutput GetType IIf InsertItem RemoveItem ListItems StringRequest Unpack SetMetaTable GetMetaTable RawEqual RawGet RawSet GCInfo CollectGarbage Error WaitTimer FileRequest PathRequest IPairs Pairs NextItem GetVersion GetCommandLine GetProgramInfo ResetTimer GetConstant SetClipboard GetClipboard PeekClipboard ClearClipboard CompareDates OpenURL CopyTable FontRequest ListRequest ColorRequest GetSystemLanguage GetSystemCountry DebugPrompt GetFileArgument Assert ForEach ForEachI Concat GetObjectType GetObjectData SetObjectData ClearObjectData CopyObjectData HaveObjectData GetObjects RaiseOnError HaveObject GetPlugins IsNil HaveItem DisablePlugin EnablePlugin LoadPlugin HavePlugin GetSystemInfo LegacyControl DisableLineHook EnableLineHook IncreasePointer DecreasePointer GetApplicationInfo DebugPrintNR TableItems IsTableEmpty LoadPrefs SavePrefs DeletePrefs IsUnicode GetTimestamp GetCountryInfo GetLanguageInfo GetTimeZone TimestampToDate DateToTimestamp ParseDate MakeDate DateToUTC UTCToDate ValidateDate Pack ConsolePrint ConsolePrintNR ConsolePrompt Beep ShowNotification GetIconProperties SetIconProperties SetWBIcon OpenAmigaGuide CloseAmigaGuide ShowRinghioMessage GetApplicationList SendApplicationMessage ChangeApplicationIcon ReadRegistryKey WriteRegistryKey CreateShortcut SetTrayIcon GetShortcutPath ShowToast PerformSelector OpenResourceMonitor CloseResourceMonitor ImageRequest PermissionRequest Vibrate CallJavaMethod Undo EnableLayers DisableLayers SwapLayers InsertLayer ShowLayer HideLayer RemoveLayer SetLayerTransparency SetLayerLight SetLayerTint AddMove ClearMove DoMove FreeLayers NextFrame SetLayerName Collision DumpLayers ScaleLayer RotateLayer SetLayerStyle GetLayerStyle TransformLayer SetLayerAnchor LayerExists SetLayerZPos TranslateLayer SelectLayer CreateLayer ModifyLayerFrames GetLayerAtPos SetLayerShadow SetLayerFilter SetLayerBorder LayerToFront LayerToBack PlayLayer StopLayer PauseLayer ResumeLayer SeekLayer SetLayerVolume RemoveLayers SetFont SetFontColor TextHeight TextWidth ResetTabs AddTab Locate SetMargins SetFontStyle Print NPrint TextOut CreateTextObject DisplayTextObject FreeTextObject InKeyStr TextExtent ScaleTextObject CopyTextObject RotateTextObject OpenFont CloseFont UseFont GetAvailableFonts FreeGlyphCache SetDefaultEncoding AddFontPath GetKerningPair GetDefaultEncoding GetFontColor GetFontStyle PlayAnim FreeAnim ScaleAnim PlayAnimDisk LoadAnimFrame LoadAnim IsAnim CreateAnim CopyAnim GetAnimFrame DisplayAnimFrame ModifyAnimFrames SelectAnim SaveAnim BeginAnimStream WriteAnimFrame FinishAnimStream SetAnimFrameDelay ChangeDisplaySize SetTitle MoveDisplay HideDisplay ShowDisplay SetDisplayAttributes CreateDisplay FreeDisplay OpenDisplay CloseDisplay SelectDisplay ActivateDisplay ChangeDisplayMode GetDisplayModes GetMonitors CreateMenu FreeMenu SelectMenuItem DeselectMenuItem IsMenuItemSelected DisableMenuItem EnableMenuItem IsMenuItemDisabled GetPubScreens ShowScreen HideScreen SetScreenTitle GetFrontScreen SetSubtitle FreeSample LoadSample IsSound GetPatternPosition GetSongPosition PlaySubsong WaitPatternPosition WaitSongPosition WaitSampleEnd IsSamplePlaying SetVolume SetPitch SetPanning StopSample PlaySample SetMasterVolume IsSample CreateSample OpenMusic CloseMusic PlayMusic StopMusic PauseMusic ResumeMusic SeekMusic SetMusicVolume IsMusic IsMusicPlaying PlayModule StopModule PauseModule ResumeModule LoadModule FreeModule IsModule SaveSample GetSampleData CreateMusic FillMusicBuffer MixSample CopySample InsertSample FlushMusicBuffer IsChannelPlaying HaveFreeChannel StopChannel GetChannels SetChannelVolume OpenAudio CloseAudio ForceSound CreateBrush DisplayBrush DisplayBrushPart ScaleBrush FreeBrush TintBrush ReplaceColors InvertBrush FlipBrush MixBrush BrushToGray RotateBrush GetBrushLink SelectBrush CopyBrush SetBrushTransparency LoadBrush SelectMask SetMaskMode SaveBrush SelectAlphaChannel SetAlphaIntensity DeleteAlphaChannel CropBrush InvertMask InvertAlphaChannel FloodFill DeleteMask BeginDoubleBuffer EndDoubleBuffer Flip ConvertToBrush GrabDesktop TransformBrush TrimBrush RasterizeBrush BlurBrush EmbossBrush EdgeBrush SharpenBrush SolarizeBrush GammaBrush ContrastBrush ModulateBrush SepiaToneBrush CharcoalBrush SwirlBrush PixelateBrush BrushToMonochrome ChangeBrushTransparency CreateShadowBrush CreateBorderBrush WaterRippleBrush OilPaintBrush BrushToRGBArray RGBArrayToBrush PerspectiveDistortBrush ArcDistortBrush PolarDistortBrush BarrelDistortBrush CreateGradientBrush CreateTexturedBrush ReadBrushPixel WriteBrushPixel QuantizeBrush ReduceAlphaChannel IsBrushEmpty DisplayBGPic DisplayBGPicPart ScaleBGPic CreateGradientBGPic CreateRainbowBGPic CreateTexturedBGPic BrushToBGPic BGPicToBrush CreateBGPic FreeBGPic LoadBGPic SelectBGPic EndSelect CopyBGPic DisplayBrushFX DisplayTextObjectFX DisplayTransitionFX DisplayBGPicPartFX UndoFX ShowLayerFX HideLayerFX RemoveLayerFX GetRandomFX ClearScreen CreateSprite DisplaySprite RemoveSprite FreeSprite LoadSprite ScaleSprite CopySprite FlipSprite RemoveSprites SetSpriteZPos AllocMem FreeMem Poke Peek FillMem CopyMem ReadMem WriteMem DumpMem MemToTable TableToMem GetMemPointer GetMemString AllocMemFromPointer AllocMemFromVirtualFile MoveTo LineTo CurveTo RelMoveTo RelLineTo RelCurveTo DrawPath StartPath StartSubPath ClosePath AddArcToPath AddCircleToPath AddEllipseToPath AddBoxToPath SetLineJoin SetLineCap SetDash SetFillRule FreePath ClearPath IsPathEmpty GetCurrentPoint GetPathExtents CopyPath AppendPath AddTextToPath TranslatePath NormalizePath ForcePathUse SetVectorEngine PathItems PathToBrush GetFillRule GetLineJoin GetLineCap GetDash SetMiterLimit GetMiterLimit CreateIcon FreeIcon LoadIcon SaveIcon AddIconImage RemoveIconImage SetStandardIconImage OpenSerialPort CloseSerialPort ReadSerialData WriteSerialData FlushSerialPort SetBaudRate SetStopBits SetDataBits SetParity SetFlowControl SetDTR SetRTS GetBaudRate GetStopBits GetDataBits GetParity GetFlowControl GetDTR GetRTS PollSerialQueue ClearSerialQueue OpenConnection CloseConnection CreateServer CloseServer SendData ReceiveData GetConnectionIP GetConnectionPort GetHostName ToIP ToHostName DownloadFile UploadFile SetNetworkTimeout GetLocalIP GetLocalPort CreateUDPObject CloseUDPObject SendUDPData ReceiveUDPData IsOnline GetMACAddress GetConnectionProtocol GetLocalProtocol SetNetworkProtocol ResolveHostName OpenVideo CloseVideo PlayVideo StopVideo PauseVideo ResumeVideo SeekVideo IsVideo SetVideoSize SetVideoPosition SetVideoVolume GetVideoFrame IsVideoPlaying ForceVideoMode ForceVideoDriver DumpVideo DisplayVideoFrame SendRexxCommand RunRexxScript CreateRexxPort +syn keyword hwFunction ACos ARGB ASin ATan ATan2 Abs ActivateDisplay Add AddArcToPath AddBoxToPath AddCircleToPath AddEllipseToPath AddFontPath AddIconImage AddMove AddStr AddTab AddTextToPath AllocMem AllocMemFromPointer AllocMemFromVirtualFile AppendPath ApplyPatch Arc ArcDistortBrush ArrayToStr Asc Assert AsyncDrawFrame BGPicToBrush BarrelDistortBrush Base64Str Beep BeginAnimStream BeginDoubleBuffer BeginRefresh BinStr BitClear BitComplement BitSet BitTest BitXor Blue BlurBrush Box BreakEventHandler BreakWhileMouseOn BrushToBGPic BrushToGray BrushToMonochrome BrushToPenArray BrushToRGBArray ByteAsc ByteChr ByteLen ByteOffset ByteStrStr ByteVal CRC32 CRC32Str CallJavaMethod CancelAsyncDraw CancelAsyncOperation CanonizePath Cast Ceil ChangeApplicationIcon ChangeBrushTransparency ChangeDirectory ChangeDisplayMode ChangeDisplaySize ChangeInterval CharOffset CharWidth CharcoalBrush CheckEvent CheckEvents Chr Circle ClearClipboard ClearEvents ClearInterval ClearMove ClearObjectData ClearPath ClearScreen ClearSerialQueue ClearTimeout CloseAmigaGuide CloseAnim CloseAudio CloseCatalog CloseConnection CloseDirectory CloseDisplay CloseFile CloseFont CloseMusic ClosePath CloseResourceMonitor CloseSerialPort CloseServer CloseUDPObject CloseVideo Cls CollectGarbage Collision ColorRequest CompareDates CompareStr CompressFile Concat ConsolePrint ConsolePrintNR ConsolePrompt ContinueAsyncOperation ContrastBrush ContrastPalette ConvertStr ConvertToBrush CopyAnim CopyBGPic CopyBrush CopyFile CopyMem CopyObjectData CopyPalette CopyPath CopyPens CopySample CopySprite CopyTable CopyTextObject Cos CountDirectoryEntries CountJoysticks CountStr CreateAnim CreateBGPic CreateBorderBrush CreateBrush CreateButton CreateClipRegion CreateCoroutine CreateDisplay CreateGradientBGPic CreateGradientBrush CreateIcon CreateKeyDown CreateLayer CreateList CreateMenu CreateMusic CreatePalette CreatePointer CreatePort CreateRainbowBGPic CreateRexxPort CreateSample CreateServer CreateShadowBrush CreateShortcut CreateSprite CreateTextObject CreateTexturedBGPic CreateTexturedBrush CreateUDPObject CropBrush CtrlCQuit CurveTo CyclePalette DateToTimestamp DateToUTC DebugOutput DebugPrint DebugPrintNR DebugPrompt DebugStr DebugVal DecompressFile DecreasePointer DefineVirtualFile DefineVirtualFileFromString Deg DeleteAlphaChannel DeleteButton DeleteFile DeleteMask DeletePrefs DeselectMenuItem DeserializeTable DirectoryItems DisableButton DisableEvent DisableLayers DisableLineHook DisableMenuItem DisablePlugin DisableVWait DisplayAnimFrame DisplayBGPic DisplayBGPicPart DisplayBGPicPartFX DisplayBrush DisplayBrushFX DisplayBrushPart DisplaySprite DisplayTextObject DisplayTextObjectFX DisplayTransitionFX DisplayVideoFrame Div DoMove DownloadFile DrawPath DumpButtons DumpLayers DumpMem DumpVideo DumpVideoTime EdgeBrush Ellipse EmbossBrush EmptyStr EnableButton EnableEvent EnableLayers EnableLineHook EnableMenuItem EnablePlugin EnableVWait End EndDoubleBuffer EndRefresh EndSelect EndianSwap EndsWith Eof Error EscapeQuit Eval Execute Exists ExitOnError Exp ExtractPalette FileAttributes FileLength FileLines FilePart FilePos FileRequest FileSize FileToString FillMem FillMusicBuffer FindStr FinishAnimStream FinishAsyncDraw Flip FlipBrush FlipSprite FloodFill Floor FlushFile FlushMusicBuffer FlushSerialPort FontRequest ForEach ForEachI ForcePathUse ForceSound ForceVideoDriver ForceVideoMode FormatStr FrExp Frac FreeAnim FreeBGPic FreeBrush FreeClipRegion FreeDisplay FreeEventCache FreeGlyphCache FreeIcon FreeLayers FreeMem FreeMenu FreeModule FreePalette FreePath FreePointer FreeSample FreeSprite FreeTextObject FullPath GCInfo GammaBrush GammaPalette GetAnimFrame GetApplicationInfo GetApplicationList GetAsset GetAttribute GetAvailableFonts GetBaudRate GetBestPen GetBrushLink GetBrushPen GetBulletColor GetCatalogString GetChannels GetCharMaps GetClipboard GetCommandLine GetConnectionIP GetConnectionPort GetConnectionProtocol GetConstant GetCoroutineStatus GetCountryInfo GetCurrentDirectory GetCurrentPoint GetDTR GetDash GetDataBits GetDate GetDateNum GetDefaultEncoding GetDirectoryEntry GetDisplayModes GetEnv GetErrorName GetEventCode GetFPSLimit GetFileArgument GetFileAttributes GetFillRule GetFillStyle GetFlowControl GetFontColor GetFontStyle GetFormStyle GetFrontScreen GetHostName GetIconProperties GetItem GetKerningPair GetLanguageInfo GetLastError GetLayerAtPos GetLayerPen GetLayerStyle GetLineCap GetLineJoin GetLineWidth GetLocalIP GetLocalInterfaces GetLocalPort GetLocalProtocol GetMACAddress GetMemPointer GetMemString GetMemoryInfo GetMetaTable GetMiterLimit GetMonitors GetObjectData GetObjectType GetObjects GetPalettePen GetParity GetPathExtents GetPatternPosition GetPen GetPlugins GetProgramDirectory GetProgramInfo GetPubScreens GetRTS GetRandomColor GetRandomFX GetRealColor GetSampleData GetShortcutPath GetSongPosition GetStartDirectory GetStopBits GetSystemCountry GetSystemInfo GetSystemLanguage GetTempFileName GetTime GetTimeZone GetTimer GetTimestamp GetType GetVersion GetVideoFrame GetVolumeInfo GetVolumeName GetWeekday GrabDesktop Green HaveFreeChannel HaveItem HaveObject HaveObjectData HavePlugin HaveVolume HexStr HideDisplay HideKeyboard HideLayer HideLayerFX HidePointer HideScreen Hypot IIf IPairs IgnoreCase ImageRequest InKeyStr IncreasePointer InsertItem InsertLayer InsertSample InsertStr InstallEventHandler Int Intersection InvertAlphaChannel InvertBrush InvertMask InvertPalette IsAbsolutePath IsAlNum IsAlpha IsAnim IsBrushEmpty IsChannelPlaying IsCntrl IsDigit IsDirectory IsFinite IsGraph IsInf IsKeyDown IsLeftMouse IsLower IsMenuItemDisabled IsMenuItemSelected IsMidMouse IsModule IsMusic IsMusicPlaying IsNan IsNil IsOnline IsPathEmpty IsPicture IsPrint IsPunct IsRightMouse IsSample IsSamplePlaying IsSound IsSpace IsTableEmpty IsUnicode IsUpper IsVideo IsVideoPlaying IsXDigit JoyDir JoyFire LayerExists LayerToBack LayerToFront Ld LdExp LeftMouseQuit LeftStr LegacyControl Limit Line LineTo ListItems ListRequest Ln LoadAnim LoadAnimFrame LoadBGPic LoadBrush LoadIcon LoadModule LoadPalette LoadPlugin LoadPrefs LoadSample LoadSprite Locate Log LowerStr MD5 MD5Str MakeButton MakeDate MakeDirectory MakeHostPath MatchPattern Max MemToTable MidStr Min MixBrush MixRGB MixSample Mod ModifyAnimFrames ModifyButton ModifyKeyDown ModifyLayerFrames ModulateBrush ModulatePalette MonitorDirectory MouseX MouseY MoveAnim MoveBrush MoveDisplay MoveFile MoveLayer MovePointer MoveSprite MoveTextObject MoveTo Mul NPrint NextDirectoryEntry NextFrame NextItem NormalizePath OilPaintBrush OpenAmigaGuide OpenAnim OpenAudio OpenCatalog OpenConnection OpenDirectory OpenDisplay OpenFile OpenFont OpenMusic OpenResourceMonitor OpenSerialPort OpenURL OpenVideo Pack PadNum Pairs PaletteToGray ParseDate PathItems PathPart PathRequest PathToBrush PatternFindStr PatternFindStrDirect PatternFindStrShort PatternReplaceStr PauseLayer PauseModule PauseMusic PauseTimer PauseVideo Peek PeekClipboard PenArrayToBrush PerformSelector PermissionRequest PerspectiveDistortBrush Pi PixelateBrush PlayAnim PlayAnimDisk PlayLayer PlayModule PlayMusic PlaySample PlaySubsong PlayVideo Plot Poke PolarDistortBrush PollSerialQueue Polygon Pow Print QuantizeBrush RGB RGBArrayToBrush Rad RaiseOnError RasterizeBrush RawDiv RawEqual RawGet RawSet ReadBrushPixel ReadByte ReadBytes ReadChr ReadDirectory ReadFloat ReadFunction ReadInt ReadLine ReadMem ReadPen ReadPixel ReadRegistryKey ReadSerialData ReadShort ReadString ReadTable ReceiveData ReceiveUDPData Red ReduceAlphaChannel RefreshDisplay RelCurveTo RelLineTo RelMoveTo RemapBrush RemoveBrushPalette RemoveButton RemoveIconImage RemoveItem RemoveKeyDown RemoveLayer RemoveLayerFX RemoveLayers RemoveSprite RemoveSprites Rename RepeatStr ReplaceColors ReplaceStr ResetKeyStates ResetTabs ResetTimer ResolveHostName ResumeCoroutine ResumeLayer ResumeModule ResumeMusic ResumeTimer ResumeVideo ReverseFindStr ReverseStr RewindDirectory RightStr Rnd RndF RndStrong Rol Ror RotateBrush RotateLayer RotateTextObject Round Rt Run RunCallback RunRexxScript Sar SaveAnim SaveBrush SaveIcon SavePalette SavePrefs SaveSample SaveSnapshot ScaleAnim ScaleBGPic ScaleBrush ScaleLayer ScaleSprite ScaleTextObject Seek SeekLayer SeekMusic SeekVideo SelectAlphaChannel SelectAnim SelectBGPic SelectBrush SelectDisplay SelectLayer SelectMask SelectMenuItem SelectPalette SendApplicationMessage SendData SendMessage SendRexxCommand SendUDPData SepiaToneBrush SerializeTable SetAlphaIntensity SetAnimFrameDelay SetBaudRate SetBorderPen SetBrushDepth SetBrushPalette SetBrushPen SetBrushTransparency SetBrushTransparentPen SetBulletColor SetBulletPen SetChannelVolume SetClipRegion SetClipboard SetCycleTable SetDTR SetDash SetDataBits SetDefaultEncoding SetDepth SetDisplayAttributes SetDitherMode SetDrawPen SetDrawTagsDefault SetEnv SetEventTimeout SetFPSLimit SetFileAttributes SetFileEncoding SetFillRule SetFillStyle SetFlowControl SetFont SetFontColor SetFontStyle SetFormStyle SetGradientPalette SetIOMode SetIconProperties SetInterval SetLayerAnchor SetLayerBorder SetLayerDepth SetLayerFilter SetLayerLight SetLayerName SetLayerPalette SetLayerPen SetLayerShadow SetLayerStyle SetLayerTint SetLayerTransparency SetLayerTransparentPen SetLayerVolume SetLayerZPos SetLineCap SetLineJoin SetLineWidth SetListItems SetMargins SetMaskMode SetMasterVolume SetMetaTable SetMiterLimit SetMusicVolume SetNetworkProtocol SetNetworkTimeout SetObjectData SetPalette SetPaletteDepth SetPaletteMode SetPalettePen SetPaletteTransparentPen SetPanning SetParity SetPen SetPitch SetPointer SetRTS SetScreenTitle SetShadowPen SetSpriteZPos SetStandardIconImage SetStandardPalette SetStopBits SetSubtitle SetTimeout SetTimerElapse SetTitle SetTransparentPen SetTransparentThreshold SetTrayIcon SetVectorEngine SetVideoPosition SetVideoSize SetVideoVolume SetVolume SetWBIcon Sgn SharpenBrush Shl ShowDisplay ShowKeyboard ShowLayer ShowLayerFX ShowNotification ShowPointer ShowRinghioMessage ShowScreen ShowToast Shr Sin SolarizeBrush SolarizePalette Sort SplitStr Sqrt StartPath StartSubPath StartTimer StartsWith StopChannel StopLayer StopModule StopMusic StopSample StopTimer StopVideo StrLen StrStr StrToArray StringRequest StringToFile StripStr Sub SwapLayers SwirlBrush SystemRequest TableItems TableToMem Tan TextExtent TextHeight TextOut TextWidth TimerElapsed TimestampToDate TintBrush TintPalette ToHostName ToIP ToNumber ToString ToUserData TransformBrush TransformLayer TranslateLayer TranslatePath TrimBrush TrimStr UTCToDate UndefineVirtualStringFile Undo UndoFX UnleftStr UnmidStr Unpack UnrightStr UnsetEnv UploadFile UpperStr UseCarriageReturn UseFont VWait Val ValidateDate ValidateStr Vibrate Wait WaitEvent WaitKeyDown WaitLeftMouse WaitMidMouse WaitPatternPosition WaitRightMouse WaitSampleEnd WaitSongPosition WaitTimer WaterRippleBrush WhileKeyDown WhileMouseDown WhileMouseOn WhileRightMouseDown Wrap WriteAnimFrame WriteBrushPixel WriteByte WriteBytes WriteChr WriteFloat WriteFunction WriteInt WriteLine WriteMem WritePen WriteRegistryKey WriteSerialData WriteShort WriteString WriteTable YieldCoroutine " user-defined constants syn match hwUserConstant "#\<\u\+\>" diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim index d16ee1817f8d7..8ccb5574e77cb 100644 --- a/runtime/syntax/html.vim +++ b/runtime/syntax/html.vim @@ -1,10 +1,11 @@ " Vim syntax file " Language: HTML -" Maintainer: Jorge Maldonado Ventura +" Previous Maintainer: Jorge Maldonado Ventura " Previous Maintainer: Claudio Fleiner " Repository: https://notabug.org/jorgesumle/vim-html-syntax -" Last Change: 2018 Apr 7 -" Included patch from Jorge Maldonado Ventura to fix rendering +" Last Change: 2021 Mar 02 +" Included patch #7900 to fix comments +" Included patch #7916 to fix a few more things " " Please check :help html.vim for some comments and a description of the options @@ -57,11 +58,12 @@ syn keyword htmlTagName contained object optgroup q s tbody tfoot thead " new html 5 tags syn keyword htmlTagName contained article aside audio bdi canvas data -syn keyword htmlTagName contained datalist details embed figcaption figure -syn keyword htmlTagName contained footer header hgroup keygen main mark -syn keyword htmlTagName contained menuitem meter nav output picture +syn keyword htmlTagName contained datalist details dialog embed figcaption +syn keyword htmlTagName contained figure footer header hgroup keygen main +syn keyword htmlTagName contained mark menuitem meter nav output picture syn keyword htmlTagName contained progress rb rp rt rtc ruby section -syn keyword htmlTagName contained slot source template time track video wbr +syn keyword htmlTagName contained slot source summary template time track +syn keyword htmlTagName contained video wbr " legal arg names syn keyword htmlArg contained action @@ -78,26 +80,16 @@ syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1 " aria attributes -syn match htmlArg contained "\<\(aria-activedescendant\|aria-atomic\)\>" -syn match htmlArg contained "\<\(aria-autocomplete\|aria-busy\|aria-checked\)\>" -syn match htmlArg contained "\<\(aria-colcount\|aria-colindex\|aria-colspan\)\>" -syn match htmlArg contained "\<\(aria-controls\|aria-current\)\>" -syn match htmlArg contained "\<\(aria-describedby\|aria-details\)\>" -syn match htmlArg contained "\<\(aria-disabled\|aria-dropeffect\)\>" -syn match htmlArg contained "\<\(aria-errormessage\|aria-expanded\)\>" -syn match htmlArg contained "\<\(aria-flowto\|aria-grabbed\|aria-haspopup\)\>" -syn match htmlArg contained "\<\(aria-hidden\|aria-invalid\)\>" -syn match htmlArg contained "\<\(aria-keyshortcuts\|aria-label\)\>" -syn match htmlArg contained "\<\(aria-labelledby\|aria-level\|aria-live\)\>" -syn match htmlArg contained "\<\(aria-modal\|aria-multiline\)\>" -syn match htmlArg contained "\<\(aria-multiselectable\|aria-orientation\)\>" -syn match htmlArg contained "\<\(aria-owns\|aria-placeholder\|aria-posinset\)\>" -syn match htmlArg contained "\<\(aria-pressed\|aria-readonly\|aria-relevant\)\>" -syn match htmlArg contained "\<\(aria-required\|aria-roledescription\)\>" -syn match htmlArg contained "\<\(aria-rowcount\|aria-rowindex\|aria-rowspan\)\>" -syn match htmlArg contained "\<\(aria-selected\|aria-setsize\|aria-sort\)\>" -syn match htmlArg contained "\<\(aria-valuemax\|aria-valuemin\)\>" -syn match htmlArg contained "\<\(aria-valuenow\|aria-valuetext\)\>" +exe 'syn match htmlArg contained "\"' syn keyword htmlArg contained role " Netscape extensions @@ -123,11 +115,11 @@ syn keyword htmlArg contained summary tabindex valuetype version " html 5 arg names syn keyword htmlArg contained allowfullscreen async autocomplete autofocus syn keyword htmlArg contained autoplay challenge contenteditable contextmenu -syn keyword htmlArg contained controls crossorigin default dialog dirname -syn keyword htmlArg contained download draggable dropzone form formaction -syn keyword htmlArg contained formenctype formmethod formnovalidate formtarget -syn keyword htmlArg contained hidden high icon inputmode keytype kind list loop -syn keyword htmlArg contained low max min minlength muted nonce novalidate open +syn keyword htmlArg contained controls crossorigin default dirname download +syn keyword htmlArg contained draggable dropzone form formaction formenctype +syn keyword htmlArg contained formmethod formnovalidate formtarget hidden +syn keyword htmlArg contained high icon inputmode keytype kind list loop low +syn keyword htmlArg contained max min minlength muted nonce novalidate open syn keyword htmlArg contained optimum pattern placeholder poster preload syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate @@ -138,13 +130,19 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" " Comments (the real ones or the old netscape ones) if exists("html_wrong_comments") - syn region htmlComment start=+ + " Idem 8.2.4.43,44: Except and are parser errors + " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment + syn region htmlComment matchgroup=htmlComment start=+ is all right + syn match htmlCommentNested contained "\@!" + syn match htmlCommentError contained "[^>+ +syn region htmlComment start=++ keepend " server-parsed commands syn region htmlPreProc start=++ contains=htmlPreStmt,htmlPreError,htmlPreAttr @@ -265,7 +263,7 @@ hi def link htmlEndTag Identifier hi def link htmlArg Type hi def link htmlTagName htmlStatement hi def link htmlSpecialTagName Exception -hi def link htmlValue String +hi def link htmlValue String hi def link htmlSpecialChar Special if !exists("html_no_rendering") @@ -309,13 +307,10 @@ hi def link htmlPreProc PreProc hi def link htmlPreAttr String hi def link htmlPreProcAttrName PreProc hi def link htmlPreProcAttrError Error -hi def link htmlSpecial Special -hi def link htmlSpecialChar Special hi def link htmlString String hi def link htmlStatement Statement hi def link htmlComment Comment -hi def link htmlCommentPart Comment -hi def link htmlValue String +hi def link htmlCommentNested htmlError hi def link htmlCommentError htmlError hi def link htmlTagError htmlError hi def link htmlEvent javaScript diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim new file mode 100644 index 0000000000000..0018081da75cf --- /dev/null +++ b/runtime/syntax/i3config.vim @@ -0,0 +1,258 @@ +" Vim syntax file +" Language: i3 config file +" Original Author: Mohamed Boughaba +" Maintainer: Quentin Hibon (github user hiqua) +" Version: 0.4 +" Last Change: 2022 Jun 05 + +" References: +" http://i3wm.org/docs/userguide.html#configuring +" http://vimdoc.sourceforge.net/htmldoc/syntax.html +" +" +" Quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +scriptencoding utf-8 + +" Todo +syn keyword i3ConfigTodo TODO FIXME XXX contained + +" Comment +" Comments are started with a # and can only be used at the beginning of a line +syn match i3ConfigComment /^\s*#.*$/ contains=i3ConfigTodo + +" Font +" A FreeType font description is composed by: +" a font family, a style, a weight, a variant, a stretch and a size. +syn match i3ConfigFontSeparator /,/ contained +syn match i3ConfigFontSeparator /:/ contained +syn keyword i3ConfigFontKeyword font contained +syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigFontSeparator +syn match i3ConfigFontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=i3ConfigFontNamespace,i3ConfigFontSeparator,i3ConfigFontKeyword +syn match i3ConfigFontSize /\s\=\d\+\(px\)\?\s\?$/ contained +syn match i3ConfigFont /^\s*font\s\+.*$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace +syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace +syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace +syn match i3ConfigFont /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace + +" variables +syn match i3ConfigString /\(['"]\)\(.\{-}\)\1/ contained +syn match i3ConfigColor /#\w\{6}/ contained +syn match i3ConfigVariableModifier /+/ contained +syn match i3ConfigVariableAndModifier /+\w\+/ contained contains=i3ConfigVariableModifier +syn match i3ConfigVariable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=i3ConfigVariableModifier,i3ConfigVariableAndModifier +syn keyword i3ConfigInitializeKeyword set contained +syn match i3ConfigInitialize /^\s*set\s\+.*$/ contains=i3ConfigVariable,i3ConfigInitializeKeyword,i3ConfigColor,i3ConfigString + +" Include +syn keyword i3ConfigIncludeKeyword include contained +syn match i3ConfigInclude /^\s*include\s\+.*$/ contains=i3ConfigIncludeKeyword,i3ConfigString,i3ConfigVariable + +" Gaps +syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained +syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,i3ConfigNumber,i3ConfigVariable +syn keyword i3ConfigSmartGapKeyword on inverse_outer contained +syn match i3ConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=i3ConfigSmartGapKeyword +syn keyword i3ConfigSmartBorderKeyword on no_gaps contained +syn match i3ConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=i3ConfigSmartBorderKeyword + +" Keyboard bindings +syn keyword i3ConfigAction toggle fullscreen restart key import kill shrink grow contained +syn keyword i3ConfigAction focus move grow height width split layout resize restore reload mute unmute exit mode workspace container to contained +syn match i3ConfigModifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=i3ConfigVariableModifier +syn match i3ConfigNumber /\s\d\+/ contained +syn match i3ConfigUnit /\sp\(pt\|x\)/ contained +syn match i3ConfigUnitOr /\sor/ contained +syn keyword i3ConfigBindKeyword bindsym bindcode exec gaps border contained +syn match i3ConfigBindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained +syn match i3ConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigNumber,i3ConfigUnit,i3ConfigUnitOr,i3ConfigBindArgument,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword,i3ConfigBorderStyleKeyword + +" Floating +syn keyword i3ConfigSizeSpecial x contained +syn match i3ConfigNegativeSize /-/ contained +syn match i3ConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber,i3ConfigNegativeSize +syn match i3ConfigFloating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=i3ConfigVariable +syn match i3ConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=i3ConfigSize + +" Orientation +syn keyword i3ConfigOrientationKeyword vertical horizontal auto contained +syn match i3ConfigOrientation /^\s*default_orientation\s\+\(vertical\|horizontal\|auto\)\s\?$/ contains=i3ConfigOrientationKeyword + +" Layout +syn keyword i3ConfigLayoutKeyword default stacking tabbed contained +syn match i3ConfigLayout /^\s*workspace_layout\s\+\(default\|stacking\|tabbed\)\s\?$/ contains=i3ConfigLayoutKeyword + +" Border style +syn keyword i3ConfigBorderStyleKeyword none normal pixel contained +syn match i3ConfigBorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\(\s\+\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?\)\?\)\s\?$/ contains=i3ConfigBorderStyleKeyword,i3ConfigNumber,i3ConfigVariable + +" Hide borders and edges +syn keyword i3ConfigEdgeKeyword none vertical horizontal both smart smart_no_gaps contained +syn match i3ConfigEdge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\|smart\|smart_no_gaps\)\s\?$/ contains=i3ConfigEdgeKeyword + +" Arbitrary commands for specific windows (for_window) +syn keyword i3ConfigCommandKeyword for_window contained +syn region i3ConfigWindowStringSpecial start=+"+ skip=+\\"+ end=+"+ contained contains=i3ConfigString +syn region i3ConfigWindowCommandSpecial start="\[" end="\]" contained contains=i3ConfigWindowStringSpacial,i3ConfigString +syn match i3ConfigArbitraryCommand /^\s*for_window\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigCommandKeyword,i3ConfigBorderStyleKeyword,i3ConfigLayoutKeyword,i3ConfigOrientationKeyword,Size,i3ConfigNumber + +" Disable focus open opening +syn keyword i3ConfigNoFocusKeyword no_focus contained +syn match i3ConfigDisableFocus /^\s*no_focus\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigNoFocusKeyword + +" Move client to specific workspace automatically +syn keyword i3ConfigAssignKeyword assign contained +syn match i3ConfigAssignSpecial /→/ contained +syn match i3ConfigAssign /^\s*assign\s\+.*$/ contains=i3ConfigAssignKeyword,i3ConfigWindowCommandSpecial,i3ConfigAssignSpecial + +" X resources +syn keyword i3ConfigResourceKeyword set_from_resource contained +syn match i3ConfigResource /^\s*set_from_resource\s\+.*$/ contains=i3ConfigResourceKeyword,i3ConfigWindowCommandSpecial,i3ConfigColor,i3ConfigVariable + +" Auto start applications +syn keyword i3ConfigExecKeyword exec exec_always contained +syn match i3ConfigNoStartupId /--no-startup-id/ contained " We are not using i3ConfigBindArgument as only no-startup-id is supported here +syn match i3ConfigExec /^\s*exec\(_always\)\?\s\+.*$/ contains=i3ConfigExecKeyword,i3ConfigNoStartupId,i3ConfigString + +" Automatically putting workspaces on specific screens +syn keyword i3ConfigWorkspaceKeyword workspace contained +syn keyword i3ConfigOutput output contained +syn match i3ConfigWorkspace /^\s*workspace\s\+.*$/ contains=i3ConfigWorkspaceKeyword,i3ConfigNumber,i3ConfigString,i3ConfigOutput + +" Changing colors +syn keyword i3ConfigClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained +syn match i3ConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=i3ConfigClientColorKeyword,i3ConfigColor,i3ConfigVariable + +syn keyword i3ConfigTitleAlignKeyword left center right contained +syn match i3ConfigTitleAlign /^\s*title_align\s\+.*$/ contains=i3ConfigTitleAlignKeyword + +" Interprocess communication +syn match i3ConfigInterprocessKeyword /ipc-socket/ contained +syn match i3ConfigInterprocess /^\s*ipc-socket\s\+.*$/ contains=i3ConfigInterprocessKeyword + +" Mouse warping +syn keyword i3ConfigMouseWarpingKeyword mouse_warping contained +syn keyword i3ConfigMouseWarpingType output none contained +syn match i3ConfigMouseWarping /^\s*mouse_warping\s\+\(output\|none\)\s\?$/ contains=i3ConfigMouseWarpingKeyword,i3ConfigMouseWarpingType + +" Focus follows mouse +syn keyword i3ConfigFocusFollowsMouseKeyword focus_follows_mouse contained +syn keyword i3ConfigFocusFollowsMouseType yes no contained +syn match i3ConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusFollowsMouseKeyword,i3ConfigFocusFollowsMouseType + +" Popups during fullscreen mode +syn keyword i3ConfigPopupOnFullscreenKeyword popup_during_fullscreen contained +syn keyword i3ConfigPopuponFullscreenType smart ignore leave_fullscreen contained +syn match i3ConfigPopupOnFullscreen /^\s*popup_during_fullscreen\s\+\w\+\s\?$/ contains=i3ConfigPopupOnFullscreenKeyword,i3ConfigPopupOnFullscreenType + +" Focus wrapping +syn keyword i3ConfigFocusWrappingKeyword force_focus_wrapping focus_wrapping contained +syn keyword i3ConfigFocusWrappingType yes no contained +syn match i3ConfigFocusWrapping /^\s*\(force_\)\?focus_wrapping\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigFocusWrappingKeyword + +" Forcing Xinerama +syn keyword i3ConfigForceXineramaKeyword force_xinerama contained +syn match i3ConfigForceXinerama /^\s*force_xinerama\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigForceXineramaKeyword + +" Automatic back-and-forth when switching to the current workspace +syn keyword i3ConfigAutomaticSwitchKeyword workspace_auto_back_and_forth contained +syn match i3ConfigAutomaticSwitch /^\s*workspace_auto_back_and_forth\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigAutomaticSwitchKeyword + +" Delay urgency hint +syn keyword i3ConfigTimeUnit ms contained +syn keyword i3ConfigDelayUrgencyKeyword force_display_urgency_hint contained +syn match i3ConfigDelayUrgency /^\s*force_display_urgency_hint\s\+\d\+\s\+ms\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDelayUrgencyKeyword,i3ConfigNumber,i3ConfigTimeUnit + +" Focus on window activation +syn keyword i3ConfigFocusOnActivationKeyword focus_on_window_activation contained +syn keyword i3ConfigFocusOnActivationType smart urgent focus none contained +syn match i3ConfigFocusOnActivation /^\s*focus_on_window_activation\s\+\(smart\|urgent\|focus\|none\)\s\?$/ contains=i3ConfigFocusOnActivationKeyword,i3ConfigFocusOnActivationType + +" Automatic back-and-forth when switching to the current workspace +syn keyword i3ConfigDrawingMarksKeyword show_marks contained +syn match i3ConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDrawingMarksKeyword + +" Group mode/bar +syn keyword i3ConfigBlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_min_width workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained +syn region i3ConfigBlock start=+^\s*[^#]*s\?{$+ end=+^\s*[^#]*}$+ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend + +" Line continuation +syn region i3ConfigLineCont start=/^.*\\$/ end=/^.*$/ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend + +" Define the highlighting. +hi def link i3ConfigTodo Todo +hi def link i3ConfigComment Comment +hi def link i3ConfigFontContent Type +hi def link i3ConfigFocusOnActivationType Type +hi def link i3ConfigPopupOnFullscreenType Type +hi def link i3ConfigOrientationKeyword Type +hi def link i3ConfigMouseWarpingType Type +hi def link i3ConfigFocusFollowsMouseType Type +hi def link i3ConfigGapStyleKeyword Type +hi def link i3ConfigTitleAlignKeyword Type +hi def link i3ConfigSmartGapKeyword Type +hi def link i3ConfigSmartBorderKeyword Type +hi def link i3ConfigLayoutKeyword Type +hi def link i3ConfigBorderStyleKeyword Type +hi def link i3ConfigEdgeKeyword Type +hi def link i3ConfigAction Type +hi def link i3ConfigCommand Type +hi def link i3ConfigOutput Type +hi def link i3ConfigWindowCommandSpecial Type +hi def link i3ConfigFocusWrappingType Type +hi def link i3ConfigUnitOr Type +hi def link i3ConfigFontSize Constant +hi def link i3ConfigColor Constant +hi def link i3ConfigNumber Constant +hi def link i3ConfigUnit Constant +hi def link i3ConfigVariableAndModifier Constant +hi def link i3ConfigTimeUnit Constant +hi def link i3ConfigModifier Constant +hi def link i3ConfigString Constant +hi def link i3ConfigNegativeSize Constant +hi def link i3ConfigFontSeparator Special +hi def link i3ConfigVariableModifier Special +hi def link i3ConfigSizeSpecial Special +hi def link i3ConfigWindowSpecial Special +hi def link i3ConfigAssignSpecial Special +hi def link i3ConfigFontNamespace PreProc +hi def link i3ConfigBindArgument PreProc +hi def link i3ConfigNoStartupId PreProc +hi def link i3ConfigIncludeKeyword Identifier +hi def link i3ConfigFontKeyword Identifier +hi def link i3ConfigBindKeyword Identifier +hi def link i3ConfigOrientation Identifier +hi def link i3ConfigGapStyle Identifier +hi def link i3ConfigTitleAlign Identifier +hi def link i3ConfigSmartGap Identifier +hi def link i3ConfigSmartBorder Identifier +hi def link i3ConfigLayout Identifier +hi def link i3ConfigBorderStyle Identifier +hi def link i3ConfigEdge Identifier +hi def link i3ConfigFloating Identifier +hi def link i3ConfigCommandKeyword Identifier +hi def link i3ConfigNoFocusKeyword Identifier +hi def link i3ConfigInitializeKeyword Identifier +hi def link i3ConfigAssignKeyword Identifier +hi def link i3ConfigResourceKeyword Identifier +hi def link i3ConfigExecKeyword Identifier +hi def link i3ConfigWorkspaceKeyword Identifier +hi def link i3ConfigClientColorKeyword Identifier +hi def link i3ConfigInterprocessKeyword Identifier +hi def link i3ConfigMouseWarpingKeyword Identifier +hi def link i3ConfigFocusFollowsMouseKeyword Identifier +hi def link i3ConfigPopupOnFullscreenKeyword Identifier +hi def link i3ConfigFocusWrappingKeyword Identifier +hi def link i3ConfigForceXineramaKeyword Identifier +hi def link i3ConfigAutomaticSwitchKeyword Identifier +hi def link i3ConfigDelayUrgencyKeyword Identifier +hi def link i3ConfigFocusOnActivationKeyword Identifier +hi def link i3ConfigDrawingMarksKeyword Identifier +hi def link i3ConfigBlockKeyword Identifier +hi def link i3ConfigVariable Statement +hi def link i3ConfigArbitraryCommand Type + +let b:current_syntax = "i3config" diff --git a/runtime/syntax/ia64.vim b/runtime/syntax/ia64.vim index 22ce4623d9e34..2ff460688c05b 100644 --- a/runtime/syntax/ia64.vim +++ b/runtime/syntax/ia64.vim @@ -1,10 +1,9 @@ " Vim syntax file -" Language: IA-64 (Itanium) assembly language -" Maintainer: Parth Malwankar -" URL: http://www.geocities.com/pmalwankar (Home Page with link to my Vim page) -" http://www.geocities.com/pmalwankar/vim.htm (for VIM) -" File Version: 0.7 -" Last Change: 2006 Sep 08 +" Language: IA-64 (Itanium) assembly language +" Maintainer: Doug Kearns +" Previous Maintainer: Parth Malwankar +" File Version: 0.8 +" Last Change: 2020 Sep 25 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -15,16 +14,16 @@ endif "ignore case for assembly syn case ignore -" Identifier Keyword characters (defines \k) -setlocal iskeyword=@,48-57,#,$,.,:,?,@-@,_,~ - syn sync minlines=5 " Read the MASM syntax to start with " This is needed as both IA-64 as well as IA-32 instructions are supported source :p:h/masm.vim -syn region ia64Comment start="//" end="$" contains=ia64Todo +" Identifier Keyword characters (defines \k) +syn iskeyword @,48-57,#,$,.,:,?,@-@,_,~ + +syn region ia64Comment start="//" end="$" contains=ia64Todo syn region ia64Comment start="/\*" end="\*/" contains=ia64Todo syn match ia64Identifier "[a-zA-Z_$][a-zA-Z0-9_$]*" @@ -266,22 +265,22 @@ syn match ia64data "stringz\=\(\(\(\.ua\)\=\(\.msb\|\.lsb\)\=\)\|\(\(\.msb\|\.ls "put masm groups with our groups hi def link masmOperator ia64operator hi def link masmDirective ia64Directive -hi def link masmOpcode ia64Opcode +hi def link masmOpcode ia64Opcode hi def link masmIdentifier ia64Identifier -hi def link masmFloat ia64Float +hi def link masmFloat ia64Float "ia64 specific stuff -hi def link ia64Label Define -hi def link ia64Comment Comment +hi def link ia64Label Define +hi def link ia64Comment Comment hi def link ia64Directive Type -hi def link ia64opcode Statement +hi def link ia64opcode Statement hi def link ia64registers Operator -hi def link ia64string String +hi def link ia64string String hi def link ia64Hex Number -hi def link ia64Binary Number -hi def link ia64Octal Number -hi def link ia64Float Float -hi def link ia64Decimal Number +hi def link ia64Binary Number +hi def link ia64Octal Number +hi def link ia64Float Float +hi def link ia64Decimal Number hi def link ia64Identifier Identifier hi def link ia64data Type hi def link ia64delimiter Delimiter diff --git a/runtime/syntax/icon.vim b/runtime/syntax/icon.vim index 179d75cd28f7a..276bb584974eb 100644 --- a/runtime/syntax/icon.vim +++ b/runtime/syntax/icon.vim @@ -1,199 +1,211 @@ " Vim syntax file -" Language: Icon -" Maintainer: Wendell Turner -" URL: ftp://ftp.halcyon.com/pub/users/wturner/icon.vim -" Last Change: 2003 May 11 +" Language: Icon +" Maintainer: Doug Kearns +" Previous Maintainer: Wendell Turner (invalid last known address) +" Last Change: 2022 Jun 16 +" Contributor: eschen@alumni.princeton.edu 2002.09.18 -" quit when a syntax file was already loaded +" Prelude {{{1 if exists("b:current_syntax") finish endif -syn keyword iconFunction abs acos any args asin atan bal -syn keyword iconFunction callout center char chdir close collect copy -syn keyword iconFunction cos cset delay delete detab display dtor -syn keyword iconFunction entab errorclear exit exp find flush function -syn keyword iconFunction get getch getche getenv iand icom image -syn keyword iconFunction insert integer ior ishift ixor kbhit key -syn keyword iconFunction left list loadfunc log many map match -syn keyword iconFunction member move name numeric open ord pop -syn keyword iconFunction pos proc pull push put read reads -syn keyword iconFunction real remove rename repl reverse right rtod -syn keyword iconFunction runerr save seek seq set sin sort -syn keyword iconFunction sortf sqrt stop string system tab table -syn keyword iconFunction tan trim type upto variable where write writes - -" Keywords -syn match iconKeyword "&allocated" -syn match iconKeyword "&ascii" -syn match iconKeyword "&clock" -syn match iconKeyword "&collections" -syn match iconKeyword "&cset" -syn match iconKeyword "¤t" -syn match iconKeyword "&date" -syn match iconKeyword "&dateline" -syn match iconKeyword "&digits" -syn match iconKeyword "&dump" -syn match iconKeyword "&e" -syn match iconKeyword "&error" -syn match iconKeyword "&errornumber" -syn match iconKeyword "&errortext" -syn match iconKeyword "&errorvalue" -syn match iconKeyword "&errout" -syn match iconKeyword "&fail" -syn match iconKeyword "&features" -syn match iconKeyword "&file" -syn match iconKeyword "&host" -syn match iconKeyword "&input" -syn match iconKeyword "&lcase" -syn match iconKeyword "&letters" -syn match iconKeyword "&level" -syn match iconKeyword "&line" -syn match iconKeyword "&main" -syn match iconKeyword "&null" -syn match iconKeyword "&output" -syn match iconKeyword "&phi" -syn match iconKeyword "&pi" -syn match iconKeyword "&pos" -syn match iconKeyword "&progname" -syn match iconKeyword "&random" -syn match iconKeyword "®ions" -syn match iconKeyword "&source" -syn match iconKeyword "&storage" -syn match iconKeyword "&subject" -syn match iconKeyword "&time" -syn match iconKeyword "&trace" -syn match iconKeyword "&ucase" -syn match iconKeyword "&version" - -" Reserved words -syn keyword iconReserved break by case create default do -syn keyword iconReserved else end every fail if -syn keyword iconReserved initial link next not of -syn keyword iconReserved procedure repeat return suspend -syn keyword iconReserved then to until while - -" Storage class reserved words -syn keyword iconStorageClass global static local record - -syn keyword iconTodo contained TODO FIXME XXX BUG - -" String and Character constants -" Highlight special characters (those which have a backslash) differently -syn match iconSpecial contained "\\x\x\{2}\|\\\o\{3\}\|\\[bdeflnrtv\"\'\\]\|\\^c[a-zA-Z0-9]\|\\$" -syn region iconString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=iconSpecial -syn region iconCset start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=iconSpecial -syn match iconCharacter "'[^\\]'" - -" not sure about these -"syn match iconSpecialCharacter "'\\[bdeflnrtv]'" -"syn match iconSpecialCharacter "'\\\o\{3\}'" -"syn match iconSpecialCharacter "'\\x\x\{2}'" -"syn match iconSpecialCharacter "'\\^c\[a-zA-Z0-9]'" - -"when wanted, highlight trailing white space +syn iskeyword @,48-57,_,192-255,& + +" Not Top {{{1 +syn cluster iconNotTop contains=iconDocField,iconIncluded,iconStringSpecial,iconTodo,@Spell + +" Whitespace errors {{{1 if exists("icon_space_errors") - syn match iconSpaceError "\s*$" - syn match iconSpaceError " \+\t"me=e-1 + if !exists("icon_no_trail_space_error") + syn match iconSpaceError "\s\+$" display excludenl + endif + if !exists("icon_no_tab_space_error") + syn match iconSpaceError " \+\t"me=e-1 display + endif endif -"catch errors caused by wrong parenthesis -syn cluster iconParenGroup contains=iconParenError,iconIncluded,iconSpecial,iconTodo,iconUserCont,iconUserLabel,iconBitField +" Reserved words {{{1 +syn keyword iconReserved break by case create default do else every fail if +syn keyword iconReserved initial next not of repeat return suspend then to +syn keyword iconReserved until while -syn region iconParen transparent start='(' end=')' contains=ALLBUT,@iconParenGroup -syn match iconParenError ")" -syn match iconInParen contained "[{}]" +syn keyword iconStorageClass global static local record invocable +syn keyword iconLink link -syn case ignore +" Procedure definitions {{{1 +if exists("icon_no_procedure_fold") + syn region iconProcedure matchgroup=iconReserved start="\" end="\" contains=ALLBUT,@iconNotTop +else + syn region iconProcedure matchgroup=iconReserved start="\" end="\" contains=ALLBUT,@iconNotTop fold +endif -"integer number, or floating point number without a dot -syn match iconNumber "\<\d\+\>" +" Keywords {{{1 +syn keyword iconKeyword &allocated &ascii &clock &collections &cset ¤t +syn keyword iconKeyword &date &dateline &digits &dump &e &error &errornumber +syn keyword iconKeyword &errortext &errorvalue &errout &fail &features &file +syn keyword iconKeyword &host &input &lcase &letters &level &line &main &null +syn keyword iconKeyword &output &phi &pi &pos &progname &random ®ions +syn keyword iconKeyword &source &storage &subject &time &trace &ucase &version + +" Graphics keywords +syn keyword iconKeyword &col &control &interval &ldrag &lpress &lrelease +syn keyword iconKeyword &mdrag &meta &mpress &mrelease &rdrag &resize &row +syn keyword iconKeyword &rpress &rrelease &shift &window &x &y + +" Functions {{{1 +syn keyword iconFunction abs acos any args asin atan bal callout center char +syn keyword iconFunction chdir close collect copy cos cset delay delete detab +syn keyword iconFunction display dtor entab errorclear exit exp find flush +syn keyword iconFunction function get getch getche getenv iand icom image +syn keyword iconFunction insert integer ior ishift ixor kbhit key left list +syn keyword iconFunction loadfunc log many map match member move name numeric +syn keyword iconFunction open ord pop pos proc pull push put read reads real +syn keyword iconFunction remove rename repl reverse right rtod runerr save +syn keyword iconFunction seek self seq serial set sin sort sortf sqrt stop +syn keyword iconFunction string system tab table tan trim type upto variable +syn keyword iconFunction where write writes + +" Graphics functions +syn keyword iconFunction Active Alert Bg CenterString Clip Clone Color +syn keyword iconFunction ColorDialog ColorValue CopyArea Couple DrawArc +syn keyword iconFunction DrawCircle DrawCurve DrawImage DrawLine DrawPoint +syn keyword iconFunction DrawPolygon DrawRectangle DrawSegment DrawString +syn keyword iconFunction Enqueue EraseArea Event Fg FillArc FillCircle +syn keyword iconFunction FillPolygon FillRectangle Font FreeColor GotoRC +syn keyword iconFunction GotoXY LeftString Lower NewColor Notice OpenDialog +syn keyword iconFunction PaletteChars PaletteColor PaletteGrays PaletteKey +syn keyword iconFunction Pattern Pending Pixel Raise ReadImage RightString +syn keyword iconFunction SaveDialog SelectDialog Shade TextDialog TextWidth +syn keyword iconFunction ToggleDialog Uncouple WAttrib WClose WDefault WDelay +syn keyword iconFunction WDone WFlush WOpen WQuit WRead WReads WriteImage +syn keyword iconFunction WSync WWrite WWrites + +" String and character constants {{{1 +syn match iconStringSpecial "\\x\x\{2}\|\\\o\{3\}\|\\[bdeflnrtv\"\'\\]\|\\^[a-zA-Z0-9]" contained +syn match iconStringSpecial "\\$" contained +syn match iconStringSpecial "_\ze\s*$" contained + +syn region iconString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=iconStringSpecial +syn region iconCset start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=iconStringSpecial + +" Bracket errors {{{1 + +if !exists("icon_no_bracket_errors") + " catch errors caused by wrong brackets (ACE 2002.09.18) + syn cluster iconBracketGroup contains=iconBracketError,iconIncluded + syn region iconBracket start='\[' end='\]' contains=ALLBUT,@iconBracketGroup,@iconNotTop transparent + syn match iconBracketError "]" + + "catch errors caused by wrong braces (ACE 2002.09.18) + syn cluster iconBraceGroup contains=iconBraceError,iconIncluded + syn region iconBrace start='{' end='}' contains=ALLBUT,@iconBraceGroup,@iconNotTop transparent + syn match iconBraceError "}" + + "catch errors caused by wrong parenthesis + syn cluster iconParenGroup contains=iconParenError,iconIncluded + syn region iconParen start='(' end=')' contains=ALLBUT,@iconParenGroup,@iconNotTop transparent + syn match iconParenError ")" +end + +" Numbers {{{1 +syn case ignore -"floating point number, with dot, optional exponent -syn match iconFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\>" +" integer +syn match iconInteger "\<\d\+\>" +syn match iconInteger "\<\d\{1,2}[rR][a-zA-Z0-9]\+\>" -"floating point number, starting with a dot, optional exponent -syn match iconFloat "\.\d\+\(e[-+]\=\d\+\)\=\>" +" real with trailing dot +syn match iconReal "\<\d\+\." -"floating point number, without dot, with exponent -syn match iconFloat "\<\d\+e[-+]\=\d\+\>" +" real, with dot, optional exponent +syn match iconReal "\<\d\+\.\d*\%(e[-+]\=\d\+\)\=\>" -"radix number -syn match iconRadix "\<\d\{1,2}[rR][a-zA-Z0-9]\+\>" +" real, with leading dot, optional exponent +syn match iconReal "\.\d\+\%(e[-+]\=\d\+\)\=\>" +" real, without dot, with exponent +syn match iconReal "\<\d\+e[-+]\=\d\+\>" -" syn match iconIdentifier "\<[a-z_][a-z0-9_]*\>" +syn cluster iconNumber contains=iconInteger,iconReal syn case match -" Comment -syn match iconComment "#.*" contains=iconTodo,iconSpaceError - -syn region iconPreCondit start="^\s*$\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=iconComment,iconString,iconCharacter,iconNumber,iconCommentError,iconSpaceError - -syn region iconIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn match iconIncluded contained "<[^>]*>" -syn match iconInclude "^\s*$\s*include\>\s*["<]" contains=iconIncluded -"syn match iconLineSkip "\\$" - -syn cluster iconPreProcGroup contains=iconPreCondit,iconIncluded,iconInclude,iconDefine,iconInParen,iconUserLabel - -syn region iconDefine start="^\s*$\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,@iconPreProcGroup +" Comments {{{1 +syn keyword iconTodo TODO FIXME XXX BUG contained +syn match iconComment "#.*" contains=iconTodo,iconSpaceError,@Spell +syn match iconDocField "^#\s\+\zs\%(File\|Subject\|Authors\=\|Date\|Version\|Links\|Requires\|See also\):" contained -"wt:syn region iconPreProc "start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" "end="$" contains=ALLBUT,@iconPreProcGroup - -" Highlight User Labels - -" syn cluster iconMultiGroup contains=iconIncluded,iconSpecial,iconTodo,iconUserCont,iconUserLabel,iconBitField +if exists("icon_no_comment_fold") + syn region iconDocumentation start="\%^#\{2,}\%(\n#\+\%(\s\+.*\)\=\)\+" end="^#\+\n\s*$" contains=iconDocField keepend +else + syn region iconMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=iconComment keepend fold transparent + syn region iconDocumentation start="\%^#\{2,}\%(\n#\)\+" end="^#\+\n\%([^#]\|$\)" contains=iconDocField keepend fold +endif +" Preprocessor {{{1 +syn match iconPreInclude '^\s*\zs$\s*include\>\ze\s*"' nextgroup=iconIncluded skipwhite +syn match iconIncluded '"[^"]\+"' contained + +syn region iconPreDefine start="^\s*\zs$\s*\%(define\|undef\)\>" end="$" oneline contains=ALLBUT,@iconPreGroup +syn region iconPreProc start="^\s*\zs$\s*\%(error\|line\)\>" end="$" oneline contains=ALLBUT,@iconPreGroup +syn region iconPreConditional start="^\s*\zs$\s*\%(if\|ifdef\|ifndef\|elif\|else\|endif\)\>" end="$" oneline contains=iconComment,iconString,iconCset,iconNumber,iconSpaceError + +syn cluster iconPreGroup contains=iconPreCondit,iconPreInclude,iconIncluded,iconPreDefine + +syn match iconPreSymbol "_V\d\+" +syn keyword iconPreSymbol _ACORN _AMIGA _ARM_FUNCTIONS _ASCII _CALLING +syn keyword iconPreSymbol _CO_EXPRESSIONS _COMPILED _DIRECT_EXECUTION +syn keyword iconPreSymbol _DOS_FUNCTIONS _EBCDIC _EVENT_MONITOR +syn keyword iconPreSymbol _EXECUTABLE_IMAGES _EXTERNAL_FUNCTIONS +syn keyword iconPreSymbol _EXTERNAL_VALUES _INTERPRETED _KEYBOARD_FUNCTIONS +syn keyword iconPreSymbol _LARGE_INTEGERS _MACINTOSH _MEMORY_MONITOR _MSDOS +syn keyword iconPreSymbol _MSDOS_386 _MULTIREGION _MULTITASKING _OS2 _PIPES +syn keyword iconPreSymbol _PORT _PRESENTATION_MGR _RECORD_IO _STRING_INVOKE +syn keyword iconPreSymbol _SYSTEM_FUNCTION _UNIX _VISUALIZATION _VMS +syn keyword iconPreSymbol _WINDOW_FUNCTIONS _X_WINDOW_SYSTEM + +" Syncing {{{1 if !exists("icon_minlines") - let icon_minlines = 15 + let icon_minlines = 250 endif exec "syn sync ccomment iconComment minlines=" . icon_minlines -" Define the default highlighting. - -" Only when an item doesn't have highlighting - -" The default methods for highlighting. Can be overridden later +" Default Highlighting {{{1 -" hi def link iconSpecialCharacter iconSpecial +hi def link iconParenError iconError +hi def link iconBracketError iconError +hi def link iconBraceError iconError +hi def link iconSpaceError iconError +hi def link iconError Error -hi def link iconOctalError iconError -hi def link iconParenError iconError -hi def link iconInParen iconError -hi def link iconCommentError iconError -hi def link iconSpaceError iconError -hi def link iconCommentError iconError -hi def link iconIncluded iconString -hi def link iconCommentString iconString -hi def link iconComment2String iconString -hi def link iconCommentSkip iconComment +hi def link iconInteger Number +hi def link iconReal Float +hi def link iconString String +hi def link iconCset String +hi def link iconStringSpecial SpecialChar -hi def link iconUserLabel Label -hi def link iconCharacter Character -hi def link iconNumber Number -hi def link iconRadix Number -hi def link iconFloat Float -hi def link iconInclude Include hi def link iconPreProc PreProc -hi def link iconDefine Macro -hi def link iconError Error -hi def link iconStatement Statement -hi def link iconPreCondit PreCondit -hi def link iconString String -hi def link iconCset String -hi def link iconComment Comment -hi def link iconSpecial SpecialChar -hi def link iconTodo Todo -hi def link iconStorageClass StorageClass -hi def link iconFunction Statement -hi def link iconReserved Label -hi def link iconKeyword Operator +hi def link iconIncluded iconString +hi def link iconPreInclude Include +hi def link iconPreSymbol iconPreProc +hi def link iconPreDefine Define +hi def link iconPreConditional PreCondit -"hi def link iconIdentifier Identifier +hi def link iconStatement Statement +hi def link iconStorageClass StorageClass +hi def link iconFunction Function +hi def link iconReserved Label +hi def link iconLink Include +hi def link iconKeyword Keyword +hi def link iconComment Comment +hi def link iconTodo Todo +hi def link iconDocField SpecialComment +hi def link iconDocumentation Comment +" Postscript {{{1 let b:current_syntax = "icon" +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/syntax/idl.vim b/runtime/syntax/idl.vim index 6a4ce7e08773f..2f20dec2d7c75 100644 --- a/runtime/syntax/idl.vim +++ b/runtime/syntax/idl.vim @@ -7,7 +7,7 @@ " This is an experiment. IDL's structure is simple enough to permit a full " grammar based approach to rather than using a few heuristics. The result -" is large and somewhat repetative but seems to work. +" is large and somewhat repetitive but seems to work. " There are some Microsoft extensions to idl files that are here. Some of " them are disabled by defining idl_no_ms_extensions. diff --git a/runtime/syntax/indent.vim b/runtime/syntax/indent.vim index ddeae67e0d8a1..b2a1a0c85f400 100644 --- a/runtime/syntax/indent.vim +++ b/runtime/syntax/indent.vim @@ -1,7 +1,8 @@ " Vim syntax file -" Language: indent(1) configuration file -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2010-01-23 +" Language: indent(1) configuration file +" Maintainer: Doug Kearns +" Previous Maintainer: Nikolai Weibull +" Last Change: 2021 Nov 17 " indent_is_bsd: If exists, will change somewhat to match BSD implementation " " TODO: is the deny-all (a la lilo.vim nice or no?)... @@ -27,7 +28,7 @@ syn region indentComment start='//' skip='\\$' end='$' \ contains=indentTodo,@Spell if !exists("indent_is_bsd") - syn match indentOptions '-i\|--indentation-level\|-il\|--indent-level' + syn match indentOptions '-i\|--indent-level\|-il\|--indent-label' \ nextgroup=indentNumber skipwhite skipempty endif syn match indentOptions '-\%(bli\|c\%([bl]i\|[dip]\)\=\|di\=\|ip\=\|lc\=\|pp\=i\|sbi\|ts\|-\%(brace-indent\|comment-indentation\|case-brace-indentation\|declaration-comment-column\|continuation-indentation\|case-indentation\|else-endif-column\|line-comments-indentation\|declaration-indentation\|indent-level\|parameter-indentation\|line-length\|comment-line-length\|paren-indentation\|preprocessor-indentation\|struct-brace-indentation\|tab-size\)\)' diff --git a/runtime/syntax/initng.vim b/runtime/syntax/initng.vim index 1a912c1d051fe..959c79a17602d 100644 --- a/runtime/syntax/initng.vim +++ b/runtime/syntax/initng.vim @@ -1,6 +1,6 @@ " Vim syntax file " Language: initng .i files -" Maintainer: Elan RuusamīŋŊe +" Maintainer: Elan Ruusamäe " URL: http://glen.alkohol.ee/pld/initng/ " License: GPL v2 " Version: 0.13 @@ -20,7 +20,6 @@ endif syn case match let is_bash = 1 -unlet! b:current_syntax syn include @shTop syntax/sh.vim syn region initngService matchgroup=initngServiceHeader start="^\s*\(service\|virtual\|daemon\|class\|cron\)\s\+\(\(\w\|[-/*]\)\+\(\s\+:\s\+\(\w\|[-/*]\)\+\)\?\)\s\+{" end="}" contains=@initngServiceCluster diff --git a/runtime/syntax/inittab.vim b/runtime/syntax/inittab.vim index 82bf660105e62..fc5adfc3480c4 100644 --- a/runtime/syntax/inittab.vim +++ b/runtime/syntax/inittab.vim @@ -1,9 +1,8 @@ " Vim syntax file -" This is a GENERATED FILE. Please always refer to source file at the URI below. " Language: SysV-compatible init process control file `inittab' -" Maintainer: David Ne\v{c}as (Yeti) -" Last Change: 2002-09-13 -" URL: http://physics.muni.cz/~yeti/download/syntax/inittab.vim +" Maintainer: Donovan Keohane +" Previous Maintainer: David Ne\v{c}as (Yeti) +" Last Change: 2019-11-19 " Setup " quit when a syntax file was already loaded @@ -25,7 +24,7 @@ syn region inittabShString start=+"+ end=+"+ skip=+\\\\\|\\\"+ contained syn region inittabShString start=+'+ end=+'+ contained syn match inittabShOption "\s[-+][[:alnum:]]\+"ms=s+1 contained syn match inittabShOption "\s--[:alnum:][-[:alnum:]]*"ms=s+1 contained -syn match inittabShCommand "/\S\+" contained +syn match inittabShCommand "\S\+" contained syn cluster inittabSh add=inittabShOption,inittabShString,inittabShCommand " Keywords @@ -39,7 +38,7 @@ syn match inittabColonAction ":" contained nextgroup=inittabAction,inittabError syn match inittabAction "\w\+" contained nextgroup=inittabColonProcess,inittabError contains=inittabActionName syn match inittabColonProcess ":" contained nextgroup=inittabProcessPlus,inittabProcess,inittabError syn match inittabProcessPlus "+" contained nextgroup=inittabProcess,inittabError -syn region inittabProcess start="/" end="$" transparent oneline contained contains=@inittabSh,inittabComment +syn region inittabProcess start="\S" end="$" transparent oneline contained contains=@inittabSh,inittabComment " Define the default highlighting diff --git a/runtime/syntax/ipfilter.vim b/runtime/syntax/ipfilter.vim index a7b7df2bacd14..c00762623f74b 100644 --- a/runtime/syntax/ipfilter.vim +++ b/runtime/syntax/ipfilter.vim @@ -1,7 +1,7 @@ " ipfilter syntax file " Language: ipfilter configuration file " Maintainer: Hendrik Scholz -" Last Change: 2005 Jan 27 +" Last Change: 2022 Jun 14 " " http://www.wormulon.net/files/misc/ipfilter.vim " @@ -52,3 +52,4 @@ hi def link IPFNetmask String hi def link IPFAny Statement hi def link IPFProto Identifier +let b:current_syntax = 'ipfilter' diff --git a/runtime/syntax/iss.vim b/runtime/syntax/iss.vim index bd28c732b1a4e..34bb698368367 100644 --- a/runtime/syntax/iss.vim +++ b/runtime/syntax/iss.vim @@ -1,11 +1,11 @@ " Vim syntax file " Language: Inno Setup File (iss file) and My InnoSetup extension " Maintainer: Jason Mills (jmills@cs.mun.ca) -" Previous Maintainer: Dominique StīŋŊphan (dominique@mggen.com) -" Last Change: 2019 Sep 27 +" Previous Maintainer: Dominique StÊphan (dominique@mggen.com) +" Last Change: 2021 Aug 30 " " Todo: -" - The paramter String: is matched as flag string (because of case ignore). +" - The parameter String: is matched as flag string (because of case ignore). " - Pascal scripting syntax is not recognized. " - Embedded double quotes confuse string matches. e.g. "asfd""asfa" diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim index 4912942e8b500..a694cb2f1a85e 100644 --- a/runtime/syntax/j.vim +++ b/runtime/syntax/j.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: J -" Maintainer: David BÃŧrgin <676c7473@gmail.com> -" URL: https://github.com/glts/vim-j -" Last Change: 2015-01-11 +" Maintainer: David BÃŧrgin +" URL: https://gitlab.com/glts/vim-j +" Last Change: 2019-11-12 if exists('b:current_syntax') finish @@ -23,10 +23,10 @@ syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./ " Standard library names. A few names need to be defined with ":syntax match" " because they would otherwise take precedence over the corresponding jControl " and jDefineExpression items. -syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB dbhelp libjqt +syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFBE IFIOS IFJA IFJHS IFJNET IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCHAR2 JCHAR4 JCMPX JFL JINT JLIB JPTR JSB JSIZES JSTR JSTR2 JSTR4 JTYPES JVERSION LF LF2 LIBFILE TAB UNAME UNXLIB dbhelp libjqt syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows rxapply rxmerge table syntax keyword jStdlibConjunction bind cuts def on -syntax keyword jStdlibVerb AND Endian IFDEF OR XOR anddf android_exec_am android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring cleartags clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd loadtags mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset ta tagcp tagopen tagselect take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit +syntax keyword jStdlibVerb AND Endian IFDEF OR XOR abspath anddf android_exec_am android_exec_host android_getdisplaymetrics andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dbcut dberm dberr dbg dbinto dbjmp dblocals dblxq dblxs dbnxt dbout dbover dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf16 isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd mema memf memr memu memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolist tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount undquote unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/ syntax match jStdlibVerb /\<\%(Note\|\%(assert\|break\|do\)\.\@!\)\>/ diff --git a/runtime/syntax/jargon.vim b/runtime/syntax/jargon.vim index 05f45a2c9b7e5..c4b017d9e672d 100644 --- a/runtime/syntax/jargon.vim +++ b/runtime/syntax/jargon.vim @@ -1,23 +1,24 @@ " Vim syntax file " Language: Jargon File " Maintainer: Dan Church (https://github.com/h3xx) -" Last Change: 2019 Sep 27 +" Last Change: 2020 Mar 16 " " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif -syn match jargonChaptTitle /:[^:]*:/ -syn match jargonEmailAddr /[^<@ ^I]*@[^ ^I>]*/ -syn match jargonUrl +\(http\|ftp\)://[^\t )"]*+ -syn region jargonMark start="{" end="}" +syn region jargonHeader start="^:" end="$" contains=jargonChaptTitle +syn match jargonChaptTitle /:[^:]*:/ contained +syn match jargonEmailAddr /[+._A-Za-z0-9-]\+@[+._A-Za-z0-9-]\+/ +syn match jargonUrl +\(https\?\|ftp\)://[^\t )"]*+ +syn region jargonMark start="{[^\t {}]" end="}" " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link jargonChaptTitle Title -hi def link jargonEmailAddr Comment -hi def link jargonUrl Comment -hi def link jargonMark Label +hi def link jargonChaptTitle Title +hi def link jargonEmailAddr Comment +hi def link jargonUrl Comment +hi def link jargonMark Label let b:current_syntax = "jargon" diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index c9bb5dc2d4f7d..00d607194462c 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2018 July 26 +" Last Change: 2022 Jun 08 " Please check :help java.vim for comments on some of the options available. @@ -23,8 +23,6 @@ set cpo&vim syn match javaError "[\\@`]" syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" -syn match javaOK "\.\.\." - " use separate name so that it can be deleted in javacc.vim syn match javaError2 "#\|=<" hi def link javaError2 javaError @@ -59,8 +57,12 @@ syn match javaUserLabelRef "\k\+" contained syn match javaVarArg "\.\.\." syn keyword javaScopeDecl public protected private abstract +function s:isModuleInfoDeclarationCurrentBuffer() abort + return fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!' +endfunction + " Java Modules(Since Java 9, for "module-info.java" file) -if fnamemodify(bufname("%"), ":t") == "module-info.java" +if s:isModuleInfoDeclarationCurrentBuffer() syn keyword javaModuleStorageClass module transitive syn keyword javaModuleStmt open requires exports opens uses provides syn keyword javaModuleExternal to with @@ -72,20 +74,42 @@ if exists("java_highlight_java_lang_ids") endif if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang") " java.lang.* - syn match javaLangClass "\" - syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException + " + " The keywords of javaR_JavaLang, javaC_JavaLang, javaE_JavaLang, + " and javaX_JavaLang are sub-grouped according to the Java version + " of their introduction, and sub-group keywords (that is, class + " names) are arranged in alphabetical order, so that future newer + " 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 cluster javaTop add=javaR_JavaLang syn cluster javaClasses add=javaR_JavaLang hi def link javaR_JavaLang javaR_Java - syn keyword javaC_JavaLang Process RuntimePermission StringKeySet CharacterData01 Class ThreadLocal ThreadLocalMap CharacterData0E Package Character StringCoding Long ProcessImpl ProcessEnvironment Short AssertionStatusDirectives 1PackageInfoProxy UnicodeBlock InheritableThreadLocal AbstractStringBuilder StringEnvironment ClassLoader ConditionalSpecialCasing CharacterDataPrivateUse StringBuffer StringDecoder Entry StringEntry WrappedHook StringBuilder StrictMath State ThreadGroup Runtime CharacterData02 MethodArray Object CharacterDataUndefined Integer Gate Boolean Enum Variable Subset StringEncoder Void Terminator CharsetSD IntegerCache CharacterCache Byte CharsetSE Thread SystemClassLoaderAction CharacterDataLatin1 StringValues StackTraceElement Shutdown ShortCache String ConverterSD ByteCache Lock EnclosingMethodInfo Math Float Value Double SecurityManager LongCache ProcessBuilder StringEntrySet Compiler Number UNIXProcess ConverterSE ExternalData CaseInsensitiveComparator CharacterData00 NativeLibrary + " Member enumerations: + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + " Member classes: + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + syn match javaC_JavaLang "\%(\" + 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 "\" " See javaDebug. syn cluster javaTop add=javaC_JavaLang syn cluster javaClasses add=javaC_JavaLang hi def link javaC_JavaLang javaC_Java - syn keyword javaE_JavaLang IncompatibleClassChangeError InternalError UnknownError ClassCircularityError AssertionError ThreadDeath IllegalAccessError NoClassDefFoundError ClassFormatError UnsupportedClassVersionError NoSuchFieldError VerifyError ExceptionInInitializerError InstantiationError LinkageError NoSuchMethodError Error UnsatisfiedLinkError StackOverflowError AbstractMethodError VirtualMachineError OutOfMemoryError + syn keyword javaE_JavaLang AbstractMethodError ClassCircularityError ClassFormatError Error IllegalAccessError IncompatibleClassChangeError InstantiationError InternalError LinkageError NoClassDefFoundError NoSuchFieldError NoSuchMethodError OutOfMemoryError StackOverflowError ThreadDeath UnknownError UnsatisfiedLinkError VerifyError VirtualMachineError ExceptionInInitializerError UnsupportedClassVersionError AssertionError BootstrapMethodError syn cluster javaTop add=javaE_JavaLang syn cluster javaClasses add=javaE_JavaLang hi def link javaE_JavaLang javaE_Java - syn keyword javaX_JavaLang CloneNotSupportedException Exception NoSuchMethodException IllegalAccessException NoSuchFieldException Throwable InterruptedException ClassNotFoundException InstantiationException + syn keyword javaX_JavaLang ClassNotFoundException CloneNotSupportedException Exception IllegalAccessException InstantiationException InterruptedException NoSuchMethodException Throwable NoSuchFieldException ReflectiveOperationException syn cluster javaTop add=javaX_JavaLang syn cluster javaClasses add=javaX_JavaLang hi def link javaX_JavaLang javaX_Java @@ -118,7 +142,7 @@ if exists("java_space_errors") endif endif -syn region javaLabelRegion transparent matchgroup=javaLabel start="\" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString +syn region javaLabelRegion transparent matchgroup=javaLabel start="\" end="->" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel syn keyword javaLabel default @@ -126,7 +150,7 @@ syn keyword javaLabel default " annoying. Was: if !exists("java_allow_cpp_keywords") " The following cluster contains all java groups except the contained ones -syn cluster javaTop add=javaExternal,javaError,javaError,javaBranch,javaLabelRegion,javaLabel,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaClassDecl,javaClassDecl,javaScopeDecl,javaError,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg +syn cluster javaTop add=javaExternal,javaError,javaBranch,javaLabelRegion,javaLabel,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaScopeDecl,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg " Comments @@ -153,7 +177,7 @@ syn cluster javaTop add=javaComment,javaLineComment if !exists("java_ignore_javadoc") && main_syntax != 'jsp' syntax case ignore " syntax coloring for javadoc comments (HTML) - syntax include @javaHtml :p:h/html.vim + syntax include @javaHtml syntax/html.vim unlet b:current_syntax " HTML enables spell checking for all text that is not in a syntax item. This " is wrong for Java (all identifiers would be spell-checked), so it's undone @@ -336,7 +360,7 @@ hi def link htmlComment Special hi def link htmlCommentPart Special hi def link javaSpaceError Error -if fnamemodify(bufname("%"), ":t") == "module-info.java" +if s:isModuleInfoDeclarationCurrentBuffer() hi def link javaModuleStorageClass StorageClass hi def link javaModuleStmt Statement hi def link javaModuleExternal Include @@ -348,6 +372,7 @@ if main_syntax == 'java' unlet main_syntax endif +delfunction! s:isModuleInfoDeclarationCurrentBuffer let b:spell_options="contained" let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/syntax/javascript.vim b/runtime/syntax/javascript.vim index 5c6439f9e0a54..e513137984ee7 100644 --- a/runtime/syntax/javascript.vim +++ b/runtime/syntax/javascript.vim @@ -7,7 +7,7 @@ " (ss) repaired several quoting and grouping glitches " (ss) fixed regex parsing issue with multiple qualifiers [gi] " (ss) additional factoring of keywords, globals, and members -" Last Change: 2019 Sep 27 +" Last Change: 2022 Jun 09 " 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) " 2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder) @@ -39,8 +39,16 @@ syn region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contai syn region javaScriptEmbed start=+${+ end=+}+ contains=@javaScriptEmbededExpr +" number handling by Christopher Leonard chris.j.leonard@gmx.com syn match javaScriptSpecialCharacter "'\\.'" -syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" +syn match javaScriptNumber "\<0[bB][0-1]\+\(_[0-1]\+\)*\>" +syn match javaScriptNumber "\<0[oO][0-7]\+\(_[0-7]\+\)*\>" +syn match javaScriptNumber "\<0\([0-7]\+\(_[0-7]\+\)*\)\?\>" +syn match javaScriptNumber "\<0[xX][0-9a-fA-F]\+\(_[0-9a-fA-F]\+\)*\>" +syn match javaScriptNumber "\<\d\+\(_\d\+\)*[eE][+-]\?\d\+\>" +syn match javaScriptNumber "\<[1-9]\d*\(_\d\+\)*\(\.\(\d\+\(_\d\+\)*\([eE][+-]\?\d\+\)\?\)\?\)\?\>" +syn match javaScriptNumber "\<\(\d\+\(_\d\+\)*\)\?\.\d\+\(_\d\+\)*\([eE][+-]\?\d\+\)\?\>" +syn match javaScriptNumber "\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\([eE][+-]\?\d\+\)\?\)\?\>" syn region javaScriptRegexpString start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline syn keyword javaScriptConditional if else switch @@ -77,10 +85,10 @@ else syn match javaScriptParens "[()]" endif -syn sync fromstart -syn sync maxlines=100 - if main_syntax == "javascript" + syn sync fromstart + syn sync maxlines=100 + syn sync ccomment javaScriptComment endif diff --git a/runtime/syntax/javascriptreact.vim b/runtime/syntax/javascriptreact.vim index fc49691cb0877..0067a0b352230 100644 --- a/runtime/syntax/javascriptreact.vim +++ b/runtime/syntax/javascriptreact.vim @@ -1,2 +1,3 @@ -" Placeholder for backwards compatilibity: .jsx used to stand for JavaScript. +" Placeholder for backwards compatilibity: .jsx used to be associated with the +" filetpye JavaScript. runtime! syntax/javascript.vim diff --git a/runtime/syntax/jsonc.vim b/runtime/syntax/jsonc.vim new file mode 100644 index 0000000000000..d0df16bbf1afd --- /dev/null +++ b/runtime/syntax/jsonc.vim @@ -0,0 +1,44 @@ +" Vim syntax file +" Language: JSONC (JSON with Comments) +" Original Author: Izhak Jakov +" Acknowledgement: Based off of vim-jsonc maintained by Kevin Locke +" https://github.com/kevinoid/vim-jsonc +" License: MIT +" Last Change: 2021-07-01 + +" Ensure syntax is loaded once, unless nested inside another (main) syntax +" For description of main_syntax, see https://stackoverflow.com/q/16164549 +if !exists('g:main_syntax') + if exists('b:current_syntax') && b:current_syntax ==# 'jsonc' + finish + endif + let g:main_syntax = 'jsonc' +endif + +" Based on vim-json syntax +runtime! syntax/json.vim + +" Remove syntax group for comments treated as errors +if !exists("g:vim_json_warnings") || g:vim_json_warnings + syn clear jsonCommentError +endif + +syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze\(\_s*\/\/.*\_s*\)*[}\]]/ contains=jsonString +syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze\_s*\/\*\_.*\*\/\_s*[}\]]/ contains=jsonString +syn match jsonTrailingCommaError /\(,\)\+\ze\(\_s*\/\/.*\_s*\)*[}\]]/ +syn match jsonTrailingCommaError /\(,\)\+\ze\_s*\/\*\_.*\*\/\_s*[}\]]/ + +" Define syntax matching comments and their contents +syn keyword jsonCommentTodo FIXME NOTE TBD TODO XXX +syn region jsonLineComment start=+\/\/+ end=+$+ contains=@Spell,jsonCommentTodo keepend +syn region jsonComment start='/\*' end='\*/' contains=@Spell,jsonCommentTodo fold + +" Link comment syntax comment to highlighting +hi! def link jsonLineComment Comment +hi! def link jsonComment Comment + +" Set/Unset syntax to avoid duplicate inclusion and correctly handle nesting +let b:current_syntax = 'jsonc' +if g:main_syntax ==# 'jsonc' + unlet g:main_syntax +endif diff --git a/runtime/syntax/julia.vim b/runtime/syntax/julia.vim new file mode 100644 index 0000000000000..ec7eabf109abc --- /dev/null +++ b/runtime/syntax/julia.vim @@ -0,0 +1,550 @@ +" Vim syntax file +" Language: julia +" Maintainer: Carlo Baldassi +" Homepage: https://github.com/JuliaEditorSupport/julia-vim +" Last Change: 2021 Aug 04 + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +if version < 704 + " this is used to disable regex syntax like `\@3<=' + " on older vim versions + function! s:d(x) + return '' + endfunction +else + function! s:d(x) + return string(a:x) + endfunction +endif + +scriptencoding utf-8 + +let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0) +let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1) +let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1) + +let s:julia_highlight_operators = get(g:, "julia_highlight_operators", 1) + +" List of characters, up to \UFF, which cannot be used in identifiers. +" (It includes operator characters; we don't consider them identifiers.) +" This is used mostly in lookbehinds with `\@<=`, e.g. when we need to check +" that that we're not in the middle of an identifier. +" It doesn't include a few characters (spaces and all closing parentheses) +" because those may or may not be valid in the lookbehind on a case-by-case +" basis. +let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F' + \ . '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C' + \ . '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7' + +" The complete list +let s:nonidS_chars = '[:space:])\U5D}' . s:nonid_chars + + +" List of all valid operator chars up to \UFF (NOTE: they must all be included +" in s:nonidS_chars, so that if we include that, then this is redundant) +" It does not include '!' since it can be used in an identifier. +" The list contains the following characters: '%&*+-/<=>\\^|~ÂŦÂąÃ—Ãˇ' +let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\UF7' + +" List of all valid operator chars above \UFF +" Written with ranges for performance reasons +" The list contains the following characters: 'â€Ļ⁝⅋←↑→↓↔↚↛↜↝↞↠â†ĸâ†Ŗâ†¤â†Ļ↩â†Ēâ†Ģâ†Ŧ↮â†ļ↷â†ēâ†ģâ†ŧâ†Ŋ⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠â‡ĸ⇴â‡ĩâ‡ļ⇷⇸⇹â‡ēâ‡ģâ‡ŧâ‡Ŋ⇾â‡ŋ∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤âˆĨâˆĻ∧∨∊âˆĒ∡∸âˆēâˆģâˆŊ∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡â‰ĸâ‰Ŗâ‰¤â‰Ĩâ‰Ļ≧≨≩â‰Ēâ‰Ģâ‰Ŧâ‰­â‰Žâ‰¯â‰°â‰ąâ‰˛â‰ŗâ‰´â‰ĩâ‰ļ≷≸≹â‰ēâ‰ģâ‰ŧâ‰Ŋ≾â‰ŋ⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡âŠĸâŠŖâŠŠâŠŦâŠŽâŠ°âŠąâŠ˛âŠŗâŠ´âŠĩâŠļ⊷âŠģâŠŧâŠŊ⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡â‹ĸâ‹Ŗâ‹¤â‹Ĩâ‹Ļ⋧⋨⋩â‹Ēâ‹Ģâ‹Ŧâ‹­â‹Žâ‹¯â‹°â‹ąâ‹˛â‹ŗâ‹´â‹ĩâ‹ļ⋷⋸⋹â‹ēâ‹ģâ‹ŧâ‹Ŋ⋾â‹ŋâŒŋ▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱âŸĩâŸļ⟷⟹âŸēâŸģâŸŧâŸŊ⟾âŸŋ⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠âĨ„âĨ…âĨ†âĨ‡âĨˆâĨ‰âĨŠâĨ‹âĨŒâĨâĨŽâĨâĨâĨ‘âĨ’âĨ“âĨ”âĨ•âĨ–âĨ—âĨ˜âĨ™âĨšâĨ›âĨœâĨâĨžâĨŸâĨ âĨĄâĨĸâĨŖâĨ¤âĨĨâĨĻâĨ§âĨ¨âĨŠâĨĒâĨĢâĨŦâĨ­âĨŽâĨ¯âĨ°âώâϏâĻŧâĻžâĻŋâ§€â§â§Ąâ§Ŗâ§¤â§Ĩâ§´â§ļ⧡â§ēâ§ģ⨇⨈⨝⨟â¨ĸâ¨Ŗâ¨¤â¨Ĩâ¨Ļ⨧⨨⨊â¨Ēâ¨Ģâ¨Ŧâ¨­â¨Žâ¨°â¨ąâ¨˛â¨ŗâ¨´â¨ĩâ¨ļ⨡⨸⨚â¨ēâ¨ģâ¨ŧâ¨Ŋ⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡âŠĸâŠŖâŠĻ⊧âŠĒâŠĢâŠŦâŠ­âŠŽâŠ¯âŠ°âŠąâŠ˛âŠŗâŠ´âŠĩâŠļ⊡⊸⊚âŠēâŠģâŠŧâŠŊ⊞âŠŋâĒ€âǁâĒ‚âǃâĒ„âĒ…âdžâLJâLjâljâNJâĒ‹ânjâĒâĒŽâĒâǐâĒ‘âĒ’âĒ“âĒ”âĒ•âĒ–âĒ—âǘâĒ™âǚâĒ›âǜâĒâĒžâǟâĒ âĒĄâĒĸâĒŖâǤâĒĨâĒĻâǧâǍâĒŠâĒĒâĒĢâĒŦâĒ­âĒŽâǝâǰâĒąâǞâĒŗâĒ´âĒĩâĒļâǎâǏâĒšâĒēâĒģâĒŧâĒŊâĒžâĒŋâĢ€ấâĢ‚ẫâĢ„âĢ…â̆â̇â̈ẩâ̊âĢ‹â̌âĢâĢŽâĢâ̐âĢ‘âĢ’âĢ“âĢ”âĢ•âĢ–âĢ—â̘âĢ™âĢ›â̎â̏âĢšâĢēâŦ°âŦąâŦ˛âŦŗâŦ´âŦĩâŦļâŦˇâŦ¸âŦšâŦēâŦģâŦŧâŦŊâŦžâŦŋ⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌īŋŠīŋĒīŋĢīŋŦ' +let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC' + +" Full operators regex +let s:operators = '\%(' . '\.\%([-+*/^Ãˇ%|&âŠģ]\|//\|\\\|>>\|>>>\?\)\?=' . + \ '\|' . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' . + \ '\|' . '\.\?[!' . s:op_chars . s:op_chars_wc . ']' . + \ '\)' + + +" Characters that can be used to start an identifier. Above \UBF we don't +" bother checking. (If a UTF8 operator is used, it will take precedence anyway.) +let s:id_charsH = '\%([A-Za-z_\UA2-\UA6\UA9\UAA\UAE\UB0\UB5\UBA]\|[^\U00-\UBF]\)' +" Characters that can appear in an identifier, starting in 2nd position. Above +" \UBF we check for operators since we need to stop the identifier if one +" appears. We don't check for invalid characters though. +let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\UBC-\UBE]\|[^\U00-\UBF]\@=[^' . s:op_chars_wc . ']\)' + +" A valid julia identifier, more or less +let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)' + + + +syn case match + +syntax cluster juliaExpressions contains=@juliaParItems,@juliaStringItems,@juliaKeywordItems,@juliaBlocksItems,@juliaTypesItems,@juliaConstItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaNumberItems,@juliaCommentItems,@juliaErrorItems,@juliaSyntaxRegions +syntax cluster juliaExprsPrintf contains=@juliaExpressions,@juliaPrintfItems +syntax cluster juliaExprsNodot contains=@juliaParItems,@juliaStringItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaCommentItems,juliaIdSymbol + +syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar +syntax cluster juliaKeywordItems contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword +syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock +syntax cluster juliaTypesItems contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther + +syntax cluster juliaConstItems contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler + +syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra +syntax cluster juliaSymbolItems contains=juliaPossibleSymbol +syntax cluster juliaNumberItems contains=juliaNumbers +syntax cluster juliaStringItems contains=juliaChar,juliaString,juliabString,juliasString,juliaShellString,juliaDocString,juliaRegEx +syntax cluster juliaPrintfItems contains=juliaPrintfParBlock,juliaPrintfString +syntax cluster juliaOperatorItems contains=juliaOperator,juliaRangeOperator,juliaCTransOperator,juliaTernaryRegion,juliaColon,juliaSemicolon,juliaComma +syntax cluster juliaCommentItems contains=juliaCommentL,juliaCommentM +syntax cluster juliaErrorItems contains=juliaErrorPar,juliaErrorEnd,juliaErrorElse,juliaErrorCatch,juliaErrorFinally + +syntax cluster juliaSyntaxRegions contains=juliaIdSymbol,juliaTypeOperatorR2,juliaTypeOperatorR3,juliaWhereR,juliaDotted + +syntax cluster juliaSpellcheckStrings contains=@spell +syntax cluster juliaSpellcheckDocStrings contains=@spell +syntax cluster juliaSpellcheckComments contains=@spell + +if !s:julia_spellcheck_docstrings + syntax cluster juliaSpellcheckDocStrings remove=@spell +endif +if !s:julia_spellcheck_strings + syntax cluster juliaSpellcheckStrings remove=@spell +endif +if !s:julia_spellcheck_comments + syntax cluster juliaSpellcheckComments remove=@spell +endif + +syntax match juliaSemicolon display ";" +syntax match juliaComma display "," +syntax match juliaColon display ":" + +" A dot can introduce a sort of 'environment' such that words after it are not +" recognized as keywords. This has low precedence so that it can be overridden +" by operators +syntax match juliaDotted transparent "\.\s*[^])}.]" contains=@juliaExprsNodot +syntax match juliaDottedT contained transparent "\.\s*[^])}.]" contains=@juliaExprsNodot,juliaType + +syntax match juliaErrorPar display "[])}]" +syntax match juliaErrorEnd display "\" +syntax match juliaErrorElse display "\<\%(else\|elseif\)\>" +syntax match juliaErrorCatch display "\" +syntax match juliaErrorFinally display "\" +syntax match juliaErrorSemicol display contained ";" + +syntax region juliaParBlock matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor +syntax region juliaParBlockInRange matchgroup=juliaParDelim contained start="(" end=")" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor +syntax region juliaSqBraIdxBlock matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS +exec 'syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS' +syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=juliaType,juliaDottedT,@juliaExpressions + +exec 'syntax match juliaType contained "\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"' + +" This is a generic identifier followed by some symbol, either a type +" operator (<: or >:), or an open parenthesis, or an open curly bracket. +" It's used to recognize one of the contained regions looking for identifiers +" only once. Once recognized, those regions no longer need to use the +" expensive s:idregex. +exec 'syntax match juliaIdSymbol transparent "' . s:idregex . '\%(\s*[<>]:\|\.\?(\|{\|\"\)\@=" contains=juliaFunctionCall,juliaParamType,juliaStringPrefixed,juliaTypeOperatorR1' + +syntax match juliaFunctionCall contained "[^{([:space:]<>\"]\+(\@=" nextgroup=juliaParBlock + +exec 'syntax match juliaFunctionDef contained transparent "\%(\<\%(function\|macro\)\)\@'.s:d(8).'<=\s\+\zs' . s:idregex . '\%(\.' . s:idregex . '\)*\ze\s*\%((\|\send\>\|$\)" contains=juliaFunctionName' +exec 'syntax match juliaFunctionName contained "\%(\<\%(function\|macro\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"' + +exec 'syntax match juliaStructR contained transparent "\%(\<\%(\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*' . s:idregex . '\>\(\s*(\)\@!" contains=juliaType' + +syntax match juliaKeyword display "\<\%(return\|local\|global\|const\)\>" +syntax match juliaInfixKeyword display "\%(=\s*\)\@\S\@!\%(\s*=\)\@!" + +" The import/export/using keywords introduce a sort of special parsing +" environment with its own rules +exec 'syntax region juliaImportLine matchgroup=juliaKeyword excludenl start="\<\%(import\|using\|export\)\>" skip="\%(\%(\<\%(import\|using\|export\)\>\)\|^\)\@'.s:d(6).'<=$" end="$" end="\%([])}]\)\@=" contains=@juliaExpressions,juliaAsKeyword,@juliaContinuationItems,juliaMacroName' +syntax match juliaAsKeyword display contained "\" + +syntax match juliaRepKeyword display "\<\%(break\|continue\)\>" +syntax region juliaConditionalBlock matchgroup=juliaConditional start="\" end="\" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold +syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="\" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock +syntax region juliaConditionalEBlock matchgroup=juliaConditional transparent contained start="\" end="\"me=s-1 contains=@juliaExpressions +syntax region juliaWhileBlock matchgroup=juliaRepeat start="\" end="\" contains=@juliaExpressions fold +syntax region juliaForBlock matchgroup=juliaRepeat start="\" end="\" contains=@juliaExpressions,juliaOuter fold +syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold +syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions,juliaFunctionDef fold +syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions,juliaFunctionDef fold +syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold +syntax region juliaStructBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions,juliaStructR fold +syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions,juliaStructR fold +syntax region juliaLetBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold +syntax region juliaDoBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold +syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\<\%(bare\)\?module\>" end="\" contains=@juliaExpressions fold +syntax region juliaExceptionBlock matchgroup=juliaException start="\" end="\" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold +syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="\" end="\"me=s-1 contains=@juliaExpressions,juliaFinallyBlock +syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="\" end="\"me=s-1 contains=@juliaExpressions +syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="\" end="\" fold contains=@juliaExpressions,juliaStructR +syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="\" end="\" fold contains=@juliaExpressions,juliaStructR + +exec 'syntax region juliaComprehensionFor matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor' +syntax match juliaComprehensionIf contained "\" + +exec 'syntax match juliaOuter contained "\"' + +syntax match juliaRangeKeyword contained "\<\%(begin\|end\)\>" + +syntax match juliaBaseTypeBasic display "\<\%(\%(N\|Named\)\?Tuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\|Nothing\|Some\|Missing\)\>" +syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|\%(Abstract\)\?Irrational\|Enum\|BigInt\|BigFloat\|MathConst\|ComplexF\%(16\|32\|64\)\)\>" +syntax match juliaBaseTypeC display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\|void\)\)\>" +syntax match juliaBaseTypeError display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|ReadOnlyMemory\|StringIndex\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Missing\|\%(Process\|Task\)Failed\)Exception\|DimensionMismatch\|SegmentationFault\)\>" +syntax match juliaBaseTypeIter display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\|CartesianIndices\)\>" +syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\|Substitution\)\?String\>" +syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|\%(Sparse\|Row\)Vector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>" +syntax match juliaBaseTypeDict display "\<\%(WeakKey\|Id\|Abstract\)\?Dict\>" +syntax match juliaBaseTypeSet display "\<\%(\%(Abstract\|Bit\)\?Set\)\>" +syntax match juliaBaseTypeIO display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\|GenericIOBuffer\)\>" +syntax match juliaBaseTypeProcess display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>" +syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Abstract\|Lin\|Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>" +syntax match juliaBaseTypeRegex display "\" +syntax match juliaBaseTypeFact display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>" +syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>" +syntax match juliaBaseTypeRound display "\" +syntax match juliaBaseTypeSpecial display "\<\%(LocalProcess\|ClusterManager\)\>" +syntax match juliaBaseTypeRandom display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>" +syntax match juliaBaseTypeDisplay display "\<\%(Text\(Display\)\?\|\%(Abstract\)\?Display\|MIME\|HTML\)\>" +syntax match juliaBaseTypeTime display "\<\%(Date\%(Time\)\?\|DateFormat\)\>" +syntax match juliaBaseTypeOther display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>" + +syntax match juliaConstNum display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|Ī€\)\>\)" +" Note: recognition of ℯ, which Vim does not consider a valid identifier, is +" complicated. We detect possible uses by just looking for the character (for +" performance) and then check that it's actually used by its own. +" (This also tries to detect preceding number constants; it does so in a crude +" way.) +syntax match juliaPossibleEuler "ℯ" contains=juliaEuler +exec 'syntax match juliaEuler contained "\%(\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\%(.\?[0-9][.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze[' . s:nonidS_chars . s:op_chars_wc . ']"' +syntax match juliaConstBool display "\<\%(true\|false\)\>" +syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|PROGRAM_FILE\|DEPOT_PATH\)\>" +syntax match juliaConstIO display "\<\%(std\%(out\|in\|err\)\|devnull\)\>" +syntax match juliaConstC display "\<\%(C_NULL\)\>" +syntax match juliaConstGeneric display "\<\%(nothing\|Main\|undef\|missing\)\>" + +syntax match juliaParamType contained "[^{([:space:]<>\"]\+\ze{" nextgroup=juliaCurBraBlock + +syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro,juliaDocMacro,juliaDocMacroPre + +exec 'syntax match juliaMacro contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"' +syntax match juliaMacro contained "@[!.~$%^*/\\|<>+-]\ze[^0-9]" +exec 'syntax region juliaMacroCall contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\\|\\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS' +exec 'syntax region juliaMacroCall contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\\|\\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS' +exec 'syntax region juliaMacroCallP contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock' +exec 'syntax region juliaMacroCallP contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock' + +exec 'syntax match juliaNumbers transparent "\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\@'.s:d(1).'<=\d\|\.\d\|im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit' + +"integer regexes +let s:dec_regex = '\d\%(_\?\d\)*\%(\>\|im\>\|\ze\D\)' +let s:hex_regex = '0x\x\%(_\?\x\)*\%(\>\|im\>\|\ze\X\)' +let s:bin_regex = '0b[01]\%(_\?[01]\)*\%(\>\|im\>\|\ze[^01]\)' +let s:oct_regex = '0o\o\%(_\?\o\)*\%(\>\|im\>\|\ze\O\)' + +let s:int_regex = '\%(' . s:hex_regex . + \ '\|' . s:bin_regex . + \ '\|' . s:oct_regex . + \ '\|' . s:dec_regex . + \ '\)' + +"floating point regexes +" starting with a dot, optional exponent +let s:float_regex1 = '\.\d\%(_\?\d\)*\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)' +" with dot, optional exponent +let s:float_regex2 = '\d\%(_\?\d\)*\.\%(\d\%(_\?\d\)*\)\?\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)' +" without dot, with exponent +let s:float_regex3 = '\d\%(_\?\d\)*[eEf][-+]\?\d\+\%(\>\|im\>\|\ze\D\)' + +"hex floating point numbers +" starting with a dot +let s:hexfloat_regex1 = '0x\.\%\(\x\%(_\?\x\)*\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)' +" starting with a digit +let s:hexfloat_regex2 = '0x\x\%(_\?\x\)*\%\(\.\%\(\x\%(_\?\x\)*\)\?\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)' + +let s:float_regex = '\%(' . s:float_regex3 . + \ '\|' . s:float_regex2 . + \ '\|' . s:float_regex1 . + \ '\|' . s:hexfloat_regex2 . + \ '\|' . s:hexfloat_regex1 . + \ '\)' + +exec 'syntax match juliaNumber contained "' . s:int_regex . '" contains=juliaComplexUnit' +exec 'syntax match juliaFloat contained "' . s:float_regex . '" contains=juliaComplexUnit' +syntax match juliaComplexUnit display contained "\" + +syntax match juliaRangeOperator display ":" +exec 'syntax match juliaOperator "' . s:operators . '"' + +exec 'syntax region juliaTernaryRegion matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol' + +let s:interp_dollar = '\([' . s:nonidS_chars . s:op_chars_wc . '!]\|^\)\@'.s:d(1).'<=\$' + +exec 'syntax match juliaDollarVar display contained "' . s:interp_dollar . s:idregex . '"' +exec 'syntax region juliaDollarPar matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '(" end=")" contains=@juliaExpressions' +exec 'syntax region juliaDollarSqBra matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS' + +syntax match juliaChar "'\\\?.'" contains=juliaSpecialChar +syntax match juliaChar display "'\\\o\{3\}'" contains=juliaOctalEscapeChar +syntax match juliaChar display "'\\x\x\{2\}'" contains=juliaHexEscapeChar +syntax match juliaChar display "'\\u\x\{1,4\}'" contains=juliaUniCharSmall +syntax match juliaChar display "'\\U\x\{1,8\}'" contains=juliaUniCharLarge + +exec 'syntax match juliaCTransOperator "[[:space:]}' . s:nonid_chars . s:op_chars_wc . '!]\@'.s:d(1).'"]\+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw +syntax region juliabString matchgroup=juliaStringDelim start=+\\"]\+\%(\s*[<>]:\)\@=" + +" force precedence over Symbols +syntax match juliaTypeOperator contained "[<>:]:" +exec 'syntax match juliaTypeOperatorR2 transparent "[<>:]:\s*\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaTypeOperator,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaTypeOperator' +syntax match juliaIsaKeyword contained "\" +exec 'syntax match juliaTypeOperatorR3 transparent "\" +exec 'syntax match juliaWhereR transparent "\ +" Version: 3.0.0 +" Last Change: 18. Apr 2022 +" Credits: Thanks for contributions to this to Michael Jagusch +" Thanks for beta testing to Thomas Baginski +" +" Note to self: +" for testing perfomance +" open a 1000 lines file. +" :syntime on +" G +" hold down CTRL-U until reaching top +" :syntime report + +" Init {{{ +if exists("b:current_syntax") + finish +endif + +let s:keepcpo = &cpo +set cpo&vim + +" if colorscheme is tortus(less)? krlGroupName defaults to 1 +if get(g:, 'colors_name', " ") =~ '\[^;]*/ containedin=krlFold contains=krlSingleQuoteString,krlInteger,krlFloat,krlMovement,krlDelimiter,krlBoolean +highlight default link krlFoldComment Comment + +" move fold comment until second ; +syn match krlMoveFoldComment /\c\v^\s*;\s*fold>[^;]*[^;]*/ containedin=krlFold contains=krlInteger,krlFloat,krlMovement,krlDelimiter +highlight default link krlMoveFoldComment Comment + +" things to highlight in a fold line +syn keyword krlFoldHighlights CONT IN SYN OUT containedin=krlFoldComment +syn match krlFoldHighlights /\c\v<(M|F|E|A|t|i|bin|binin|UP|SPSMAKRO)\d+>/ containedin=krlFoldComment +if g:krlGroupName + highlight default link krlFoldHighlights Sysvars +else + " default color for Fold Highlights +endif +syn keyword krlVkrcFoldConstants EIN AUS containedin=krlFoldComment +highlight default link krlVkrcFoldConstants Boolean + +" Comment without Fold, also includes endfold lines and fold line part after second ; +syn match krlComment /\c\v;\s*%(<%(end)?fold>)@!.*$/ containedin=krlFold contains=krlTodo,krlDebug,@Spell +" Commented out Fold line: "; ;FOLD PTP..." +syn match krlComment /\c\v^\s*;\s*;.*$/ contains=krlTodo,krlDebug +highlight default link krlComment Comment + +if has("conceal") && get(g:, 'krlConcealFoldTail', 1) + syn match krlConcealFoldTail /\c\v(^\s*;\s*fold[^;]*)@250<=;%(--|\s*|\s*)@!.*$/ transparent containedin=krlComment conceal cchar=* +endif +" }}} Comment and Folding + +" Header {{{ +syn match krlHeader /&\a\w*/ +highlight default link krlHeader PreProc +" }}} Header + +" Operator {{{ +" Boolean operator +syn keyword krlBoolOperator and or exor not b_and b_or b_exor b_not +highlight default link krlBoolOperator Operator +" Arithmetic operator +syn match krlArithOperator /[+-]/ containedin=krlFloat +syn match krlArithOperator /[*/]/ +highlight default link krlArithOperator Operator +" Compare operator +syn match krlCompOperator /[<>=]/ +highlight default link krlCompOperator Operator +" Geometric operator +" Do not move the : operator +" Must be present befor krlParamdef +syn match krlGeomOperator /[:]/ +" syn match krlGeomOperator /[:]/ containedin=krlLabel,krlParamdef +highlight default link krlGeomOperator Operator +" }}} Operator + +" Type, StorageClass and Typedef {{{ +" Simple data types +syn keyword krlType bool char real int containedin=krlAnyType +" External program and function +syn keyword krlType ext extfct extfctp extp containedin=krlAnyType +" Communication +syn keyword krlType signal channel containedin=krlAnyType +highlight default link krlType Type +" StorageClass +syn keyword krlStorageClass decl global const struc enum +highlight default link krlStorageClass StorageClass +" .dat file public +syn keyword krlDatStorageClass public +highlight default link krlDatStorageClass StorageClass +" Parameter StorageClass +" Do not move the :in/:out +" Must be present after krlGeomOperator +syn match krlParamdef /[:]\s*in\>/ +syn match krlParamdef /[:]\s*out\>/ +highlight default link krlParamdef StorageClass +" Not a typedef but I like to have those highlighted +" different then types, structures or strorage classes +syn keyword krlTypedef DEF DEFFCT ENDFCT DEFDAT ENDDAT +syn match krlTypedef /^\s*END\>/ +highlight default link krlTypedef Typedef +" }}} Type, StorageClass and Typedef + +" Delimiter {{{ +syn match krlDelimiter /[\[\](),\\]/ +highlight default link krlDelimiter Delimiter +" }}} Delimiter + +" Constant values {{{ +" Boolean +syn keyword krlBoolean true false containedin=krlStructVal +highlight default link krlBoolean Boolean +" Binary integer +syn match krlBinaryInt /'b[01]\+'/ containedin=krlStructVal +highlight default link krlBinaryInt Number +" Hexadecimal integer +syn match krlHexInt /'h[0-9a-fA-F]\+'/ containedin=krlStructVal +highlight default link krlHexInt Number +" Integer +syn match krlInteger /\W\@1<=[+-]\?\d\+/ containedin=krlStructVal,krlFloat contains=krlArithOperator +highlight default link krlInteger Number +" Float +syn match krlFloat /\v\W@1<=[+-]?\d+\.?\d*%(\s*[eE][+-]?\d+)?/ containedin=krlStructVal +highlight default link krlFloat Float +" String +syn region krlString start=/"/ end=/"/ oneline containedin=krlStructVal contains=@Spell +highlight default link krlString String +syn match krlSpecialChar /[|]/ containedin=krlString +highlight default link krlSpecialChar SpecialChar +" String within a fold line +syn region krlSingleQuoteString start=/'/ end=/'/ oneline contained contains=@Spell +highlight default link krlSingleQuoteString String +" Enum +syn match krlEnumVal /#\s*\a\w*/ containedin=krlStructVal +highlight default link krlEnumVal Constant +" }}} Constant values + +" Predefined Structure and Enum {{{ +" Predefined structures and enums found in +" /r1/mada/$*.dat, /r1/steu/$*.dat and +" /r1/system/$config.dat as well as +" basisTech, gripperTech and spotTech +" +" Predefined data types found in krc1 +syn keyword krlStructure servopara keymove powermodul trace techangle tech techfct techcps techfctctrl axis_inc axis_cal date display_var pro_ip con bus +syn keyword krlEnum ident_state sig_state move_state async_state emt_mode boxmode msg_prm_typ msg_typ cmd_stat asys trace_state trace_mode direction techsys techgeoref techclass techmode hpu_key_val pro_state eax transsys mode_move cosys device rotsys emstop cause_t +" +" Predefined data types found in kss functions +syn keyword krlEnum ediagstate rdc_fs_state ret_c_psync_e var_type cancel_psync_e sys_vars +syn keyword krlStructure siginf rw_rdc_file rw_mam_file diagpar_t error_t stopmess case_sense_t msgbuf_t e3pos e3axis diagopt_t +" +" Predefined structures for movement +syn keyword krlStructure frame e6pos pos e6axis axis +syn keyword krlStructure fdat ldat pdat +syn keyword krlStructure load inertia +" +" Predefined structures for shapes +syn keyword krlStructure axbox cylinder box +" +" Predefined structures and enums found in /r1/mada/$machine.dat +syn keyword krlStructure cp fra acc_car jerk_struc dhart spin trpspin ex_kin et_ax maxtool +syn keyword krlEnum individual_mames supply_voltage kinclass main_axis wrist_axis sw_onoff +" +" Predefined structures and enums found in /r1/mada/$robcor.dat +" syn keyword krlStructure +syn keyword krlEnum adap_acc model_type control_parameter eko_mode +" +" Predefined structures and enums found in /steu/mada/$custom.dat +syn keyword krlStructure pro_io_t ser ext_mod_t coop_krc ws_config bin_type coop_update_t ldc_reaction +syn keyword krlEnum axis_of_coordinates spline_para_variant target_status cp_vel_type cp_statmon +" +" Predefined structures and enums found in /steu/mada/$machine.dat +syn keyword krlStructure emstop_path boxstatesafein boxstatesafeout +syn keyword krlEnum digincode +" +" Predefined structures and enums found in /steu/mada/$option.dat +syn keyword krlStructure msg_t +" syn keyword krlEnum +" +" Predefined structures and enums found in /r1/system/$config.dat +" BasisTech +syn keyword krlStructure dig_out_type ctrl_in_t ctrl_out_t fct_out_t fct_in_t odat basis_sugg_t out_sugg_t md_state machine_def_t machine_tool_t machine_frame_t trigger_para constvel_para condstop_para adat tm_sugg_t tqm_tqdat_t sps_prog_type +syn keyword krlEnum bas_command out_modetype ipo_m_t apo_mode_t funct_type p00_command timer_actiontype +" +" GripperTech +syn keyword krlStructure grp_typ grp_types grp_sugg_t +syn keyword krlEnum on_off_typ apo_typ +" +" SpotTech +syn keyword krlStructure spot_type spot_sugg_t +syn keyword krlEnum s_command s_pair_slct command_retr +" +" VW +syn keyword krlStructure vw_mpara_typ zangentyp zangenbedingung ibszangentyp last_ibs_typ verr_typ verrcheck_t t_fb_state kollisionsdaten state_t modus_t +syn keyword krlEnum synctype dir_typ subtype ari_typ bool_typ vw_command ibgn_command vw_user_cmd move_types adv_t_type bas_type ibs_mode_typ vw_user_cmd pro_mode mode_op +" +" ProgCoop +syn keyword krlStructure ydat +" syn keyword krlEnum +" +" bas.src +syn keyword krlStructure cont +syn keyword krlEnum esys ipo_mode circ_mode circ_type ori_type var_state +" +" MsgLib.src +syn keyword krlStructure KrlMsg_T KrlMsgParType_T KrlMsgPar_T KrlMsgOpt_T KrlMsgDlgSK_T +syn keyword krlEnum EKrlMsgType +" +highlight default link krlStructure Structure +highlight default link krlEnum Structure +" }}} Predefined Structure and Enum + +" System variable {{{ +syn match krlSysvars /\<\$\a[a-zA-Z0-9_.]*/ +if g:krlGroupName + highlight default link krlSysvars Sysvars +else + " default color for Sysvars +endif +" }}} System variable + +" Statements, keywords et al {{{ +" continue +syn keyword krlContinue continue +if g:krlGroupName + highlight default link krlContinue Continue +else + highlight default link krlContinue Statement +endif +" interrupt +syn match krlStatement /\v\c%(\s+)?%(\s+)?/ contains=krlStorageClass +" keywords +syn keyword krlStatement wait on off enable disable stop trigger with when distance onstart delay do prio import is minimum maximum confirm on_error_proceed +syn match krlStatement /\v\c%(/ +syn match krlStatement /\v\c%(/ +highlight default link krlStatement Statement +" Conditional +syn keyword krlConditional if then else endif switch case default endswitch skip endskip +highlight default link krlConditional Conditional +" Repeat +syn keyword krlRepeat for to step endfor while endwhile repeat until loop endloop exit +highlight default link krlRepeat Repeat +" Label +syn keyword krlLabel goto +syn match krlLabel /^\s*\w\+:\ze\s*\%(;.*\)\?$/ +highlight default link krlLabel Label +" Keyword +syn keyword krlKeyword anin anout digin +highlight default link krlKeyword Keyword +" Exception +syn keyword krlException return resume halt +highlight default link krlException Exception +" }}} Statements, keywords et al + +" special keywords for movement commands {{{ +syn keyword krlMovement PTP PTP_REL LIN LIN_REL CIRC CIRC_REL SPL SPL_REL SPTP SPTP_REL SLIN SLIN_REL SCIRC SCIRC_REL +syn keyword krlMovement ASYPTP ASYCONT ASYSTOP ASYCANCEL MOVE_EMI +syn match krlMovement /\v\c^\s*/ +if g:krlGroupName + highlight default link krlMovement Movement +else + highlight default link krlMovement Special +endif +" movement modifiers +syn match krlMoveBlockInst /\c\v^\s*TIME_BLOCK\s+(START|PART|END)/ +syn match krlMoveBlockInst /\c\v^\s*CONST_VEL\s+(START|END)/ +syn keyword krlMoveBlockInst ptp_spline spline endspline +highlight default link krlMoveBlockInst Statement +syn keyword krlMoveMod ca c_ptp c_dis c_vel c_ori c_spl +if g:krlGroupName + highlight default link krlMoveMod Movement +else + highlight default link krlMoveMod Special +endif +" }}} special keywords for movement commands + +" Structure value {{{ +" avoid coloring structure component names +syn match krlNames /\.[a-zA-Z_][.a-zA-Z0-9_$]*/ +syn match krlNames contained /[a-zA-Z_][.a-zA-Z0-9_$]*/ +" highlight default link krlNames None +" Structure value +syn region krlStructVal start=/{/ end=/}/ oneline containedin=krlStructVal contains=krlNames +highlight default link krlStructVal Delimiter +" }}} Structure value + +" BuildInFunction {{{ +syn keyword krlBuildInFunction contained Pulse +syn keyword krlBuildInFunction contained m_comment +syn keyword krlBuildInFunction contained is_key_pressed +syn keyword krlBuildInFunction contained set_opt_filter +syn keyword krlBuildInFunction contained timer_limit +syn keyword krlBuildInFunction contained tool_adj +syn keyword krlBuildInFunction contained FRand +syn keyword krlBuildInFunction contained ExecFunc eb_test EB EK EO LK mbx_rec +" safe robot +syn keyword krlbuildinfunction contained get_AxesMask get_BrakeTest_Time +" math +syn keyword krlBuildInFunction contained Abs Sin Cos Acos Tan Atan Atan2 Sqrt +syn keyword krlBuildInFunction contained Forward Inverse inv_pos +" cFoo sFoo +syn keyword krlBuildInFunction contained cClose cOpen cRead cWrite sRead sWrite +" string +syn keyword krlBuildInFunction contained StrToBool StrToInt StrToReal StrToString StrToFrame StrToPos StrToE3Pos StrToE6Pos StrToAxis StrToE3Axis StrToE6Axis +syn keyword krlBuildInFunction contained StrAdd StrClear StrCopy StrComp StrFind StrLen StrDeclLen StrToBool StrToInt StrToReal StrToString +" diag +syn keyword krlBuildInFunction contained diag_start diag_stop get_DiagState +" rdc mam pid +syn keyword krlBuildInFunction contained CheckPidOnRdc check_mam_on_rdc get_rdc_fs_state +syn keyword krlBuildInFunction contained set_mam_on_hd copy_mam_hd_to_rdc copy_mam_rdc_to_hd +syn keyword krlBuildInFunction contained PidToHd PidToRdc +syn keyword krlBuildInFunction contained cal_to_rdc rdc_file_to_hd +syn keyword krlBuildInFunction contained delete_pid_on_rdc delete_rdc_content +syn keyword krlBuildInFunction contained create_rdc_archive restore_rdc_archive +" ioctl +syn keyword krlBuildInFunction contained IOCtl cIOCtl +syn keyword krlBuildInFunction contained WSpaceGive WSpaceTake +" sync +syn keyword krlBuildInFunction contained Sync SyncCmd CancelProgSync +" remote +syn keyword krlBuildInFunction contained RemoteCmd RemoteRead +" msg/dlg +syn keyword krlBuildInFunction contained IsMessageSet clear_KrlMsg get_MsgBuffer exists_KrlDlg exists_KrlMsg set_KrlDlg set_KrlDlgAnswer set_KrlMsg +" robvers +syn keyword krlBuildInFunction contained maximize_UsedxRobvers set_UsedxRobvers +" md_foo +syn keyword krlBuildInFunction contained md_Cmd md_GetState md_SetState md_Asgn +" emi +syn keyword krlBuildInFunction contained emi_ActPos emi_EndPos emi_StartPos emi_RecState emi_RecName +" var +syn keyword krlBuildInFunction contained cast_from cast_to +syn keyword krlBuildInFunction contained GetVarsize GetCycDef get_sig_inf get_decl_place VarType VarState +" sys +syn keyword krlBuildInFunction contained GetSysState get_system_data set_system_data set_system_data_delayed +" err +syn keyword krlBuildInFunction contained err_clear err_raise +" motion +syn keyword krlBuildInFunction contained delete_backward_buffer rob_stop rob_stop_release set_brake_delay suppress_repositioning VectorMoveOn VectorMoveOff +" torque +syn keyword krlBuildInFunction contained set_torque_limits reset_torque_limits +" krc1 +syn keyword krlBuildInFunction contained cLcopy cCurpos cNew cClear cRelease cKey +if g:krlGroupName + highlight default link krlBuildInFunction BuildInFunction +else + highlight default link krlBuildInFunction Function +endif +" }}} BuildInFunction + +" Function {{{ +syn match krlFunction /[a-zA-Z_]\w* *(/me=e-1 contains=krlBuildInFunction +highlight default link krlFunction Function +" }}} Function + +" Error {{{ +if get(g:, 'krlShowError', 1) + " some more or less common typos + " + " vars or funcs >24 chars are not possible in krl. a234567890123456789012345 + syn match krlError0 /\w\{25,}/ containedin=krlFunction,krlNames,krlLabel,krlAnyType,krlEnumVal,krlSysvars + " + " should be interrupt (on|off) \w+ + syn match krlError1 /\vinterrupt[ \t(]+[_$a-zA-Z0-9]+[_$a-zA-Z0-9.\[\]()+\-*/]*[ \t)]+o%(n|ff)>/ + " + " for bla==5 to 7... + " || + syn match krlError3 /\v%(^\s*for%(\(|\s)+[_$a-zA-Z]+[_$a-zA-Z0-9.\[\]()+\-*/ ]*\s*)@<=[:=]\=/ + " + " TODO optimize performance + " wait for a=b + " | + syn match krlError4 /\v%(^\s*%(return|wait\s+for|if|while|until|%(global\s+)?interrupt\s+decl)>[^;]+[^;<>=])@<=\=[^=]/ + " + " wait for a>[^;]+)@<=\>\s*\[^;]+[^;])@<=\)\s*\(/ + " + " TODO optimize performance + " a == b + 1 + " a := b + 1 + " || + syn match krlError7 /\v%(^\s*%(return|wait\s+for|if|while|until|%(global\s+)?interrupt\s+decl)>[^;]+[^;])@1=])@<=\=\ze[^=]/ + " + " <(distance|delay|prio)> := + " <(distance|delay|prio)> == + " || + syn match krlError9 /\v(^[^;]*<(distance|delay|prio|minimum|maximum)\s*)@<=[:=]\=/ + " + " 'for', 'while' or 'repeat' followed by 'do' + syn match krlError10 /\c\v^\s*(until|while|for)>[^;]*/ + " + highlight default link krlError0 Error + highlight default link krlError1 Error + highlight default link krlError2 Error + highlight default link krlError3 Error + highlight default link krlError4 Error + highlight default link krlError5 Error + highlight default link krlError6 Error + highlight default link krlError7 Error + highlight default link krlError8 Error + highlight default link krlError9 Error + highlight default link krlError10 Error +endif +" }}} Error + +" Finish {{{ +let &cpo = s:keepcpo +unlet s:keepcpo + +let b:current_syntax = "krl" +" }}} Finish + +" vim:sw=2 sts=2 et fdm=marker diff --git a/runtime/syntax/less.vim b/runtime/syntax/less.vim index 5cc8c6d7bd3e4..c44f0775f23c4 100644 --- a/runtime/syntax/less.vim +++ b/runtime/syntax/less.vim @@ -2,14 +2,13 @@ " Language: less " Maintainer: Alessandro Vioni " URL: https://github.com/genoma/vim-less -" Last Change: 2014 November 24 +" Last Change: 2020 Sep 29 if exists("b:current_syntax") finish endif runtime! syntax/css.vim -runtime! after/syntax/css.vim syn case ignore diff --git a/runtime/syntax/lex.vim b/runtime/syntax/lex.vim index 560aa44be3dd4..82197adbedb52 100644 --- a/runtime/syntax/lex.vim +++ b/runtime/syntax/lex.vim @@ -1,22 +1,19 @@ " Vim syntax file -" Language: Lex -" Maintainer: Charles E. Campbell -" Last Change: Aug 31, 2016 -" Version: 16 -" URL: http://mysite.verizon.net/astronaut/vim/index.html#SYNTAX_LEX -" -" Option: -" lex_uses_cpp : if this variable exists, then C++ is loaded rather than C +" Language: Lex and Flex +" Maintainer: Charles E. Campbell +" Contributor: Robert A. van Engelen +" Last Change: Apr 24, 2020 +" Version: 18 " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif -" Read the C/C++ syntax to start with -let s:Cpath= fnameescape(expand(":p:h").(exists("g:lex_uses_cpp")? "/cpp.vim" : "/c.vim")) +" Read the C++ syntax to start with +let s:Cpath= fnameescape(expand(":p:h")."/cpp.vim") if !filereadable(s:Cpath) - for s:Cpath in split(globpath(&rtp,(exists("g:lex_uses_cpp")? "syntax/cpp.vim" : "syntax/c.vim")),"\n") + for s:Cpath in split(globpath(&rtp,"syntax/cpp.vim"),"\n") if filereadable(fnameescape(s:Cpath)) let s:Cpath= fnameescape(s:Cpath) break @@ -29,115 +26,163 @@ exe "syn include @lexCcode ".s:Cpath " --- Lex stuff --- " --- ========= --- -" Options Section -syn match lexOptions '^%\s*option\>.*$' contains=lexPatString +" Definitions +" %% +" Rules +" %% +" User Code +" +" --- ======= --- +" --- Example --- +" --- ======= --- +" +" // this is a valid lex file +" // indented initial code block +" #include +" %{ +" // initial code block +" #include +" const char *sep = ""; +" %} +" %option outfile="scanner.c" noyywrap nodefault +" %x COMMENT +" id [A-Za-z_][A-Za-z0-9_]* +" %% +" // indented initial action code block +" printf("BEGIN"); +" {id} printf("%s%s", sep, yytext); sep = ""; +" . | +" \n { sep = "\n"; } +" "/*" { BEGIN COMMENT; } +" "//".* { } +" { +" "*/" { BEGIN INITIAL; } +" .|\n +" } +" <*><> { // end of file +" printf("\nEND\n"); +" yyterminate(); +" } +" %% +" void scan() +" { +" while (yylex()) +" continue; +" } +" /* main program */ +" int main() +" { +" scan(); +" } -" Abbreviations Section +" Definitions Section with initial code blocks, abbreviations, options, states if has("folding") - syn region lexAbbrvBlock fold start="^\(\h\+\s\|%{\)" end="^\ze%%$" skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude,lexAbbrvComment,lexStartState + syn region lexAbbrvBlock fold start="^\S" end="^\ze%%" skipnl nextgroup=lexPatBlock contains=lexOptions,lexAbbrv,lexInitialCodeBlock,lexInclude,lexAbbrvComment,lexStartState else - syn region lexAbbrvBlock start="^\(\h\+\s\|%{\)" end="^\ze%%$" skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude,lexAbbrvComment,lexStartState + syn region lexAbbrvBlock start="^\S" end="^\ze%%" skipnl nextgroup=lexPatBlock contains=lexOptions,lexAbbrv,lexInitialCodeBlock,lexInclude,lexAbbrvComment,lexStartState endif -syn match lexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=lexAbbrvRegExp -syn match lexAbbrv "^%[sx]" contained -syn match lexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=lexAbbrv,lexInclude +syn match lexOptions "^%\a\+\(\s.*\|[^{]*\)$" contains=lexOptionsEq,lexPatString,lexSlashQuote,lexBrace,lexSlashBrace +syn match lexOptionsEq "=" skipwhite contained +syn match lexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=lexAbbrvPat +syn match lexAbbrvPat "\s\S.*$"lc=1 contained contains=lexPatAbbrv,lexPatString,lexSlashQuote,lexBrace,lexSlashBrace nextgroup=lexAbbrv,lexInclude +syn match lexStartState "^%\(xs\?\|s\)\(t\(a\(t\(e\?\)\?\)\?\)\?\)\?\(\s\+\I\i*\)\+\s*$" contained contains=lexStartStateCmd +syn match lexStartStateCmd '^%\(xs\?\|s\)\(t\(a\(t\(e\?\)\?\)\?\)\?\)\?' contained if has("folding") - syn region lexInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=@lexCcode - syn region lexAbbrvComment fold start="^\s\+/\*" end="\*/" contains=@Spell - syn region lexAbbrvComment fold start="\%^/\*" end="\*/" contains=@Spell - syn region lexStartState fold matchgroup=lexAbbrv start="^%\a\+" end="$" contained + syn region lexInitialCodeBlock fold start="^\s\+" end="^\S"me=e-1 contains=@lexCcode + syn region lexInclude fold matchgroup=lexSep start="^%\a*{" end="^%\?}" contained contains=@lexCcode,lexCFunctions + syn region lexAbbrvComment fold start="^\s*//" end="$" contains=@Spell + syn region lexAbbrvComment fold start="^\s*/\*" end="\*/" contains=@Spell else - syn region lexInclude matchgroup=lexSep start="^%{" end="%}" contained contains=@lexCcode - syn region lexAbbrvComment start="^\s\+/\*" end="\*/" contains=@Spell - syn region lexAbbrvComment start="\%^/\*" end="\*/" contains=@Spell - syn region lexStartState matchgroup=lexAbbrv start="^%\a\+" end="$" contained + syn region lexInitialCodeBlock start="^\s\+" end="^\S"me=e-1 contains=@lexCcode + syn region lexInclude matchgroup=lexSep start="^%\a*{" end="^%\?}" contained contains=@lexCcode,lexCFunctions + syn region lexAbbrvComment start="^\s*//" end="$" contains=@Spell + syn region lexAbbrvComment start="^\s*/\*" end="\*/" contains=@Spell endif -"%% : Patterns {Actions} +" Rules Section with patterns and actions if has("folding") - syn region lexPatBlock fold matchgroup=Todo start="^%%$" matchgroup=Todo end="^%\ze%$" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude - syn region lexPat fold start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPattern contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace - syn region lexPatInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=lexPatCode - syn region lexBrace fold start="\[" skip=+\\\\\|\\+ end="]" contained - syn region lexPatString fold matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained + syn region lexPatBlock fold matchgroup=Todo start="^%%" matchgroup=Todo end="^\ze%%" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatSep,lexPatInclude + syn region lexPat fold start="\S" skip="\\\\\|\\\s" end="\ze\(\s*$\|\s\+\(\h\|{\W\|{$\|[-+*]\|//\|/\*\)\)" skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPatEnd contains=lexPatTag,lexPatString,lexSlashQuote,lexPatAbbrv,lexBrace,lexSlashBrace + syn region lexPatInclude fold matchgroup=lexSep start="^%{" end="^%}" contained contains=@lexCcode + syn region lexBrace fold matchgroup=Character start="\[" skip="\\.\|\[:\a\+:\]\|\[\.\a\+\.\]\|\[=.=\]" end="\]" contained + syn region lexPatString fold matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained else - syn region lexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude - syn region lexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPattern contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace - syn region lexPatInclude matchgroup=lexSep start="^%{" end="%}" contained contains=lexPatCode - syn region lexBrace start="\[" skip=+\\\\\|\\+ end="]" contained - syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained + syn region lexPatBlock matchgroup=Todo start="^%%" matchgroup=Todo end="^\ze%%" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatSep,lexPatInclude + syn region lexPat start="\S" skip="\\\\\|\\\s" end="\ze\(\s*$\|\s\+\(\h\|{\W\|{$\|[-+*]\|//\|/\*\)\)" skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPatEnd contains=lexPatTag,lexPatString,lexSlashQuote,lexPatAbbrv,lexBrace,lexSlashBrace + syn region lexPatInclude matchgroup=lexSep start="^%{" end="^%}" contained contains=@lexCcode + syn region lexBrace matchgroup=Character start="\[" skip="\\.\|\[:\a\+:\]\|\[\.\a\+\.\]\|\[=.=\]" end="\]" contained + syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained endif -syn match lexPatTag "^<\I\i*\(,\I\i*\)*>" contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep -syn match lexPatTagZone "^<\I\i*\(,\I\i*\)*>\s\+\ze{" contained nextgroup=lexPatTagZoneStart -syn match lexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep - -" Lex Patterns -syn region lexPattern start='[^ \t{}]' end="$" contained contains=lexPatRange -syn region lexPatRange matchgroup=Delimiter start='\[' skip='\\\\\|\\.' end='\]' contains=lexEscape -syn match lexEscape '\%(\\\\\)*\\.' contained +syn match lexPatAbbrv "{\I\i*}"hs=s+1,he=e-1 contained +syn match lexPatTag "^<\^\?\(\I\i*\|\*\)\(,\^\?\(\I\i*\|\*\)\)*>" contained nextgroup=lexPat,lexMorePat,lexPatSep,lexPatEnd +syn match lexPatTagZone "^<\^\?\(\I\i*\|\*\)\(,\^\?\(\I\i*\|\*\)\)*>\s*{$"me=e-1 contained nextgroup=lexPatTagZoneStart if has("folding") - syn region lexPatTagZoneStart matchgroup=lexPatTag fold start='{' end='}' contained contains=lexPat,lexPatComment - syn region lexPatComment start="\s\+/\*" end="\*/" fold skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell + syn region lexPatTagZoneStart fold matchgroup=lexPatTag start='{$' end='^}' skipnl skipwhite contained contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatSep,lexPatInclude + syn region lexPatComment fold start="//" end="$" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell + syn region lexPatComment fold start="/\*" end="\*/" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell else - syn region lexPatTagZoneStart matchgroup=lexPatTag start='{' end='}' contained contains=lexPat,lexPatComment - syn region lexPatComment start="\s\+/\*" end="\*/" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell + syn region lexPatTagZoneStart matchgroup=lexPatTag start='{' end='^}' skipnl skipwhite contained contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatSep,lexPatInclude + syn region lexPatComment start="//" end="$" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell + syn region lexPatComment start="/\*" end="\*/" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell endif -syn match lexPatCodeLine "[^{\[].*" contained contains=@lexCcode -syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment -syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine +syn match lexPatEnd "\s*$" skipnl contained +syn match lexPatCodeLine "[^{\[].*" contained contains=@lexCcode,lexCFunctions +syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment +syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine syn match lexSlashQuote +\(\\\\\)*\\"+ contained +syn match lexSlashBrace +\(\\\\\)*\\\[+ contained if has("folding") - syn region lexPatCode matchgroup=Delimiter start="{" end="}" fold skipnl contained contains=@lexCcode,lexCFunctions + syn region lexPatCode fold matchgroup=Delimiter start="{" end="}" skipnl contained contains=@lexCcode,lexCFunctions else - syn region lexPatCode matchgroup=Delimiter start="{" end="}" skipnl contained contains=@lexCcode,lexCFunctions + syn region lexPatCode matchgroup=Delimiter start="{" end="}" skipnl contained contains=@lexCcode,lexCFunctions endif -" Lex "functions" which may appear in C/C++ code blocks -syn keyword lexCFunctions BEGIN input unput woutput yyleng yylook yytext -syn keyword lexCFunctions ECHO output winput wunput yyless yymore yywrap +" User Code Section with final code block +syn region lexFinalCodeBlock matchgroup=Todo start="^%%" end="\%$" contained contains=@lexCcode -" %% -" lexAbbrevBlock -" %% -" lexPatBlock -" %% -" lexFinalCodeBlock -syn region lexFinalCodeBlock matchgroup=Todo start="%$"me=e-1 end="\%$" contained contains=@lexCcode +" Lex macros which may appear in C/C++ code blocks +syn keyword lexCFunctions BEGIN ECHO REJECT yytext YYText yyleng YYLeng yymore yyless yywrap yylook +syn keyword lexCFunctions yyrestart yyterminate yylineno yycolumno yyin yyout +syn keyword lexCFunctions input unput output winput wunput woutput +syn keyword lexCFunctions yyinput yyunput yyoutput yywinput yywunput yywoutput " includes several ALLBUTs; these have to be treated so as to exclude lex* groups -syn cluster cParenGroup add=lex.* +syn cluster cParenGroup add=lex.* syn cluster cDefineGroup add=lex.* syn cluster cPreProcGroup add=lex.* -syn cluster cMultiGroup add=lex.* +syn cluster cMultiGroup add=lex.* " Synchronization syn sync clear syn sync minlines=500 syn sync match lexSyncPat grouphere lexPatBlock "^%[a-zA-Z]" syn sync match lexSyncPat groupthere lexPatBlock "^<$" -syn sync match lexSyncPat groupthere lexPatBlock "^%%$" +syn sync match lexSyncPat groupthere lexPatBlock "^%%" " The default highlighting. if !exists("skip_lex_syntax_inits") hi def link lexAbbrvComment lexPatComment - hi def link lexAbbrvRegExp Macro - hi def link lexAbbrv SpecialChar - hi def link lexBrace lexPat - hi def link lexCFunctions Function - hi def link lexCstruct cStructure - hi def link lexMorePat SpecialChar - hi def link lexOptions PreProc + hi def link lexAbbrvPat lexPat + hi def link lexAbbrv Special + hi def link lexBrace lexPat + hi def link lexCFunctions PreProc + hi def link lexMorePat Special + hi def link lexOptions PreProc + hi def link lexOptionsEq Operator hi def link lexPatComment Comment hi def link lexPat Function - hi def link lexPatString Function - hi def link lexPatTag Special + hi def link lexPatString lexPat + hi def link lexPatAbbrv Special + hi def link lexPatTag Statement hi def link lexPatTagZone lexPatTag hi def link lexSep Delimiter hi def link lexSlashQuote lexPat - hi def link lexStartState Statement + hi def link lexSlashBrace lexPat + hi def link lexStartState lexPatTag + hi def link lexStartStateCmd Special endif let b:current_syntax = "lex" -" vim:ts=10 +" vim:ts=8 diff --git a/runtime/syntax/lhaskell.vim b/runtime/syntax/lhaskell.vim index 0a8a076ff4bd0..cf1f126a3c66b 100644 --- a/runtime/syntax/lhaskell.vim +++ b/runtime/syntax/lhaskell.vim @@ -1,11 +1,11 @@ " Vim syntax file " Language: Haskell with literate comments, Bird style, -" TeX style and plain text surrounding +" Markdown style, TeX style and plain text surrounding " \begin{code} \end{code} blocks " Maintainer: Haskell Cafe mailinglist " Original Author: Arthur van Leeuwen -" Last Change: 2010 Apr 11 -" Version: 1.04 +" Last Change: 2020 Feb 25 +" Version: 1.05 " " Thanks to Ian Lynagh for thoughtful comments on initial versions and " for the inspiration for writing this in the first place. @@ -44,8 +44,8 @@ endif " First off, see if we can inherit a user preference for lhs_markup if !exists("b:lhs_markup") if exists("lhs_markup") - if lhs_markup =~ '\<\%(tex\|none\)\>' - let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|none\)\>') + if lhs_markup =~ '\<\%(tex\|md\|none\)\>' + let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|md\|none\)\>') else echohl WarningMsg | echo "Unknown value of lhs_markup" | echohl None let b:lhs_markup = "unknown" @@ -54,7 +54,7 @@ if !exists("b:lhs_markup") let b:lhs_markup = "unknown" endif else - if b:lhs_markup !~ '\<\%(tex\|none\)\>' + if b:lhs_markup !~ '\<\%(tex\|md\|none\)\>' let b:lhs_markup = "unknown" endif endif @@ -74,6 +74,8 @@ call cursor(1,1) if b:lhs_markup == "unknown" if search('\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0 let b:lhs_markup = "tex" + elseif search('```haskell','W') != 0 + let b:lhs_markup = "md" else let b:lhs_markup = "plain" endif @@ -86,6 +88,10 @@ if b:lhs_markup == "tex" " Tex.vim removes "_" from 'iskeyword', but we need it for Haskell. setlocal isk+=_ syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract +elseif b:lhs_markup == "md" + runtime! syntax/markdown.vim + unlet b:current_syntax + syntax cluster lhsTeXContainer contains=markdown.* else syntax cluster lhsTeXContainer contains=.* endif @@ -96,9 +102,12 @@ syntax include @haskellTop syntax/haskell.vim syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer +syntax region lhsHaskellMDBlock start="^```haskell$" matchgroup=NONE end="^```$" keepend contains=@haskellTop,lhsMarkdownCode containedin=@lhsTeXContainer syntax match lhsBirdTrack "^>" contained +syntax match lhsMarkdownCode "^\(```haskell\|^```\)$" contained + syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}" @@ -107,6 +116,8 @@ syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}" hi def link lhsBirdTrack Comment +hi def link lhsMarkdownCode Comment + hi def link beginCodeBegin texCmdName hi def link beginCodeCode texSection diff --git a/runtime/syntax/liquid.vim b/runtime/syntax/liquid.vim index 295a91775e319..966b60f6f8929 100644 --- a/runtime/syntax/liquid.vim +++ b/runtime/syntax/liquid.vim @@ -2,7 +2,7 @@ " Language: Liquid " Maintainer: Tim Pope " Filenames: *.liquid -" Last Change: 2013 May 30 +" Last Change: 2022 Mar 15 if exists('b:current_syntax') finish @@ -68,10 +68,10 @@ if !exists('s:subtype') unlet s:subtype endif -syn region liquidStatement matchgroup=liquidDelimiter start="{%" end="%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend -syn region liquidExpression matchgroup=liquidDelimiter start="{{" end="}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend -syn region liquidComment matchgroup=liquidDelimiter start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend -syn region liquidRaw matchgroup=liquidDelimiter start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend +syn region liquidStatement matchgroup=liquidDelimiter start="{%-\=" end="-\=%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend +syn region liquidExpression matchgroup=liquidDelimiter start="{{-\=" end="-\=}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend +syn region liquidComment matchgroup=liquidDelimiter start="{%-\=\s*comment\s*-\=%}" end="{%-\=\s*endcomment\s*-\=%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend +syn region liquidRaw matchgroup=liquidDelimiter start="{%-\=\s*raw\s*-\=%}" end="{%-\=\s*endraw\s*-\=%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression @@ -79,11 +79,11 @@ syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,l syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained syn keyword liquidKeyword endhighlight contained -syn region liquidHighlight start="{%\s*highlight\s\+\w\+\s*%}" end="{% endhighlight %}" keepend +syn region liquidHighlight start="{%-\=\s*highlight\s\+\w\+\s*-\=%}" end="{%-\= endhighlight -\=%}" keepend for s:type in g:liquid_highlight_types exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained' - exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*%}" end="{% endhighlight %}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') + exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%-\=\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*-\=%}" end="{%-\= endhighlight -\=%}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') endfor unlet! s:type @@ -92,18 +92,18 @@ syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained syn match liquidNumber "-\=\<\d\+\>" contained syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained syn keyword liquidBoolean true false contained -syn keyword liquidNull null nil contained +syn keyword liquidNull null nil blank contained syn match liquidEmpty "\" contained syn keyword liquidOperator and or not contained syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter -syn keyword liquidFilter date capitalize downcase upcase first last join sort size strip_html strip_newlines newline_to_br replace replace_first remove remove_first truncate truncatewords prepend append minus plus times divided_by contained +syn keyword liquidFilter date capitalize downcase upcase escape escape_once first last join sort size where uniq strip_html strip_newlines newline_to_br replace replace_first remove remove_first slice split strip truncate truncatewords prepend append url_encode url_decode abs at_most at_least ceil divided_by floor minus plus round times modulo contained syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained -syn keyword liquidRepeat for endfor tablerow endtablerow in contained -syn match liquidRepeat "\%({%\s*\)\@<=empty\>" contained -syn keyword liquidKeyword assign cycle include with contained +syn keyword liquidRepeat for endfor tablerow endtablerow in break continue limit offset reversed contained +syn match liquidRepeat "\%({%-\=\s*\)\@<=empty\>" contained +syn keyword liquidKeyword assign capture endcapture increasement decreasement cycle include with render contained syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained diff --git a/runtime/syntax/lisp.vim b/runtime/syntax/lisp.vim index 17c54d1a4fb4a..90513e3a00b0a 100644 --- a/runtime/syntax/lisp.vim +++ b/runtime/syntax/lisp.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Lisp -" Maintainer: Charles E. Campbell -" Last Change: Jul 11, 2019 -" Version: 29 +" Maintainer: Charles E. Campbell +" Last Change: Nov 10, 2021 +" Version: 31 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP " " Thanks to F Xavier Noria for a list of 978 Common Lisp symbols taken from HyperSpec @@ -54,20 +54,20 @@ if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 syn region lispParen8 contained matchgroup=hlLevel8 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen9 syn region lispParen9 contained matchgroup=hlLevel9 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen0 else - syn region lispList matchgroup=lispParen start="(" skip="|.\{-}|" matchgroup=lispParen end=")" contains=@lispListCluster - syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster + syn region lispList matchgroup=lispParen start="(" skip="|.\{-}|" matchgroup=lispParen end=")" contains=@lispListCluster + syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster endif " --------------------------------------------------------------------- " Atoms: {{{1 -syn match lispAtomMark "'" -syn match lispAtom "'("me=e-1 contains=lispAtomMark nextgroup=lispAtomList -syn match lispAtom "'[^ \t()]\+" contains=lispAtomMark -syn match lispAtomBarSymbol !'|..\{-}|! contains=lispAtomMark -syn region lispAtom start=+'"+ skip=+\\"+ end=+"+ -syn region lispAtomList contained matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contains=@lispAtomCluster,lispString,lispEscapeSpecial -syn match lispAtomNmbr contained "\<\d\+" -syn match lispLeadWhite contained "^\s\+" +syn match lispAtomMark "'" +syn match lispAtom "'("me=e-1 contains=lispAtomMark nextgroup=lispAtomList +syn match lispAtom "'[^ \t()]\+" contains=lispAtomMark +syn match lispAtomBarSymbol !'|..\{-}|! contains=lispAtomMark +syn region lispAtom start=+'"+ skip=+\\"+ end=+"+ +syn region lispAtomList contained matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contains=@lispAtomCluster,lispString,lispEscapeSpecial +syn match lispAtomNmbr contained "\<\d\+" +syn match lispLeadWhite contained "^\s\+" " --------------------------------------------------------------------- " Standard Lisp Functions and Macros: {{{1 @@ -553,6 +553,8 @@ syn match lispParenError ")" syn cluster lispCommentGroup contains=lispTodo,@Spell syn match lispComment ";.*$" contains=@lispCommentGroup syn region lispCommentRegion start="#|" end="|#" contains=lispCommentRegion,@lispCommentGroup +syn region lispComment start="#+nil" end="\ze)" contains=@lispCommentGroup +syn match lispComment '^\s*#+nil.*$' contains=@lispCommentGroup syn keyword lispTodo contained combak combak: todo todo: " --------------------------------------------------------------------- diff --git a/runtime/syntax/lout.vim b/runtime/syntax/lout.vim index 30c87fce5147f..b26a7bcc46d90 100644 --- a/runtime/syntax/lout.vim +++ b/runtime/syntax/lout.vim @@ -1,6 +1,6 @@ " Vim syntax file " Language: Lout -" Maintainer: Christian V. J. BrīŋŊssow +" Maintainer: Christian V. J. BrÃŧssow " Last Change: So 12 Feb 2012 15:15:03 CET " Filenames: *.lout,*.lt " URL: http://www.cvjb.de/comp/vim/lout.vim diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim index f313c14e7af7d..b398e2e5c6188 100644 --- a/runtime/syntax/lua.vim +++ b/runtime/syntax/lua.vim @@ -2,7 +2,7 @@ " Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2 " Maintainer: Marcus Aurelius Farias " First Author: Carlos Augusto Teixeira Mendes -" Last Change: 2012 Aug 12 +" Last Change: 2022 Mar 31 " Options: lua_version = 4 or 5 " lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2) " default 5.2 @@ -319,6 +319,15 @@ elseif lua_version == 5 syn match luaFunc /\/ syn match luaFunc /\/ endif + if lua_subversion >= 3 + "https://www.lua.org/manual/5.3/manual.html#6.5+%20%20%20%20syn%20match%20luaFunc%20/\%3Cutf8\.char\%3E/+%20%20%20%20syn%20match%20luaFunc%20/\%3Cutf8\.charpattern\%3E/+%20%20%20%20syn%20match%20luaFunc%20/\%3Cutf8\.codes\%3E/+%20%20%20%20syn%20match%20luaFunc%20/\%3Cutf8\.codepoint\%3E/+%20%20%20%20syn%20match%20luaFunc%20/\%3Cutf8\.len\%3E/+%20%20%20%20syn%20match%20luaFunc%20/\%3Cutf8\.offset\%3E/+%20%20endif%20endif" Define the default highlighting. diff --git a/runtime/syntax/m3build.vim b/runtime/syntax/m3build.vim new file mode 100644 index 0000000000000..1a378e8175435 --- /dev/null +++ b/runtime/syntax/m3build.vim @@ -0,0 +1,177 @@ +" Vim syntax file +" Language: Modula-3 Makefile +" Maintainer: Doug Kearns +" Last Change: 2021 April 15 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/m3quake.vim + +" Identifiers +syn match m3buildPredefinedVariable "\<\%(TARGET\|OS_TYPE\|BUILD_DIR\|PKG_USE\|WDROOT\)\>" + +" Build Procedures {{{1 +" Generated from cm3/m3-sys/cm3/src/M3Build.m3 +syn keyword m3buildProcedure HasCBackend + +" (* packages & locations *) +syn keyword m3buildProcedure Pkg +syn keyword m3buildProcedure override +syn keyword m3buildProcedure path_of +syn keyword m3buildProcedure pkg_subdir + +" (* names *) +syn keyword m3buildProcedure program_name +syn keyword m3buildProcedure library_name + +" (* calls in the generated .M3EXPORT files *) +syn keyword m3buildProcedure _define_lib +syn keyword m3buildProcedure _define_pgm +syn keyword m3buildProcedure _import_template +syn keyword m3buildProcedure _import_m3lib +syn keyword m3buildProcedure _import_otherlib +syn keyword m3buildProcedure _map_add_interface +syn keyword m3buildProcedure _map_add_generic_interface +syn keyword m3buildProcedure _map_add_module +syn keyword m3buildProcedure _map_add_generic_module +syn keyword m3buildProcedure _map_add_c +syn keyword m3buildProcedure _map_add_h +syn keyword m3buildProcedure _map_add_s + +" (* compiler options *) +syn keyword m3buildProcedure m3_debug +syn keyword m3buildProcedure m3_optimize +syn keyword m3buildProcedure build_shared +syn keyword m3buildProcedure build_standalone + +" (* derived files *) +syn keyword m3buildProcedure m3_compile_only +syn keyword m3buildProcedure m3_finish_up + +" (* predefined system libraries *) +syn keyword m3buildProcedure import_sys_lib + +" (* options *) +syn keyword m3buildProcedure m3_option +syn keyword m3buildProcedure remove_m3_option + +" (* deleting *) +syn keyword m3buildProcedure deriveds + +" (* imports *) +syn keyword m3buildProcedure include_dir +syn keyword m3buildProcedure include_pkg +syn keyword m3buildProcedure import +syn keyword m3buildProcedure import_version +syn keyword m3buildProcedure import_obj +syn keyword m3buildProcedure import_lib + +" (* objects *) +syn keyword m3buildProcedure pgm_object + +" (* sources *) +syn keyword m3buildProcedure source +syn keyword m3buildProcedure pgm_source +syn keyword m3buildProcedure interface +syn keyword m3buildProcedure Interface +syn keyword m3buildProcedure implementation +syn keyword m3buildProcedure module +syn keyword m3buildProcedure Module +syn keyword m3buildProcedure h_source +syn keyword m3buildProcedure c_source +syn keyword m3buildProcedure s_source +syn keyword m3buildProcedure ship_source + +" (* generics *) +syn keyword m3buildProcedure generic_interface +syn keyword m3buildProcedure Generic_interface +syn keyword m3buildProcedure generic_implementation +syn keyword m3buildProcedure Generic_implementation +syn keyword m3buildProcedure generic_module +syn keyword m3buildProcedure Generic_module +syn keyword m3buildProcedure build_generic_intf +syn keyword m3buildProcedure build_generic_impl + +" (* derived sources *) +syn keyword m3buildProcedure derived_interface +syn keyword m3buildProcedure derived_implementation +syn keyword m3buildProcedure derived_c +syn keyword m3buildProcedure derived_h + +" (* hiding/exporting *) +syn keyword m3buildProcedure hide_interface +syn keyword m3buildProcedure hide_generic_interface +syn keyword m3buildProcedure hide_generic_implementation +syn keyword m3buildProcedure export_interface +syn keyword m3buildProcedure export_generic_interface +syn keyword m3buildProcedure export_generic_implementation + +" (* templates *) +syn keyword m3buildProcedure template + +" (* library building *) +syn keyword m3buildProcedure library +syn keyword m3buildProcedure Library + +" (* program building *) +syn keyword m3buildProcedure program +syn keyword m3buildProcedure Program +syn keyword m3buildProcedure c_program +syn keyword m3buildProcedure C_program + +" (* man pages *) +syn keyword m3buildProcedure manPage +syn keyword m3buildProcedure ManPage + +" (* emacs *) +syn keyword m3buildProcedure Gnuemacs +syn keyword m3buildProcedure CompiledGnuemacs + +" (* "-find" support *) +syn keyword m3buildProcedure find_unit +syn keyword m3buildProcedure enum_units + +" (* export functions *) +syn keyword m3buildProcedure install_sources +syn keyword m3buildProcedure install_derived +syn keyword m3buildProcedure install_derived_link +syn keyword m3buildProcedure install_derived_symbolic_link +syn keyword m3buildProcedure install_derived_hard_link +syn keyword m3buildProcedure install_link_to_derived +syn keyword m3buildProcedure install_symbolic_link_to_derived +syn keyword m3buildProcedure install_hard_link_to_derived +syn keyword m3buildProcedure install_symbolic_link +syn keyword m3buildProcedure install_file + +" (* installation functions *) +syn keyword m3buildProcedure BindExport +syn keyword m3buildProcedure BinExport +syn keyword m3buildProcedure LibdExport +syn keyword m3buildProcedure LibExport +syn keyword m3buildProcedure EmacsdExport +syn keyword m3buildProcedure EmacsExport +syn keyword m3buildProcedure DocdExport +syn keyword m3buildProcedure DocExport +syn keyword m3buildProcedure MandExport +syn keyword m3buildProcedure ManExport +syn keyword m3buildProcedure HtmlExport +syn keyword m3buildProcedure RootExport +syn keyword m3buildProcedure RootdExport + +" (* misc *) +syn keyword m3buildProcedure gen_m3exports +syn keyword m3buildProcedure generate_tfile +syn keyword m3buildProcedure delete_file +syn keyword m3buildProcedure link_file +syn keyword m3buildProcedure symbolic_link_file +syn keyword m3buildProcedure hard_link_file +" }}} + +hi def link m3buildPredefinedVariable Identifier +hi def link m3buildProcedure Function + +let b:current_syntax = "m3build" + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/syntax/m3quake.vim b/runtime/syntax/m3quake.vim new file mode 100644 index 0000000000000..c202d90e7468a --- /dev/null +++ b/runtime/syntax/m3quake.vim @@ -0,0 +1,74 @@ +" Vim syntax file +" Language: Modula-3 Quake +" Maintainer: Doug Kearns +" Last Change: 2021 April 15 + +if exists("b:current_syntax") + finish +endif + +" Keywords +syn keyword m3quakeKeyword else end foreach if in is local or proc readonly +syn keyword m3quakeKeyword return + +" Builtin procedures {{{ +" Generated from m3-sys/m3quake/src/QMachine.m3 +syn keyword m3quakeProcedure arglist cp_if defined empty equal error escape +syn keyword m3quakeProcedure exec cm3_exec file format include make_dir +syn keyword m3quakeProcedure normalize path stale try_exec try_cm3_exec +syn keyword m3quakeProcedure unlink_file write datetime date datestamp +syn keyword m3quakeProcedure TRACE_INSTR eval_func hostname + +syn keyword m3quakeProcedure pushd popd cd getwd + +syn keyword m3quakeProcedure quake + +syn keyword m3quakeProcedure q_exec q_exec_put q_exec_get + +syn keyword m3quakeProcedure fs_exists fs_readable fs_writable fs_executable +syn keyword m3quakeProcedure fs_isdir fs_isfile fs_contents fs_putfile +syn keyword m3quakeProcedure fs_mkdir fs_touch fs_lsdirs fs_lsfiles fs_rmdir +syn keyword m3quakeProcedure fs_rmfile fs_rmrec fs_cp + +syn keyword m3quakeProcedure pn_valid pn_decompose pn_compose pn_absolute +syn keyword m3quakeProcedure pn_prefix pn_last pn_base pn_lastbase pn_lastext +syn keyword m3quakeProcedure pn_join pn_join2 pn_replace_ext pn_parent +syn keyword m3quakeProcedure pn_current + +syn keyword m3quakeProcedure len + +syn keyword m3quakeProcedure split sub skipl skipr squeeze compress pos +syn keyword m3quakeProcedure tcontains bool encode decode subst_chars +syn keyword m3quakeProcedure del_chars subst subst_env add_prefix add_suffix +" }}} + +" Identifiers +syn match m3quakeEnvVariable "$\h\w\+" + +" Operators +syn match m3quakeOperator "&" +syn match m3quakeOperator "\<\%(contains\|not\|and\|or\)\>" + +" Strings +syn match m3quakeEscape "\\[\\nrtbf"]" contained display +syn region m3quakeString start=+"+ end=+"+ contains=m3quakeEscape + +" Comments +syn keyword m3quakeTodo TODO FIXME XXX contained +syn region m3quakeComment start="%" end="$" contains=m3quakeTodo,@Spell +syn region m3quakeComment start="/\*" end="\*/" contains=m3quakeTodo,@Spell + +" Default highlighting +hi def link m3quakeCommand Statement +hi def link m3quakeComment Comment +hi def link m3quakeEnvVariable Identifier +hi def link m3quakeEscape Special +hi def link m3quakeKeyword Keyword +hi def link m3quakeOperator Operator +hi def link m3quakeProcedure Function +hi def link m3quakeString String +hi def link m3quakeTodo Todo + +let b:current_syntax = "m3quake" + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/syntax/m4.vim b/runtime/syntax/m4.vim index 6f229ea1aba44..f90197aeb05bc 100644 --- a/runtime/syntax/m4.vim +++ b/runtime/syntax/m4.vim @@ -2,7 +2,8 @@ " Language: M4 " Maintainer: Claudio Fleiner (claudio@fleiner.com) " URL: http://www.fleiner.com/vim/syntax/m4.vim -" Last Change: 2005 Jan 15 +" (outdated) +" Last Change: 2022 Jun 12 " This file will highlight user function calls if they use only " capital letters and have at least one argument (i.e. the '(' @@ -21,6 +22,7 @@ endif syn match m4Variable contained "\$\d\+" syn match m4Special contained "$[@*#]" syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors +syn match m4Comment "#.*" contains=SpellErrors syn match m4Constants "\<\(m4_\)\=__file__" syn match m4Constants "\<\(m4_\)\=__line__" syn keyword m4Constants divnum sysval m4_divnum m4_sysval @@ -32,7 +34,7 @@ syn region m4Command matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regex syn keyword m4Statement divert undivert syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top -syn region m4String start="`" end="'" contained contains=@m4Top,@m4StringContents,SpellErrors +syn region m4String start="`" end="'" contains=SpellErrors syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function " Define the default highlighting. diff --git a/runtime/syntax/make.vim b/runtime/syntax/make.vim index 377e4450d9884..d0d7f1523b534 100644 --- a/runtime/syntax/make.vim +++ b/runtime/syntax/make.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: Makefile -" Maintainer: Roland Hieber +" Maintainer: Roland Hieber , " Previous Maintainer: Claudio Fleiner -" URL: https://github.com/vim/vim/syntax/make.vim -" Last Change: 2019 Apr 02 +" URL: https://github.com/vim/vim/blob/master/runtime/syntax/make.vim +" Last Change: 2020 May 03 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -13,35 +13,27 @@ endif let s:cpo_save = &cpo set cpo&vim - " some special characters syn match makeSpecial "^\s*[@+-]\+" syn match makeNextLine "\\\n\s*" -" some directives -syn match makePreCondit "^ *\(ifn\=\(eq\|def\)\>\|else\(\s\+ifn\=\(eq\|def\)\)\=\>\|endif\>\)" -syn match makeInclude "^ *[-s]\=include" -syn match makeStatement "^ *vpath" -syn match makeExport "^ *\(export\|unexport\)\>" -syn match makeOverride "^ *override" -hi link makeOverride makeStatement -hi link makeExport makeStatement - " catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend -syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" contains=makeStatement,makeIdent,makePreCondit,makeDefine +syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" + \ contains=makeStatement,makeIdent,makePreCondit,makeDefine " Microsoft Makefile specials syn case ignore -syn match makeInclude "^!\s*include" +syn match makeInclude "^!\s*include\s.*$" syn match makePreCondit "^!\s*\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|else\s*if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>" syn case match " identifiers -syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString -syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString +syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent +syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent syn match makeIdent "\$\$\w*" syn match makeIdent "\$[^({]" syn match makeIdent "^ *[^:#= \t]*\s*[:+?!*]="me=e-2 +syn match makeIdent "^ *[^:#= \t]*\s*::="me=e-3 syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1 syn match makeIdent "%" @@ -49,21 +41,39 @@ syn match makeIdent "%" syn match makeConfig "@[A-Za-z0-9_]\+@" " make targets -" syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>" -syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource -syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource - -syn region makeTarget transparent matchgroup=makeTarget start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands -syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget,makeComment skipnl nextgroup=makeCommands,makeCommandError - -syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands -syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent,makeComment skipnl nextgroup=makeCommands,makeCommandError +syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 +syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 + +syn region makeTarget transparent matchgroup=makeTarget + \ start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 + \ end=";"re=e-1,me=e-1 end="[^\\]$" + \ keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment,makeDString + \ skipnl nextGroup=makeCommands +syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" + \ contains=makeIdent,makeSpecTarget,makeComment + \ skipnl nextgroup=makeCommands,makeCommandError + +syn region makeSpecTarget transparent matchgroup=makeSpecTarget + \ start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 + \ end="[^\\]$" keepend + \ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands +syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" + \ contains=makeIdent,makeComment + \ skipnl nextgroup=makeCommands,makeCommandError syn match makeCommandError "^\s\+\S.*" contained -syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError +syn region makeCommands contained start=";"hs=s+1 start="^\t" + \ end="^[^\t#]"me=e-1,re=e-1 end="^$" + \ contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString + \ nextgroup=makeCommandError syn match makeCmdNextLine "\\\n."he=e-1 contained - +" some directives +syn match makePreCondit "^ *\(ifn\=\(eq\|def\)\>\|else\(\s\+ifn\=\(eq\|def\)\)\=\>\|endif\>\)" +syn match makeInclude "^ *[-s]\=include\s.*$" +syn match makeStatement "^ *vpath" +syn match makeExport "^ *\(export\|unexport\)\>" +syn match makeOverride "^ *override\>" " Statements / Functions (GNU make) syn match makeStatement contained "(\(abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|file\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|guile\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|subst\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1 @@ -84,8 +94,8 @@ syn keyword makeTodo TODO FIXME XXX contained syn match makeEscapedChar "\\[^$]" -syn region makeDString start=+\(\\\)\@ +" Maintainer: Jason Franklin +" Previous Maintainer: SungHyun Nam " Previous Maintainer: Gautam H. Mudunuri " Version Info: -" Last Change: 2015 Nov 24 +" Last Change: 2020 Sep 19 " Additional highlighting by Johannes Tanzler : " * manSubHeading @@ -18,14 +19,17 @@ endif runtime! syntax/ctrlh.vim syn case ignore + syn match manReference "\f\+([1-9][a-z]\=)" -syn match manTitle "^\f\+([0-9]\+[a-z]\=).*" -syn match manSectionHeading "^[a-z][a-z -]*[a-z]$" -syn match manSubHeading "^\s\{3\}[a-z][a-z -]*[a-z]$" +syn match manSectionHeading "^\a.*$" +syn match manSubHeading "^\s\{3\}\a.*$" syn match manOptionDesc "^\s*[+-][a-z0-9]\S*" syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*" " syn match manHistory "^[a-z].*last change.*$" +syn match manHeader '\%1l.*' +exe 'syn match manFooter ''\%' . line('$') . 'l.*''' + if getline(1) =~ '^[a-zA-Z_]\+([23])' syntax include @cCode :p:h/c.vim syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained @@ -36,7 +40,9 @@ endif " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link manTitle Title +hi def link manHeader Title +hi def link manFooter PreProc + hi def link manSectionHeading Statement hi def link manOptionDesc Constant hi def link manLongOptionDesc Constant diff --git a/runtime/syntax/maple.vim b/runtime/syntax/maple.vim index f14cf79cf41bf..78f2b4e09e42f 100644 --- a/runtime/syntax/maple.vim +++ b/runtime/syntax/maple.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Maple V (based on release 4) -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Mar 26, 2019 -" Version: 16 +" Version: 17 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_MAPLE " " Package Function Selection: {{{1 diff --git a/runtime/syntax/markdown.vim b/runtime/syntax/markdown.vim index 1955a7443e153..17b61c2fa48cd 100644 --- a/runtime/syntax/markdown.vim +++ b/runtime/syntax/markdown.vim @@ -2,7 +2,7 @@ " Language: Markdown " Maintainer: Tim Pope " Filenames: *.markdown -" Last Change: 2016 Aug 29 +" Last Change: 2020 Jan 14 if exists("b:current_syntax") finish @@ -18,37 +18,46 @@ unlet! b:current_syntax if !exists('g:markdown_fenced_languages') let g:markdown_fenced_languages = [] endif +let s:done_include = {} for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")') + if has_key(s:done_include, matchstr(s:type,'[^.]*')) + continue + endif if s:type =~ '\.' let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') endif exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' unlet! b:current_syntax + let s:done_include[matchstr(s:type,'[^.]*')] = 1 endfor unlet! s:type +unlet! s:done_include -syn sync minlines=10 +if !exists('g:markdown_minlines') + let g:markdown_minlines = 50 +endif +execute 'syn sync minlines=' . g:markdown_minlines syn case ignore -syn match markdownValid '[<>]\c[a-z/$!]\@!' -syn match markdownValid '&\%(#\=\w*;\)\@!' +syn match markdownValid '[<>]\c[a-z/$!]\@!' transparent contains=NONE +syn match markdownValid '&\%(#\=\w*;\)\@!' transparent contains=NONE syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule -syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError +syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError,markdownValid syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink syn match markdownHeadingRule "^[=-]\+$" contained -syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH1 matchgroup=markdownH1Delimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH2 matchgroup=markdownH2Delimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH3 matchgroup=markdownH3Delimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH4 matchgroup=markdownH4Delimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH5 matchgroup=markdownH5Delimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH6 matchgroup=markdownH6Delimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock @@ -70,31 +79,40 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained -syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart +syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline -let s:concealends = has('conceal') ? ' concealends' : '' -exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends -exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends -exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart' . s:concealends +let s:concealends = '' +if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1 + let s:concealends = ' concealends' +endif +exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends +exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\w\@.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') + if has_key(s:done_include, matchstr(s:type,'[^.]*')) + continue + endif + exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*````*\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*````*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends + let s:done_include[matchstr(s:type,'[^.]*')] = 1 endfor unlet! s:type + unlet! s:done_include endif syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]" @@ -107,6 +125,12 @@ hi def link markdownH4 htmlH4 hi def link markdownH5 htmlH5 hi def link markdownH6 htmlH6 hi def link markdownHeadingRule markdownRule +hi def link markdownH1Delimiter markdownHeadingDelimiter +hi def link markdownH2Delimiter markdownHeadingDelimiter +hi def link markdownH3Delimiter markdownHeadingDelimiter +hi def link markdownH4Delimiter markdownHeadingDelimiter +hi def link markdownH5Delimiter markdownHeadingDelimiter +hi def link markdownH6Delimiter markdownHeadingDelimiter hi def link markdownHeadingDelimiter Delimiter hi def link markdownOrderedListMarker markdownListMarker hi def link markdownListMarker htmlTagName diff --git a/runtime/syntax/masm.vim b/runtime/syntax/masm.vim index bb3c9681bcd0a..3be0fd45d12f1 100644 --- a/runtime/syntax/masm.vim +++ b/runtime/syntax/masm.vim @@ -2,8 +2,7 @@ " Language: Microsoft Macro Assembler (80x86) " Orig Author: Rob Brady " Maintainer: Wu Yongwei -" Last Change: $Date: 2013/11/13 11:49:24 $ -" $Revision: 1.48 $ +" Last Change: 2022-04-24 20:07:04 +0800 " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -13,10 +12,12 @@ endif let s:cpo_save = &cpo set cpo&vim +syn iskeyword @,48-57,_,36,60,62,63,@-@ + syn case ignore -syn match masmIdentifier "[@a-z_$?][@a-z0-9_$?]*" +syn match masmIdentifier "[@a-z_$?][@a-z0-9_$?<>]*" syn match masmLabel "^\s*[@a-z_$?][@a-z0-9_$?]*:"he=e-1 syn match masmDecimal "[-+]\?\d\+[dt]\?" @@ -67,6 +68,7 @@ syn keyword masmType STDCALL SYSCALL C BASIC FORTRAN PASCAL syn keyword masmType PTR NEAR FAR NEAR16 FAR16 NEAR32 FAR32 syn keyword masmType REAL4 REAL8 REAL10 BYTE SBYTE TBYTE syn keyword masmType WORD DWORD QWORD FWORD SWORD SDWORD +syn keyword masmType SQWORD OWORD MMWORD XMMWORD YMMWORD syn keyword masmOperator AND NOT OR SHL SHR XOR MOD DUP syn keyword masmOperator EQ GE GT LE LT NE syn keyword masmOperator LROFFSET SEG LENGTH LENGTHOF SIZE SIZEOF diff --git a/runtime/syntax/mason.vim b/runtime/syntax/mason.vim index f087def794021..e1638ece757ec 100644 --- a/runtime/syntax/mason.vim +++ b/runtime/syntax/mason.vim @@ -1,11 +1,12 @@ " Vim syntax file -" Language: Mason (Perl embedded in HTML) -" Maintainer: vim-perl -" Homepage: http://github.com/vim-perl/vim-perl/tree/master -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2017-09-12 -" Contributors: Hinrik Örn Sigurðsson -" Andrew Smith +" Language: Mason (Perl embedded in HTML) +" Maintainer: vim-perl +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2021 Oct 10 +" Contributors: Hinrik Örn Sigurðsson +" Andrew Smith " " TODO: " - Fix <%text> blocks to show HTML tags but ignore Mason tags. @@ -74,6 +75,7 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs, " syntax files. hi def link masonDoc Comment hi def link masonPod Comment +hi def link podOrdinary masonPod hi def link masonPerlComment perlComment let b:current_syntax = "mason" diff --git a/runtime/syntax/meson.vim b/runtime/syntax/meson.vim index 78de2ab89e52b..0af0d776f8951 100644 --- a/runtime/syntax/meson.vim +++ b/runtime/syntax/meson.vim @@ -2,7 +2,8 @@ " Language: Meson " License: VIM License " Maintainer: Nirbheek Chauhan -" Last Change: 2019 Oct 18 +" Liam Beguin +" Last Change: 2021 Aug 16 " Credits: Zvezdan Petkovic " Neil Schemenauer " Dmitry Vasiliev @@ -17,11 +18,7 @@ " let meson_space_error_highlight = 1 " -" For version 5.x: Clear all syntax items. -" For version 6.x: Quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists("b:current_syntax") finish endif @@ -32,8 +29,9 @@ set cpo&vim " http://mesonbuild.com/Syntax.html syn keyword mesonConditional elif else if endif -syn keyword mesonRepeat foreach endforeach -syn keyword mesonOperator and not or +syn keyword mesonRepeat foreach endforeach +syn keyword mesonOperator and not or in +syn keyword mesonStatement continue break syn match mesonComment "#.*$" contains=mesonTodo,@Spell syn keyword mesonTodo FIXME NOTE NOTES TODO XXX contained @@ -58,9 +56,11 @@ syn match mesonEscape "\\$" " Meson only supports integer numbers " http://mesonbuild.com/Syntax.html#numbers syn match mesonNumber "\<\d\+\>" +syn match mesonNumber "\<0x\x\+\>" +syn match mesonNumber "\<0o\o\+\>" " booleans -syn keyword mesonConstant false true +syn keyword mesonBoolean false true " Built-in functions syn keyword mesonBuiltin @@ -99,6 +99,7 @@ syn keyword mesonBuiltin \ install_headers \ install_man \ install_subdir + \ install_emptydir \ is_disabler \ is_variable \ jar @@ -117,10 +118,13 @@ syn keyword mesonBuiltin \ subdir \ subdir_done \ subproject + \ summary \ target_machine \ test + \ unset_variable \ vcs_tag \ warning + \ range if exists("meson_space_error_highlight") " trailing whitespace @@ -130,31 +134,20 @@ if exists("meson_space_error_highlight") syn match mesonSpaceError display "\t\+ " endif -if version >= 508 || !exists("did_meson_syn_inits") - if version <= 508 - let did_meson_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " The default highlight links. Can be overridden later. - HiLink mesonStatement Statement - HiLink mesonConditional Conditional - HiLink mesonRepeat Repeat - HiLink mesonOperator Operator - HiLink mesonComment Comment - HiLink mesonTodo Todo - HiLink mesonString String - HiLink mesonEscape Special - HiLink mesonNumber Number - HiLink mesonBuiltin Function - HiLink mesonConstant Number - if exists("meson_space_error_highlight") - HiLink mesonSpaceError Error - endif - - delcommand HiLink +" The default highlight links. Can be overridden later. +hi def link mesonStatement Statement +hi def link mesonConditional Conditional +hi def link mesonRepeat Repeat +hi def link mesonOperator Operator +hi def link mesonComment Comment +hi def link mesonTodo Todo +hi def link mesonString String +hi def link mesonEscape Special +hi def link mesonNumber Number +hi def link mesonBuiltin Function +hi def link mesonBoolean Boolean +if exists("meson_space_error_higlight") + hi def link mesonSpaceError Error endif let b:current_syntax = "meson" diff --git a/runtime/syntax/messages.vim b/runtime/syntax/messages.vim index c22e4e8d0c178..8b970aaa7f561 100644 --- a/runtime/syntax/messages.vim +++ b/runtime/syntax/messages.vim @@ -4,6 +4,7 @@ " Latest Revision: 2008-06-29 " Changes: 2008-06-29 support for RFC3339 tuimestamps James Vega " 2016 Jan 19: messagesDate changed by Bram +" 2021 Jan 27: messagesHourRFC3339 changed from #946 if exists("b:current_syntax") finish @@ -26,7 +27,7 @@ syn match messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d' syn match messagesRFC3339T contained display '\cT' \ nextgroup=messagesHourRFC3339 -syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)' +syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)\s*' \ nextgroup=messagesHost syn match messagesHost contained display '\S*\s*' diff --git a/runtime/syntax/mma.vim b/runtime/syntax/mma.vim index 0683adc5739b5..d2f22e9be516b 100644 --- a/runtime/syntax/mma.vim +++ b/runtime/syntax/mma.vim @@ -12,7 +12,7 @@ " " let filetype_m="mma" " -" I also recommend setting the default 'Comment' hilighting to something +" I also recommend setting the default 'Comment' highlighting to something " other than the color used for 'Function', since both are plentiful in " most mathematica files, and they are often the same color (when using " background=dark). @@ -109,7 +109,7 @@ syntax match mmaemPHAsis "\%(^\|\s\)(\@ +" Maintainer: Dirk HÃŧsken, " Last Change: 2012 Jun 01 " (Dominique Pelle added @Spell) " Filenames: *.mms diff --git a/runtime/syntax/modula3.vim b/runtime/syntax/modula3.vim index d9b89ca7cef2e..b179303799abe 100644 --- a/runtime/syntax/modula3.vim +++ b/runtime/syntax/modula3.vim @@ -1,59 +1,96 @@ " Vim syntax file -" Language: Modula-3 -" Maintainer: Timo Pedersen -" Last Change: 2001 May 10 +" Language: Modula-3 +" Maintainer: Doug Kearns +" Previous Maintainer: Timo Pedersen +" Last Change: 2021 Apr 08 -" Basic things only... -" Based on the modula 2 syntax file - -" quit when a syntax file was already loaded if exists("b:current_syntax") finish endif -" Modula-3 is case-sensitive -" syn case ignore - " Modula-3 keywords -syn keyword modula3Keyword ABS ADDRES ADR ADRSIZE AND ANY -syn keyword modula3Keyword ARRAY AS BITS BITSIZE BOOLEAN BRANDED BY BYTESIZE -syn keyword modula3Keyword CARDINAL CASE CEILING CHAR CONST DEC DEFINITION -syn keyword modula3Keyword DISPOSE DIV -syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION -syn keyword modula3Keyword EXIT EXPORTS EXTENDED FALSE FINALLY FIRST FLOAT -syn keyword modula3Keyword FLOOR FROM GENERIC IMPORT -syn keyword modula3Keyword IN INC INTEGER ISTYPE LAST LOCK -syn keyword modula3Keyword LONGREAL LOOPHOLE MAX METHOD MIN MOD MUTEX -syn keyword modula3Keyword NARROW NEW NIL NOT NULL NUMBER OF OR ORD RAISE -syn keyword modula3Keyword RAISES READONLY REAL RECORD REF REFANY -syn keyword modula3Keyword RETURN ROOT -syn keyword modula3Keyword ROUND SET SUBARRAY TEXT TRUE TRUNC TRY TYPE -syn keyword modula3Keyword TYPECASE TYPECODE UNSAFE UNTRACED VAL VALUE VAR WITH +syn keyword modula3Keyword ANY ARRAY AS BITS BRANDED BY CASE CONST DEFINITION +syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION EXIT EXPORTS FINALLY +syn keyword modula3Keyword FROM GENERIC IMPORT LOCK METHOD OF RAISE RAISES +syn keyword modula3Keyword READONLY RECORD REF RETURN SET TRY TYPE TYPECASE +syn keyword modula3Keyword UNSAFE VALUE VAR WITH + +syn match modula3keyword "\" " Special keywords, block delimiters etc syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP -" Comments -syn region modula3Comment start="(\*" end="\*)" +" Reserved identifiers +syn keyword modula3Identifier ABS ADR ADRSIZE BITSIZE BYTESIZE CEILING DEC +syn keyword modula3Identifier DISPOSE FIRST FLOAT FLOOR INC ISTYPE LAST +syn keyword modula3Identifier LOOPHOLE MAX MIN NARROW NEW NUMBER ORD ROUND +syn keyword modula3Identifier SUBARRAY TRUNC TYPECODE VAL + +" Predefined types +syn keyword modula3Type ADDRESS BOOLEAN CARDINAL CHAR EXTENDED INTEGER +syn keyword modula3Type LONGCARD LONGINT LONGREAL MUTEX NULL REAL REFANY TEXT +syn keyword modula3Type WIDECHAR + +syn match modula3Type "\<\%(UNTRACED\s\+\)\=ROOT\>" + +" Operators +syn keyword modulaOperator DIV MOD IN AND OR NOT + +if exists("modula3_operators") + syn match modula3Operator "\^" + syn match modula3Operator "+\|-\|\*\|/\|&" + " TODO: need to exclude = in procedure definitions + syn match modula3Operator "<=\|<\|>=\|>\|:\@" +syn match modula3Integer "\<\d\d\=_\x\+L\=\>" + +" Reals +syn match modula3Real "\c\<\d\+\.\d\+\%([EDX][+-]\=\d\+\)\=\>" + +" String escape sequences +syn match modula3Escape "\\['"ntrf]" contained display +syn match modula3Escape "\\\o\{3}" contained display +syn match modula3Escape "\\\\" contained display + +" Characters +syn match modula3Character "'\%([^']\|\\.\|\\\o\{3}\)'" contains=modula3Escape " Strings -syn region modula3String start=+"+ end=+"+ -syn region modula3String start=+'+ end=+'+ +syn region modula3String start=+"+ end=+"+ contains=modula3Escape -" Define the default highlighting. -" Only when an item doesn't have highlighting yet +" Pragmas +syn region modula3Pragma start="<\*" end="\*>" -" The default methods for highlighting. Can be overridden later -hi def link modula3Keyword Statement -hi def link modula3Block PreProc -hi def link modula3Comment Comment -hi def link modula3String String +" Comments +syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell +" Default highlighting +hi def link modula3Block Statement +hi def link modula3Boolean Boolean +hi def link modula3Character Character +hi def link modula3Comment Comment +hi def link modula3Escape Special +hi def link modula3Identifier Keyword +hi def link modula3Integer Number +hi def link modula3Keyword Statement +hi def link modula3Nil Constant +hi def link modula3Operator Operator +hi def link modula3Pragma PreProc +hi def link modula3Real Float +hi def link modula3String String +hi def link modula3Type Type let b:current_syntax = "modula3" -"I prefer to use this... -"set ai -"vim: ts=8 +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/syntax/moo.vim b/runtime/syntax/moo.vim index 617058f8e32a5..6f2dd59e8418e 100644 --- a/runtime/syntax/moo.vim +++ b/runtime/syntax/moo.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: MOO " Maintainer: Timo Frenay -" Last Change: 2001 Oct 06 +" Last Change: 2020 Oct 19 " Note: Requires Vim 6.0 or above " quit when a syntax file was already loaded @@ -95,7 +95,7 @@ if exists("moo_unknown_builtin_functions") syn keyword mooKnownBuiltinFunction abs acos add_property add_verb asin atan binary_hash boot_player buffered_output_length callers caller_perms call_function ceil children chparent clear_property connected_players connected_seconds connection_name connection_option connection_options cos cosh create crypt ctime db_disk_size decode_binary delete_property delete_verb disassemble dump_database encode_binary equal eval exp floatstr floor flush_input force_input function_info idle_seconds index is_clear_property is_member is_player kill_task length listappend listdelete listen listeners listinsert listset log log10 match max max_object memory_usage min move notify object_bytes open_network_connection output_delimiters parent pass players properties property_info queued_tasks queue_info raise random read recycle renumber reset_max_object resume rindex rmatch seconds_left server_log server_version setadd setremove set_connection_option set_player_flag set_property_info set_task_perms set_verb_args set_verb_code set_verb_info shutdown sin sinh sqrt strcmp string_hash strsub substitute suspend tan tanh task_id task_stack ticks_left time tofloat toint toliteral tonum toobj tostr trunc typeof unlisten valid value_bytes value_hash verbs verb_args verb_code verb_info contained endif -"īŋŊEnclosed expressions +" Enclosed expressions syn match mooUnenclosedError display ~[')\]|}]~ syn match mooParenthesesError display ~[';\]|}]~ contained syn region mooParentheses start=~(~ end=~)~ transparent contains=@mooEnclosedContents,mooParenthesesError diff --git a/runtime/syntax/mupad.vim b/runtime/syntax/mupad.vim index 55ea9c4e438c5..df87ad14fe4db 100644 --- a/runtime/syntax/mupad.vim +++ b/runtime/syntax/mupad.vim @@ -279,5 +279,6 @@ hi def link mupadType Type hi def link mupadDefine Define hi def link mupadIdentifier Identifier +let b:current_syntax = 'mupad' " TODO More comprehensive listing. diff --git a/runtime/syntax/nasm.vim b/runtime/syntax/nasm.vim index 4f70a0f334be6..d7630332255c0 100644 --- a/runtime/syntax/nasm.vim +++ b/runtime/syntax/nasm.vim @@ -3,7 +3,7 @@ " Maintainer: Andrii Sokolov " Original Author: Manuel M.H. Stol " Former Maintainer: Manuel M.H. Stol -" Contributors: Leonard KÃļnig (C string highlighting) +" Contributors: Leonard KÃļnig (C string highlighting), Peter Stanhope (Add missing 64-bit mode registers) " Last Change: 2017 Jan 23 " NASM Home: http://www.nasm.us/ @@ -240,7 +240,8 @@ syn cluster nasmGrpPreProcs contains=nasmMacroDef,@nasmGrpInMacros,@nasmGrpPreCo syn match nasmGen08Register "\<[A-D][HL]\>" syn match nasmGen16Register "\<\([A-D]X\|[DS]I\|[BS]P\)\>" syn match nasmGen32Register "\" -syn match nasmGen64Register "\" +syn match nasmGen64Register "\" +syn match nasmExtRegister "\<\([SB]PL\|[SD]IL\)\>" syn match nasmSegRegister "\<[C-GS]S\>" syn match nasmSpcRegister "\" syn match nasmFpuRegister "\" diff --git a/runtime/syntax/neomuttrc.vim b/runtime/syntax/neomuttrc.vim index 7ff89879d9ecd..421b11ffa3089 100644 --- a/runtime/syntax/neomuttrc.vim +++ b/runtime/syntax/neomuttrc.vim @@ -1,10 +1,11 @@ " Vim syntax file " Language: NeoMutt setup files -" Maintainer: Guillaume Brogi -" Last Change: 2018-03-25 +" Maintainer: Richard Russon +" Previous Maintainer: Guillaume Brogi +" Last Change: 2022-04-08 " Original version based on syntax/muttrc.vim -" This file covers NeoMutt 2018-03-23 +" This file covers NeoMutt 2022-04-08 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -18,23 +19,22 @@ set cpo&vim setlocal isk=@,48-57,_,- " handling optional variables -syntax match muttrcComment "^# .*$" contains=@Spell -syntax match muttrcComment "^#[^ ].*$" -syntax match muttrcComment "^#$" -syntax match muttrcComment "[^\\]#.*$"lc=1 +syntax match muttrcComment "^# .*$" contains=@Spell +syntax match muttrcComment "^#[^ ].*$" +syntax match muttrcComment "^#$" +syntax match muttrcComment "[^\\]#.*$"lc=1 " Escape sequences (back-tick and pipe goes here too) -syntax match muttrcEscape +\\[#tnr"'Cc ]+ -syntax match muttrcEscape +[`|]+ -syntax match muttrcEscape +\\$+ +syntax match muttrcEscape +\\[#tnr"'Cc ]+ +syntax match muttrcEscape +[`|]+ +syntax match muttrcEscape +\\$+ " The variables takes the following arguments -"syn match muttrcString contained "=\s*[^ #"'`]\+"lc=1 contains=muttrcEscape -syntax region muttrcString contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString -syntax region muttrcString contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction +syntax region muttrcString contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString +syntax region muttrcString contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction syntax match muttrcStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcString,muttrcStringNL -syntax region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand,muttrcVarDeprecatedStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad +syntax region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand syntax match muttrcRXChars contained /[^\\][][.*?+]\+/hs=s+1 syntax match muttrcRXChars contained /[][|()][.*?+]*/ @@ -44,54 +44,53 @@ syntax match muttrcRXChars contained /\\/ " Why does muttrcRXString2 work with one \ when muttrcRXString requires two? syntax region muttrcRXString contained skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars syntax region muttrcRXString contained skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars -syntax region muttrcRXString contained skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars +syntax region muttrcRXString contained skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars " For some reason, skip refuses to match backslashes here... syntax region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXChars syntax region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXChars syntax region muttrcRXString2 contained skipwhite start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars syntax region muttrcRXString2 contained skipwhite start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars -" these must be kept synchronized with muttrcRXString, but are intended for -" muttrcRXHooks +" these must be kept synchronized with muttrcRXString, but are intended for muttrcRXHooks syntax region muttrcRXHookString contained keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syntax region muttrcRXHookString contained keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL -syntax region muttrcRXHookString contained keepend skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syntax region muttrcRXHookString contained keepend skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syntax region muttrcRXHookString contained keepend skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL syntax region muttrcRXHookString contained keepend matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL -syntax match muttrcRXHookStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL +syntax match muttrcRXHookStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL " these are exclusively for args lists (e.g. -rx pat pat pat ...) -syntax region muttrcRXPat contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat -syntax region muttrcRXPat contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat -syntax match muttrcRXPat contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat -syntax match muttrcRXDef contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat - -syntax match muttrcSpecial +\(['"]\)!\1+ - -syntax match muttrcSetStrAssignment contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr contains=muttrcVariable,muttrcEscapedVariable -syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr contains=muttrcString -syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr contains=muttrcString -syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr contains=muttrcVariable,muttrcEscapedVariable -syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr contains=muttrcVariable,muttrcEscapedVariable -syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetNumAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr contains=muttrcVariable,muttrcEscapedVariable -syntax match muttrcSetNumAssignment contained skipwhite /=\s*\d\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetNumAssignment contained skipwhite /=\s*"\d\+"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax region muttrcRXPat contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat +syntax region muttrcRXPat contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat +syntax match muttrcRXPat contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat +syntax match muttrcRXDef contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat + +syntax match muttrcSpecial +\(['"]\)!\1+ + +syntax match muttrcSetStrAssignment contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString +syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetNumAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax match muttrcSetNumAssignment contained skipwhite /=\s*\d\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetNumAssignment contained skipwhite /=\s*"\d\+"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " Now catch some email addresses and headers (purified version from mail.vim) -syntax match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+" -syntax match muttrcHeader "\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" +syntax match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+" +syntax match muttrcHeader "\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" syntax match muttrcKeySpecial contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+ -syntax match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName -syntax region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial,muttrcKeyName -syntax region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial,muttrcKeyName +syntax match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName +syntax region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial,muttrcKeyName +syntax region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial,muttrcKeyName syntax match muttrcKeyName contained "\\[trne]" syntax match muttrcKeyName contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|Next\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" syntax match muttrcKeyName contained "\c" @@ -102,90 +101,88 @@ syntax match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVv syntax match muttrcStrftimeEscapes contained /%E[cCxXyY]/ syntax match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/ -syntax region muttrcIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcGroupIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcGroupIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcSidebarFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcSidebarFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcQueryFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcAliasFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcAliasFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcAttachFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcAttachFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcComposeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcComposeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcFolderFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcFolderFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcMixFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcMixFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcPGPFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcPGPFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcStatusFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcStatusFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcPGPGetKeysFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcPGPGetKeysFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcSmimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcSmimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcStrftimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -syntax region muttrcStrftimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax region muttrcAliasFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcAliasFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcAliasFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcAliasFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcAttachFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcAttachFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcComposeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcComposeFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcComposeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcComposeFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcFolderFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcFolderFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcGroupIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcGroupIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcMixFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcMixFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPatternFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPatternFormatEscapes,muttrcPatternFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPatternFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPatternFormatEscapes,muttrcPatternFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcQueryFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcQueryFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSidebarFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSidebarFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSmimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSmimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStatusFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStatusFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStrftimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStrftimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " Format escapes and conditionals syntax match muttrcFormatConditionals2 contained /[^?]*?/ -function! s:escapesConditionals(baseName, sequence, alignment, secondary) +function! s:escapesConditionals(baseName, sequence, padding, conditional) exec 'syntax match muttrc' . a:baseName . 'Escapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?\%(' . a:sequence . '\|%\)/' - if a:alignment + if a:padding exec 'syntax match muttrc' . a:baseName . 'Escapes contained /%[>|*]./' endif - if a:secondary + if a:conditional exec 'syntax match muttrc' . a:baseName . 'Conditionals contained /%?\%(' . a:sequence . '\)?/ nextgroup=muttrcFormatConditionals2' else exec 'syntax match muttrc' . a:baseName . 'Conditionals contained /%?\%(' . a:sequence . '\)?/' endif endfunction -" CHECKED 2018-04-18 -" Ref: index_format_str() in hdrline.c -call s:escapesConditionals('IndexFormat', '[AaBbCcDdEeFfgHIiJKLlMmNnOPqRrSsTtuvWXxYyZz(<[{]\|G[a-zA-Z]\+', 1, 1) -" Ref: alias_format_str() in addrbook.c -syntax match muttrcAliasFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[afnrt%]/ -" Ref: group_index_format_str() in browser.c -call s:escapesConditionals('GroupIndexFormat', '[CdfMNns]', 1, 1) -" Ref: sidebar_format_str() in sidebar.c -call s:escapesConditionals('SidebarFormat', '[BdFLNnSt!]', 1, 1) -" Ref: query_format_str() in query.c -call s:escapesConditionals('QueryFormat', '[acent]', 0, 1) -" Ref: attach_format_str() in recvattach.c +" CHECKED 2022-04-08 +" Ref: alias_format_str() in alias/dlg_alias.c +call s:escapesConditionals('AliasFormat', '[acfnrt]', 1, 0) +" Ref: attach_format_str() in attach/dlg_attach.c call s:escapesConditionals('AttachFormat', '[CcDdeFfIMmnQsTtuX]', 1, 1) -" Ref: compose_format_str() in compose.c -syntax match muttrcComposeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ahlv%]/ -syntax match muttrcComposeFormatEscapes contained /%[>|*]./ -" Ref: folder_format_str() in browser.c -call s:escapesConditionals('FolderFormat', '[CDdFfglmNnstu]', 1, 0) +" Ref: compose_format_str() in compose/cbar.c +call s:escapesConditionals('ComposeFormat', '[ahlv]', 1, 1) +" Ref: folder_format_str() in browser/browser.c +call s:escapesConditionals('FolderFormat', '[CDdFfgilmNnstu]', 1, 0) +" Ref: group_index_format_str() in nntp/browse.c +call s:escapesConditionals('GroupIndexFormat', '[CdfMNns]', 1, 1) +" Ref: index_format_str() in hdrline.c +call s:escapesConditionals('IndexFormat', '[AaBbCDdEefgHIiJKLlMmNnOPqRrSsTtuvWXxYyZ(<[{]\|@\i\+@\|G[a-zA-Z]\+\|Fp\=\|z[cst]\|cr\=', 1, 1) " Ref: mix_format_str() in remailer.c -call s:escapesConditionals('MixFormat', '[acns]', 0, 0) -" Ref: status_format_str() in status.c -call s:escapesConditionals('StatusFormat', '[bdFfhLlMmnoPpRrSstuVv]', 1, 1) -" Ref: fmt_smime_command() in ncrypt/smime.c -call s:escapesConditionals('SmimeFormat', '[aCcdfiks]', 0, 1) -" Ref: crypt_format_str() in ncrypt/crypt_gpgme.c -" Ref: pgp_entry_fmt() in ncrypt/pgpkey.c -" Note: crypt_format_str() supports 'p', but pgp_entry_fmt() does not -call s:escapesConditionals('PGPFormat', '[acfklnptu[]', 0, 0) -" Ref: fmt_pgp_command() ncrypt/pgpinvoke.c +call s:escapesConditionals('MixFormat', '[acns]', 1, 0) +" Ref: pattern_format_str() in pattern/dlg_pattern.c +call s:escapesConditionals('PatternFormat', '[den]', 1, 0) +" Ref: pgp_command_format_str() in ncrypt/pgpinvoke.c call s:escapesConditionals('PGPCmdFormat', '[afprs]', 0, 1) +" Ref: crypt_format_str() in ncrypt/dlg_gpgme.c +" Ref: pgp_entry_format_str() in ncrypt/dlg_pgp.c +" Note: crypt_format_str() supports 'p', but pgp_entry_fmt() does not +call s:escapesConditionals('PGPFormat', '[AaCcFfKkLlnptu[]', 0, 0) +" Ref: query_format_str() in alias/dlg_query.c +call s:escapesConditionals('QueryFormat', '[acent]', 1, 1) +" Ref: sidebar_format_str() in sidebar/window.c +call s:escapesConditionals('SidebarFormat', '[!BDdFLNnorStZ]', 1, 1) +" Ref: smime_command_format_str() in ncrypt/smime.c +call s:escapesConditionals('SmimeFormat', '[aCcdfiks]', 0, 1) +" Ref: status_format_str() in status.c +call s:escapesConditionals('StatusFormat', '[bDdFfhLlMmnoPpRrSsTtuVv]', 1, 1) -" This matches the documentation, but directly contradicts the code -" (according to the code, this should be identical to the muttrcPGPCmdFormatEscapes -syntax match muttrcPGPGetKeysFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[acfklntu[%]/ - -syntax region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes -syntax region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes -syntax region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes -syntax region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes syntax region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes syntax match muttrcVarEqualsAliasFmt contained skipwhite "=" nextgroup=muttrcAliasFormatStr syntax match muttrcVarEqualsAttachFmt contained skipwhite "=" nextgroup=muttrcAttachFormatStr @@ -194,31 +191,23 @@ syntax match muttrcVarEqualsFolderFmt contained skipwhite "=" nextgroup=mutt syntax match muttrcVarEqualsGrpIdxFmt contained skipwhite "=" nextgroup=muttrcGroupIndexFormatStr syntax match muttrcVarEqualsIdxFmt contained skipwhite "=" nextgroup=muttrcIndexFormatStr syntax match muttrcVarEqualsMixFmt contained skipwhite "=" nextgroup=muttrcMixFormatStr +syntax match muttrcVarEqualsPatternFmt contained skipwhite "=" nextgroup=muttrcPatternFormatStr syntax match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr syntax match muttrcVarEqualsPGPFmt contained skipwhite "=" nextgroup=muttrcPGPFormatStr -syntax match muttrcVarEqualsPGPGetKeysFmt contained skipwhite "=" nextgroup=muttrcPGPGetKeysFormatStr syntax match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr syntax match muttrcVarEqualsSdbFmt contained skipwhite "=" nextgroup=muttrcSidebarFormatStr syntax match muttrcVarEqualsSmimeFmt contained skipwhite "=" nextgroup=muttrcSmimeFormatStr syntax match muttrcVarEqualsStatusFmt contained skipwhite "=" nextgroup=muttrcStatusFormatStr syntax match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=muttrcStrftimeFormatStr -syntax match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -" CHECKED 2018-04-18 -" List of the different screens in mutt -syntax keyword muttrcMenu contained alias attach browser compose editor generic index key_select_pgp key_select_smime mix pager pgp postpone query smime +" CHECKED 2022-04-08 +" List of the different screens in NeoMutt (see MenuNames in menu/type.c) +syntax keyword muttrcMenu contained alias attach autocrypt browser compose editor generic index key_select_pgp key_select_smime mix pager pgp postpone query smime syntax match muttrcMenuList "\S\+" contained contains=muttrcMenu syntax match muttrcMenuCommas /,/ contained -" CHECKED 2018-04-18 -" List of hooks in Commands in init.h -syntax keyword muttrcHooks contained skipwhite - \ account-hook append-hook close-hook crypt-hook fcc-hook fcc-save-hook - \ folder-hook iconv-hook mbox-hook message-hook open-hook pgp-hook - \ reply-hook save-hook send-hook send2-hook -syntax keyword muttrcHooks skipwhite shutdown-hook startup-hook timeout-hook nextgroup=muttrcCommand - syntax region muttrcSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL syntax region muttrcSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL @@ -232,17 +221,17 @@ syntax match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite next syntax match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)" syntax keyword muttrcAsterisk contained * + syntax keyword muttrcListsKeyword lists skipwhite nextgroup=muttrcGroupDef,muttrcComment syntax keyword muttrcListsKeyword unlists skipwhite nextgroup=muttrcAsterisk,muttrcComment -syntax keyword muttrcSubscribeKeyword subscribe nextgroup=muttrcGroupDef,muttrcComment -syntax keyword muttrcSubscribeKeyword unsubscribe nextgroup=muttrcAsterisk,muttrcComment +syntax keyword muttrcSubscribeKeyword subscribe skipwhite nextgroup=muttrcGroupDef,muttrcComment +syntax keyword muttrcSubscribeKeyword unsubscribe skipwhite nextgroup=muttrcAsterisk,muttrcComment syntax keyword muttrcAlternateKeyword contained alternates unalternates syntax region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment -" muttrcVariable includes a prefix because partial strings are considered -" valid. +" muttrcVariable includes a prefix because partial strings are considered valid. syntax match muttrcVariable contained "\\\@]\+" contains=muttrcEmail syntax match muttrcAction contained "<[^>]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName -" First, functions that take regular expressions: +" CHECKED 2022-04-08 +" First, hooks that take regular expressions: syntax match muttrcRXHookNot contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL syntax match muttrcRXHooks /\<\%(account\|append\|close\|crypt\|folder\|mbox\|open\|pgp\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL -" Now, functions that take patterns +" Now, hooks that take patterns syntax match muttrcPatHookNot contained /!\s*/ skipwhite nextgroup=muttrcPattern -syntax match muttrcPatHooks /\<\%(charset\|iconv\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern +syntax match muttrcPatHooks /\<\%(charset\|iconv\|index-format\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern syntax match muttrcPatHooks /\<\%(message\|reply\|send\|send2\|save\|fcc\|fcc-save\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern +" Global hooks that take a command +syntax keyword muttrcHooks skipwhite shutdown-hook startup-hook timeout-hook nextgroup=muttrcCommand + syntax match muttrcBindFunction contained /\S\+\>/ skipwhite contains=muttrcFunction syntax match muttrcBindFunctionNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL syntax match muttrcBindKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL @@ -271,8 +264,8 @@ syntax region muttrcMacroDescr contained keepend skipwhite start=+'+ms=e skip=+\ syntax region muttrcMacroDescr contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s syntax match muttrcMacroDescrNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL syntax region muttrcMacroBody contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL -syntax region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'\|\%(\%(\\\\\)\@-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)" +" Parameter: date syntax match muttrcSimplePat contained "!\?\^\?[~][dr]\s*\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\|\%(`[^`]\+`\)\|\%(\$[a-zA-Z0-9_-]\+\)\)" contains=muttrcShellString,muttrcVariable -syntax match muttrcSimplePat contained "!\?\^\?[~][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatRXContainer -syntax match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString +" Parameter: regex +syntax match muttrcSimplePat contained "!\?\^\?[~][BbCcefHhIiLMstwxYy]\s*" nextgroup=muttrcSimplePatRXContainer +" Parameter: pattern +syntax match muttrcSimplePat contained "!\?\^\?[%][BbCcefHhiLstxy]\s*" nextgroup=muttrcSimplePatString +" Parameter: pattern syntax match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString syntax region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat + "syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXString syntax region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+ syntax region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+ -syntax region muttrcSimplePatString contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 +syntax region muttrcSimplePatString contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 syntax region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXString syntax region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXString -syntax region muttrcSimplePatRXContainer contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString +syntax region muttrcSimplePatRXContainer contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString syntax match muttrcSimplePatMetas contained /[(|)]/ syntax match muttrcOptSimplePat contained skipwhite /[~=%!(^].*/ contains=muttrcSimplePat,muttrcSimplePatMetas @@ -349,12 +351,12 @@ syntax keyword muttrcColor contained brightblack brightblue brightcyan brightdef syntax match muttrcColor contained "\<\%(bright\)\=color\d\{1,3}\>" " Now for the structure of the color line syntax match muttrcColorRXNL contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL -syntax match muttrcColorBG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL +syntax match muttrcColorBG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL syntax match muttrcColorBGNL contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL -syntax match muttrcColorFG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL +syntax match muttrcColorFG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL syntax match muttrcColorFGNL contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL -syntax match muttrcColorContext contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace,muttrcColorCompose nextgroup=muttrcColorFG,muttrcColorFGNL -syntax match muttrcColorNL contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose +syntax match muttrcColorContext contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace,muttrcColorCompose nextgroup=muttrcColorFG,muttrcColorFGNL +syntax match muttrcColorNL contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose syntax match muttrcColorKeyword contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose " And now color's brother: syntax region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL @@ -372,28 +374,27 @@ syntax keyword muttrcMonoAttrib contained bold none normal reverse standout unde syntax keyword muttrcMono contained mono skipwhite nextgroup=muttrcColorField,muttrcColorCompose syntax match muttrcMonoLine "^\s*mono\s\+\S\+" skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono -" CHECKED 2018-04-18 -" List of fields in Fields in color.c +" CHECKED 2022-04-08 +" List of fields in ColorFields in color/commmand.c syntax keyword muttrcColorField skipwhite contained - \ attachment attach_headers body bold error hdrdefault header index - \ index_author index_collapsed index_date index_flags index_label - \ index_number index_size index_subject index_tag index_tags indicator - \ markers message normal progress prompt quoted search sidebar_divider - \ sidebar_flagged sidebar_highlight sidebar_indicator sidebar_new - \ sidebar_ordinary sidebar_spoolfile signature status tilde tree underline - \ nextgroup=muttrcColor + \ attachment attach_headers body bold error hdrdefault header index index_author + \ index_collapsed index_date index_flags index_label index_number index_size index_subject + \ index_tag index_tags indicator markers message normal options progress prompt quoted + \ search sidebar_divider sidebar_flagged sidebar_highlight sidebar_indicator sidebar_new + \ sidebar_ordinary sidebar_spoolfile sidebar_unread signature status tilde tree underline + \ warning nextgroup=muttrcColor + syntax match muttrcColorField contained "\" syntax match muttrcColorCompose skipwhite contained /\s*compose\s*/ nextgroup=muttrcColorComposeField -" CHECKED 2018-04-18 -" List of fields in ComposeFields in color.c +" CHECKED 2022-04-08 +" List of fields in ComposeColorFields in color/command.c syntax keyword muttrcColorComposeField skipwhite contained - \ header security_both security_encrypt security_none security_sign - \ nextgroup=muttrcColorFG,muttrcColorFGNL + \ header security_both security_encrypt security_none security_sign + \ nextgroup=muttrcColorFG,muttrcColorFGNL syntax region muttrcColorLine keepend start=/^\s*color\s\+/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace - function! s:boolQuadGen(type, vars, deprecated) let l:novars = copy(a:vars) call map(l:novars, '"no" . v:val') @@ -403,643 +404,473 @@ function! s:boolQuadGen(type, vars, deprecated) let l:orig_type = copy(a:type) if a:deprecated let l:type = 'Deprecated' . a:type + exec 'syntax keyword muttrcVar' . l:type . ' ' . join(a:vars) + exec 'syntax keyword muttrcVar' . l:type . ' ' . join(l:novars) + exec 'syntax keyword muttrcVar' . l:type . ' ' . join(l:invvars) else let l:type = a:type + exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(a:vars) . ' nextgroup=muttrcSet' . l:orig_type . 'Assignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr' + exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:novars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr' + exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:invvars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr' endif - exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(a:vars) . ' nextgroup=muttrcSet' . l:orig_type . 'Assignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr' - exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:novars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr' - exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:invvars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr' endfunction -" CHECKED 2018-04-18 -" List of DT_BOOL in MuttVars in init.h +" CHECKED 2022-04-08 +" List of DT_BOOL in MuttVars in mutt_config.c call s:boolQuadGen('Bool', [ - \ 'allow_8bit', 'allow_ansi', 'arrow_cursor', 'ascii_chars', 'askbcc', - \ 'askcc', 'ask_follow_up', 'ask_x_comment_to', 'attach_split', 'autoedit', - \ 'auto_tag', 'beep', 'beep_new', 'bounce_delivered', 'braille_friendly', - \ 'change_folder_next', 'check_mbox_size', 'check_new', 'collapse_all', - \ 'collapse_flagged', 'collapse_unread', 'confirmappend', 'confirmcreate', - \ 'crypt_autoencrypt', 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime', - \ 'crypt_confirmhook', 'crypt_opportunistic_encrypt', 'crypt_replyencrypt', - \ 'crypt_replysign', 'crypt_replysignencrypted', 'crypt_timestamp', - \ 'crypt_use_gpgme', 'crypt_use_pka', 'delete_untag', 'digest_collapse', - \ 'duplicate_threads', 'edit_headers', 'encode_from', 'fast_reply', - \ 'fcc_clear', 'flag_safe', 'followup_to', 'force_name', 'forward_decode', - \ 'forward_decrypt', 'forward_quote', 'forward_references', 'hdrs', - \ 'header', 'header_cache_compress', 'header_color_partial', 'help', - \ 'hidden_host', 'hide_limited', 'hide_missing', 'hide_thread_subject', - \ 'hide_top_limited', 'hide_top_missing', 'history_remove_dups', - \ 'honor_disposition', 'idn_decode', 'idn_encode', 'ignore_list_reply_to', - \ 'imap_check_subscribed', 'imap_idle', 'imap_list_subscribed', - \ 'imap_passive', 'imap_peek', 'imap_servernoise', 'implicit_autoview', - \ 'include_onlyfirst', 'keep_flagged', 'mailcap_sanitize', - \ 'maildir_check_cur', 'maildir_header_cache_verify', 'maildir_trash', - \ 'mail_check_recent', 'mail_check_stats', 'markers', 'mark_old', - \ 'menu_move_off', 'menu_scroll', 'message_cache_clean', 'meta_key', - \ 'metoo', 'mh_purge', 'mime_forward_decode', 'mime_subject', - \ 'mime_type_query_first', 'narrow_tree', 'nm_record', 'nntp_listgroup', - \ 'nntp_load_description', 'pager_stop', 'pgp_autoinline', - \ 'pgp_auto_decode', 'pgp_check_exit', 'pgp_ignore_subkeys', 'pgp_long_ids', - \ 'pgp_replyinline', 'pgp_retainable_sigs', 'pgp_self_encrypt', - \ 'pgp_show_unusable', 'pgp_strict_enc', 'pgp_use_gpg_agent', 'pipe_decode', - \ 'pipe_split', 'pop_auth_try_all', 'pop_last', 'postpone_encrypt', - \ 'print_decode', 'print_split', 'prompt_after', 'read_only', - \ 'reflow_space_quotes', 'reflow_text', 'reply_self', 'reply_with_xorig', - \ 'resolve', 'resume_draft_files', 'resume_edited_draft_files', - \ 'reverse_alias', 'reverse_name', 'reverse_realname', 'rfc2047_parameters', - \ 'save_address', 'save_empty', 'save_name', 'save_unsubscribed', 'score', - \ 'show_new_news', 'show_only_unread', 'sidebar_folder_indent', - \ 'sidebar_new_mail_only', 'sidebar_next_new_wrap', 'sidebar_on_right', - \ 'sidebar_short_path', 'sidebar_visible', 'sig_dashes', 'sig_on_top', - \ 'smart_wrap', 'smime_ask_cert_label', 'smime_decrypt_use_default_key', - \ 'smime_is_default', 'smime_self_encrypt', 'sort_re', 'ssl_force_tls', - \ 'ssl_usesystemcerts', 'ssl_use_sslv2', 'ssl_use_sslv3', 'ssl_use_tlsv1', - \ 'ssl_use_tlsv1_1', 'ssl_use_tlsv1_2', 'ssl_verify_dates', - \ 'ssl_verify_host', 'ssl_verify_partial_chains', 'status_on_top', - \ 'strict_threads', 'suspend', 'text_flowed', 'thorough_search', - \ 'thread_received', 'tilde', 'ts_enabled', 'uncollapse_jump', - \ 'uncollapse_new', 'user_agent', 'use_8bitmime', 'use_domain', - \ 'use_envelope_from', 'use_from', 'use_ipv6', 'virtual_spoolfile', - \ 'wait_key', 'weed', 'wrap_search', 'write_bcc', 'x_comment_to' - \ ], 0) - -" CHECKED 2018-04-18 + \ 'abort_backspace', 'allow_8bit', 'allow_ansi', 'arrow_cursor', 'ascii_chars', 'ask_bcc', + \ 'ask_cc', 'ask_follow_up', 'ask_x_comment_to', 'attach_save_without_prompting', + \ 'attach_split', 'autocrypt', 'autocrypt_reply', 'auto_edit', 'auto_subscribe', 'auto_tag', + \ 'beep', 'beep_new', 'bounce_delivered', 'braille_friendly', + \ 'browser_abbreviate_mailboxes', 'change_folder_next', 'check_mbox_size', 'check_new', + \ 'collapse_all', 'collapse_flagged', 'collapse_unread', 'compose_show_user_headers', + \ 'confirm_append', 'confirm_create', 'copy_decode_weed', 'count_alternatives', + \ 'crypt_auto_encrypt', 'crypt_auto_pgp', 'crypt_auto_sign', 'crypt_auto_smime', + \ 'crypt_confirm_hook', 'crypt_opportunistic_encrypt', + \ 'crypt_opportunistic_encrypt_strong_keys', 'crypt_protected_headers_read', + \ 'crypt_protected_headers_save', 'crypt_protected_headers_write', 'crypt_reply_encrypt', + \ 'crypt_reply_sign', 'crypt_reply_sign_encrypted', 'crypt_timestamp', 'crypt_use_gpgme', + \ 'crypt_use_pka', 'delete_untag', 'digest_collapse', 'duplicate_threads', 'edit_headers', + \ 'encode_from', 'fast_reply', 'fcc_before_send', 'fcc_clear', 'flag_safe', 'followup_to', + \ 'force_name', 'forward_decode', 'forward_decrypt', 'forward_quote', 'forward_references', + \ 'hdrs', 'header', 'header_color_partial', 'help', 'hidden_host', 'hide_limited', + \ 'hide_missing', 'hide_thread_subject', 'hide_top_limited', 'hide_top_missing', + \ 'history_remove_dups', 'honor_disposition', 'idn_decode', 'idn_encode', + \ 'ignore_list_reply_to', 'imap_check_subscribed', 'imap_condstore', 'imap_deflate', + \ 'imap_idle', 'imap_list_subscribed', 'imap_passive', 'imap_peek', 'imap_qresync', + \ 'imap_rfc5161', 'imap_server_noise', 'implicit_autoview', 'include_encrypted', + \ 'include_only_first', 'keep_flagged', 'local_date_header', 'mailcap_sanitize', + \ 'maildir_check_cur', 'maildir_header_cache_verify', 'maildir_trash', 'mail_check_recent', + \ 'mail_check_stats', 'markers', 'mark_old', 'menu_move_off', 'menu_scroll', + \ 'message_cache_clean', 'meta_key', 'me_too', 'mh_purge', 'mime_forward_decode', + \ 'mime_type_query_first', 'narrow_tree', 'nm_query_window_enable', 'nm_record', + \ 'nntp_listgroup', 'nntp_load_description', 'pager_stop', 'pgp_auto_decode', + \ 'pgp_auto_inline', 'pgp_check_exit', 'pgp_check_gpg_decrypt_status_fd', + \ 'pgp_ignore_subkeys', 'pgp_long_ids', 'pgp_reply_inline', 'pgp_retainable_sigs', + \ 'pgp_self_encrypt', 'pgp_show_unusable', 'pgp_strict_enc', 'pgp_use_gpg_agent', + \ 'pipe_decode', 'pipe_decode_weed', 'pipe_split', 'pop_auth_try_all', 'pop_last', + \ 'postpone_encrypt', 'print_decode', 'print_decode_weed', 'print_split', 'prompt_after', + \ 'read_only', 'reflow_space_quotes', 'reflow_text', 'reply_self', 'reply_with_xorig', + \ 'resolve', 'resume_draft_files', 'resume_edited_draft_files', 'reverse_alias', + \ 'reverse_name', 'reverse_real_name', 'rfc2047_parameters', 'save_address', 'save_empty', + \ 'save_name', 'save_unsubscribed', 'score', 'show_new_news', 'show_only_unread', + \ 'sidebar_folder_indent', 'sidebar_new_mail_only', 'sidebar_next_new_wrap', + \ 'sidebar_non_empty_mailbox_only', 'sidebar_on_right', 'sidebar_short_path', + \ 'sidebar_visible', 'sig_dashes', 'sig_on_top', 'size_show_bytes', 'size_show_fractions', + \ 'size_show_mb', 'size_units_on_left', 'smart_wrap', 'smime_ask_cert_label', + \ 'smime_decrypt_use_default_key', 'smime_is_default', 'smime_self_encrypt', 'sort_re', + \ 'ssl_force_tls', 'ssl_use_sslv2', 'ssl_use_sslv3', 'ssl_use_system_certs', + \ 'ssl_use_tlsv1', 'ssl_use_tlsv1_1', 'ssl_use_tlsv1_2', 'ssl_use_tlsv1_3', + \ 'ssl_verify_dates', 'ssl_verify_host', 'ssl_verify_partial_chains', 'status_on_top', + \ 'strict_threads', 'suspend', 'text_flowed', 'thorough_search', 'thread_received', 'tilde', + \ 'ts_enabled', 'tunnel_is_secure', 'uncollapse_jump', 'uncollapse_new', 'user_agent', + \ 'use_8bit_mime', 'use_domain', 'use_envelope_from', 'use_from', 'use_ipv6', + \ 'virtual_spool_file', 'wait_key', 'weed', 'wrap_search', 'write_bcc', 'x_comment_to' + \ ], 0) + +" CHECKED 2022-04-08 " Deprecated Bools -" List of DT_SYNONYM synonyms of Bools in MuttVars in init.h +" List of DT_SYNONYM or DT_DEPRECATED Bools in MuttVars in mutt_config.c call s:boolQuadGen('Bool', [ - \ 'edit_hdrs', 'envelope_from', 'forw_decode', 'forw_decrypt', - \ 'forw_quote', 'ignore_linear_white_space', 'pgp_autoencrypt', - \ 'pgp_autosign', 'pgp_auto_traditional', 'pgp_create_traditional', - \ 'pgp_replyencrypt', 'pgp_replysign', 'pgp_replysignencrypted', - \ 'xterm_set_titles' - \ ], 1) - -" CHECKED 2018-04-18 -" List of DT_QUAD in MuttVars in init.h + \ 'askbcc', 'askcc', 'autoedit', 'confirmappend', 'confirmcreate', 'crypt_autoencrypt', + \ 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime', 'crypt_confirmhook', + \ 'crypt_replyencrypt', 'crypt_replysign', 'crypt_replysignencrypted', 'edit_hdrs', + \ 'envelope_from', 'forw_decode', 'forw_decrypt', 'forw_quote', 'header_cache_compress', + \ 'ignore_linear_white_space', 'imap_servernoise', 'include_onlyfirst', 'metoo', + \ 'mime_subject', 'pgp_autoencrypt', 'pgp_autoinline', 'pgp_autosign', + \ 'pgp_auto_traditional', 'pgp_create_traditional', 'pgp_replyencrypt', 'pgp_replyinline', + \ 'pgp_replysign', 'pgp_replysignencrypted', 'reverse_realname', 'ssl_usesystemcerts', + \ 'use_8bitmime', 'virtual_spoolfile', 'xterm_set_titles' + \ ], 1) + +" CHECKED 2022-04-08 +" List of DT_QUAD in MuttVars in mutt_config.c call s:boolQuadGen('Quad', [ - \ 'abort_noattach', 'abort_nosubject', 'abort_unmodified', 'bounce', - \ 'catchup_newsgroup', 'copy', 'crypt_verify_sig', 'delete', 'fcc_attach', - \ 'followup_to_poster', 'forward_edit', 'honor_followup_to', 'include', - \ 'mime_forward', 'mime_forward_rest', 'move', 'pgp_mime_auto', - \ 'pop_delete', 'pop_reconnect', 'postpone', 'post_moderated', 'print', - \ 'quit', 'recall', 'reply_to', 'ssl_starttls' - \ ], 0) - -" CHECKED 2018-04-18 + \ 'abort_noattach', 'abort_nosubject', 'abort_unmodified', 'bounce', 'catchup_newsgroup', + \ 'copy', 'crypt_verify_sig', 'delete', 'fcc_attach', 'followup_to_poster', + \ 'forward_attachments', 'forward_edit', 'honor_followup_to', 'include', 'mime_forward', + \ 'mime_forward_rest', 'move', 'pgp_mime_auto', 'pop_delete', 'pop_reconnect', 'postpone', + \ 'post_moderated', 'print', 'quit', 'recall', 'reply_to', 'ssl_starttls', + \ ], 0) + +" CHECKED 2022-04-08 " Deprecated Quads -" List of DT_SYNONYM synonyms of Quads in MuttVars in init.h +" List of DT_SYNONYM or DT_DEPRECATED Quads in MuttVars in mutt_config.c call s:boolQuadGen('Quad', [ - \ 'mime_fwd', 'pgp_encrypt_self', 'pgp_verify_sig', 'smime_encrypt_self' - \ ], 1) + \ 'mime_fwd', 'pgp_encrypt_self', 'pgp_verify_sig', 'smime_encrypt_self' + \ ], 1) -" CHECKED 2018-04-18 -" List of DT_NUMBER in MuttVars in init.h +" CHECKED 2022-04-08 +" List of DT_NUMBER or DT_LONG in MuttVars in mutt_config.c syntax keyword muttrcVarNum skipwhite contained - \ connect_timeout debug_level history imap_keepalive imap_pipeline_depth - \ imap_poll_timeout mail_check mail_check_stats_interval menu_context - \ net_inc nm_db_limit nm_open_timeout nm_query_window_current_position - \ nm_query_window_duration nntp_context nntp_poll pager_context - \ pager_index_lines pgp_timeout pop_checkinterval read_inc reflow_wrap - \ save_history score_threshold_delete score_threshold_flag - \ score_threshold_read search_context sendmail_wait sidebar_component_depth - \ sidebar_width skip_quoted_offset sleep_time smime_timeout - \ ssl_min_dh_prime_bits timeout time_inc wrap wrap_headers write_inc - \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr + \ connect_timeout debug_level header_cache_compress_level history imap_fetch_chunk_size + \ imap_keepalive imap_pipeline_depth imap_poll_timeout mail_check mail_check_stats_interval + \ menu_context net_inc nm_db_limit nm_open_timeout nm_query_window_current_position + \ nm_query_window_duration nntp_context nntp_poll pager_context pager_index_lines + \ pager_read_delay pager_skip_quoted_context pgp_timeout pop_check_interval read_inc + \ reflow_wrap save_history score_threshold_delete score_threshold_flag score_threshold_read + \ search_context sendmail_wait sidebar_component_depth sidebar_width sleep_time + \ smime_timeout ssl_min_dh_prime_bits timeout time_inc toggle_quoted_show_levels wrap + \ wrap_headers write_inc + \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" CHECKED 2022-04-08 +" Deprecated Numbers syntax keyword muttrcVarDeprecatedNum contained skipwhite - \ wrapmargin - \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr + \ header_cache_pagesize pop_checkinterval skip_quoted_offset -" CHECKED 2018-04-18 -" List of DT_STRING in MuttVars in init.h +" CHECKED 2022-04-08 +" List of DT_STRING in MuttVars in mutt_config.c " Special cases first, and all the rest at the end " Formats themselves must be updated in their respective groups " See s:escapesConditionals -syntax match muttrcVarStr contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax match muttrcVarStr contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syntax keyword muttrcVarStr contained skipwhite alias_format nextgroup=muttrcVarEqualsAliasFmt syntax keyword muttrcVarStr contained skipwhite attach_format nextgroup=muttrcVarEqualsAttachFmt syntax keyword muttrcVarStr contained skipwhite compose_format nextgroup=muttrcVarEqualsComposeFmt syntax keyword muttrcVarStr contained skipwhite folder_format vfolder_format nextgroup=muttrcVarEqualsFolderFmt -syntax keyword muttrcVarStr contained skipwhite attribution index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt -" Deprecated format -syntax keyword muttrcVarDeprecatedStr contained skipwhite hdr_format msg_format nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite attribution forward_format index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt syntax keyword muttrcVarStr contained skipwhite mix_entry_format nextgroup=muttrcVarEqualsMixFmt +syntax keyword muttrcVarStr contained skipwhite pattern_format nextgroup=muttrcVarEqualsPatternFmt syntax keyword muttrcVarStr contained skipwhite - \ pgp_clearsign_command pgp_decode_command pgp_decrypt_command - \ pgp_encrypt_only_command pgp_encrypt_sign_command pgp_export_command - \ pgp_import_command pgp_list_pubring_command pgp_list_secring_command - \ pgp_sign_command pgp_verify_command pgp_verify_key_command - \ nextgroup=muttrcVarEqualsPGPCmdFmt + \ pgp_clear_sign_command pgp_decode_command pgp_decrypt_command pgp_encrypt_only_command + \ pgp_encrypt_sign_command pgp_export_command pgp_get_keys_command pgp_import_command + \ pgp_list_pubring_command pgp_list_secring_command pgp_sign_command pgp_verify_command + \ pgp_verify_key_command + \ nextgroup=muttrcVarEqualsPGPCmdFmt syntax keyword muttrcVarStr contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt -syntax keyword muttrcVarStr contained skipwhite pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt syntax keyword muttrcVarStr contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFmt syntax keyword muttrcVarStr contained skipwhite - \ smime_decrypt_command smime_encrypt_command smime_get_cert_command - \ smime_get_cert_email_command smime_get_signer_cert_command - \ smime_import_cert_command smime_pk7out_command smime_sign_command - \ smime_verify_command smime_verify_opaque_command - \ nextgroup=muttrcVarEqualsSmimeFmt -syntax keyword muttrcVarStr contained skipwhite ts_icon_format ts_status_format status_format nextgroup=muttrcVarEqualsStatusFmt -" Deprecated format -syntax keyword muttrcVarDeprecatedStr contained skipwhite xterm_icon xterm_title nextgroup=muttrcVarEqualsStatusFmt + \ smime_decrypt_command smime_encrypt_command smime_get_cert_command + \ smime_get_cert_email_command smime_get_signer_cert_command smime_import_cert_command + \ smime_pk7out_command smime_sign_command smime_verify_command smime_verify_opaque_command + \ nextgroup=muttrcVarEqualsSmimeFmt +syntax keyword muttrcVarStr contained skipwhite status_format ts_icon_format ts_status_format nextgroup=muttrcVarEqualsStatusFmt syntax keyword muttrcVarStr contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFmt syntax keyword muttrcVarStr contained skipwhite group_index_format nextgroup=muttrcVarEqualsGrpIdxFmt syntax keyword muttrcVarStr contained skipwhite sidebar_format nextgroup=muttrcVarEqualsSdbFmt syntax keyword muttrcVarStr contained skipwhite - \ assumed_charset attach_charset attach_sep attribution_locale charset - \ config_charset content_type default_hook dsn_notify dsn_return - \ empty_subject escape forward_attribution_intro forward_attribution_trailer - \ forward_format header_cache_pagesize hidden_tags hostname - \ imap_authenticators imap_delim_chars imap_headers imap_login imap_pass - \ imap_user indent_string mailcap_path mark_macro_prefix mh_seq_flagged - \ mh_seq_replied mh_seq_unseen mime_type_query_command newsgroups_charset - \ news_server nm_default_uri nm_exclude_tags nm_query_type - \ nm_query_window_current_search nm_query_window_timebase nm_record_tags - \ nm_unread_tag nntp_authenticators nntp_pass nntp_user pgp_default_key - \ pgp_sign_as pipe_sep pop_authenticators pop_host pop_pass pop_user - \ postpone_encrypt_as post_indent_string preconnect realname send_charset - \ show_multipart_alternative sidebar_delim_chars sidebar_divider_char - \ sidebar_indent_string simple_search smime_default_key smime_encrypt_with - \ smime_sign_as smime_sign_digest_alg smtp_authenticators smtp_pass smtp_url - \ spam_separator ssl_ciphers tunnel - \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr + \ abort_key arrow_string assumed_charset attach_charset attach_sep attribution_locale + \ autocrypt_acct_format charset config_charset content_type crypt_protected_headers_subject + \ default_hook dsn_notify dsn_return empty_subject forward_attribution_intro + \ forward_attribution_trailer greeting header_cache_backend header_cache_compress_method + \ hidden_tags hostname imap_authenticators imap_delim_chars imap_headers imap_login + \ imap_pass imap_user indent_string mailcap_path mark_macro_prefix mh_seq_flagged + \ mh_seq_replied mh_seq_unseen newsgroups_charset news_server nm_default_url nm_exclude_tags + \ nm_flagged_tag nm_query_type nm_query_window_current_search nm_query_window_or_terms + \ nm_query_window_timebase nm_record_tags nm_replied_tag nm_unread_tag nntp_authenticators + \ nntp_pass nntp_user pgp_default_key pgp_sign_as pipe_sep pop_authenticators pop_host + \ pop_pass pop_user postpone_encrypt_as post_indent_string preconnect preferred_languages + \ real_name send_charset show_multipart_alternative sidebar_delim_chars sidebar_divider_char + \ sidebar_indent_string simple_search smime_default_key smime_encrypt_with smime_sign_as + \ smime_sign_digest_alg smtp_authenticators smtp_pass smtp_url smtp_user spam_separator + \ ssl_ciphers + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + " Deprecated strings -syntax keyword muttrcVarDeprecatedStr contained skipwhite - \ forw_format indent_str pgp_self_encrypt_as post_indent_str - \ smime_self_encrypt_as - \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax keyword muttrcVarDeprecatedStr + \ abort_noattach_regexp attach_keyword escape forw_format hdr_format indent_str msg_format + \ nm_default_uri pgp_clearsign_command pgp_getkeys_command pgp_self_encrypt_as + \ post_indent_str print_cmd quote_regexp realname reply_regexp smime_self_encrypt_as + \ spoolfile visual xterm_icon xterm_title -" CHECKED 2018-04-18 +" CHECKED 2022-04-08 " List of DT_ADDRESS -syntax keyword muttrcVarStr contained skipwhite envelope_from_address from nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -" List of DT_HCACHE -syntax keyword muttrcVarStr contained skipwhite header_cache_backend nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -" List of DT_MAGIC -syntax keyword muttrcVarStr contained skipwhite mbox_type nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax keyword muttrcVarStr contained skipwhite envelope_from_address from nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" List of DT_ENUM +syntax keyword muttrcVarStr contained skipwhite mbox_type use_threads nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " List of DT_MBTABLE -syntax keyword muttrcVarStr contained skipwhite flag_chars from_chars status_chars to_chars nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax keyword muttrcVarStr contained skipwhite crypt_chars flag_chars from_chars status_chars to_chars nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -" CHECKED 2018-04-18 -" List of DT_PATH +" CHECKED 2022-04-08 +" List of DT_PATH or DT_MAILBOX +syntax keyword muttrcVarStr contained skipwhite + \ alias_file attach_save_dir autocrypt_dir certificate_file debug_file + \ entropy_file folder header_cache history_file mbox message_cachedir newsrc + \ news_cache_dir postponed record signature smime_ca_location + \ smime_certificates smime_keys spool_file ssl_ca_certificates_file ssl_client_cert + \ tmpdir trash + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" List of DT_COMMAND (excluding pgp_*_command and smime_*_command) syntax keyword muttrcVarStr contained skipwhite - \ alias_file certificate_file debug_file display_filter editor entropy_file - \ folder header_cache history_file inews ispell mbox message_cachedir mixmaster - \ new_mail_command news_cache_dir newsrc pager postponed print_command - \ query_command record sendmail shell signature smime_ca_location - \ smime_certificates smime_keys spoolfile ssl_ca_certificates_file - \ ssl_client_cert tmpdir trash visual - \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr - -" CHECKED 2018-04-18 + \ display_filter editor inews ispell mixmaster new_mail_command pager + \ print_command query_command sendmail shell external_search_command + \ imap_oauth_refresh_command pop_oauth_refresh_command + \ mime_type_query_command smtp_oauth_refresh_command tunnel + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" CHECKED 2022-04-08 " List of DT_REGEX syntax keyword muttrcVarStr contained skipwhite - \ abort_noattach_regex gecos_mask mask pgp_decryption_okay pgp_good_sign - \ quote_regex reply_regex smileys - \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -" List of deprecated DT_PATH -syntax keyword muttrcVarDeprecatedStr contained skipwhite print_cmd nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr -" List of deprecated DT_REGEX -syntax keyword muttrcVarDeprecatedStr contained skipwhite abort_noattach_regexp attach_keyword quote_regexp reply_regexp nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr + \ abort_noattach_regex gecos_mask mask pgp_decryption_okay pgp_good_sign quote_regex + \ reply_regex smileys + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " List of DT_SORT syntax keyword muttrcVarStr contained skipwhite - \ pgp_sort_keys sidebar_sort_method sort sort_alias sort_aux sort_browser - \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr + \ pgp_sort_keys sidebar_sort_method sort sort_alias sort_aux sort_browser + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -" CHECKED 2018-04-18 -" List of commands in Commands in init.h +" CHECKED 2022-04-08 +" List of commands in mutt_commands in mutt_commands.c " Remember to remove hooks, they have already been dealt with -syntax keyword muttrcCommand skipwhite charset-hook nextgroup=muttrcRXString -syntax keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks -syntax keyword muttrcCommand skipwhite spam nextgroup=muttrcSpamPattern -syntax keyword muttrcCommand skipwhite nospam nextgroup=muttrcNoSpamPattern -syntax keyword muttrcCommand skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL -syntax keyword muttrcCommand skipwhite macro nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL syntax keyword muttrcCommand skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL -syntax keyword muttrcCommand skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL -syntax keyword muttrcCommand skipwhite set unset reset toggle nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr,muttrcVarDeprecatedBool,muttrcVarDeprecatedQuad,muttrcVarDeprecatedStr +syntax keyword muttrcCommand skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL syntax keyword muttrcCommand skipwhite exec nextgroup=muttrcFunction +syntax keyword muttrcCommand skipwhite macro nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL +syntax keyword muttrcCommand skipwhite nospam nextgroup=muttrcNoSpamPattern +syntax keyword muttrcCommand skipwhite set unset reset toggle nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcCommand skipwhite spam nextgroup=muttrcSpamPattern +syntax keyword muttrcCommand skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL +syntax keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks syntax keyword muttrcCommand skipwhite - \ alternative_order attachments auto_view finish hdr_order ifdef ifndef - \ ignore lua lua-source mailboxes mailto_allow mime_lookup my_hdr push score - \ setenv sidebar_whitelist source subjectrx subscribe-to tag-formats - \ tag-transforms unalternative_order unattachments unauto_view uncolor - \ unhdr_order unignore unmailboxes unmailto_allow unmime_lookup unmono - \ unmy_hdr unscore unsetenv unsidebar_whitelist unsubjectrx unsubscribe-from - \ unvirtual-mailboxes virtual-mailboxes - -" CHECKED 2018-04-18 -" List of functions in functions.h -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" -syntax match muttrcFunction contained "\" - + \ alternative_order attachments auto_view cd echo finish hdr_order ifdef ifndef ignore lua + \ lua-source mailboxes mailto_allow mime_lookup my_hdr named-mailboxes push score setenv + \ sidebar_whitelist source subjectrx subscribe-to tag-formats tag-transforms + \ unalternative_order unattachments unauto_view unbind uncolor unhdr_order unignore unmacro + \ unmailboxes unmailto_allow unmime_lookup unmono unmy_hdr unscore unsetenv + \ unsidebar_whitelist unsubjectrx unsubscribe-from unvirtual-mailboxes virtual-mailboxes + +function! s:genFunctions(functions) + for f in a:functions + exec 'syntax match muttrcFunction contained "\<' . l:f . '\>"' + endfor +endfunction +" CHECKED 2022-04-08 +" List of functions in functions.c +" Note: 'noop' is included but is elsewhere in the source +call s:genFunctions(['noop', + \ 'accept', 'alias-dialog', 'append', 'attach-file', 'attach-key', 'attach-message', + \ 'attach-news-message', 'autocrypt-acct-menu', 'autocrypt-menu', 'backspace', + \ 'backward-char', 'backward-word', 'bol', 'bottom', 'bottom-page', 'bounce-message', + \ 'break-thread', 'buffy-cycle', 'buffy-list', 'capitalize-word', 'catchup', 'chain-next', + \ 'chain-prev', 'change-dir', 'change-folder', 'change-folder-readonly', 'change-newsgroup', + \ 'change-newsgroup-readonly', 'change-vfolder', 'check-new', 'check-stats', + \ 'check-traditional-pgp', 'clear-flag', 'collapse-all', 'collapse-parts', + \ 'collapse-thread', 'complete', 'complete-query', 'compose-to-sender', 'copy-file', + \ 'copy-message', 'create-account', 'create-alias', 'create-mailbox', 'current-bottom', + \ 'current-middle', 'current-top', 'decode-copy', 'decode-save', 'decrypt-copy', + \ 'decrypt-save', 'delete', 'delete-account', 'delete-char', 'delete-entry', + \ 'delete-mailbox', 'delete-message', 'delete-pattern', 'delete-subthread', 'delete-thread', + \ 'descend-directory', 'detach-file', 'display-address', 'display-filename', + \ 'display-message', 'display-toggle-weed', 'downcase-word', 'edit', 'edit-bcc', 'edit-cc', + \ 'edit-content-id', 'edit-description', 'edit-encoding', 'edit-fcc', 'edit-file', + \ 'edit-followup-to', 'edit-from', 'edit-headers', 'edit-label', 'edit-language', + \ 'edit-message', 'edit-mime', 'edit-newsgroups', 'edit-or-view-raw-message', + \ 'edit-raw-message', 'edit-reply-to', 'edit-subject', 'edit-to', 'edit-type', + \ 'edit-x-comment-to', 'end-cond', 'enter-command', 'enter-mask', 'entire-thread', 'eol', + \ 'error-history', 'exit', 'extract-keys', 'fetch-mail', 'filter-entry', 'first-entry', + \ 'flag-message', 'followup-message', 'forget-passphrase', 'forward-char', + \ 'forward-message', 'forward-to-group', 'forward-word', 'get-attachment', 'get-children', + \ 'get-message', 'get-parent', 'goto-folder', 'goto-parent', 'group-alternatives', + \ 'group-chat-reply', 'group-multilingual', 'group-related', 'group-reply', 'half-down', + \ 'half-up', 'help', 'history-down', 'history-search', 'history-up', 'imap-fetch-mail', + \ 'imap-logout-all', 'insert', 'ispell', 'jump', 'kill-eol', 'kill-eow', 'kill-line', + \ 'kill-word', 'last-entry', 'limit', 'limit-current-thread', 'link-threads', 'list-reply', + \ 'list-subscribe', 'list-unsubscribe', 'mail', 'mail-key', 'mailbox-cycle', 'mailbox-list', + \ 'mark-as-new', 'mark-message', 'middle-page', 'mix', 'modify-labels', + \ 'modify-labels-then-hide', 'modify-tags', 'modify-tags-then-hide', 'move-down', 'move-up', + \ 'new-mime', 'next-entry', 'next-line', 'next-new', 'next-new-then-unread', 'next-page', + \ 'next-subthread', 'next-thread', 'next-undeleted', 'next-unread', 'next-unread-mailbox', + \ 'parent-message', 'pgp-menu', 'pipe-entry', 'pipe-message', 'post-message', + \ 'postpone-message', 'previous-entry', 'previous-line', 'previous-new', + \ 'previous-new-then-unread', 'previous-page', 'previous-subthread', 'previous-thread', + \ 'previous-undeleted', 'previous-unread', 'print-entry', 'print-message', 'purge-message', + \ 'purge-thread', 'quasi-delete', 'query', 'query-append', 'quit', 'quote-char', + \ 'read-subthread', 'read-thread', 'recall-message', 'reconstruct-thread', 'redraw-screen', + \ 'refresh', 'reload-active', 'rename-attachment', 'rename-file', 'rename-mailbox', 'reply', + \ 'resend-message', 'root-message', 'save-entry', 'save-message', 'search', 'search-next', + \ 'search-opposite', 'search-reverse', 'search-toggle', 'select-entry', 'select-new', + \ 'send-message', 'set-flag', 'shell-escape', 'show-limit', 'show-log-messages', + \ 'show-version', 'sidebar-first', 'sidebar-last', 'sidebar-next', 'sidebar-next-new', + \ 'sidebar-open', 'sidebar-page-down', 'sidebar-page-up', 'sidebar-prev', + \ 'sidebar-prev-new', 'sidebar-toggle-virtual', 'sidebar-toggle-visible', 'skip-headers', + \ 'skip-quoted', 'smime-menu', 'sort', 'sort-alias', 'sort-alias-reverse', 'sort-mailbox', + \ 'sort-reverse', 'subscribe', 'subscribe-pattern', 'sync-mailbox', 'tag-entry', + \ 'tag-message', 'tag-pattern', 'tag-prefix', 'tag-prefix-cond', 'tag-subthread', + \ 'tag-thread', 'toggle-active', 'toggle-disposition', 'toggle-mailboxes', 'toggle-new', + \ 'toggle-prefer-encrypt', 'toggle-quoted', 'toggle-read', 'toggle-recode', + \ 'toggle-subscribed', 'toggle-unlink', 'toggle-write', 'top', 'top-page', + \ 'transpose-chars', 'uncatchup', 'undelete-entry', 'undelete-message', 'undelete-pattern', + \ 'undelete-subthread', 'undelete-thread', 'ungroup-attachment', 'unsubscribe', + \ 'unsubscribe-pattern', 'untag-pattern', 'upcase-word', 'update-encoding', 'verify-key', + \ 'vfolder-from-query', 'vfolder-from-query-readonly', 'vfolder-window-backward', + \ 'vfolder-window-forward', 'vfolder-window-reset', 'view-attach', 'view-attachments', + \ 'view-file', 'view-mailcap', 'view-name', 'view-pager', 'view-raw-message', 'view-text', + \ 'what-key', 'write-fcc' + \ ]) " Define the default highlighting. " Only when an item doesn't have highlighting yet -highlight def link muttrcComment Comment -highlight def link muttrcEscape SpecialChar -highlight def link muttrcRXChars SpecialChar -highlight def link muttrcString String -highlight def link muttrcRXString String -highlight def link muttrcRXString2 String -highlight def link muttrcSpecial Special -highlight def link muttrcHooks Type -highlight def link muttrcGroupFlag Type -highlight def link muttrcGroupDef Macro -highlight def link muttrcAddrDef muttrcGroupFlag -highlight def link muttrcRXDef muttrcGroupFlag -highlight def link muttrcRXPat String -highlight def link muttrcAliasGroupName Macro -highlight def link muttrcAliasKey Identifier -highlight def link muttrcUnAliasKey Identifier -highlight def link muttrcAliasEncEmail Identifier -highlight def link muttrcAliasParens Type -highlight def link muttrcSetNumAssignment Number highlight def link muttrcSetBoolAssignment Boolean highlight def link muttrcSetQuadAssignment Boolean -highlight def link muttrcSetStrAssignment String -highlight def link muttrcEmail Special -highlight def link muttrcVariableInner Special -highlight def link muttrcEscapedVariable String -highlight def link muttrcHeader Type -highlight def link muttrcKeySpecial SpecialChar -highlight def link muttrcKey Type -highlight def link muttrcKeyName SpecialChar + +highlight def link muttrcComment Comment + +highlight def link muttrcAlternatesLine Error +highlight def link muttrcBadAction Error +highlight def link muttrcBindFunction Error +highlight def link muttrcBindMenuList Error +highlight def link muttrcColorBG Error +highlight def link muttrcColorBGH Error +highlight def link muttrcColorBGI Error +highlight def link muttrcColorContext Error +highlight def link muttrcColorFG Error +highlight def link muttrcColorFGH Error +highlight def link muttrcColorFGI Error +highlight def link muttrcColorLine Error +highlight def link muttrcFormatErrors Error +highlight def link muttrcGroupLine Error +highlight def link muttrcListsLine Error +highlight def link muttrcPattern Error +highlight def link muttrcSubscribeLine Error +highlight def link muttrcUnColorLine Error +highlight def link muttrcVarDeprecatedBool Error +highlight def link muttrcVarDeprecatedQuad Error +highlight def link muttrcVarDeprecatedStr Error + +highlight def link muttrcAliasEncEmail Identifier +highlight def link muttrcAliasKey Identifier +highlight def link muttrcColorCompose Identifier +highlight def link muttrcColorComposeField Identifier +highlight def link muttrcColorContextH Identifier +highlight def link muttrcColorContextI Identifier +highlight def link muttrcColorField Identifier +highlight def link muttrcMenu Identifier +highlight def link muttrcSimplePat Identifier +highlight def link muttrcUnAliasKey Identifier +highlight def link muttrcUnColorIndex Identifier highlight def link muttrcVarBool Identifier -highlight def link muttrcVarQuad Identifier highlight def link muttrcVarNum Identifier +highlight def link muttrcVarQuad Identifier highlight def link muttrcVarStr Identifier -highlight def link muttrcMenu Identifier + highlight def link muttrcCommand Keyword -highlight def link muttrcMacroDescr String + highlight def link muttrcAction Macro -highlight def link muttrcBadAction Error -highlight def link muttrcBindFunction Error -highlight def link muttrcBindMenuList Error +highlight def link muttrcAliasGroupName Macro highlight def link muttrcFunction Macro -highlight def link muttrcGroupKeyword muttrcCommand -highlight def link muttrcGroupLine Error -highlight def link muttrcSubscribeKeyword muttrcCommand -highlight def link muttrcSubscribeLine Error -highlight def link muttrcListsKeyword muttrcCommand -highlight def link muttrcListsLine Error +highlight def link muttrcGroupDef Macro +highlight def link muttrcSimplePatString Macro + +highlight def link muttrcMonoAttrib muttrcColor + highlight def link muttrcAlternateKeyword muttrcCommand -highlight def link muttrcAlternatesLine Error highlight def link muttrcAttachmentsLine muttrcCommand -highlight def link muttrcAttachmentsFlag Type -highlight def link muttrcAttachmentsMimeType String -highlight def link muttrcColorLine Error -highlight def link muttrcColorContext Error -highlight def link muttrcColorContextI Identifier -highlight def link muttrcColorContextH Identifier highlight def link muttrcColorKeyword muttrcCommand -highlight def link muttrcColorField Identifier -highlight def link muttrcColorCompose Identifier -highlight def link muttrcColorComposeField Identifier -highlight def link muttrcColor Type -highlight def link muttrcColorFG Error -highlight def link muttrcColorFGI Error -highlight def link muttrcColorFGH Error -highlight def link muttrcColorBG Error -highlight def link muttrcColorBGI Error -highlight def link muttrcColorBGH Error -highlight def link muttrcMonoAttrib muttrcColor +highlight def link muttrcGroupKeyword muttrcCommand +highlight def link muttrcListsKeyword muttrcCommand highlight def link muttrcMono muttrcCommand -highlight def link muttrcSimplePat Identifier -highlight def link muttrcSimplePatString Macro -highlight def link muttrcSimplePatMetas Special -highlight def link muttrcPattern Error -highlight def link muttrcUnColorLine Error -highlight def link muttrcUnColorKeyword muttrcCommand -highlight def link muttrcUnColorIndex Identifier -highlight def link muttrcShellString muttrcEscape -highlight def link muttrcRXHooks muttrcCommand -highlight def link muttrcRXHookNot Type highlight def link muttrcPatHooks muttrcCommand -highlight def link muttrcPatHookNot Type -highlight def link muttrcFormatConditionals2 Type -highlight def link muttrcIndexFormatStr muttrcString -highlight def link muttrcIndexFormatEscapes muttrcEscape -highlight def link muttrcIndexFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcAliasFormatStr muttrcString +highlight def link muttrcRXHooks muttrcCommand +highlight def link muttrcSubscribeKeyword muttrcCommand +highlight def link muttrcUnColorKeyword muttrcCommand + highlight def link muttrcAliasFormatEscapes muttrcEscape -highlight def link muttrcAttachFormatStr muttrcString highlight def link muttrcAttachFormatEscapes muttrcEscape -highlight def link muttrcAttachFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcComposeFormatStr muttrcString highlight def link muttrcComposeFormatEscapes muttrcEscape -highlight def link muttrcFolderFormatStr muttrcString highlight def link muttrcFolderFormatEscapes muttrcEscape -highlight def link muttrcFolderFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcMixFormatStr muttrcString +highlight def link muttrcGroupIndexFormatEscapes muttrcEscape +highlight def link muttrcIndexFormatEscapes muttrcEscape highlight def link muttrcMixFormatEscapes muttrcEscape -highlight def link muttrcMixFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcPGPFormatStr muttrcString -highlight def link muttrcPGPFormatEscapes muttrcEscape -highlight def link muttrcPGPFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcPGPCmdFormatStr muttrcString +highlight def link muttrcPatternFormatEscapes muttrcEscape highlight def link muttrcPGPCmdFormatEscapes muttrcEscape -highlight def link muttrcPGPCmdFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcStatusFormatStr muttrcString +highlight def link muttrcPGPFormatEscapes muttrcEscape +highlight def link muttrcPGPTimeEscapes muttrcEscape +highlight def link muttrcQueryFormatEscapes muttrcEscape +highlight def link muttrcShellString muttrcEscape +highlight def link muttrcSidebarFormatEscapes muttrcEscape +highlight def link muttrcSmimeFormatEscapes muttrcEscape highlight def link muttrcStatusFormatEscapes muttrcEscape +highlight def link muttrcTimeEscapes muttrcEscape + +highlight def link muttrcAliasFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcAttachFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcComposeFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcFolderFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcIndexFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcMixFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcPatternFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcPGPCmdFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcPGPFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcSmimeFormatConditionals muttrcFormatConditionals2 highlight def link muttrcStatusFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcPGPGetKeysFormatStr muttrcString -highlight def link muttrcPGPGetKeysFormatEscapes muttrcEscape + +highlight def link muttrcAddrDef muttrcGroupFlag +highlight def link muttrcRXDef muttrcGroupFlag + +highlight def link muttrcAliasFormatStr muttrcString +highlight def link muttrcAttachFormatStr muttrcString +highlight def link muttrcComposeFormatStr muttrcString +highlight def link muttrcFolderFormatStr muttrcString +highlight def link muttrcGroupIndexFormatStr muttrcString +highlight def link muttrcIndexFormatStr muttrcString +highlight def link muttrcMixFormatStr muttrcString +highlight def link muttrcPatternFormatStr muttrcString +highlight def link muttrcPGPCmdFormatStr muttrcString +highlight def link muttrcPGPFormatStr muttrcString +highlight def link muttrcQueryFormatStr muttrcString +highlight def link muttrcSidebarFormatStr muttrcString highlight def link muttrcSmimeFormatStr muttrcString -highlight def link muttrcSmimeFormatEscapes muttrcEscape -highlight def link muttrcSmimeFormatConditionals muttrcFormatConditionals2 -highlight def link muttrcTimeEscapes muttrcEscape -highlight def link muttrcPGPTimeEscapes muttrcEscape -highlight def link muttrcStrftimeEscapes Type +highlight def link muttrcStatusFormatStr muttrcString highlight def link muttrcStrftimeFormatStr muttrcString -highlight def link muttrcFormatErrors Error +highlight def link muttrcSetNumAssignment Number + +highlight def link muttrcEmail Special +highlight def link muttrcSimplePatMetas Special +highlight def link muttrcSpecial Special +highlight def link muttrcVariableInner Special + +highlight def link muttrcAliasEncEmailNL SpecialChar +highlight def link muttrcAliasENNL SpecialChar +highlight def link muttrcAliasGroupDefNL SpecialChar +highlight def link muttrcAliasNameNL SpecialChar +highlight def link muttrcAliasNL SpecialChar highlight def link muttrcBindFunctionNL SpecialChar highlight def link muttrcBindKeyNL SpecialChar highlight def link muttrcBindMenuListNL SpecialChar -highlight def link muttrcMacroDescrNL SpecialChar -highlight def link muttrcMacroBodyNL SpecialChar -highlight def link muttrcMacroKeyNL SpecialChar -highlight def link muttrcMacroMenuListNL SpecialChar +highlight def link muttrcColorBGNL SpecialChar +highlight def link muttrcColorFGNL SpecialChar highlight def link muttrcColorMatchCountNL SpecialChar highlight def link muttrcColorNL SpecialChar highlight def link muttrcColorRXNL SpecialChar -highlight def link muttrcColorBGNL SpecialChar -highlight def link muttrcColorFGNL SpecialChar -highlight def link muttrcAliasNameNL SpecialChar -highlight def link muttrcAliasENNL SpecialChar -highlight def link muttrcAliasNL SpecialChar -highlight def link muttrcUnAliasNL SpecialChar -highlight def link muttrcAliasGroupDefNL SpecialChar -highlight def link muttrcAliasEncEmailNL SpecialChar +highlight def link muttrcEscape SpecialChar +highlight def link muttrcKeyName SpecialChar +highlight def link muttrcKeySpecial SpecialChar +highlight def link muttrcMacroBodyNL SpecialChar +highlight def link muttrcMacroDescrNL SpecialChar +highlight def link muttrcMacroKeyNL SpecialChar +highlight def link muttrcMacroMenuListNL SpecialChar highlight def link muttrcPatternNL SpecialChar -highlight def link muttrcUnColorPatNL SpecialChar +highlight def link muttrcRXChars SpecialChar +highlight def link muttrcStringNL SpecialChar +highlight def link muttrcUnAliasNL SpecialChar highlight def link muttrcUnColorAPNL SpecialChar highlight def link muttrcUnColorIndexNL SpecialChar -highlight def link muttrcStringNL SpecialChar +highlight def link muttrcUnColorPatNL SpecialChar -highlight def link muttrcVarDeprecatedBool Error -highlight def link muttrcVarDeprecatedQuad Error -highlight def link muttrcVarDeprecatedStr Error +highlight def link muttrcAttachmentsMimeType String +highlight def link muttrcEscapedVariable String +highlight def link muttrcMacroDescr String +highlight def link muttrcRXPat String +highlight def link muttrcRXString String +highlight def link muttrcRXString2 String +highlight def link muttrcSetStrAssignment String +highlight def link muttrcString String +highlight def link muttrcAliasParens Type +highlight def link muttrcAttachmentsFlag Type +highlight def link muttrcColor Type +highlight def link muttrcFormatConditionals2 Type +highlight def link muttrcGroupFlag Type +highlight def link muttrcHeader Type +highlight def link muttrcHooks Type +highlight def link muttrcKey Type +highlight def link muttrcPatHookNot Type +highlight def link muttrcRXHookNot Type +highlight def link muttrcStrftimeEscapes Type let b:current_syntax = "neomuttrc" diff --git a/runtime/syntax/netrw.vim b/runtime/syntax/netrw.vim index c4d3cf5fdab89..1f02bbef78095 100644 --- a/runtime/syntax/netrw.vim +++ b/runtime/syntax/netrw.vim @@ -1,7 +1,7 @@ " Language : Netrw Listing Syntax " Maintainer : Charles E. Campbell -" Last change: Oct 31, 2016 -" Version : 20 NOT RELEASED +" Last change: Nov 07, 2019 +" Version : 20 " --------------------------------------------------------------------- if exists("b:current_syntax") finish @@ -105,7 +105,7 @@ if !exists("did_drchip_netrwlist_syntax") " special syntax highlighting (see :he g:netrw_special_syntax) hi default link netrwCoreDump WarningMsg - hi default link netrwData DiffChange + hi default link netrwData Folded hi default link netrwHdr netrwPlain hi default link netrwLex netrwPlain hi default link netrwLib DiffChange diff --git a/runtime/syntax/nginx.vim b/runtime/syntax/nginx.vim new file mode 100644 index 0000000000000..18dd50cbb27d7 --- /dev/null +++ b/runtime/syntax/nginx.vim @@ -0,0 +1,2307 @@ +" Vim syntax file +" Language: nginx.conf +" Maintainer: Chris Aumann +" Last Change: Apr 15, 2017 + +if exists("b:current_syntax") + finish +end + +let b:current_syntax = "nginx" + +syn match ngxVariable '\$\(\w\+\|{\w\+}\)' +syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained +syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained +syn region ngxBlock start=+^+ end=+{+ skip=+\${\|{{\|{%+ contains=ngxComment,ngxInteger,ngxIPaddr,ngxDirectiveBlock,ngxVariableBlock,ngxString,ngxThirdPartyLuaBlock oneline +syn region ngxString start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString,ngxSSLCipherInsecure +syn match ngxComment ' *#.*$' + +" These regular expressions where taken (and adapted) from +" http://vim.1045645.n5.nabble.com/IPv6-support-for-quot-dns-quot-zonefile-syntax-highlighting-td1197292.html +syn match ngxInteger '\W\zs\(\d[0-9.]*\|[0-9.]*\d\)\w\?\ze\W' +syn match ngxIPaddr '\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{6}\(\x\{1,4}:\x\{1,4}\|\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[::\(\(\x\{1,4}:\)\{,6}\x\{1,4}\|\(\x\{1,4}:\)\{,5}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{1}:\(\(\x\{1,4}:\)\{,5}\x\{1,4}\|\(\x\{1,4}:\)\{,4}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{2}:\(\(\x\{1,4}:\)\{,4}\x\{1,4}\|\(\x\{1,4}:\)\{,3}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{3}:\(\(\x\{1,4}:\)\{,3}\x\{1,4}\|\(\x\{1,4}:\)\{,2}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{4}:\(\(\x\{1,4}:\)\{,2}\x\{1,4}\|\(\x\{1,4}:\)\{,1}\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{5}:\(\(\x\{1,4}:\)\{,1}\x\{1,4}\|\([0-2]\?\d\{1,2}\.\)\{3}[0-2]\?\d\{1,2}\)\]' +syn match ngxIPaddr '\[\(\x\{1,4}:\)\{6}:\x\{1,4}\]' + +" Highlight wildcard listening signs also as IPaddr +syn match ngxIPaddr '\s\zs\[::]' +syn match ngxIPaddr '\s\zs\*' + +syn keyword ngxBoolean on +syn keyword ngxBoolean off + +syn keyword ngxDirectiveBlock http contained +syn keyword ngxDirectiveBlock mail contained +syn keyword ngxDirectiveBlock events contained +syn keyword ngxDirectiveBlock server contained +syn keyword ngxDirectiveBlock match contained +syn keyword ngxDirectiveBlock types contained +syn keyword ngxDirectiveBlock location contained +syn keyword ngxDirectiveBlock upstream contained +syn keyword ngxDirectiveBlock charset_map contained +syn keyword ngxDirectiveBlock limit_except contained +syn keyword ngxDirectiveBlock if contained +syn keyword ngxDirectiveBlock geo contained +syn keyword ngxDirectiveBlock map contained +syn keyword ngxDirectiveBlock split_clients contained + +syn keyword ngxDirectiveImportant include +syn keyword ngxDirectiveImportant root +syn keyword ngxDirectiveImportant server contained +syn region ngxDirectiveImportantServer matchgroup=ngxDirectiveImportant start=+^\s*\zsserver\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxUpstreamServerOptions,ngxString,ngxIPaddr,ngxBoolean,ngxInteger,ngxTemplateVar +syn keyword ngxDirectiveImportant server_name +syn keyword ngxDirectiveImportant listen contained +syn region ngxDirectiveImportantListen matchgroup=ngxDirectiveImportant start=+listen+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxListenOptions,ngxString,ngxIPaddr,ngxBoolean,ngxInteger,ngxTemplateVar +syn keyword ngxDirectiveImportant internal +syn keyword ngxDirectiveImportant proxy_pass +syn keyword ngxDirectiveImportant memcached_pass +syn keyword ngxDirectiveImportant fastcgi_pass +syn keyword ngxDirectiveImportant scgi_pass +syn keyword ngxDirectiveImportant uwsgi_pass +syn keyword ngxDirectiveImportant try_files +syn keyword ngxDirectiveImportant error_page +syn keyword ngxDirectiveImportant post_action + +syn keyword ngxUpstreamServerOptions weight contained +syn keyword ngxUpstreamServerOptions max_conns contained +syn keyword ngxUpstreamServerOptions max_fails contained +syn keyword ngxUpstreamServerOptions fail_timeout contained +syn keyword ngxUpstreamServerOptions backup contained +syn keyword ngxUpstreamServerOptions down contained +syn keyword ngxUpstreamServerOptions resolve contained +syn keyword ngxUpstreamServerOptions route contained +syn keyword ngxUpstreamServerOptions service contained +syn keyword ngxUpstreamServerOptions default_server contained +syn keyword ngxUpstreamServerOptions slow_start contained + +syn keyword ngxListenOptions default_server contained +syn keyword ngxListenOptions ssl contained +syn keyword ngxListenOptions http2 contained +syn keyword ngxListenOptions spdy contained +syn keyword ngxListenOptions proxy_protocol contained +syn keyword ngxListenOptions setfib contained +syn keyword ngxListenOptions fastopen contained +syn keyword ngxListenOptions backlog contained +syn keyword ngxListenOptions rcvbuf contained +syn keyword ngxListenOptions sndbuf contained +syn keyword ngxListenOptions accept_filter contained +syn keyword ngxListenOptions deferred contained +syn keyword ngxListenOptions bind contained +syn keyword ngxListenOptions ipv6only contained +syn keyword ngxListenOptions reuseport contained +syn keyword ngxListenOptions so_keepalive contained +syn keyword ngxListenOptions keepidle contained + +syn keyword ngxDirectiveControl break +syn keyword ngxDirectiveControl return +syn keyword ngxDirectiveControl rewrite +syn keyword ngxDirectiveControl set + +syn keyword ngxDirectiveDeprecated connections +syn keyword ngxDirectiveDeprecated imap +syn keyword ngxDirectiveDeprecated limit_zone +syn keyword ngxDirectiveDeprecated mysql_test +syn keyword ngxDirectiveDeprecated open_file_cache_retest +syn keyword ngxDirectiveDeprecated optimize_server_names +syn keyword ngxDirectiveDeprecated satisfy_any +syn keyword ngxDirectiveDeprecated so_keepalive + +syn keyword ngxDirective absolute_redirect +syn keyword ngxDirective accept_mutex +syn keyword ngxDirective accept_mutex_delay +syn keyword ngxDirective acceptex_read +syn keyword ngxDirective access_log +syn keyword ngxDirective add_after_body +syn keyword ngxDirective add_before_body +syn keyword ngxDirective add_header +syn keyword ngxDirective addition_types +syn keyword ngxDirective aio +syn keyword ngxDirective aio_write +syn keyword ngxDirective alias +syn keyword ngxDirective allow +syn keyword ngxDirective ancient_browser +syn keyword ngxDirective ancient_browser_value +syn keyword ngxDirective auth_basic +syn keyword ngxDirective auth_basic_user_file +syn keyword ngxDirective auth_http +syn keyword ngxDirective auth_http_header +syn keyword ngxDirective auth_http_pass_client_cert +syn keyword ngxDirective auth_http_timeout +syn keyword ngxDirective auth_jwt +syn keyword ngxDirective auth_jwt_key_file +syn keyword ngxDirective auth_request +syn keyword ngxDirective auth_request_set +syn keyword ngxDirective autoindex +syn keyword ngxDirective autoindex_exact_size +syn keyword ngxDirective autoindex_format +syn keyword ngxDirective autoindex_localtime +syn keyword ngxDirective charset +syn keyword ngxDirective charset_map +syn keyword ngxDirective charset_types +syn keyword ngxDirective chunked_transfer_encoding +syn keyword ngxDirective client_body_buffer_size +syn keyword ngxDirective client_body_in_file_only +syn keyword ngxDirective client_body_in_single_buffer +syn keyword ngxDirective client_body_temp_path +syn keyword ngxDirective client_body_timeout +syn keyword ngxDirective client_header_buffer_size +syn keyword ngxDirective client_header_timeout +syn keyword ngxDirective client_max_body_size +syn keyword ngxDirective connection_pool_size +syn keyword ngxDirective create_full_put_path +syn keyword ngxDirective daemon +syn keyword ngxDirective dav_access +syn keyword ngxDirective dav_methods +syn keyword ngxDirective debug_connection +syn keyword ngxDirective debug_points +syn keyword ngxDirective default_type +syn keyword ngxDirective degradation +syn keyword ngxDirective degrade +syn keyword ngxDirective deny +syn keyword ngxDirective devpoll_changes +syn keyword ngxDirective devpoll_events +syn keyword ngxDirective directio +syn keyword ngxDirective directio_alignment +syn keyword ngxDirective disable_symlinks +syn keyword ngxDirective empty_gif +syn keyword ngxDirective env +syn keyword ngxDirective epoll_events +syn keyword ngxDirective error_log +syn keyword ngxDirective etag +syn keyword ngxDirective eventport_events +syn keyword ngxDirective expires +syn keyword ngxDirective f4f +syn keyword ngxDirective f4f_buffer_size +syn keyword ngxDirective fastcgi_bind +syn keyword ngxDirective fastcgi_buffer_size +syn keyword ngxDirective fastcgi_buffering +syn keyword ngxDirective fastcgi_buffers +syn keyword ngxDirective fastcgi_busy_buffers_size +syn keyword ngxDirective fastcgi_cache +syn keyword ngxDirective fastcgi_cache_bypass +syn keyword ngxDirective fastcgi_cache_key +syn keyword ngxDirective fastcgi_cache_lock +syn keyword ngxDirective fastcgi_cache_lock_age +syn keyword ngxDirective fastcgi_cache_lock_timeout +syn keyword ngxDirective fastcgi_cache_max_range_offset +syn keyword ngxDirective fastcgi_cache_methods +syn keyword ngxDirective fastcgi_cache_min_uses +syn keyword ngxDirective fastcgi_cache_path +syn keyword ngxDirective fastcgi_cache_purge +syn keyword ngxDirective fastcgi_cache_revalidate +syn keyword ngxDirective fastcgi_cache_use_stale +syn keyword ngxDirective fastcgi_cache_valid +syn keyword ngxDirective fastcgi_catch_stderr +syn keyword ngxDirective fastcgi_connect_timeout +syn keyword ngxDirective fastcgi_force_ranges +syn keyword ngxDirective fastcgi_hide_header +syn keyword ngxDirective fastcgi_ignore_client_abort +syn keyword ngxDirective fastcgi_ignore_headers +syn keyword ngxDirective fastcgi_index +syn keyword ngxDirective fastcgi_intercept_errors +syn keyword ngxDirective fastcgi_keep_conn +syn keyword ngxDirective fastcgi_limit_rate +syn keyword ngxDirective fastcgi_max_temp_file_size +syn keyword ngxDirective fastcgi_next_upstream +syn keyword ngxDirective fastcgi_next_upstream_timeout +syn keyword ngxDirective fastcgi_next_upstream_tries +syn keyword ngxDirective fastcgi_no_cache +syn keyword ngxDirective fastcgi_param +syn keyword ngxDirective fastcgi_pass_header +syn keyword ngxDirective fastcgi_pass_request_body +syn keyword ngxDirective fastcgi_pass_request_headers +syn keyword ngxDirective fastcgi_read_timeout +syn keyword ngxDirective fastcgi_request_buffering +syn keyword ngxDirective fastcgi_send_lowat +syn keyword ngxDirective fastcgi_send_timeout +syn keyword ngxDirective fastcgi_split_path_info +syn keyword ngxDirective fastcgi_store +syn keyword ngxDirective fastcgi_store_access +syn keyword ngxDirective fastcgi_temp_file_write_size +syn keyword ngxDirective fastcgi_temp_path +syn keyword ngxDirective flv +syn keyword ngxDirective geoip_city +syn keyword ngxDirective geoip_country +syn keyword ngxDirective geoip_org +syn keyword ngxDirective geoip_proxy +syn keyword ngxDirective geoip_proxy_recursive +syn keyword ngxDirective google_perftools_profiles +syn keyword ngxDirective gunzip +syn keyword ngxDirective gunzip_buffers +syn keyword ngxDirective gzip nextgroup=ngxGzipOn,ngxGzipOff skipwhite +syn keyword ngxGzipOn on contained +syn keyword ngxGzipOff off contained +syn keyword ngxDirective gzip_buffers +syn keyword ngxDirective gzip_comp_level +syn keyword ngxDirective gzip_disable +syn keyword ngxDirective gzip_hash +syn keyword ngxDirective gzip_http_version +syn keyword ngxDirective gzip_min_length +syn keyword ngxDirective gzip_no_buffer +syn keyword ngxDirective gzip_proxied +syn keyword ngxDirective gzip_static +syn keyword ngxDirective gzip_types +syn keyword ngxDirective gzip_vary +syn keyword ngxDirective gzip_window +syn keyword ngxDirective hash +syn keyword ngxDirective health_check +syn keyword ngxDirective health_check_timeout +syn keyword ngxDirective hls +syn keyword ngxDirective hls_buffers +syn keyword ngxDirective hls_forward_args +syn keyword ngxDirective hls_fragment +syn keyword ngxDirective hls_mp4_buffer_size +syn keyword ngxDirective hls_mp4_max_buffer_size +syn keyword ngxDirective http2_chunk_size +syn keyword ngxDirective http2_body_preread_size +syn keyword ngxDirective http2_idle_timeout +syn keyword ngxDirective http2_max_concurrent_streams +syn keyword ngxDirective http2_max_field_size +syn keyword ngxDirective http2_max_header_size +syn keyword ngxDirective http2_max_requests +syn keyword ngxDirective http2_recv_buffer_size +syn keyword ngxDirective http2_recv_timeout +syn keyword ngxDirective if_modified_since +syn keyword ngxDirective ignore_invalid_headers +syn keyword ngxDirective image_filter +syn keyword ngxDirective image_filter_buffer +syn keyword ngxDirective image_filter_interlace +syn keyword ngxDirective image_filter_jpeg_quality +syn keyword ngxDirective image_filter_sharpen +syn keyword ngxDirective image_filter_transparency +syn keyword ngxDirective image_filter_webp_quality +syn keyword ngxDirective imap_auth +syn keyword ngxDirective imap_capabilities +syn keyword ngxDirective imap_client_buffer +syn keyword ngxDirective index +syn keyword ngxDirective iocp_threads +syn keyword ngxDirective ip_hash +syn keyword ngxDirective js_access +syn keyword ngxDirective js_content +syn keyword ngxDirective js_filter +syn keyword ngxDirective js_include +syn keyword ngxDirective js_preread +syn keyword ngxDirective js_set +syn keyword ngxDirective keepalive +syn keyword ngxDirective keepalive_disable +syn keyword ngxDirective keepalive_requests +syn keyword ngxDirective keepalive_timeout +syn keyword ngxDirective kqueue_changes +syn keyword ngxDirective kqueue_events +syn keyword ngxDirective large_client_header_buffers +syn keyword ngxDirective least_conn +syn keyword ngxDirective least_time +syn keyword ngxDirective limit_conn +syn keyword ngxDirective limit_conn_dry_run +syn keyword ngxDirective limit_conn_log_level +syn keyword ngxDirective limit_conn_status +syn keyword ngxDirective limit_conn_zone +syn keyword ngxDirective limit_except +syn keyword ngxDirective limit_rate +syn keyword ngxDirective limit_rate_after +syn keyword ngxDirective limit_req +syn keyword ngxDirective limit_req_dry_run +syn keyword ngxDirective limit_req_log_level +syn keyword ngxDirective limit_req_status +syn keyword ngxDirective limit_req_zone +syn keyword ngxDirective lingering_close +syn keyword ngxDirective lingering_time +syn keyword ngxDirective lingering_timeout +syn keyword ngxDirective load_module +syn keyword ngxDirective lock_file +syn keyword ngxDirective log_format +syn keyword ngxDirective log_not_found +syn keyword ngxDirective log_subrequest +syn keyword ngxDirective map_hash_bucket_size +syn keyword ngxDirective map_hash_max_size +syn keyword ngxDirective master_process +syn keyword ngxDirective max_ranges +syn keyword ngxDirective memcached_bind +syn keyword ngxDirective memcached_buffer_size +syn keyword ngxDirective memcached_connect_timeout +syn keyword ngxDirective memcached_force_ranges +syn keyword ngxDirective memcached_gzip_flag +syn keyword ngxDirective memcached_next_upstream +syn keyword ngxDirective memcached_next_upstream_timeout +syn keyword ngxDirective memcached_next_upstream_tries +syn keyword ngxDirective memcached_read_timeout +syn keyword ngxDirective memcached_send_timeout +syn keyword ngxDirective merge_slashes +syn keyword ngxDirective min_delete_depth +syn keyword ngxDirective modern_browser +syn keyword ngxDirective modern_browser_value +syn keyword ngxDirective mp4 +syn keyword ngxDirective mp4_buffer_size +syn keyword ngxDirective mp4_max_buffer_size +syn keyword ngxDirective mp4_limit_rate +syn keyword ngxDirective mp4_limit_rate_after +syn keyword ngxDirective msie_padding +syn keyword ngxDirective msie_refresh +syn keyword ngxDirective multi_accept +syn keyword ngxDirective ntlm +syn keyword ngxDirective open_file_cache +syn keyword ngxDirective open_file_cache_errors +syn keyword ngxDirective open_file_cache_events +syn keyword ngxDirective open_file_cache_min_uses +syn keyword ngxDirective open_file_cache_valid +syn keyword ngxDirective open_log_file_cache +syn keyword ngxDirective output_buffers +syn keyword ngxDirective override_charset +syn keyword ngxDirective pcre_jit +syn keyword ngxDirective perl +syn keyword ngxDirective perl_modules +syn keyword ngxDirective perl_require +syn keyword ngxDirective perl_set +syn keyword ngxDirective pid +syn keyword ngxDirective pop3_auth +syn keyword ngxDirective pop3_capabilities +syn keyword ngxDirective port_in_redirect +syn keyword ngxDirective post_acceptex +syn keyword ngxDirective postpone_gzipping +syn keyword ngxDirective postpone_output +syn keyword ngxDirective preread_buffer_size +syn keyword ngxDirective preread_timeout +syn keyword ngxDirective protocol nextgroup=ngxMailProtocol skipwhite +syn keyword ngxMailProtocol imap pop3 smtp contained +syn keyword ngxDirective proxy +syn keyword ngxDirective proxy_bind +syn keyword ngxDirective proxy_buffer +syn keyword ngxDirective proxy_buffer_size +syn keyword ngxDirective proxy_buffering +syn keyword ngxDirective proxy_buffers +syn keyword ngxDirective proxy_busy_buffers_size +syn keyword ngxDirective proxy_cache +syn keyword ngxDirective proxy_cache_bypass +syn keyword ngxDirective proxy_cache_convert_head +syn keyword ngxDirective proxy_cache_key +syn keyword ngxDirective proxy_cache_lock +syn keyword ngxDirective proxy_cache_lock_age +syn keyword ngxDirective proxy_cache_lock_timeout +syn keyword ngxDirective proxy_cache_max_range_offset +syn keyword ngxDirective proxy_cache_methods +syn keyword ngxDirective proxy_cache_min_uses +syn keyword ngxDirective proxy_cache_path +syn keyword ngxDirective proxy_cache_purge +syn keyword ngxDirective proxy_cache_revalidate +syn keyword ngxDirective proxy_cache_use_stale +syn keyword ngxDirective proxy_cache_valid +syn keyword ngxDirective proxy_connect_timeout +syn keyword ngxDirective proxy_cookie_domain +syn keyword ngxDirective proxy_cookie_path +syn keyword ngxDirective proxy_download_rate +syn keyword ngxDirective proxy_force_ranges +syn keyword ngxDirective proxy_headers_hash_bucket_size +syn keyword ngxDirective proxy_headers_hash_max_size +syn keyword ngxDirective proxy_hide_header +syn keyword ngxDirective proxy_http_version +syn keyword ngxDirective proxy_ignore_client_abort +syn keyword ngxDirective proxy_ignore_headers +syn keyword ngxDirective proxy_intercept_errors +syn keyword ngxDirective proxy_limit_rate +syn keyword ngxDirective proxy_max_temp_file_size +syn keyword ngxDirective proxy_method +syn keyword ngxDirective proxy_next_upstream contained +syn region ngxDirectiveProxyNextUpstream matchgroup=ngxDirective start=+^\s*\zsproxy_next_upstream\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxProxyNextUpstreamOptions,ngxString,ngxTemplateVar +syn keyword ngxDirective proxy_next_upstream_timeout +syn keyword ngxDirective proxy_next_upstream_tries +syn keyword ngxDirective proxy_no_cache +syn keyword ngxDirective proxy_pass_error_message +syn keyword ngxDirective proxy_pass_header +syn keyword ngxDirective proxy_pass_request_body +syn keyword ngxDirective proxy_pass_request_headers +syn keyword ngxDirective proxy_protocol +syn keyword ngxDirective proxy_protocol_timeout +syn keyword ngxDirective proxy_read_timeout +syn keyword ngxDirective proxy_redirect +syn keyword ngxDirective proxy_request_buffering +syn keyword ngxDirective proxy_responses +syn keyword ngxDirective proxy_send_lowat +syn keyword ngxDirective proxy_send_timeout +syn keyword ngxDirective proxy_set_body +syn keyword ngxDirective proxy_set_header +syn keyword ngxDirective proxy_ssl_certificate +syn keyword ngxDirective proxy_ssl_certificate_key +syn keyword ngxDirective proxy_ssl_ciphers +syn keyword ngxDirective proxy_ssl_crl +syn keyword ngxDirective proxy_ssl_name +syn keyword ngxDirective proxy_ssl_password_file +syn keyword ngxDirective proxy_ssl_protocols nextgroup=ngxSSLProtocol skipwhite +syn keyword ngxDirective proxy_ssl_server_name +syn keyword ngxDirective proxy_ssl_session_reuse +syn keyword ngxDirective proxy_ssl_trusted_certificate +syn keyword ngxDirective proxy_ssl_verify +syn keyword ngxDirective proxy_ssl_verify_depth +syn keyword ngxDirective proxy_store +syn keyword ngxDirective proxy_store_access +syn keyword ngxDirective proxy_temp_file_write_size +syn keyword ngxDirective proxy_temp_path +syn keyword ngxDirective proxy_timeout +syn keyword ngxDirective proxy_upload_rate +syn keyword ngxDirective queue +syn keyword ngxDirective random_index +syn keyword ngxDirective read_ahead +syn keyword ngxDirective real_ip_header +syn keyword ngxDirective real_ip_recursive +syn keyword ngxDirective recursive_error_pages +syn keyword ngxDirective referer_hash_bucket_size +syn keyword ngxDirective referer_hash_max_size +syn keyword ngxDirective request_pool_size +syn keyword ngxDirective reset_timedout_connection +syn keyword ngxDirective resolver +syn keyword ngxDirective resolver_timeout +syn keyword ngxDirective rewrite_log +syn keyword ngxDirective rtsig_overflow_events +syn keyword ngxDirective rtsig_overflow_test +syn keyword ngxDirective rtsig_overflow_threshold +syn keyword ngxDirective rtsig_signo +syn keyword ngxDirective satisfy +syn keyword ngxDirective scgi_bind +syn keyword ngxDirective scgi_buffer_size +syn keyword ngxDirective scgi_buffering +syn keyword ngxDirective scgi_buffers +syn keyword ngxDirective scgi_busy_buffers_size +syn keyword ngxDirective scgi_cache +syn keyword ngxDirective scgi_cache_bypass +syn keyword ngxDirective scgi_cache_key +syn keyword ngxDirective scgi_cache_lock +syn keyword ngxDirective scgi_cache_lock_age +syn keyword ngxDirective scgi_cache_lock_timeout +syn keyword ngxDirective scgi_cache_max_range_offset +syn keyword ngxDirective scgi_cache_methods +syn keyword ngxDirective scgi_cache_min_uses +syn keyword ngxDirective scgi_cache_path +syn keyword ngxDirective scgi_cache_purge +syn keyword ngxDirective scgi_cache_revalidate +syn keyword ngxDirective scgi_cache_use_stale +syn keyword ngxDirective scgi_cache_valid +syn keyword ngxDirective scgi_connect_timeout +syn keyword ngxDirective scgi_force_ranges +syn keyword ngxDirective scgi_hide_header +syn keyword ngxDirective scgi_ignore_client_abort +syn keyword ngxDirective scgi_ignore_headers +syn keyword ngxDirective scgi_intercept_errors +syn keyword ngxDirective scgi_limit_rate +syn keyword ngxDirective scgi_max_temp_file_size +syn keyword ngxDirective scgi_next_upstream +syn keyword ngxDirective scgi_next_upstream_timeout +syn keyword ngxDirective scgi_next_upstream_tries +syn keyword ngxDirective scgi_no_cache +syn keyword ngxDirective scgi_param +syn keyword ngxDirective scgi_pass_header +syn keyword ngxDirective scgi_pass_request_body +syn keyword ngxDirective scgi_pass_request_headers +syn keyword ngxDirective scgi_read_timeout +syn keyword ngxDirective scgi_request_buffering +syn keyword ngxDirective scgi_send_timeout +syn keyword ngxDirective scgi_store +syn keyword ngxDirective scgi_store_access +syn keyword ngxDirective scgi_temp_file_write_size +syn keyword ngxDirective scgi_temp_path +syn keyword ngxDirective secure_link +syn keyword ngxDirective secure_link_md5 +syn keyword ngxDirective secure_link_secret +syn keyword ngxDirective send_lowat +syn keyword ngxDirective send_timeout +syn keyword ngxDirective sendfile +syn keyword ngxDirective sendfile_max_chunk +syn keyword ngxDirective server_name_in_redirect +syn keyword ngxDirective server_names_hash_bucket_size +syn keyword ngxDirective server_names_hash_max_size +syn keyword ngxDirective server_tokens +syn keyword ngxDirective session_log +syn keyword ngxDirective session_log_format +syn keyword ngxDirective session_log_zone +syn keyword ngxDirective set_real_ip_from +syn keyword ngxDirective slice +syn keyword ngxDirective smtp_auth +syn keyword ngxDirective smtp_capabilities +syn keyword ngxDirective smtp_client_buffer +syn keyword ngxDirective smtp_greeting_delay +syn keyword ngxDirective source_charset +syn keyword ngxDirective spdy_chunk_size +syn keyword ngxDirective spdy_headers_comp +syn keyword ngxDirective spdy_keepalive_timeout +syn keyword ngxDirective spdy_max_concurrent_streams +syn keyword ngxDirective spdy_pool_size +syn keyword ngxDirective spdy_recv_buffer_size +syn keyword ngxDirective spdy_recv_timeout +syn keyword ngxDirective spdy_streams_index_size +syn keyword ngxDirective ssi +syn keyword ngxDirective ssi_ignore_recycled_buffers +syn keyword ngxDirective ssi_last_modified +syn keyword ngxDirective ssi_min_file_chunk +syn keyword ngxDirective ssi_silent_errors +syn keyword ngxDirective ssi_types +syn keyword ngxDirective ssi_value_length +syn keyword ngxDirective ssl +syn keyword ngxDirective ssl_buffer_size +syn keyword ngxDirective ssl_certificate +syn keyword ngxDirective ssl_certificate_key +syn keyword ngxDirective ssl_ciphers +syn keyword ngxDirective ssl_client_certificate +syn keyword ngxDirective ssl_crl +syn keyword ngxDirective ssl_dhparam +syn keyword ngxDirective ssl_ecdh_curve +syn keyword ngxDirective ssl_engine +syn keyword ngxDirective ssl_handshake_timeout +syn keyword ngxDirective ssl_password_file +syn keyword ngxDirective ssl_prefer_server_ciphers nextgroup=ngxSSLPreferServerCiphersOff,ngxSSLPreferServerCiphersOn skipwhite +syn keyword ngxSSLPreferServerCiphersOn on contained +syn keyword ngxSSLPreferServerCiphersOff off contained +syn keyword ngxDirective ssl_preread +syn keyword ngxDirective ssl_protocols nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite +syn match ngxSSLProtocol 'TLSv1' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite +syn match ngxSSLProtocol 'TLSv1\.1' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite +syn match ngxSSLProtocol 'TLSv1\.2' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite +syn match ngxSSLProtocol 'TLSv1\.3' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite + +" Do not enable highlighting of insecure protocols if sslecure is loaded +if !exists('g:loaded_sslsecure') + syn keyword ngxSSLProtocolDeprecated SSLv2 SSLv3 contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite +else + syn match ngxSSLProtocol 'SSLv2' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite + syn match ngxSSLProtocol 'SSLv3' contained nextgroup=ngxSSLProtocol,ngxSSLProtocolDeprecated skipwhite +endif + +syn keyword ngxDirective ssl_session_cache +syn keyword ngxDirective ssl_session_ticket_key +syn keyword ngxDirective ssl_session_tickets nextgroup=ngxSSLSessionTicketsOn,ngxSSLSessionTicketsOff skipwhite +syn keyword ngxSSLSessionTicketsOn on contained +syn keyword ngxSSLSessionTicketsOff off contained +syn keyword ngxDirective ssl_session_timeout +syn keyword ngxDirective ssl_stapling +syn keyword ngxDirective ssl_stapling_file +syn keyword ngxDirective ssl_stapling_responder +syn keyword ngxDirective ssl_stapling_verify +syn keyword ngxDirective ssl_trusted_certificate +syn keyword ngxDirective ssl_verify_client +syn keyword ngxDirective ssl_verify_depth +syn keyword ngxDirective starttls +syn keyword ngxDirective state +syn keyword ngxDirective status +syn keyword ngxDirective status_format +syn keyword ngxDirective status_zone +syn keyword ngxDirective sticky contained +syn keyword ngxDirective sticky_cookie_insert contained +syn region ngxDirectiveSticky matchgroup=ngxDirective start=+^\s*\zssticky\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxCookieOptions,ngxString,ngxBoolean,ngxInteger,ngxTemplateVar +syn keyword ngxDirective stub_status +syn keyword ngxDirective sub_filter +syn keyword ngxDirective sub_filter_last_modified +syn keyword ngxDirective sub_filter_once +syn keyword ngxDirective sub_filter_types +syn keyword ngxDirective tcp_nodelay +syn keyword ngxDirective tcp_nopush +syn keyword ngxDirective thread_pool +syn keyword ngxDirective thread_stack_size +syn keyword ngxDirective timeout +syn keyword ngxDirective timer_resolution +syn keyword ngxDirective types_hash_bucket_size +syn keyword ngxDirective types_hash_max_size +syn keyword ngxDirective underscores_in_headers +syn keyword ngxDirective uninitialized_variable_warn +syn keyword ngxDirective upstream_conf +syn keyword ngxDirective use +syn keyword ngxDirective user +syn keyword ngxDirective userid +syn keyword ngxDirective userid_domain +syn keyword ngxDirective userid_expires +syn keyword ngxDirective userid_mark +syn keyword ngxDirective userid_name +syn keyword ngxDirective userid_p3p +syn keyword ngxDirective userid_path +syn keyword ngxDirective userid_service +syn keyword ngxDirective uwsgi_bind +syn keyword ngxDirective uwsgi_buffer_size +syn keyword ngxDirective uwsgi_buffering +syn keyword ngxDirective uwsgi_buffers +syn keyword ngxDirective uwsgi_busy_buffers_size +syn keyword ngxDirective uwsgi_cache +syn keyword ngxDirective uwsgi_cache_bypass +syn keyword ngxDirective uwsgi_cache_key +syn keyword ngxDirective uwsgi_cache_lock +syn keyword ngxDirective uwsgi_cache_lock_age +syn keyword ngxDirective uwsgi_cache_lock_timeout +syn keyword ngxDirective uwsgi_cache_methods +syn keyword ngxDirective uwsgi_cache_min_uses +syn keyword ngxDirective uwsgi_cache_path +syn keyword ngxDirective uwsgi_cache_purge +syn keyword ngxDirective uwsgi_cache_revalidate +syn keyword ngxDirective uwsgi_cache_use_stale +syn keyword ngxDirective uwsgi_cache_valid +syn keyword ngxDirective uwsgi_connect_timeout +syn keyword ngxDirective uwsgi_force_ranges +syn keyword ngxDirective uwsgi_hide_header +syn keyword ngxDirective uwsgi_ignore_client_abort +syn keyword ngxDirective uwsgi_ignore_headers +syn keyword ngxDirective uwsgi_intercept_errors +syn keyword ngxDirective uwsgi_limit_rate +syn keyword ngxDirective uwsgi_max_temp_file_size +syn keyword ngxDirective uwsgi_modifier1 +syn keyword ngxDirective uwsgi_modifier2 +syn keyword ngxDirective uwsgi_next_upstream +syn keyword ngxDirective uwsgi_next_upstream_timeout +syn keyword ngxDirective uwsgi_next_upstream_tries +syn keyword ngxDirective uwsgi_no_cache +syn keyword ngxDirective uwsgi_param +syn keyword ngxDirective uwsgi_pass +syn keyword ngxDirective uwsgi_pass_header +syn keyword ngxDirective uwsgi_pass_request_body +syn keyword ngxDirective uwsgi_pass_request_headers +syn keyword ngxDirective uwsgi_read_timeout +syn keyword ngxDirective uwsgi_request_buffering +syn keyword ngxDirective uwsgi_send_timeout +syn keyword ngxDirective uwsgi_ssl_certificate +syn keyword ngxDirective uwsgi_ssl_certificate_key +syn keyword ngxDirective uwsgi_ssl_ciphers +syn keyword ngxDirective uwsgi_ssl_crl +syn keyword ngxDirective uwsgi_ssl_name +syn keyword ngxDirective uwsgi_ssl_password_file +syn keyword ngxDirective uwsgi_ssl_protocols nextgroup=ngxSSLProtocol skipwhite +syn keyword ngxDirective uwsgi_ssl_server_name +syn keyword ngxDirective uwsgi_ssl_session_reuse +syn keyword ngxDirective uwsgi_ssl_trusted_certificate +syn keyword ngxDirective uwsgi_ssl_verify +syn keyword ngxDirective uwsgi_ssl_verify_depth +syn keyword ngxDirective uwsgi_store +syn keyword ngxDirective uwsgi_store_access +syn keyword ngxDirective uwsgi_string +syn keyword ngxDirective uwsgi_temp_file_write_size +syn keyword ngxDirective uwsgi_temp_path +syn keyword ngxDirective valid_referers +syn keyword ngxDirective variables_hash_bucket_size +syn keyword ngxDirective variables_hash_max_size +syn keyword ngxDirective worker_aio_requests +syn keyword ngxDirective worker_connections +syn keyword ngxDirective worker_cpu_affinity +syn keyword ngxDirective worker_priority +syn keyword ngxDirective worker_processes +syn keyword ngxDirective worker_rlimit_core +syn keyword ngxDirective worker_rlimit_nofile +syn keyword ngxDirective worker_rlimit_sigpending +syn keyword ngxDirective worker_threads +syn keyword ngxDirective working_directory +syn keyword ngxDirective xclient +syn keyword ngxDirective xml_entities +syn keyword ngxDirective xslt_last_modified +syn keyword ngxDirective xslt_param +syn keyword ngxDirective xslt_string_param +syn keyword ngxDirective xslt_stylesheet +syn keyword ngxDirective xslt_types +syn keyword ngxDirective zone + +" Do not enable highlighting of insecure ciphers if sslecure is loaded +if !exists('g:loaded_sslsecure') + " Mark insecure SSL Ciphers (Note: List might not not complete) + " Reference: https://www.openssl.org/docs/man1.0.2/apps/ciphers.html + syn match ngxSSLCipherInsecure '[^!]\zsSSLv3' + syn match ngxSSLCipherInsecure '[^!]\zsSSLv2' + syn match ngxSSLCipherInsecure '[^!]\zsHIGH' + syn match ngxSSLCipherInsecure '[^!]\zsMEDIUM' + syn match ngxSSLCipherInsecure '[^!]\zsLOW' + syn match ngxSSLCipherInsecure '[^!]\zsDEFAULT' + syn match ngxSSLCipherInsecure '[^!]\zsCOMPLEMENTOFDEFAULT' + syn match ngxSSLCipherInsecure '[^!]\zsALL' + syn match ngxSSLCipherInsecure '[^!]\zsCOMPLEMENTOFALL' + + " SHA ciphers are only used in HMAC with all known OpenSSL/ LibreSSL cipher suites and MAC + " usage is still considered safe + " syn match ngxSSLCipherInsecure '[^!]\zsSHA\ze\D' " Match SHA1 without matching SHA256+ + " syn match ngxSSLCipherInsecure '[^!]\zsSHA1' + syn match ngxSSLCipherInsecure '[^!]\zsMD5' + syn match ngxSSLCipherInsecure '[^!]\zsRC2' + syn match ngxSSLCipherInsecure '[^!]\zsRC4' + syn match ngxSSLCipherInsecure '[^!]\zs3DES' + syn match ngxSSLCipherInsecure '[^!3]\zsDES' + syn match ngxSSLCipherInsecure '[^!]\zsaDSS' + syn match ngxSSLCipherInsecure '[^!a]\zsDSS' + syn match ngxSSLCipherInsecure '[^!]\zsPSK' + syn match ngxSSLCipherInsecure '[^!]\zsIDEA' + syn match ngxSSLCipherInsecure '[^!]\zsSEED' + syn match ngxSSLCipherInsecure '[^!]\zsEXP\w*' " Match all EXPORT ciphers + syn match ngxSSLCipherInsecure '[^!]\zsaGOST\w*' " Match all GOST ciphers + syn match ngxSSLCipherInsecure '[^!]\zskGOST\w*' + syn match ngxSSLCipherInsecure '[^!ak]\zsGOST\w*' + syn match ngxSSLCipherInsecure '[^!]\zs[kae]\?FZA' " Not implemented + syn match ngxSSLCipherInsecure '[^!]\zsECB' + syn match ngxSSLCipherInsecure '[^!]\zs[aes]NULL' + + " Anonymous cipher suites should never be used + syn match ngxSSLCipherInsecure '[^!ECa]\zsDH\ze[^E]' " Try to match DH without DHE, EDH, EECDH, etc. + syn match ngxSSLCipherInsecure '[^!EA]\zsECDH\ze[^E]' " Do not match EECDH, ECDHE + syn match ngxSSLCipherInsecure '[^!]\zsADH' + syn match ngxSSLCipherInsecure '[^!]\zskDHE' + syn match ngxSSLCipherInsecure '[^!]\zskEDH' + syn match ngxSSLCipherInsecure '[^!]\zskECDHE' + syn match ngxSSLCipherInsecure '[^!]\zskEECDH' + syn match ngxSSLCipherInsecure '[^!E]\zsAECDH' +endif + +syn keyword ngxProxyNextUpstreamOptions error contained +syn keyword ngxProxyNextUpstreamOptions timeout contained +syn keyword ngxProxyNextUpstreamOptions invalid_header contained +syn keyword ngxProxyNextUpstreamOptions http_500 contained +syn keyword ngxProxyNextUpstreamOptions http_502 contained +syn keyword ngxProxyNextUpstreamOptions http_503 contained +syn keyword ngxProxyNextUpstreamOptions http_504 contained +syn keyword ngxProxyNextUpstreamOptions http_403 contained +syn keyword ngxProxyNextUpstreamOptions http_404 contained +syn keyword ngxProxyNextUpstreamOptions http_429 contained +syn keyword ngxProxyNextUpstreamOptions non_idempotent contained +syn keyword ngxProxyNextUpstreamOptions off contained + +syn keyword ngxStickyOptions cookie contained +syn region ngxStickyOptionsCookie matchgroup=ngxStickyOptions start=+^\s*\zssticky\s\s*cookie\ze\s.*;+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxCookieOptions,ngxString,ngxBoolean,ngxInteger,ngxTemplateVar +syn keyword ngxStickyOptions route contained +syn keyword ngxStickyOptions learn contained + +syn keyword ngxCookieOptions expires contained +syn keyword ngxCookieOptions domain contained +syn keyword ngxCookieOptions httponly contained +syn keyword ngxCookieOptions secure contained +syn keyword ngxCookieOptions path contained + +" 3rd party module list: +" https://www.nginx.com/resources/wiki/modules/ + +" Accept Language Module +" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales. +syn keyword ngxDirectiveThirdParty set_from_accept_language + +" Access Key Module (DEPRECATED) +" Denies access unless the request URL contains an access key. +syn keyword ngxDirectiveDeprecated accesskey +syn keyword ngxDirectiveDeprecated accesskey_arg +syn keyword ngxDirectiveDeprecated accesskey_hashmethod +syn keyword ngxDirectiveDeprecated accesskey_signature + +" Asynchronous FastCGI Module +" Primarily a modified version of the Nginx FastCGI module which implements multiplexing of connections, allowing a single FastCGI server to handle many concurrent requests. +" syn keyword ngxDirectiveThirdParty fastcgi_bind +" syn keyword ngxDirectiveThirdParty fastcgi_buffer_size +" syn keyword ngxDirectiveThirdParty fastcgi_buffers +" syn keyword ngxDirectiveThirdParty fastcgi_busy_buffers_size +" syn keyword ngxDirectiveThirdParty fastcgi_cache +" syn keyword ngxDirectiveThirdParty fastcgi_cache_key +" syn keyword ngxDirectiveThirdParty fastcgi_cache_methods +" syn keyword ngxDirectiveThirdParty fastcgi_cache_min_uses +" syn keyword ngxDirectiveThirdParty fastcgi_cache_path +" syn keyword ngxDirectiveThirdParty fastcgi_cache_use_stale +" syn keyword ngxDirectiveThirdParty fastcgi_cache_valid +" syn keyword ngxDirectiveThirdParty fastcgi_catch_stderr +" syn keyword ngxDirectiveThirdParty fastcgi_connect_timeout +" syn keyword ngxDirectiveThirdParty fastcgi_hide_header +" syn keyword ngxDirectiveThirdParty fastcgi_ignore_client_abort +" syn keyword ngxDirectiveThirdParty fastcgi_ignore_headers +" syn keyword ngxDirectiveThirdParty fastcgi_index +" syn keyword ngxDirectiveThirdParty fastcgi_intercept_errors +" syn keyword ngxDirectiveThirdParty fastcgi_max_temp_file_size +" syn keyword ngxDirectiveThirdParty fastcgi_next_upstream +" syn keyword ngxDirectiveThirdParty fastcgi_param +" syn keyword ngxDirectiveThirdParty fastcgi_pass +" syn keyword ngxDirectiveThirdParty fastcgi_pass_header +" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_body +" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_headers +" syn keyword ngxDirectiveThirdParty fastcgi_read_timeout +" syn keyword ngxDirectiveThirdParty fastcgi_send_lowat +" syn keyword ngxDirectiveThirdParty fastcgi_send_timeout +" syn keyword ngxDirectiveThirdParty fastcgi_split_path_info +" syn keyword ngxDirectiveThirdParty fastcgi_store +" syn keyword ngxDirectiveThirdParty fastcgi_store_access +" syn keyword ngxDirectiveThirdParty fastcgi_temp_file_write_size +" syn keyword ngxDirectiveThirdParty fastcgi_temp_path +syn keyword ngxDirectiveDeprecated fastcgi_upstream_fail_timeout +syn keyword ngxDirectiveDeprecated fastcgi_upstream_max_fails + +" Akamai G2O Module +" Nginx Module for Authenticating Akamai G2O requests +syn keyword ngxDirectiveThirdParty g2o +syn keyword ngxDirectiveThirdParty g2o_nonce +syn keyword ngxDirectiveThirdParty g2o_key + +" Lua Module +" You can be very simple to execute lua code for nginx +syn keyword ngxDirectiveThirdParty lua_file + +" Array Variable Module +" Add support for array-typed variables to nginx config files +syn keyword ngxDirectiveThirdParty array_split +syn keyword ngxDirectiveThirdParty array_join +syn keyword ngxDirectiveThirdParty array_map +syn keyword ngxDirectiveThirdParty array_map_op + +" Nginx Audio Track for HTTP Live Streaming +" This nginx module generates audio track for hls streams on the fly. +syn keyword ngxDirectiveThirdParty ngx_hls_audio_track +syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_rootpath +syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_format +syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_header + +" AWS Proxy Module +" Nginx module to proxy to authenticated AWS services +syn keyword ngxDirectiveThirdParty aws_access_key +syn keyword ngxDirectiveThirdParty aws_key_scope +syn keyword ngxDirectiveThirdParty aws_signing_key +syn keyword ngxDirectiveThirdParty aws_endpoint +syn keyword ngxDirectiveThirdParty aws_s3_bucket +syn keyword ngxDirectiveThirdParty aws_sign + +" Backtrace module +" A Nginx module to dump backtrace when a worker process exits abnormally +syn keyword ngxDirectiveThirdParty backtrace_log +syn keyword ngxDirectiveThirdParty backtrace_max_stack_size + +" Brotli Module +" Nginx module for Brotli compression +syn keyword ngxDirectiveThirdParty brotli_static +syn keyword ngxDirectiveThirdParty brotli +syn keyword ngxDirectiveThirdParty brotli_types +syn keyword ngxDirectiveThirdParty brotli_buffers +syn keyword ngxDirectiveThirdParty brotli_comp_level +syn keyword ngxDirectiveThirdParty brotli_window +syn keyword ngxDirectiveThirdParty brotli_min_length + +" Cache Purge Module +" Adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches. +syn keyword ngxDirectiveThirdParty fastcgi_cache_purge +syn keyword ngxDirectiveThirdParty proxy_cache_purge +" syn keyword ngxDirectiveThirdParty scgi_cache_purge +" syn keyword ngxDirectiveThirdParty uwsgi_cache_purge + +" Chunkin Module (DEPRECATED) +" HTTP 1.1 chunked-encoding request body support for Nginx. +syn keyword ngxDirectiveDeprecated chunkin +syn keyword ngxDirectiveDeprecated chunkin_keepalive +syn keyword ngxDirectiveDeprecated chunkin_max_chunks_per_buf +syn keyword ngxDirectiveDeprecated chunkin_resume + +" Circle GIF Module +" Generates simple circle images with the colors and size specified in the URL. +syn keyword ngxDirectiveThirdParty circle_gif +syn keyword ngxDirectiveThirdParty circle_gif_max_radius +syn keyword ngxDirectiveThirdParty circle_gif_min_radius +syn keyword ngxDirectiveThirdParty circle_gif_step_radius + +" Nginx-Clojure Module +" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales. +syn keyword ngxDirectiveThirdParty jvm_path +syn keyword ngxDirectiveThirdParty jvm_var +syn keyword ngxDirectiveThirdParty jvm_classpath +syn keyword ngxDirectiveThirdParty jvm_classpath_check +syn keyword ngxDirectiveThirdParty jvm_workers +syn keyword ngxDirectiveThirdParty jvm_options +syn keyword ngxDirectiveThirdParty jvm_handler_type +syn keyword ngxDirectiveThirdParty jvm_init_handler_name +syn keyword ngxDirectiveThirdParty jvm_init_handler_code +syn keyword ngxDirectiveThirdParty jvm_exit_handler_name +syn keyword ngxDirectiveThirdParty jvm_exit_handler_code +syn keyword ngxDirectiveThirdParty handlers_lazy_init +syn keyword ngxDirectiveThirdParty auto_upgrade_ws +syn keyword ngxDirectiveThirdParty content_handler_type +syn keyword ngxDirectiveThirdParty content_handler_name +syn keyword ngxDirectiveThirdParty content_handler_code +syn keyword ngxDirectiveThirdParty rewrite_handler_type +syn keyword ngxDirectiveThirdParty rewrite_handler_name +syn keyword ngxDirectiveThirdParty rewrite_handler_code +syn keyword ngxDirectiveThirdParty access_handler_type +syn keyword ngxDirectiveThirdParty access_handler_name +syn keyword ngxDirectiveThirdParty access_handler_code +syn keyword ngxDirectiveThirdParty header_filter_type +syn keyword ngxDirectiveThirdParty header_filter_name +syn keyword ngxDirectiveThirdParty header_filter_code +syn keyword ngxDirectiveThirdParty content_handler_property +syn keyword ngxDirectiveThirdParty rewrite_handler_property +syn keyword ngxDirectiveThirdParty access_handler_property +syn keyword ngxDirectiveThirdParty header_filter_property +syn keyword ngxDirectiveThirdParty always_read_body +syn keyword ngxDirectiveThirdParty shared_map +syn keyword ngxDirectiveThirdParty write_page_size + +" Upstream Consistent Hash +" A load balancer that uses an internal consistent hash ring to select the right backend node. +syn keyword ngxDirectiveThirdParty consistent_hash + +" Nginx Development Kit +" The NDK is an Nginx module that is designed to extend the core functionality of the excellent Nginx webserver in a way that can be used as a basis of other Nginx modules. +" NDK_UPSTREAM_LIST +" This submodule provides a directive that creates a list of upstreams, with optional weighting. This list can then be used by other modules to hash over the upstreams however they choose. +syn keyword ngxDirectiveThirdParty upstream_list + +" Drizzle Module +" Upstream module for talking to MySQL and Drizzle directly +syn keyword ngxDirectiveThirdParty drizzle_server +syn keyword ngxDirectiveThirdParty drizzle_keepalive +syn keyword ngxDirectiveThirdParty drizzle_query +syn keyword ngxDirectiveThirdParty drizzle_pass +syn keyword ngxDirectiveThirdParty drizzle_connect_timeout +syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout +syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout +syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout +syn keyword ngxDirectiveThirdParty drizzle_buffer_size +syn keyword ngxDirectiveThirdParty drizzle_module_header +syn keyword ngxDirectiveThirdParty drizzle_status + +" Dynamic ETags Module +" Attempt at handling ETag / If-None-Match on proxied content. +syn keyword ngxDirectiveThirdParty dynamic_etags + +" Echo Module +" Bringing the power of "echo", "sleep", "time" and more to Nginx's config file +syn keyword ngxDirectiveThirdParty echo +syn keyword ngxDirectiveThirdParty echo_duplicate +syn keyword ngxDirectiveThirdParty echo_flush +syn keyword ngxDirectiveThirdParty echo_sleep +syn keyword ngxDirectiveThirdParty echo_blocking_sleep +syn keyword ngxDirectiveThirdParty echo_reset_timer +syn keyword ngxDirectiveThirdParty echo_read_request_body +syn keyword ngxDirectiveThirdParty echo_location_async +syn keyword ngxDirectiveThirdParty echo_location +syn keyword ngxDirectiveThirdParty echo_subrequest_async +syn keyword ngxDirectiveThirdParty echo_subrequest +syn keyword ngxDirectiveThirdParty echo_foreach_split +syn keyword ngxDirectiveThirdParty echo_end +syn keyword ngxDirectiveThirdParty echo_request_body +syn keyword ngxDirectiveThirdParty echo_exec +syn keyword ngxDirectiveThirdParty echo_status +syn keyword ngxDirectiveThirdParty echo_before_body +syn keyword ngxDirectiveThirdParty echo_after_body + +" Encrypted Session Module +" Encrypt and decrypt nginx variable values +syn keyword ngxDirectiveThirdParty encrypted_session_key +syn keyword ngxDirectiveThirdParty encrypted_session_iv +syn keyword ngxDirectiveThirdParty encrypted_session_expires +syn keyword ngxDirectiveThirdParty set_encrypt_session +syn keyword ngxDirectiveThirdParty set_decrypt_session + +" Enhanced Memcached Module +" This module is based on the standard Nginx Memcached module, with some additonal features +syn keyword ngxDirectiveThirdParty enhanced_memcached_pass +syn keyword ngxDirectiveThirdParty enhanced_memcached_hash_keys_with_md5 +syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_put +syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_delete +syn keyword ngxDirectiveThirdParty enhanced_memcached_stats +syn keyword ngxDirectiveThirdParty enhanced_memcached_flush +syn keyword ngxDirectiveThirdParty enhanced_memcached_flush_namespace +syn keyword ngxDirectiveThirdParty enhanced_memcached_bind +syn keyword ngxDirectiveThirdParty enhanced_memcached_connect_timeout +syn keyword ngxDirectiveThirdParty enhanced_memcached_send_timeout +syn keyword ngxDirectiveThirdParty enhanced_memcached_buffer_size +syn keyword ngxDirectiveThirdParty enhanced_memcached_read_timeout + +" Events Module (DEPRECATED) +" Provides options for start/stop events. +syn keyword ngxDirectiveDeprecated on_start +syn keyword ngxDirectiveDeprecated on_stop + +" EY Balancer Module +" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream. +syn keyword ngxDirectiveThirdParty max_connections +syn keyword ngxDirectiveThirdParty max_connections_max_queue_length +syn keyword ngxDirectiveThirdParty max_connections_queue_timeout + +" Upstream Fair Balancer +" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin. +syn keyword ngxDirectiveThirdParty fair +syn keyword ngxDirectiveThirdParty upstream_fair_shm_size + +" Fancy Indexes Module +" Like the built-in autoindex module, but fancier. +syn keyword ngxDirectiveThirdParty fancyindex +syn keyword ngxDirectiveThirdParty fancyindex_default_sort +syn keyword ngxDirectiveThirdParty fancyindex_directories_first +syn keyword ngxDirectiveThirdParty fancyindex_css_href +syn keyword ngxDirectiveThirdParty fancyindex_exact_size +syn keyword ngxDirectiveThirdParty fancyindex_name_length +syn keyword ngxDirectiveThirdParty fancyindex_footer +syn keyword ngxDirectiveThirdParty fancyindex_header +syn keyword ngxDirectiveThirdParty fancyindex_show_path +syn keyword ngxDirectiveThirdParty fancyindex_ignore +syn keyword ngxDirectiveThirdParty fancyindex_hide_symlinks +syn keyword ngxDirectiveThirdParty fancyindex_localtime +syn keyword ngxDirectiveThirdParty fancyindex_time_format + +" Form Auth Module +" Provides authentication and authorization with credentials submitted via POST request +syn keyword ngxDirectiveThirdParty form_auth +syn keyword ngxDirectiveThirdParty form_auth_pam_service +syn keyword ngxDirectiveThirdParty form_auth_login +syn keyword ngxDirectiveThirdParty form_auth_password +syn keyword ngxDirectiveThirdParty form_auth_remote_user + +" Form Input Module +" Reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded" and parses the arguments into nginx variables. +syn keyword ngxDirectiveThirdParty set_form_input +syn keyword ngxDirectiveThirdParty set_form_input_multi + +" GeoIP Module (DEPRECATED) +" Country code lookups via the MaxMind GeoIP API. +syn keyword ngxDirectiveDeprecated geoip_country_file + +" GeoIP 2 Module +" Creates variables with values from the maxmind geoip2 databases based on the client IP +syn keyword ngxDirectiveThirdParty geoip2 + +" GridFS Module +" Nginx module for serving files from MongoDB's GridFS +syn keyword ngxDirectiveThirdParty gridfs + +" Headers More Module +" Set and clear input and output headers...more than "add"! +syn keyword ngxDirectiveThirdParty more_clear_headers +syn keyword ngxDirectiveThirdParty more_clear_input_headers +syn keyword ngxDirectiveThirdParty more_set_headers +syn keyword ngxDirectiveThirdParty more_set_input_headers + +" Health Checks Upstreams Module +" Polls backends and if they respond with HTTP 200 + an optional request body, they are marked good. Otherwise, they are marked bad. +syn keyword ngxDirectiveThirdParty healthcheck_enabled +syn keyword ngxDirectiveThirdParty healthcheck_delay +syn keyword ngxDirectiveThirdParty healthcheck_timeout +syn keyword ngxDirectiveThirdParty healthcheck_failcount +syn keyword ngxDirectiveThirdParty healthcheck_send +syn keyword ngxDirectiveThirdParty healthcheck_expected +syn keyword ngxDirectiveThirdParty healthcheck_buffer +syn keyword ngxDirectiveThirdParty healthcheck_status + +" HTTP Accounting Module +" Add traffic stat function to nginx. Useful for http accounting based on nginx configuration logic +syn keyword ngxDirectiveThirdParty http_accounting +syn keyword ngxDirectiveThirdParty http_accounting_log +syn keyword ngxDirectiveThirdParty http_accounting_id +syn keyword ngxDirectiveThirdParty http_accounting_interval +syn keyword ngxDirectiveThirdParty http_accounting_perturb + +" Nginx Digest Authentication module +" Digest Authentication for Nginx +syn keyword ngxDirectiveThirdParty auth_digest +syn keyword ngxDirectiveThirdParty auth_digest_user_file +syn keyword ngxDirectiveThirdParty auth_digest_timeout +syn keyword ngxDirectiveThirdParty auth_digest_expires +syn keyword ngxDirectiveThirdParty auth_digest_replays +syn keyword ngxDirectiveThirdParty auth_digest_shm_size + +" Auth PAM Module +" HTTP Basic Authentication using PAM. +syn keyword ngxDirectiveThirdParty auth_pam +syn keyword ngxDirectiveThirdParty auth_pam_service_name + +" HTTP Auth Request Module +" Implements client authorization based on the result of a subrequest +" syn keyword ngxDirectiveThirdParty auth_request +" syn keyword ngxDirectiveThirdParty auth_request_set + +" HTTP Concatenation module for Nginx +" A Nginx module for concatenating files in a given context: CSS and JS files usually +syn keyword ngxDirectiveThirdParty concat +syn keyword ngxDirectiveThirdParty concat_types +syn keyword ngxDirectiveThirdParty concat_unique +syn keyword ngxDirectiveThirdParty concat_max_files +syn keyword ngxDirectiveThirdParty concat_delimiter +syn keyword ngxDirectiveThirdParty concat_ignore_file_error + +" HTTP Dynamic Upstream Module +" Update upstreams' config by restful interface +syn keyword ngxDirectiveThirdParty dyups_interface +syn keyword ngxDirectiveThirdParty dyups_read_msg_timeout +syn keyword ngxDirectiveThirdParty dyups_shm_zone_size +syn keyword ngxDirectiveThirdParty dyups_upstream_conf +syn keyword ngxDirectiveThirdParty dyups_trylock + +" HTTP Footer If Filter Module +" The ngx_http_footer_if_filter_module is used to add given content to the end of the response according to the condition specified. +syn keyword ngxDirectiveThirdParty footer_if + +" HTTP Footer Filter Module +" This module implements a body filter that adds a given string to the page footer. +syn keyword ngxDirectiveThirdParty footer +syn keyword ngxDirectiveThirdParty footer_types + +" HTTP Internal Redirect Module +" Make an internal redirect to the uri specified according to the condition specified. +syn keyword ngxDirectiveThirdParty internal_redirect_if +syn keyword ngxDirectiveThirdParty internal_redirect_if_no_postponed + +" HTTP JavaScript Module +" Embedding SpiderMonkey. Nearly full port on Perl module. +syn keyword ngxDirectiveThirdParty js +syn keyword ngxDirectiveThirdParty js_filter +syn keyword ngxDirectiveThirdParty js_filter_types +syn keyword ngxDirectiveThirdParty js_load +syn keyword ngxDirectiveThirdParty js_maxmem +syn keyword ngxDirectiveThirdParty js_require +syn keyword ngxDirectiveThirdParty js_set +syn keyword ngxDirectiveThirdParty js_utf8 + +" HTTP Push Module (DEPRECATED) +" Turn Nginx into an adept long-polling HTTP Push (Comet) server. +syn keyword ngxDirectiveDeprecated push_buffer_size +syn keyword ngxDirectiveDeprecated push_listener +syn keyword ngxDirectiveDeprecated push_message_timeout +syn keyword ngxDirectiveDeprecated push_queue_messages +syn keyword ngxDirectiveDeprecated push_sender + +" HTTP Redis Module +" Redis support. +syn keyword ngxDirectiveThirdParty redis_bind +syn keyword ngxDirectiveThirdParty redis_buffer_size +syn keyword ngxDirectiveThirdParty redis_connect_timeout +syn keyword ngxDirectiveThirdParty redis_next_upstream +syn keyword ngxDirectiveThirdParty redis_pass +syn keyword ngxDirectiveThirdParty redis_read_timeout +syn keyword ngxDirectiveThirdParty redis_send_timeout + +" Iconv Module +" A character conversion nginx module using libiconv +syn keyword ngxDirectiveThirdParty set_iconv +syn keyword ngxDirectiveThirdParty iconv_buffer_size +syn keyword ngxDirectiveThirdParty iconv_filter + +" IP Blocker Module +" An efficient shared memory IP blocking system for nginx. +syn keyword ngxDirectiveThirdParty ip_blocker + +" IP2Location Module +" Allows user to lookup for geolocation information using IP2Location database +syn keyword ngxDirectiveThirdParty ip2location_database + +" JS Module +" Reflect the nginx functionality in JS +syn keyword ngxDirectiveThirdParty js +syn keyword ngxDirectiveThirdParty js_access +syn keyword ngxDirectiveThirdParty js_load +syn keyword ngxDirectiveThirdParty js_set + +" Limit Upload Rate Module +" Limit client-upload rate when they are sending request bodies to you +syn keyword ngxDirectiveThirdParty limit_upload_rate +syn keyword ngxDirectiveThirdParty limit_upload_rate_after + +" Limit Upstream Module +" Limit the number of connections to upstream for NGINX +syn keyword ngxDirectiveThirdParty limit_upstream_zone +syn keyword ngxDirectiveThirdParty limit_upstream_conn +syn keyword ngxDirectiveThirdParty limit_upstream_log_level + +" Log If Module +" Conditional accesslog for nginx +syn keyword ngxDirectiveThirdParty access_log_bypass_if + +" Log Request Speed (DEPRECATED) +" Log the time it took to process each request. +syn keyword ngxDirectiveDeprecated log_request_speed_filter +syn keyword ngxDirectiveDeprecated log_request_speed_filter_timeout + +" Log ZeroMQ Module +" ZeroMQ logger module for nginx +syn keyword ngxDirectiveThirdParty log_zmq_server +syn keyword ngxDirectiveThirdParty log_zmq_endpoint +syn keyword ngxDirectiveThirdParty log_zmq_format +syn keyword ngxDirectiveThirdParty log_zmq_off + +" Lower/UpperCase Module +" This module simply uppercases or lowercases a string and saves it into a new variable. +syn keyword ngxDirectiveThirdParty lower +syn keyword ngxDirectiveThirdParty upper + +" Lua Upstream Module +" Nginx C module to expose Lua API to ngx_lua for Nginx upstreams + +" Lua Module +" Embed the Power of Lua into NGINX HTTP servers +syn keyword ngxDirectiveThirdParty lua_use_default_type +syn keyword ngxDirectiveThirdParty lua_malloc_trim +syn keyword ngxDirectiveThirdParty lua_code_cache +syn keyword ngxDirectiveThirdParty lua_regex_cache_max_entries +syn keyword ngxDirectiveThirdParty lua_regex_match_limit +syn keyword ngxDirectiveThirdParty lua_package_path +syn keyword ngxDirectiveThirdParty lua_package_cpath +syn keyword ngxDirectiveThirdParty init_by_lua +syn keyword ngxDirectiveThirdParty init_by_lua_file +syn keyword ngxDirectiveThirdParty init_worker_by_lua +syn keyword ngxDirectiveThirdParty init_worker_by_lua_file +syn keyword ngxDirectiveThirdParty set_by_lua +syn keyword ngxDirectiveThirdParty set_by_lua_file +syn keyword ngxDirectiveThirdParty content_by_lua +syn keyword ngxDirectiveThirdParty content_by_lua_file +syn keyword ngxDirectiveThirdParty rewrite_by_lua +syn keyword ngxDirectiveThirdParty rewrite_by_lua_file +syn keyword ngxDirectiveThirdParty access_by_lua +syn keyword ngxDirectiveThirdParty access_by_lua_file +syn keyword ngxDirectiveThirdParty header_filter_by_lua +syn keyword ngxDirectiveThirdParty header_filter_by_lua_file +syn keyword ngxDirectiveThirdParty body_filter_by_lua +syn keyword ngxDirectiveThirdParty body_filter_by_lua_file +syn keyword ngxDirectiveThirdParty log_by_lua +syn keyword ngxDirectiveThirdParty log_by_lua_file +syn keyword ngxDirectiveThirdParty balancer_by_lua_file +syn keyword ngxDirectiveThirdParty lua_need_request_body +syn keyword ngxDirectiveThirdParty ssl_certificate_by_lua_file +syn keyword ngxDirectiveThirdParty ssl_session_fetch_by_lua_file +syn keyword ngxDirectiveThirdParty ssl_session_store_by_lua_file +syn keyword ngxDirectiveThirdParty lua_shared_dict +syn keyword ngxDirectiveThirdParty lua_socket_connect_timeout +syn keyword ngxDirectiveThirdParty lua_socket_send_timeout +syn keyword ngxDirectiveThirdParty lua_socket_send_lowat +syn keyword ngxDirectiveThirdParty lua_socket_read_timeout +syn keyword ngxDirectiveThirdParty lua_socket_buffer_size +syn keyword ngxDirectiveThirdParty lua_socket_pool_size +syn keyword ngxDirectiveThirdParty lua_socket_keepalive_timeout +syn keyword ngxDirectiveThirdParty lua_socket_log_errors +syn keyword ngxDirectiveThirdParty lua_ssl_ciphers +syn keyword ngxDirectiveThirdParty lua_ssl_crl +syn keyword ngxDirectiveThirdParty lua_ssl_protocols +syn keyword ngxDirectiveThirdParty lua_ssl_trusted_certificate +syn keyword ngxDirectiveThirdParty lua_ssl_verify_depth +syn keyword ngxDirectiveThirdParty lua_http10_buffering +syn keyword ngxDirectiveThirdParty rewrite_by_lua_no_postpone +syn keyword ngxDirectiveThirdParty access_by_lua_no_postpone +syn keyword ngxDirectiveThirdParty lua_transform_underscores_in_response_headers +syn keyword ngxDirectiveThirdParty lua_check_client_abort +syn keyword ngxDirectiveThirdParty lua_max_pending_timers +syn keyword ngxDirectiveThirdParty lua_max_running_timers + +" MD5 Filter Module +" A content filter for nginx, which returns the md5 hash of the content otherwise returned. +syn keyword ngxDirectiveThirdParty md5_filter + +" Memc Module +" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. +syn keyword ngxDirectiveThirdParty memc_buffer_size +syn keyword ngxDirectiveThirdParty memc_cmds_allowed +syn keyword ngxDirectiveThirdParty memc_connect_timeout +syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified +syn keyword ngxDirectiveThirdParty memc_next_upstream +syn keyword ngxDirectiveThirdParty memc_pass +syn keyword ngxDirectiveThirdParty memc_read_timeout +syn keyword ngxDirectiveThirdParty memc_send_timeout +syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout +syn keyword ngxDirectiveThirdParty memc_upstream_max_fails + +" Mod Security Module +" ModSecurity is an open source, cross platform web application firewall (WAF) engine +syn keyword ngxDirectiveThirdParty ModSecurityConfig +syn keyword ngxDirectiveThirdParty ModSecurityEnabled +syn keyword ngxDirectiveThirdParty pool_context +syn keyword ngxDirectiveThirdParty pool_context_hash_size + +" Mogilefs Module +" MogileFS client for nginx web server. +syn keyword ngxDirectiveThirdParty mogilefs_pass +syn keyword ngxDirectiveThirdParty mogilefs_methods +syn keyword ngxDirectiveThirdParty mogilefs_domain +syn keyword ngxDirectiveThirdParty mogilefs_class +syn keyword ngxDirectiveThirdParty mogilefs_tracker +syn keyword ngxDirectiveThirdParty mogilefs_noverify +syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout +syn keyword ngxDirectiveThirdParty mogilefs_send_timeout +syn keyword ngxDirectiveThirdParty mogilefs_read_timeout + +" Mongo Module +" Upstream module that allows nginx to communicate directly with MongoDB database. +syn keyword ngxDirectiveThirdParty mongo_auth +syn keyword ngxDirectiveThirdParty mongo_pass +syn keyword ngxDirectiveThirdParty mongo_query +syn keyword ngxDirectiveThirdParty mongo_json +syn keyword ngxDirectiveThirdParty mongo_bind +syn keyword ngxDirectiveThirdParty mongo_connect_timeout +syn keyword ngxDirectiveThirdParty mongo_send_timeout +syn keyword ngxDirectiveThirdParty mongo_read_timeout +syn keyword ngxDirectiveThirdParty mongo_buffering +syn keyword ngxDirectiveThirdParty mongo_buffer_size +syn keyword ngxDirectiveThirdParty mongo_buffers +syn keyword ngxDirectiveThirdParty mongo_busy_buffers_size +syn keyword ngxDirectiveThirdParty mongo_next_upstream + +" MP4 Streaming Lite Module +" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL. +" syn keyword ngxDirectiveThirdParty mp4 + +" NAXSI Module +" NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX +syn keyword ngxDirectiveThirdParty DeniedUrl denied_url +syn keyword ngxDirectiveThirdParty LearningMode learning_mode +syn keyword ngxDirectiveThirdParty SecRulesEnabled rules_enabled +syn keyword ngxDirectiveThirdParty SecRulesDisabled rules_disabled +syn keyword ngxDirectiveThirdParty CheckRule check_rule +syn keyword ngxDirectiveThirdParty BasicRule basic_rule +syn keyword ngxDirectiveThirdParty MainRule main_rule +syn keyword ngxDirectiveThirdParty LibInjectionSql libinjection_sql +syn keyword ngxDirectiveThirdParty LibInjectionXss libinjection_xss + +" Nchan Module +" Fast, horizontally scalable, multiprocess pub/sub queuing server and proxy for HTTP, long-polling, Websockets and EventSource (SSE) +syn keyword ngxDirectiveThirdParty nchan_channel_id +syn keyword ngxDirectiveThirdParty nchan_channel_id_split_delimiter +syn keyword ngxDirectiveThirdParty nchan_eventsource_event +syn keyword ngxDirectiveThirdParty nchan_longpoll_multipart_response +syn keyword ngxDirectiveThirdParty nchan_publisher +syn keyword ngxDirectiveThirdParty nchan_publisher_channel_id +syn keyword ngxDirectiveThirdParty nchan_publisher_upstream_request +syn keyword ngxDirectiveThirdParty nchan_pubsub +syn keyword ngxDirectiveThirdParty nchan_subscribe_request +syn keyword ngxDirectiveThirdParty nchan_subscriber +syn keyword ngxDirectiveThirdParty nchan_subscriber_channel_id +syn keyword ngxDirectiveThirdParty nchan_subscriber_compound_etag_message_id +syn keyword ngxDirectiveThirdParty nchan_subscriber_first_message +syn keyword ngxDirectiveThirdParty nchan_subscriber_http_raw_stream_separator +syn keyword ngxDirectiveThirdParty nchan_subscriber_last_message_id +syn keyword ngxDirectiveThirdParty nchan_subscriber_message_id_custom_etag_header +syn keyword ngxDirectiveThirdParty nchan_subscriber_timeout +syn keyword ngxDirectiveThirdParty nchan_unsubscribe_request +syn keyword ngxDirectiveThirdParty nchan_websocket_ping_interval +syn keyword ngxDirectiveThirdParty nchan_authorize_request +syn keyword ngxDirectiveThirdParty nchan_max_reserved_memory +syn keyword ngxDirectiveThirdParty nchan_message_buffer_length +syn keyword ngxDirectiveThirdParty nchan_message_timeout +syn keyword ngxDirectiveThirdParty nchan_redis_idle_channel_cache_timeout +syn keyword ngxDirectiveThirdParty nchan_redis_namespace +syn keyword ngxDirectiveThirdParty nchan_redis_pass +syn keyword ngxDirectiveThirdParty nchan_redis_ping_interval +syn keyword ngxDirectiveThirdParty nchan_redis_server +syn keyword ngxDirectiveThirdParty nchan_redis_storage_mode +syn keyword ngxDirectiveThirdParty nchan_redis_url +syn keyword ngxDirectiveThirdParty nchan_store_messages +syn keyword ngxDirectiveThirdParty nchan_use_redis +syn keyword ngxDirectiveThirdParty nchan_access_control_allow_origin +syn keyword ngxDirectiveThirdParty nchan_channel_group +syn keyword ngxDirectiveThirdParty nchan_channel_group_accounting +syn keyword ngxDirectiveThirdParty nchan_group_location +syn keyword ngxDirectiveThirdParty nchan_group_max_channels +syn keyword ngxDirectiveThirdParty nchan_group_max_messages +syn keyword ngxDirectiveThirdParty nchan_group_max_messages_disk +syn keyword ngxDirectiveThirdParty nchan_group_max_messages_memory +syn keyword ngxDirectiveThirdParty nchan_group_max_subscribers +syn keyword ngxDirectiveThirdParty nchan_subscribe_existing_channels_only +syn keyword ngxDirectiveThirdParty nchan_channel_event_string +syn keyword ngxDirectiveThirdParty nchan_channel_events_channel_id +syn keyword ngxDirectiveThirdParty nchan_stub_status +syn keyword ngxDirectiveThirdParty nchan_max_channel_id_length +syn keyword ngxDirectiveThirdParty nchan_max_channel_subscribers +syn keyword ngxDirectiveThirdParty nchan_channel_timeout +syn keyword ngxDirectiveThirdParty nchan_storage_engine + +" Nginx Notice Module +" Serve static file to POST requests. +syn keyword ngxDirectiveThirdParty notice +syn keyword ngxDirectiveThirdParty notice_type + +" OCSP Proxy Module +" Nginx OCSP processing module designed for response caching +syn keyword ngxDirectiveThirdParty ocsp_proxy +syn keyword ngxDirectiveThirdParty ocsp_cache_timeout + +" Eval Module +" Module for nginx web server evaluates response of proxy or memcached module into variables. +syn keyword ngxDirectiveThirdParty eval +syn keyword ngxDirectiveThirdParty eval_escalate +syn keyword ngxDirectiveThirdParty eval_buffer_size +syn keyword ngxDirectiveThirdParty eval_override_content_type +syn keyword ngxDirectiveThirdParty eval_subrequest_in_memory + +" OpenSSL Version Module +" Nginx OpenSSL version check at startup +syn keyword ngxDirectiveThirdParty openssl_version_minimum +syn keyword ngxDirectiveThirdParty openssl_builddate_minimum + +" Owner Match Module +" Control access for specific owners and groups of files +syn keyword ngxDirectiveThirdParty omallow +syn keyword ngxDirectiveThirdParty omdeny + +" Accept Language Module +" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales. +syn keyword ngxDirectiveThirdParty pagespeed + +" PHP Memcache Standard Balancer Module +" Loadbalancer that is compatible to the standard loadbalancer in the php-memcache module +syn keyword ngxDirectiveThirdParty hash_key + +" PHP Session Module +" Nginx module to parse php sessions +syn keyword ngxDirectiveThirdParty php_session_parse +syn keyword ngxDirectiveThirdParty php_session_strip_formatting + +" Phusion Passenger Module +" Passenger is an open source web application server. +syn keyword ngxDirectiveThirdParty passenger_root +syn keyword ngxDirectiveThirdParty passenger_enabled +syn keyword ngxDirectiveThirdParty passenger_base_uri +syn keyword ngxDirectiveThirdParty passenger_document_root +syn keyword ngxDirectiveThirdParty passenger_ruby +syn keyword ngxDirectiveThirdParty passenger_python +syn keyword ngxDirectiveThirdParty passenger_nodejs +syn keyword ngxDirectiveThirdParty passenger_meteor_app_settings +syn keyword ngxDirectiveThirdParty passenger_app_env +syn keyword ngxDirectiveThirdParty passenger_app_root +syn keyword ngxDirectiveThirdParty passenger_app_group_name +syn keyword ngxDirectiveThirdParty passenger_app_type +syn keyword ngxDirectiveThirdParty passenger_startup_file +syn keyword ngxDirectiveThirdParty passenger_restart_dir +syn keyword ngxDirectiveThirdParty passenger_spawn_method +syn keyword ngxDirectiveThirdParty passenger_env_var +syn keyword ngxDirectiveThirdParty passenger_load_shell_envvars +syn keyword ngxDirectiveThirdParty passenger_rolling_restarts +syn keyword ngxDirectiveThirdParty passenger_resist_deployment_errors +syn keyword ngxDirectiveThirdParty passenger_user_switching +syn keyword ngxDirectiveThirdParty passenger_user +syn keyword ngxDirectiveThirdParty passenger_group +syn keyword ngxDirectiveThirdParty passenger_default_user +syn keyword ngxDirectiveThirdParty passenger_default_group +syn keyword ngxDirectiveThirdParty passenger_show_version_in_header +syn keyword ngxDirectiveThirdParty passenger_friendly_error_pages +syn keyword ngxDirectiveThirdParty passenger_disable_security_update_check +syn keyword ngxDirectiveThirdParty passenger_security_update_check_proxy +syn keyword ngxDirectiveThirdParty passenger_max_pool_size +syn keyword ngxDirectiveThirdParty passenger_min_instances +syn keyword ngxDirectiveThirdParty passenger_max_instances +syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app +syn keyword ngxDirectiveThirdParty passenger_pool_idle_time +syn keyword ngxDirectiveThirdParty passenger_max_preloader_idle_time +syn keyword ngxDirectiveThirdParty passenger_force_max_concurrent_requests_per_process +syn keyword ngxDirectiveThirdParty passenger_start_timeout +syn keyword ngxDirectiveThirdParty passenger_concurrency_model +syn keyword ngxDirectiveThirdParty passenger_thread_count +syn keyword ngxDirectiveThirdParty passenger_max_requests +syn keyword ngxDirectiveThirdParty passenger_max_request_time +syn keyword ngxDirectiveThirdParty passenger_memory_limit +syn keyword ngxDirectiveThirdParty passenger_stat_throttle_rate +syn keyword ngxDirectiveThirdParty passenger_core_file_descriptor_ulimit +syn keyword ngxDirectiveThirdParty passenger_app_file_descriptor_ulimit +syn keyword ngxDirectiveThirdParty passenger_pre_start +syn keyword ngxDirectiveThirdParty passenger_set_header +syn keyword ngxDirectiveThirdParty passenger_max_request_queue_size +syn keyword ngxDirectiveThirdParty passenger_request_queue_overflow_status_code +syn keyword ngxDirectiveThirdParty passenger_sticky_sessions +syn keyword ngxDirectiveThirdParty passenger_sticky_sessions_cookie_name +syn keyword ngxDirectiveThirdParty passenger_abort_websockets_on_process_shutdown +syn keyword ngxDirectiveThirdParty passenger_ignore_client_abort +syn keyword ngxDirectiveThirdParty passenger_intercept_errors +syn keyword ngxDirectiveThirdParty passenger_pass_header +syn keyword ngxDirectiveThirdParty passenger_ignore_headers +syn keyword ngxDirectiveThirdParty passenger_headers_hash_bucket_size +syn keyword ngxDirectiveThirdParty passenger_headers_hash_max_size +syn keyword ngxDirectiveThirdParty passenger_buffer_response +syn keyword ngxDirectiveThirdParty passenger_response_buffer_high_watermark +syn keyword ngxDirectiveThirdParty passenger_buffer_size, passenger_buffers, passenger_busy_buffers_size +syn keyword ngxDirectiveThirdParty passenger_socket_backlog +syn keyword ngxDirectiveThirdParty passenger_log_level +syn keyword ngxDirectiveThirdParty passenger_log_file +syn keyword ngxDirectiveThirdParty passenger_file_descriptor_log_file +syn keyword ngxDirectiveThirdParty passenger_debugger +syn keyword ngxDirectiveThirdParty passenger_instance_registry_dir +syn keyword ngxDirectiveThirdParty passenger_data_buffer_dir +syn keyword ngxDirectiveThirdParty passenger_fly_with +syn keyword ngxDirectiveThirdParty union_station_support +syn keyword ngxDirectiveThirdParty union_station_key +syn keyword ngxDirectiveThirdParty union_station_proxy_address +syn keyword ngxDirectiveThirdParty union_station_filter +syn keyword ngxDirectiveThirdParty union_station_gateway_address +syn keyword ngxDirectiveThirdParty union_station_gateway_port +syn keyword ngxDirectiveThirdParty union_station_gateway_cert +syn keyword ngxDirectiveDeprecated rails_spawn_method +syn keyword ngxDirectiveDeprecated passenger_debug_log_file + +" Postgres Module +" Upstream module that allows nginx to communicate directly with PostgreSQL database. +syn keyword ngxDirectiveThirdParty postgres_server +syn keyword ngxDirectiveThirdParty postgres_keepalive +syn keyword ngxDirectiveThirdParty postgres_pass +syn keyword ngxDirectiveThirdParty postgres_query +syn keyword ngxDirectiveThirdParty postgres_rewrite +syn keyword ngxDirectiveThirdParty postgres_output +syn keyword ngxDirectiveThirdParty postgres_set +syn keyword ngxDirectiveThirdParty postgres_escape +syn keyword ngxDirectiveThirdParty postgres_connect_timeout +syn keyword ngxDirectiveThirdParty postgres_result_timeout + +" Pubcookie Module +" Authorizes users using encrypted cookies +syn keyword ngxDirectiveThirdParty pubcookie_inactive_expire +syn keyword ngxDirectiveThirdParty pubcookie_hard_expire +syn keyword ngxDirectiveThirdParty pubcookie_app_id +syn keyword ngxDirectiveThirdParty pubcookie_dir_depth +syn keyword ngxDirectiveThirdParty pubcookie_catenate_app_ids +syn keyword ngxDirectiveThirdParty pubcookie_app_srv_id +syn keyword ngxDirectiveThirdParty pubcookie_login +syn keyword ngxDirectiveThirdParty pubcookie_login_method +syn keyword ngxDirectiveThirdParty pubcookie_post +syn keyword ngxDirectiveThirdParty pubcookie_domain +syn keyword ngxDirectiveThirdParty pubcookie_granting_cert_file +syn keyword ngxDirectiveThirdParty pubcookie_session_key_file +syn keyword ngxDirectiveThirdParty pubcookie_session_cert_file +syn keyword ngxDirectiveThirdParty pubcookie_crypt_key_file +syn keyword ngxDirectiveThirdParty pubcookie_end_session +syn keyword ngxDirectiveThirdParty pubcookie_encryption +syn keyword ngxDirectiveThirdParty pubcookie_session_reauth +syn keyword ngxDirectiveThirdParty pubcookie_auth_type_names +syn keyword ngxDirectiveThirdParty pubcookie_no_prompt +syn keyword ngxDirectiveThirdParty pubcookie_on_demand +syn keyword ngxDirectiveThirdParty pubcookie_addl_request +syn keyword ngxDirectiveThirdParty pubcookie_no_obscure_cookies +syn keyword ngxDirectiveThirdParty pubcookie_no_clean_creds +syn keyword ngxDirectiveThirdParty pubcookie_egd_device +syn keyword ngxDirectiveThirdParty pubcookie_no_blank +syn keyword ngxDirectiveThirdParty pubcookie_super_debug +syn keyword ngxDirectiveThirdParty pubcookie_set_remote_user + +" Push Stream Module +" A pure stream http push technology for your Nginx setup +syn keyword ngxDirectiveThirdParty push_stream_channels_statistics +syn keyword ngxDirectiveThirdParty push_stream_publisher +syn keyword ngxDirectiveThirdParty push_stream_subscriber +syn keyword ngxDirectiveThirdParty push_stream_shared_memory_size +syn keyword ngxDirectiveThirdParty push_stream_channel_deleted_message_text +syn keyword ngxDirectiveThirdParty push_stream_channel_inactivity_time +syn keyword ngxDirectiveThirdParty push_stream_ping_message_text +syn keyword ngxDirectiveThirdParty push_stream_timeout_with_body +syn keyword ngxDirectiveThirdParty push_stream_message_ttl +syn keyword ngxDirectiveThirdParty push_stream_max_subscribers_per_channel +syn keyword ngxDirectiveThirdParty push_stream_max_messages_stored_per_channel +syn keyword ngxDirectiveThirdParty push_stream_max_channel_id_length +syn keyword ngxDirectiveThirdParty push_stream_max_number_of_channels +syn keyword ngxDirectiveThirdParty push_stream_max_number_of_wildcard_channels +syn keyword ngxDirectiveThirdParty push_stream_wildcard_channel_prefix +syn keyword ngxDirectiveThirdParty push_stream_events_channel_id +syn keyword ngxDirectiveThirdParty push_stream_channels_path +syn keyword ngxDirectiveThirdParty push_stream_store_messages +syn keyword ngxDirectiveThirdParty push_stream_channel_info_on_publish +syn keyword ngxDirectiveThirdParty push_stream_authorized_channels_only +syn keyword ngxDirectiveThirdParty push_stream_header_template_file +syn keyword ngxDirectiveThirdParty push_stream_header_template +syn keyword ngxDirectiveThirdParty push_stream_message_template +syn keyword ngxDirectiveThirdParty push_stream_footer_template +syn keyword ngxDirectiveThirdParty push_stream_wildcard_channel_max_qtd +syn keyword ngxDirectiveThirdParty push_stream_ping_message_interval +syn keyword ngxDirectiveThirdParty push_stream_subscriber_connection_ttl +syn keyword ngxDirectiveThirdParty push_stream_longpolling_connection_ttl +syn keyword ngxDirectiveThirdParty push_stream_websocket_allow_publish +syn keyword ngxDirectiveThirdParty push_stream_last_received_message_time +syn keyword ngxDirectiveThirdParty push_stream_last_received_message_tag +syn keyword ngxDirectiveThirdParty push_stream_last_event_id +syn keyword ngxDirectiveThirdParty push_stream_user_agent +syn keyword ngxDirectiveThirdParty push_stream_padding_by_user_agent +syn keyword ngxDirectiveThirdParty push_stream_allowed_origins +syn keyword ngxDirectiveThirdParty push_stream_allow_connections_to_events_channel + +" rDNS Module +" Make a reverse DNS (rDNS) lookup for incoming connection and provides simple access control of incoming hostname by allow/deny rules +syn keyword ngxDirectiveThirdParty rdns +syn keyword ngxDirectiveThirdParty rdns_allow +syn keyword ngxDirectiveThirdParty rdns_deny + +" RDS CSV Module +" Nginx output filter module to convert Resty-DBD-Streams (RDS) to Comma-Separated Values (CSV) +syn keyword ngxDirectiveThirdParty rds_csv +syn keyword ngxDirectiveThirdParty rds_csv_row_terminator +syn keyword ngxDirectiveThirdParty rds_csv_field_separator +syn keyword ngxDirectiveThirdParty rds_csv_field_name_header +syn keyword ngxDirectiveThirdParty rds_csv_content_type +syn keyword ngxDirectiveThirdParty rds_csv_buffer_size + +" RDS JSON Module +" An output filter that formats Resty DBD Streams generated by ngx_drizzle and others to JSON +syn keyword ngxDirectiveThirdParty rds_json +syn keyword ngxDirectiveThirdParty rds_json_buffer_size +syn keyword ngxDirectiveThirdParty rds_json_format +syn keyword ngxDirectiveThirdParty rds_json_root +syn keyword ngxDirectiveThirdParty rds_json_success_property +syn keyword ngxDirectiveThirdParty rds_json_user_property +syn keyword ngxDirectiveThirdParty rds_json_errcode_key +syn keyword ngxDirectiveThirdParty rds_json_errstr_key +syn keyword ngxDirectiveThirdParty rds_json_ret +syn keyword ngxDirectiveThirdParty rds_json_content_type + +" Redis Module +" Use this module to perform simple caching +syn keyword ngxDirectiveThirdParty redis_pass +syn keyword ngxDirectiveThirdParty redis_bind +syn keyword ngxDirectiveThirdParty redis_connect_timeout +syn keyword ngxDirectiveThirdParty redis_read_timeout +syn keyword ngxDirectiveThirdParty redis_send_timeout +syn keyword ngxDirectiveThirdParty redis_buffer_size +syn keyword ngxDirectiveThirdParty redis_next_upstream +syn keyword ngxDirectiveThirdParty redis_gzip_flag + +" Redis 2 Module +" Nginx upstream module for the Redis 2.0 protocol +syn keyword ngxDirectiveThirdParty redis2_query +syn keyword ngxDirectiveThirdParty redis2_raw_query +syn keyword ngxDirectiveThirdParty redis2_raw_queries +syn keyword ngxDirectiveThirdParty redis2_literal_raw_query +syn keyword ngxDirectiveThirdParty redis2_pass +syn keyword ngxDirectiveThirdParty redis2_connect_timeout +syn keyword ngxDirectiveThirdParty redis2_send_timeout +syn keyword ngxDirectiveThirdParty redis2_read_timeout +syn keyword ngxDirectiveThirdParty redis2_buffer_size +syn keyword ngxDirectiveThirdParty redis2_next_upstream + +" Replace Filter Module +" Streaming regular expression replacement in response bodies +syn keyword ngxDirectiveThirdParty replace_filter +syn keyword ngxDirectiveThirdParty replace_filter_types +syn keyword ngxDirectiveThirdParty replace_filter_max_buffered_size +syn keyword ngxDirectiveThirdParty replace_filter_last_modified +syn keyword ngxDirectiveThirdParty replace_filter_skip + +" Roboo Module +" HTTP Robot Mitigator + +" RRD Graph Module +" This module provides an HTTP interface to RRDtool's graphing facilities. +syn keyword ngxDirectiveThirdParty rrd_graph +syn keyword ngxDirectiveThirdParty rrd_graph_root + +" RTMP Module +" NGINX-based Media Streaming Server +syn keyword ngxDirectiveThirdParty rtmp +" syn keyword ngxDirectiveThirdParty server +" syn keyword ngxDirectiveThirdParty listen +syn keyword ngxDirectiveThirdParty application +" syn keyword ngxDirectiveThirdParty timeout +syn keyword ngxDirectiveThirdParty ping +syn keyword ngxDirectiveThirdParty ping_timeout +syn keyword ngxDirectiveThirdParty max_streams +syn keyword ngxDirectiveThirdParty ack_window +syn keyword ngxDirectiveThirdParty chunk_size +syn keyword ngxDirectiveThirdParty max_queue +syn keyword ngxDirectiveThirdParty max_message +syn keyword ngxDirectiveThirdParty out_queue +syn keyword ngxDirectiveThirdParty out_cork +" syn keyword ngxDirectiveThirdParty allow +" syn keyword ngxDirectiveThirdParty deny +syn keyword ngxDirectiveThirdParty exec_push +syn keyword ngxDirectiveThirdParty exec_pull +syn keyword ngxDirectiveThirdParty exec +syn keyword ngxDirectiveThirdParty exec_options +syn keyword ngxDirectiveThirdParty exec_static +syn keyword ngxDirectiveThirdParty exec_kill_signal +syn keyword ngxDirectiveThirdParty respawn +syn keyword ngxDirectiveThirdParty respawn_timeout +syn keyword ngxDirectiveThirdParty exec_publish +syn keyword ngxDirectiveThirdParty exec_play +syn keyword ngxDirectiveThirdParty exec_play_done +syn keyword ngxDirectiveThirdParty exec_publish_done +syn keyword ngxDirectiveThirdParty exec_record_done +syn keyword ngxDirectiveThirdParty live +syn keyword ngxDirectiveThirdParty meta +syn keyword ngxDirectiveThirdParty interleave +syn keyword ngxDirectiveThirdParty wait_key +syn keyword ngxDirectiveThirdParty wait_video +syn keyword ngxDirectiveThirdParty publish_notify +syn keyword ngxDirectiveThirdParty drop_idle_publisher +syn keyword ngxDirectiveThirdParty sync +syn keyword ngxDirectiveThirdParty play_restart +syn keyword ngxDirectiveThirdParty idle_streams +syn keyword ngxDirectiveThirdParty record +syn keyword ngxDirectiveThirdParty record_path +syn keyword ngxDirectiveThirdParty record_suffix +syn keyword ngxDirectiveThirdParty record_unique +syn keyword ngxDirectiveThirdParty record_append +syn keyword ngxDirectiveThirdParty record_lock +syn keyword ngxDirectiveThirdParty record_max_size +syn keyword ngxDirectiveThirdParty record_max_frames +syn keyword ngxDirectiveThirdParty record_interval +syn keyword ngxDirectiveThirdParty recorder +syn keyword ngxDirectiveThirdParty record_notify +syn keyword ngxDirectiveThirdParty play +syn keyword ngxDirectiveThirdParty play_temp_path +syn keyword ngxDirectiveThirdParty play_local_path +syn keyword ngxDirectiveThirdParty pull +syn keyword ngxDirectiveThirdParty push +syn keyword ngxDirectiveThirdParty push_reconnect +syn keyword ngxDirectiveThirdParty session_relay +syn keyword ngxDirectiveThirdParty on_connect +syn keyword ngxDirectiveThirdParty on_play +syn keyword ngxDirectiveThirdParty on_publish +syn keyword ngxDirectiveThirdParty on_done +syn keyword ngxDirectiveThirdParty on_play_done +syn keyword ngxDirectiveThirdParty on_publish_done +syn keyword ngxDirectiveThirdParty on_record_done +syn keyword ngxDirectiveThirdParty on_update +syn keyword ngxDirectiveThirdParty notify_update_timeout +syn keyword ngxDirectiveThirdParty notify_update_strict +syn keyword ngxDirectiveThirdParty notify_relay_redirect +syn keyword ngxDirectiveThirdParty notify_method +syn keyword ngxDirectiveThirdParty hls +syn keyword ngxDirectiveThirdParty hls_path +syn keyword ngxDirectiveThirdParty hls_fragment +syn keyword ngxDirectiveThirdParty hls_playlist_length +syn keyword ngxDirectiveThirdParty hls_sync +syn keyword ngxDirectiveThirdParty hls_continuous +syn keyword ngxDirectiveThirdParty hls_nested +syn keyword ngxDirectiveThirdParty hls_base_url +syn keyword ngxDirectiveThirdParty hls_cleanup +syn keyword ngxDirectiveThirdParty hls_fragment_naming +syn keyword ngxDirectiveThirdParty hls_fragment_slicing +syn keyword ngxDirectiveThirdParty hls_variant +syn keyword ngxDirectiveThirdParty hls_type +syn keyword ngxDirectiveThirdParty hls_keys +syn keyword ngxDirectiveThirdParty hls_key_path +syn keyword ngxDirectiveThirdParty hls_key_url +syn keyword ngxDirectiveThirdParty hls_fragments_per_key +syn keyword ngxDirectiveThirdParty dash +syn keyword ngxDirectiveThirdParty dash_path +syn keyword ngxDirectiveThirdParty dash_fragment +syn keyword ngxDirectiveThirdParty dash_playlist_length +syn keyword ngxDirectiveThirdParty dash_nested +syn keyword ngxDirectiveThirdParty dash_cleanup +" syn keyword ngxDirectiveThirdParty access_log +" syn keyword ngxDirectiveThirdParty log_format +syn keyword ngxDirectiveThirdParty max_connections +syn keyword ngxDirectiveThirdParty rtmp_stat +syn keyword ngxDirectiveThirdParty rtmp_stat_stylesheet +syn keyword ngxDirectiveThirdParty rtmp_auto_push +syn keyword ngxDirectiveThirdParty rtmp_auto_push_reconnect +syn keyword ngxDirectiveThirdParty rtmp_socket_dir +syn keyword ngxDirectiveThirdParty rtmp_control + +" RTMPT Module +" Module for nginx to proxy rtmp using http protocol +syn keyword ngxDirectiveThirdParty rtmpt_proxy_target +syn keyword ngxDirectiveThirdParty rtmpt_proxy_rtmp_timeout +syn keyword ngxDirectiveThirdParty rtmpt_proxy_http_timeout +syn keyword ngxDirectiveThirdParty rtmpt_proxy +syn keyword ngxDirectiveThirdParty rtmpt_proxy_stat +syn keyword ngxDirectiveThirdParty rtmpt_proxy_stylesheet + +" Syntactically Awesome Module +" Providing on-the-fly compiling of Sass files as an NGINX module. +syn keyword ngxDirectiveThirdParty sass_compile +syn keyword ngxDirectiveThirdParty sass_error_log +syn keyword ngxDirectiveThirdParty sass_include_path +syn keyword ngxDirectiveThirdParty sass_indent +syn keyword ngxDirectiveThirdParty sass_is_indented_syntax +syn keyword ngxDirectiveThirdParty sass_linefeed +syn keyword ngxDirectiveThirdParty sass_precision +syn keyword ngxDirectiveThirdParty sass_output_style +syn keyword ngxDirectiveThirdParty sass_source_comments +syn keyword ngxDirectiveThirdParty sass_source_map_embed + +" Secure Download Module +" Enables you to create links which are only valid until a certain datetime is reached +syn keyword ngxDirectiveThirdParty secure_download +syn keyword ngxDirectiveThirdParty secure_download_secret +syn keyword ngxDirectiveThirdParty secure_download_path_mode + +" Selective Cache Purge Module +" A module to purge cache by GLOB patterns. The supported patterns are the same as supported by Redis. +syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_unix_socket +syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_host +syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_port +syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_database +syn keyword ngxDirectiveThirdParty selective_cache_purge_query + +" Set cconv Module +" Cconv rewrite set commands +syn keyword ngxDirectiveThirdParty set_cconv_to_simp +syn keyword ngxDirectiveThirdParty set_cconv_to_trad +syn keyword ngxDirectiveThirdParty set_pinyin_to_normal + +" Set Hash Module +" Nginx module that allows the setting of variables to the value of a variety of hashes +syn keyword ngxDirectiveThirdParty set_md5 +syn keyword ngxDirectiveThirdParty set_md5_upper +syn keyword ngxDirectiveThirdParty set_murmur2 +syn keyword ngxDirectiveThirdParty set_murmur2_upper +syn keyword ngxDirectiveThirdParty set_sha1 +syn keyword ngxDirectiveThirdParty set_sha1_upper + +" Set Lang Module +" Provides a variety of ways for setting a variable denoting the langauge that content should be returned in. +syn keyword ngxDirectiveThirdParty set_lang +syn keyword ngxDirectiveThirdParty set_lang_method +syn keyword ngxDirectiveThirdParty lang_cookie +syn keyword ngxDirectiveThirdParty lang_get_var +syn keyword ngxDirectiveThirdParty lang_list +syn keyword ngxDirectiveThirdParty lang_post_var +syn keyword ngxDirectiveThirdParty lang_host +syn keyword ngxDirectiveThirdParty lang_referer + +" Set Misc Module +" Various set_xxx directives added to nginx's rewrite module +syn keyword ngxDirectiveThirdParty set_if_empty +syn keyword ngxDirectiveThirdParty set_quote_sql_str +syn keyword ngxDirectiveThirdParty set_quote_pgsql_str +syn keyword ngxDirectiveThirdParty set_quote_json_str +syn keyword ngxDirectiveThirdParty set_unescape_uri +syn keyword ngxDirectiveThirdParty set_escape_uri +syn keyword ngxDirectiveThirdParty set_hashed_upstream +syn keyword ngxDirectiveThirdParty set_encode_base32 +syn keyword ngxDirectiveThirdParty set_base32_padding +syn keyword ngxDirectiveThirdParty set_misc_base32_padding +syn keyword ngxDirectiveThirdParty set_base32_alphabet +syn keyword ngxDirectiveThirdParty set_decode_base32 +syn keyword ngxDirectiveThirdParty set_encode_base64 +syn keyword ngxDirectiveThirdParty set_decode_base64 +syn keyword ngxDirectiveThirdParty set_encode_hex +syn keyword ngxDirectiveThirdParty set_decode_hex +syn keyword ngxDirectiveThirdParty set_sha1 +syn keyword ngxDirectiveThirdParty set_md5 +syn keyword ngxDirectiveThirdParty set_hmac_sha1 +syn keyword ngxDirectiveThirdParty set_random +syn keyword ngxDirectiveThirdParty set_secure_random_alphanum +syn keyword ngxDirectiveThirdParty set_secure_random_lcalpha +syn keyword ngxDirectiveThirdParty set_rotate +syn keyword ngxDirectiveThirdParty set_local_today +syn keyword ngxDirectiveThirdParty set_formatted_gmt_time +syn keyword ngxDirectiveThirdParty set_formatted_local_time + +" SFlow Module +" A binary, random-sampling nginx module designed for: lightweight, centralized, continuous, real-time monitoring of very large and very busy web farms. +syn keyword ngxDirectiveThirdParty sflow + +" Shibboleth Module +" Shibboleth auth request module for nginx +syn keyword ngxDirectiveThirdParty shib_request +syn keyword ngxDirectiveThirdParty shib_request_set +syn keyword ngxDirectiveThirdParty shib_request_use_headers + +" Slice Module +" Nginx module for serving a file in slices (reverse byte-range) +" syn keyword ngxDirectiveThirdParty slice +syn keyword ngxDirectiveThirdParty slice_arg_begin +syn keyword ngxDirectiveThirdParty slice_arg_end +syn keyword ngxDirectiveThirdParty slice_header +syn keyword ngxDirectiveThirdParty slice_footer +syn keyword ngxDirectiveThirdParty slice_header_first +syn keyword ngxDirectiveThirdParty slice_footer_last + +" SlowFS Cache Module +" Module adding ability to cache static files. +syn keyword ngxDirectiveThirdParty slowfs_big_file_size +syn keyword ngxDirectiveThirdParty slowfs_cache +syn keyword ngxDirectiveThirdParty slowfs_cache_key +syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses +syn keyword ngxDirectiveThirdParty slowfs_cache_path +syn keyword ngxDirectiveThirdParty slowfs_cache_purge +syn keyword ngxDirectiveThirdParty slowfs_cache_valid +syn keyword ngxDirectiveThirdParty slowfs_temp_path + +" Small Light Module +" Dynamic Image Transformation Module For nginx. +syn keyword ngxDirectiveThirdParty small_light +syn keyword ngxDirectiveThirdParty small_light_getparam_mode +syn keyword ngxDirectiveThirdParty small_light_material_dir +syn keyword ngxDirectiveThirdParty small_light_pattern_define +syn keyword ngxDirectiveThirdParty small_light_radius_max +syn keyword ngxDirectiveThirdParty small_light_sigma_max +syn keyword ngxDirectiveThirdParty small_light_imlib2_temp_dir +syn keyword ngxDirectiveThirdParty small_light_buffer + +" Sorted Querystring Filter Module +" Nginx module to expose querystring parameters sorted in a variable to be used on cache_key as example +syn keyword ngxDirectiveThirdParty sorted_querystring_filter_parameter + +" Sphinx2 Module +" Nginx upstream module for Sphinx 2.x +syn keyword ngxDirectiveThirdParty sphinx2_pass +syn keyword ngxDirectiveThirdParty sphinx2_bind +syn keyword ngxDirectiveThirdParty sphinx2_connect_timeout +syn keyword ngxDirectiveThirdParty sphinx2_send_timeout +syn keyword ngxDirectiveThirdParty sphinx2_buffer_size +syn keyword ngxDirectiveThirdParty sphinx2_read_timeout +syn keyword ngxDirectiveThirdParty sphinx2_next_upstream + +" HTTP SPNEGO auth Module +" This module implements adds SPNEGO support to nginx(http://nginx.org). It currently supports only Kerberos authentication via GSSAPI +syn keyword ngxDirectiveThirdParty auth_gss +syn keyword ngxDirectiveThirdParty auth_gss_keytab +syn keyword ngxDirectiveThirdParty auth_gss_realm +syn keyword ngxDirectiveThirdParty auth_gss_service_name +syn keyword ngxDirectiveThirdParty auth_gss_authorized_principal +syn keyword ngxDirectiveThirdParty auth_gss_allow_basic_fallback + +" SR Cache Module +" Transparent subrequest-based caching layout for arbitrary nginx locations +syn keyword ngxDirectiveThirdParty srcache_fetch +syn keyword ngxDirectiveThirdParty srcache_fetch_skip +syn keyword ngxDirectiveThirdParty srcache_store +syn keyword ngxDirectiveThirdParty srcache_store_max_size +syn keyword ngxDirectiveThirdParty srcache_store_skip +syn keyword ngxDirectiveThirdParty srcache_store_statuses +syn keyword ngxDirectiveThirdParty srcache_store_ranges +syn keyword ngxDirectiveThirdParty srcache_header_buffer_size +syn keyword ngxDirectiveThirdParty srcache_store_hide_header +syn keyword ngxDirectiveThirdParty srcache_store_pass_header +syn keyword ngxDirectiveThirdParty srcache_methods +syn keyword ngxDirectiveThirdParty srcache_ignore_content_encoding +syn keyword ngxDirectiveThirdParty srcache_request_cache_control +syn keyword ngxDirectiveThirdParty srcache_response_cache_control +syn keyword ngxDirectiveThirdParty srcache_store_no_store +syn keyword ngxDirectiveThirdParty srcache_store_no_cache +syn keyword ngxDirectiveThirdParty srcache_store_private +syn keyword ngxDirectiveThirdParty srcache_default_expire +syn keyword ngxDirectiveThirdParty srcache_max_expire + +" SSSD Info Module +" Retrives additional attributes from SSSD for current authentizated user +syn keyword ngxDirectiveThirdParty sssd_info +syn keyword ngxDirectiveThirdParty sssd_info_output_to +syn keyword ngxDirectiveThirdParty sssd_info_groups +syn keyword ngxDirectiveThirdParty sssd_info_group +syn keyword ngxDirectiveThirdParty sssd_info_group_separator +syn keyword ngxDirectiveThirdParty sssd_info_attributes +syn keyword ngxDirectiveThirdParty sssd_info_attribute +syn keyword ngxDirectiveThirdParty sssd_info_attribute_separator + +" Static Etags Module +" Generate etags for static content +syn keyword ngxDirectiveThirdParty FileETag + +" Statsd Module +" An nginx module for sending statistics to statsd +syn keyword ngxDirectiveThirdParty statsd_server +syn keyword ngxDirectiveThirdParty statsd_sample_rate +syn keyword ngxDirectiveThirdParty statsd_count +syn keyword ngxDirectiveThirdParty statsd_timing + +" Sticky Module +" Add a sticky cookie to be always forwarded to the same upstream server +" syn keyword ngxDirectiveThirdParty sticky + +" Stream Echo Module +" TCP/stream echo module for NGINX (a port of ngx_http_echo_module) +syn keyword ngxDirectiveThirdParty echo +syn keyword ngxDirectiveThirdParty echo_duplicate +syn keyword ngxDirectiveThirdParty echo_flush_wait +syn keyword ngxDirectiveThirdParty echo_sleep +syn keyword ngxDirectiveThirdParty echo_send_timeout +syn keyword ngxDirectiveThirdParty echo_read_bytes +syn keyword ngxDirectiveThirdParty echo_read_line +syn keyword ngxDirectiveThirdParty echo_request_data +syn keyword ngxDirectiveThirdParty echo_discard_request +syn keyword ngxDirectiveThirdParty echo_read_buffer_size +syn keyword ngxDirectiveThirdParty echo_read_timeout +syn keyword ngxDirectiveThirdParty echo_client_error_log_level +syn keyword ngxDirectiveThirdParty echo_lingering_close +syn keyword ngxDirectiveThirdParty echo_lingering_time +syn keyword ngxDirectiveThirdParty echo_lingering_timeout + +" Stream Lua Module +" Embed the power of Lua into Nginx stream/TCP Servers. +syn keyword ngxDirectiveThirdParty lua_resolver +syn keyword ngxDirectiveThirdParty lua_resolver_timeout +syn keyword ngxDirectiveThirdParty lua_lingering_close +syn keyword ngxDirectiveThirdParty lua_lingering_time +syn keyword ngxDirectiveThirdParty lua_lingering_timeout + +" Stream Upsync Module +" Sync upstreams from consul or others, dynamiclly modify backend-servers attribute(weight, max_fails,...), needn't reload nginx. +syn keyword ngxDirectiveThirdParty upsync +syn keyword ngxDirectiveThirdParty upsync_dump_path +syn keyword ngxDirectiveThirdParty upsync_lb +syn keyword ngxDirectiveThirdParty upsync_show + +" Strip Module +" Whitespace remover. +syn keyword ngxDirectiveThirdParty strip + +" Subrange Module +" Split one big HTTP/Range request to multiple subrange requesets +syn keyword ngxDirectiveThirdParty subrange + +" Substitutions Module +" A filter module which can do both regular expression and fixed string substitutions on response bodies. +syn keyword ngxDirectiveThirdParty subs_filter +syn keyword ngxDirectiveThirdParty subs_filter_types + +" Summarizer Module +" Upstream nginx module to get summaries of documents using the summarizer daemon service +syn keyword ngxDirectiveThirdParty smrzr_filename +syn keyword ngxDirectiveThirdParty smrzr_ratio + +" Supervisord Module +" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand. +syn keyword ngxDirectiveThirdParty supervisord +syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status +syn keyword ngxDirectiveThirdParty supervisord_name +syn keyword ngxDirectiveThirdParty supervisord_start +syn keyword ngxDirectiveThirdParty supervisord_stop + +" Tarantool Upstream Module +" Tarantool NginX upstream module (REST, JSON API, websockets, load balancing) +syn keyword ngxDirectiveThirdParty tnt_pass +syn keyword ngxDirectiveThirdParty tnt_http_methods +syn keyword ngxDirectiveThirdParty tnt_http_rest_methods +syn keyword ngxDirectiveThirdParty tnt_pass_http_request +syn keyword ngxDirectiveThirdParty tnt_pass_http_request_buffer_size +syn keyword ngxDirectiveThirdParty tnt_method +syn keyword ngxDirectiveThirdParty tnt_http_allowed_methods - experemental +syn keyword ngxDirectiveThirdParty tnt_send_timeout +syn keyword ngxDirectiveThirdParty tnt_read_timeout +syn keyword ngxDirectiveThirdParty tnt_buffer_size +syn keyword ngxDirectiveThirdParty tnt_next_upstream +syn keyword ngxDirectiveThirdParty tnt_connect_timeout +syn keyword ngxDirectiveThirdParty tnt_next_upstream +syn keyword ngxDirectiveThirdParty tnt_next_upstream_tries +syn keyword ngxDirectiveThirdParty tnt_next_upstream_timeout + +" TCP Proxy Module +" Add the feature of tcp proxy with nginx, with health check and status monitor +syn keyword ngxDirectiveBlock tcp +" syn keyword ngxDirectiveThirdParty server +" syn keyword ngxDirectiveThirdParty listen +" syn keyword ngxDirectiveThirdParty allow +" syn keyword ngxDirectiveThirdParty deny +" syn keyword ngxDirectiveThirdParty so_keepalive +" syn keyword ngxDirectiveThirdParty tcp_nodelay +" syn keyword ngxDirectiveThirdParty timeout +" syn keyword ngxDirectiveThirdParty server_name +" syn keyword ngxDirectiveThirdParty resolver +" syn keyword ngxDirectiveThirdParty resolver_timeout +" syn keyword ngxDirectiveThirdParty upstream +syn keyword ngxDirectiveThirdParty check +syn keyword ngxDirectiveThirdParty check_http_send +syn keyword ngxDirectiveThirdParty check_http_expect_alive +syn keyword ngxDirectiveThirdParty check_smtp_send +syn keyword ngxDirectiveThirdParty check_smtp_expect_alive +syn keyword ngxDirectiveThirdParty check_shm_size +syn keyword ngxDirectiveThirdParty check_status +" syn keyword ngxDirectiveThirdParty ip_hash +" syn keyword ngxDirectiveThirdParty proxy_pass +" syn keyword ngxDirectiveThirdParty proxy_buffer +" syn keyword ngxDirectiveThirdParty proxy_connect_timeout +" syn keyword ngxDirectiveThirdParty proxy_read_timeout +syn keyword ngxDirectiveThirdParty proxy_write_timeout + +" Testcookie Module +" NGINX module for L7 DDoS attack mitigation +syn keyword ngxDirectiveThirdParty testcookie +syn keyword ngxDirectiveThirdParty testcookie_name +syn keyword ngxDirectiveThirdParty testcookie_domain +syn keyword ngxDirectiveThirdParty testcookie_expires +syn keyword ngxDirectiveThirdParty testcookie_path +syn keyword ngxDirectiveThirdParty testcookie_secret +syn keyword ngxDirectiveThirdParty testcookie_session +syn keyword ngxDirectiveThirdParty testcookie_arg +syn keyword ngxDirectiveThirdParty testcookie_max_attempts +syn keyword ngxDirectiveThirdParty testcookie_p3p +syn keyword ngxDirectiveThirdParty testcookie_fallback +syn keyword ngxDirectiveThirdParty testcookie_whitelist +syn keyword ngxDirectiveThirdParty testcookie_pass +syn keyword ngxDirectiveThirdParty testcookie_redirect_via_refresh +syn keyword ngxDirectiveThirdParty testcookie_refresh_template +syn keyword ngxDirectiveThirdParty testcookie_refresh_status +syn keyword ngxDirectiveThirdParty testcookie_deny_keepalive +syn keyword ngxDirectiveThirdParty testcookie_get_only +syn keyword ngxDirectiveThirdParty testcookie_https_location +syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_cookie +syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_cookie_key +syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_iv +syn keyword ngxDirectiveThirdParty testcookie_internal +syn keyword ngxDirectiveThirdParty testcookie_httponly_flag +syn keyword ngxDirectiveThirdParty testcookie_secure_flag + +" Types Filter Module +" Change the `Content-Type` output header depending on an extension variable according to a condition specified in the 'if' clause. +syn keyword ngxDirectiveThirdParty types_filter +syn keyword ngxDirectiveThirdParty types_filter_use_default + +" Unzip Module +" Enabling fetching of files that are stored in zipped archives. +syn keyword ngxDirectiveThirdParty file_in_unzip_archivefile +syn keyword ngxDirectiveThirdParty file_in_unzip_extract +syn keyword ngxDirectiveThirdParty file_in_unzip + +" Upload Progress Module +" An upload progress system, that monitors RFC1867 POST upload as they are transmitted to upstream servers +syn keyword ngxDirectiveThirdParty upload_progress +syn keyword ngxDirectiveThirdParty track_uploads +syn keyword ngxDirectiveThirdParty report_uploads +syn keyword ngxDirectiveThirdParty upload_progress_content_type +syn keyword ngxDirectiveThirdParty upload_progress_header +syn keyword ngxDirectiveThirdParty upload_progress_jsonp_parameter +syn keyword ngxDirectiveThirdParty upload_progress_json_output +syn keyword ngxDirectiveThirdParty upload_progress_jsonp_output +syn keyword ngxDirectiveThirdParty upload_progress_template + +" Upload Module +" Parses request body storing all files being uploaded to a directory specified by upload_store directive +syn keyword ngxDirectiveThirdParty upload_pass +syn keyword ngxDirectiveThirdParty upload_resumable +syn keyword ngxDirectiveThirdParty upload_store +syn keyword ngxDirectiveThirdParty upload_state_store +syn keyword ngxDirectiveThirdParty upload_store_access +syn keyword ngxDirectiveThirdParty upload_set_form_field +syn keyword ngxDirectiveThirdParty upload_aggregate_form_field +syn keyword ngxDirectiveThirdParty upload_pass_form_field +syn keyword ngxDirectiveThirdParty upload_cleanup +syn keyword ngxDirectiveThirdParty upload_buffer_size +syn keyword ngxDirectiveThirdParty upload_max_part_header_len +syn keyword ngxDirectiveThirdParty upload_max_file_size +syn keyword ngxDirectiveThirdParty upload_limit_rate +syn keyword ngxDirectiveThirdParty upload_max_output_body_len +syn keyword ngxDirectiveThirdParty upload_tame_arrays +syn keyword ngxDirectiveThirdParty upload_pass_args + +" Upstream Fair Module +" The fair load balancer module for nginx http://nginx.localdomain.pl +syn keyword ngxDirectiveThirdParty fair +syn keyword ngxDirectiveThirdParty upstream_fair_shm_size + +" Upstream Hash Module (DEPRECATED) +" Provides simple upstream load distribution by hashing a configurable variable. +" syn keyword ngxDirectiveDeprecated hash +syn keyword ngxDirectiveDeprecated hash_again + +" Upstream Domain Resolve Module +" A load-balancer that resolves an upstream domain name asynchronously. +syn keyword ngxDirectiveThirdParty jdomain + +" Upsync Module +" Sync upstreams from consul or others, dynamiclly modify backend-servers attribute(weight, max_fails,...), needn't reload nginx +syn keyword ngxDirectiveThirdParty upsync +syn keyword ngxDirectiveThirdParty upsync_dump_path +syn keyword ngxDirectiveThirdParty upsync_lb +syn keyword ngxDirectiveThirdParty upstream_show + +" URL Module +" Nginx url encoding converting module +syn keyword ngxDirectiveThirdParty url_encoding_convert +syn keyword ngxDirectiveThirdParty url_encoding_convert_from +syn keyword ngxDirectiveThirdParty url_encoding_convert_to + +" User Agent Module +" Match browsers and crawlers +syn keyword ngxDirectiveThirdParty user_agent + +" Upstrema Ketama Chash Module +" Nginx load-balancer module implementing ketama consistent hashing. +syn keyword ngxDirectiveThirdParty ketama_chash + +" Video Thumbextractor Module +" Extract thumbs from a video file +syn keyword ngxDirectiveThirdParty video_thumbextractor +syn keyword ngxDirectiveThirdParty video_thumbextractor_video_filename +syn keyword ngxDirectiveThirdParty video_thumbextractor_video_second +syn keyword ngxDirectiveThirdParty video_thumbextractor_image_width +syn keyword ngxDirectiveThirdParty video_thumbextractor_image_height +syn keyword ngxDirectiveThirdParty video_thumbextractor_only_keyframe +syn keyword ngxDirectiveThirdParty video_thumbextractor_next_time +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_rows +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_cols +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_max_rows +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_max_cols +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_sample_interval +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_color +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_margin +syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_padding +syn keyword ngxDirectiveThirdParty video_thumbextractor_threads +syn keyword ngxDirectiveThirdParty video_thumbextractor_processes_per_worker + +" Eval Module +" Module for nginx web server evaluates response of proxy or memcached module into variables. +syn keyword ngxDirectiveThirdParty eval +syn keyword ngxDirectiveThirdParty eval_escalate +syn keyword ngxDirectiveThirdParty eval_override_content_type + +" VTS Module +" Nginx virtual host traffic status module +syn keyword ngxDirectiveThirdParty vhost_traffic_status +syn keyword ngxDirectiveThirdParty vhost_traffic_status_zone +syn keyword ngxDirectiveThirdParty vhost_traffic_status_display +syn keyword ngxDirectiveThirdParty vhost_traffic_status_display_format +syn keyword ngxDirectiveThirdParty vhost_traffic_status_display_jsonp +syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter +syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_by_host +syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_by_set_key +syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_check_duplicate +syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit +syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_traffic +syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_traffic_by_set_key +syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_check_duplicate + +" XSS Module +" Native support for cross-site scripting (XSS) in an nginx. +syn keyword ngxDirectiveThirdParty xss_get +syn keyword ngxDirectiveThirdParty xss_callback_arg +syn keyword ngxDirectiveThirdParty xss_override_status +syn keyword ngxDirectiveThirdParty xss_check_status +syn keyword ngxDirectiveThirdParty xss_input_types + +" ZIP Module +" ZIP archiver for nginx + +" Contained LUA blocks for embedded syntax highlighting +syn keyword ngxThirdPartyLuaBlock balancer_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock init_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock init_worker_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock set_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock content_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock rewrite_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock access_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock header_filter_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock body_filter_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock log_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock ssl_certificate_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock ssl_session_fetch_by_lua_block contained +syn keyword ngxThirdPartyLuaBlock ssl_session_store_by_lua_block contained + + +" Nested syntax in ERB templating statements +" Subtype needs to be set to '', otherwise recursive errors occur when opening *.nginx files +let b:eruby_subtype = '' +unlet b:current_syntax +syn include @ERB syntax/eruby.vim +syn region ngxTemplate start=+<%[^\=]+ end=+%>+ oneline contains=@ERB +syn region ngxTemplateVar start=+<%=+ end=+%>+ oneline +let b:current_syntax = "nginx" + +" Nested syntax in Jinja templating statements +" This dependend on https://github.com/lepture/vim-jinja +unlet b:current_syntax +try + syn include @JINJA syntax/jinja.vim + syn region ngxTemplate start=+{%+ end=+%}+ oneline contains=@JINJA + syn region ngxTemplateVar start=+{{+ end=+}}+ oneline +catch +endtry +let b:current_syntax = "nginx" + +" Enable nested LUA syntax highlighting +unlet b:current_syntax +syn include @LUA syntax/lua.vim +syn region ngxLua start=+^\s*\w\+_by_lua_block\s*{+ end=+}+me=s-1 contains=ngxBlock,@LUA +let b:current_syntax = "nginx" + + +" Highlight +hi link ngxComment Comment +hi link ngxVariable Identifier +hi link ngxVariableBlock Identifier +hi link ngxVariableString PreProc +hi link ngxString String +hi link ngxIPaddr Delimiter +hi link ngxBoolean Boolean +hi link ngxInteger Number +hi link ngxDirectiveBlock Statement +hi link ngxDirectiveImportant Type +hi link ngxDirectiveControl Keyword +hi link ngxDirectiveDeprecated Error +hi link ngxDirective Function +hi link ngxDirectiveThirdParty Function +hi link ngxListenOptions PreProc +hi link ngxUpstreamServerOptions PreProc +hi link ngxProxyNextUpstreamOptions PreProc +hi link ngxMailProtocol Keyword +hi link ngxSSLProtocol PreProc +hi link ngxSSLProtocolDeprecated Error +hi link ngxStickyOptions ngxDirective +hi link ngxCookieOptions PreProc +hi link ngxTemplateVar Identifier + +hi link ngxSSLSessionTicketsOff ngxBoolean +hi link ngxSSLSessionTicketsOn Error +hi link ngxSSLPreferServerCiphersOn ngxBoolean +hi link ngxSSLPreferServerCiphersOff Error +hi link ngxGzipOff ngxBoolean +hi link ngxGzipOn Error +hi link ngxSSLCipherInsecure Error + +hi link ngxThirdPartyLuaBlock Function diff --git a/runtime/syntax/nroff.vim b/runtime/syntax/nroff.vim index 3a8cf9585624d..5667042515586 100644 --- a/runtime/syntax/nroff.vim +++ b/runtime/syntax/nroff.vim @@ -1,16 +1,9 @@ " VIM syntax file " Language: nroff/groff -" Maintainer: Pedro Alejandro LīŋŊpez-Valencia -" URL: http://vorbote.wordpress.com/ -" Last Change: 2012 Feb 2 -" -" {{{1 Acknowledgements -" -" ACKNOWLEDGEMENTS: -" -" My thanks to JīŋŊrīŋŊme PlīŋŊt , who was the -" creator and maintainer of this syntax file for several years. -" May I be as good at it as he has been. +" Maintainer: John Marshall +" Previous Maintainer: Pedro Alejandro LÃŗpez-Valencia +" Previous Maintainer: JÊrôme PlÃģt +" Last Change: 2021 Mar 28 " " {{{1 Todo " @@ -31,6 +24,13 @@ endif let s:cpo_save = &cpo set cpo&vim +if exists("nroff_is_groff") + let b:nroff_is_groff = 1 +endif + +syn spell toplevel +syn case match + " " {{{1 plugin settings... " @@ -48,7 +48,7 @@ endif " setlocal paragraphs+=XP " -" {{{2 Activate navigation to preporcessor sections. +" {{{2 Activate navigation to preprocessor sections. " if exists("b:preprocs_as_sections") setlocal sections=EQTSPS[\ G1GS @@ -169,9 +169,9 @@ endif " syn region nroffEquation start=/^\.\s*EQ\>/ end=/^\.\s*EN\>/ -syn region nroffTable start=/^\.\s*TS\>/ end=/^\.\s*TE\>/ +syn region nroffTable start=/^\.\s*TS\>/ end=/^\.\s*TE\>/ contains=@Spell syn region nroffPicture start=/^\.\s*PS\>/ end=/^\.\s*PE\>/ -syn region nroffRefer start=/^\.\s*\[\>/ end=/^\.\s*\]\>/ +syn region nroffRefer start=/^\.\s*\[\>/ end=/^\.\s*\]\>/ contains=@Spell syn region nroffGrap start=/^\.\s*G1\>/ end=/^\.\s*G2\>/ syn region nroffGremlin start=/^\.\s*GS\>/ end=/^\.\s*GE|GF\>/ @@ -179,11 +179,11 @@ syn region nroffGremlin start=/^\.\s*GS\>/ end=/^\.\s*GE|GF\>/ " ------------------------------------------------------------ syn region nroffIgnore start=/^[.']\s*ig/ end=/^['.]\s*\./ -syn match nroffComment /\(^[.']\s*\)\=\\".*/ contains=nroffTodo -syn match nroffComment /^'''.*/ contains=nroffTodo +syn match nroffComment /\(^[.']\s*\)\=\\".*/ contains=nroffTodo,@Spell +syn match nroffComment /^'''.*/ contains=nroffTodo,@Spell if exists("b:nroff_is_groff") - syn match nroffComment "\\#.*$" contains=nroffTodo + syn match nroffComment "\\#.*$" contains=nroffTodo,@Spell endif syn keyword nroffTodo TODO XXX FIXME contained @@ -198,7 +198,7 @@ syn keyword nroffTodo TODO XXX FIXME contained " hi def link nroffEscChar nroffSpecialChar -hi def link nroffEscCharAr nroffSpecialChar +hi def link nroffEscCharArg nroffSpecialChar hi def link nroffSpecialChar SpecialChar hi def link nroffSpace Delimiter @@ -211,7 +211,7 @@ hi def link nroffEscPar nroffEscape hi def link nroffEscRegPar nroffEscape hi def link nroffEscArg nroffEscape hi def link nroffSize nroffEscape -hi def link nroffEscape Preproc +hi def link nroffEscape PreProc hi def link nroffIgnore Comment hi def link nroffComment Comment diff --git a/runtime/syntax/nsis.vim b/runtime/syntax/nsis.vim index 3389771b7877a..3a73fe098916b 100644 --- a/runtime/syntax/nsis.vim +++ b/runtime/syntax/nsis.vim @@ -1,9 +1,9 @@ " Vim syntax file -" Language: NSIS script, for version of NSIS 3.03 and later +" Language: NSIS script, for version of NSIS 3.08 and later " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-nsis " Previous Maintainer: Alex Jakushev -" Last Change: 2018-10-02 +" Last Change: 2020-10-18 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -97,6 +97,8 @@ syn match nsisSysVar "$RESOURCES_LOCALIZED" syn match nsisSysVar "$CDBURN_AREA" syn match nsisSysVar "$HWNDPARENT" syn match nsisSysVar "$PLUGINSDIR" +syn match nsisSysVar "$\%(USERTEMPLATES\|USERSTARTMENU\|USERSMPROGRAMS\|USERDESKTOP\)" +syn match nsisSysVar "$\%(COMMONTEMPLATES\|COMMONSTARTMENU\|COMMONSMPROGRAMS\|COMMONDESKTOP\|COMMONPROGRAMDATA\)" syn match nsisSysVar "$\\r" syn match nsisSysVar "$\\n" syn match nsisSysVar "$\\t" @@ -149,7 +151,7 @@ syn keyword nsisStatement contained Section nextgroup=nsisSectionOpt skipwhite syn region nsisSectionOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSectionKwd syn match nsisSectionKwd contained "/o\>" -syn keyword nsisStatement contained SectionIn nextgroup=nsisSectionInOpt skipwhite +syn keyword nsisStatement contained SectionInstType SectionIn nextgroup=nsisSectionInOpt skipwhite syn region nsisSectionInOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSectionInKwd syn keyword nsisSectionInKwd contained RO @@ -269,10 +271,22 @@ syn keyword nsisAttribute contained ManifestDPIAware nextgroup=nsisManifestDPIAw syn region nsisManifestDPIAwareOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisManifestDPIAwareKwd syn keyword nsisManifestDPIAwareKwd contained notset true false +syn keyword nsisAttribute contained ManifestLongPathAware nextgroup=nsisManifestLongPathAwareOpt skipwhite +syn region nsisManifestLongPathAwareOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisManifestLongPathAwareKwd +syn match nsisManifestLongPathAwareKwd contained "\<\%(notset\|true\|false\)\>" + syn keyword nsisAttribute contained ManifestSupportedOS nextgroup=nsisManifestSupportedOSOpt skipwhite syn region nsisManifestSupportedOSOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisManifestSupportedOSKwd syn match nsisManifestSupportedOSKwd contained "\<\%(none\|all\|WinVista\|Win7\|Win8\|Win8\.1\|Win10\)\>" +syn keyword nsisAttribute contained PEAddResource nextgroup=nsisPEAddResourceOpt skipwhite +syn region nsisPEAddResourceOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisPEAddResourceKwd +syn match nsisPEAddResourceKwd contained "/\%(OVERWRITE\|REPLACE\)\>" + +syn keyword nsisAttribute contained PERemoveResource nextgroup=nsisPERemoveResourceOpt skipwhite +syn region nsisPERemoveResourceOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisPERemoveResourceKwd +syn match nsisPERemoveResourceKwd contained "/NOERRORS\>" + syn keyword nsisAttribute contained RequestExecutionLevel nextgroup=nsisRequestExecutionLevelOpt skipwhite syn region nsisRequestExecutionLevelOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisRequestExecutionLevelKwd syn keyword nsisRequestExecutionLevelKwd contained none user highest admin @@ -353,7 +367,7 @@ syn keyword nsisInstruction contained ExpandEnvStrings ReadEnvStr syn keyword nsisInstruction contained DeleteRegKey nextgroup=nsisDeleteRegKeyOpt skipwhite syn region nsisDeleteRegKeyOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDeleteRegKeyKwd,nsisRegistry -syn match nsisDeleteRegKeyKwd contained "/ifempty\>" +syn match nsisDeleteRegKeyKwd contained "/\%(ifempty\|ifnosubkeys\|ifnovalues\)\>" syn keyword nsisInstruction contained nextgroup=nsisRegistryOpt skipwhite \ DeleteRegValue EnumRegKey EnumRegValue ReadRegDWORD ReadRegStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr @@ -368,8 +382,8 @@ syn region nsisSetRegViewOpt contained start="" end="$" transparent keepend cont syn keyword nsisSetRegViewKwd contained default lastused "FUNCTIONS - general purpose (4.9.3) -syn keyword nsisInstruction contained CallInstDLL CreateDirectory GetDLLVersion -syn keyword nsisInstruction contained GetDLLVersionLocal GetFileTime GetFileTimeLocal +syn keyword nsisInstruction contained CallInstDLL CreateDirectory GetWinVer +syn keyword nsisInstruction contained GetFileTime GetFileTimeLocal GetKnownFolderPath syn keyword nsisInstruction contained GetTempFileName SearchPath RegDLL UnRegDLL syn keyword nsisInstruction contained CopyFiles nextgroup=nsisCopyFilesOpt skipwhite @@ -380,6 +394,10 @@ syn keyword nsisInstruction contained CreateShortcut nextgroup=nsisCreateShortcu syn region nsisCreateShortcutOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisCreateShortcutKwd syn match nsisCreateShortcutKwd contained "/NoWorkingDir\>" +syn keyword nsisInstruction contained GetDLLVersion GetDLLVersionLocal nextgroup=nsisGetDLLVersionOpt skipwhite +syn region nsisGetDLLVersionOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisGetDLLVersionKwd +syn match nsisGetDLLVersionKwd contained "/ProductVersion\>" + syn keyword nsisInstruction contained GetFullPathName nextgroup=nsisGetFullPathNameOpt skipwhite syn region nsisGetFullPathNameOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisGetFullPathNameKwd syn match nsisGetFullPathNameKwd contained "/SHORT\>" @@ -395,6 +413,7 @@ syn keyword nsisFileAttrib contained FILE_ATTRIBUTE_TEMPORARY syn keyword nsisInstruction contained Abort Call ClearErrors GetCurrentAddress syn keyword nsisInstruction contained GetFunctionAddress GetLabelAddress Goto syn keyword nsisInstruction contained IfAbort IfErrors IfFileExists IfRebootFlag IfSilent +syn keyword nsisInstruction contained IfShellVarContextAll IfRtlLanguage syn keyword nsisInstruction contained IntCmp IntCmpU Int64Cmp Int64CmpU IntPtrCmp IntPtrCmpU syn keyword nsisInstruction contained Return Quit SetErrors StrCmp StrCmpS @@ -460,6 +479,10 @@ syn keyword nsisInstruction contained CreateFont nextgroup=nsisFontOpt skipwhite syn keyword nsisInstruction contained nextgroup=nsisBooleanOpt skipwhite \ LockWindow SetAutoClose +syn keyword nsisInstruction contained LoadAndSetImage nextgroup=nsisLoadAndSetImageOpt skipwhite +syn region nsisLoadAndSetImageOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisLoadAndSetImageKwd +syn match nsisLoadAndSetImageKwd contained "/\%(EXERESOURCE\|STRINGID\|RESIZETOFIT\%(WIDTH\|HEIGHT\)\)\>" + syn keyword nsisInstruction contained SendMessage nextgroup=nsisSendMessageOpt skipwhite syn region nsisSendMessageOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSendMessageKwd syn match nsisSendMessageKwd contained "/TIMEOUT\>" @@ -556,7 +579,7 @@ syn keyword nsisVerboseKwd contained push pop "PREPROCESSOR (5.4) syn match nsisDefine contained "!define\>" nextgroup=nsisDefineOpt skipwhite syn region nsisDefineOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDefineKwd -syn match nsisDefineKwd contained "/\%(ifndef\|redef\|date\|utcdate\|math\|file\)\>" +syn match nsisDefineKwd contained "/\%(ifndef\|redef\|date\|utcdate\|file\|intfmt\|math\)\>" syn match nsisDefine contained "!undef\>" syn match nsisPreCondit contained "!ifdef\>" @@ -615,7 +638,10 @@ hi def link nsisInstTypeKwd Constant hi def link nsisLicenseBkColorKwd Constant hi def link nsisLicenseForceSelectionKwd Constant hi def link nsisManifestDPIAwareKwd Constant +hi def link nsisManifestLongPathAwareKwd Constant hi def link nsisManifestSupportedOSKwd Constant +hi def link nsisPEAddResourceKwd Constant +hi def link nsisPERemoveResourceKwd Constant hi def link nsisRequestExecutionLevelKwd Constant hi def link nsisShowInstDetailsKwd Constant hi def link nsisSilentInstallKwd Constant @@ -633,11 +659,13 @@ hi def link nsisWriteRegMultiStrKwd Constant hi def link nsisSetRegViewKwd Constant hi def link nsisCopyFilesKwd Constant hi def link nsisCreateShortcutKwd Constant +hi def link nsisGetDLLVersionKwd Constant hi def link nsisGetFullPathNameKwd Constant hi def link nsisFileAttrib Constant hi def link nsisMessageBox Constant hi def link nsisFileWriteUTF16LEKwd Constant hi def link nsisSetShellVarContextKwd Constant +hi def link nsisLoadAndSetImageKwd Constant hi def link nsisSendMessageKwd Constant hi def link nsisSetBrandingImageKwd Constant hi def link nsisSetDetailsViewKwd Constant diff --git a/runtime/syntax/objc.vim b/runtime/syntax/objc.vim index 9d7b20ecd0c54..7c6e2d51283b3 100644 --- a/runtime/syntax/objc.vim +++ b/runtime/syntax/objc.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: Objective-C " Maintainer: Kazunobu Kuriyama -" Last Change: 2015 Dec 14 +" Last Change: 2020 Jun 07 +" Last Change By Maintainer: 2015 Dec 14 """ Preparation for loading ObjC stuff if exists("b:current_syntax") @@ -24,7 +25,7 @@ syn keyword objcUsefulTerm nil Nil NO YES " Preprocessor Directives syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn match objcImported display contained "\(<\h[-a-zA-Z0-9_/]*\.h>\|<[a-z0-9]\+>\)" +syn match objcImported display contained "\(<\h[-+a-zA-Z0-9_/]*\.h>\|<[a-z0-9]\+>\)" syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported " ObjC Compiler Directives @@ -63,7 +64,7 @@ syn keyword objcStorageClass nullable nonnull null_unspecified " ObjC type specifier syn keyword objcTypeSpecifier __kindof __covariant -" ObjC Type Infomation Parameters +" ObjC Type Information Parameters syn keyword objcTypeInfoParams ObjectType KeyType " shorthand diff --git a/runtime/syntax/ocaml.vim b/runtime/syntax/ocaml.vim index 42913f228e4f2..af3efd3dab62c 100644 --- a/runtime/syntax/ocaml.vim +++ b/runtime/syntax/ocaml.vim @@ -4,7 +4,7 @@ " Maintainers: Markus Mottl " Karl-Heinz Sylla " Issac Trotts -" URL: https://github.com/rgrinberg/vim-ocaml +" URL: https://github.com/ocaml/vim-ocaml " Last Change: " 2018 Nov 08 - Improved highlighting of operators (MaÃĢlan) " 2018 Apr 22 - Improved support for PPX (Andrey Popp) @@ -18,14 +18,20 @@ " can be distinguished from begin/end, which is used for indentation, " and folding. (David Baelde) -" quit when a syntax file was already loaded +" Quit when a syntax file was already loaded if exists("b:current_syntax") && b:current_syntax == "ocaml" finish endif +let s:keepcpo = &cpo +set cpo&vim + " ' can be used in OCaml identifiers setlocal iskeyword+=' +" ` is part of the name of polymorphic variants +setlocal iskeyword+=` + " OCaml is case sensitive. syn case match @@ -123,7 +129,7 @@ syn region ocamlSig matchgroup=ocamlSigEncl start="\" matchgroup=ocamlSi syn region ocamlModSpec matchgroup=ocamlKeyword start="\" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr " "open" -syn region ocamlNone matchgroup=ocamlKeyword start="\" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment +syn match ocamlKeyword "\" skipwhite skipempty nextgroup=ocamlFullMod " "include" syn match ocamlKeyword "\" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod @@ -225,7 +231,18 @@ syn match ocamlStar "*" syn match ocamlAngle "<" syn match ocamlAngle ">" " Custom indexing operators: -syn match ocamlIndexingOp "\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\(()\|\[]\|{}\)\(<-\)\?" +syn region ocamlIndexing matchgroup=ocamlIndexingOp + \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*(" + \ end=")\(\_s*<-\)\?" + \ contains=ALLBUT,@ocamlContained,ocamlParenErr +syn region ocamlIndexing matchgroup=ocamlIndexingOp + \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*\[" + \ end="]\(\_s*<-\)\?" + \ contains=ALLBUT,@ocamlContained,ocamlBrackErr +syn region ocamlIndexing matchgroup=ocamlIndexingOp + \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*{" + \ end="}\(\_s*<-\)\?" + \ contains=ALLBUT,@ocamlContained,ocamlBraceErr " Extension operators (has to be declared before regular infix operators): syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+" " Infix and prefix operators: @@ -283,7 +300,6 @@ syn sync match ocamlSigSync grouphere ocamlSig "\" syn sync match ocamlSigSync groupthere ocamlSig "\" " Define the default highlighting. -" Only when an item doesn't have highlighting yet hi def link ocamlBraceErr Error hi def link ocamlBrackErr Error @@ -308,14 +324,17 @@ hi def link ocamlModPath Include hi def link ocamlObject Include hi def link ocamlModule Include hi def link ocamlModParam1 Include +hi def link ocamlGenMod Include hi def link ocamlModType Include hi def link ocamlMPRestr3 Include hi def link ocamlFullMod Include +hi def link ocamlFuncWith Include +hi def link ocamlModParam Include hi def link ocamlModTypeRestr Include hi def link ocamlWith Include hi def link ocamlMTDef Include -hi def link ocamlSigEncl ocamlModule -hi def link ocamlStructEncl ocamlModule +hi def link ocamlSigEncl ocamlModule +hi def link ocamlStructEncl ocamlModule hi def link ocamlScript Include @@ -326,24 +345,25 @@ hi def link ocamlModPreRHS Keyword hi def link ocamlMPRestr2 Keyword hi def link ocamlKeyword Keyword hi def link ocamlMethod Include +hi def link ocamlArrow Keyword hi def link ocamlKeyChar Keyword hi def link ocamlAnyVar Keyword hi def link ocamlTopStop Keyword -hi def link ocamlRefAssign ocamlKeyChar -hi def link ocamlEqual ocamlKeyChar -hi def link ocamlStar ocamlInfixOp -hi def link ocamlAngle ocamlInfixOp -hi def link ocamlCons ocamlInfixOp +hi def link ocamlRefAssign ocamlKeyChar +hi def link ocamlEqual ocamlKeyChar +hi def link ocamlStar ocamlInfixOp +hi def link ocamlAngle ocamlInfixOp +hi def link ocamlCons ocamlInfixOp -hi def link ocamlPrefixOp ocamlOperator -hi def link ocamlInfixOp ocamlOperator -hi def link ocamlExtensionOp ocamlOperator -hi def link ocamlIndexingOp ocamlOperator +hi def link ocamlPrefixOp ocamlOperator +hi def link ocamlInfixOp ocamlOperator +hi def link ocamlExtensionOp ocamlOperator +hi def link ocamlIndexingOp ocamlOperator if exists("ocaml_highlight_operators") hi def link ocamlInfixOpKeyword ocamlOperator - hi def link ocamlOperator Operator + hi def link ocamlOperator Operator else hi def link ocamlInfixOpKeyword Keyword endif @@ -353,7 +373,7 @@ hi def link ocamlCharacter Character hi def link ocamlNumber Number hi def link ocamlFloat Float hi def link ocamlString String -hi def link ocamlQuotedStringDelim Identifier +hi def link ocamlQuotedStringDelim Identifier hi def link ocamlLabel Identifier @@ -363,8 +383,11 @@ hi def link ocamlTodo Todo hi def link ocamlEncl Keyword -hi def link ocamlPpxEncl ocamlEncl +hi def link ocamlPpxEncl ocamlEncl let b:current_syntax = "ocaml" +let &cpo = s:keepcpo +unlet s:keepcpo + " vim: ts=8 diff --git a/runtime/syntax/opam.vim b/runtime/syntax/opam.vim new file mode 100644 index 0000000000000..9ac1d41ce7ddb --- /dev/null +++ b/runtime/syntax/opam.vim @@ -0,0 +1,38 @@ +" Vim syntax file +" Language: OPAM - OCaml package manager +" Maintainer: Markus Mottl +" URL: https://github.com/ocaml/vim-ocaml +" Last Change: +" 2020 Dec 31 - Added header (Markus Mottl) + +if exists("b:current_syntax") + finish +endif + +" need %{vars}% +" env: [[CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs"]] +syn keyword opamKeyword1 remove depends pin-depends depopts conflicts env packages patches version maintainer tags license homepage authors doc install author available name depexts substs synopsis description +syn match opamKeyword2 "\v(bug-reports|post-messages|ocaml-version|opam-version|dev-repo|build-test|build-doc|build)" + +syn keyword opamTodo FIXME NOTE NOTES TODO XXX contained +syn match opamComment "#.*$" contains=opamTodo,@Spell +syn match opamOperator ">\|<\|=\|<=\|>=" + +syn region opamInterpolate start=/%{/ end=/}%/ contained +syn region opamString start=/"/ end=/"/ contains=opamInterpolate +syn region opamSeq start=/\[/ end=/\]/ contains=ALLBUT,opamKeyword1,opamKeyword2 +syn region opamExp start=/{/ end=/}/ contains=ALLBUT,opamKeyword1,opamKeyword2 + +hi link opamKeyword1 Keyword +hi link opamKeyword2 Keyword + +hi link opamString String +hi link opamExp Function +hi link opamSeq Statement +hi link opamOperator Operator +hi link opamComment Comment +hi link opamInterpolate Identifier + +let b:current_syntax = "opam" + +" vim: ts=2 sw=2 diff --git a/runtime/syntax/openscad.vim b/runtime/syntax/openscad.vim new file mode 100644 index 0000000000000..1e20c743c4e76 --- /dev/null +++ b/runtime/syntax/openscad.vim @@ -0,0 +1,129 @@ +" Vim syntax file +" Language: OpenSCAD +" Maintainer: Niklas Adam +" Last change: 2022-04-15 +" +" +" From salkin-mada/openscad.nvim +" Building on the work of Sirtaj Singh Kang and others for vim-openscad +" + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syntax case ignore + +setlocal iskeyword=a-z,A-Z,48-57,_ + +syn match openscadAoperator "{" +syn match openscadAoperator "}" +syn match openscadLi "\[" +syn match openscadLi "\]" +syn match openscadPar "(" +syn match openscadPar ")" + +syn match openscadSpecialVariable "\$[a-zA-Z_]\+\>" display +syn match openscadModifier "^\s*[\*\!\#\%]" display + +syn match openscadBinaryoperator "+" +syn match openscadBinaryoperator "-" +syn match openscadBinaryoperator "*" +syn match openscadBinaryoperator "/" +syn match openscadBinaryoperator "%" +syn match openscadBinaryoperator "\*\*" +syn match openscadBinaryoperator "<" +syn match openscadBinaryoperator "<=" +syn match openscadBinaryoperator ">" +syn match openscadBinaryoperator ">=" +syn match openscadBinaryoperator "=" +syn match openscadBinaryoperator "==" +syn match openscadBinaryoperator "===" +syn match openscadBinaryoperator "!=" +syn match openscadBinaryoperator "!==" +syn match openscadBinaryoperator "&" +syn match openscadBinaryoperator "|" +syn match openscadBinaryoperator "/ contained display + +syn keyword openscadModuleDef module nextgroup=openscadModule skipwhite skipempty +syn match openscadModule /\<\h\w*\>/ contained display + +syn keyword openscadStatement echo assign let assert +syn keyword openscadConditional if else +syn keyword openscadRepeat for intersection_for +syn keyword openscadInclude include use +syn keyword openscadCsgKeyword union difference intersection render intersection_for +syn keyword openscadTransform scale rotate translate resize mirror multmatrix color minkowski hull projection linear_extrude rotate_extrude offset +syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface +syn keyword openscadPrimitive2D square circle polygon import_dxf text +syn keyword openscadPrimitiveImport import child children + +syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent +syn match openscadNumber "\d\+" display contained +syn match openscadNumber "\.\d\+" display contained + +syn region openscadString start=/"/ skip=/\\"/ end=/"/ + +syn keyword openscadBoolean true false + +syn keyword openscadCommentTodo TODO FIXME XXX NOTE contained display +syn match openscadInlineComment ://.*$: contains=openscadCommentTodo +syn region openscadBlockComment start=:/\*: end=:\*/: fold contains=openscadCommentTodo + +syn region openscadBlock start="{" end="}" transparent fold +syn region openscadVector start="\[" end="\]" transparent fold + +syn keyword openscadBuiltin abs acos asin atan atan2 ceil cos exp floor ln log +syn keyword openscadBuiltin lookup max min pow rands round sign sin sqrt tan +syn keyword openscadBuiltin str len search version version_num concat chr ord cross norm +syn keyword openscadBuiltin parent_module +syn keyword openscadBuiltin dxf_cross dxf_dim +syn keyword openscadBuiltinSpecial PI undef + +""""""""""""""""""""""""""""""""""""""""" +" linkage +""""""""""""""""""""""""""""""""""""""""" +hi def link openscadFunctionDef Structure +hi def link openscadAoperator Function +hi def link openscadLi Function +" hi def link openscadPar Structure +hi def link openscadBuiltinSpecial Special +hi def link openscadBinaryoperator Special +hi def link openscadFunction Function +hi def link openscadModuleDef Structure +hi def link openscadModule Function +hi def link openscadBlockComment Comment +hi def link openscadBoolean Boolean +hi def link openscadBuiltin Function +hi def link openscadConditional Conditional +hi def link openscadCsgKeyword Structure +hi def link openscadInclude Include +hi def link openscadInlineComment Comment +hi def link openscadModifier Special +hi def link openscadStatement Statement +hi def link openscadNumbers Number +hi def link openscadNumber Number +hi def link openscadPrimitiveSolid Keyword +hi def link openscadPrimitive2D Keyword +hi def link openscadPrimitiveImport Keyword +hi def link openscadRepeat Repeat +hi def link openscadSpecialVariable Special +hi def link openscadString String +hi def link openscadTransform Statement +hi def link openscadCommentTodo Todo + +let b:current_syntax = 'openscad' diff --git a/runtime/syntax/pamconf.vim b/runtime/syntax/pamconf.vim index 10d667bdf5ed4..29132848a95d5 100644 --- a/runtime/syntax/pamconf.vim +++ b/runtime/syntax/pamconf.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: pam(8) configuration file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2011-08-03 +" Latest Revision: 2020/08/04 +" Changes By: Haochen Tong if exists("b:current_syntax") @@ -11,23 +12,32 @@ endif let s:cpo_save = &cpo set cpo&vim -syn match pamconfService '^[[:graph:]]\+' - \ nextgroup=pamconfType, - \ pamconfServiceLineCont skipwhite +let s:has_service_field = exists("b:pamconf_has_service_field") + \ ? b:pamconf_has_service_field + \ : expand('%:t') == 'pam.conf' ? 1 : 0 + +syn match pamconfType '-\?[[:alpha:]]\+' + \ contains=pamconfTypeKeyword + \ nextgroup=pamconfControl, + \ pamconfTypeLineCont skipwhite + +syn keyword pamconfTypeKeyword contained account auth password session + +if s:has_service_field + syn match pamconfService '^[[:graph:]]\+' + \ nextgroup=pamconfType, + \ pamconfServiceLineCont skipwhite + + syn match pamconfServiceLineCont contained '\\$' + \ nextgroup=pamconfType, + \ pamconfServiceLineCont skipwhite skipnl +endif syn keyword pamconfTodo contained TODO FIXME XXX NOTE syn region pamconfComment display oneline start='#' end='$' \ contains=pamconfTodo,@Spell -syn match pamconfServiceLineCont contained '\\$' - \ nextgroup=pamconfType, - \ pamconfServiceLineCont skipwhite skipnl - -syn keyword pamconfType account auth password session - \ nextgroup=pamconfControl, - \ pamconfTypeLineCont skipwhite - syn match pamconfTypeLineCont contained '\\$' \ nextgroup=pamconfControl, \ pamconfTypeLineCont skipwhite skipnl @@ -98,7 +108,8 @@ hi def link pamconfTodo Todo hi def link pamconfComment Comment hi def link pamconfService Statement hi def link pamconfServiceLineCont Special -hi def link pamconfType Type +hi def link pamconfType Special +hi def link pamconfTypeKeyword Type hi def link pamconfTypeLineCont pamconfServiceLineCont hi def link pamconfControl Macro hi def link pamconfControlBegin Delimiter diff --git a/runtime/syntax/pamenv.vim b/runtime/syntax/pamenv.vim new file mode 100644 index 0000000000000..90359daa61cf8 --- /dev/null +++ b/runtime/syntax/pamenv.vim @@ -0,0 +1,28 @@ +" Vim syntax file +" Language: pam_env.conf(5) configuration file +" Latest Revision: 2020-05-10 + +if exists("b:current_syntax") + finish +endif + +syn keyword pamenvTodo contained TODO FIXME XXX NOTE +syn region pamenvComment start='^#' end='$' display oneline contains=pamenvTodo,@Spells + +syn match pamenvVars '^[A-Z_][A-Z_0-9]*' nextgroup=pamenvKeywords skipwhite + +syn keyword pamenvKeywords contained DEFAULT OVERRIDE nextgroup=pamenvVarEq + +syn match pamenvVarEq contained '=' nextgroup=pamenvValue,pamenvValueWithQuote + +syn match pamenvValue contained '[^ \t]*' skipwhite nextgroup=pamenvKeywords +syn region pamenvValueWithQuote contained start='"' end='"' skipwhite nextgroup=pamenvKeywords + +hi def link pamenvTodo Todo +hi def link pamenvComment Comment +hi def link pamenvKeywords Keyword +hi def link pamenvVars Identifier +hi def link pamenvValue String +hi def link pamenvValueWithQuote String + +let b:current_syntax = "pamenv" diff --git a/runtime/syntax/pascal.vim b/runtime/syntax/pascal.vim index 2a58ee43f6466..206df213a61a1 100644 --- a/runtime/syntax/pascal.vim +++ b/runtime/syntax/pascal.vim @@ -1,16 +1,16 @@ " Vim syntax file -" Language: Pascal -" Version: 2.8 -" Last Change: 2004/10/17 17:47:30 -" Maintainer: Xavier CrīŋŊgut -" Previous Maintainer: Mario Eusebio +" Language: Pascal +" Maintainer: Doug Kearns +" Previous Maintainers: Xavier CrÊgut +" Mario Eusebio +" Last Change: 2021 May 20 " Contributors: Tim Chase , -" Stas Grabois , -" Mazen NEIFER , -" Klaus Hast , -" Austin Ziegler , -" Markus Koenig +" Stas Grabois , +" Mazen NEIFER , +" Klaus Hast , +" Austin Ziegler , +" Markus Koenig " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -25,10 +25,10 @@ syn keyword pascalBoolean true false syn keyword pascalConditional if else then syn keyword pascalConstant nil maxint syn keyword pascalLabel case goto label -syn keyword pascalOperator and div downto in mod not of or packed with +syn keyword pascalOperator and div downto in mod not of or packed syn keyword pascalRepeat do for do repeat while to until syn keyword pascalStatement procedure function -syn keyword pascalStatement program begin end const var type +syn keyword pascalStatement program begin end const var type with syn keyword pascalStruct record syn keyword pascalType array boolean char integer file pointer real set syn keyword pascalType string text variant @@ -40,12 +40,12 @@ syn keyword pascalTodo contained TODO FIXME XXX DEBUG NOTE " 20010723az: When wanted, highlight the trailing whitespace -- this is " based on c_space_errors; to enable, use "pascal_space_errors". if exists("pascal_space_errors") - if !exists("pascal_no_trail_space_error") - syn match pascalSpaceError "\s\+$" - endif - if !exists("pascal_no_tab_space_error") - syn match pascalSpaceError " \+\t"me=e-1 - endif + if !exists("pascal_no_trail_space_error") + syn match pascalSpaceError "\s\+$" + endif + if !exists("pascal_no_tab_space_error") + syn match pascalSpaceError " \+\t"me=e-1 + endif endif @@ -98,9 +98,24 @@ if exists("pascal_symbol_operator") endif syn match pascalNumber "-\=\<\d\+\>" +if !exists("pascal_traditional") + syn match pascalHexNumber "\$\x\+\>" +endif +if exists("pascal_fpc") + syn match pascalOctNumber "&\o\+\>" + syn match pascalBinNumber "%[01]\+\>" +endif +if exists("pascal_gpc") + syn match pascalExtendedNumber "\%([2-9]\|[12]\d\|3[0-6]\)#[[:alnum:]]\+\>" +endif + syn match pascalFloat "-\=\<\d\+\.\d\+\>" syn match pascalFloat "-\=\<\d\+\.\d\+[eE]-\=\d\+\>" -syn match pascalHexNumber "\$[0-9a-fA-F]\+\>" + +if !exists("pascal_traditional") + " allow leading zeros + syn match pascalControlCharacter "#\%([01]\=\d\=\d\|2[0-4]\d\|25[0-5]\)\>" +endif if exists("pascal_no_tabs") syn match pascalShowTab "\t" @@ -142,7 +157,7 @@ if !exists("pascal_traditional") syn keyword pascalStatement interface unit uses syn keyword pascalModifier absolute assembler external far forward inline syn keyword pascalModifier interrupt near virtual - syn keyword pascalAcces private public + syn keyword pascalAccess private public strict syn keyword pascalStruct object syn keyword pascalOperator shl shr xor @@ -157,6 +172,7 @@ if !exists("pascal_traditional") syn keyword pascalType Single Double Extended Comp syn keyword pascalType PChar + syn keyword pascalPredefined self if !exists ("pascal_fpc") syn keyword pascalPredefined Result @@ -166,11 +182,11 @@ if !exists("pascal_traditional") syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError syn keyword pascalStatement fail otherwise operator syn keyword pascalDirective popstack - syn keyword pascalPredefined self syn keyword pascalType ShortString AnsiString WideString endif if exists("pascal_gpc") + syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError syn keyword pascalType SmallInt syn keyword pascalType AnsiChar syn keyword pascalType PAnsiChar @@ -178,6 +194,8 @@ if !exists("pascal_traditional") if exists("pascal_delphi") syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError + syn region pascalDocumentation start="///" end="$" contains=pascalTodo,pascalSpaceError + syn region pascalDocumentation start="{!" end="}" contains=pascalTodo,pascalSpaceError syn keyword pascalType SmallInt Int64 syn keyword pascalType Real48 Currency syn keyword pascalType AnsiChar WideChar @@ -192,11 +210,11 @@ if !exists("pascal_traditional") syn keyword pascalStatement initialization finalization uses exports syn keyword pascalStatement property out resourcestring threadvar syn keyword pascalModifier contains - syn keyword pascalModifier overridden reintroduce abstract + syn keyword pascalModifier overridden reintroduce abstract sealed syn keyword pascalModifier override export dynamic name message syn keyword pascalModifier dispid index stored default nodefault readonly syn keyword pascalModifier writeonly implements overload requires resident - syn keyword pascalAcces protected published automated + syn keyword pascalAccess protected published automated syn keyword pascalDirective register pascal cvar cdecl stdcall safecall syn keyword pascalOperator as is endif @@ -319,37 +337,43 @@ endif " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link pascalAcces pascalStatement +hi def link pascalAccess pascalStatement hi def link pascalBoolean Boolean hi def link pascalComment Comment -hi def link pascalConditional Conditional +hi def link pascalDocumentation Comment +hi def link pascalConditional Conditional hi def link pascalConstant Constant -hi def link pascalDelimiter Identifier -hi def link pascalDirective pascalStatement -hi def link pascalException Exception -hi def link pascalFloat Float +hi def link pascalControlCharacter Character +hi def link pascalDelimiter Identifier +hi def link pascalDirective pascalStatement +hi def link pascalException Exception +hi def link pascalFloat Float hi def link pascalFunction Function -hi def link pascalLabel Label +hi def link pascalLabel Label hi def link pascalMatrixDelimiter Identifier hi def link pascalModifier Type hi def link pascalNumber Number +hi def link pascalExtendedNumber Number +hi def link pascalBinNumber pascalNumber +hi def link pascalHexNumber pascalNumber +hi def link pascalOctNumber pascalNumber hi def link pascalOperator Operator -hi def link pascalPredefined pascalStatement +hi def link pascalPredefined pascalStatement hi def link pascalPreProc PreProc hi def link pascalRepeat Repeat -hi def link pascalSpaceError Error -hi def link pascalStatement Statement +hi def link pascalSpaceError Error +hi def link pascalStatement Statement hi def link pascalString String -hi def link pascalStringEscape Special +hi def link pascalStringEscape Special hi def link pascalStringEscapeGPC Special -hi def link pascalStringError Error +hi def link pascalStringError Error hi def link pascalStruct pascalStatement hi def link pascalSymbolOperator pascalOperator -hi def link pascalTodo Todo -hi def link pascalType Type -hi def link pascalUnclassified pascalStatement +hi def link pascalTodo Todo +hi def link pascalType Type +hi def link pascalUnclassified pascalStatement " hi def link pascalAsm Assembler -hi def link pascalError Error +hi def link pascalError Error hi def link pascalAsmKey pascalStatement hi def link pascalShowTab Error @@ -357,4 +381,4 @@ hi def link pascalShowTab Error let b:current_syntax = "pascal" -" vim: ts=8 sw=2 +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/syntax/pbtxt.vim b/runtime/syntax/pbtxt.vim new file mode 100644 index 0000000000000..92a75560ef355 --- /dev/null +++ b/runtime/syntax/pbtxt.vim @@ -0,0 +1,44 @@ +" Vim syntax file +" Language: Protobuf Text Format +" Maintainer: Lakshay Garg +" Last Change: 2020 Nov 17 +" Homepage: https://github.com/lakshayg/vim-pbtxt + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn case ignore + +syn keyword pbtxtTodo TODO FIXME contained +syn keyword pbtxtBool true false contained + +syn match pbtxtInt display "\<\(0\|[1-9]\d*\)\>" +syn match pbtxtHex display "\<0[xX]\x\+\>" +syn match pbtxtFloat display "\(0\|[1-9]\d*\)\=\.\d*" +syn match pbtxtMessage display "^\s*\w\+\s*{"me=e-1 +syn match pbtxtField display "^\s*\w\+:"me=e-1 +syn match pbtxtEnum display ":\s*\a\w\+"ms=s+1 contains=pbtxtBool +syn region pbtxtString start=+"+ skip=+\\"+ end=+"+ contains=@Spell +syn region pbtxtComment start="#" end="$" keepend contains=pbtxtTodo,@Spell + +hi def link pbtxtTodo Todo +hi def link pbtxtBool Boolean +hi def link pbtxtInt Number +hi def link pbtxtHex Number +hi def link pbtxtFloat Float +hi def link pbtxtMessage Structure +hi def link pbtxtField Identifier +hi def link pbtxtEnum Define +hi def link pbtxtString String +hi def link pbtxtComment Comment + +let b:current_syntax = "pbtxt" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet diff --git a/runtime/syntax/perl.vim b/runtime/syntax/perl.vim index 6ac28f6915b84..73f967a183e42 100644 --- a/runtime/syntax/perl.vim +++ b/runtime/syntax/perl.vim @@ -1,15 +1,17 @@ " Vim syntax file -" Language: Perl 5 +" Language: Perl " Maintainer: vim-perl -" Homepage: http://github.com/vim-perl/vim-perl/tree/master -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2017-09-12 +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2022 Jun 13 " Contributors: Andy Lester " Hinrik Örn Sigurðsson " Lukas Mai " Nick Hibma " Sonia Heimann " Rob Hoelz +" Doug Kearns " and many others. " " Please download the most recent version first, before mailing @@ -41,11 +43,11 @@ set cpo&vim " POD starts with ^= and ends with ^=cut -if !exists("perl_include_pod") || perl_include_pod == 1 +if get(g:, 'perl_include_pod', 1) " Include a while extra syntax file syn include @Pod syntax/pod.vim unlet b:current_syntax - if exists("perl_fold") + if get(g:, 'perl_fold', 1) syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold extend syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold extend else @@ -54,7 +56,7 @@ if !exists("perl_include_pod") || perl_include_pod == 1 endif else " Use only the bare minimum of rules - if exists("perl_fold") + if get(g:, 'perl_fold', 1) syn region perlPOD start="^=[a-z]" end="^=cut" fold else syn region perlPOD start="^=[a-z]" end="^=cut" @@ -92,7 +94,7 @@ syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdi syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>" syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>" syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>" -syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" +syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\%(::\%(exception\%(::system\)\=\|hints\|skip\)\)\=\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|deprecate\|diagnostics\|encoding\%(::warnings\)\=\|experimental\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|ok\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>" syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>" syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>" @@ -138,38 +140,36 @@ syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\ " If you don't want complex things like @{${"foo"}} to be processed, " just set the variable "perl_no_extended_vars"... -if !exists("perl_no_scope_in_variables") - syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref - syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref - syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref +if !get(g:, 'perl_no_scope_in_variables', 0) + syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref + syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref + syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref else - syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref - syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref - syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref + syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref + syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref + syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref endif syn match perlVarPlain2 "%[-+]" -if !exists("perl_no_extended_vars") - syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces - syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained - syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained - syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained - syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained - syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained - syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend - syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend - syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend - syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend - syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend - syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contains=perlVarSimpleMemberName contained extend +if !get(g:, 'perl_no_extended_vars', 0) + syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQ,perlQQ,perlQW,perlQR,perlArrow,perlBraces + syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained + syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained + syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained + syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained + syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend + syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend + syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend + syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend + syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend + syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contains=perlVarSimpleMemberName contained extend syn match perlVarSimpleMemberName "\I\i*" contained - syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend - syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref - syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref - syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref - syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref - syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref + syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend + syn match perlPackageConst "__PACKAGE__" nextgroup=perlPostDeref + syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlPostDeref + syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlPostDeref + syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" keepend extend contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlPostDeref endif " File Descriptors @@ -221,10 +221,16 @@ syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" cont " Constants " " Numbers -syn match perlNumber "\<\%(0\%(x\x[[:xdigit:]_]*\|b[01][01_]*\|\o[0-7_]*\|\)\|[1-9][[:digit:]_]*\)\>" -syn match perlFloat "\<\d[[:digit:]_]*[eE][\-+]\=\d\+" -syn match perlFloat "\<\d[[:digit:]_]*\.[[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" -syn match perlFloat "\.[[:digit:]][[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" +syn case ignore +syn match perlNumber "\<\%(0\|[1-9]\%(_\=\d\)*\)\>" +syn match perlNumber "\<0\%(x\x\%(_\=\x\)*\|b[01]\%(_\=[01]\)*\|o\=\%(_\=\o\)*\)\>" +syn match perlFloat "\<\d\%(_\=\d\)*e[-+]\=\d\%(_\=\d\)*" +syn match perlFloat "\<\d\%(_\=\d\)*\.\%(\d\%(_\=\d\)*\)\=\%(e[-+]\=\d\%(_\=\d\)*\)\=" +syn match perlFloat "\.\d\%(_\=\d\)*\%(e[-+]\=\d\%(_\=\d\)*\)\=" +syn match perlFloat "\<0x\x\%(_\=\x\)*p[-+]\=\d\%(_\=\d\)*" +syn match perlFloat "\<0x\x\%(_\=\x\)*\.\%(\x\%(_\=\x\)*\)\=\%(p[-+]\=\d\%(_\=\d\)*\)\=" +syn match perlFloat "\<0x\.\x\%(_\=\x\)*\%(p[-+]\=\d\%(_\=\d\)*\)\=" +syn case match syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV syn match perlVStringV "\+ extend contained contains=perlAnglesD " Simple version of searches and matches -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1+ contains=@perlInterpMatch keepend extend nextgroup=perlMatchModifiers +syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpMatch,perlAnglesDQ keepend extend nextgroup=perlMatchModifiers +syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend -syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1+ keepend contained contains=@perlInterpDQ extend nextgroup=perlSubstitutionModifiers +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)+ contained contains=@perlInterpDQ,perlParensDQ keepend extend nextgroup=perlSubstitutionModifiers +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\]+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend nextgroup=perlSubstitutionModifiers +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend nextgroup=perlSubstitutionModifiers +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend nextgroup=perlSubstitutionModifiers +syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'+ contained contains=@perlInterpSQ keepend extend nextgroup=perlSubstitutionModifiers " Translations " perlMatch is the first part, perlTranslation* is the second, translator part. +syn match perlTranslationModifiers "[cdsr]\+" contained syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@[cdsr]*+ contains=perlAnglesSQ contained +syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]([{<]\)+ end=+\z1+ contained nextgroup=perlTranslationModifiers +syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+(+ end=+)+ contains=perlParensSQ contained nextgroup=perlTranslationModifiers +syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\[+ end=+\]+ contains=perlBracketsSQ contained nextgroup=perlTranslationModifiers +syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+{+ end=+}+ contains=perlBracesSQ contained nextgroup=perlTranslationModifiers +syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+<+ end=+>+ contains=perlAnglesSQ contained nextgroup=perlTranslationModifiers " Strings and q, qq, qw and qr expressions syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ keepend extend syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend extend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ keepend extend +syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend +syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpDQ keepend extend syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@+ contains=@perlInterpDQ,perlAnglesDQ keepend extend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ keepend extend +syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@+ contains=@perlInterpSQ,perlAnglesSQ keepend extend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosxdual]*+ contains=@perlInterpMatch keepend extend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\s*\z([^[:space:]#([{<'/]\)+ end=+\z1+ contains=@perlInterpMatch keepend extend nextgroup=perlQRModifiers +syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@ and qr[] which allows for comments and extra whitespace in the pattern -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@[imosxdual]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend nextgroup=perlQRModifiers +syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@\zs\_[^)]\+" contained - syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError + syn match perlSubPrototype "\s*([\\$@%&*\[\];]*)" contained extend endif - -syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment - -syn match perlFunction +\\_s*+ nextgroup=perlSubName +syn match perlSubAttribute "\s*:\s*\h\w*\%(([^)]*)\|\)" contained extend +syn match perlSubName "\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\s*" contained extend +syn region perlSubDeclaration start="" end="[;{]" contains=perlSubName,perlSubPrototype,perlSubAttribute,perlSubSignature,perlComment contained transparent +syn match perlFunction "\\_s*" nextgroup=perlSubDeclaration " The => operator forces a bareword to the left of it to be interpreted as " a string @@ -394,39 +429,75 @@ syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained syn match perlFormatField "@$" contained " __END__ and __DATA__ clauses -if exists("perl_fold") - syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA fold - syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold + +" Vim excludes empty syn-region end lines from the fold region. This is +" probably a bug and means a DATA section ending with an empty line does not +" have that final line included in the fold. +" +" As a workaround we exploit an unterminated syntax region here with an end +" pattern that will (probably) never match. This forces all lines to be +" included in the fold region. Of course, if it does match then there's +" nothing to work around as it is a non-empty line. +" +" This problem also exists with empty string delimited heredocs but there's no +" known workaround for that case. +if get(g:, 'perl_fold', 0) + syntax region perlDATA matchgroup=perlDATAStart start="^__DATA__$" end="VIM_PERL_EOF\%$" contains=@perlDATA fold + syntax region perlEND matchgroup=perlENDStart start="^__END__$" end="VIM_PERL_EOF\%$" contains=@perlDATA fold else - syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA - syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA + syntax region perlDATA matchgroup=perlDATAStart start="^__DATA__$" end="\%$" contains=@perlDATA + syntax region perlEND matchgroup=perlENDStart start="^__END__$" end="\%$" contains=@perlDATA +endif + +" TODO: generalise this to allow other filetypes +if get(g:, 'perl_highlight_data', 0) + syn cluster perlDATA add=perlPOD +else + syn cluster perlDATA remove=perlPOD endif " " Folding - -if exists("perl_fold") +if get(g:, 'perl_fold', 0) " Note: this bit must come before the actual highlighting of the "package" " keyword, otherwise this will screw up Pod lines that match /^package/ - if !exists("perl_nofold_packages") + if !get(g:, 'perl_nofold_packages', 0) syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend + syn region perlPackageFold start="^\z(\s*\)package\s*\S\+\s*{" end="^\z1}" transparent fold keepend endif - if !exists("perl_nofold_subs") + if !get(g:, 'perl_nofold_subs', 0) if get(g:, "perl_fold_anonymous_subs", 0) - syn region perlSubFold start="\[^{]*{" end="}" transparent fold keepend extend - syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend + " EXPLANATION: + " \ - "sub" keyword + " \_[^;{]* - any characters, including new line, but not ";" or "{", zero or more times + " \%(([\\$@%&*\[\];]*)\)\= - prototype definition, \$@%&*[]; characters between (), zero or 1 times + " \_[^;]* - any characters, including new line, but not ";" or "{", zero or more times + " { - start subroutine block + syn region perlSubFold start="\\_[^;{]*\%(([\\$@%&*\[\];]*)\)\=\_[^;{]*{" end="}" transparent fold keepend extend else - syn region perlSubFold start="^\z(\s*\)\.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend - syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend + " EXPLANATION: + " same, as above, but first non-space character after "sub" keyword must + " be [A-Za-z_] + syn region perlSubFold start="\\s*\h\_[^;{]*\%(([\\$@%&*\[\];]*)\)\=\_[^;]*{" end="}" transparent fold keepend extend endif + + syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>\_s*{" end="}" transparent fold keepend endif - if exists("perl_fold_blocks") + if get(g:, 'perl_fold_blocks', 0) syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend + + " TODO this is works incorrectly syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend + else + if get(g:, 'perl_fold_do_blocks', 0) + syn region perlDoBlockDeclaration start="" end="{" contains=perlComment contained transparent + syn match perlOperator "\\_s*" nextgroup=perlDoBlockDeclaration + + syn region perlDoBlockFold start="\\_[^{]*{" end="}" transparent fold keepend extend + endif endif - setlocal foldmethod=syntax syn sync fromstart else " fromstart above seems to set minlines even if perl_fold is not set. @@ -438,29 +509,28 @@ endif " The default highlighting. hi def link perlSharpBang PreProc -hi def link perlControl PreProc -hi def link perlInclude Include -hi def link perlSpecial Special -hi def link perlString String +hi def link perlControl PreProc +hi def link perlInclude Include +hi def link perlSpecial Special +hi def link perlString String hi def link perlCharacter Character -hi def link perlNumber Number -hi def link perlFloat Float +hi def link perlNumber Number +hi def link perlFloat Float hi def link perlType Type hi def link perlIdentifier Identifier -hi def link perlLabel Label +hi def link perlLabel Label hi def link perlStatement Statement hi def link perlConditional Conditional -hi def link perlRepeat Repeat +hi def link perlRepeat Repeat hi def link perlOperator Operator hi def link perlFunction Keyword -hi def link perlSubName Function +hi def link perlSubName Function hi def link perlSubPrototype Type -hi def link perlSignature Type -hi def link perlSubAttributes PreProc -hi def link perlSubAttributesCont perlSubAttributes -hi def link perlComment Comment +hi def link perlSubSignature Type +hi def link perlSubAttribute PreProc +hi def link perlComment Comment hi def link perlTodo Todo -if exists("perl_string_as_statement") +if get(g:, 'perl_string_as_statement', 0) hi def link perlStringStartEnd perlStatement else hi def link perlStringStartEnd perlString @@ -470,21 +540,29 @@ hi def link perlList perlStatement hi def link perlMisc perlStatement hi def link perlVarPlain perlIdentifier hi def link perlVarPlain2 perlIdentifier -hi def link perlArrow perlIdentifier +hi def link perlArrow perlIdentifier hi def link perlFiledescRead perlIdentifier hi def link perlFiledescStatement perlIdentifier -hi def link perlVarSimpleMember perlIdentifier -hi def link perlVarSimpleMemberName perlString -hi def link perlVarNotInMatches perlIdentifier +hi def link perlVarSimpleMember perlIdentifier +hi def link perlVarSimpleMemberName perlString +hi def link perlVarNotInMatches perlIdentifier hi def link perlVarSlash perlIdentifier +hi def link perlQ perlString hi def link perlQQ perlString -hi def link perlHereDoc perlString +hi def link perlQW perlString +hi def link perlQR perlString +hi def link perlMatchModifiers perlMatchStartEnd +hi def link perlSubstitutionModifiers perlMatchStartEnd +hi def link perlTranslationModifiers perlMatchStartEnd +hi def link perlQRModifiers perlStringStartEnd +hi def link perlHereDoc perlString +hi def link perlIndentedHereDoc perlString hi def link perlStringUnexpanded perlString -hi def link perlSubstitutionSQ perlString -hi def link perlSubstitutionGQQ perlString -hi def link perlTranslationGQ perlString -hi def link perlMatch perlString -hi def link perlMatchStartEnd perlStatement +hi def link perlSubstitutionSQ perlString +hi def link perlSubstitutionGQQ perlString +hi def link perlTranslationGQ perlString +hi def link perlMatch perlString +hi def link perlMatchStartEnd perlStatement hi def link perlFormatName perlIdentifier hi def link perlFormatField perlString hi def link perlPackageDecl perlType @@ -493,44 +571,48 @@ hi def link perlPackageRef perlType hi def link perlStatementPackage perlStatement hi def link perlStatementStorage perlStatement hi def link perlStatementControl perlStatement -hi def link perlStatementScalar perlStatement -hi def link perlStatementRegexp perlStatement +hi def link perlStatementScalar perlStatement +hi def link perlStatementRegexp perlStatement hi def link perlStatementNumeric perlStatement -hi def link perlStatementList perlStatement -hi def link perlStatementHash perlStatement -hi def link perlStatementIOfunc perlStatement +hi def link perlStatementList perlStatement +hi def link perlStatementHash perlStatement +hi def link perlStatementIOfunc perlStatement hi def link perlStatementFiledesc perlStatement -hi def link perlStatementVector perlStatement -hi def link perlStatementFiles perlStatement -hi def link perlStatementFlow perlStatement +hi def link perlStatementVector perlStatement +hi def link perlStatementFiles perlStatement +hi def link perlStatementFlow perlStatement hi def link perlStatementInclude perlStatement -hi def link perlStatementProc perlStatement -hi def link perlStatementSocket perlStatement +hi def link perlStatementProc perlStatement +hi def link perlStatementSocket perlStatement hi def link perlStatementIPC perlStatement hi def link perlStatementNetwork perlStatement -hi def link perlStatementPword perlStatement -hi def link perlStatementTime perlStatement -hi def link perlStatementMisc perlStatement +hi def link perlStatementPword perlStatement +hi def link perlStatementTime perlStatement +hi def link perlStatementMisc perlStatement hi def link perlStatementIndirObj perlStatement hi def link perlFunctionName perlIdentifier -hi def link perlMethod perlIdentifier +hi def link perlMethod perlIdentifier hi def link perlPostDeref perlIdentifier hi def link perlFunctionPRef perlType + if !get(g:, 'perl_include_pod', 1) hi def link perlPOD perlComment endif hi def link perlShellCommand perlString hi def link perlSpecialAscii perlSpecial -hi def link perlSpecialDollar perlSpecial -hi def link perlSpecialString perlSpecial -hi def link perlSpecialStringU perlSpecial +hi def link perlSpecialDollar perlSpecial +hi def link perlSpecialString perlSpecial +hi def link perlSpecialStringU perlSpecial hi def link perlSpecialMatch perlSpecial +hi def link perlEND perlComment +hi def link perlENDStart perlEND hi def link perlDATA perlComment +hi def link perlDATAStart perlDATA " NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part), -" I had to remove the transparent property from the following regions -" in order to get them to highlight correctly. Feel free to remove -" these and reinstate the transparent property if you know how. +" I had to remove the transparent property from the following regions +" in order to get them to highlight correctly. Feel free to remove +" these and reinstate the transparent property if you know how. hi def link perlParensSQ perlString hi def link perlBracketsSQ perlString hi def link perlBracesSQ perlString @@ -546,23 +628,21 @@ hi def link perlSpecialStringU2 perlString " Possible errors hi def link perlNotEmptyLine Error hi def link perlElseIfError Error -hi def link perlSubPrototypeError Error -hi def link perlSubError Error " Syncing to speed up processing " -if !exists("perl_no_sync_on_sub") +if !get(g:, 'perl_no_sync_on_sub', 0) syn sync match perlSync grouphere NONE "^\s*\" syn sync match perlSync grouphere NONE "^}" endif -if !exists("perl_no_sync_on_global_var") +if !get(g:, 'perl_no_sync_on_global_var', 0) syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{" syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*(" endif -if exists("perl_sync_dist") +if get(g:, 'perl_sync_dist', 0) execute "syn sync maxlines=" . perl_sync_dist else syn sync maxlines=100 diff --git a/runtime/syntax/perl6.vim b/runtime/syntax/perl6.vim deleted file mode 100644 index 3bcd9ff0e95b0..0000000000000 --- a/runtime/syntax/perl6.vim +++ /dev/null @@ -1,2242 +0,0 @@ -" Vim syntax file -" Language: Perl 6 -" Maintainer: vim-perl -" Homepage: http://github.com/vim-perl/vim-perl/tree/master -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 - -" Contributors: Luke Palmer -" Moritz Lenz -" Hinrik Örn Sigurðsson -" -" This is a big undertaking. Perl 6 is the sort of language that only Perl -" can parse. But I'll do my best to get vim to. -" -" You can associate the extension ".pl" with the filetype "perl6" by setting -" autocmd BufNewFile,BufRead *.pl setf perl6 -" in your ~/.vimrc. But that will infringe on Perl 5, so you might want to -" put a modeline near the beginning or end of your Perl 6 files instead: -" # vim: filetype=perl6 - -" TODO: -" * Deal with s:Perl5// -" * m:s// is a match, not a substitution -" * Make these highlight as strings, not operators: -" <==> <=:=> <===> <=~> <ÂĢ Âģ> ÂĢ>Âģ ÂĢ<Âģ -" * Allow more keywords to match as function calls(leave() is export(), etc) -" * Optimization: use nextgroup instead of lookaround (:help syn-nextgroup) -" * Fix s''' substitutions being matched as package names -" * Match s/// and m/// better, so things like "$s/" won't match -" * Add more support for folding (:help syn-fold) -" * Add more syntax syncing hooks (:help syn-sync) -" * Q//: -" :to, :heredoc -" interpolate \q:s{$scalar} (though the spec isn't very clear on it) -" -" Impossible TODO?: -" * Unspace -" * Unicode bracketing characters for quoting (there are so many) -" * Various tricks depending on context. I.e. we can't know when Perl -" expects ÂĢ*Âģ to be a string or a hyperoperator. The latter is presumably -" more common, so that's what we assume. -" * Selective highlighting of Pod formatting codes with the :allow option -" * Arbitrary number, order, and negation of adverbs to Q//, q//, qq//. -" Currently only the first adverb is considered significant. Anything -" more would require an exponential amount of regexes, making this -" already slow syntax file even slower. -" -" If you want to have Pir code inside Q:PIR// strings highlighted, do: -" let perl6_embedded_pir=1 -" -" The above requires pir.vim, which you can find in Parrot's repository: -" https://svn.parrot.org/parrot/trunk/editor/ -" -" Some less than crucial things have been made optional to speed things up. -" Look at the comments near the if/else branches in this file to see exactly -" which features are affected. "perl6_extended_all" enables everything. -" -" The defaults are: -" -" unlet perl6_extended_comments -" unlet perl6_extended_q -" unlet perl6_extended_all - -" quit when a syntax file was already loaded -if exists("b:current_syntax") - finish -endif -let s:keepcpo= &cpo -set cpo&vim - -" identifiers -syn match p6Normal display "\K\%(\k\|[-']\K\@=\)*" - -" This is used in the for loops below -" Don't use the "syn keyword" construct because that always has higher -" priority than matches/regions, so the words can't be autoquoted with -" the "=>" and "p5=>" operators. All the lookaround stuff is to make sure -" we don't match them as part of some other identifier. -let s:before_keyword = " display \"\\%(\\k\\|\\K\\@<=[-']\\)\\@.;\\]" -syn match p6Operator display "\%(:\@\)" -" "i" requires a digit to the left, and no keyword char to the right -syn match p6Operator display "\d\@<=i\k\@!" -" index overloading -syn match p6Operator display "\%(&\.(\@=\|@\.\[\@=\|%\.{\@=\)" - -" all infix operators except nonassocative ones -let s:infix_a = [ - \ "div % mod +& +< +> \\~& ?& \\~< \\~> +| +\\^ \\~| \\~\\^ ?| ?\\^ xx x", - \ "\\~ && & also <== ==> <<== ==>> == != < <= > >= \\~\\~ eq ne lt le gt", - \ "ge =:= === eqv before after \\^\\^ min max \\^ff ff\\^ \\^ff\\^", - \ "\\^fff fff\\^ \\^fff\\^ fff ff ::= := \\.= => , : p5=> Z minmax", - \ "\\.\\.\\. and andthen or orelse xor \\^ += -= /= \\*= \\~= //= ||=", - \ "+ - \\*\\* \\* // / \\~ || |", -\ ] -" nonassociative infix operators -let s:infix_n = "but does <=> leg cmp \\.\\. \\.\\.\\^\\^ \\^\\.\\. \\^\\.\\.\\^" - -let s:infix_a_long = join(s:infix_a, " ") -let s:infix_a_words = split(s:infix_a_long) -let s:infix_a_pattern = join(s:infix_a_words, "\\|") - -let s:infix_n_words = split(s:infix_n) -let s:infix_n_pattern = join(s:infix_n_words, "\\|") - -let s:both = [s:infix_a_pattern, s:infix_n_pattern] -let s:infix = join(s:both, "\\|") - -let s:infix_assoc = "!\\?\\%(" . s:infix_a_pattern . "\\)" -let s:infix = "!\\?\\%(" . s:infix . "\\)" - -unlet s:infix_a s:infix_a_long s:infix_a_words s:infix_a_pattern -unlet s:infix_n s:infix_n_pattern s:both - -" [+] reduce -exec "syn match p6ReduceOp display \"\\k\\@" - -" does is a type constraint sometimes -syn match p6TypeConstraint display "does\%(\s*\%(\k\|[-']\K\@=\)\)\@=" - -" int is a type sometimes -syn match p6Type display "\\%(\s*(\|\s\+\d\)\@!" - -" these Routine names are also Properties, if preceded by "is" -syn match p6Property display "\%(is\s\+\)\@<=\%(signature\|context\|also\|shape\)" - -" The sigil in ::*Package -syn match p6PackageTwigil display "\%(::\)\@<=\*" - -" $ -syn region p6MatchVarSigil - \ matchgroup=p6Variable - \ start="\$\%(<<\@!\)\@=" - \ end=">\@<=" - \ contains=p6MatchVar - -syn region p6MatchVar - \ matchgroup=p6Twigil - \ start="<" - \ end=">" - \ contained - -" Contextualizers -syn match p6Context display "\<\%(item\|list\|slice\|hash\)\>" -syn match p6Context display "\%(\$\|@\|%\|&\|@@\)(\@=" - -" the "$" placeholder in "$var1, $, var2 = @list" -syn match p6Placeholder display "\%(,\s*\)\@<=\$\%(\K\|\%([.^*?=!~]\|:\@]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)\)" - \ start="\ze\z(\$\%(\%(\%(\%([.^*?=!~]\|:\@]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)\)" - \ end="\z1\zs" - \ contained - \ contains=TOP - \ keepend - -syn region p6InterpArray - \ matchgroup=p6Context - \ start="@\ze()\@!" - \ start="@@\ze()\@!" - \ skip="([^)]*)" - \ end=")\zs" - \ contained - \ contains=TOP - -syn region p6InterpHash - \ start="\ze\z(%\$*\%(\%(\%(!\|/\|Âĸ\)\|\%(\%(\%([.^*?=!~]\|:\@]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)\)" - \ end="\z1\zs" - \ contained - \ contains=TOP - \ keepend - -syn region p6InterpHash - \ matchgroup=p6Context - \ start="%\ze()\@!" - \ skip="([^)]*)" - \ end=")\zs" - \ contained - \ contains=TOP - -syn region p6InterpFunction - \ start="\ze\z(&\%(\%(!\|/\|Âĸ\)\|\%(\%(\%([.^*?=!~]\|:\@]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\)\)" - \ end="\z1\zs" - \ contained - \ contains=TOP - \ keepend - -syn region p6InterpFunction - \ matchgroup=p6Context - \ start="&\ze()\@!" - \ skip="([^)]*)" - \ end=")\zs" - \ contained - \ contains=TOP - -syn region p6InterpClosure - \ start="\\\@" contained -syn match p6EscCloseFrench display "\\Âģ" contained -syn match p6EscBackTick display "\\`" contained -syn match p6EscForwardSlash display "\\/" contained -syn match p6EscVerticalBar display "\\|" contained -syn match p6EscExclamation display "\\!" contained -syn match p6EscComma display "\\," contained -syn match p6EscDollar display "\\\$" contained -syn match p6EscCloseCurly display "\\}" contained -syn match p6EscCloseBracket display "\\\]" contained - -" misc escapes -syn match p6EscOctOld display "\\\d\{1,3}" contained -syn match p6EscNull display "\\0\d\@!" contained -syn match p6EscCodePoint display "\%(\\c\)\@<=\%(\d\|\S\|\[\)\@=" contained nextgroup=p6CodePoint -syn match p6EscHex display "\%(\\x\)\@<=\%(\x\|\[\)\@=" contained nextgroup=p6HexSequence -syn match p6EscOct display "\%(\\o\)\@<=\%(\o\|\[\)\@=" contained nextgroup=p6OctSequence -syn match p6EscQQ display "\\qq" contained nextgroup=p6QQSequence -syn match p6EscOpenCurly display "\\{" contained -syn match p6EscHash display "\\#" contained -syn match p6EscBackSlash display "\\\\" contained - -syn region p6QQSequence - \ matchgroup=p6Escape - \ start="\[" - \ skip="\[[^\]]*]" - \ end="]" - \ contained - \ transparent - \ contains=@p6Interp_qq - -syn match p6CodePoint display "\%(\d\+\|\S\)" contained -syn region p6CodePoint - \ matchgroup=p6Escape - \ start="\[" - \ end="]" - \ contained - -syn match p6HexSequence display "\x\+" contained -syn region p6HexSequence - \ matchgroup=p6Escape - \ start="\[" - \ end="]" - \ contained - -syn match p6OctSequence display "\o\+" contained -syn region p6OctSequence - \ matchgroup=p6Escape - \ start="\[" - \ end="]" - \ contained - -" matches :key, :!key, :$var, :key, etc -" Since we don't know in advance how the adverb ends, we use a trick. -" Consume nothing with the start pattern (\ze at the beginning), -" while capturing the whole adverb into \z1 and then putting it before -" the match start (\zs) of the end pattern. -syn region p6Adverb - \ start="\ze\z(:!\?\K\%(\k\|[-']\K\@=\)*\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\?\)" - \ start="\ze\z(:!\?[@$%]\$*\%(::\|\%(\$\@<=\d\+\|!\|/\|Âĸ\)\|\%(\%([.^*?=!~]\|:\@ -" FIXME: not sure how to distinguish this from the "less than" operator -" in all cases. For now, it matches if any of the following is true: -" -" * There is whitespace missing on either side of the "<", since -" people tend to put spaces around "less than" -" * It comes after "enum", "for", "any", "all", or "none" -" * It's the first or last thing on a line (ignoring whitespace) -" * It's preceded by "= " -" -" It never matches when: -" -" * Preceded by [<+~=] (e.g. <>, =<$foo>) -" * Followed by [-=] (e.g. <--, <=, <==) -syn region p6StringAngle - \ matchgroup=p6Quote - \ start="\%(\<\%(enum\|for\|any\|all\|none\)\>\s*(\?\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!" - \ start="\%(\s\|[<+~=]\)\@\|[-=]\{1,2}>\@!\)\@!" - \ start="[<+~=]\@\|[-=]\{1,2}>\@!\)\@!" - \ start="\%(^\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!" - \ start="[<+~=]\@\|[-=]\{1,2}>\@!\)\@!" - \ skip="\\\@" - \ end=">" - \ contains=p6InnerAnglesOne,p6EscBackSlash,p6EscCloseAngle - -syn region p6InnerAnglesOne - \ matchgroup=p6StringAngle - \ start="<" - \ skip="\\\@" - \ end=">" - \ transparent - \ contained - \ contains=p6InnerAnglesOne - -" <> -syn region p6StringAngles - \ matchgroup=p6Quote - \ start="<<=\@!" - \ skip="\\\@" - \ end=">>" - \ contains=p6InnerAnglesTwo,@p6Interp_qq,p6Comment,p6EscHash,p6EscCloseAngle,p6Adverb,p6StringSQ,p6StringDQ - -syn region p6InnerAnglesTwo - \ matchgroup=p6StringAngles - \ start="<<" - \ skip="\\\@" - \ end=">>" - \ transparent - \ contained - \ contains=p6InnerAnglesTwo - -" ÂĢwordsÂģ -syn region p6StringFrench - \ matchgroup=p6Quote - \ start="ÂĢ" - \ skip="\\\@" nextgroup=p6QPairs skipwhite skipempty -syn match p6QPairs contained transparent skipwhite skipempty nextgroup=p6StringQ,p6StringQ_PIR "\%(\_s*:!\?\K\%(\k\|[-']\K\@=\)*\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|ÂĢ[^Âģ]*Âģ\|{[^}]*}\)\?\)*" - -if exists("perl6_embedded_pir") - syn include @p6PIR syntax/pir.vim -endif - -" hardcoded set of delimiters -let s:delims = [ - \ ["\\\"", "\\\"", "p6EscDoubleQuote", "\\\\\\@", "p6EscCloseAngle", "\\%(\\\\\\@\\|<[^>]*>\\)"], - \ ["ÂĢ", "Âģ", "p6EscCloseFrench", "\\%(\\\\\\@>", "p6EscCloseAngle", "\\%(\\\\\\@>\\|<<\\%([^>]\\|>>\\@!\\)*>>\\)"]) - call add(s:delims, ["\\s\\@<=<<<", ">>>", "p6EscCloseAngle", "\\%(\\\\\\@>>\\|<<<\\%([^>]\\|>\\%(>>\\)\\@!\\)*>>>\\)"]) -endif - -if !exists("perl6_extended_q") && !exists("perl6_extended_all") - " simple version, no special highlighting within the string - for [start_delim, end_delim, end_group, skip] in s:delims - exec "syn region p6StringQ matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=".end_group." contained" - endfor - - if exists("perl6_embedded_pir") - " highlight embedded PIR code - for [start_delim, end_delim, end_group, skip] in s:delims - exec "syn region p6StringQ_PIR matchgroup=p6Quote start=\"\\%(Q\\s*:PIR\\s*\\)\\@<=".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6PIR,".end_group." contained" - endfor - endif -else - let s:before = "syn region p6StringQ matchgroup=p6Quote start=\"\\%(" - let s:after = "\\%(\\_s*:!\\?\\K\\%(\\k\\|[-']\\K\\@=\\)*\\%(([^)]*)\\|\\[[^\\]]*]\\|<[^>]*>\\|ÂĢ[^Âģ]*Âģ\\|{[^}]*}\\)\\?\\)*\\_s*\\)\\@<=" - - let s:adverbs = [ - \ ["s", "scalar"], - \ ["a", "array"], - \ ["h", "hash"], - \ ["f", "function"], - \ ["c", "closure"], - \ ["b", "backslash"], - \ ["w", "words"], - \ ["ww", "quotewords"], - \ ["x", "exec"], - \ ] - - " these can't be conjoined with q and qq (e.g. as qqq and qqqq) - let s:q_adverbs = [ - \ ["q", "single"], - \ ["qq", "double"], - \ ] - - for [start_delim, end_delim, end_group, skip] in s:delims - " Q, q, and qq with any number of (ignored) adverbs - exec s:before ."Q". s:after .start_delim."\" end=\"". end_delim ."\""." contained" - exec s:before ."q". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q"." contained" - exec s:before ."qq". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq"." contained" - - for [short, long] in s:adverbs - " Qs, qs, qqs, Qa, qa, qqa, etc, with ignored adverbs - exec s:before ."Q".short. s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long." contained" - exec s:before ."q".short. s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long." contained" - exec s:before ."qq".short. s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long." contained" - - " Q, q, and qq, with one significant adverb - exec s:before ."Q\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long." contained" - for [q_short, q_long] in s:q_adverbs - exec s:before ."Q\\s*:\\%(".q_short."\\|".q_long."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".q_long." contained" - endfor - exec s:before ."q\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long." contained" - exec s:before ."qq\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long." contained" - - for [short2, long2] in s:adverbs - " Qs, qs, qqs, Qa, qa, qqa, etc, with one significant adverb - exec s:before ."Q".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long.",@p6Interp_".long2." contained" - for [q_short2, q_long2] in s:q_adverbs - exec s:before ."Q".short."\\s*:\\%(".q_short2."\\|".q_long2."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long.",@p6Interp_".q_long2." contained" - endfor - exec s:before ."q".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long.",@p6Interp_".long2." contained" - exec s:before ."qq".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long.",@p6Interp_".long2." contained" - endfor - endfor - endfor - unlet s:before s:after s:adverbs s:q_adverbs -endif -unlet s:delims - -" Match these so something else above can't. E.g. the "q" in "role q { }" -" should not be considered a string -syn match p6Normal display "\%(\<\%(role\|grammar\|slang\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*" - -" :key -syn match p6Operator display ":\@ and p5=> autoquoting -syn match p6StringP5Auto display "\K\%(\k\|[-']\K\@=\)*\ze\s\+p5=>" -syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*\ze\%(p5\)\@" -syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*\ze\s\+=>" -syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*p5\ze=>" - -" Hyperoperators. Needs to come after the quoting operators (<>, ÂĢÂģ, etc) -exec "syn match p6HyperOp display \"Âģ" .s:infix."Âģ\\?\"" -exec "syn match p6HyperOp display \"ÂĢ\\?".s:infix."ÂĢ\"" -exec "syn match p6HyperOp display \"Âģ" .s:infix."ÂĢ\"" -exec "syn match p6HyperOp display \"ÂĢ" .s:infix. "Âģ\"" - -exec "syn match p6HyperOp display \">>" .s:infix."\\%(>>\\)\\?\"" -exec "syn match p6HyperOp display \"\\%(<<\\)\\?".s:infix."<<\"" -exec "syn match p6HyperOp display \">>" .s:infix."<<\"" -exec "syn match p6HyperOp display \"<<" .s:infix.">>\"" -unlet s:infix - -" Regexes and grammars - -syn match p6RegexName display "\%(\<\%(regex\|rule\|token\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*" nextgroup=p6RegexBlockCrap skipwhite skipempty -syn match p6RegexBlockCrap "[^{]*" nextgroup=p6RegexBlock skipwhite skipempty transparent contained - -syn region p6RegexBlock - \ matchgroup=p6Normal - \ start="{" - \ end="}" - \ contained - \ contains=@p6Regexen,@p6Variables - -" Perl 6 regex bits - -syn cluster p6Regexen - \ add=p6RxMeta - \ add=p6RxEscape - \ add=p6EscHex - \ add=p6EscOct - \ add=p6EscNull - \ add=p6RxAnchor - \ add=p6RxCapture - \ add=p6RxGroup - \ add=p6RxAlternation - \ add=p6RxAdverb - \ add=p6RxAdverbArg - \ add=p6RxStorage - \ add=p6RxAssertion - \ add=p6RxQuoteWords - \ add=p6RxClosure - \ add=p6RxStringSQ - \ add=p6RxStringDQ - \ add=p6Comment - -syn match p6RxMeta display contained ".\%(\k\|\s\)\@" - \ contained - \ contains=@p6Regexen,@p6Variables,p6RxCharClass,p6RxAssertCall -syn region p6RxAssertCall - \ matchgroup=p6Normal - \ start="\%(::\|\%(\K\%(\k\|[-']\K\@=\)*\)\)\@<=(\@=" - \ end=")\@<=" - \ contained - \ contains=TOP -syn region p6RxCharClass - \ matchgroup=p6StringSpecial2 - \ start="\%(<[-!+?]\?\)\@<=\[" - \ skip="\\]" - \ end="]" - \ contained - \ contains=p6RxRange,p6RxEscape,p6EscHex,p6EscOct,p6EscNull -syn region p6RxQuoteWords - \ matchgroup=p6StringSpecial2 - \ start="< " - \ end=">" - \ contained -syn region p6RxAdverb - \ start="\ze\z(:!\?\K\%(\k\|[-']\K\@=\)*\)" - \ end="\z1\zs" - \ contained - \ contains=TOP - \ keepend -syn region p6RxAdverbArg - \ start="\%(:!\?\K\%(\k\|[-']\K\@=\)*\)\@<=(" - \ skip="([^)]*)" - \ end=")" - \ contained - \ contains=TOP -syn region p6RxStorage - \ matchgroup=p6Operator - \ start="\%(^\s*\)\@<=:\%(my\>\|temp\>\)\@=" - \ end="$" - \ contains=TOP - \ contained - -" Perl 5 regex bits - -syn cluster p6RegexP5Base - \ add=p6RxP5Escape - \ add=p6RxP5Oct - \ add=p6RxP5Hex - \ add=p6RxP5EscMeta - \ add=p6RxP5CodePoint - \ add=p6RxP5Prop - -" normal regex stuff -syn cluster p6RegexP5 - \ add=@p6RegexP5Base - \ add=p6RxP5Quantifier - \ add=p6RxP5Meta - \ add=p6RxP5QuoteMeta - \ add=p6RxP5ParenMod - \ add=p6RxP5Verb - \ add=p6RxP5Count - \ add=p6RxP5Named - \ add=p6RxP5ReadRef - \ add=p6RxP5WriteRef - \ add=p6RxP5CharClass - \ add=p6RxP5Anchor - -" inside character classes -syn cluster p6RegexP5Class - \ add=@p6RegexP5Base - \ add=p6RxP5Posix - \ add=p6RxP5Range - -syn match p6RxP5Escape display contained "\\\S" -syn match p6RxP5CodePoint display contained "\\c\S\@=" nextgroup=p6RxP5CPId -syn match p6RxP5CPId display contained "\S" -syn match p6RxP5Oct display contained "\\\%(\o\{1,3}\)\@=" nextgroup=p6RxP5OctSeq -syn match p6RxP5OctSeq display contained "\o\{1,3}" -syn match p6RxP5Anchor display contained "[\^$]" -syn match p6RxP5Hex display contained "\\x\%({\x\+}\|\x\{1,2}\)\@=" nextgroup=p6RxP5HexSeq -syn match p6RxP5HexSeq display contained "\x\{1,2}" -syn region p6RxP5HexSeq - \ matchgroup=p6RxP5Escape - \ start="{" - \ end="}" - \ contained -syn region p6RxP5Named - \ matchgroup=p6RxP5Escape - \ start="\%(\\N\)\@<={" - \ end="}" - \ contained -syn match p6RxP5Quantifier display contained "\%([+*]\|(\@" - \ contained -syn match p6RxP5WriteRef display contained "\\g\%(\d\|{\)\@=" nextgroup=p6RxP5WriteRefId -syn match p6RxP5WriteRefId display contained "\d\+" -syn region p6RxP5WriteRefId - \ matchgroup=p6RxP5Escape - \ start="{" - \ end="}" - \ contained -syn match p6RxP5Prop display contained "\\[pP]\%(\a\|{\)\@=" nextgroup=p6RxP5PropId -syn match p6RxP5PropId display contained "\a" -syn region p6RxP5PropId - \ matchgroup=p6RxP5Escape - \ start="{" - \ end="}" - \ contained -syn match p6RxP5Meta display contained "[(|).]" -syn match p6RxP5ParenMod display contained "(\@<=?\@=" nextgroup=p6RxP5Mod,p6RxP5ModName,p6RxP5Code -syn match p6RxP5Mod display contained "?\%(<\?=\|<\?!\|[#:|]\)" -syn match p6RxP5Mod display contained "?-\?[impsx]\+" -syn match p6RxP5Mod display contained "?\%([-+]\?\d\+\|R\)" -syn match p6RxP5Mod display contained "?(DEFINE)" -syn match p6RxP5Mod display contained "?\%(&\|P[>=]\)" nextgroup=p6RxP5ModDef -syn match p6RxP5ModDef display contained "\h\w*" -syn region p6RxP5ModName - \ matchgroup=p6StringSpecial - \ start="?'" - \ end="'" - \ contained -syn region p6RxP5ModName - \ matchgroup=p6StringSpecial - \ start="?P\?<" - \ end=">" - \ contained -syn region p6RxP5Code - \ matchgroup=p6StringSpecial - \ start="??\?{" - \ end="})\@=" - \ contained - \ contains=TOP -syn match p6RxP5EscMeta display contained "\\[?*.{}()[\]|\^$]" -syn match p6RxP5Count display contained "\%({\d\+\%(,\%(\d\+\)\?\)\?}\)\@=" nextgroup=p6RxP5CountId -syn region p6RxP5CountId - \ matchgroup=p6RxP5Escape - \ start="{" - \ end="}" - \ contained -syn match p6RxP5Verb display contained "(\@<=\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\?\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\?\|ACCEPT\)" -syn region p6RxP5QuoteMeta - \ matchgroup=p6RxP5Escape - \ start="\\Q" - \ end="\\E" - \ contained - \ contains=@p6Variables,p6EscBackSlash -syn region p6RxP5CharClass - \ matchgroup=p6StringSpecial - \ start="\[\^\?" - \ skip="\\]" - \ end="]" - \ contained - \ contains=@p6RegexP5Class -syn region p6RxP5Posix - \ matchgroup=p6RxP5Escape - \ start="\[:" - \ end=":]" - \ contained -syn match p6RxP5Range display contained "-" - -" 'string' inside a regex -syn region p6RxStringSQ - \ matchgroup=p6Quote - \ start="'" - \ skip="\\\@, mm, rx -syn region p6Match - \ matchgroup=p6Quote - \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@\@!>\@!" - \ skip="\\>" - \ end=">" - \ contains=@p6Regexen,@p6Variables - -" mÂĢfooÂģ, mmÂĢfooÂģ, rxÂĢfooÂģ -syn region p6Match - \ matchgroup=p6Quote - \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@ -syn region p6Match - \ matchgroup=p6Quote - \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@\@!" - \ skip="\\>" - \ end=">" - \ contains=@p6Regexen,@p6Variables - -" sÂĢfooÂģ -syn region p6Match - \ matchgroup=p6Quote - \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@ -syn region p6Match - \ matchgroup=p6Quote - \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@\@!" - \ skip="\\>" - \ end=">" - \ contains=@p6RegexP5,p6Variables - -" m:P5ÂĢÂģ -syn region p6Match - \ matchgroup=p6Quote - \ start="\%(\%(::\|[$@%&][.!^:*?]\?\|\.\)\@]*>" - \ end=">" - \ matchgroup=p6Error - \ start="^#<" - \ contains=p6Attention,p6Comment -syn region p6Comment - \ matchgroup=p6Comment - \ start="^\@]\|>>\@!\)*>>" - \ end=">>" - \ matchgroup=p6Error - \ start="^#<<" - \ contains=p6Attention,p6Comment - syn region p6Comment - \ matchgroup=p6Comment - \ start="^\@]\|>\%(>>\)\@!\)*>>>" - \ end=">>>" - \ matchgroup=p6Error - \ start="^#<<<" - \ contains=p6Attention,p6Comment - - syn region p6Comment - \ matchgroup=p6Comment - \ start="^\@" - \ end="^\ze\%(\s*$\|=\K\)" - \ contains=p6PodAbbrCodeType - \ keepend - -syn region p6PodAbbrCodeType - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=p6PodName,p6PodAbbrCode - -syn region p6PodAbbrCode - \ start="^" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - -" Abbreviated blocks (everything is a comment) -syn region p6PodAbbrRegion - \ matchgroup=p6PodPrefix - \ start="^=\zecomment\>" - \ end="^\ze\%(\s*$\|=\K\)" - \ contains=p6PodAbbrCommentType - \ keepend - -syn region p6PodAbbrCommentType - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=p6PodComment,p6PodAbbrNoCode - -" Abbreviated blocks (implicit code allowed) -syn region p6PodAbbrRegion - \ matchgroup=p6PodPrefix - \ start="^=\ze\%(pod\|item\|nested\|\u\+\)\>" - \ end="^\ze\%(\s*$\|=\K\)" - \ contains=p6PodAbbrType - \ keepend - -syn region p6PodAbbrType - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=p6PodName,p6PodAbbr - -syn region p6PodAbbr - \ start="^" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=@p6PodFormat,p6PodImplicitCode - -" Abbreviated block to end-of-file -syn region p6PodAbbrRegion - \ matchgroup=p6PodPrefix - \ start="^=\zeEND\>" - \ end="\%$" - \ contains=p6PodAbbrEOFType - \ keepend - -syn region p6PodAbbrEOFType - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="\%$" - \ contained - \ contains=p6PodName,p6PodAbbrEOF - -syn region p6PodAbbrEOF - \ start="^" - \ end="\%$" - \ contained - \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode - -" Directives -syn region p6PodDirectRegion - \ matchgroup=p6PodPrefix - \ start="^=\%(config\|use\)\>" - \ end="^\ze\%([^=]\|=\K\|\s*$\)" - \ contains=p6PodDirectArgRegion - \ keepend - -syn region p6PodDirectArgRegion - \ matchgroup=p6PodType - \ start="\S\+" - \ end="^\ze\%([^=]\|=\K\|\s*$\)" - \ contained - \ contains=p6PodDirectConfigRegion - -syn region p6PodDirectConfigRegion - \ start="" - \ end="^\ze\%([^=]\|=\K\|\s*$\)" - \ contained - \ contains=@p6PodConfig - -" =encoding is a special directive -syn region p6PodDirectRegion - \ matchgroup=p6PodPrefix - \ start="^=encoding\>" - \ end="^\ze\%([^=]\|=\K\|\s*$\)" - \ contains=p6PodEncodingArgRegion - \ keepend - -syn region p6PodEncodingArgRegion - \ matchgroup=p6PodName - \ start="\S\+" - \ end="^\ze\%([^=]\|=\K\|\s*$\)" - \ contained - -" Paragraph blocks (implicit code forbidden) -syn region p6PodParaRegion - \ matchgroup=p6PodPrefix - \ start="^=for\>" - \ end="^\ze\%(\s*$\|=\K\)" - \ contains=p6PodParaNoCodeTypeRegion - \ keepend - \ extend - -syn region p6PodParaNoCodeTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=p6PodParaNoCode,p6PodParaConfigRegion - -syn region p6PodParaConfigRegion - \ start="" - \ end="^\ze\%([^=]\|=\k\@\ze\s*code\>" - \ end="^\ze\%(\s*$\|=\K\)" - \ contains=p6PodParaCodeTypeRegion - \ keepend - \ extend - -syn region p6PodParaCodeTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=p6PodParaCode,p6PodParaConfigRegion - -syn region p6PodParaCode - \ start="^[^=]" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - -" Paragraph blocks (implicit code allowed) -syn region p6PodParaRegion - \ matchgroup=p6PodPrefix - \ start="^=for\>\ze\s*\%(pod\|item\|nested\|\u\+\)\>" - \ end="^\ze\%(\s*$\|=\K\)" - \ contains=p6PodParaTypeRegion - \ keepend - \ extend - -syn region p6PodParaTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=p6PodPara,p6PodParaConfigRegion - -syn region p6PodPara - \ start="^[^=]" - \ end="^\ze\%(\s*$\|=\K\)" - \ contained - \ contains=@p6PodFormat,p6PodImplicitCode - -" Paragraph block to end-of-file -syn region p6PodParaRegion - \ matchgroup=p6PodPrefix - \ start="^=for\>\ze\s\+END\>" - \ end="\%$" - \ contains=p6PodParaEOFTypeRegion - \ keepend - \ extend - -syn region p6PodParaEOFTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="\%$" - \ contained - \ contains=p6PodParaEOF,p6PodParaConfigRegion - -syn region p6PodParaEOF - \ start="^[^=]" - \ end="\%$" - \ contained - \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode - -" Delimited blocks (implicit code forbidden) -syn region p6PodDelimRegion - \ matchgroup=p6PodPrefix - \ start="^=begin\>" - \ end="^=end\>" - \ contains=p6PodDelimNoCodeTypeRegion - \ keepend - \ extend - -syn region p6PodDelimNoCodeTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze=end\>" - \ contained - \ contains=p6PodDelimNoCode,p6PodDelimConfigRegion - -syn region p6PodDelimConfigRegion - \ start="" - \ end="^\ze\%([^=]\|=\K\|\s*$\)" - \ contained - \ contains=@p6PodConfig - -syn region p6PodDelimNoCode - \ start="^" - \ end="^\ze=end\>" - \ contained - \ contains=@p6PodNestedBlocks,@p6PodFormat - -" Delimited blocks (everything is code) -syn region p6PodDelimRegion - \ matchgroup=p6PodPrefix - \ start="^=begin\>\ze\s*code\>" - \ end="^=end\>" - \ contains=p6PodDelimCodeTypeRegion - \ keepend - \ extend - -syn region p6PodDelimCodeTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze=end\>" - \ contained - \ contains=p6PodDelimCode,p6PodDelimConfigRegion - -syn region p6PodDelimCode - \ start="^" - \ end="^\ze=end\>" - \ contained - \ contains=@p6PodNestedBlocks - -" Delimited blocks (implicit code allowed) -syn region p6PodDelimRegion - \ matchgroup=p6PodPrefix - \ start="^=begin\>\ze\s*\%(pod\|item\|nested\|\u\+\)\>" - \ end="^=end\>" - \ contains=p6PodDelimTypeRegion - \ keepend - \ extend - -syn region p6PodDelimTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="^\ze=end\>" - \ contained - \ contains=p6PodDelim,p6PodDelimConfigRegion - -syn region p6PodDelim - \ start="^" - \ end="^\ze=end\>" - \ contained - \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode - -" Delimited block to end-of-file -syn region p6PodDelimRegion - \ matchgroup=p6PodPrefix - \ start="^=begin\>\ze\s\+END\>" - \ end="\%$" - \ contains=p6PodDelimEOFTypeRegion - \ extend - -syn region p6PodDelimEOFTypeRegion - \ matchgroup=p6PodType - \ start="\K\k*" - \ end="\%$" - \ contained - \ contains=p6PodDelimEOF,p6PodDelimConfigRegion - -syn region p6PodDelimEOF - \ start="^" - \ end="\%$" - \ contained - \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode - -syn cluster p6PodConfig - \ add=p6PodConfigOperator - \ add=p6PodExtraConfig - \ add=p6StringAuto - \ add=p6PodAutoQuote - \ add=p6StringSQ - -syn region p6PodParens - \ start="(" - \ end=")" - \ contained - \ contains=p6Number,p6StringSQ - -syn match p6PodAutoQuote display contained "=>" -syn match p6PodConfigOperator display contained ":!\?" nextgroup=p6PodConfigOption -syn match p6PodConfigOption display contained "[^[:space:](<]\+" nextgroup=p6PodParens,p6StringAngle -syn match p6PodExtraConfig display contained "^=" -syn match p6PodVerticalBar display contained "|" -syn match p6PodColon display contained ":" -syn match p6PodSemicolon display contained ";" -syn match p6PodComma display contained "," -syn match p6PodImplicitCode display contained "^\s.*" - -syn region p6PodDelimEndRegion - \ matchgroup=p6PodType - \ start="\%(^=end\>\)\@<=" - \ end="\K\k*" - -" These may appear inside delimited blocks -syn cluster p6PodNestedBlocks - \ add=p6PodAbbrRegion - \ add=p6PodDirectRegion - \ add=p6PodParaRegion - \ add=p6PodDelimRegion - \ add=p6PodDelimEndRegion - -" Pod formatting codes - -syn cluster p6PodFormat - \ add=p6PodFormatOne - \ add=p6PodFormatTwo - \ add=p6PodFormatThree - \ add=p6PodFormatFrench - -" Balanced angles found inside formatting codes. Ensures proper nesting. - -syn region p6PodFormatAnglesOne - \ matchgroup=p6PodFormat - \ start="<" - \ skip="<[^>]*>" - \ end=">" - \ transparent - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne - -syn region p6PodFormatAnglesTwo - \ matchgroup=p6PodFormat - \ start="<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ transparent - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo - -syn region p6PodFormatAnglesThree - \ matchgroup=p6PodFormat - \ start="<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ transparent - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo,p6PodFormatAnglesThree - -syn region p6PodFormatAnglesFrench - \ matchgroup=p6PodFormat - \ start="ÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ transparent - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo,p6PodFormatAnglesThree - -" All formatting codes - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="\u<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="\u<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="\u<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="\uÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree - -" C<> and V<> don't allow nested formatting formatting codes - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="[CV]<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="[CV]<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAnglesTwo - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="[CV]<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="[CV]ÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench - -" L<> can have a "|" separator - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="L<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="L<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="L<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="LÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar - -" E<> can have a ";" separator - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="E<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodSemiColon - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="E<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodSemiColon - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="E<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodSemiColon - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="EÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodSemiColon - -" M<> can have a ":" separator - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="M<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodColon - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="M<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodColon - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="M<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodColon - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="MÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodColon - -" D<> can have "|" and ";" separators - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="D<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar,p6PodSemiColon - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="D<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAngleTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar,p6PodSemiColon - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="D<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="DÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon - -" X<> can have "|", "," and ";" separators - -syn region p6PodFormatOne - \ matchgroup=p6PodFormatCode - \ start="X<" - \ skip="<[^>]*>" - \ end=">" - \ contained - \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar,p6PodSemiColon,p6PodComma - -syn region p6PodFormatTwo - \ matchgroup=p6PodFormatCode - \ start="X<<" - \ skip="<<[^>]*>>" - \ end=">>" - \ contained - \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar,p6PodSemiColon,p6PodComma - -syn region p6PodFormatThree - \ matchgroup=p6PodFormatCode - \ start="X<<<" - \ skip="<<<[^>]*>>>" - \ end=">>>" - \ contained - \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon,p6PodComma - -syn region p6PodFormatFrench - \ matchgroup=p6PodFormatCode - \ start="XÂĢ" - \ skip="ÂĢ[^Âģ]*Âģ" - \ end="Âģ" - \ contained - \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon,p6PodComma - -" Define the default highlighting. -" Only when an item doesn't have highlighting yet - -hi def link p6EscOctOld p6Error -hi def link p6PackageTwigil p6Twigil -hi def link p6StringAngle p6String -hi def link p6StringFrench p6String -hi def link p6StringAngles p6String -hi def link p6StringSQ p6String -hi def link p6StringDQ p6String -hi def link p6StringQ p6String -hi def link p6RxStringSQ p6String -hi def link p6RxStringDQ p6String -hi def link p6Substitution p6String -hi def link p6Transliteration p6String -hi def link p6StringAuto p6String -hi def link p6StringP5Auto p6String -hi def link p6Key p6String -hi def link p6Match p6String -hi def link p6RegexBlock p6String -hi def link p6RxP5CharClass p6String -hi def link p6RxP5QuoteMeta p6String -hi def link p6RxCharClass p6String -hi def link p6RxQuoteWords p6String -hi def link p6ReduceOp p6Operator -hi def link p6ReverseCrossOp p6Operator -hi def link p6HyperOp p6Operator -hi def link p6QuoteQ p6Operator -hi def link p6RxRange p6StringSpecial -hi def link p6RxAnchor p6StringSpecial -hi def link p6RxP5Anchor p6StringSpecial -hi def link p6CodePoint p6StringSpecial -hi def link p6RxMeta p6StringSpecial -hi def link p6RxP5Range p6StringSpecial -hi def link p6RxP5CPId p6StringSpecial -hi def link p6RxP5Posix p6StringSpecial -hi def link p6RxP5Mod p6StringSpecial -hi def link p6RxP5HexSeq p6StringSpecial -hi def link p6RxP5OctSeq p6StringSpecial -hi def link p6RxP5WriteRefId p6StringSpecial -hi def link p6HexSequence p6StringSpecial -hi def link p6OctSequence p6StringSpecial -hi def link p6RxP5Named p6StringSpecial -hi def link p6RxP5PropId p6StringSpecial -hi def link p6RxP5Quantifier p6StringSpecial -hi def link p6RxP5CountId p6StringSpecial -hi def link p6RxP5Verb p6StringSpecial -hi def link p6Escape p6StringSpecial2 -hi def link p6EscNull p6StringSpecial2 -hi def link p6EscHash p6StringSpecial2 -hi def link p6EscQQ p6StringSpecial2 -hi def link p6EscQuote p6StringSpecial2 -hi def link p6EscDoubleQuote p6StringSpecial2 -hi def link p6EscBackTick p6StringSpecial2 -hi def link p6EscForwardSlash p6StringSpecial2 -hi def link p6EscVerticalBar p6StringSpecial2 -hi def link p6EscExclamation p6StringSpecial2 -hi def link p6EscDollar p6StringSpecial2 -hi def link p6EscOpenCurly p6StringSpecial2 -hi def link p6EscCloseCurly p6StringSpecial2 -hi def link p6EscCloseBracket p6StringSpecial2 -hi def link p6EscCloseAngle p6StringSpecial2 -hi def link p6EscCloseFrench p6StringSpecial2 -hi def link p6EscBackSlash p6StringSpecial2 -hi def link p6RxEscape p6StringSpecial2 -hi def link p6RxCapture p6StringSpecial2 -hi def link p6RxAlternation p6StringSpecial2 -hi def link p6RxP5 p6StringSpecial2 -hi def link p6RxP5ReadRef p6StringSpecial2 -hi def link p6RxP5Oct p6StringSpecial2 -hi def link p6RxP5Hex p6StringSpecial2 -hi def link p6RxP5EscMeta p6StringSpecial2 -hi def link p6RxP5Meta p6StringSpecial2 -hi def link p6RxP5Escape p6StringSpecial2 -hi def link p6RxP5CodePoint p6StringSpecial2 -hi def link p6RxP5WriteRef p6StringSpecial2 -hi def link p6RxP5Prop p6StringSpecial2 - -hi def link p6Property Tag -hi def link p6Attention Todo -hi def link p6Type Type -hi def link p6Error Error -hi def link p6BlockLabel Label -hi def link p6Float Float -hi def link p6Normal Normal -hi def link p6Package Normal -hi def link p6PackageScope Normal -hi def link p6Number Number -hi def link p6VersionNum Number -hi def link p6String String -hi def link p6Repeat Repeat -hi def link p6Keyword Keyword -hi def link p6Pragma Keyword -hi def link p6Module Keyword -hi def link p6DeclareRoutine Keyword -hi def link p6VarStorage Special -hi def link p6FlowControl Special -hi def link p6NumberBase Special -hi def link p6Twigil Special -hi def link p6StringSpecial2 Special -hi def link p6VersionDot Special -hi def link p6Comment Comment -hi def link p6Include Include -hi def link p6Shebang PreProc -hi def link p6ClosureTrait PreProc -hi def link p6Routine Function -hi def link p6Operator Operator -hi def link p6Version Operator -hi def link p6Context Operator -hi def link p6Quote Delimiter -hi def link p6TypeConstraint PreCondit -hi def link p6Exception Exception -hi def link p6Placeholder Identifier -hi def link p6Variable Identifier -hi def link p6VarSlash Identifier -hi def link p6VarNum Identifier -hi def link p6VarExclam Identifier -hi def link p6VarMatch Identifier -hi def link p6VarName Identifier -hi def link p6MatchVar Identifier -hi def link p6RxP5ReadRefId Identifier -hi def link p6RxP5ModDef Identifier -hi def link p6RxP5ModName Identifier -hi def link p6Conditional Conditional -hi def link p6StringSpecial SpecialChar - -hi def link p6PodAbbr p6Pod -hi def link p6PodAbbrEOF p6Pod -hi def link p6PodAbbrNoCode p6Pod -hi def link p6PodAbbrCode p6PodCode -hi def link p6PodPara p6Pod -hi def link p6PodParaEOF p6Pod -hi def link p6PodParaNoCode p6Pod -hi def link p6PodParaCode p6PodCode -hi def link p6PodDelim p6Pod -hi def link p6PodDelimEOF p6Pod -hi def link p6PodDelimNoCode p6Pod -hi def link p6PodDelimCode p6PodCode -hi def link p6PodImplicitCode p6PodCode -hi def link p6PodExtraConfig p6PodPrefix -hi def link p6PodVerticalBar p6PodFormatCode -hi def link p6PodColon p6PodFormatCode -hi def link p6PodSemicolon p6PodFormatCode -hi def link p6PodComma p6PodFormatCode -hi def link p6PodFormatOne p6PodFormat -hi def link p6PodFormatTwo p6PodFormat -hi def link p6PodFormatThree p6PodFormat -hi def link p6PodFormatFrench p6PodFormat - -hi def link p6PodType Type -hi def link p6PodConfigOption String -hi def link p6PodCode PreProc -hi def link p6Pod Comment -hi def link p6PodComment Comment -hi def link p6PodAutoQuote Operator -hi def link p6PodConfigOperator Operator -hi def link p6PodPrefix Statement -hi def link p6PodName Identifier -hi def link p6PodFormatCode SpecialChar -hi def link p6PodFormat SpecialComment - - -" Syncing to speed up processing -"syn sync match p6SyncPod groupthere p6PodAbbrRegion "^=\K\k*\>" -"syn sync match p6SyncPod groupthere p6PodDirectRegion "^=\%(config\|use\|encoding\)\>" -"syn sync match p6SyncPod groupthere p6PodParaRegion "^=for\>" -"syn sync match p6SyncPod groupthere p6PodDelimRegion "^=begin\>" -"syn sync match p6SyncPod groupthere p6PodDelimEndRegion "^=end\>" - -" Let's just sync whole file, the other methods aren't reliable (or I don't -" know how to use them reliably) -syn sync fromstart - -setlocal foldmethod=syntax - -let b:current_syntax = "perl6" - -let &cpo = s:keepcpo -unlet s:keepcpo - -" vim:ts=8:sts=4:sw=4:expandtab:ft=vim diff --git a/runtime/syntax/php.vim b/runtime/syntax/php.vim index b10b0c6764d6f..80662d675092f 100644 --- a/runtime/syntax/php.vim +++ b/runtime/syntax/php.vim @@ -1,9 +1,11 @@ " Vim syntax file -" Language: php PHP 3/4/5/7 -" Maintainer: Jason Woofenden -" Last Change: Jun 20, 2018 -" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD -" Former Maintainers: Peter Hodge +" Language: php PHP 3/4/5/7/8 +" Maintainer: Tyson Andre +" Last Change: Sep 18, 2021 +" URL: https://github.com/TysonAndre/php-vim-syntax +" Former Maintainers: +" Jason Woofenden +" Peter Hodge " Debian VIM Maintainers " " Note: If you are using a colour terminal with dark background, you will @@ -11,10 +13,32 @@ " than the default colourscheme, because elflord's colours will better " highlight the break-points (Statements) in your code. " +" Note: This embeds a modified copy of the html.vim with (mostly) different symbols, +" in order to implement php_htmlInStrings=2 can work as expected and correctly parse +" ` +" Previous Maintainer Claudio Fleiner +" Repository https://notabug.org/jorgesumle/vim-html-syntax +" Last Change 2021 Mar 02 +" Included patch #7900 to fix comments +" Included patch #7916 to fix a few more things +" " Options: " Set to anything to enable: " php_sql_query SQL syntax highlighting inside strings " php_htmlInStrings HTML syntax highlighting inside strings +" +" By setting this to 2, this will use a local copy of +" HTML syntax highlighting instead of the official +" HTML syntax highlighting, and properly highlight +" `&]" + + " tags + syn region phpInnerHtmlString contained start=+"+ end=+"+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc + syn region phpInnerHtmlString contained start=+'+ end=+'+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc + syn match phpInnerHtmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@phpInnerHtmlPreproc + syn region phpInnerHtmlEndTag contained start=++ contains=phpInnerHtmlTagN,phpInnerHtmlTagError + syn region phpInnerHtmlTag contained start=+<[^/]+ end=+>+ fold contains=phpInnerHtmlTagN,phpInnerHtmlString,htmlArg,phpInnerHtmlValue,phpInnerHtmlTagError,phpInnerHtmlEvent,phpInnerHtmlCssDefinition,@phpInnerHtmlPreproc,@phpInnerHtmlArgCluster + syn match phpInnerHtmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@phpInnerHtmlTagNameCluster + syn match phpInnerHtmlTagN contained +]<"ms=s+1 + + + " special characters + syn match phpInnerHtmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" + + " Comments (the real ones or the old netscape ones) + if exists("html_wrong_comments") + syn region phpInnerHtmlComment start=+ + " Idem 8.2.4.43,44: Except and are parser errors + " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment + syn region phpInnerHtmlComment matchgroup=phpInnerHtmlComment start=+ is all right + syn match phpInnerHtmlCommentNested contained "\@!" + syn match phpInnerHtmlCommentError contained "[^>+ keepend + + " server-parsed commands + syn region phpInnerHtmlPreProc start=++ contains=phpInnerHtmlPreStmt,phpInnerHtmlPreError,phpInnerHtmlPreAttr + syn match phpInnerHtmlPreStmt contained "+ + \ end=++ + \ matchgroup=tsxCloseString end=+/>+ + \ fold + \ contains=tsxRegion,tsxCloseString,tsxCloseTag,tsxTag,tsxCommentInvalid,tsxFragment,tsxEscJs,@Spell + \ keepend + \ extend + +" <> +" s~~~~~~e +" A big start regexp borrowed from https://git.io/vDyxc +syntax region tsxFragment + \ start=+\(\((\|{\|}\|\[\|,\|&&\|||\|?\|:\|=\|=>\|\Wreturn\|^return\|\Wdefault\|^\|>\)\_s*\)\@<=<>+ + \ skip=++ + \ end=++ + \ fold + \ contains=tsxRegion,tsxCloseString,tsxCloseTag,tsxTag,tsxCommentInvalid,tsxFragment,tsxEscJs,@Spell + \ keepend + \ extend + +" +" ~~~~~~ +syntax match tsxCloseTag + \ +"']\+>+ + \ contained + \ contains=tsxTagName,tsxIntrinsicTagName + +syntax match tsxCloseTag ++ contained + +syntax match tsxCloseString + \ +/>+ + \ contained + +" +" ~~~~~~~~ +syntax match tsxCommentInvalid // display + +syntax region tsxBlockComment + \ contained + \ start="/\*" + \ end="\*/" + +syntax match tsxLineComment + \ "//.*$" + \ contained + \ display + +syntax cluster tsxComment contains=tsxBlockComment,tsxLineComment + +syntax match tsxEntity "&[^; \t]*;" contains=tsxEntityPunct +syntax match tsxEntityPunct contained "[&.;]" + +" +" ~~~ +syntax match tsxTagName + \ +["'* ]\++hs=s+1 + \ contained + \ nextgroup=tsxAttrib + \ skipwhite + \ display +syntax match tsxIntrinsicTagName + \ +[ +" ~~~ +syntax match tsxAttrib + \ +[a-zA-Z_][-0-9a-zA-Z_]*+ + \ nextgroup=tsxEqual skipwhite + \ contained + \ display + +" +" ~ +syntax match tsxEqual +=+ display contained + \ nextgroup=tsxString skipwhite + +" +" s~~~~~~e +syntax region tsxString contained start=+"+ end=+"+ contains=tsxEntity,@Spell display + +" +" s~~~~~~~~~~~~~~e +syntax region tsxEscJs + \ contained + \ contains=@typescriptValue,@tsxComment + \ matchgroup=typescriptBraces + \ start=+{+ + \ end=+}+ + \ extend + + +""""""""""""""""""""""""""""""""""""""""""""""""""" +" Source the part common with typescriptreact.vim +source :h/typescriptcommon.vim + + +syntax cluster typescriptExpression add=tsxRegion,tsxFragment + +hi def link tsxTag htmlTag +hi def link tsxTagName Function +hi def link tsxIntrinsicTagName htmlTagName +hi def link tsxString String +hi def link tsxNameSpace Function +hi def link tsxCommentInvalid Error +hi def link tsxBlockComment Comment +hi def link tsxLineComment Comment +hi def link tsxAttrib Type +hi def link tsxEscJs tsxEscapeJs +hi def link tsxCloseTag htmlTag +hi def link tsxCloseString Identifier + +let b:current_syntax = "typescriptreact" +if main_syntax == 'typescriptreact' + unlet main_syntax +endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/vb.vim b/runtime/syntax/vb.vim index 8ddb1efac39a6..607f6130ba3c8 100644 --- a/runtime/syntax/vb.vim +++ b/runtime/syntax/vb.vim @@ -1,9 +1,11 @@ " Vim syntax file -" Language: Visual Basic -" Maintainer: Tim Chase -" Former Maintainer: Robert M. Cortopassi -" (tried multiple times to contact, but email bounced) +" Language: Visual Basic +" Maintainer: Doug Kearns +" Former Maintainer: Tim Chase +" Former Maintainer: Robert M. Cortopassi +" (tried multiple times to contact, but email bounced) " Last Change: +" 2021 Nov 26 Incorporated additions from Doug Kearns " 2005 May 25 Synched with work by Thomas Barthel " 2004 May 30 Added a few keywords @@ -13,7 +15,7 @@ " quit when a syntax file was already loaded if exists("b:current_syntax") - finish + finish endif " VB is case insensitive @@ -233,7 +235,7 @@ syn keyword vbKeyword Public PublicNotCreateable OnNewProcessSingleUse syn keyword vbKeyword InSameProcessMultiUse GlobalMultiUse Resume Seek syn keyword vbKeyword Set Static Step String Time WithEvents -syn keyword vbTodo contained TODO +syn keyword vbTodo contained TODO "Datatypes syn keyword vbTypes Boolean Byte Currency Date Decimal Double Empty @@ -319,46 +321,54 @@ syn match vbNumber "\<\d\+\>" syn match vbNumber "\<\d\+\.\d*\>" "floating point number, starting with a dot syn match vbNumber "\.\d\+\>" -"syn match vbNumber "{[[:xdigit:]-]\+}\|&[hH][[:xdigit:]]\+&" -"syn match vbNumber ":[[:xdigit:]]\+" -"syn match vbNumber "[-+]\=\<\d\+\>" -syn match vbFloat "[-+]\=\<\d\+[eE][\-+]\=\d\+" -syn match vbFloat "[-+]\=\<\d\+\.\d*\([eE][\-+]\=\d\+\)\=" -syn match vbFloat "[-+]\=\<\.\d\+\([eE][\-+]\=\d\+\)\=" +"syn match vbNumber "{[[:xdigit:]-]\+}\|&[hH][[:xdigit:]]\+&" +"syn match vbNumber ":[[:xdigit:]]\+" +"syn match vbNumber "[-+]\=\<\d\+\>" +syn match vbFloat "[-+]\=\<\d\+[eE][\-+]\=\d\+" +syn match vbFloat "[-+]\=\<\d\+\.\d*\([eE][\-+]\=\d\+\)\=" +syn match vbFloat "[-+]\=\<\.\d\+\([eE][\-+]\=\d\+\)\=" -" String and Character contstants +" String and Character constants syn region vbString start=+"+ end=+"\|$+ syn region vbComment start="\(^\|\s\)REM\s" end="$" contains=vbTodo syn region vbComment start="\(^\|\s\)\'" end="$" contains=vbTodo -syn match vbLineNumber "^\d\+\(\s\|$\)" -syn match vbTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 +syn match vbLineLabel "^\h\w\+:" +syn match vbLineNumber "^\d\+\(:\|\s\|$\)" +syn match vbTypeSpecifier "\<\a\w*[@\$%&!#]"ms=s+1 syn match vbTypeSpecifier "#[a-zA-Z0-9]"me=e-1 +" Conditional Compilation +syn match vbPreProc "^#const\>" +syn region vbPreProc matchgroup=PreProc start="^#if\>" end="\" transparent contains=TOP +syn region vbPreProc matchgroup=PreProc start="^#elseif\>" end="\" transparent contains=TOP +syn match vbPreProc "^#else\>" +syn match vbPreProc "^#end\s*if\>" " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link vbBoolean Boolean -hi def link vbLineNumber Comment -hi def link vbComment Comment -hi def link vbConditional Conditional -hi def link vbConst Constant -hi def link vbDefine Constant -hi def link vbError Error -hi def link vbFunction Identifier -hi def link vbIdentifier Identifier -hi def link vbNumber Number -hi def link vbFloat Float -hi def link vbMethods PreProc -hi def link vbOperator Operator -hi def link vbRepeat Repeat -hi def link vbString String -hi def link vbStatement Statement -hi def link vbKeyword Statement -hi def link vbEvents Special -hi def link vbTodo Todo -hi def link vbTypes Type -hi def link vbTypeSpecifier Type - +hi def link vbBoolean Boolean +hi def link vbLineNumber Comment +hi def link vbLineLabel Comment +hi def link vbComment Comment +hi def link vbConditional Conditional +hi def link vbConst Constant +hi def link vbDefine Constant +hi def link vbError Error +hi def link vbFunction Identifier +hi def link vbIdentifier Identifier +hi def link vbNumber Number +hi def link vbFloat Float +hi def link vbMethods PreProc +hi def link vbOperator Operator +hi def link vbRepeat Repeat +hi def link vbString String +hi def link vbStatement Statement +hi def link vbKeyword Statement +hi def link vbEvents Special +hi def link vbTodo Todo +hi def link vbTypes Type +hi def link vbTypeSpecifier Type +hi def link vbPreProc PreProc let b:current_syntax = "vb" diff --git a/runtime/syntax/vhdl.vim b/runtime/syntax/vhdl.vim index efcb840284aba..06fc2e795e90b 100644 --- a/runtime/syntax/vhdl.vim +++ b/runtime/syntax/vhdl.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: VHDL [VHSIC (Very High Speed Integrated Circuit) Hardware Description Language] -" Maintainer: Daniel Kho +" Maintainer: Daniel Kho " Previous Maintainer: Czo " Credits: Stephan Hegel -" Last Changed: 2018 May 06 by Daniel Kho +" Last Changed: 2020 Apr 04 by Daniel Kho " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -16,10 +16,10 @@ set cpo&vim " case is not significant syn case ignore -" VHDL keywords -syn keyword vhdlStatement access after alias all assert +" VHDL 1076-2019 keywords +syn keyword vhdlStatement access after alias all syn keyword vhdlStatement architecture array attribute -syn keyword vhdlStatement assume assume_guarantee +syn keyword vhdlStatement assert assume syn keyword vhdlStatement begin block body buffer bus syn keyword vhdlStatement case component configuration constant syn keyword vhdlStatement context cover @@ -34,20 +34,19 @@ syn keyword vhdlStatement map syn keyword vhdlStatement new next null syn keyword vhdlStatement of on open others out syn keyword vhdlStatement package port postponed procedure process pure -syn keyword vhdlStatement parameter property protected +syn keyword vhdlStatement parameter property protected private syn keyword vhdlStatement range record register reject report return -syn keyword vhdlStatement release restrict restrict_guarantee -syn keyword vhdlStatement select severity signal shared -syn keyword vhdlStatement subtype +syn keyword vhdlStatement release restrict +syn keyword vhdlStatement select severity signal shared subtype syn keyword vhdlStatement sequence strong syn keyword vhdlStatement then to transport type syn keyword vhdlStatement unaffected units until use -syn keyword vhdlStatement variable -" VHDL-2017 interface -syn keyword vhdlStatement view -syn keyword vhdlStatement vmode vprop vunit +syn keyword vhdlStatement variable view +syn keyword vhdlStatement vpkg vmode vprop vunit syn keyword vhdlStatement wait when while with -syn keyword vhdlStatement note warning error failure + +" VHDL predefined severity levels +syn keyword vhdlAttribute note warning error failure " Linting of conditionals. syn match vhdlStatement "\<\(if\|else\)\>" @@ -124,7 +123,7 @@ syn match vhdlAttribute "\'succ" syn match vhdlAttribute "\'val" syn match vhdlAttribute "\'image" syn match vhdlAttribute "\'value" -" VHDL-2017 interface attribute +" VHDL-2019 interface attribute syn match vhdlAttribute "\'converse" syn keyword vhdlBoolean true false @@ -167,7 +166,7 @@ syn match vhdlOperator "=\|\/=\|>\|<\|>=" syn match vhdlOperator "<=\|:=" syn match vhdlOperator "=>" -" VHDL-2017 concurrent signal association (spaceship) operator +" VHDL-202x concurrent signal association (spaceship) operator syn match vhdlOperator "<=>" " VHDL-2008 conversion, matching equality/non-equality operators @@ -188,7 +187,7 @@ syn match vhdlError "\(<\)[&+\-\/\\]\+" syn match vhdlError "[>=&+\-\/\\]\+\(<\)" " Covers most operators " support negative sign after operators. E.g. q<=-b; -" Supports VHDL-2017 spaceship (concurrent simple signal association). +" Supports VHDL-202x spaceship (concurrent simple signal association). syn match vhdlError "\(<=\)[<=&+\*\\?:]\+" syn match vhdlError "[>=&+\-\*\\:]\+\(=>\)" syn match vhdlError "\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<=\|?>=\|>=\|:=\|=>\)[<>=&+\*\\?:]\+" @@ -265,4 +264,5 @@ let b:current_syntax = "vhdl" let &cpo = s:cpo_save unlet s:cpo_save + " vim: ts=8 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 78c9d26a59b55..22e372b6b0bed 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file -" Language: Vim 8.0 script -" Maintainer: Charles E. Campbell -" Last Change: July 18, 2019 -" Version: 8.0-23 +" Language: Vim 8.2 script +" Maintainer: Charles E. Campbell +" Last Change: Jun 16, 20222 +" Version: 8.2-46 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -19,41 +19,38 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 -syn keyword vimCommand contained a ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletl dep diffpu[t] dl dr[op] ec em[enu] ene[w] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] messages mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smenu snoremenu spelld[ump] spr[evious] srg st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tch[dir] tf[irst] tlmenu tm[enu] to[pleft] tu[nmenu] undol[ist] up[date] vi[sual] vmapc[lear] wa[ll] winp[os] wundo xme xr[estore] -syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] cle[arjumps] cnor comp[iler] cpf[ile] cun delc[ommand] deletp di[splay] diffs[plit] dli[st] ds[earch] echoe[rr] en[dif] ex filetype fix[del] for gui helpg[rep] ia in j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] smile so[urce] spelli[nfo] sr sri sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs tcld[o] th[row] tln tma[p] tp[revious] tunma[p] unh[ide] v vie[w] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme -syn keyword vimCommand contained abc[lear] argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do dsp[lit] echom[sg] endf[unction] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] inor ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sn[ext] sor[t] spellr[epall] srI srl star[tinsert] sts[elect] sv[iew] syncbind tab tabf[ind] tabnew tags tclf[ile] tj[ump] tlnoremenu tmapc[lear] tr[ewind] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu -syn keyword vimCommand contained abo[veleft] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delep dell diffg[et] dig[raphs] doau e[dit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi if intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] sno[magic] sp[lit] spellu[ndo] src srn startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] te[aroff] tl[ast] tlu tn[ext] try una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo -syn keyword vimCommand contained addd arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cn[ext] colo[rscheme] cons[t] cs d[elete] deletel delm[arks] diffo[ff] dir doaut ea el[se] endt[ry] f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoreme spe[llgood] spellw[rong] sre[wind] srp startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcd ter[minal] tlm tlunmenu tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank] -syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] com cope[n] cscope debug deletep delp diffp[atch] dj[ump] dp earlier elsei[f] endw[hile] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir +syn keyword vimCommand contained a al[l] arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endenum ene[w] export filt[er] fo[ld] fu[nction] h[elp] hi if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wq xmapc[lear] xr[estore] +syn keyword vimCommand contained ab ar[gs] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endf[unction] enum exu[sage] fin[d] foldc[lose] go[to] ha[rdcopy] hid[e] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wqa[ll] xme xunme +syn keyword vimCommand contained abc[lear] arga[dd] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endfo[r] eval f[ile] fina[lly] foldd[oopen] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wundo xmenu xunmenu +syn keyword vimCommand contained abo[veleft] argd[elete] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] en[dif] endinterface ex files fini[sh] folddoc[losed] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp static sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wv[iminfo] xnoreme xwininfo +syn keyword vimCommand contained abstract argded[upe] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] endclass endt[ry] exi[t] filet fir[st] foldo[pen] gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] wn[ext] x[it] xnoremenu y[ank] +syn keyword vimCommand contained addd argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon enddef endw[hile] exp filetype fix[del] for gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wp[revious] xa[ll] xprop z[^.=] syn match vimCommand contained "\" -syn keyword vimStdPlugin contained Arguments Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns - -" added later -syn keyword vimCommand contained eval +syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns " vimOptions are caught only when contained in a vimSet {{{2 -syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com conceallevel crb cscopeverbose cuc def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbcs printdevice printoptions pw qe relativenumber rightleft rs runtimepath scr sect sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan -syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments confirm cryptmethod cspc cul define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr pmbfn printencoding prompt pythondll quoteescape remap rightleftcmd rtp sb scroll sections sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write -syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring copyindent cscopepathcomp csprg cursorbind delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn popt printexpr pt pythonhome rdt renderoptions rl ru sbo scrollbind secure shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany -syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible cot cscopeprg csqf cursorcolumn dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph pp printfont pumheight pythonthreedll re report rlc rubydll sbr scrolljump sel shell shelltype shortname shq slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup -syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete cp cscopequickfix csre cursorline dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader preserveindent printheader pumwidth pythonthreehome readonly restorescreen rnu ruf sc scrolloff selection shellcmdflag shellxescape showbreak si sm so spellfile spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay -syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cpo cscoperelative cst cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewheight printmbcharset pvh pyx redrawtime revins ro ruler scb scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws -syn keyword vimOption contained altkeymap arabicshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cpoptions cscopetag csto debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printmbfont pvw pyxversion regexpengine ri rop rulerformat scl scs sessionoptions shellquote shiftround showfulltag sidescrolloff smartindent sol spellsuggest sr stal sua swf syntax tagcase tb tenc termwinsize tfu title toolbar tsr ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww -syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns concealcursor cpt cscopetagorder csverb deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll +syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj sn spellfile spo st su swf ta taglength tbis termguicolors textmode thesaurusfunc titlestring tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write +syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm so spelllang spr sta sua switchbuf tabline tagrelative tbs termwinkey textwidth tildeop tl tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany +syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm softtabstop spelloptions sps stal suffixes sws tabpagemax tags tc termwinscroll tf timeout tm ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup +syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase sol spellsuggest sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tfu timeoutlen to tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay +syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent sp spf srr statusline sw sxq tag tal tenc termwintype tgc title toolbar tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws +syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab spc spl ss stl swapfile syn tagbsearch tb term terse tgst titlelen toolbariconsize tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww +syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc spell splitbelow ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurus titleold top ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes +syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spellcapcheck splitright ssop sts swb syntax tagfunc tbidi termencoding " vimOptions: These are the turn-off setting variants {{{2 -syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm noma nomagic noml nomod nomodelineexpr nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup -syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomacatsui nomh nomle nomodeline nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows -syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl +syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows +syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup noxtermcodes +syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline nomodified " vimOptions: These are the invertible variants {{{2 -syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invma invmagic invml invmod invmodelineexpr invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup -syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmacatsui invmh invmle invmodeline invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws -syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl +syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws +syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup invxtermcodes +syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline invmodified " termcap codes (which can also be set) {{{2 -syn keyword vimOption contained t_8b t_AB t_al t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI 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_ti t_ts t_Ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR -syn keyword vimOption contained t_8f t_AF t_AL t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB +syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI 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_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR +syn keyword vimOption contained t_8f t_AB t_al t_AU t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_fe t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD t_ke t_KF syn match vimOption contained "t_%1" syn match vimOption contained "t_#2" syn match vimOption contained "t_#4" @@ -69,29 +66,30 @@ syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beauti " AutoCmd Events {{{2 syn case ignore -syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost 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 CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TermResponse TextChanged TextChangedI TextChangedP TextYankPost User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew -syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre +syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinLeave BufWrite BufWritePost CmdlineChanged CmdlineLeave CmdwinEnter ColorScheme CompleteChanged CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileExplorer FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinScrolled +syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre BufWinEnter BufWipeout BufWriteCmd BufWritePre CmdlineEnter CmdUndefined CmdwinLeave ColorSchemePre CompleteDone " 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 " Default highlighting groups {{{2 -syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question QuickFixLine Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC StatusLineTerm TabLine TabLineFill TabLineSel Terminal Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu +syn keyword vimHLGroup contained ColorColumn CurSearch Cursor CursorColumn CursorIM CursorLine CursorLineFold CursorLineNr CursorLineSign DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr LineNrAbove LineNrBelow MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question QuickFixLine Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC StatusLineTerm StatusLineTermNC TabLine TabLineFill TabLineSel Terminal Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu syn match vimHLGroup contained "Conceal" syn case match " Function Names {{{2 -syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eventhandler exp filereadable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getjumplist getpos gettabvar getwinposx globpath histadd hlID input inputsecret islocked job_setoptions js_decode len lispindent localtime maparg matcharg matchstrpos mzeval perleval popup_create popup_getpos popup_setoptions printf prop_clear prop_type_change py3eval readfile reltimestr remote_send resolve screenchar screenstring searchpos setcharsearch setloclist settabvar sha256 sign_getdefined sign_placelist simplify sound_clear sound_stop sqrt strcharpart strgetchar strpart submatch synconcealed synstack tabpagenr tan term_dumpload term_getattr term_getscrolled term_gettty term_setansicolors term_start test_feedinput test_ignore_error test_null_job test_option_not_set test_setmouse timer_start toupper type values winbufnr win_getid win_id2win winrestcmd winwidth -syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete empty executable expand filewritable floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getline getqflist gettabwinvar getwinposy has histdel hostname inputdialog insert isnan job_start js_encode libcall list2str log mapcheck matchdelete max nextnonblank popup_atcursor popup_dialog popup_hide popup_settext prompt_setcallback prop_find prop_type_delete pyeval reg_executing remote_expr remote_startserver reverse screenchars search server2client setcmdpos setmatches settabwinvar shellescape sign_getplaced sign_undefine sin soundfold spellbadword str2float strchars stridx strridx substitute synID system tabpagewinnr tanh term_dumpwrite term_getcursor term_getsize term_list term_setkill term_wait test_garbagecollect_now test_null_blob test_null_list test_override test_settime timer_stop tr undofile virtcol wincol win_gotoid winlayout winrestview wordcount -syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline environ execute expandcmd filter fmod foldlevel function getbufvar getcmdline getcurpos getfsize getloclist getreg gettagstack getwinvar has_key histget iconv inputlist invert items job_status json_decode libcallnr listener_add log10 match matchend min nr2char popup_beval popup_filter_menu popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyxeval reg_recording remote_foreground remove round screencol searchdecl serverlist setenv setpos settagstack shiftwidth sign_jump sign_unplace sinh sound_playevent spellsuggest str2list strdisplaywidth string strtrans swapinfo synIDattr systemlist tagfiles tempname term_getaltscreen term_getjob term_getstatus term_scrape term_setrestore test_alloc_fail test_garbagecollect_soon test_null_channel test_null_partial test_refcount timer_info timer_stopall trim undotree visualmode win_execute winheight winline winsaveview writefile -syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype escape exepath extend finddir fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getmatches getregtype getwininfo glob haslocaldir histnr indent inputrestore isdirectory job_getchannel job_stop json_encode line listener_flush luaeval matchadd matchlist mkdir or popup_clear popup_filter_yesno popup_move pow prompt_setprompt prop_remove prop_type_list range reltime remote_peek rename rubyeval screenpos searchpair setbufline setfperm setqflist setwinvar sign_define sign_place sign_unplacelist sort sound_playfile split str2nr strftime strlen strwidth swapname synIDtrans tabpagebuflist taglist term_dumpdiff term_getansicolors term_getline term_gettitle term_sendkeys term_setsize test_autochdir test_getvalue test_null_dict test_null_string test_scrollbar timer_pause tolower trunc uniq wildmenumode win_findbuf win_id2tabwin winnr win_screenpos xor -syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler eval exists feedkeys findfile fnamemodify foldtextresult get getchar getcmdtype getenv getftype getpid gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isinf job_info join keys line2byte listener_remove map matchaddpos matchstr mode pathshorten popup_close popup_getoptions popup_notification prevnonblank prop_add prop_type_add pumvisible readdir reltimefloat remote_read repeat screenattr screenrow searchpairpos setbufvar setline setreg +syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getcharmod getcmdpos getcursorcharpos getftime getmarklist getreg gettagstack getwinvar haslocaldir hlexists indent inputsave isdirectory job_info join keys line2byte listener_flush luaeval mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove +syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdscreenpos getcwd getftype getmatches getreginfo gettext glob hasmapto hlget index inputsecret isinf job_setoptions js_decode len lispindent listener_remove map mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_dict test_null_string test_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth +syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcmdtype getenv getimstatus getmousepos getregtype getwininfo glob2regpat histadd hlID input insert islocked job_start js_encode libcall list2blob localtime maparg match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_function test_option_not_set test_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount +syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufvar getcharstr getcmdwintype getfontname getjumplist getpid gettabinfo getwinpos globpath histdel hlset inputdialog interrupt isnan job_status json_decode libcallnr list2str log mapcheck matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile +syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getchangelist getcmdcompltype getcompletion getfperm getline getpos gettabvar getwinposx has histget hostname inputlist invert items job_stop json_encode line listener_add log10 maplist matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor +syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getchar getcmdline getcurpos getfsize getloclist getqflist gettabwinvar getwinposy has_key histnr iconv inputrestore isabsolutepath job_getchannel "--- syntax here and above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 -" Set up folding commands -if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[aflmpPrt]' +" Set up folding commands {{{2 +if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' if g:vimsyn_folding =~# 'a' com! -nargs=* VimFolda fold else @@ -102,6 +100,11 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[aflmpPrt]' else com! -nargs=* VimFoldf endif + if g:vimsyn_folding =~# 'h' + com! -nargs=* VimFoldh fold + else + com! -nargs=* VimFoldh + endif if g:vimsyn_folding =~# 'l' com! -nargs=* VimFoldl fold else @@ -135,6 +138,7 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[aflmpPrt]' else com! -nargs=* VimFolda com! -nargs=* VimFoldf + com! -nargs=* VimFoldh com! -nargs=* VimFoldl com! -nargs=* VimFoldm com! -nargs=* VimFoldp @@ -143,7 +147,7 @@ else com! -nargs=* VimFoldt endif -" commands not picked up by the generator (due to non-standard format) +" commands not picked up by the generator (due to non-standard format) {{{2 syn keyword vimCommand contained py3 " Deprecated variable options {{{2 @@ -166,10 +170,13 @@ endif " Numbers {{{2 " ======= -syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment -syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment -syn match vimNumber "\<0[xX]\x\+" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment -syn match vimNumber "\%(^\|\A\)\zs#\x\{6}" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment +syn match vimNumber '\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0[xX]\x\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0[zZ][a-zA-Z0-9.]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '0[0-7]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment " All vimCommands are contained by vimIsCommand. {{{2 syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimEcho,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd @@ -181,11 +188,13 @@ syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in " Insertions And Appends: insert append {{{2 +" (buftype != nofile test avoids having append, change, insert show up in the command window) " ======================= -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\+\)\=\)\=starti\%[nsert]$" matchgroup=vimCommand end="^\.$"" +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="^\.$"" +endif " Behave! {{{2 " ======= @@ -206,7 +215,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=vimAugroup,vimIsCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimNotFunc,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption +syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimNotFunc,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vim9Comment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' syn region vimAugroup fold matchgroup=vimAugroupKey start="\\ze\s\+\K\k*" end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList else @@ -220,12 +229,12 @@ syn keyword vimAugroupKey contained aug[roup] " Operators: {{{2 " ========= -syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue -syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile +syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment,vimVar syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile -syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup -syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar +syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile +syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup +syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" endif @@ -233,21 +242,26 @@ endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID -syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand -syn match vimFunction "\\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody +syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand +syn match vimFunction "\<\(fu\%[nction]\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody +syn match vimFunction "\\|\" + " Special Filenames, Modifiers, Extension Removal: {{{2 " =============================================== syn match vimSpecFile "" nextgroup=vimSpecFileMod,vimSubst @@ -260,9 +274,9 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= -syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine +syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine syn keyword vimUserCommand contained com[mand] -syn match vimUserCmd "\.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList +syn match vimUserCmd "\.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter 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 @@ -290,6 +304,14 @@ syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup syn match vimComment +\!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup -syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup +"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ +syn match vimEscape contained "\\." " Substitutions: {{{2 " ============= @@ -320,7 +343,8 @@ syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTw syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation syn cluster vimSubstList add=vimCollection syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<\%(\\|\\|\\)[:#[:alpha:]]\@!" nextgroup=vimSubstPat -syn match vimSubst "\%(^\|[^\\]\)\[:#[:alpha:]]\@!" nextgroup=vimSubstPat contained +"syn match vimSubst "\%(^\|[^\\]\)\[:#[:alpha:]]\@!" nextgroup=vimSubstPat contained +syn match vimSubst "\%(^\|[^\\\"']\)\[:#[:alpha:]\"']\@!" nextgroup=vimSubstPat contained syn match vimSubst "/\zs\\ze/" nextgroup=vimSubstPat syn match vimSubst "\(:\+\s*\|^\s*\)s\ze#.\{-}#.\{-}#" nextgroup=vimSubstPat syn match vimSubst1 contained "\" nextgroup=vimSubstPat @@ -333,7 +357,7 @@ syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\| syn match vimSubstSubstr contained "\\z\=\d" syn match vimSubstTwoBS contained "\\\\" syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags -syn match vimSubstFlags contained "[&cegiIpr]\+" +syn match vimSubstFlags contained "[&cegiIlnpr#]\+" " 'String': {{{2 syn match vimString "[^(,]'[^']\{-}\zs'" @@ -358,35 +382,39 @@ syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1 syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1 syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile -syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile +syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile +syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile -" Complex repeats (:h complex-repeat) {{{2 +" Complex Repeats: (:h complex-repeat) {{{2 +" =============== 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="\%(\\\\\)*\\." end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod -syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar oneline +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 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 "[,:]" skipwhite nextgroup=vimCommand +syn match vimSetSep contained "[,:]" syn match vimSetMod contained "&vim\=\|[!&?<]\|all&" -" Let {{{2 +" Let: {{{2 " === -syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar +syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc +VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\%(\s\+eval\)\=\|eval\%(\s\+trim\)\=\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' -" Abbreviations {{{2 +" Abbreviations: {{{2 " ============= syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbrev] ia[bbrev] skipwhite nextgroup=vimMapMod,vimMapLhs -" Autocmd {{{2 +" 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*" +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" -" Echo and Execute -- prefer strings! {{{2 +" Echo And Execute: -- prefer strings! {{{2 " ================ syn region vimEcho oneline excludenl matchgroup=vimCommand start="\" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimFuncVar,vimString,vimVar syn region vimExecute oneline excludenl matchgroup=vimCommand start="\" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar @@ -395,10 +423,10 @@ syn case ignore syn keyword vimEchoHLNone none syn case match -" Maps {{{2 +" Maps: {{{2 " ==== syn match vimMap "\!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs -syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs +syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vmapc[lear] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn keyword vimMap mapc[lear] smapc[lear] syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs @@ -410,7 +438,7 @@ syn case ignore syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique syn case match -" Menus {{{2 +" Menus: {{{2 " ===== syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod syn keyword vimCommand am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] skipwhite nextgroup=@vimMenuList @@ -419,13 +447,13 @@ syn match vimMenuPriority "\d\+\(\.\d\+\)*" contained skipwhite nextgroup=vimMen syn match vimMenuNameMore "\c\\\s\|\|\\\." contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation syn match vimMenuMod contained "\c<\(script\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList syn match vimMenuMap "\s" contained skipwhite nextgroup=vimMenuRhs -syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vimIsCommand +syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vim9Comment,vimIsCommand syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList -" Angle-Bracket Notation (tnx to Michael Geddes) {{{2 +" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2 " ====================== syn case ignore -syn match vimNotation "\%#=1\(\\\|\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|mouse\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket +syn match vimNotation "\%#=1\(\\\|\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cmd\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|mouse\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket syn match vimNotation "\%#=1\(\\\|\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket syn match vimNotation "\%#=1\(\\\|\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket syn match vimNotation '\(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket @@ -434,11 +462,15 @@ syn match vimNotation "\%#=1\(\\\|\)\=<\([cas]file\|abuf\|amatch\|cword\|cWO syn match vimBracket contained "[\\<>]" syn case match -" User Function Highlighting {{{2 +" User Function Highlighting: {{{2 " (following Gautam Iyer's suggestion) " ========================== -syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute +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.]*\>\|\" contains=vimNotation +syn keyword vimFuncEcho contained ec ech echo + +" User Command Highlighting: {{{2 +syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' " Errors And Warnings: {{{2 " ==================== @@ -451,12 +483,12 @@ endif syn match vimNotFunc "\\|\\|\\|\" skipwhite nextgroup=vimOper,vimOperParen,vimVar,vimFunc,vimNotation -" Norm {{{2 +" Norm: {{{2 " ==== syn match vimNorm "\" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment -syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment +syn match vimSyntax "\" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment +syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment syn cluster vimFuncBodyList add=vimSyntax " Syntax: case {{{2 @@ -507,7 +539,7 @@ syn match vimSynKeyOpt contained "\%#=1\<\(conceal\|contained\|transparent\|skip syn cluster vimFuncBodyList add=vimSynType " Syntax: match {{{2 -syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation +syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vim9Comment syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup syn match vimSynMtchOpt contained "\%#=1\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" @@ -555,13 +587,13 @@ syn match vimSyncKey contained "\" skipwhite nextgroup=v syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone syn keyword vimSyncNone contained NONE -" Additional IsCommand, here by reasons of precedence {{{2 +" Additional IsCommand: here by reasons of precedence {{{2 " ==================== syn match vimIsCommand "\s*\a\+" transparent contains=vimCommand,vimNotation -" Highlighting {{{2 +" Highlighting: {{{2 " ============ -syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment +syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment,vim9Comment if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") syn match vimHiCtermError contained "\D\i*" endif @@ -576,7 +608,7 @@ syn case match syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList syn case ignore -syn keyword vimHiCtermColor contained black blue brown cyan darkblue darkcyan darkgray darkgreen darkgrey darkmagenta darkred darkyellow gray green grey lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightred magenta red white yellow +syn keyword vimHiCtermColor contained black blue brown cyan darkblue darkcyan darkgray darkgreen darkgrey darkmagenta darkred darkyellow gray green grey grey40 grey50 grey90 lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightred lightyellow magenta red seagreen white yellow syn match vimHiCtermColor contained "\" syn case match @@ -585,7 +617,7 @@ syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 -syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation +syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror") syn match vimHiKeyError contained "\i\+="he=e-1 @@ -594,6 +626,7 @@ syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError +syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib @@ -609,13 +642,14 @@ syn keyword vimHiClear contained clear nextgroup=vimHiGroup syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\\|\\)" end="$" contains=@vimHiCluster syn cluster vimFuncBodyList add=vimHiLink -" Control Characters {{{2 +" Control Characters: {{{2 " ================== syn match vimCtrlChar "[- -]" " Beginners - Patterns that involve ^ {{{2 " ========= syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle +syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup syn match vimContinue "^\s*\\" syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue @@ -628,9 +662,11 @@ syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained syn region vimGlobal matchgroup=Statement start='\ -" Last Change: 2013 Jun 1 +" Last Change: 2022 Apr 28 + +" GNU Wget 1.21 built on linux-gnu. if exists("b:current_syntax") finish @@ -18,155 +20,206 @@ syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline syn case ignore -syn keyword wgetBoolean on off contained -syn keyword wgetNumber inf contained -syn case match -syn match wgetNumber "\<\%(\d\+\|inf\)\>" contained -syn match wgetQuota "\<\d\+[kKmM]\>" contained -syn match wgetTime "\<\d\+[smhdw]\>" contained +syn keyword wgetBoolean on off yes no contained +syn keyword wgetNumber inf contained + +syn match wgetNumber "\<\d\+>" contained +syn match wgetQuota "\<\d\+[kmgt]\>" contained +syn match wgetTime "\<\d\+[smhdw]\>" contained "{{{ Commands -let s:commands = map([ - \ "accept", - \ "add_hostdir", - \ "adjust_extension", - \ "always_rest", - \ "ask_password", - \ "auth_no_challenge", - \ "background", - \ "backup_converted", - \ "backups", - \ "base", - \ "bind_address", - \ "ca_certificate", - \ "ca_directory", - \ "cache", - \ "certificate", - \ "certificate_type", - \ "check_certificate", - \ "connect_timeout", - \ "content_disposition", - \ "continue", - \ "convert_links", - \ "cookies", - \ "cut_dirs", - \ "debug", - \ "default_page", - \ "delete_after", - \ "dns_cache", - \ "dns_timeout", - \ "dir_prefix", - \ "dir_struct", - \ "domains", - \ "dot_bytes", - \ "dots_in_line", - \ "dot_spacing", - \ "dot_style", - \ "egd_file", - \ "exclude_directories", - \ "exclude_domains", - \ "follow_ftp", - \ "follow_tags", - \ "force_html", - \ "ftp_passwd", - \ "ftp_password", - \ "ftp_user", - \ "ftp_proxy", - \ "glob", - \ "header", - \ "html_extension", - \ "htmlify", - \ "http_keep_alive", - \ "http_passwd", - \ "http_password", - \ "http_proxy", - \ "https_proxy", - \ "http_user", - \ "ignore_case", - \ "ignore_length", - \ "ignore_tags", - \ "include_directories", - \ "inet4_only", - \ "inet6_only", - \ "input", - \ "iri", - \ "keep_session_cookies", - \ "kill_longer", - \ "limit_rate", - \ "load_cookies", - \ "locale", - \ "local_encoding", - \ "logfile", - \ "login", - \ "max_redirect", - \ "mirror", - \ "netrc", - \ "no_clobber", - \ "no_parent", - \ "no_proxy", - \ "numtries", - \ "output_document", - \ "page_requisites", - \ "passive_ftp", - \ "passwd", - \ "password", - \ "post_data", - \ "post_file", - \ "prefer_family", - \ "preserve_permissions", - \ "private_key", - \ "private_key_type", - \ "progress", - \ "protocol_directories", - \ "proxy_passwd", - \ "proxy_password", - \ "proxy_user", - \ "quiet", - \ "quota", - \ "random_file", - \ "random_wait", - \ "read_timeout", - \ "reclevel", - \ "recursive", - \ "referer", - \ "reject", - \ "relative_only", - \ "remote_encoding", - \ "remove_listing", - \ "restrict_file_names", - \ "retr_symlinks", - \ "retry_connrefused", - \ "robots", - \ "save_cookies", - \ "save_headers", - \ "secure_protocol", - \ "server_response", - \ "show_all_dns_entries", - \ "simple_host_check", - \ "span_hosts", - \ "spider", - \ "strict_comments", - \ "sslcertfile", - \ "sslcertkey", - \ "timeout", - \ "time_stamping", - \ "use_server_timestamps", - \ "tries", - \ "trust_server_names", - \ "user", - \ "use_proxy", - \ "user_agent", - \ "verbose", - \ "wait", - \ "wait_retry"], - \ "substitute(v:val, '_', '[-_]\\\\=', 'g')") +let s:commands =<< trim EOL + accept + accept_regex + add_host_dir + adjust_extension + always_rest + ask_password + auth_no_challenge + background + backup_converted + backups + base + bind_address + bind_dns_address + body_data + body_file + ca_certificate + ca_directory + cache + certificate + certificate_type + check_certificate + choose_config + ciphers + compression + connect_timeout + content_disposition + content_on_error + continue + convert_file_only + convert_links + cookies + crl_file + cut_dirs + debug + default_page + delete_after + dns_cache + dns_servers + dns_timeout + dir_prefix + dir_struct + domains + dot_bytes + dots_in_line + dot_spacing + dot_style + egd_file + exclude_directories + exclude_domains + follow_ftp + follow_tags + force_html + ftp_passwd + ftp_password + ftp_user + ftp_proxy + ftps_clear_data_connection + ftps_fallback_to_ftp + ftps_implicit + ftps_resume_ssl + hsts + hsts_file + ftp_stmlf + glob + header + html_extension + htmlify + http_keep_alive + http_passwd + http_password + http_proxy + https_proxy + https_only + http_user + if_modified_since + ignore_case + ignore_length + ignore_tags + include_directories + inet4_only + inet6_only + input + input_meta_link + iri + keep_bad_hash + keep_session_cookies + kill_longer + limit_rate + load_cookies + locale + local_encoding + logfile + login + max_redirect + metalink_index + metalink_over_http + method + mirror + netrc + no_clobber + no_config + no_parent + no_proxy + numtries + output_document + page_requisites + passive_ftp + passwd + password + pinned_pubkey + post_data + post_file + prefer_family + preferred_location + preserve_permissions + private_key + private_key_type + progress + protocol_directories + proxy_passwd + proxy_password + proxy_user + quiet + quota + random_file + random_wait + read_timeout + rec_level + recursive + referer + regex_type + reject + rejected_log + reject_regex + relative_only + remote_encoding + remove_listing + report_speed + restrict_file_names + retr_symlinks + retry_connrefused + retry_on_host_error + retry_on_http_error + robots + save_cookies + save_headers + secure_protocol + server_response + show_all_dns_entries + show_progress + simple_host_check + span_hosts + spider + start_pos + strict_comments + sslcertfile + sslcertkey + timeout + timestamping + use_server_timestamps + tries + trust_server_names + unlink + use_askpass + user + use_proxy + user_agent + verbose + wait + wait_retry + warc_cdx + warc_cdx_dedup + warc_compression + warc_digests + warc_file + warc_header + warc_keep_log + warc_max_size + warc_temp_dir + wdebug + xattr +EOL "}}} -syn case ignore +call map(s:commands, "substitute(v:val, '_', '[-_]\\\\=', 'g')") + for cmd in s:commands - exe 'syn match wgetCommand "' . cmd . '" nextgroup=wgetAssignmentOperator skipwhite contained' + exe 'syn match wgetCommand "\<' . cmd . '\>" nextgroup=wgetAssignmentOperator skipwhite contained' endfor + syn case match syn match wgetStart "^" nextgroup=wgetCommand,wgetComment skipwhite @@ -179,6 +232,7 @@ hi def link wgetComment Comment hi def link wgetNumber Number hi def link wgetQuota Number hi def link wgetString String +hi def link wgetTime Number hi def link wgetTodo Todo let b:current_syntax = "wget" diff --git a/runtime/syntax/wget2.vim b/runtime/syntax/wget2.vim new file mode 100644 index 0000000000000..a63c336f06419 --- /dev/null +++ b/runtime/syntax/wget2.vim @@ -0,0 +1,250 @@ +" Vim syntax file +" Language: Wget2 configuration file (/etc/wget2rc ~/.wget2rc) +" Maintainer: Doug Kearns +" Last Change: 2022 Apr 28 + +" GNU Wget2 2.0.0 - multithreaded metalink/file/website downloader + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn match wgetComment "#.*$" contains=wgetTodo contained + +syn keyword wgetTodo TODO NOTE FIXME XXX contained + +syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline +syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline + +syn case ignore + +syn keyword wgetBoolean on off yes no y n contained +syn keyword wgetNumber infinity inf contained + +syn match wgetNumber "\<\d\+>" contained +syn match wgetQuota "\<\d\+[kmgt]\>" contained +syn match wgetTime "\<\d\+[smhd]\>" contained + +"{{{ Commands +let s:commands =<< trim EOL + accept + accept-regex + adjust-extension + append-output + ask-password + auth-no-challenge + background + backup-converted + backups + base + bind-address + bind-interface + body-data + body-file + ca-certificate + ca-directory + cache + certificate + certificate-type + check-certificate + check-hostname + chunk-size + clobber + compression + config + connect-timeout + content-disposition + content-on-error + continue + convert-file-only + convert-links + cookie-suffixes + cookies + crl-file + cut-dirs + cut-file-get-vars + cut-url-get-vars + debug + default-http-port + default-https-port + default-page + delete-after + directories + directory-prefix + dns-cache + dns-cache-preload + dns-timeout + domains + download-attr + egd-file + exclude-directories + exclude-domains + execute + filter-mime-type + filter-urls + follow-tags + force-atom + force-css + force-directories + force-html + force-metalink + force-progress + force-rss + force-sitemap + fsync-policy + gnupg-homedir + header + help + host-directories + hpkp + hpkp-file + hsts + hsts-file + hsts-preload + hsts-preload-file + html-extension + http-keep-alive + http-password + http-proxy + http-proxy-password + http-proxy-user + http-user + http2 + http2-only + http2-request-window + https-enforce + https-only + https-proxy + hyperlink + if-modified-since + ignore-case + ignore-length + ignore-tags + include-directories + inet4-only + inet6-only + input-encoding + input-file + keep-extension + keep-session-cookies + level + limit-rate + list-plugins + load-cookies + local-db + local-encoding + local-plugin + max-redirect + max-threads + metalink + method + mirror + netrc + netrc-file + ocsp + ocsp-date + ocsp-file + ocsp-nonce + ocsp-server + ocsp-stapling + output-document + output-file + page-requisites + parent + password + plugin + plugin-dirs + plugin-help + plugin-opt + post-data + post-file + prefer-family + private-key + private-key-type + progress + protocol-directories + proxy + quiet + quota + random-file + random-wait + read-timeout + recursive + referer + regex-type + reject + reject-regex + remote-encoding + report-speed + restrict-file-names + retry-connrefused + retry-on-http-error + robots + save-content-on + save-cookies + save-headers + secure-protocol + server-response + signature-extensions + span-hosts + spider + start-pos + stats-dns + stats-ocsp + stats-server + stats-site + stats-tls + strict-comments + tcp-fastopen + timeout + timestamping + tls-false-start + tls-resume + tls-session-file + tries + trust-server-names + unlink + use-askpass + use-server-timestamps + user + user-agent + verbose + verify-save-failed + verify-sig + version + wait + waitretry + xattr +EOL +"}}} + +call map(s:commands, "substitute(v:val, '_', '[-_]\\\\=', 'g')") + +for cmd in s:commands + exe 'syn match wgetCommand "\<' . cmd . '\>" nextgroup=wgetAssignmentOperator skipwhite contained' +endfor + +syn case match + +syn match wgetStart "^" nextgroup=wgetCommand,wgetComment skipwhite +syn match wgetAssignmentOperator "=" nextgroup=wgetString,wgetBoolean,wgetNumber,wgetQuota,wgetTime skipwhite contained + +hi def link wgetAssignmentOperator Special +hi def link wgetBoolean Boolean +hi def link wgetCommand Identifier +hi def link wgetComment Comment +hi def link wgetNumber Number +hi def link wgetQuota Number +hi def link wgetString String +hi def link wgetTime Number +hi def link wgetTodo Todo + +let b:current_syntax = "wget" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 fdm=marker: diff --git a/runtime/syntax/xkb.vim b/runtime/syntax/xkb.vim index 59fc497e62251..22be56d725084 100644 --- a/runtime/syntax/xkb.vim +++ b/runtime/syntax/xkb.vim @@ -2,7 +2,7 @@ " This is a GENERATED FILE. Please always refer to source file at the URI below. " Language: XKB (X Keyboard Extension) components " Maintainer: David Ne\v{c}as (Yeti) -" Last Change: 2003-04-13 +" Last Change: 2020 Oct 18 " URL: http://trific.ath.cx/Ftp/vim/syntax/xkb.vim " Setup @@ -41,7 +41,7 @@ syn match xkbPhysicalKey "<\w\+>" syn keyword xkbPreproc augment include replace syn keyword xkbConstant False True syn keyword xkbModif override replace -syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width +syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width syn keyword xkbFunction AnyOf ISOLock LatchGroup LatchMods LockControls LockGroup LockMods LockPointerButton MovePtr NoAction PointerButton SetControls SetGroup SetMods SetPtrDflt Terminate syn keyword xkbTModif default hidden partial virtual syn keyword xkbSect alphanumeric_keys alternate_group function_keys keypad_keys modifier_keys xkb_compatibility xkb_geometry xkb_keycodes xkb_keymap xkb_semantics xkb_symbols xkb_types diff --git a/runtime/syntax/xmath.vim b/runtime/syntax/xmath.vim index 22b3e85daea06..37ae95111292c 100644 --- a/runtime/syntax/xmath.vim +++ b/runtime/syntax/xmath.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: xmath (a simulation tool) -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Aug 31, 2016 -" Version: 9 +" Version: 10 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XMATH " For version 5.x: Clear all syntax items diff --git a/runtime/syntax/xml.vim b/runtime/syntax/xml.vim index f7c7894369d2d..d99f8b467a382 100644 --- a/runtime/syntax/xml.vim +++ b/runtime/syntax/xml.vim @@ -4,11 +4,13 @@ " Repository: https://github.com/chrisbra/vim-xml-ftplugin " Previous Maintainer: Johannes Zellner " Author: Paul Siegmann -" Last Changed: Sept 24, 2019 +" Last Changed: Nov 03, 2019 " Filenames: *.xml " Last Change: " 20190923 - Fix xmlEndTag to match xmlTag (vim/vim#884) " 20190924 - Fix xmlAttribute property (amadeus/vim-xml@d8ce1c946) +" 20191103 - Enable spell checking globally +" 20210428 - Improve syntax synchronizing " CONFIGURATION: " syntax folding can be turned on by @@ -52,6 +54,12 @@ set cpo&vim syn case match +" Allow spell checking in tag values, +" there is no syntax region for that, +" so enable spell checking in top-level elements +" This text is spell checked +syn spell toplevel + " mark illegal characters syn match xmlError "[<&]" @@ -295,9 +303,12 @@ unlet b:current_syntax " synchronizing -" TODO !!! to be improved !!! -syn sync match xmlSyncDT grouphere xmlDocType +\_.\(+ + +" The following is slow on large documents (and the doctype is optional +" syn sync match xmlSyncDT grouphere xmlDocType +\_.\(+ if exists('g:xml_syntax_folding') @@ -306,7 +317,7 @@ if exists('g:xml_syntax_folding') syn sync match xmlSync groupthere xmlRegion +"']\+>+ endif -syn sync minlines=100 +syn sync minlines=100 maxlines=200 " The default highlighting. @@ -347,4 +358,4 @@ let b:current_syntax = "xml" let &cpo = s:xml_cpo_save unlet s:xml_cpo_save -" vim: ts=8 +" vim: ts=4 diff --git a/runtime/syntax/xpm.vim b/runtime/syntax/xpm.vim index 0667ca28ad5d5..be9f38723ed67 100644 --- a/runtime/syntax/xpm.vim +++ b/runtime/syntax/xpm.vim @@ -1,19 +1,22 @@ " Vim syntax file " Language: X Pixmap " Maintainer: Ronald Schild -" Last Change: 2017 Feb 01 +" Last Change: 2021 Oct 04 " Version: 5.4n.1 " Jemma Nelson added termguicolors support +" Dominique PellÊ fixed spelling support " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif +syn spell notoplevel + syn keyword xpmType char syn keyword xpmStorageClass static syn keyword xpmTodo TODO FIXME XXX contained -syn region xpmComment start="/\*" end="\*/" contains=xpmTodo +syn region xpmComment start="/\*" end="\*/" contains=xpmTodo,@Spell syn region xpmPixelString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@xpmColors if has("gui_running") || has("termguicolors") && &termguicolors diff --git a/runtime/syntax/xs.vim b/runtime/syntax/xs.vim index 3e658b4a83fdd..2145ede2ddb64 100644 --- a/runtime/syntax/xs.vim +++ b/runtime/syntax/xs.vim @@ -1,9 +1,12 @@ " Vim syntax file -" Language: XS (Perl extension interface language) -" Author: Autogenerated from perl headers, on an original basis of Michael W. Dodge -" Maintainer: vim-perl -" Previous: Vincent Pit -" Last Change: 2017-09-12 +" Language: XS (Perl extension interface language) +" Author: Autogenerated from perl headers, on an original basis of Michael W. Dodge +" Maintainer: vim-perl +" Previous: Vincent Pit +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2018 Mar 28 if exists("b:current_syntax") finish diff --git a/runtime/syntax/xslt.vim b/runtime/syntax/xslt.vim index 3e0df6acffd6e..900b8ca0490de 100644 --- a/runtime/syntax/xslt.vim +++ b/runtime/syntax/xslt.vim @@ -1,13 +1,14 @@ " Vim syntax file " Language: XSLT -" Maintainer: Johannes Zellner -" Last Change: Sun, 28 Oct 2001 21:22:24 +0100 +" Maintainer: Bogdan Barbu +" Previous Maintainer: Johannes Zellner +" Last Change: Fri, 17 Jan 2020 07:15:37 +0200 " Filenames: *.xsl " $Id: xslt.vim,v 1.1 2004/06/13 15:52:10 vimboss Exp $ " REFERENCES: " [1] http://www.w3.org/TR/xslt -" +" [2] http://www.w3.org/TR/xslt20 " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -19,11 +20,13 @@ runtime syntax/xml.vim syn cluster xmlTagHook add=xslElement syn case match +syn match xslElement '\%(xsl:\)\@<=analyze-string' syn match xslElement '\%(xsl:\)\@<=apply-imports' syn match xslElement '\%(xsl:\)\@<=apply-templates' syn match xslElement '\%(xsl:\)\@<=attribute' syn match xslElement '\%(xsl:\)\@<=attribute-set' syn match xslElement '\%(xsl:\)\@<=call-template' +syn match xslElement '\%(xsl:\)\@<=character-map' syn match xslElement '\%(xsl:\)\@<=choose' syn match xslElement '\%(xsl:\)\@<=comment' syn match xslElement '\%(xsl:\)\@<=copy' @@ -33,19 +36,25 @@ syn match xslElement '\%(xsl:\)\@<=document' syn match xslElement '\%(xsl:\)\@<=element' syn match xslElement '\%(xsl:\)\@<=fallback' syn match xslElement '\%(xsl:\)\@<=for-each' +syn match xslElement '\%(xsl:\)\@<=for-each-group' +syn match xslElement '\%(xsl:\)\@<=function' syn match xslElement '\%(xsl:\)\@<=if' syn match xslElement '\%(xsl:\)\@<=include' syn match xslElement '\%(xsl:\)\@<=import' +syn match xslElement '\%(xsl:\)\@<=import-schema' syn match xslElement '\%(xsl:\)\@<=key' syn match xslElement '\%(xsl:\)\@<=message' +syn match xslElement '\%(xsl:\)\@<=namespace' syn match xslElement '\%(xsl:\)\@<=namespace-alias' syn match xslElement '\%(xsl:\)\@<=number' syn match xslElement '\%(xsl:\)\@<=otherwise' syn match xslElement '\%(xsl:\)\@<=output' syn match xslElement '\%(xsl:\)\@<=param' +syn match xslElement '\%(xsl:\)\@<=perform-sort' syn match xslElement '\%(xsl:\)\@<=processing-instruction' syn match xslElement '\%(xsl:\)\@<=preserve-space' syn match xslElement '\%(xsl:\)\@<=script' +syn match xslElement '\%(xsl:\)\@<=sequence' syn match xslElement '\%(xsl:\)\@<=sort' syn match xslElement '\%(xsl:\)\@<=strip-space' syn match xslElement '\%(xsl:\)\@<=stylesheet' diff --git a/runtime/syntax/xxd.vim b/runtime/syntax/xxd.vim index f3c43e816ca7c..2f90b6b0bd7db 100644 --- a/runtime/syntax/xxd.vim +++ b/runtime/syntax/xxd.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: bin using xxd -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Aug 31, 2016 -" Version: 10 +" Version: 11 " Notes: use :help xxd to see how to invoke it " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XXD diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim index 8e4a225ff422e..3aa01e8841389 100644 --- a/runtime/syntax/yacc.vim +++ b/runtime/syntax/yacc.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Yacc -" Maintainer: Charles E. Campbell +" Maintainer: Charles E. Campbell " Last Change: Mar 25, 2019 -" Version: 16 +" Version: 17 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_YACC " " Options: {{{1 diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim index 1e947671a9ddd..bab89b916e794 100644 --- a/runtime/syntax/zsh.vim +++ b/runtime/syntax/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2018-07-13 +" Latest Revision: 2020-11-21 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -13,32 +13,45 @@ endif let s:cpo_save = &cpo set cpo&vim -if v:version > 704 || (v:version == 704 && has("patch1142")) - syn iskeyword @,48-57,_,192-255,#,- -else - setlocal iskeyword+=- -endif +function! s:ContainedGroup() + " needs 7.4.2008 for execute() function + let result='TOP' + " vim-pandoc syntax defines the @langname cluster for embedded syntax languages + " However, if no syntax is defined yet, `syn list @zsh` will return + " "No syntax items defined", so make sure the result is actually a valid syn cluster + for cluster in ['markdownHighlightzsh', 'zsh'] + try + " markdown syntax defines embedded clusters as @markdownhighlight, + " pandoc just uses @, so check both for both clusters + let a=split(execute('syn list @'. cluster), "\n") + if len(a) == 2 && a[0] =~# '^---' && a[1] =~? cluster + return '@'. cluster + endif + catch /E392/ + " ignore + endtry + endfor + return result +endfunction + +let s:contained=s:ContainedGroup() + +syn iskeyword @,48-57,_,192-255,#,- if get(g:, 'zsh_fold_enable', 0) setlocal foldmethod=syntax endif -syn keyword zshTodo contained TODO FIXME XXX NOTE - -syn region zshComment oneline start='\%(^\|\s\+\)#' end='$' - \ contains=zshTodo,@Spell fold - -syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' - \ contains=zshTodo,@Spell fold - -syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' - syn match zshQuoted '\\.' +syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}' +syn match zshPOSIXQuoted '\\[0-7]\{1,3}' +syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}' +syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}' + syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ \ contains=zshQuoted,@zshDerefs,@zshSubst fold syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold -" XXX: This should probably be more precise, but Zsh seems a bit confused about it itself syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ - \ end=+'+ contains=zshQuoted + \ skip=+\\[\\']+ end=+'+ contains=zshPOSIXQuoted,zshQuoted syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' syn keyword zshPrecommand noglob nocorrect exec command builtin - time @@ -121,213 +134,16 @@ syn keyword zshCommands alias autoload bg bindkey break bye cap cd \ zmodload zparseopts zprof zpty zrecompile \ zregexparse zsocket zstyle ztcp -" Options, generated by: echo ${(j:\n:)options[(I)*]} | sort -" Create a list of option names from zsh source dir: -" #!/bin/zsh -" topdir=/path/to/zsh-xxx -" grep '^pindex([A-Za-z_]*)$' $topdir/Doc/Zsh/options.yo | -" while read opt -" do -" echo ${${(L)opt#pindex\(}%\)} -" done - +" Options, generated by from the zsh source with the make-options.zsh script. syn case ignore - -syn match zshOptStart /^\s*\%(\%(\%(un\)\?setopt\)\|set\s+[-+]o\)/ nextgroup=zshOption skipwhite -syn match zshOption / - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?alias_func_def\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?all_export\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?always_last_prompt\>\)\|\%(\%(no_\?\)\?always_lastprompt\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?always_to_end\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?append_create\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?append_history\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_cd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_continue\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_list\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_menu\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_name_dirs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_param_keys\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_param_slash\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_pushd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_remove_slash\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_resume\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bad_pattern\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bang_hist\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bare_glob_qual\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bash_auto_list\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bash_rematch\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bg_nice\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?brace_ccl\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?brace_expand\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?bsd_echo\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?case_glob\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?case_match\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?c_bases\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?chase_dots\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?chase_links\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?check_jobs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?check_running_jobs\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?combining_chars\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?complete_aliases\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?complete_in_word\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?continue_on_error\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?correct_all\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?c_precedences\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_junkie_history\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_junkie_loops\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_junkie_quotes\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\|\%(\%(no_\?\)\?cshnullcmd\>\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_null_glob\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?debug_before_cmd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?dot_glob\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?err_exit\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?err_return\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?eval_lineno\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?extended_glob\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?extended_history\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?flow_control\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?force_float\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?function_argzero\>\)\|\%(\%(no_\?\)\?function_arg_zero\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?global_export\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?global_rcs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_assign\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_complete\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_dots\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?globsubst\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_star_short\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_all\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_cmds\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_dirs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_executables_only\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_list_all\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_allow_clobber\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_append\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_beep\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?histexpand\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?histexpiredupsfirst\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_fcntl_lock\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_find_no_dups\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_ignore_all_dups\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_ignore_dups\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_ignore_space\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_lex_words\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_no_functions\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_no_store\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_reduce_blanks\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_save_by_copy\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_save_no_dups\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_subst_pattern\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_verify\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ignore_braces\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ignore_close_braces\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ignore_eof\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?inc_append_history\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?inc_append_history_time\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?interactive_comments\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_arrays\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_autoload\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_glob\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_option_print\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_typeset\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_zero_subscript\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?list_ambiguous\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?list_beep\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?list_packed\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?list_rows_first\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?list_types\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?local_loops\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?local_options\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?local_patterns\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?local_traps\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?long_list_jobs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?magic_equal_subst\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?mail_warn\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?mail_warning\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?menu_complete\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?multi_byte\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?multi_func_def\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?multi_os\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?no_match\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?null_glob\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?numeric_glob_sort\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?octal_zeroes\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?one_cmd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?over_strike\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?path_dirs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?path_script\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?pipe_fail\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_aliases\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_arg_zero\>\)\|\%(\%(no_\?\)\?posix_argzero\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_builtins\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_cd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_identifiers\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_jobs\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_strings\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_traps\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?print_eight_bit\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?print_exit_value\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_bang\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_cr\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_percent\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_sp\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_subst\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_vars\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_ignore_dups\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_minus\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_silent\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_to_home\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?rc_expandparam\>\)\|\%(\%(no_\?\)\?rc_expand_param\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?rc_quotes\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?rec_exact\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?re_match_pcre\>\)\|\%(\%(no_\?\)\?rematch_pcre\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?rm_star_silent\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?rm_star_wait\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?share_history\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_file_expansion\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_glob\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?shin_stdin\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?short_loops\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_word_split\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?single_command\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?single_line_zle\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?source_trace\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?sun_keyboard_hack\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?track_all\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?transient_rprompt\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?traps_async\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?type_set_silent\>\)\|\%(\%(no_\?\)\?typeset_silent\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?warn_nested_var\>\)\| - \ \%(\%(\\)\|\%(\%(no_\?\)\?warn_create_global\>\)\| - \ \%(\%(\\)\| - \ \%(\%(\\)/ nextgroup=zshOption,zshComment skipwhite contained +syn match zshOptStart + \ /\v^\s*%(%(un)?setopt|set\s+[-+]o)/ + \ nextgroup=zshOption skipwhite +syn match zshOption nextgroup=zshOption,zshComment skipwhite contained /\v + \ <%(no_?)?%( + \ auto_?cd|auto_?pushd|cdable_?vars|cd_?silent|chase_?dots|chase_?links|posix_?cd|pushd_?ignore_?dups|pushd_?minus|pushd_?silent|pushd_?to_?home|always_?last_?prompt|always_?to_?end|auto_?list|auto_?menu|auto_?name_?dirs|auto_?param_?keys|auto_?param_?slash|auto_?remove_?slash|bash_?auto_?list|complete_?aliases|complete_?in_?word|glob_?complete|hash_?list_?all|list_?ambiguous|list_?beep|list_?packed|list_?rows_?first|list_?types|menu_?complete|rec_?exact|bad_?pattern|bare_?glob_?qual|brace_?ccl|case_?glob|case_?match|case_?paths|csh_?null_?glob|equals|extended_?glob|force_?float|glob|glob_?assign|glob_?dots|glob_?star_?short|glob_?subst|hist_?subst_?pattern|ignore_?braces|ignore_?close_?braces|ksh_?glob|magic_?equal_?subst|mark_?dirs|multibyte|nomatch|null_?glob|numeric_?glob_?sort|rc_?expand_?param|rematch_?pcre|sh_?glob|unset|warn_?create_?global|warn_?nested_?var|warnnestedvar|append_?history|bang_?hist|extended_?history|hist_?allow_?clobber|hist_?beep|hist_?expire_?dups_?first|hist_?fcntl_?lock|hist_?find_?no_?dups|hist_?ignore_?all_?dups|hist_?ignore_?dups|hist_?ignore_?space|hist_?lex_?words|hist_?no_?functions|hist_?no_?store|hist_?reduce_?blanks|hist_?save_?by_?copy|hist_?save_?no_?dups|hist_?verify|inc_?append_?history|inc_?append_?history_?time|share_?history|all_?export|global_?export|global_?rcs|rcs|aliases|clobber|clobber_?empty|correct|correct_?all|dvorak|flow_?control|ignore_?eof|interactive_?comments|hash_?cmds|hash_?dirs|hash_?executables_?only|mail_?warning|path_?dirs|path_?script|print_?eight_?bit|print_?exit_?value|rc_?quotes|rm_?star_?silent|rm_?star_?wait|short_?loops|short_?repeat|sun_?keyboard_?hack|auto_?continue|auto_?resume|bg_?nice|check_?jobs|check_?running_?jobs|hup|long_?list_?jobs|monitor|notify|posix_?jobs|prompt_?bang|prompt_?cr|prompt_?sp|prompt_?percent|prompt_?subst|transient_?rprompt|alias_?func_?def|c_?bases|c_?precedences|debug_?before_?cmd|err_?exit|err_?return|eval_?lineno|exec|function_?argzero|local_?loops|local_?options|local_?patterns|local_?traps|multi_?func_?def|multios|octal_?zeroes|pipe_?fail|source_?trace|typeset_?silent|typeset_?to_?unset|verbose|xtrace|append_?create|bash_?rematch|bsd_?echo|continue_?on_?error|csh_?junkie_?history|csh_?junkie_?loops|csh_?junkie_?quotes|csh_?nullcmd|ksh_?arrays|ksh_?autoload|ksh_?option_?print|ksh_?typeset|ksh_?zero_?subscript|posix_?aliases|posix_?argzero|posix_?builtins|posix_?identifiers|posix_?strings|posix_?traps|sh_?file_?expansion|sh_?nullcmd|sh_?option_?letters|sh_?word_?split|traps_?async|interactive|login|privileged|restricted|shin_?stdin|single_?command|beep|combining_?chars|emacs|overstrike|single_?line_?zle|vi|zle|brace_?expand|dot_?glob|hash_?all|hist_?append|hist_?expand|log|mail_?warn|one_?cmd|physical|prompt_?vars|stdin|track_?all|no_?match + \)>/ +syn case match syn keyword zshTypes float integer local typeset declare private readonly @@ -342,31 +158,42 @@ syn match zshNumber '[+-]\=\d\+\.\d\+\>' " TODO: $[...] is the same as $((...)), so add that as well. syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst -syn region zshSubst matchgroup=zshSubstDelim transparent - \ start='\$(' skip='\\)' end=')' contains=TOP fold +exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ skip=/\\)/ end=/)/ contains='.s:contained. ' fold' syn region zshParentheses transparent start='(' skip='\\)' end=')' fold syn region zshGlob start='(#' end=')' syn region zshMathSubst matchgroup=zshSubstDelim transparent - \ start='\$((' skip='\\)' end='))' + \ start='\%(\$\?\)[<=>]\@' +syn keyword zshTodo contained TODO FIXME XXX NOTE + +syn region zshComment oneline start='\%(^\|\s\+\)#' end='$' + \ contains=zshTodo,@Spell fold + +syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' + \ contains=zshTodo,@Spell fold + +syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$' + hi def link zshTodo Todo hi def link zshComment Comment hi def link zshPreProc PreProc hi def link zshQuoted SpecialChar +hi def link zshPOSIXQuoted SpecialChar hi def link zshString String hi def link zshStringDelimiter zshString hi def link zshPOSIXString zshString diff --git a/runtime/tools/README.txt b/runtime/tools/README.txt index fa176c776d595..19976b325cf65 100644 --- a/runtime/tools/README.txt +++ b/runtime/tools/README.txt @@ -34,4 +34,4 @@ xcmdsrv_client.c: Example for a client program that communicates with a Vim unicode.vim Vim script to generate tables for src/mbyte.c. -[xxd (and tee for OS/2) can be found in the src directory] +[xxd can be found in the src directory] diff --git a/runtime/tools/ccfilter.c b/runtime/tools/ccfilter.c index 8539e2a3dcb75..43489f16c290f 100644 --- a/runtime/tools/ccfilter.c +++ b/runtime/tools/ccfilter.c @@ -184,7 +184,7 @@ int main( int argc, char *argv[] ) case COMPILER_GCC: Severity = 'e'; #ifdef GOTO_FROM_WHERE_INCLUDED - rv = sscanf( Line, "In file included from %[^:]:%u:", + rv = sscanf( Line, "In file included from %[^:]:%lu:", FileName, &Row ); if ( rv == 2 ) { @@ -193,11 +193,11 @@ int main( int argc, char *argv[] ) else #endif { - if ((rv = sscanf( Line, "%[^:]:%u: warning: %[^\n]", + if ((rv = sscanf( Line, "%[^:]:%lu: warning: %[^\n]", FileName, &Row, Reason ))==3) { Severity = 'w'; } else { - rv = sscanf( Line, "%[^:]:%u: %[^\n]", + rv = sscanf( Line, "%[^:]:%lu: %[^\n]", FileName, &Row, Reason ); } ok = ( rv == 3 ); @@ -205,24 +205,24 @@ int main( int argc, char *argv[] ) Col = (dec_col ? 1 : 0 ); break; case COMPILER_AIX: - rv = sscanf( Line, "\"%[^\"]\", line %u.%u: %*s (%c) %[^\n]", + rv = sscanf( Line, "\"%[^\"]\", line %lu.%lu: %*s (%c) %[^\n]", FileName, &Row, &Col, &Severity, Reason ); ok = ( rv == 5 ); break; case COMPILER_HPUX: - rv = sscanf( Line, "cc: \"%[^\"]\", line %u: %c%*[^:]: %[^\n]", + rv = sscanf( Line, "cc: \"%[^\"]\", line %lu: %c%*[^:]: %[^\n]", FileName, &Row, &Severity, Reason ); ok = ( rv == 4 ); Col = (dec_col ? 1 : 0 ); break; case COMPILER_SOLARIS: - rv = sscanf( Line, "\"%[^\"]\", line %u: warning: %[^\n]", + rv = sscanf( Line, "\"%[^\"]\", line %lu: warning: %[^\n]", FileName, &Row, Reason ); Severity = 'w'; ok = ( rv == 3 ); if ( rv != 3 ) { - rv = sscanf( Line, "\"%[^\"]\", line %u: %[^\n]", + rv = sscanf( Line, "\"%[^\"]\", line %lu: %[^\n]", FileName, &Row, Reason ); Severity = 'e'; ok = ( rv == 3 ); @@ -230,18 +230,18 @@ int main( int argc, char *argv[] ) Col = (dec_col ? 1 : 0 ); break; case COMPILER_ATT: - rv = sscanf( Line, "%c \"%[^\"]\",L%u/C%u%*[^:]:%[^\n]", + rv = sscanf( Line, "%c \"%[^\"]\",L%lu/C%lu%*[^:]:%[^\n]", &Severity, FileName, &Row, &Col, Reason ); ok = ( rv == 5 ); if (rv != 5) - { rv = sscanf( Line, "%c \"%[^\"]\",L%u/C%u: %[^\n]", + { rv = sscanf( Line, "%c \"%[^\"]\",L%lu/C%lu: %[^\n]", &Severity, FileName, &Row, &Col, Reason ); ok = ( rv == 5 ); } if (rv != 5) - { rv = sscanf( Line, "%c \"%[^\"]\",L%u: %[^\n]", + { rv = sscanf( Line, "%c \"%[^\"]\",L%lu: %[^\n]", &Severity, FileName, &Row, Reason ); ok = ( rv == 4 ); Col = (dec_col ? 1 : 0 ); @@ -272,10 +272,10 @@ int main( int argc, char *argv[] ) } else { - rv = sscanf( p+2, "%[^:]: %u: %[^\n]", + rv = sscanf( p+2, "%[^:]: %lu: %[^\n]", FileName, &Row, Reason ); if (rv != 3) - rv = sscanf( p+2, "%[^,], line %u: %[^\n]", + rv = sscanf( p+2, "%[^,], line %lu: %[^\n]", FileName, &Row, Reason ); ok = ( rv == 3 ); } @@ -315,10 +315,10 @@ int main( int argc, char *argv[] ) { for (p=Reason; (*p) && (isspace(*p)); p++); if ( BasePath[CWDlen] == 0 ) - printf( "%s:%u:%u:%c:%s\n", FileName, Row, Col, Severity, p ); + printf( "%s:%lu:%lu:%c:%s\n", FileName, Row, Col, Severity, p ); else { - printf( "%s/%s:%u:%u:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p ); + printf( "%s/%s:%lu:%lu:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p ); } } if (!prefetch) diff --git a/runtime/tools/demoserver.py b/runtime/tools/demoserver.py index 00fe8bfbca4f0..2667aed3961ea 100644 --- a/runtime/tools/demoserver.py +++ b/runtime/tools/demoserver.py @@ -44,9 +44,6 @@ def handle(self): except socket.error: print("=== socket error ===") break - except IOError: - print("=== socket closed ===") - break if data == '': print("=== socket closed ===") break @@ -62,9 +59,16 @@ def handle(self): if decoded[0] >= 0: if decoded[1] == 'hello!': response = "got it" + id = decoded[0] + elif decoded[1] == 'hello channel!': + response = "got that" + # response is not to a specific message callback but to the + # channel callback, need to use ID zero + id = 0 else: response = "what?" - encoded = json.dumps([decoded[0], response]) + id = decoded[0] + encoded = json.dumps([id, response]) print("sending {0}".format(encoded)) self.request.sendall(encoded.encode('utf-8')) thesocket = None diff --git a/runtime/tools/emoji_list.vim b/runtime/tools/emoji_list.vim new file mode 100644 index 0000000000000..d361b7ee985ad --- /dev/null +++ b/runtime/tools/emoji_list.vim @@ -0,0 +1,23 @@ +" Script to fill the window with emoji characters, one per line. +" Source this script: :source % + +if &modified + new +else + enew +endif + +" Use a compiled Vim9 function for speed +def DoIt() + var lnum = 1 + for c in range(0x100, 0x1ffff) + var cs = nr2char(c) + if charclass(cs) == 3 + setline(lnum, '|' .. cs .. '| ' .. strwidth(cs)) + lnum += 1 + endif + endfor +enddef + +call DoIt() +set nomodified diff --git a/runtime/tools/shtags.1 b/runtime/tools/shtags.1 index 314df883c7d44..0a13802bc02c9 100644 --- a/runtime/tools/shtags.1 +++ b/runtime/tools/shtags.1 @@ -19,7 +19,7 @@ Name of tags file to create. (default is 'tags') .IP "\fB-s \fP" The name of the shell used by the script(s). By default, \fBshtags\fP tries to work out which is the appropriate shell for each -file individually by looking at the first line of each file. This wont +file individually by looking at the first line of each file. This won't work however, if the script starts as a bourne shell script and tries to be clever about starting the shell it really wants. .b diff --git a/runtime/tools/shtags.pl b/runtime/tools/shtags.pl index 79238fdb27e11..49a469a22ef8d 100755 --- a/runtime/tools/shtags.pl +++ b/runtime/tools/shtags.pl @@ -72,7 +72,7 @@ sub version # # for each line of every file listed on the command line, look for a -# 'sub' definition, or, if variables are wanted aswell, look for a +# 'sub' definition, or, if variables are wanted as well, look for a # variable definition at the start of a line # while( <> ) diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim index b518d0541f459..6da013ef89ba0 100644 --- a/runtime/tools/unicode.vim +++ b/runtime/tools/unicode.vim @@ -7,7 +7,7 @@ " Usage: Vim -S " " Author: Bram Moolenaar -" Last Update: 2010 Jan 12 +" Last Update: 2020 Aug 24 " Parse lines of UnicodeData.txt. Creates a list of lists in s:dataprops. func! ParseDataToProps() @@ -195,6 +195,13 @@ func! BuildWidthTable(pattern, tableName) let end = -1 let ranges = [] let dataidx = 0 + " Account for indentation differences between ambiguous and doublewidth + " table in mbyte.c + if a:pattern == 'A' + let spc = ' ' + else + let spc = "\t" + endif for p in s:widthprops if p[1][0] =~ a:pattern if p[0] =~ '\.\.' @@ -229,7 +236,7 @@ func! BuildWidthTable(pattern, tableName) else if start >= 0 " produce previous range - call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end)) if a:pattern == 'A' call add(s:ambitable, [start, end]) else @@ -243,7 +250,7 @@ func! BuildWidthTable(pattern, tableName) endif endfor if start >= 0 - call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end)) if a:pattern == 'A' call add(s:ambitable, [start, end]) else @@ -254,93 +261,165 @@ func! BuildWidthTable(pattern, tableName) " New buffer to put the result in. new exe "file " . a:tableName - call setline(1, " static struct interval " . a:tableName . "[] =") - call setline(2, " {") + if a:pattern == 'A' + call setline(1, "static struct interval " . a:tableName . "[] =") + call setline(2, "{") + else + call setline(1, " static struct interval " . a:tableName . "[] =") + call setline(2, " {") + endif call append('$', ranges) call setline('$', getline('$')[:-2]) " remove last comma - call setline(line('$') + 1, " };") + if a:pattern == 'A' + call setline(line('$') + 1, "};") + else + call setline(line('$') + 1, " };") + endif wincmd p endfunc -" Build the amoji width table in a new buffer. -func! BuildEmojiTable(pattern, tableName) - let alltokens = [] - let widthtokens = [] - let lines = map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 'v:val=~a:pattern'), 'matchstr(v:val,"^\\S\\+")') - for n in range(len(lines)) - let line = lines[n] - let token = split(line, '\.\.') - let first = ('0x' . token[0]) + 0 - if len(token) == 1 + +" Get characters from a list of lines in form "12ab .." or "12ab..56cd ..." +" and put them in dictionary "chardict" +func AddLinesToCharDict(lines, chardict) + for line in a:lines + let tokens = split(line, '\.\.') + let first = str2nr(tokens[0], 16) + if len(tokens) == 1 let last = first else - let last = ('0x' . token[1]) + 0 + let last = str2nr(tokens[1], 16) endif + for nr in range(first, last) + let a:chardict[nr] = 1 + endfor + endfor +endfunc - let token = [first, last] - if len(alltokens) > 0 && (token[0] - 1 == alltokens[-1][1]) - let alltokens[-1][1] = token[1] +func Test_AddLinesToCharDict() + let dict = {} + call AddLinesToCharDict([ + \ '1234 blah blah', + \ '1235 blah blah', + \ '12a0..12a2 blah blah', + \ '12a1 blah blah', + \ ], dict) + call assert_equal({0x1234: 1, 0x1235: 1, + \ 0x12a0: 1, 0x12a1: 1, 0x12a2: 1, + \ }, dict) + if v:errors != [] + echoerr 'AddLinesToCharDict' v:errors + return 1 + endif + return 0 +endfunc + + +func CharDictToPairList(chardict) + let result = [] + let keys = keys(a:chardict)->map('str2nr(v:val)')->sort('N') + let low = keys[0] + let high = keys[0] + for key in keys + if key > high + 1 + call add(result, [low, high]) + let low = key + let high = key else - call add(alltokens, token) + let high = key endif + endfor + call add(result, [low, high]) + return result +endfunc - " Characters below 1F000 may be considered single width traditionally, - " making them double width causes problems. - if first < 0x1f000 - continue - endif +func Test_CharDictToPairList() + let dict = {0x1020: 1, 0x1021: 1, 0x1022: 1, + \ 0x1024: 1, + \ 0x2022: 1, + \ 0x2024: 1, 0x2025: 1} + call assert_equal([ + \ [0x1020, 0x1022], + \ [0x1024, 0x1024], + \ [0x2022, 0x2022], + \ [0x2024, 0x2025], + \ ], CharDictToPairList(dict)) + if v:errors != [] + echoerr 'CharDictToPairList' v:errors + return 1 + endif + return 0 +endfunc - " exclude characters that are in the "ambiguous" or "doublewidth" table - for ambi in s:ambitable - if first >= ambi[0] && first <= ambi[1] - let first = ambi[1] + 1 - endif - if last >= ambi[0] && last <= ambi[1] - let last = ambi[0] - 1 - endif - endfor - for double in s:doubletable - if first >= double[0] && first <= double[1] - let first = double[1] + 1 - endif - if last >= double[0] && last <= double[1] - let last = double[0] - 1 - endif - endfor - if first <= last - let token = [first, last] - if len(widthtokens) > 0 && (token[0] - 1 == widthtokens[-1][1]) - let widthtokens[-1][1] = token[1] - else - call add(widthtokens, token) - endif - endif - endfor - let allranges = map(alltokens, 'printf("\t{0x%04x, 0x%04x},", v:val[0], v:val[1])') - let widthranges = map(widthtokens, 'printf("\t{0x%04x, 0x%04x},", v:val[0], v:val[1])') +" Build the amoji width table in a new buffer. +func BuildEmojiTable() + " First make the table for all emojis. + let pattern = '; Emoji\s\+#\s' + let lines = map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 'v:val=~pattern'), 'matchstr(v:val,"^\\S\\+")') + + " Make a dictionary with an entry for each character. + let chardict = {} + call AddLinesToCharDict(lines, chardict) + let pairlist = CharDictToPairList(chardict) + let allranges = map(pairlist, 'printf(" {0x%04x, 0x%04x},", v:val[0], v:val[1])') " New buffer to put the result in. new - exe "file " . a:tableName . '_all' - call setline(1, " static struct interval " . a:tableName . "_all[] =") - call setline(2, " {") + exe 'file emoji_all' + call setline(1, "static struct interval emoji_all[] =") + call setline(2, "{") call append('$', allranges) call setline('$', getline('$')[:-2]) " remove last comma - call setline(line('$') + 1, " };") + call setline(line('$') + 1, "};") wincmd p + " Make the table for wide emojis. + let pattern = '; Emoji_\(Presentation\|Modifier_Base\)\s\+#\s' + let lines = map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 'v:val=~pattern'), 'matchstr(v:val,"^\\S\\+")') + + " Make a dictionary with an entry for each character. + let chardict = {} + call AddLinesToCharDict(lines, chardict) + + " exclude characters that are in the "ambiguous" or "doublewidth" table + for ambi in s:ambitable + for nr in range(ambi[0], ambi[1]) + if has_key(chardict, nr) + call remove(chardict, nr) + endif + endfor + endfor + + for wide in s:doubletable + for nr in range(wide[0], wide[1]) + if has_key(chardict, nr) + call remove(chardict, nr) + endif + endfor + endfor + + let pairlist = CharDictToPairList(chardict) + let wide_ranges = map(pairlist, 'printf("\t{0x%04x, 0x%04x},", v:val[0], v:val[1])') + " New buffer to put the result in. new - exe "file " . a:tableName . '_width' - call setline(1, " static struct interval " . a:tableName . "_width[] =") + exe 'file emoji_wide' + call setline(1, " static struct interval emoji_wide[] =") call setline(2, " {") - call append('$', widthranges) + call append('$', wide_ranges) call setline('$', getline('$')[:-2]) " remove last comma call setline(line('$') + 1, " };") wincmd p endfunc +" First test a few things +let v:errors = [] +if Test_AddLinesToCharDict() || Test_CharDictToPairList() + finish +endif + + " Try to avoid hitting E36 set equalalways @@ -383,9 +462,8 @@ let s:ambitable = [] call BuildWidthTable('A', 'ambiguous') " Edit the emoji text file. Requires the netrw plugin. -edit https://www.unicode.org/Public/emoji/11.0/emoji-data.txt -"edit http://www.unicode.org/Public/emoji/latest/emoji-data.txt +edit https://unicode.org/Public/emoji/12.1/emoji-data.txt " Build the emoji table. Ver. 1.0 - 6.0 -" Must come after the "ambiguous" table -call BuildEmojiTable('; Emoji\s\+#\s\+\d\+\.\d', 'emoji') +" Must come after the "ambiguous" and "doublewidth" tables +call BuildEmojiTable() diff --git a/runtime/tools/xcmdsrv_client.c b/runtime/tools/xcmdsrv_client.c index c0a60d216462c..e1aea10667914 100644 --- a/runtime/tools/xcmdsrv_client.c +++ b/runtime/tools/xcmdsrv_client.c @@ -509,7 +509,7 @@ SendEventProc( /* * Didn't recognize this thing. Just skip through the next * null character and try again. - * Also, throw away commands that we cant process anyway. + * Also, throw away commands that we can't process anyway. */ while (*p != 0) diff --git a/runtime/tutor/Makefile b/runtime/tutor/Makefile index b7b984a5c7ed1..3d1d560de71ec 100644 --- a/runtime/tutor/Makefile +++ b/runtime/tutor/Makefile @@ -11,7 +11,7 @@ all: tutor.utf-8 \ tutor.de.utf-8 \ tutor.el tutor.el.cp737 \ tutor.eo \ - tutor.es.utf-8 \ + tutor.es \ tutor.fr.utf-8 \ tutor.hr tutor.hr.cp1250 \ tutor.hu tutor.hu.cp1250 \ @@ -48,8 +48,8 @@ tutor.el: tutor.el.utf-8 tutor.el.cp737: tutor.el.utf-8 iconv -f UTF-8 -t cp737 tutor.el.utf-8 > tutor.el.cp737 -tutor.es.utf-8: tutor.es - iconv -f ISO-8859-1 -t UTF-8 tutor.es > tutor.es.utf-8 +tutor.es: tutor.es.utf-8 + iconv -f UTF-8 -t ISO-8859-1 tutor.es.utf-8 > tutor.es tutor.fr.utf-8: tutor.fr iconv -f ISO-8859-1 -t UTF-8 tutor.fr > tutor.fr.utf-8 diff --git a/runtime/tutor/tutor b/runtime/tutor/tutor index 426fb575697dc..98c41778453ca 100644 --- a/runtime/tutor/tutor +++ b/runtime/tutor/tutor @@ -7,7 +7,7 @@ enough of the commands that you will be able to easily use Vim as an all-purpose editor. - The approximate time required to complete the tutor is 25-30 minutes, + The approximate time required to complete the tutor is 30 minutes, depending upon how much time is spent with experimentation. ATTENTION: @@ -143,12 +143,12 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. !! NOTE: Before executing any of the steps below, read this entire lesson!! - 1. Exit this tutor as you did in lesson 1.2: :q! - Or, if you have access to another terminal, do the following there. + 1. If you have access to another terminal, do the following there. + Otherwise, exit this tutor as you did in lesson 1.2: :q! - 2. At the shell prompt type this command: vim tutor - 'vim' is the command to start the Vim editor, 'tutor' is the name of the - file you wish to edit. Use a file that may be changed. + 2. At the shell prompt type this command: vim file.txt + 'vim' is the command to start the Vim editor, 'file.txt' is the name of + the file you wish to edit. Use the name of a file that you can change. 3. Insert and delete text as you learned in the previous lessons. @@ -319,6 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> 6) Sugar is sweet ---> 7) And so are you. +Doubling to operate on a line also works for operators mentioned below. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.7: THE UNDO COMMAND @@ -346,25 +347,25 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2 SUMMARY + 1. To delete from the cursor up to the next word type: dw + 2. To delete from the cursor up to the end of the word type: de + 3. To delete from the cursor to the end of a line type: d$ + 4. To delete a whole line type: dd - 1. To delete from the cursor up to the next word type: dw - 2. To delete from the cursor to the end of a line type: d$ - 3. To delete a whole line type: dd - - 4. To repeat a motion prepend it with a number: 2w - 5. The format for a change command is: + 5. To repeat a motion prepend it with a number: 2w + 6. The format for a change command is: operator [number] motion where: operator - is what to do, such as d for delete [number] - is an optional count to repeat the motion motion - moves over the text to operate on, such as w (word), - $ (to the end of line), etc. + e (end of word), $ (end of the line), etc. - 6. To move to the start of the line use a zero: 0 + 7. To move to the start of the line use a zero: 0 - 7. To undo previous actions, type: u (lowercase u) + 8. To undo previous actions, type: u (lowercase u) To undo all the changes on a line, type: U (capital U) - To undo the undo's, type: CTRL-R + To undo the undo's, type: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.1: THE PUT COMMAND @@ -432,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization. ---> This line has a few words that need changing using the change operator. Notice that ce deletes the word and places you in Insert mode. - + cc does the same for the whole line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -802,7 +803,8 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an ---> a) this is the first item. b) - NOTE: You can also use y as an operator; yw yanks one word. + NOTE: You can also use y as an operator: yw yanks one word, + yy yanks the whole line, then p puts that line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.5: SET OPTION @@ -879,11 +881,11 @@ NOTE: If you want to ignore case for just one search command, use \c ** Enable Vim features ** Vim has many more features than Vi, but most of them are disabled by - default. To start using more features you have to create a "vimrc" file. + default. To start using more features you should create a "vimrc" file. 1. Start editing the "vimrc" file. This depends on your system: :e ~/.vimrc for Unix - :e $VIM/_vimrc for Windows + :e ~/_vimrc for Windows 2. Now read the example "vimrc" file contents: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +955,7 @@ NOTE: Completion works for many commands. Just try pressing CTRL-D and Publisher: New Riders The first book completely dedicated to Vim. Especially useful for beginners. There are many examples and pictures. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html This book is older and more about Vi than Vim, but also recommended: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.bar b/runtime/tutor/tutor.bar index 43fcdb8d3f659..ec30eddaf171d 100644 --- a/runtime/tutor/tutor.bar +++ b/runtime/tutor/tutor.bar @@ -884,7 +884,7 @@ Anm 1. LīŋŊg ayn "vimrc"-Dautticht an; dīŋŊs geet ie naach BetribsgebīŋŊu verschidn: :e ~/.vimrc fīŋŊr s Unix - :e $VIM/_vimrc bei n Fenstl + :e ~/_vimrc bei n Fenstl 2. Ietz lis īŋŊnn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: :r $VIMRUNTIME/vimrc_example.vim @@ -954,7 +954,7 @@ Anm Verlaag: New Riders DīŋŊs ist dīŋŊs eerste Buech, wo ganz yn n Wimm gwidmt ist, netty dīŋŊs Grechte fīŋŊr AnfīŋŊnger. Es haat ayn WīŋŊsn Beispiler und aau Bilder drinn. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html DīŋŊs folgete Buech ist schoon īŋŊlter und meerer īŋŊber n Urwimm als wie īŋŊber n Wimm, aber aau zo n Empfelhen: Textbearbeitung mit dem vi-Editor - von dyr @@ -968,7 +968,7 @@ Anm mitp-Verlaag, Buechlaittzal 978-3-8266-1781-2 Trotz dyr recht pfrengen DarstīŋŊllung ist s durch seine viln nīŋŊtzlichnen Bei- spiler aau fīŋŊr Einsteiger grad grecht. Probhaeupster und de Beispilschripfer - seind zesig zo n Kriegn; see http://iccf-holland.org/click5.html + seind zesig zo n Kriegn; see https://iccf-holland.org/click5.html Verfasst habnd dīŋŊnn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf EntwīŋŊrff, wo diff --git a/runtime/tutor/tutor.bar.utf-8 b/runtime/tutor/tutor.bar.utf-8 index b8e4d103908c3..42bea0eac2c54 100644 --- a/runtime/tutor/tutor.bar.utf-8 +++ b/runtime/tutor/tutor.bar.utf-8 @@ -884,7 +884,7 @@ AnmÃļrkung: Sollt klain/grooß bei ayner ainzignen Suech wurst sein, benutz \ 1. LÃļg ayn "vimrc"-Dautticht an; dÃļs geet ie naach Betribsgebäu verschidn: :e ~/.vimrc fÃŧr s Unix - :e $VIM/_vimrc bei n Fenstl + :e ~/_vimrc bei n Fenstl 2. Ietz lis Ãļnn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: :r $VIMRUNTIME/vimrc_example.vim @@ -954,7 +954,7 @@ AnmÃļrkung: D VergÃļntzung geit s fÃŧr aynn Hauffen Faudungen. Versuech ainfa Verlaag: New Riders DÃļs ist dÃļs eerste Buech, wo ganz yn n Wimm gwidmt ist, netty dÃļs Grechte fÃŧr AnfÃļnger. Es haat ayn WÃļsn Beispiler und aau Bilder drinn. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html DÃļs folgete Buech ist schoon Ãļlter und meerer Ãŧber n Urwimm als wie Ãŧber n Wimm, aber aau zo n Empfelhen: Textbearbeitung mit dem vi-Editor - von dyr @@ -968,7 +968,7 @@ AnmÃļrkung: D VergÃļntzung geit s fÃŧr aynn Hauffen Faudungen. Versuech ainfa mitp-Verlaag, Buechlaittzal 978-3-8266-1781-2 Trotz dyr recht pfrengen DarstÃļllung ist s durch seine viln nÃŧtzlichnen Bei- spiler aau fÃŧr Einsteiger grad grecht. Probhaeupster und de Beispilschripfer - seind zesig zo n Kriegn; see http://iccf-holland.org/click5.html + seind zesig zo n Kriegn; see https://iccf-holland.org/click5.html Verfasst habnd dÃļnn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf EntwÃŧrff, wo diff --git a/runtime/tutor/tutor.bg.utf-8 b/runtime/tutor/tutor.bg.utf-8 index bae4b965c030d..325ed784e58ba 100644 --- a/runtime/tutor/tutor.bg.utf-8 +++ b/runtime/tutor/tutor.bg.utf-8 @@ -944,8 +944,8 @@ ŅŅŠĐˇĐ´Đ°Đ´ĐĩŅ‚Đĩ Ņ„Đ°ĐšĐģ, ĐŊĐ°Ņ€Đĩ҇ĐĩĐŊ "vimrc". 1. ĐĄŅŠĐˇĐ´Đ°ĐšŅ‚Đĩ Đ˛Đ°ŅˆĐ¸Ņ Ņ„Đ°ĐšĐģ "vimrc". В ĐˇĐ°Đ˛Đ¸ŅĐ¸ĐŧĐžŅŅ‚ ĐžŅ‚ Đ˛Đ°ŅˆĐ°Ņ‚Đ° ĐžĐŋĐĩŅ€Đ°Ņ†Đ¸ĐžĐŊĐŊа ŅĐ¸ŅŅ‚ĐĩĐŧа: - :e ~/.vimrc Са Đ˛ŅĐĩĐēи вид Unix - :e $VIM/_vimrc Са MS-Windows + :e ~/.vimrc Са Đ˛ŅĐĩĐēи вид Unix + :e ~/_vimrc Са MS-Windows 2. ĐĄĐĩĐŗĐ° ĐŋŅ€ĐžŅ‡ĐĩŅ‚ĐĩŅ‚Đĩ ŅŅŠĐ´ŅŠŅ€ĐļаĐŊиĐĩŅ‚Đž ĐŊа ĐŋŅ€Đ¸ĐŧĐĩŅ€ĐŊĐ¸Ņ Ņ„Đ°ĐšĐģ "vimrc": :r $VIMRUNTIME/vimrc_example.vim @@ -1017,7 +1017,7 @@ Đ˜ĐˇĐ´Đ°Ņ‚ĐĩĐģ: New Riders ĐĸОва Đĩ ĐŋŅŠŅ€Đ˛Đ°Ņ‚Đ° ĐēĐŊĐ¸ĐŗĐ°, Đ¸ĐˇŅ†ŅĐģĐž ĐŋĐžŅĐ˛ĐĩŅ‚ĐĩĐŊа ĐŊа Vim. ĐžŅĐžĐąĐĩĐŊĐž ĐŋĐžĐģĐĩСĐŊа Đĩ Са ĐŊĐ°Ņ‡Đ¸ĐŊаĐĩŅ‰Đ¸. В ĐŊĐĩŅ ҉Đĩ ĐŊаĐŧĐĩŅ€Đ¸Ņ‚Đĩ ĐŧĐŊĐžĐŗĐž ĐŋŅ€Đ¸ĐŧĐĩŅ€Đ¸ и ĐēĐ°Ņ€Ņ‚Đ¸ĐŊĐēи. - ВиĐļŅ‚Đĩ http://iccf-holland.org/click5.html + ВиĐļŅ‚Đĩ https://iccf-holland.org/click5.html ĐĄĐģĐĩĐ´ĐŊĐ°Ņ‚Đ° ĐēĐŊĐ¸ĐŗĐ° Đĩ ĐŋĐž-ŅŅ‚Đ°Ņ€Đ° и ĐŋĐž-ҁĐēĐžŅ€Đž Са Vi ĐžŅ‚ĐēĐžĐģĐēĐžŅ‚Đž Са Vim, ĐŊĐž ŅŅŠŅ‰Đž ҁĐĩ ĐŋŅ€ĐĩĐŋĐžŅ€ŅŠŅ‡Đ˛Đ°: Learning the Vi Editor - ĐžŅ‚ Linda Lamb diff --git a/runtime/tutor/tutor.ca b/runtime/tutor/tutor.ca index 90ed6606c69a5..808a87d61bfb7 100644 --- a/runtime/tutor/tutor.ca +++ b/runtime/tutor/tutor.ca @@ -767,8 +767,8 @@ Nota: Aix fitxer "vimrc". 1. Comenceu a editar el fitxer "vimrc", depenent del sistema - :edit ~/.vimrc per Unix - :edit $VIM/_vimrc per MS-Windows + :edit ~/.vimrc per Unix + :edit ~/_vimrc per MS-Windows 2. Llegiu el fitxer "vimrc" d'exemple: @@ -792,7 +792,7 @@ Nota: Aix Editorial: New Riders īŋŊs el primer llibre dedicat completament al Vim, especialment īŋŊtil per a usuaris novells. ContīŋŊ molts exemples i diagrames. - Vegeu http://iccf-holland.org/click5.html + Vegeu https://iccf-holland.org/click5.html Aquest altre īŋŊs mīŋŊs vell i tracta mīŋŊs sobre el Vi que sobre el Vim: Learning the Vi Editor - de Linda Lamb diff --git a/runtime/tutor/tutor.ca.utf-8 b/runtime/tutor/tutor.ca.utf-8 index 627c0cee33f01..f39154b8039bd 100644 --- a/runtime/tutor/tutor.ca.utf-8 +++ b/runtime/tutor/tutor.ca.utf-8 @@ -767,8 +767,8 @@ Nota: Així s'evita haver de prÊmer i , l'Ãēltim caràcter, el text a inserir, fitxer "vimrc". 1. Comenceu a editar el fitxer "vimrc", depenent del sistema - :edit ~/.vimrc per Unix - :edit $VIM/_vimrc per MS-Windows + :edit ~/.vimrc per Unix + :edit ~/_vimrc per MS-Windows 2. Llegiu el fitxer "vimrc" d'exemple: @@ -792,7 +792,7 @@ Nota: Així s'evita haver de prÊmer i , l'Ãēltim caràcter, el text a inserir, Editorial: New Riders És el primer llibre dedicat completament al Vim, especialment Ãētil per a usuaris novells. ContÊ molts exemples i diagrames. - Vegeu http://iccf-holland.org/click5.html + Vegeu https://iccf-holland.org/click5.html Aquest altre Ês mÊs vell i tracta mÊs sobre el Vi que sobre el Vim: Learning the Vi Editor - de Linda Lamb diff --git a/runtime/tutor/tutor.cs b/runtime/tutor/tutor.cs index d8e170db90a87..6d62bb583857f 100644 --- a/runtime/tutor/tutor.cs +++ b/runtime/tutor/tutor.cs @@ -765,8 +765,8 @@ Vim m nastavenīŋŊ. Pro zapnutīŋŊ nīŋŊkterīŋŊch vytvoīŋŊ soubor "vimrc". 1. ZaīŋŊni upravovat soubor "vimrc". Toto zīŋŊvisīŋŊ na pouīŋŊitīŋŊm systīŋŊmu: - :edit ~/.vimrc pro Unix - :edit $VIM/_vimrc pro MS-Windows + :edit ~/.vimrc pro Unix + :edit ~/_vimrc pro MS-Windows 2. NynīŋŊ īŋŊti ukīŋŊzkovīŋŊ "vimrc" soubor: @@ -791,7 +791,7 @@ Do souboru "vimrc" m Nakladatel: New Riders PrvnīŋŊ kniha urīŋŊenīŋŊ pro Vim. ObzvlīŋŊtīŋŊ vhodnīŋŊ pro zaīŋŊīŋŊteīŋŊnīŋŊky. Obsahuje mnoīŋŊstvīŋŊ pīŋŊīŋŊkladīŋŊ a obrīŋŊzkīŋŊ. - viz http://iccf-holland.org/click5.html + viz https://iccf-holland.org/click5.html Tato kniha je starīŋŊīŋŊ a vīŋŊce vīŋŊnovanīŋŊ Vi neīŋŊ Vim, ale takīŋŊ doporuīŋŊenīŋŊ: Learning the Vi Editor - od Linda Lamb diff --git a/runtime/tutor/tutor.cs.cp1250 b/runtime/tutor/tutor.cs.cp1250 index 9266cd53065f4..26567db91cfd7 100644 --- a/runtime/tutor/tutor.cs.cp1250 +++ b/runtime/tutor/tutor.cs.cp1250 @@ -765,8 +765,8 @@ Pozn nastavenīŋŊ. Pro zapnutīŋŊ nīŋŊkterīŋŊch vytvoīŋŊ soubor "vimrc". 1. ZaīŋŊni upravovat soubor "vimrc". Toto zīŋŊvisīŋŊ na pouīŋŊitīŋŊm systīŋŊmu: - :edit ~/.vimrc pro Unix - :edit $VIM/_vimrc pro MS-Windows + :edit ~/.vimrc pro Unix + :edit ~/_vimrc pro MS-Windows 2. NynīŋŊ īŋŊti ukīŋŊzkovīŋŊ "vimrc" soubor: @@ -791,7 +791,7 @@ Pozn Nakladatel: New Riders PrvnīŋŊ kniha urīŋŊenīŋŊ pro Vim. ObzvlīŋŊtīŋŊ vhodnīŋŊ pro zaīŋŊīŋŊteīŋŊnīŋŊky. Obsahuje mnoīŋŊstvīŋŊ pīŋŊīŋŊkladīŋŊ a obrīŋŊzkīŋŊ. - viz http://iccf-holland.org/click5.html + viz https://iccf-holland.org/click5.html Tato kniha je starīŋŊīŋŊ a vīŋŊce vīŋŊnovanīŋŊ Vi neīŋŊ Vim, ale takīŋŊ doporuīŋŊenīŋŊ: Learning the Vi Editor - od Linda Lamb diff --git a/runtime/tutor/tutor.cs.utf-8 b/runtime/tutor/tutor.cs.utf-8 index 58ad83df6c1bd..36bb3a2d0fd0e 100644 --- a/runtime/tutor/tutor.cs.utf-8 +++ b/runtime/tutor/tutor.cs.utf-8 @@ -765,8 +765,8 @@ PoznÃĄmka: Tímto se vyhneÅĄ stisknutí i , posledního znaku, textu na vloÅže nastavení. Pro zapnutí některÃŊch vytvoř soubor "vimrc". 1. Začni upravovat soubor "vimrc". Toto zÃĄvisí na pouÅžitÊm systÊmu: - :edit ~/.vimrc pro Unix - :edit $VIM/_vimrc pro MS-Windows + :edit ~/.vimrc pro Unix + :edit ~/_vimrc pro MS-Windows 2. Nyní čti ukÃĄzkovÃŊ "vimrc" soubor: @@ -791,7 +791,7 @@ PoznÃĄmka: Tímto se vyhneÅĄ stisknutí i , posledního znaku, textu na vloÅže Nakladatel: New Riders První kniha určenÃĄ pro Vim. ObzvlÃĄÅĄtě vhodnÃĄ pro zaÄÃĄtečníky. Obsahuje mnoÅžství příkladů a obrÃĄzků. - viz http://iccf-holland.org/click5.html + viz https://iccf-holland.org/click5.html Tato kniha je starÅĄÃ­ a více věnovanÃĄ Vi neÅž Vim, ale takÊ doporučenÃĄ: Learning the Vi Editor - od Linda Lamb diff --git a/runtime/tutor/tutor.da b/runtime/tutor/tutor.da index fe72405cc0b9a..ba62fce53c623 100644 --- a/runtime/tutor/tutor.da +++ b/runtime/tutor/tutor.da @@ -883,7 +883,7 @@ BEM 1. Begynd at redigere "vimrc"-filen. Det afhīŋŊnger af dit system: :e ~/.vimrc i Unix - :e $VIM/_vimrc i MS-Windows + :e ~/_vimrc i MS-Windows 2. LīŋŊs nu indholdet af eksempel "vimrc"-filen: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ BEM Forlag: New Riders Den fīŋŊrste bog som helt er tilegnet Vim. Specielt nyttig for begyndere. Der er mange eksempler og billeder. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Denne bog er īŋŊldre og mere om Vi end Vim, men anbefales ogsīŋŊ: Learning the Vi Editor - af Linda Lamb diff --git a/runtime/tutor/tutor.da.utf-8 b/runtime/tutor/tutor.da.utf-8 index fc46d977b8985..dad3ea8a7e3df 100644 --- a/runtime/tutor/tutor.da.utf-8 +++ b/runtime/tutor/tutor.da.utf-8 @@ -11,7 +11,7 @@ afhÃĻngig af hvor meget tid der bruges pÃĨ at eksperimentere. VÆR OPMÆRKSOM PÅ AT: - Kommandoerne i lektionerne ÃĻndre teksten. Opret en kopi af filen + Kommandoerne i lektionerne ÃĻndrer teksten. Opret en kopi af filen til at øve pÃĨ (hvis du startede "vimtutor", sÃĨ er det allerede en kopi). Det er vigtigt at huske pÃĨ at vejledningen er sat op til at lÃĻre ved at @@ -883,7 +883,7 @@ BEMÆRK: Hvis du vil ignorere case for en enkelt søg-kommando, sÃĨ brug \c 1. Begynd at redigere "vimrc"-filen. Det afhÃĻnger af dit system: :e ~/.vimrc i Unix - :e $VIM/_vimrc i MS-Windows + :e ~/_vimrc i MS-Windows 2. LÃĻs nu indholdet af eksempel "vimrc"-filen: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ BEMÆRK: Fuldførelse virker til mange kommandoer. Prøv blot at trykke pÃĨ Forlag: New Riders Den første bog som helt er tilegnet Vim. Specielt nyttig for begyndere. Der er mange eksempler og billeder. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Denne bog er ÃĻldre og mere om Vi end Vim, men anbefales ogsÃĨ: Learning the Vi Editor - af Linda Lamb diff --git a/runtime/tutor/tutor.de b/runtime/tutor/tutor.de index 92988b6a0fdf4..599fdc7b64c01 100644 --- a/runtime/tutor/tutor.de +++ b/runtime/tutor/tutor.de @@ -886,7 +886,7 @@ Anmerkung: Um die Schreibweise f 1. Starte das Editieren der "vimrc"-Datei, abhīŋŊngig von deinem System: :e ~/.vimrc fīŋŊr Unix - :e $VIM/_vimrc fīŋŊr MS-Windows + :e ~/_vimrc fīŋŊr MS-Windows 2. Nun lies den Inhalt der Beispiel-"vimrc"-Datei ein: :r $VIMRUNTIME/vimrc_example.vim @@ -956,7 +956,7 @@ Anmerkung: Vervollst Verlag: New Riders Das erste Buch, welches durchgīŋŊngig Vim gewidmet ist. Besonders nīŋŊtzlich fīŋŊr AnfīŋŊnger. Viele Beispiele und Bilder sind enthalten. - Siehe http://iccf-holland.org/click5.html + Siehe https://iccf-holland.org/click5.html Folgendes Buch ist īŋŊlter und mehr īŋŊber Vi als Vim, aber auch empfehlenswert: Textbearbeitung mit dem Vi-Editor - von Linda Lamb und Arnold Robbins @@ -970,7 +970,7 @@ Anmerkung: Vervollst mitp-Verlag, ISBN 3-8266-1425-9 Trotz der kompakten Darstellung ist es durch viele nīŋŊtzliche Beispiele auch fīŋŊr Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind - online erhīŋŊltlich. Siehe http://iccf-holland.org/click5.html + online erhīŋŊltlich. Siehe https://iccf-holland.org/click5.html Dieses Tutorial wurde geschrieben von Michael C. Pierce und Robert K. Ware, Colorado School of Mines. Es benutzt Ideen, die Charles Smith, Colorado State diff --git a/runtime/tutor/tutor.de.utf-8 b/runtime/tutor/tutor.de.utf-8 index 283550a2556d7..9a5b592d9fea8 100644 --- a/runtime/tutor/tutor.de.utf-8 +++ b/runtime/tutor/tutor.de.utf-8 @@ -886,7 +886,7 @@ Anmerkung: Um die Schreibweise fÃŧr eine einzige Suche zu ignorieren, benutze \c 1. Starte das Editieren der "vimrc"-Datei, abhängig von deinem System: :e ~/.vimrc fÃŧr Unix - :e $VIM/_vimrc fÃŧr MS-Windows + :e ~/_vimrc fÃŧr MS-Windows 2. Nun lies den Inhalt der Beispiel-"vimrc"-Datei ein: :r $VIMRUNTIME/vimrc_example.vim @@ -956,7 +956,7 @@ Anmerkung: Vervollständigung funktioniert fÃŧr viele Kommandos. Probiere Verlag: New Riders Das erste Buch, welches durchgängig Vim gewidmet ist. Besonders nÃŧtzlich fÃŧr Anfänger. Viele Beispiele und Bilder sind enthalten. - Siehe http://iccf-holland.org/click5.html + Siehe https://iccf-holland.org/click5.html Folgendes Buch ist älter und mehr Ãŧber Vi als Vim, aber auch empfehlenswert: Textbearbeitung mit dem Vi-Editor - von Linda Lamb und Arnold Robbins @@ -970,7 +970,7 @@ Anmerkung: Vervollständigung funktioniert fÃŧr viele Kommandos. Probiere mitp-Verlag, ISBN 3-8266-1425-9 Trotz der kompakten Darstellung ist es durch viele nÃŧtzliche Beispiele auch fÃŧr Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind - online erhältlich. Siehe http://iccf-holland.org/click5.html + online erhältlich. Siehe https://iccf-holland.org/click5.html Dieses Tutorial wurde geschrieben von Michael C. Pierce und Robert K. Ware, Colorado School of Mines. Es benutzt Ideen, die Charles Smith, Colorado State diff --git a/runtime/tutor/tutor.el b/runtime/tutor/tutor.el index 126a391e6f735..9a2fd98c62986 100644 --- a/runtime/tutor/tutor.el +++ b/runtime/tutor/tutor.el @@ -768,8 +768,8 @@ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ "vimrc". 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ "vimrc", īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ: - :edit ~/.vimrc īŋŊīŋŊīŋŊ Unix - :edit $VIM/_vimrc īŋŊīŋŊīŋŊ MS-Windows + :edit ~/.vimrc īŋŊīŋŊīŋŊ Unix + :edit ~/_vimrc īŋŊīŋŊīŋŊ MS-Windows 2. īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ "vimrc": :read $VIMRUNTIME/vimrc_example.vim @@ -796,7 +796,7 @@ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ Vim. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ. - īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ http://iccf-holland.org/click5.html + īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ Vi īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ Vim, īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: diff --git a/runtime/tutor/tutor.el.cp737 b/runtime/tutor/tutor.el.cp737 index 8ef6f74541ac7..64833444b1419 100644 --- a/runtime/tutor/tutor.el.cp737 +++ b/runtime/tutor/tutor.el.cp737 @@ -768,8 +768,8 @@ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊæĢœīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ⧜īŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊáĨœīŋŊīŋŊ ⤘ īŋŊīŋŊīŋŊīŋŊīŋŊ "vimrc". 1. īŋŊīŋŊīŋŊåŠĢīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊé¤ĻīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ "vimrc", īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊá̘īŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊįŠĢīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ: - :edit ~/.vimrc īŋŊīŋŊīŋŊ Unix - :edit $VIM/_vimrc īŋŊīŋŊīŋŊ MS-Windows + :edit ~/.vimrc īŋŊīŋŊīŋŊ Unix + :edit ~/_vimrc īŋŊīŋŊīŋŊ MS-Windows 2. īŋŊ騘 īŋŊīŋŊīŋŊ᚜īŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊ媜īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ嚪īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ "vimrc": :read $VIMRUNTIME/vimrc_example.vim @@ -796,7 +796,7 @@ īŋŊīŋŊ īŋŊīŋŊéĢĻ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâ¤Ļ īŋŊīŋŊīŋŊīŋŊ Vim. īŋŊīŋŊīŋŊīŋŊå̜īŋŊīŋŊ īŋŊīŋŊ㊠īŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊᨠīŋŊīŋŊīŋŊ. īŋŊīŋŊᨎīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ嚪īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ検īŋŊ. - īŋŊīŋŊå̜ īŋŊīŋŊīŋŊ http://iccf-holland.org/click5.html + īŋŊīŋŊå̜ īŋŊīŋŊīŋŊ https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ夘īŋŊ īŋŊīŋŊīŋŊīŋŊæĢœīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊæĢœīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ Vi īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ Vim, īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ办īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ骜īŋŊīŋŊ: diff --git a/runtime/tutor/tutor.el.utf-8 b/runtime/tutor/tutor.el.utf-8 index b8bfbe7fe0db8..7cb9741293463 100644 --- a/runtime/tutor/tutor.el.utf-8 +++ b/runtime/tutor/tutor.el.utf-8 @@ -768,8 +768,8 @@ Ī€ÎĩĪÎšĪƒĪƒĪŒĪ„ÎĩĪÎą Ī‡ÎąĪÎąÎēĪ„ÎˇĪÎšĪƒĪ„ÎšÎēÎŦ Ī€ĪÎ­Ī€ÎĩΚ ÎŊÎą Ī†Ī„ÎšÎŦΞÎĩĪ„Îĩ έÎŊÎą ÎąĪĪ‡ÎĩίÎŋ "vimrc". 1. Î‘ĪĪ‡Î¯ĪƒĪ„Îĩ δΚÎŋĪÎ¸ĪŽÎŊÎŋÎŊĪ„ÎąĪ‚ Ī„Îŋ ÎąĪĪ‡ÎĩίÎŋ "vimrc", ÎąĪ…Ī„ĪŒ ÎĩÎžÎąĪĪ„ÎŦĪ„ÎąÎš ÎąĪ€ĪŒ Ī„Îŋ ĪƒĪĪƒĪ„ÎˇÎŧÎŦ ĪƒÎąĪ‚: - :edit ~/.vimrc ÎŗÎšÎą Unix - :edit $VIM/_vimrc ÎŗÎšÎą MS-Windows + :edit ~/.vimrc ÎŗÎšÎą Unix + :edit ~/_vimrc ÎŗÎšÎą MS-Windows 2. Î¤ĪŽĪÎą ÎĩÎšĪƒÎŦÎŗÎĩĪ„Îĩ Ī„Îŋ ÎēÎĩίÎŧÎĩÎŊÎŋ Ī€ÎąĪÎąÎ´ÎĩÎ¯ÎŗÎŧÎąĪ„ÎŋĪ‚ ÎŗÎšÎą ÎąĪĪ‡ÎĩίÎŋ "vimrc": :read $VIMRUNTIME/vimrc_example.vim @@ -796,7 +796,7 @@ ΤÎŋ Ī€ĪĪŽĪ„Îŋ βΚβÎģίÎŋ Ī€ÎģÎŽĪĪ‰Ī‚ ÎąĪ†ÎšÎĩ΁ΉÎŧέÎŊÎŋ ĪƒĪ„ÎŋÎŊ Vim. Î™Î´ÎšÎąÎ¯Ī„ÎĩĪÎą Ī‡ĪÎŽĪƒÎšÎŧÎŋ ÎŗÎšÎą ÎąĪĪ‡ÎŦĪÎšÎŋĪ…Ī‚. ÎĨĪ€ÎŦ΁·ÎŋĪ…ÎŊ Ī€ÎŋÎģÎģÎŦ Ī€ÎąĪÎąÎ´ÎĩÎ¯ÎŗÎŧÎąĪ„Îą ÎēιΚ ÎĩΚÎēΌÎŊÎĩĪ‚. - ΔÎĩÎ¯Ī„Îĩ Ī„ÎˇÎŊ http://iccf-holland.org/click5.html + ΔÎĩÎ¯Ī„Îĩ Ī„ÎˇÎŊ https://iccf-holland.org/click5.html Î‘Ī…Ī„ĪŒ Ī„Îŋ βΚβÎģίÎŋ ÎĩίÎŊιΚ Ī€ÎąÎģÎšĪŒĪ„Îĩ΁Îŋ ÎēιΚ Ī€ÎĩĪÎšĪƒĪƒĪŒĪ„Îĩ΁Îŋ ÎŗÎšÎą Ī„ÎŋÎŊ Vi Ī€ÎąĪÎŦ ÎŗÎšÎą Ī„ÎŋÎŊ Vim, ÎąÎģÎģÎŦ ÎĩĪ€Î¯ĪƒÎˇĪ‚ ĪƒĪ…ÎŊÎšĪƒĪ„ĪŽÎŧÎĩÎŊÎŋ: diff --git a/runtime/tutor/tutor.eo b/runtime/tutor/tutor.eo index 11a0b9d00235e..b33699e04bc64 100644 --- a/runtime/tutor/tutor.eo +++ b/runtime/tutor/tutor.eo @@ -7,7 +7,7 @@ fasonita por priskribi sufiīŋŊajn komandojn, por ke vi kapablu uzi Vim kun sufiīŋŊa facileco. - La tempo bezonata por plenumi la kurson estas 25-30 minutoj, kaj dependas + La tempo bezonata por plenumi la kurson estas 30 minutoj, kaj dependas de kiom da tempo estas uzata por eksperimenti. ATENTU: @@ -100,7 +100,7 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. 1. Movu la kursoron al la unua suba linio markita per --->. 2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan - signon post kie la teksto estas enmetenda. + signon antaīŋŊ kie la teksto estas enmetenda. 3. Premu i kaj tajpu la bezonatajn aldonojn. @@ -200,7 +200,7 @@ Nun da 1. Premu por certigi, ke vi estas en normala reīŋŊimo. - 2. Movu la kursoron al la linio markita per --->. + 2. Movu la kursoron al la suba linio markita per --->. 3. Movu la kursoron al la komenco de vorto, kiu forviīŋŊendas. @@ -225,7 +225,7 @@ Nun da 1. Premu por certigi, ke vi estas en normala reīŋŊimo. - 2. Movu la kursoron sur la suban linion markita per --->. + 2. Movu la kursoron al la suba linio markita per --->. 3. Movu la kursoron īŋŊe la fino de la īŋŊusta linio (POST la unua . ). @@ -296,10 +296,10 @@ RIMARKO: Premo de nur la movo en Normala re 1. Movu la kursoron īŋŊe la unua MAJUSKLA vorto en la linio markita per --->. - 2. Tajpu d2w por forviīŋŊi la du MAJUSKLAJN vortojn + 2. Tajpu d2w por forviīŋŊi la du MAJUSKLAJN vortojn. 3. Ripetu paīŋŊojn 1 īŋŊis 2 per malsama nombro por forviīŋŊi la sinsekvajn - MAJUSKLAJN vortojn per unu komando + MAJUSKLAJN vortojn per unu komando. ---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita. @@ -379,7 +379,7 @@ RIMARKO: Premo de nur la movo en Normala re ** Tajpu p por meti tekston forviīŋŊitan antaīŋŊe post la kursoro. ** - 1. Movu la kursoron īŋŊe la unua ---> suba linio. + 1. Movu la kursoron īŋŊe la unua suba linio markita per --->. 2. Tajpu dd por forviīŋŊi la linion kaj konservi īŋŊin ene de reīŋŊistro de Vim. @@ -652,7 +652,7 @@ RIMARKO: Se vi volus eliri el Vim kaj restartigi la dosiero estus precize same kiel kopio de la instruilo kiam vi konservis īŋŊin. - 5. Nun forviīŋŊu la dosieron tajpante (WINDOWS): :!del TESTO + 5. Nun forviīŋŊu la dosieron tajpante (VINDOZO): :!del TESTO aīŋŊ (UNIKSO): :!rm TESTO @@ -713,7 +713,7 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, 1. :!komando plenumas eksteran komandon. Iuj utilaj ekzemploj estas: - (WINDOWS) (UNIKSO) + (VINDOZO) (UNIKSO) :!dir :!ls - listigas dosierujon :!del DOSIERNOMO :!rm DOSIERNOMO - forviīŋŊas la dosieron DOSIERNOMO @@ -808,7 +808,7 @@ RIMARKO: Anstata ** Uzu la y operatoron por kopii tekston, kaj p por alglui īŋŊin ** - 1. Iru al la linio markita per ---> sube kaj poziciu la kursoron post "a)". + 1. Iru al la suba linio markita per ---> kaj poziciu la kursoron post "a)". 2. Komencu la Viduman reīŋŊimon per v kaj movu la kursoron tuj antaīŋŊ "unua". @@ -914,7 +914,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser 1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo: :e ~/.vimrc por Unikso - :e $VIM/_vimrc por Windows + :e ~/_vimrc por Vindozo 2. Nun legu la enhavon de la ekzempla "vimrc" :r $VIMRUNTIME/vimrc_example.vim @@ -945,7 +945,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser 6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI - 7. Premu . Vim kompletigos la nomon (se īŋŊi estas unika) + 7. Premu d. Vim kompletigos la nomon (se īŋŊi estas unika) RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj . Estas aparte utila por :help . @@ -986,6 +986,6 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj Esperantigita fare de Dominique PellīŋŊ, 2008-04-01 RetpoīŋŊto: dominique.pelle@gmail.com - Lasta īŋŊanīŋŊo: 2018-12-02 + Lasta īŋŊanīŋŊo: 2020-07-19 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.eo.utf-8 b/runtime/tutor/tutor.eo.utf-8 index 1b3873c13dad4..1feeeb93fe37d 100644 --- a/runtime/tutor/tutor.eo.utf-8 +++ b/runtime/tutor/tutor.eo.utf-8 @@ -7,7 +7,7 @@ fasonita por priskribi sufiĉajn komandojn, por ke vi kapablu uzi Vim kun sufiĉa facileco. - La tempo bezonata por plenumi la kurson estas 25-30 minutoj, kaj dependas + La tempo bezonata por plenumi la kurson estas 30 minutoj, kaj dependas de kiom da tempo estas uzata por eksperimenti. ATENTU: @@ -100,7 +100,7 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. 1. Movu la kursoron al la unua suba linio markita per --->. 2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan - signon post kie la teksto estas enmetenda. + signon antaÅ­ kie la teksto estas enmetenda. 3. Premu i kaj tajpu la bezonatajn aldonojn. @@ -200,7 +200,7 @@ Nun daÅ­rigu al la leciono 2. 1. Premu por certigi, ke vi estas en normala reĝimo. - 2. Movu la kursoron al la linio markita per --->. + 2. Movu la kursoron al la suba linio markita per --->. 3. Movu la kursoron al la komenco de vorto, kiu forviŝendas. @@ -225,7 +225,7 @@ Nun daÅ­rigu al la leciono 2. 1. Premu por certigi, ke vi estas en normala reĝimo. - 2. Movu la kursoron sur la suban linion markita per --->. + 2. Movu la kursoron al la suba linio markita per --->. 3. Movu la kursoron ĉe la fino de la ĝusta linio (POST la unua . ). @@ -296,10 +296,10 @@ RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos 1. Movu la kursoron ĉe la unua MAJUSKLA vorto en la linio markita per --->. - 2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn + 2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn. 3. Ripetu paŝojn 1 ĝis 2 per malsama nombro por forviŝi la sinsekvajn - MAJUSKLAJN vortojn per unu komando + MAJUSKLAJN vortojn per unu komando. ---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita. @@ -379,7 +379,7 @@ RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos ** Tajpu p por meti tekston forviŝitan antaÅ­e post la kursoro. ** - 1. Movu la kursoron ĉe la unua ---> suba linio. + 1. Movu la kursoron ĉe la unua suba linio markita per --->. 2. Tajpu dd por forviŝi la linion kaj konservi ĝin ene de reĝistro de Vim. @@ -652,7 +652,7 @@ RIMARKO: Se vi volus eliri el Vim kaj restartigi ĝin denove per vim TESTO, la dosiero estus precize same kiel kopio de la instruilo kiam vi konservis ĝin. - 5. Nun forviŝu la dosieron tajpante (WINDOWS): :!del TESTO + 5. Nun forviŝu la dosieron tajpante (VINDOZO): :!del TESTO aÅ­ (UNIKSO): :!rm TESTO @@ -713,7 +713,7 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, 1. :!komando plenumas eksteran komandon. Iuj utilaj ekzemploj estas: - (WINDOWS) (UNIKSO) + (VINDOZO) (UNIKSO) :!dir :!ls - listigas dosierujon :!del DOSIERNOMO :!rm DOSIERNOMO - forviŝas la dosieron DOSIERNOMO @@ -808,7 +808,7 @@ RIMARKO: AnstataÅ­iga reĝimo estas same kiel Enmeta reĝimo, sed ĉiu signo ** Uzu la y operatoron por kopii tekston, kaj p por alglui ĝin ** - 1. Iru al la linio markita per ---> sube kaj poziciu la kursoron post "a)". + 1. Iru al la suba linio markita per ---> kaj poziciu la kursoron post "a)". 2. Komencu la Viduman reĝimon per v kaj movu la kursoron tuj antaÅ­ "unua". @@ -914,7 +914,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c 1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo: :e ~/.vimrc por Unikso - :e $VIM/_vimrc por Windows + :e ~/_vimrc por Vindozo 2. Nun legu la enhavon de la ekzempla "vimrc" :r $VIMRUNTIME/vimrc_example.vim @@ -945,7 +945,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c 6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI - 7. Premu . Vim kompletigos la nomon (se ĝi estas unika) + 7. Premu d. Vim kompletigos la nomon (se ĝi estas unika) RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj . Estas aparte utila por :help . @@ -986,6 +986,6 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj Esperantigita fare de Dominique PellÊ, 2008-04-01 Retpoŝto: dominique.pelle@gmail.com - Lasta ŝanĝo: 2018-12-02 + Lasta ŝanĝo: 2020-07-19 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.es b/runtime/tutor/tutor.es index 3665e95e17dfa..7619fbc49c471 100644 --- a/runtime/tutor/tutor.es +++ b/runtime/tutor/tutor.es @@ -1,84 +1,84 @@ =============================================================================== -= B i e n v e n i d o a l t u t o r d e V I M - VersiīŋŊn 1.4 = += B i e n v e n i d o a l t u t o r d e V I M - VersiīŋŊn 1.7 = =============================================================================== - Vim es un editor muy potente que dispone de muchos mandatos, demasiados + Vim es un editor muy potente que dispone de muchos comandos, demasiados para ser explicados en un tutor como īŋŊste. Este tutor estīŋŊ diseīŋŊado - para describir suficientes mandatos para que usted sea capaz de + para describir suficientes comandos para que usted sea capaz de aprender fīŋŊcilmente a usar Vim como un editor de propīŋŊsito general. - El tiempo necesario para completar el tutor es aproximadamente de 25-30 - minutos, dependiendo de cuanto tiempo se dedique a la experimentaciīŋŊn. + El tiempo necesario para completar el tutor es aproximadamente de 30 + minutos, dependiendo de cuīŋŊnto tiempo se dedique a la experimentaciīŋŊn. - Los mandatos de estas lecciones modificarīŋŊn el texto. Haga una copia de + Los comandos de estas lecciones modificarīŋŊn el texto. Haga una copia de este fichero para practicar (con īŋŊvimtutorīŋŊ esto ya es una copia). Es importante recordar que este tutor estīŋŊ pensado para enseīŋŊar con - la prīŋŊctica. Esto significa que es necesario ejecutar los mandatos - para aprenderlos adecuadamente. Si īŋŊnicamente se lee el texto, se - olvidarīŋŊn los mandatos. + la prīŋŊctica. Esto significa que es necesario ejecutar los comandos + para aprenderlos adecuadamente. Si īŋŊnicamente lee el texto, īŋŊse le + olvidarīŋŊn los comandos. - Ahora, asegīŋŊrese de que la tecla de bloqueo de mayīŋŊsculas no estīŋŊ + Ahora, asegīŋŊrese de que la tecla de bloqueo de mayīŋŊsculas NO estīŋŊ activada y pulse la tecla j lo suficiente para mover el cursor de forma que la LecciīŋŊn 1.1 ocupe completamente la pantalla. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 1.1: MOVIMIENTOS DEL CURSOR + LecciīŋŊn 1.1: MOVER EL CURSOR - ** Para mover el cursor, pulse las teclas h,j,k,l de la forma que se indica. ** + ** Para mover el cursor, pulse las teclas h,j,k,l de la forma indicada. ** ^ - k IndicaciīŋŊn: La tecla h estīŋŊ a la izquierda y mueve a la izquierda. - < h l > La tecla l estīŋŊ a la derecha y mueve a la derecha. + k IndicaciīŋŊn: La tecla h estīŋŊ a la izquierda y lo mueve a la izquierda. + < h l > La tecla l estīŋŊ a la derecha y lo mueve a la derecha. j La tecla j parece una flecha que apunta hacia abajo. v 1. Mueva el cursor por la pantalla hasta que se sienta cīŋŊmodo con ello. - 2. Mantenga pulsada la tecla j hasta que se repita īŋŊautomīŋŊgicamenteīŋŊ. ----> Ahora ya sabe como llegar a la lecciīŋŊn siguiente. + 2. Mantenga pulsada la tecla (j) hasta que se repita īŋŊautomīŋŊgicamenteīŋŊ. + Ahora ya sabe como llegar a la lecciīŋŊn siguiente. - 3. Utilizando la tecla abajo, vaya a la LecciīŋŊn 1.2. + 3. Utilizando la tecla abajo, vaya a la lecciīŋŊn 1.2. -Nota: Si alguna vez no estīŋŊ seguro sobre algo que ha tecleado, pulse +NOTA: Si alguna vez no estīŋŊ seguro sobre algo que ha tecleado, pulse para situarse en modo Normal. Luego vuelva a teclear la orden que deseaba. -Nota: Las teclas de movimiento del cursor tambiīŋŊn funcionan. Pero usando +NOTA: Las teclas de movimiento del cursor tambiīŋŊn funcionan. Pero usando hjkl podrīŋŊ moverse mucho mīŋŊs rīŋŊpido una vez que se acostumbre a ello. + īŋŊDe verdad! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 1.2: ENTRANDO Y SALIENDO DE VIM + LecciīŋŊn 1.2: SALIR DE VIM - īŋŊīŋŊ NOTA: Antes de ejecutar alguno de los pasos siguientes lea primero + īŋŊīŋŊ NOTA: Antes de ejecutar alguno de los siguientes pasos lea primero la lecciīŋŊn entera!! 1. Pulse la tecla (para asegurarse de que estīŋŊ en modo Normal). - 2. Escriba: :q! + 2. Escriba: :q! + Esto provoca la salida del editor DESCARTANDO cualquier cambio que haya hecho. ----> Esto provoca la salida del editor SIN guardar ningīŋŊn cambio que se haya - hecho. Si quiere guardar los cambios y salir escriba: - :wq + 3. Regrese aquīŋŊ ejecutando el comando que le trajo a este tutor. + īŋŊste puede haber sido: vimtutor - 3. Cuando vea el sīŋŊmbolo del sistema, escriba el mandato que le trajo a este - tutor. īŋŊste puede haber sido: vimtutor - Normalmente se usarīŋŊa: vim tutor + 4. Si ha memorizado estos pasos y se siente con confianza, ejecute los + pasos 1 a 3 para salir y volver a entrar al editor. ----> 'vim' significa entrar al editor, 'tutor' es el fichero a editar. +NOTA: :q! descarta cualquier cambio que haya realizado. + En prīŋŊximas lecciones aprenderīŋŊ cīŋŊmo guardar los cambios en un archivo. + + 5. Mueva el cursor hasta la LecciīŋŊn 1.3. - 4. Si ha memorizado estos pasos y se se siente con confianza, ejecute los - pasos 1 a 3 para salir y volver a entrar al editor. DespuīŋŊs mueva el - cursor hasta la LecciīŋŊn 1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 1.3: EDICIīŋŊN DE TEXTO - BORRADO -** Estando en modo Normal pulse x para borrar el carīŋŊcter sobre el cursor. **j +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 1.3: EDITAR TEXTO - BORRAR + ** Pulse x para eliminar el carīŋŊcter bajo el cursor. ** 1. Mueva el cursor a la līŋŊnea de abajo seīŋŊalada con --->. - 2. Para corregir los errores, mueva el cursor hasta que estīŋŊ bajo el + 2. Para corregir los errores, mueva el cursor hasta que estīŋŊ sobre el carīŋŊcter que va a ser borrado. - 3. Pulse la tecla x para borrar el carīŋŊcter sobrante. + 3. Pulse la tecla x para eliminar el carīŋŊcter no deseado. 4. Repita los pasos 2 a 4 hasta que la frase sea la correcta. @@ -86,20 +86,20 @@ Nota: Las teclas de movimiento del cursor tambi 5. Ahora que la līŋŊnea esta correcta, continīŋŊe con la LecciīŋŊn 1.4. - NOTA: A medida que vaya avanzando en este tutor no intente memorizar, aprenda practicando. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 1.4: EDICIīŋŊN DE TEXTO - INSERCIīŋŊN - ** Estando en modo Normal pulse i para insertar texto. ** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 1.4: EDITAR TEXTO - BORRAR + ** Pulse i para insertar texto. ** 1. Mueva el cursor a la primera līŋŊnea de abajo seīŋŊalada con --->. - 2. Para que la primera līŋŊnea se igual a la segunda mueva el cursor bajo el - primer carīŋŊcter que sigue al texto que ha de ser insertado. + 2. Para hacer que la primera līŋŊnea sea igual que la segunda, mueva el + cursor hasta que estīŋŊ sobre el carīŋŊcter ANTES del cual el texto va a ser + insertado. 3. Pulse i y escriba los caracteres a aīŋŊadir. @@ -109,9 +109,55 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar, ---> Flta texto en esta . ---> Falta algo de texto en esta līŋŊnea. - 5. Cuando se sienta cīŋŊmodo insertando texto pase al resumen que esta mīŋŊs - abajo. + 5. Cuando se sienta cīŋŊmodo insertando texto pase vaya a la lecciīŋŊn 1.5. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 1.5: EDITAR TEXTO - AīŋŊADIR + + + ** Pulse A para aīŋŊadir texto. ** + + 1. Mueva el cursor a la primera līŋŊnea inferior marcada con --->. + No importa sobre quīŋŊ carīŋŊcter estīŋŊ el cursor en esta līŋŊnea. + + 2. Pulse A y escriba el texto necesario. + + 3. Cuando el texto haya sido aīŋŊadido pulse para volver al modo Normal. + 4. Mueva el cursor a la segunda līŋŊnea marcada con ---> y repita los + pasos 2 y 3 para corregir esta frase. + +---> Falta algīŋŊn texto en es + Falta algīŋŊn texto en esta līŋŊnea. +---> TambiīŋŊn falta alg + TambiīŋŊn falta algīŋŊn texto aquīŋŊ. + + 5. Cuando se sienta cīŋŊmodo aīŋŊadiendo texto pase a la lecciīŋŊn 1.6. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 1.6: EDITAR UN ARCHIVO + + ** Use :wq para guardar un archivo y salir ** + + !! NOTA: Antes de ejecutar los siguientes pasos, lea la lecciīŋŊn entera!! + + 1. Si tiene acceso a otra terminal, haga lo siguiente en ella. + Si no es asīŋŊ, salga de este tutor como hizo en la lecciīŋŊn 1.2: :q! + + 2. En el sīŋŊmbolo del sistema escriba este comando: vim archivo.txt + 'vim' es el comando para arrancar el editor Vim, 'archivo.txt' + es el nombre del archivo que quiere editar + Utilice el nombre de un archivo que pueda cambiar. + + 3. Inserte y elimine texto como ya aprendiīŋŊ en las lecciones anteriores. + + 4. Guarde el archivo con los cambios y salga de Vim con: :wq + + 5. Si ha salido de vimtutor en el paso 1 reinicie vimtutor y baje hasta + el siguiente sumario. + + 6. DespuīŋŊs de leer los pasos anteriores y haberlos entendido: hīŋŊgalos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIīŋŊN 1 @@ -120,55 +166,59 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar, 1. El cursor se mueve utilizando las teclas de las flechas o las teclas hjkl. h (izquierda) j (abajo) k (arriba) l (derecha) - 2. Para acceder a Vim (desde el sīŋŊmbolo del sistema %) escriba: - vim FILENAME + 2. Para acceder a Vim desde el sīŋŊmbolo del sistema escriba: + vim NOMBREARCHIVO 3. Para salir de Vim escriba: :q! para eliminar todos los cambios. + O escriba: :wq para guardar los cambios. - 4. Para borrar un carīŋŊcter sobre el cursor en modo Normal pulse: x + 4. Para borrar un carīŋŊcter bajo el cursor en modo Normal pulse: x - 5. Para insertar texto en la posiciīŋŊn del cursor estando en modo Normal: - pulse i escriba el texto pulse + 5. Para insertar o aīŋŊadir texto escriba: + i escriba el texto a insertar inserta el texto antes del cursor + A escriba el texto a aīŋŊadir aīŋŊade texto al final de la līŋŊnea -NOTA: Pulsando se vuelve al modo Normal o cancela un mandato no deseado - o incompleto. +NOTA: Pulsando se vuelve al modo Normal o cancela una orden no deseada + o incompleta. Ahora continīŋŊe con la LecciīŋŊn 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 2.1: MANDATOS PARA BORRAR + LecciīŋŊn 2.1: COMANDOS PARA BORRAR - ** Escriba dw para borrar hasta el final de una palabra ** + ** Escriba dw para borrar una palabra ** 1. Pulse para asegurarse de que estīŋŊ en el modo Normal. - 2. Mueva el cursor a la līŋŊnea de abajo seīŋŊalada con --->. + 2. Mueva el cursor a la līŋŊnea inferior seīŋŊalada con --->. 3. Mueva el cursor al comienzo de una palabra que desee borrar. 4. Pulse dw para hacer que la palabra desaparezca. - - NOTA: Las letras dw aparecerīŋŊn en la īŋŊltima līŋŊnea de la pantalla cuando - las escriba. Si escribe algo equivocado pulse y comience de nuevo. - + NOTA: La letra d aparecerīŋŊ en la īŋŊltima līŋŊnea inferior derecha + de la pantalla mientras la escribe. Vim estīŋŊ esperando que escriba w . + Si ve otro carīŋŊcter que no sea d escribiīŋŊ algo mal, pulse y + comience de nuevo. ---> Hay algunas palabras pīŋŊsalo bien que no pertenecen papel a esta frase. + 5. Repita los pasos 3 y 4 hasta que la frase sea correcta y pase a la + lecciīŋŊn 2.2. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 2.2: MīŋŊS MANDATOS PARA BORRAR + LecciīŋŊn 2.2: MīŋŊS COMANDOS PARA BORRAR ** Escriba d$ para borrar hasta el final de la līŋŊnea. ** - 1. Pulse para asegurarse de que estīŋŊ en el modo Normal. - 2. Mueva el cursor a la līŋŊnea de abajo seīŋŊalada con --->. + 2. Mueva el cursor a la līŋŊnea inferior seīŋŊalada con --->. 3. Mueva el cursor al final de la līŋŊnea correcta (DESPUīŋŊS del primer . ). @@ -176,319 +226,391 @@ Ahora contin ---> Alguien ha escrito el final de esta līŋŊnea dos veces. esta līŋŊnea dos veces. + 5. Pase a la lecciīŋŊn 2.3 para entender quīŋŊ estīŋŊ pasando. + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 2.3: SOBRE OPERADORES Y MOVIMIENTOS + + Muchos comandos que cambian texto estīŋŊn compuestos por un operador y un + movimiento. + El formato para eliminar un comando con el operador de borrado d es el + siguiente: + d movimiento + Donde: + d - es el operador para borrar. + movimiento - es sobre lo que el comando va a operar (lista inferior). + Una lista resumida de movimientos: + w - hasta el comienzo de la siguiente palabra, EXCLUYENDO su primer + carīŋŊcter. + e - hasta el final de la palabra actual, INCLUYENDO su primer carīŋŊcter. + $ - hasta el final de la līŋŊnea, INCLUYENDO el īŋŊltimo carīŋŊcter. +NOTA: Pulsando īŋŊnicamente el movimiento estando en el modo Normal sin un + operador, moverīŋŊ el cursor como se especifica en la lista anterior. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 2.3: SOBRE MANDATOS Y OBJETOS + LecciīŋŊn 2.4: UTILIZAR UN CONTADOR PARA UN MOVIMIENTO - El formato del mandato de borrar d es como sigue: + ** Al escribir un nīŋŊmero antes de un movimiento, lo repite esas veces. ** - [nīŋŊmero] d objeto O d [nīŋŊmero] objeto - donde: - nīŋŊmero - es cuīŋŊntas veces se ha de ejecutar el mandato (opcional, defecto=1). - d - es el mandato para borrar. - objeto - es sobre lo que el mandato va a operar (lista, abajo). + 1. Mueva el cursor al comienzo de la līŋŊnea marcada con --->. - Una lista corta de objetos: - w - desde el cursor hasta el final de la palabra, incluyendo el espacio. - e - desde el cursor hasta el final de la palabra, SIN incluir el espacio. - $ - desde el cursor hasta el final de la līŋŊnea. + 2. Escriba 2w para mover el cursor dos palabras hacia adelante. + + 3. Escriba 3e para mover el cursor al final de la tercera palabra hacia + adelante. + + 4. Escriba 0 (cero) para colocar el cursor al inicio de la līŋŊnea. + + 5. Repita el paso 2 y 3 con diferentes nīŋŊmeros. + +---> Esto es solo una līŋŊnea con palabra donde poder moverse. + + 6. Pase a la lecciīŋŊn 2.5. -NOTE: Para los aventureros, pulsando sīŋŊlo el objeto estando en modo Normal - sin un mandato moverīŋŊ el cursor como se especifica en la lista de objetos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 2.4: UNA EXCEPCIīŋŊN AL 'MANDATO-OBJETO' + LecciīŋŊn 2.5: UTILIZAR UN CONTADOR PARA BORRAR MAS + + + ** Al escribir un nīŋŊmero con un operador lo repite esas veces. ** + + En combinaciīŋŊn con el operador de borrado y el movimiento mencionado + anteriormente, aīŋŊada un contador antes del movimiento para eliminar mīŋŊs: + d nīŋŊmero movimiento + + 1. Mueva el cursos a la primera palabra en MAYīŋŊSCULAS en la līŋŊnea + marcada con --->. + + 2. Escriba d2w para eliminar las dos palabras en MAYīŋŊSCULAS. + + 3. Repita los pasos 1 y 2 con diferentes contadores para eliminar + las siguientes palabras en MAYīŋŊSCULAS con un comando. + +---> esta ABC DE serie FGHI JK LMN OP de palabras ha sido Q RS TUV limpiada. - ** Escriba dd para borrar una līŋŊnea entera. ** - Debido a la frecuencia con que se borran līŋŊneas enteras, los diseīŋŊadores - de Vim decidieron que serīŋŊa mīŋŊs fīŋŊcil el escribir simplemente dos des en - una fila para borrar una līŋŊnea. - 1. Mueva el cursor a la segunda līŋŊnea de la lista de abajo. - 2. Escriba dd para borrar la līŋŊnea. - 3. MuīŋŊvase ahora a la cuarta līŋŊnea. - 4. Escriba 2dd (recuerde nīŋŊmero-mandato-objeto) para borrar las dos - līŋŊneas. - 1) Las rosas son rojas, - 2) El barro es divertido, - 3) El cielo es azul, - 4) Yo tengo un coche, - 5) Los relojes marcan la hora, - 6) El azucar es dulce, - 7) Y asīŋŊ eres tu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 2.5: EL MANDATO DESHACER + LecciīŋŊn 2.6: OPERACIīŋŊN EN LīŋŊNEAS + + + ** Escriba dd para eliminar una līŋŊnea completa. ** + Debido a la frecuencia con que se elimina una līŋŊnea completa, los + diseīŋŊadores de Vi, decidieron que serīŋŊa mīŋŊs sencillo simplemente escribir + dos letras d para eliminar una līŋŊnea. - ** Pulse u para deshacer los īŋŊltimos mandatos, + 1. Mueva el cursor a la segunda līŋŊnea del pīŋŊrrafo inferior. + 2. Escriba dd para eliminar la līŋŊnea. + 3. Ahora muīŋŊvase a la cuarta līŋŊnea. + 4. Escriba 2dd para eliminar dos līŋŊneas a la vez. + +---> 1) Las rosas son rojas, +---> 2) El barro es divertido, +---> 3) Las violetas son azules, +---> 4) Tengo un coche, +---> 5) Los relojes dan la hora, +---> 6) El azīŋŊcar es dulce +---> 7) Y tambiīŋŊn lo eres tīŋŊ. + +La duplicaciīŋŊn para borrar līŋŊneas tambiīŋŊn funcionan con los operadores +mencionados anteriormente. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 2.7: EL MANDATO DESHACER + + + ** Pulse u para deshacer los īŋŊltimos comandos, U para deshacer una līŋŊnea entera. ** - 1. Mueva el cursor a la līŋŊnea de abajo seīŋŊalada con ---> y sitīŋŊelo bajo el + 1. Mueva el cursor a la līŋŊnea inferior seīŋŊalada con ---> y sitīŋŊelo bajo el primer error. - 2. Pulse x para borrar el primer carīŋŊter errīŋŊneo. - 3. Pulse ahora u para deshacer el īŋŊltimo mandato ejecutado. - 4. Ahora corrija todos los errores de la līŋŊnea usando el mandato x. + 2. Pulse x para borrar el primer carīŋŊcter no deseado. + 3. Pulse ahora u para deshacer el īŋŊltimo comando ejecutado. + 4. Ahora corrija todos los errores de la līŋŊnea usando el comando x. 5. Pulse ahora U mayīŋŊscula para devolver la līŋŊnea a su estado original. 6. Pulse ahora u unas pocas veces para deshacer lo hecho por U y los - mandatos previos. + comandos previos. 7. Ahora pulse CTRL-R (mantenga pulsada la tecla CTRL y pulse R) unas - pocas veces para volver a ejecutar los mandatos (deshacer lo deshecho). + cuantas veces para volver a ejecutar los comandos (deshacer lo deshecho). ---> Corrrija los errores dee esttta līŋŊnea y vuuelva a ponerlos coon deshacer. - 8. Estos mandatos son muy īŋŊtiles. Ahora pase al resumen de la LecciīŋŊn 2. + 8. Estos son unos comandos muy īŋŊtiles. Ahora vayamos al resumen de la + lecciīŋŊn 2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIīŋŊN 2 - 1. Para borrar desde el cursor hasta el final de una palabra pulse: dw - 2. Para borrar desde el cursor hasta el final de una līŋŊnea pulse: d$ - 3. Para borrar una līŋŊnea entera pulse: dd +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMEN DE LA LECCIīŋŊN 2 - 4. El formato de un mandato en modo Normal es: + 1. Para borrar desde el cursor hasta siguiente palabra pulse: dw + 2. Para borrar desde el cursor hasta el final de la palabra pulse: de + 3. Para borrar desde el cursor hasta el final de una līŋŊnea pulse: d$ + 4. Para borrar una līŋŊnea entera pulse: dd - [nīŋŊmero] mandato objeto O mandato [nīŋŊmero] objeto + 5. Para repetir un movimiento precīŋŊdalo con un nīŋŊmero: 2w + 6. El formato para un comando de cambio es: + operador [nīŋŊmero] movimiento donde: - nīŋŊmero - es cuīŋŊntas veces se ha de ejecutar el mandato - mandato - es lo que hay que hacer, por ejemplo, d para borrar - objeto - es sobre lo que el mandato va a operar, por ejemplo - w (palabra), $ (hasta el final de la līŋŊnea), etc. + comando - es lo que hay que hacer, por ejemplo, d para borrar + [nīŋŊmero] - es un nīŋŊmero opcional para repetir el movimiento + movimiento - se mueve sobre el texto sobre el que operar, como + w (palabra), $ (hasta el final de la līŋŊnea), etc. + 7. Para moverse al inicio de la līŋŊnea utilice un cero: 0 - 5. Para deshacer acciones previas pulse: u (u minīŋŊscula) + 8. Para deshacer acciones previas pulse: u (u minīŋŊscula) Para deshacer todos los cambios de una līŋŊnea pulse: U (U mayīŋŊscula) - Para deshacer lo deshecho pulse: CTRL-R + Para deshacer lo deshecho pulse: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 3.1: EL MANDATO īŋŊPUTīŋŊ (poner) + LecciīŋŊn 3.1: EL COMANDO īŋŊPUTīŋŊ (poner) - ** Pulse p para poner lo īŋŊltimo que ha borrado despuīŋŊs del cursor. ** +** Pulse p para poner (pegar) despuīŋŊs del cursor lo īŋŊltimo que ha borrado. ** - 1. Mueva el cursor al final de la lista de abajo. + 1. Mueva el cursor a la primera līŋŊnea inferior marcada con --->. - 2. Escriba dd para borrar la līŋŊnea y almacenarla en el buffer de Vim. + 2. Escriba dd para borrar la līŋŊnea y almacenarla en un registro de Vim. - 3. Mueva el cursor a la līŋŊnea que debe quedar por debajo de la - līŋŊnea a mover. + 3. Mueva el cursor a la līŋŊnea c) por ENCIMA de donde deberīŋŊa estar + la līŋŊnea eliminada. - 4. Estando en mod Normal, pulse p para restituir la līŋŊnea borrada. + 4. Pulse p para pegar la līŋŊnea borrada por debajo del cursor. 5. Repita los pasos 2 a 4 para poner todas las līŋŊneas en el orden correcto. - d) īŋŊPuedes aprenderla tu? - b) Las violetas son azules, - c) La inteligencia se aprende, - a) Las rosas son rojas, +---> d) īŋŊPuedes aprenderla tīŋŊ? +---> b) Las violetas son azules, +---> c) La inteligencia se aprende, +---> a) Las rosas son rojas, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 3.2: EL MANDATO īŋŊREPLACEīŋŊ (remplazar) - + LecciīŋŊn 3.2: EL COMANDO REEMPLAZAR - ** Pulse r y un carīŋŊcter para sustituir el carīŋŊcter sobre el cursor. ** + ** Pulse rx para reemplazar el carīŋŊcter bajo el cursor con x . ** - 1. Mueva el cursor a la primera līŋŊnea de abajo seīŋŊalada con --->. + 1. Mueva el cursor a la primera līŋŊnea inferior marcada con --->. - 2. Mueva el cursor para situarlo bajo el primer error. + 2. Mueva el cursor para situarlo sobre el primer error. - 3. Pulse r y el carīŋŊcter que debe sustituir al errīŋŊneo. + 3. Pulse r y despuīŋŊs el carīŋŊcter que deberīŋŊa ir ahīŋŊ. - 4. Repita los pasos 2 y 3 hasta que la primera līŋŊnea estīŋŊ corregida. + 4. Repita los pasos 2 y 3 hasta que la primera sea igual a la segunda. ---> īŋŊCuendo esta līŋŊnea fue rscrita alguien pulso algunas teclas equibocadas! ---> īŋŊCuando esta līŋŊnea fue escrita alguien pulsīŋŊ algunas teclas equivocadas! + 5. Ahora pase a la lecciīŋŊn 3.3. - +NOTA: Recuerde que deberīŋŊa aprender practicando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 3.3: EL MANDATO īŋŊCHANGEīŋŊ (cambiar) + LecciīŋŊn 3.3: EL COMANDO CAMBIAR - ** Para cambiar parte de una palabra o toda ella escriba cw . ** + ** Para cambiar hasta el final de una līŋŊnea, escriba ce . ** - - 1. Mueva el cursor a la primera līŋŊnea de abajo seīŋŊalada con --->. + 1. Mueva el cursor a la primera līŋŊnea inferior marcada con --->. 2. SitīŋŊe el cursor en la u de lubrs. - 3. Escriba cw y corrija la palabra (en este caso, escriba 'īŋŊnea'). + 3. Escriba ce y corrija la palabra (en este caso, escriba 'īŋŊnea'). - 4. Pulse y mueva el cursor al error siguiente (el primer carīŋŊcter - que deba cambiarse). + 4. Pulse y mueva el cursor al siguiente error que debe ser cambiado. 5. Repita los pasos 3 y 4 hasta que la primera frase sea igual a la segunda. ----> Esta lubrs tiene unas pocas pskavtad que corregir usem el mandato change. ----> Esta līŋŊnea tiene unas pocas palabras que corregir usando el mandato change. +---> Esta lubrs tiene unas pocas pskavtad que corregir usem el comando change. +---> Esta līŋŊnea tiene unas pocas palabras que corregir usando el comando change. + +Tenga en cuenta que ce elimina la palabra y entra en el modo Insertar. + cc hace lo mismo para toda la līŋŊnea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LecciīŋŊn 3.4: MīŋŊS CAMBIOS USANDO c - ** El mandato change se utiliza con los mismos objetos que delete. ** + ** El operador change se utiliza con los mismos movimientos que delete. ** - 1. El mandato change funciona de la misma forma que delete. El formato es: + 1. El operador change funciona de la misma forma que delete. El formato es: - [nīŋŊmero] c objeto O c [nīŋŊmero] objeto + c [nīŋŊmero] movimiento - 2. Los objetos son tambiīŋŊm los mismos, tales como w (palabra), $ (fin de - la līŋŊnea), etc. + 2. Los movimientos son tambiīŋŊn los mismos, tales como w (palabra) o + $ (fin de la līŋŊnea). - 3. Mueva el cursor a la primera līŋŊnea de abajo seīŋŊalada con --->. + 3. Mueva el cursor a la primera līŋŊnea inferior seīŋŊalada con --->. 4. Mueva el cursor al primer error. - 5. Escriba c$ para hacer que el resto de la līŋŊnea sea como la segunda + 5. Pulse c$ y escriba el resto de la līŋŊnea para que sea como la segunda y pulse . ---> El final de esta līŋŊnea necesita alguna ayuda para que sea como la segunda. ----> El final de esta līŋŊnea necesita ser corregido usando el mandato c$. +---> El final de esta līŋŊnea necesita ser corregido usando el comando c$. + +NOTA: Puede utilizar el retorno de carro para corregir errores mientras escribe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIīŋŊN 3 - 1. Para sustituir texto que ha sido borrado, pulse p . Esto Pone el texto - borrado DESPUīŋŊS del cursor (si lo que se ha borrado es una līŋŊnea se - situarīŋŊ sobre la līŋŊnea que estīŋŊ sobre el cursor). + 1. Para volver a poner o pegar el texto que acaba de ser borrado, + escriba p . Esto pega el texto despuīŋŊs del cursor (si se borrīŋŊ una + līŋŊnea, al pegarla, esta se situarīŋŊ en la līŋŊnea debajo del cursor). 2. Para sustituir el carīŋŊcter bajo el cursor, pulse r y luego el - carīŋŊcter que sustituirīŋŊ al original. + carīŋŊcter que quiere que estīŋŊ en ese lugar. - 3. El mandato change le permite cambiar el objeto especificado desde la - posiciīŋŊn del cursor hasta el final del objeto; e.g. Pulse cw para - cambiar desde el cursor hasta el final de la palabra, c$ para cambiar - hasta el final de la līŋŊnea. + 3. El operador change le permite cambiar desde la posiciīŋŊn del cursor + hasta donde el movimiento indicado le lleve. Por ejemplo, pulse ce + para cambiar desde el cursor hasta el final de la palabra, o c$ + para cambiar hasta el final de la līŋŊnea. 4. El formato para change es: - [nīŋŊmero] c objeto O c [nīŋŊmero] objeto + c [nīŋŊmero] movimiento Pase ahora a la lecciīŋŊn siguiente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 4.1: SITUACIīŋŊN EN EL FICHERO Y SU ESTADO + LecciīŋŊn 4.1: UBICACIīŋŊN DEL CURSOR Y ESTADO DEL ARCHIVO + ** Pulse CTRL-G para mostrar su situaciīŋŊn en el fichero y su estado. + Pulse G para moverse a una determinada līŋŊnea del fichero. ** - ** Pulse CTRL-g para mostrar su situaciīŋŊn en el fichero y su estado. - Pulse MAYU-G para moverse a una determinada līŋŊnea del fichero. ** +NOTA: īŋŊīŋŊLea esta lecciīŋŊn entera antes de ejecutar cualquiera de los pasos!! - Nota: īŋŊīŋŊLea esta lecciīŋŊn entera antes de ejecutar alguno de los pasos!! + 1. Mantenga pulsada la tecla Ctrl y pulse g . Le llamamos a esto CTRL-G. + AparecerīŋŊ un mensaje en la parte inferior de la pīŋŊgina con el nombre + del archivo y la posiciīŋŊn en este. Recuerde el nīŋŊmero de līŋŊnea + para el paso 3. +NOTA: QuizīŋŊs pueda ver la posiciīŋŊn del cursor en la esquina inferior derecha + de la pantalla. Esto ocurre cuando la opciīŋŊn 'ruler' (regla) estīŋŊ + habilitada (consulte :help 'ruler' ) - 1. Mantenga pulsada la tecla Ctrl y pulse g . Aparece una līŋŊnea de estado - al final de la pantalla con el nombre del fichero y la līŋŊnea en la que - estīŋŊ situado. Recuerde el nīŋŊmero de la līŋŊnea para el Paso 3. + 2. Pulse G para mover el cursor hasta la parte inferior del archivo. + Pulse gg para mover el cursor al inicio del archivo. - 2. Pulse Mayu-G para ir al final del fichero. + 3. Escriba el nīŋŊmero de la līŋŊnea en la que estaba y despuīŋŊs G . Esto + le volverīŋŊ a la līŋŊnea en la que estaba cuando pulsīŋŊ CTRL-G. - 3. Escriba el nīŋŊmero de la līŋŊnea en la que estaba y despīŋŊes Mayu-G. Esto - le volverīŋŊ a la līŋŊnea en la que estaba cuando pulsīŋŊ Ctrl-g. - (Cuando escriba los nīŋŊmeros NO se mostrarīŋŊn en la pantalla). - - 4. Si se siente confiado en poder hacer esto ejecute los pasos 1 a 3. + 4. Si se siente seguro en poder hacer esto ejecute los pasos 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 4.2: EL MANDATO īŋŊSEARCHīŋŊ (buscar) + LecciīŋŊn 4.2: EL COMANDO īŋŊSEARCHīŋŊ (buscar) ** Escriba / seguido de una frase para buscar la frase. ** 1. En modo Normal pulse el carīŋŊcter / . FīŋŊjese que tanto el carīŋŊcter / como el cursor aparecen en la īŋŊltima līŋŊnea de la pantalla, lo mismo - que el mandato : . + que el comando : . 2. Escriba ahora errroor . Esta es la palabra que quiere buscar. - 3. Para repetir la bīŋŊsqueda, simplemente pulse n . - Para busacar la misma frase en la direcciīŋŊn opuesta, pulse Mayu-N . + 3. Para repetir la bīŋŊsqueda de la misma frase otra vez, simplemente pulse n . + Para buscar la misma frase en la direcciīŋŊn opuesta, pulse N . 4. Si quiere buscar una frase en la direcciīŋŊn opuesta (hacia arriba), - utilice el mandato ? en lugar de / . + utilice el comando ? en lugar de / . + + 5. Para regresar al lugar de donde procedīŋŊa pulse CTRL-O (Mantenga pulsado + Ctrl mientras pulsa la letra o). Repita el proceso para regresar mīŋŊs atrīŋŊs. + CTRL-I va hacia adelante. ----> Cuando la bīŋŊsqueda alcanza el final del fichero continuarīŋŊ desde el - principio. +---> "errroor" no es la forma correcta de escribir error, errroor es un error. - īŋŊerrroorīŋŊ no es la forma de deletrear error; errroor es un error. +NOTA: Cuando la bīŋŊsqueda llega al final del archivo, continuarīŋŊ desde el + comienzo, a menos que la opciīŋŊn 'wrapscan' haya sido desactivada. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LecciīŋŊn 4.3: BīŋŊSQUEDA PARA COMPROBAR PARīŋŊNTESIS ** Pulse % para encontrar el parīŋŊntesis correspondiente a ),] o } . ** - - 1. SitīŋŊe el cursor en cualquiera de los caracteres ), ] o } en la līŋŊnea de - abajo seīŋŊalada con --->. + 1. SitīŋŊe el cursor en cualquiera de los caracteres (, [ o { en la līŋŊnea + inferior seīŋŊalada con --->. 2. Pulse ahora el carīŋŊcter % . - 3. El cursor deberīŋŊa situarse en el parīŋŊntesis (, corchete [ o llave { - correspondiente. + 3. El cursor se moverīŋŊ a la pareja de cierre del parīŋŊntesis, corchete + o llave correspondiente. + + 4. Pulse % para mover el cursor a la otra pareja del carīŋŊcter. + + 5. Mueva el cursor a otro (,),[,],{ o } y vea lo que hace % . - 4. Pulse % para mover de nuevo el cursor al parīŋŊntesis, corchete o llave - correspondiente. +---> Esto ( es una līŋŊnea de prueba con (, [, ], {, y } en ella. )) ----> Esto ( es una līŋŊnea de prueba con (, [, ], {, y } en ella. )). +NOTA: īŋŊEsto es muy īŋŊtil en la detecciīŋŊn de errores en un programa con + parīŋŊntesis, corchetes o llaves sin pareja. + -Nota: īŋŊEsto es muy īŋŊtil en la detecciīŋŊn de errores en un programa con - parīŋŊntesis, corchetes o llaves disparejos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 4.4: UNA FORMA DE CAMBIAR ERRORES + LecciīŋŊn 4.4: EL COMANDO SUSTITUIR ** Escriba :s/viejo/nuevo/g para sustituir 'viejo' por 'nuevo'. ** - - 1. Mueva el cursor a la līŋŊnea de abajo seīŋŊalada con --->. + 1. Mueva el cursor a la līŋŊnea inferior seīŋŊalada con --->. 2. Escriba :s/laas/las/ . Tenga en cuenta que este mandato cambia sīŋŊlo la primera apariciīŋŊn en la līŋŊnea de la expresiīŋŊn a cambiar. + + 3. Ahora escriba :/laas/la/g . Al aīŋŊadir la opciīŋŊn g esto significa + que harīŋŊ la sustituciīŋŊn global en la līŋŊnea, cambiando todas las + ocurrencias del tīŋŊrmino "laas" en la līŋŊnea. ---> Laas mejores īŋŊpocas para ver laas flores son laas primaveras. - 4. Para cambiar todas las apariciones de una expresiīŋŊn ente dos līŋŊneas - escriba :#,#s/viejo/nuevo/g donde #,# son los nīŋŊmeros de las dos - līŋŊneas. Escriba :%s/viejo/nuevo/g para hacer los cambios en todo - el fichero. - - - - + 4. Para cambiar cada ocurrencia de la cadena de caracteres entre dos līŋŊneas, + Pulse :#,#s/viejo/nuevo/g donde #,# son los nīŋŊmeros de līŋŊnea del rango + de līŋŊneas donde se realizarīŋŊ la sustituciīŋŊn. + Pulse :%s/old/new/g para cambiar cada ocurrencia en todo el + archivo. + Pulse :%s/old/new/gc para encontrar cada ocurrencia en todo el + archivo, pidiendo confirmaciīŋŊn para + realizar la sustituciīŋŊn o no. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIīŋŊN 4 - 1. Ctrl-g muestra la posiciīŋŊn del cursor en el fichero y su estado. - Mayu-G mueve el cursor al final del fichero. Un nīŋŊmero de līŋŊnea - seguido de Mayu-G mueve el cursor a la līŋŊnea con ese nīŋŊmero. + 1. CTRL-G muestra la posiciīŋŊn del cursor en el fichero y su estado. + G mueve el cursor al final del archivo. + nīŋŊmero G mueve el cursor a ese nīŋŊmero de līŋŊnea. + gg mueve el cursor a la primera līŋŊnea del archivo. 2. Pulsando / seguido de una frase busca la frase hacia ADELANTE. Pulsando ? seguido de una frase busca la frase hacia ATRīŋŊS. DespuīŋŊs de una bīŋŊsqueda pulse n para encontrar la apariciīŋŊn - siguiente en la misma direcciīŋŊn. + siguiente en la misma direcciīŋŊn o N para buscar en direcciīŋŊn opuesta. 3. Pulsando % cuando el cursor esta sobre (,), [,], { o } localiza la pareja correspondiente. - 4. Para cambiar viejo por nuevo en una līŋŊnea pulse :s/viejo/nuevo + 4. Para cambiar viejo en el primer nuevo en una līŋŊnea pulse :s/viejo/nuevo Para cambiar todos los viejo por nuevo en una līŋŊnea pulse :s/viejo/nuevo/g Para cambiar frases entre dos nīŋŊmeros de līŋŊneas pulse :#,#s/viejo/nuevo/g Para cambiar viejo por nuevo en todo el fichero pulse :%s/viejo/nuevo/g @@ -499,11 +621,10 @@ Nota: LecciīŋŊn 5.1: CīŋŊMO EJECUTAR UN MANDATO EXTERNO - ** Escriba :! seguido de un mandato externo para ejecutar ese mandato. ** - + ** Escriba :! seguido de un comando externo para ejecutar ese comando. ** - 1. Escriba el conocido mandato : para situar el cursor al final de la - pantalla. Esto le permitirīŋŊ introducir un mandato. + 1. Escriba el conocido comando : para situar el cursor al final de la + pantalla. Esto le permitirīŋŊ introducir un comando. 2. Ahora escriba el carīŋŊcter ! (signo de admiraciīŋŊn). Esto le permitirīŋŊ ejecutar cualquier mandato del sistema. @@ -512,9 +633,11 @@ Nota: le mostrarīŋŊ una lista de su directorio, igual que si estuviera en el sīŋŊmbolo del sistema. Si ls no funciona utilice !:dir . ---->Nota: De esta manera es posible ejecutar cualquier mandato externo. +NOTA: De esta manera es posible ejecutar cualquier comando externo, + tambiīŋŊn incluyendo argumentos. ---->Nota: Todos los mandatos : deben finalizarse pulsando . +NOTA: Todos los comando : deben finalizarse pulsando . + De ahora en adelante no siempre se mencionarīŋŊ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -522,10 +645,10 @@ Nota: ** Para guardar los cambios hechos en un fichero, - escriba :w NOMBRE_DE_FICHERO. ** + escriba :w NOMBRE_DE_FICHERO ** - - 1. Escriba :!dir o :!ls para ver una lista de su directorio. + 1. Escriba :!dir o :!ls para ver una lista de los archivos + de su directorio. Ya sabe que debe pulsar despuīŋŊs de ello. 2. Elija un nombre de fichero que todavīŋŊa no exista, como TEST. @@ -533,210 +656,337 @@ Nota: 3. Ahora escriba :w TEST (donde TEST es el nombre de fichero elegido). 4. Esta acciīŋŊn guarda todo el fichero (Vim Tutor) bajo el nombre TEST. - Para comprobarlo escriba :!dir de nuevo y vea su directorio. + Para comprobarlo escriba :!dir o :!ls de nuevo y vea su directorio. + +NOTA: Si saliera de Vim y volviera a entrar de nuevo con vim TEST , el + archivo serīŋŊa una copia exacta del tutorial cuando lo guardīŋŊ. + + 5. Ahora elimine el archivo escribiendo (Windows): :!del TEST + o (Unix): :!rm TEST ----> Tenga en cuenta que si sale de Vim y entra de nuevo con el nombre de - fichero TEST, el fichero serīŋŊa una copia exacta del tutor cuando lo - ha guardado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 5.3: UN MANDATO DE ESCRITURA SELECTIVO + LecciīŋŊn 5.3: SELECCIONAR TEXTO PARA GUARDAR + - ** Para guardar parte del fichero escriba :#,# NOMBRE_DEL_FICHERO ** + ** Para guardar parte del archivo, escriba v movimiento :w ARCHIVO ** + 1. Mueva el cursor a esta līŋŊnea. - 1. Escriba de nuevo, una vez mīŋŊs, :!dir o :!ls para obtener una lista - de su directorio y elija nombre de fichero adecuado, como TEST. + 2. Pulse v y mueva el cursor hasta el quinto elemento inferior. Vea que + el texto es resaltado. - 2. Mueva el cursor al principio de la pantalla y pulse Ctrl-g para saber - el nīŋŊmero de la līŋŊnea correspondiente. īŋŊRECUERDE ESTE NīŋŊMERO! + 3. Pulse el carīŋŊcter : en la parte inferior de la pantalla aparecerīŋŊ + :'<,'> - 3. Ahora mueva el cursor a la īŋŊltima līŋŊnea de la pantalla y pulse Ctrl-g - de nuevo. īŋŊRECUERDE TAMBIīŋŊN ESTE NīŋŊMERO! + 4. Pulse w TEST , donde TEST es un nombre de archivo que aīŋŊn no existe. + Verifique que :'<,'>w TEST antes de pulsar . - 4. Para guardar SOLAMENTE una parte de un fichero, escriba :#,# w TEST - donde #,# son los nīŋŊmeros que usted ha recordado (primera līŋŊnea, - īŋŊltima līŋŊnea) y TEST es su nombre de dichero. + 5. Vim escribirīŋŊ las līŋŊneas seleccionadas en el archivo TEST. Utilice + :!dir o :!ls para verlo. īŋŊNo lo elimine todavīŋŊa! Lo utilizaremos + en la siguiente lecciīŋŊn. - 5. De nuevo, vea que el fichero esta ahīŋŊ con :!dir pero NO lo borre. +NOTA: Al pulsar v inicia la selecciīŋŊn visual. Puede mover el cursor para + hacer la selecciīŋŊn mīŋŊs grande o pequeīŋŊa. DespuīŋŊs puede utilizar un + operador para hacer algo con el texto. Por ejemplo, d eliminarīŋŊ + el texto seleccionado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LecciīŋŊn 5.4: RECUPERANDO Y MEZCLANDO FICHEROS + ** Para insertar el contenido de un fichero escriba :r NOMBRE_DEL_FICHERO ** - 1. Escriba :!dir para asegurarse de que su fichero TEST del ejercicio - anterior estīŋŊ presente. + 1. SitīŋŊe el cursor justo por encima de esta līŋŊnea. - 2. Situe el cursor al principio de esta pantalla. +NOTA: DespuīŋŊs de ejecutar el paso 2 verīŋŊ texto de la lecciīŋŊn 5.3. DespuīŋŊs + DESCIENDA hasta ver de nuevo esta lecciīŋŊn. -NOTA: DespuīŋŊs de ejecutar el paso 3 se verīŋŊ la LecciīŋŊn 5.3. Luego muīŋŊvase - hacia ABAJO para ver esta lecciīŋŊn de nuevo. + 2. Ahora recupere el archivo TEST utilizando el comando :r TEST donde + TEST es el nombre que ha utilizado. + El archivo que ha recuperado se colocarīŋŊ debajo de la līŋŊnea donde + se encuentra el cursor. - 3. Ahora recupere el fichero TEST utilizando el mandato :r TEST donde - TEST es el nombre del fichero. + 3. Para verificar que se ha recuperado el archivo, suba el cursor y + compruebe que ahora hay dos copias de la lecciīŋŊn 5.3, la original y + la versiīŋŊn del archivo. -NOTA: El fichero recuperado se sitīŋŊa a partir de la posiciīŋŊn del cursor. +NOTA: TambiīŋŊn puede leer la salida de un comando externo. Por ejemplo, + :r !ls lee la salida del comando ls y lo pega debajo de la līŋŊnea + donde se encuentra el cursor. - 4. Para verificar que el fichero ha sido recuperado, mueva el cursor hacia - arriba y vea que hay dos copias de la LecciīŋŊn 5.3, la original y la - versiīŋŊn del fichero. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIīŋŊN 5 - 1. :!mandato ejecuta un mandato externo. + 1. :!comando ejecuta un comando externo. Algunos ejemplos īŋŊtiles son: - :!dir - muestra el contenido de un directorio. - :!del NOMBRE_DE_FICHERO - borra el fichero NOMBRE_DE FICHERO. - - 2. :#,#w NOMBRE_DE _FICHERO guarda desde las līŋŊneas # hasta la # en el - fichero NOMBRE_DE_FICHERO. - - 3. :r NOMBRE_DE _FICHERO recupera el fichero del disco NOMBRE_DE FICHERO - y lo inserta en el fichero en curso a partir de la posiciīŋŊn del cursor. - + (Windows) (Unix) + :!dir :!ls - muestra el contenido de un directorio. + :!del ARCHIVO :!rm ARCHIVO - borra el fichero ARCHIVO. + 2. :w ARCHIVO escribe el archivo actual de Vim en el disco con el + nombre de ARCHIVO. + 3. v movimiento :w ARCHIVO guarda las līŋŊneas seleccionadas visualmente + en el archivo ARCHIVO. + 4. :r ARCHIVO recupera del disco el archivo ARCHIVO y lo pega debajo + de la posiciīŋŊn del cursor. + 5. :r !dir lee la salida del comando dir y lo pega debajo de la + posiciīŋŊn del cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 6.1: EL MANDATO īŋŊOPENīŋŊ (abrir) + LecciīŋŊn 6.1: EL COMANDO OPEN ** Pulse o para abrir una līŋŊnea debajo del cursor - y situarle en modo Insert ** + y situarle en modo Insertar ** + 1. Mueva el cursor a la līŋŊnea inferior seīŋŊalada con --->. - 1. Mueva el cursor a la līŋŊnea de abajo seīŋŊalada con --->. + 2. Pulse la letra minīŋŊscula o para abrir una līŋŊnea por DEBAJO del cursor + y situarle en modo Insertar. + + 3. Ahora escriba algīŋŊn texto y despuīŋŊs pulse para salir del modo + insertar. - 2. Pulse o (minīŋŊscula) para abrir una līŋŊnea por DEBAJO del cursor - y situarle en modo Insert. +---> DespuīŋŊs de pulsar o el cursor se sitīŋŊa en la līŋŊnea abierta en modo Insertar. - 3. Ahora copie la līŋŊnea seīŋŊalada con ---> y pulse para salir del - modo Insert. + 4. Para abrir una līŋŊnea por ENCIMA del cursor, simplemente pulse una O + mayīŋŊscula, en lugar de una o minīŋŊscula. Pruebe este en la līŋŊnea siguiente. + +---> Abra una līŋŊnea sobre esta pulsando O cuando el cursor estīŋŊ en esta līŋŊnea. ----> Luego de pulsar o el cursor se sitīŋŊa en la līŋŊnea abierta en modo Insert. - 4. Para abrir una līŋŊnea por encima del cursor, simplemente pulse una O - mayīŋŊscula, en lugar de una o minīŋŊscula. Pruebe este en la līŋŊnea siguiente. -Abra una līŋŊnea sobre īŋŊsta pulsando Mayu-O cuando el curso estīŋŊ en esta līŋŊnea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 6.2: EL MANDATO īŋŊAPPENDīŋŊ (aīŋŊadir) + LecciīŋŊn 6.2: EL COMANDO APPEND (aīŋŊadir) + ** Pulse a para insertar texto DESPUīŋŊS del cursor. ** + 1. Mueva el cursor al inicio de la primera līŋŊnea inferior seīŋŊalada con --->. - 1. Mueva el cursor al final de la primera līŋŊnea de abajo seīŋŊalada con ---> - pulsando $ en modo Normal. + 2. Escriba e hasta que el cursor estīŋŊ al final de līŋŊn . - 2. Escriba una a (minīŋŊscula) para aīŋŊadir texto DESPUīŋŊS del carīŋŊcter - que estīŋŊ sobre el cursor. (A mayīŋŊscula aīŋŊade texto al final de la līŋŊnea). + 3. Escriba una a (minīŋŊscula) para aīŋŊadir texto DESPUīŋŊS del cursor. -Nota: īŋŊEsto evita el pulsar i , el īŋŊltimo carīŋŊcter, el texto a insertar, - , cursor a la derecha y, finalmente, x , sīŋŊlo para aīŋŊadir algo - al final de una līŋŊnea! + 4. Complete la palabra como en la līŋŊnea inferior. Pulse para salir + del modo insertar. + + 5. Utilice e para moverse hasta la siguiente palabra incompleta y + repita los pasos 3 y 4. - 3. Complete ahora la primera līŋŊnea. NīŋŊtese que append es exactamente lo - mismo que modo Insert, excepto por el lugar donde se inserta el texto. +---> Esta līŋŊn le permit prati cīŋŊmo aīŋŊad texto a una līŋŊnea. +---> Esta līŋŊnea le permitirīŋŊ practicar cīŋŊmo aīŋŊadir texto a una līŋŊnea. ----> Esta līŋŊnea le permitirīŋŊ praticar ----> Esta līŋŊnea le permitirīŋŊ praticar el aīŋŊadido de texto al final de una līŋŊnea. +NOTA: a, i y A todos entran en el modo Insertar, la īŋŊnica diferencia es + dīŋŊnde ubican los caracteres insertados. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 6.3: OTRA VERSIīŋŊN DE īŋŊREPLACEīŋŊ (remplazar) + LecciīŋŊn 6.3: OTRA VERSIīŋŊN DE REPLACE (remplazar) + ** Pulse una R mayīŋŊscula para sustituir mīŋŊs de un carīŋŊcter. ** + 1. Mueva el cursor a la primera līŋŊnea inferior seīŋŊalada con --->. Mueva + el cursor al inicio de la primera xxx . - 1. Mueva el cursor a la primera līŋŊnea de abajo seīŋŊalada con --->. + 2. Ahora pulse R y escriba el nīŋŊmero que aparece en la līŋŊnea inferior, + esto reemplazarīŋŊ el texto xxx . + + 3. Pulse para abandonar el modo Reemplazar. Observe que el resto de + la līŋŊnea permanece sin modificaciones. - 2. SitīŋŊe el cursor al comienzo de la primera palabra que sea diferente - de las de la segunda līŋŊnea marcada con ---> (la palabra 'anterior'). + 4. Repita los pasos para reemplazar el texto xxx que queda. - 3. Ahora pulse R y sustituya el resto del texto de la primera līŋŊnea - escribiendo sobre el viejo texto para que la primera līŋŊnea sea igual - que la primera. +---> Sumar 123 a xxx da un resultado de xxx. +---> Sumar 123 a 456 da un resultado de 579. ----> Para hacer que esta līŋŊnea sea igual que la anterior use las teclas. ----> Para hacer que esta līŋŊnea sea igual que la siguiente escriba R y el texto. +NOTA: El modo Reemplazar es como el modo Insertar, pero cada carīŋŊcter escrito + elimina un carīŋŊcter ya existente. - 4. NīŋŊtese que cuando pulse para salir, el texto no alterado permanece. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 6.4: COPIAR Y PEGAR TEXTO -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 6.4: FIJAR OPCIONES + ** Utilice el operador y para copiar texto y p para pegarlo. ** - ** Fijar una opciīŋŊn de forma que una bīŋŊsqueda o sustituciīŋŊn ignore la caja ** - (Para el concepto de caja de una letra, vīŋŊase la nota al final del fichero) + 1. Mueva el cursor a la līŋŊnea inferior marcada con ---> y posicione el + cursor despuīŋŊs de "a)". + 2. Inicie el modo Visual con v y mueva el cursor justo antes de "primer". - 1. Busque 'ignorar' introduciendo: - /ignorar - Repita varias veces la bīŋŊsque pulsando la tecla n + 3. Pulse y para copiar ("yank") el texto resaltado. - 2. Fije la opciīŋŊn 'ic' (Ignorar la caja de la letra) escribiendo: - :set ic + 4. Mueva el cursor al final de la siguiente līŋŊnea mediante: j$ - 3. Ahora busque 'ignorar' de nuevo pulsando n - Repita la bīŋŊsqueda varias veces mīŋŊs pulsando la tecla n + 5. Pulse p para poner (pegar) el texto. DespuīŋŊs escriba: el segundo . - 4. Fije las opciones 'hlsearch' y 'insearch': - :set hls is + 6. Utilice el modo visual para seleccionar " elemento.", y cīŋŊpielo con y + mueva el cursor al final de la siguiente līŋŊnea con j$ y pegue el texto + reciīŋŊn copiado con p . - 5. Ahora introduzca la orden de bīŋŊsqueda otra vez, y vea quīŋŊ pasa: - /ignore +---> a) este es el primer elemento. + b) +NOTA: TambiīŋŊn puede utilizar y como un operador: yw copia una palabra, + yy copia la līŋŊnea completa donde estīŋŊ el cursor, despuīŋŊs p pegarīŋŊ + esa līŋŊnea. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIīŋŊN 6 + LecciīŋŊn 6.5: ACTIVAR (SET) UNA OPCIīŋŊN - 1. Pulsando o abre una līŋŊnea por DEBAJO del cursor y sitīŋŊa el cursor en - la līŋŊnea abierta en modo Insert. - Pulsando una O mayīŋŊscula se abre una līŋŊnea SOBRE la que estīŋŊ el cursor. + ** Active una opciīŋŊn para buscar o sustituir ignorando si estīŋŊ + en mayīŋŊsculas o minīŋŊsculas el texto. ** - 2. Pulse una a para insertar texto DESPUīŋŊS del carīŋŊcter sobre el cursor. - Pulsando una A mayīŋŊscula aīŋŊade automīŋŊticamente texto al final de la - līŋŊnea. + 1. Busque la cadena de texto 'ignorar' escribiendo: /ignorar + Repita la bīŋŊsqueda varias veces pulsando n . - 3. Pulsando una R mayīŋŊscula se entra en modo Replace hasta que, para salir, - se pulse . + 2. Active la opciīŋŊn 'ic' (Ignore case o ignorar mayīŋŊsculas y minīŋŊsculas) + mediante: :set ic - 4. Escribiendo īŋŊ:set xxxīŋŊ fija la opciīŋŊn īŋŊxxxīŋŊ + 3. Ahora busque de nuevo 'ignorar' pulsando n + Observe que ahora tambiīŋŊn se encuentran Ignorar e IGNORAR. + 4. Active las opciones 'hlsearch' y 'incsearch' escribiendo: :set hls is + 5. Ahora escriba de nuevo el comando de bīŋŊsqueda y vea quīŋŊ ocurre: /ignore + 6. Para inhabilitar el ignorar la distinciīŋŊn de mayīŋŊsculas y minīŋŊsculas + escriba: :set noic +NOTA: Para eliminar el resaltado de las coincidencias escriba: :nohlsearch +NOTA: Si quiere ignorar las mayīŋŊsculas y minīŋŊsculas, solo para un comando + de bīŋŊsqueda, utilice \c en la frase: /ignorar\c +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMEN DE LA LECCIīŋŊN 6 + 1. Escriba o para abrir una līŋŊnea por DEBAJO de la posiciīŋŊn del cursor y + entrar en modo Insertar. + Escriba O para abrir una līŋŊnea por ENCIMA de la posiciīŋŊn del cursor y + entrar en modo Insertar + + 2. Escriba a para insertar texto DESPUīŋŊS del cursor. + Escriba A para insertar texto al final de la līŋŊnea. + + 3. El comando e mueve el cursor al final de una palabra. + + 4. El operador y copia (yank) texto, p lo pega (pone). + + 5. Al escribir una R mayīŋŊscula entra en el modo Reemplazar hasta que + se pulsa . + + 6. Al escribir ":set xxx" activa la opciīŋŊn "xxx". Algunas opciones son: + 'ic' 'ignorecase' ignorar mayīŋŊsculas/minīŋŊsculas al buscar + 'is' 'incsearch' mostrar las coincidencias parciales para la bīŋŊsqueda + de una frase + 'hls' 'hlsearch' resalta todas las coincidencias de la frases + Puedes utilizar tanto los nombre largos o cortos de las opciones. + + 7. AīŋŊade "no" para inhabilitar una opciīŋŊn: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciīŋŊn 7: MANDATOS PARA LA AYUDA EN LīŋŊNEA + LecciīŋŊn 7: OBTENER AYUDA - ** Utilice el sistema de ayuda en līŋŊnea ** + ** Utilice el sistema de ayuda en līŋŊnea ** - Vim dispone de un sistema de ayuda en līŋŊnea. Para activarlo, pruebe una + Vim dispone de un sistema de ayuda en līŋŊnea. Para comenzar, pruebe una de estas tres formas: - pulse la tecla (si dispone de ella) - pulse la tecla (si dispone de ella) - escriba :help - Escriba :q para cerrar la ventana de ayuda. + Lea el texto en la ventana de ayuda para descubrir cīŋŊmo funciona la ayuda. + Escriba CTRL-W CTRL-W para saltar de una ventana a otra. + Escriba :q para cerrar la ventana de ayuda. Puede encontrar ayuda en casi cualquier tema aīŋŊadiendo un argumento al - mandato īŋŊ:helpīŋŊ mandato. Pruebe īŋŊstos: + comando īŋŊ:helpīŋŊ. Pruebe īŋŊstos (no olvide pulsar ): + + :help w + :help c_CTRL-D + :help insert-index + :help user-manual +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 7.2: CREAR UN SCRIPT DE INICIO + + + ** Habilitar funcionalidades en Vim ** + + Vim tiene muchas mīŋŊs funcionalidades que Vi, pero algunas estīŋŊn + inhabilitadas de manera predeterminada. + Para empezar a utilizar mīŋŊs funcionalidades deberīŋŊa crear un archivo + llamado "vimrc". + + 1. Comience a editar el archivo "vimrc". Esto depende de su sistema: + :e ~/.vimrc para Unix + :e ~/_vimrc para Windows + + 2. Ahora lea el contenido del archivo "vimrc" de ejemplo: + :r $VIMRUNTIME/vimrc_example.vim + + 3. Guarde el archivo mediante: + :w + + La prīŋŊxima vez que inicie Vim, este usarīŋŊ el resaltado de sintaxis. + Puede aīŋŊadir todos sus ajustes preferidos a este archivo "vimrc". + Para mīŋŊs informaciīŋŊn escriba :help vimrc-intro + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciīŋŊn 7.3: COMPLETADO + + + ** Completado de la līŋŊnea de comandos con CTRL-D o ** + + 1. AsegīŋŊrese de que Vim no estīŋŊ en el modo compatible: :set nocp + + 2. Vea quīŋŊ archivos existen en el directorio con: :!ls o :!dir + + 3. Escriba el inicio de un comando: :e + + 4. Pulse CTRL-D y Vim mostrarīŋŊ una lista de comandos que empiezan con "e". + + 5. AīŋŊada d y Vim completarīŋŊ el nombre del comando a ":edit". + + 6. Ahora aīŋŊada un espacio y el inicio del nombre de un archivo: :edit FIL + + 7. Pulse . Vim completarīŋŊ el nombre (si solo hay uno). + +NOTA: El completado funciona con muchos comandos. Solo pulse CTRL-D o + . Es especialmente īŋŊtil para :help . + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMEN DE LA LECCIīŋŊN 7 + + + 1. Escriba :help o pulse o para abrir la ventana de ayuda. + + 2. Escriba :help cmd para encontrar ayuda sobre cmd . + + 3. Escriba CTRL-W CTRL-W para saltar a otra ventana. + + 4. Escriba :q para cerrar la ventana de ayuda. + + 5. Cree un fichero vimrc de inicio para guardar sus ajustes preferidos. + + 6. Cuando escriba un comando : pulse CTRL-D para ver posibles opciones. + Pulse para utilizar una de las opciones de completado. + + + + - :help w - :help c_ - :help insert-index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -744,13 +994,15 @@ Nota: AquīŋŊ concluye el tutor de Vim. EstīŋŊ pensado para dar una visiīŋŊn breve del editor Vim, lo suficiente para permitirle usar el editor de forma bastante sencilla. EstīŋŊ muy lejos de estar completo pues Vim tiene muchīŋŊsimos mīŋŊs - mandatos. + comandos. Lea el siguiente manual de usuario: ":help user-manual". Para lecturas y estudios posteriores se recomienda el libro: - Learning the Vi Editor - por Linda Lamb - Editorial: O'Reilly & Associates Inc. - Es un buen libro para llegar a saber casi todo lo que desee hacer con Vi. - La sexta ediciīŋŊn incluye tambiīŋŊn informaciīŋŊn sobre Vim. + Vim - Vi Improved - de Steve Oualline + Editado por: New Riders + El primer libro dedicado completamente a Vim. Especialmente īŋŊtil para + reciīŋŊn principiantes. + Tiene muchos ejemplos e imīŋŊgenes. + Vea https://iccf-holland.org/click5.html Este tutorial ha sido escrito por Michael C. Pierce y Robert K. Ware, Colorado School of Mines utilizando ideas suministradas por Charles Smith, @@ -760,10 +1012,12 @@ Nota: Modificado para Vim por Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + Traducido del inglīŋŊs por: - Eduardo F. Amatria - Correo electrīŋŊnico: eferna1@platea.pntic.mec.es + * Eduardo F. Amatria + Correo electrīŋŊnico: eferna1@platea.pntic.mec.es + * Victorhck + Correo electrīŋŊnico: victorhck@opensuse.org ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.es.utf-8 b/runtime/tutor/tutor.es.utf-8 index 5bd3f31078a78..a04d453f76496 100644 --- a/runtime/tutor/tutor.es.utf-8 +++ b/runtime/tutor/tutor.es.utf-8 @@ -1,84 +1,84 @@ =============================================================================== -= B i e n v e n i d o a l t u t o r d e V I M - VersiÃŗn 1.4 = += B i e n v e n i d o a l t u t o r d e V I M - VersiÃŗn 1.7 = =============================================================================== - Vim es un editor muy potente que dispone de muchos mandatos, demasiados + Vim es un editor muy potente que dispone de muchos comandos, demasiados para ser explicados en un tutor como Êste. Este tutor estÃĄ diseÃąado - para describir suficientes mandatos para que usted sea capaz de + para describir suficientes comandos para que usted sea capaz de aprender fÃĄcilmente a usar Vim como un editor de propÃŗsito general. - El tiempo necesario para completar el tutor es aproximadamente de 25-30 - minutos, dependiendo de cuanto tiempo se dedique a la experimentaciÃŗn. + El tiempo necesario para completar el tutor es aproximadamente de 30 + minutos, dependiendo de cuÃĄnto tiempo se dedique a la experimentaciÃŗn. - Los mandatos de estas lecciones modificarÃĄn el texto. Haga una copia de + Los comandos de estas lecciones modificarÃĄn el texto. Haga una copia de este fichero para practicar (con ÂĢvimtutorÂģ esto ya es una copia). Es importante recordar que este tutor estÃĄ pensado para enseÃąar con - la prÃĄctica. Esto significa que es necesario ejecutar los mandatos - para aprenderlos adecuadamente. Si Ãēnicamente se lee el texto, se - olvidarÃĄn los mandatos. + la prÃĄctica. Esto significa que es necesario ejecutar los comandos + para aprenderlos adecuadamente. Si Ãēnicamente lee el texto, ÂĄse le + olvidarÃĄn los comandos. - Ahora, asegÃērese de que la tecla de bloqueo de mayÃēsculas no estÃĄ + Ahora, asegÃērese de que la tecla de bloqueo de mayÃēsculas NO estÃĄ activada y pulse la tecla j lo suficiente para mover el cursor de forma que la LecciÃŗn 1.1 ocupe completamente la pantalla. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 1.1: MOVIMIENTOS DEL CURSOR + LecciÃŗn 1.1: MOVER EL CURSOR - ** Para mover el cursor, pulse las teclas h,j,k,l de la forma que se indica. ** + ** Para mover el cursor, pulse las teclas h,j,k,l de la forma indicada. ** ^ - k IndicaciÃŗn: La tecla h estÃĄ a la izquierda y mueve a la izquierda. - < h l > La tecla l estÃĄ a la derecha y mueve a la derecha. + k IndicaciÃŗn: La tecla h estÃĄ a la izquierda y lo mueve a la izquierda. + < h l > La tecla l estÃĄ a la derecha y lo mueve a la derecha. j La tecla j parece una flecha que apunta hacia abajo. v 1. Mueva el cursor por la pantalla hasta que se sienta cÃŗmodo con ello. - 2. Mantenga pulsada la tecla j hasta que se repita ÂĢautomÃĄgicamenteÂģ. ----> Ahora ya sabe como llegar a la lecciÃŗn siguiente. + 2. Mantenga pulsada la tecla (j) hasta que se repita ÂĢautomÃĄgicamenteÂģ. + Ahora ya sabe como llegar a la lecciÃŗn siguiente. - 3. Utilizando la tecla abajo, vaya a la LecciÃŗn 1.2. + 3. Utilizando la tecla abajo, vaya a la lecciÃŗn 1.2. -Nota: Si alguna vez no estÃĄ seguro sobre algo que ha tecleado, pulse +NOTA: Si alguna vez no estÃĄ seguro sobre algo que ha tecleado, pulse para situarse en modo Normal. Luego vuelva a teclear la orden que deseaba. -Nota: Las teclas de movimiento del cursor tambiÊn funcionan. Pero usando +NOTA: Las teclas de movimiento del cursor tambiÊn funcionan. Pero usando hjkl podrÃĄ moverse mucho mÃĄs rÃĄpido una vez que se acostumbre a ello. + ÂĄDe verdad! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 1.2: ENTRANDO Y SALIENDO DE VIM + LecciÃŗn 1.2: SALIR DE VIM - ÂĄÂĄ NOTA: Antes de ejecutar alguno de los pasos siguientes lea primero + ÂĄÂĄ NOTA: Antes de ejecutar alguno de los siguientes pasos lea primero la lecciÃŗn entera!! 1. Pulse la tecla (para asegurarse de que estÃĄ en modo Normal). - 2. Escriba: :q! + 2. Escriba: :q! + Esto provoca la salida del editor DESCARTANDO cualquier cambio que haya hecho. ----> Esto provoca la salida del editor SIN guardar ningÃēn cambio que se haya - hecho. Si quiere guardar los cambios y salir escriba: - :wq + 3. Regrese aquí ejecutando el comando que le trajo a este tutor. + Éste puede haber sido: vimtutor - 3. Cuando vea el símbolo del sistema, escriba el mandato que le trajo a este - tutor. Éste puede haber sido: vimtutor - Normalmente se usaría: vim tutor + 4. Si ha memorizado estos pasos y se siente con confianza, ejecute los + pasos 1 a 3 para salir y volver a entrar al editor. ----> 'vim' significa entrar al editor, 'tutor' es el fichero a editar. +NOTA: :q! descarta cualquier cambio que haya realizado. + En prÃŗximas lecciones aprenderÃĄ cÃŗmo guardar los cambios en un archivo. + + 5. Mueva el cursor hasta la LecciÃŗn 1.3. - 4. Si ha memorizado estos pasos y se se siente con confianza, ejecute los - pasos 1 a 3 para salir y volver a entrar al editor. DespuÊs mueva el - cursor hasta la LecciÃŗn 1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 1.3: EDICIÓN DE TEXTO - BORRADO -** Estando en modo Normal pulse x para borrar el carÃĄcter sobre el cursor. **j +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 1.3: EDITAR TEXTO - BORRAR + ** Pulse x para eliminar el carÃĄcter bajo el cursor. ** 1. Mueva el cursor a la línea de abajo seÃąalada con --->. - 2. Para corregir los errores, mueva el cursor hasta que estÊ bajo el + 2. Para corregir los errores, mueva el cursor hasta que estÊ sobre el carÃĄcter que va a ser borrado. - 3. Pulse la tecla x para borrar el carÃĄcter sobrante. + 3. Pulse la tecla x para eliminar el carÃĄcter no deseado. 4. Repita los pasos 2 a 4 hasta que la frase sea la correcta. @@ -86,20 +86,20 @@ Nota: Las teclas de movimiento del cursor tambiÊn funcionan. Pero usando 5. Ahora que la línea esta correcta, continÃēe con la LecciÃŗn 1.4. - NOTA: A medida que vaya avanzando en este tutor no intente memorizar, aprenda practicando. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 1.4: EDICIÓN DE TEXTO - INSERCIÓN - ** Estando en modo Normal pulse i para insertar texto. ** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 1.4: EDITAR TEXTO - BORRAR + ** Pulse i para insertar texto. ** 1. Mueva el cursor a la primera línea de abajo seÃąalada con --->. - 2. Para que la primera línea se igual a la segunda mueva el cursor bajo el - primer carÃĄcter que sigue al texto que ha de ser insertado. + 2. Para hacer que la primera línea sea igual que la segunda, mueva el + cursor hasta que estÊ sobre el carÃĄcter ANTES del cual el texto va a ser + insertado. 3. Pulse i y escriba los caracteres a aÃąadir. @@ -109,9 +109,55 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar, ---> Flta texto en esta . ---> Falta algo de texto en esta línea. - 5. Cuando se sienta cÃŗmodo insertando texto pase al resumen que esta mÃĄs - abajo. + 5. Cuando se sienta cÃŗmodo insertando texto pase vaya a la lecciÃŗn 1.5. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 1.5: EDITAR TEXTO - AÑADIR + + + ** Pulse A para aÃąadir texto. ** + + 1. Mueva el cursor a la primera línea inferior marcada con --->. + No importa sobre quÊ carÃĄcter estÃĄ el cursor en esta línea. + + 2. Pulse A y escriba el texto necesario. + + 3. Cuando el texto haya sido aÃąadido pulse para volver al modo Normal. + 4. Mueva el cursor a la segunda línea marcada con ---> y repita los + pasos 2 y 3 para corregir esta frase. + +---> Falta algÃēn texto en es + Falta algÃēn texto en esta línea. +---> TambiÊn falta alg + TambiÊn falta algÃēn texto aquí. + + 5. Cuando se sienta cÃŗmodo aÃąadiendo texto pase a la lecciÃŗn 1.6. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 1.6: EDITAR UN ARCHIVO + + ** Use :wq para guardar un archivo y salir ** + + !! NOTA: Antes de ejecutar los siguientes pasos, lea la lecciÃŗn entera!! + + 1. Si tiene acceso a otra terminal, haga lo siguiente en ella. + Si no es así, salga de este tutor como hizo en la lecciÃŗn 1.2: :q! + + 2. En el símbolo del sistema escriba este comando: vim archivo.txt + 'vim' es el comando para arrancar el editor Vim, 'archivo.txt' + es el nombre del archivo que quiere editar + Utilice el nombre de un archivo que pueda cambiar. + + 3. Inserte y elimine texto como ya aprendiÃŗ en las lecciones anteriores. + + 4. Guarde el archivo con los cambios y salga de Vim con: :wq + + 5. Si ha salido de vimtutor en el paso 1 reinicie vimtutor y baje hasta + el siguiente sumario. + + 6. DespuÊs de leer los pasos anteriores y haberlos entendido: hÃĄgalos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIÓN 1 @@ -120,55 +166,59 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar, 1. El cursor se mueve utilizando las teclas de las flechas o las teclas hjkl. h (izquierda) j (abajo) k (arriba) l (derecha) - 2. Para acceder a Vim (desde el símbolo del sistema %) escriba: - vim FILENAME + 2. Para acceder a Vim desde el símbolo del sistema escriba: + vim NOMBREARCHIVO 3. Para salir de Vim escriba: :q! para eliminar todos los cambios. + O escriba: :wq para guardar los cambios. - 4. Para borrar un carÃĄcter sobre el cursor en modo Normal pulse: x + 4. Para borrar un carÃĄcter bajo el cursor en modo Normal pulse: x - 5. Para insertar texto en la posiciÃŗn del cursor estando en modo Normal: - pulse i escriba el texto pulse + 5. Para insertar o aÃąadir texto escriba: + i escriba el texto a insertar inserta el texto antes del cursor + A escriba el texto a aÃąadir aÃąade texto al final de la línea -NOTA: Pulsando se vuelve al modo Normal o cancela un mandato no deseado - o incompleto. +NOTA: Pulsando se vuelve al modo Normal o cancela una orden no deseada + o incompleta. Ahora continÃēe con la LecciÃŗn 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 2.1: MANDATOS PARA BORRAR + LecciÃŗn 2.1: COMANDOS PARA BORRAR - ** Escriba dw para borrar hasta el final de una palabra ** + ** Escriba dw para borrar una palabra ** 1. Pulse para asegurarse de que estÃĄ en el modo Normal. - 2. Mueva el cursor a la línea de abajo seÃąalada con --->. + 2. Mueva el cursor a la línea inferior seÃąalada con --->. 3. Mueva el cursor al comienzo de una palabra que desee borrar. 4. Pulse dw para hacer que la palabra desaparezca. - - NOTA: Las letras dw aparecerÃĄn en la Ãēltima línea de la pantalla cuando - las escriba. Si escribe algo equivocado pulse y comience de nuevo. - + NOTA: La letra d aparecerÃĄ en la Ãēltima línea inferior derecha + de la pantalla mientras la escribe. Vim estÃĄ esperando que escriba w . + Si ve otro carÃĄcter que no sea d escribiÃŗ algo mal, pulse y + comience de nuevo. ---> Hay algunas palabras pÃĄsalo bien que no pertenecen papel a esta frase. + 5. Repita los pasos 3 y 4 hasta que la frase sea correcta y pase a la + lecciÃŗn 2.2. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 2.2: MÁS MANDATOS PARA BORRAR + LecciÃŗn 2.2: MÁS COMANDOS PARA BORRAR ** Escriba d$ para borrar hasta el final de la línea. ** - 1. Pulse para asegurarse de que estÃĄ en el modo Normal. - 2. Mueva el cursor a la línea de abajo seÃąalada con --->. + 2. Mueva el cursor a la línea inferior seÃąalada con --->. 3. Mueva el cursor al final de la línea correcta (DESPUÉS del primer . ). @@ -176,319 +226,391 @@ Ahora continÃēe con la LecciÃŗn 2. ---> Alguien ha escrito el final de esta línea dos veces. esta línea dos veces. + 5. Pase a la lecciÃŗn 2.3 para entender quÊ estÃĄ pasando. + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 2.3: SOBRE OPERADORES Y MOVIMIENTOS + + Muchos comandos que cambian texto estÃĄn compuestos por un operador y un + movimiento. + El formato para eliminar un comando con el operador de borrado d es el + siguiente: + d movimiento + Donde: + d - es el operador para borrar. + movimiento - es sobre lo que el comando va a operar (lista inferior). + Una lista resumida de movimientos: + w - hasta el comienzo de la siguiente palabra, EXCLUYENDO su primer + carÃĄcter. + e - hasta el final de la palabra actual, INCLUYENDO su primer carÃĄcter. + $ - hasta el final de la línea, INCLUYENDO el Ãēltimo carÃĄcter. +NOTA: Pulsando Ãēnicamente el movimiento estando en el modo Normal sin un + operador, moverÃĄ el cursor como se especifica en la lista anterior. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 2.3: SOBRE MANDATOS Y OBJETOS + LecciÃŗn 2.4: UTILIZAR UN CONTADOR PARA UN MOVIMIENTO - El formato del mandato de borrar d es como sigue: + ** Al escribir un nÃēmero antes de un movimiento, lo repite esas veces. ** - [nÃēmero] d objeto O d [nÃēmero] objeto - donde: - nÃēmero - es cuÃĄntas veces se ha de ejecutar el mandato (opcional, defecto=1). - d - es el mandato para borrar. - objeto - es sobre lo que el mandato va a operar (lista, abajo). + 1. Mueva el cursor al comienzo de la línea marcada con --->. - Una lista corta de objetos: - w - desde el cursor hasta el final de la palabra, incluyendo el espacio. - e - desde el cursor hasta el final de la palabra, SIN incluir el espacio. - $ - desde el cursor hasta el final de la línea. + 2. Escriba 2w para mover el cursor dos palabras hacia adelante. + + 3. Escriba 3e para mover el cursor al final de la tercera palabra hacia + adelante. + + 4. Escriba 0 (cero) para colocar el cursor al inicio de la línea. + + 5. Repita el paso 2 y 3 con diferentes nÃēmeros. + +---> Esto es solo una línea con palabra donde poder moverse. + + 6. Pase a la lecciÃŗn 2.5. -NOTE: Para los aventureros, pulsando sÃŗlo el objeto estando en modo Normal - sin un mandato moverÃĄ el cursor como se especifica en la lista de objetos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 2.4: UNA EXCEPCIÓN AL 'MANDATO-OBJETO' + LecciÃŗn 2.5: UTILIZAR UN CONTADOR PARA BORRAR MAS + + + ** Al escribir un nÃēmero con un operador lo repite esas veces. ** + + En combinaciÃŗn con el operador de borrado y el movimiento mencionado + anteriormente, aÃąada un contador antes del movimiento para eliminar mÃĄs: + d nÃēmero movimiento + + 1. Mueva el cursos a la primera palabra en MAYÚSCULAS en la línea + marcada con --->. + + 2. Escriba d2w para eliminar las dos palabras en MAYÚSCULAS. + + 3. Repita los pasos 1 y 2 con diferentes contadores para eliminar + las siguientes palabras en MAYÚSCULAS con un comando. + +---> esta ABC DE serie FGHI JK LMN OP de palabras ha sido Q RS TUV limpiada. - ** Escriba dd para borrar una línea entera. ** - Debido a la frecuencia con que se borran líneas enteras, los diseÃąadores - de Vim decidieron que sería mÃĄs fÃĄcil el escribir simplemente dos des en - una fila para borrar una línea. - 1. Mueva el cursor a la segunda línea de la lista de abajo. - 2. Escriba dd para borrar la línea. - 3. MuÊvase ahora a la cuarta línea. - 4. Escriba 2dd (recuerde nÃēmero-mandato-objeto) para borrar las dos - líneas. - 1) Las rosas son rojas, - 2) El barro es divertido, - 3) El cielo es azul, - 4) Yo tengo un coche, - 5) Los relojes marcan la hora, - 6) El azucar es dulce, - 7) Y así eres tu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 2.5: EL MANDATO DESHACER + LecciÃŗn 2.6: OPERACIÓN EN LÍNEAS + + + ** Escriba dd para eliminar una línea completa. ** + Debido a la frecuencia con que se elimina una línea completa, los + diseÃąadores de Vi, decidieron que sería mÃĄs sencillo simplemente escribir + dos letras d para eliminar una línea. - ** Pulse u para deshacer los Ãēltimos mandatos, + 1. Mueva el cursor a la segunda línea del pÃĄrrafo inferior. + 2. Escriba dd para eliminar la línea. + 3. Ahora muÊvase a la cuarta línea. + 4. Escriba 2dd para eliminar dos líneas a la vez. + +---> 1) Las rosas son rojas, +---> 2) El barro es divertido, +---> 3) Las violetas son azules, +---> 4) Tengo un coche, +---> 5) Los relojes dan la hora, +---> 6) El azÃēcar es dulce +---> 7) Y tambiÊn lo eres tÃē. + +La duplicaciÃŗn para borrar líneas tambiÊn funcionan con los operadores +mencionados anteriormente. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 2.7: EL MANDATO DESHACER + + + ** Pulse u para deshacer los Ãēltimos comandos, U para deshacer una línea entera. ** - 1. Mueva el cursor a la línea de abajo seÃąalada con ---> y sitÃēelo bajo el + 1. Mueva el cursor a la línea inferior seÃąalada con ---> y sitÃēelo bajo el primer error. - 2. Pulse x para borrar el primer carÃĄter errÃŗneo. - 3. Pulse ahora u para deshacer el Ãēltimo mandato ejecutado. - 4. Ahora corrija todos los errores de la línea usando el mandato x. + 2. Pulse x para borrar el primer carÃĄcter no deseado. + 3. Pulse ahora u para deshacer el Ãēltimo comando ejecutado. + 4. Ahora corrija todos los errores de la línea usando el comando x. 5. Pulse ahora U mayÃēscula para devolver la línea a su estado original. 6. Pulse ahora u unas pocas veces para deshacer lo hecho por U y los - mandatos previos. + comandos previos. 7. Ahora pulse CTRL-R (mantenga pulsada la tecla CTRL y pulse R) unas - pocas veces para volver a ejecutar los mandatos (deshacer lo deshecho). + cuantas veces para volver a ejecutar los comandos (deshacer lo deshecho). ---> Corrrija los errores dee esttta línea y vuuelva a ponerlos coon deshacer. - 8. Estos mandatos son muy Ãētiles. Ahora pase al resumen de la LecciÃŗn 2. + 8. Estos son unos comandos muy Ãētiles. Ahora vayamos al resumen de la + lecciÃŗn 2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 2 - 1. Para borrar desde el cursor hasta el final de una palabra pulse: dw - 2. Para borrar desde el cursor hasta el final de una línea pulse: d$ - 3. Para borrar una línea entera pulse: dd +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMEN DE LA LECCIÓN 2 - 4. El formato de un mandato en modo Normal es: + 1. Para borrar desde el cursor hasta siguiente palabra pulse: dw + 2. Para borrar desde el cursor hasta el final de la palabra pulse: de + 3. Para borrar desde el cursor hasta el final de una línea pulse: d$ + 4. Para borrar una línea entera pulse: dd - [nÃēmero] mandato objeto O mandato [nÃēmero] objeto + 5. Para repetir un movimiento precÊdalo con un nÃēmero: 2w + 6. El formato para un comando de cambio es: + operador [nÃēmero] movimiento donde: - nÃēmero - es cuÃĄntas veces se ha de ejecutar el mandato - mandato - es lo que hay que hacer, por ejemplo, d para borrar - objeto - es sobre lo que el mandato va a operar, por ejemplo - w (palabra), $ (hasta el final de la línea), etc. + comando - es lo que hay que hacer, por ejemplo, d para borrar + [nÃēmero] - es un nÃēmero opcional para repetir el movimiento + movimiento - se mueve sobre el texto sobre el que operar, como + w (palabra), $ (hasta el final de la línea), etc. + 7. Para moverse al inicio de la línea utilice un cero: 0 - 5. Para deshacer acciones previas pulse: u (u minÃēscula) + 8. Para deshacer acciones previas pulse: u (u minÃēscula) Para deshacer todos los cambios de una línea pulse: U (U mayÃēscula) - Para deshacer lo deshecho pulse: CTRL-R + Para deshacer lo deshecho pulse: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 3.1: EL MANDATO ÂĢPUTÂģ (poner) + LecciÃŗn 3.1: EL COMANDO ÂĢPUTÂģ (poner) - ** Pulse p para poner lo Ãēltimo que ha borrado despuÊs del cursor. ** +** Pulse p para poner (pegar) despuÊs del cursor lo Ãēltimo que ha borrado. ** - 1. Mueva el cursor al final de la lista de abajo. + 1. Mueva el cursor a la primera línea inferior marcada con --->. - 2. Escriba dd para borrar la línea y almacenarla en el buffer de Vim. + 2. Escriba dd para borrar la línea y almacenarla en un registro de Vim. - 3. Mueva el cursor a la línea que debe quedar por debajo de la - línea a mover. + 3. Mueva el cursor a la línea c) por ENCIMA de donde debería estar + la línea eliminada. - 4. Estando en mod Normal, pulse p para restituir la línea borrada. + 4. Pulse p para pegar la línea borrada por debajo del cursor. 5. Repita los pasos 2 a 4 para poner todas las líneas en el orden correcto. - d) ÂŋPuedes aprenderla tu? - b) Las violetas son azules, - c) La inteligencia se aprende, - a) Las rosas son rojas, +---> d) ÂŋPuedes aprenderla tÃē? +---> b) Las violetas son azules, +---> c) La inteligencia se aprende, +---> a) Las rosas son rojas, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 3.2: EL MANDATO ÂĢREPLACEÂģ (remplazar) - + LecciÃŗn 3.2: EL COMANDO REEMPLAZAR - ** Pulse r y un carÃĄcter para sustituir el carÃĄcter sobre el cursor. ** + ** Pulse rx para reemplazar el carÃĄcter bajo el cursor con x . ** - 1. Mueva el cursor a la primera línea de abajo seÃąalada con --->. + 1. Mueva el cursor a la primera línea inferior marcada con --->. - 2. Mueva el cursor para situarlo bajo el primer error. + 2. Mueva el cursor para situarlo sobre el primer error. - 3. Pulse r y el carÃĄcter que debe sustituir al errÃŗneo. + 3. Pulse r y despuÊs el carÃĄcter que debería ir ahí. - 4. Repita los pasos 2 y 3 hasta que la primera línea estÊ corregida. + 4. Repita los pasos 2 y 3 hasta que la primera sea igual a la segunda. ---> ÂĄCuendo esta línea fue rscrita alguien pulso algunas teclas equibocadas! ---> ÂĄCuando esta línea fue escrita alguien pulsÃŗ algunas teclas equivocadas! + 5. Ahora pase a la lecciÃŗn 3.3. - +NOTA: Recuerde que debería aprender practicando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 3.3: EL MANDATO ÂĢCHANGEÂģ (cambiar) + LecciÃŗn 3.3: EL COMANDO CAMBIAR - ** Para cambiar parte de una palabra o toda ella escriba cw . ** + ** Para cambiar hasta el final de una línea, escriba ce . ** - - 1. Mueva el cursor a la primera línea de abajo seÃąalada con --->. + 1. Mueva el cursor a la primera línea inferior marcada con --->. 2. SitÃēe el cursor en la u de lubrs. - 3. Escriba cw y corrija la palabra (en este caso, escriba 'ínea'). + 3. Escriba ce y corrija la palabra (en este caso, escriba 'ínea'). - 4. Pulse y mueva el cursor al error siguiente (el primer carÃĄcter - que deba cambiarse). + 4. Pulse y mueva el cursor al siguiente error que debe ser cambiado. 5. Repita los pasos 3 y 4 hasta que la primera frase sea igual a la segunda. ----> Esta lubrs tiene unas pocas pskavtad que corregir usem el mandato change. ----> Esta línea tiene unas pocas palabras que corregir usando el mandato change. +---> Esta lubrs tiene unas pocas pskavtad que corregir usem el comando change. +---> Esta línea tiene unas pocas palabras que corregir usando el comando change. + +Tenga en cuenta que ce elimina la palabra y entra en el modo Insertar. + cc hace lo mismo para toda la línea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LecciÃŗn 3.4: MÁS CAMBIOS USANDO c - ** El mandato change se utiliza con los mismos objetos que delete. ** + ** El operador change se utiliza con los mismos movimientos que delete. ** - 1. El mandato change funciona de la misma forma que delete. El formato es: + 1. El operador change funciona de la misma forma que delete. El formato es: - [nÃēmero] c objeto O c [nÃēmero] objeto + c [nÃēmero] movimiento - 2. Los objetos son tambiÊm los mismos, tales como w (palabra), $ (fin de - la línea), etc. + 2. Los movimientos son tambiÊn los mismos, tales como w (palabra) o + $ (fin de la línea). - 3. Mueva el cursor a la primera línea de abajo seÃąalada con --->. + 3. Mueva el cursor a la primera línea inferior seÃąalada con --->. 4. Mueva el cursor al primer error. - 5. Escriba c$ para hacer que el resto de la línea sea como la segunda + 5. Pulse c$ y escriba el resto de la línea para que sea como la segunda y pulse . ---> El final de esta línea necesita alguna ayuda para que sea como la segunda. ----> El final de esta línea necesita ser corregido usando el mandato c$. +---> El final de esta línea necesita ser corregido usando el comando c$. + +NOTA: Puede utilizar el retorno de carro para corregir errores mientras escribe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIÓN 3 - 1. Para sustituir texto que ha sido borrado, pulse p . Esto Pone el texto - borrado DESPUÉS del cursor (si lo que se ha borrado es una línea se - situarÃĄ sobre la línea que estÃĄ sobre el cursor). + 1. Para volver a poner o pegar el texto que acaba de ser borrado, + escriba p . Esto pega el texto despuÊs del cursor (si se borrÃŗ una + línea, al pegarla, esta se situarÃĄ en la línea debajo del cursor). 2. Para sustituir el carÃĄcter bajo el cursor, pulse r y luego el - carÃĄcter que sustituirÃĄ al original. + carÃĄcter que quiere que estÊ en ese lugar. - 3. El mandato change le permite cambiar el objeto especificado desde la - posiciÃŗn del cursor hasta el final del objeto; e.g. Pulse cw para - cambiar desde el cursor hasta el final de la palabra, c$ para cambiar - hasta el final de la línea. + 3. El operador change le permite cambiar desde la posiciÃŗn del cursor + hasta donde el movimiento indicado le lleve. Por ejemplo, pulse ce + para cambiar desde el cursor hasta el final de la palabra, o c$ + para cambiar hasta el final de la línea. 4. El formato para change es: - [nÃēmero] c objeto O c [nÃēmero] objeto + c [nÃēmero] movimiento Pase ahora a la lecciÃŗn siguiente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 4.1: SITUACIÓN EN EL FICHERO Y SU ESTADO + LecciÃŗn 4.1: UBICACIÓN DEL CURSOR Y ESTADO DEL ARCHIVO + ** Pulse CTRL-G para mostrar su situaciÃŗn en el fichero y su estado. + Pulse G para moverse a una determinada línea del fichero. ** - ** Pulse CTRL-g para mostrar su situaciÃŗn en el fichero y su estado. - Pulse MAYU-G para moverse a una determinada línea del fichero. ** +NOTA: ÂĄÂĄLea esta lecciÃŗn entera antes de ejecutar cualquiera de los pasos!! - Nota: ÂĄÂĄLea esta lecciÃŗn entera antes de ejecutar alguno de los pasos!! + 1. Mantenga pulsada la tecla Ctrl y pulse g . Le llamamos a esto CTRL-G. + AparecerÃĄ un mensaje en la parte inferior de la pÃĄgina con el nombre + del archivo y la posiciÃŗn en este. Recuerde el nÃēmero de línea + para el paso 3. +NOTA: QuizÃĄs pueda ver la posiciÃŗn del cursor en la esquina inferior derecha + de la pantalla. Esto ocurre cuando la opciÃŗn 'ruler' (regla) estÃĄ + habilitada (consulte :help 'ruler' ) - 1. Mantenga pulsada la tecla Ctrl y pulse g . Aparece una línea de estado - al final de la pantalla con el nombre del fichero y la línea en la que - estÃĄ situado. Recuerde el nÃēmero de la línea para el Paso 3. + 2. Pulse G para mover el cursor hasta la parte inferior del archivo. + Pulse gg para mover el cursor al inicio del archivo. - 2. Pulse Mayu-G para ir al final del fichero. + 3. Escriba el nÃēmero de la línea en la que estaba y despuÊs G . Esto + le volverÃĄ a la línea en la que estaba cuando pulsÃŗ CTRL-G. - 3. Escriba el nÃēmero de la línea en la que estaba y despÃēes Mayu-G. Esto - le volverÃĄ a la línea en la que estaba cuando pulsÃŗ Ctrl-g. - (Cuando escriba los nÃēmeros NO se mostrarÃĄn en la pantalla). - - 4. Si se siente confiado en poder hacer esto ejecute los pasos 1 a 3. + 4. Si se siente seguro en poder hacer esto ejecute los pasos 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 4.2: EL MANDATO ÂĢSEARCHÂģ (buscar) + LecciÃŗn 4.2: EL COMANDO ÂĢSEARCHÂģ (buscar) ** Escriba / seguido de una frase para buscar la frase. ** 1. En modo Normal pulse el carÃĄcter / . Fíjese que tanto el carÃĄcter / como el cursor aparecen en la Ãēltima línea de la pantalla, lo mismo - que el mandato : . + que el comando : . 2. Escriba ahora errroor . Esta es la palabra que quiere buscar. - 3. Para repetir la bÃēsqueda, simplemente pulse n . - Para busacar la misma frase en la direcciÃŗn opuesta, pulse Mayu-N . + 3. Para repetir la bÃēsqueda de la misma frase otra vez, simplemente pulse n . + Para buscar la misma frase en la direcciÃŗn opuesta, pulse N . 4. Si quiere buscar una frase en la direcciÃŗn opuesta (hacia arriba), - utilice el mandato ? en lugar de / . + utilice el comando ? en lugar de / . + + 5. Para regresar al lugar de donde procedía pulse CTRL-O (Mantenga pulsado + Ctrl mientras pulsa la letra o). Repita el proceso para regresar mÃĄs atrÃĄs. + CTRL-I va hacia adelante. ----> Cuando la bÃēsqueda alcanza el final del fichero continuarÃĄ desde el - principio. +---> "errroor" no es la forma correcta de escribir error, errroor es un error. - ÂĢerrroorÂģ no es la forma de deletrear error; errroor es un error. +NOTA: Cuando la bÃēsqueda llega al final del archivo, continuarÃĄ desde el + comienzo, a menos que la opciÃŗn 'wrapscan' haya sido desactivada. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LecciÃŗn 4.3: BÚSQUEDA PARA COMPROBAR PARÉNTESIS ** Pulse % para encontrar el parÊntesis correspondiente a ),] o } . ** - - 1. SitÃēe el cursor en cualquiera de los caracteres ), ] o } en la línea de - abajo seÃąalada con --->. + 1. SitÃēe el cursor en cualquiera de los caracteres (, [ o { en la línea + inferior seÃąalada con --->. 2. Pulse ahora el carÃĄcter % . - 3. El cursor debería situarse en el parÊntesis (, corchete [ o llave { - correspondiente. + 3. El cursor se moverÃĄ a la pareja de cierre del parÊntesis, corchete + o llave correspondiente. + + 4. Pulse % para mover el cursor a la otra pareja del carÃĄcter. + + 5. Mueva el cursor a otro (,),[,],{ o } y vea lo que hace % . - 4. Pulse % para mover de nuevo el cursor al parÊntesis, corchete o llave - correspondiente. +---> Esto ( es una línea de prueba con (, [, ], {, y } en ella. )) ----> Esto ( es una línea de prueba con (, [, ], {, y } en ella. )). +NOTA: ÂĄEsto es muy Ãētil en la detecciÃŗn de errores en un programa con + parÊntesis, corchetes o llaves sin pareja. + -Nota: ÂĄEsto es muy Ãētil en la detecciÃŗn de errores en un programa con - parÊntesis, corchetes o llaves disparejos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 4.4: UNA FORMA DE CAMBIAR ERRORES + LecciÃŗn 4.4: EL COMANDO SUSTITUIR ** Escriba :s/viejo/nuevo/g para sustituir 'viejo' por 'nuevo'. ** - - 1. Mueva el cursor a la línea de abajo seÃąalada con --->. + 1. Mueva el cursor a la línea inferior seÃąalada con --->. 2. Escriba :s/laas/las/ . Tenga en cuenta que este mandato cambia sÃŗlo la primera apariciÃŗn en la línea de la expresiÃŗn a cambiar. + + 3. Ahora escriba :/laas/la/g . Al aÃąadir la opciÃŗn g esto significa + que harÃĄ la sustituciÃŗn global en la línea, cambiando todas las + ocurrencias del tÊrmino "laas" en la línea. ---> Laas mejores Êpocas para ver laas flores son laas primaveras. - 4. Para cambiar todas las apariciones de una expresiÃŗn ente dos líneas - escriba :#,#s/viejo/nuevo/g donde #,# son los nÃēmeros de las dos - líneas. Escriba :%s/viejo/nuevo/g para hacer los cambios en todo - el fichero. - - - - + 4. Para cambiar cada ocurrencia de la cadena de caracteres entre dos líneas, + Pulse :#,#s/viejo/nuevo/g donde #,# son los nÃēmeros de línea del rango + de líneas donde se realizarÃĄ la sustituciÃŗn. + Pulse :%s/old/new/g para cambiar cada ocurrencia en todo el + archivo. + Pulse :%s/old/new/gc para encontrar cada ocurrencia en todo el + archivo, pidiendo confirmaciÃŗn para + realizar la sustituciÃŗn o no. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIÓN 4 - 1. Ctrl-g muestra la posiciÃŗn del cursor en el fichero y su estado. - Mayu-G mueve el cursor al final del fichero. Un nÃēmero de línea - seguido de Mayu-G mueve el cursor a la línea con ese nÃēmero. + 1. CTRL-G muestra la posiciÃŗn del cursor en el fichero y su estado. + G mueve el cursor al final del archivo. + nÃēmero G mueve el cursor a ese nÃēmero de línea. + gg mueve el cursor a la primera línea del archivo. 2. Pulsando / seguido de una frase busca la frase hacia ADELANTE. Pulsando ? seguido de una frase busca la frase hacia ATRÁS. DespuÊs de una bÃēsqueda pulse n para encontrar la apariciÃŗn - siguiente en la misma direcciÃŗn. + siguiente en la misma direcciÃŗn o N para buscar en direcciÃŗn opuesta. 3. Pulsando % cuando el cursor esta sobre (,), [,], { o } localiza la pareja correspondiente. - 4. Para cambiar viejo por nuevo en una línea pulse :s/viejo/nuevo + 4. Para cambiar viejo en el primer nuevo en una línea pulse :s/viejo/nuevo Para cambiar todos los viejo por nuevo en una línea pulse :s/viejo/nuevo/g Para cambiar frases entre dos nÃēmeros de líneas pulse :#,#s/viejo/nuevo/g Para cambiar viejo por nuevo en todo el fichero pulse :%s/viejo/nuevo/g @@ -499,11 +621,10 @@ Nota: ÂĄEsto es muy Ãētil en la detecciÃŗn de errores en un programa con LecciÃŗn 5.1: CÓMO EJECUTAR UN MANDATO EXTERNO - ** Escriba :! seguido de un mandato externo para ejecutar ese mandato. ** - + ** Escriba :! seguido de un comando externo para ejecutar ese comando. ** - 1. Escriba el conocido mandato : para situar el cursor al final de la - pantalla. Esto le permitirÃĄ introducir un mandato. + 1. Escriba el conocido comando : para situar el cursor al final de la + pantalla. Esto le permitirÃĄ introducir un comando. 2. Ahora escriba el carÃĄcter ! (signo de admiraciÃŗn). Esto le permitirÃĄ ejecutar cualquier mandato del sistema. @@ -512,9 +633,11 @@ Nota: ÂĄEsto es muy Ãētil en la detecciÃŗn de errores en un programa con le mostrarÃĄ una lista de su directorio, igual que si estuviera en el símbolo del sistema. Si ls no funciona utilice !:dir . ---->Nota: De esta manera es posible ejecutar cualquier mandato externo. +NOTA: De esta manera es posible ejecutar cualquier comando externo, + tambiÊn incluyendo argumentos. ---->Nota: Todos los mandatos : deben finalizarse pulsando . +NOTA: Todos los comando : deben finalizarse pulsando . + De ahora en adelante no siempre se mencionarÃĄ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -522,10 +645,10 @@ Nota: ÂĄEsto es muy Ãētil en la detecciÃŗn de errores en un programa con ** Para guardar los cambios hechos en un fichero, - escriba :w NOMBRE_DE_FICHERO. ** + escriba :w NOMBRE_DE_FICHERO ** - - 1. Escriba :!dir o :!ls para ver una lista de su directorio. + 1. Escriba :!dir o :!ls para ver una lista de los archivos + de su directorio. Ya sabe que debe pulsar despuÊs de ello. 2. Elija un nombre de fichero que todavía no exista, como TEST. @@ -533,210 +656,337 @@ Nota: ÂĄEsto es muy Ãētil en la detecciÃŗn de errores en un programa con 3. Ahora escriba :w TEST (donde TEST es el nombre de fichero elegido). 4. Esta acciÃŗn guarda todo el fichero (Vim Tutor) bajo el nombre TEST. - Para comprobarlo escriba :!dir de nuevo y vea su directorio. + Para comprobarlo escriba :!dir o :!ls de nuevo y vea su directorio. + +NOTA: Si saliera de Vim y volviera a entrar de nuevo con vim TEST , el + archivo sería una copia exacta del tutorial cuando lo guardÃŗ. + + 5. Ahora elimine el archivo escribiendo (Windows): :!del TEST + o (Unix): :!rm TEST ----> Tenga en cuenta que si sale de Vim y entra de nuevo con el nombre de - fichero TEST, el fichero sería una copia exacta del tutor cuando lo - ha guardado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 5.3: UN MANDATO DE ESCRITURA SELECTIVO + LecciÃŗn 5.3: SELECCIONAR TEXTO PARA GUARDAR + - ** Para guardar parte del fichero escriba :#,# NOMBRE_DEL_FICHERO ** + ** Para guardar parte del archivo, escriba v movimiento :w ARCHIVO ** + 1. Mueva el cursor a esta línea. - 1. Escriba de nuevo, una vez mÃĄs, :!dir o :!ls para obtener una lista - de su directorio y elija nombre de fichero adecuado, como TEST. + 2. Pulse v y mueva el cursor hasta el quinto elemento inferior. Vea que + el texto es resaltado. - 2. Mueva el cursor al principio de la pantalla y pulse Ctrl-g para saber - el nÃēmero de la línea correspondiente. ÂĄRECUERDE ESTE NÚMERO! + 3. Pulse el carÃĄcter : en la parte inferior de la pantalla aparecerÃĄ + :'<,'> - 3. Ahora mueva el cursor a la Ãēltima línea de la pantalla y pulse Ctrl-g - de nuevo. ÂĄRECUERDE TAMBIÉN ESTE NÚMERO! + 4. Pulse w TEST , donde TEST es un nombre de archivo que aÃēn no existe. + Verifique que :'<,'>w TEST antes de pulsar . - 4. Para guardar SOLAMENTE una parte de un fichero, escriba :#,# w TEST - donde #,# son los nÃēmeros que usted ha recordado (primera línea, - Ãēltima línea) y TEST es su nombre de dichero. + 5. Vim escribirÃĄ las líneas seleccionadas en el archivo TEST. Utilice + :!dir o :!ls para verlo. ÂĄNo lo elimine todavía! Lo utilizaremos + en la siguiente lecciÃŗn. - 5. De nuevo, vea que el fichero esta ahí con :!dir pero NO lo borre. +NOTA: Al pulsar v inicia la selecciÃŗn visual. Puede mover el cursor para + hacer la selecciÃŗn mÃĄs grande o pequeÃąa. DespuÊs puede utilizar un + operador para hacer algo con el texto. Por ejemplo, d eliminarÃĄ + el texto seleccionado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LecciÃŗn 5.4: RECUPERANDO Y MEZCLANDO FICHEROS + ** Para insertar el contenido de un fichero escriba :r NOMBRE_DEL_FICHERO ** - 1. Escriba :!dir para asegurarse de que su fichero TEST del ejercicio - anterior estÃĄ presente. + 1. SitÃēe el cursor justo por encima de esta línea. - 2. Situe el cursor al principio de esta pantalla. +NOTA: DespuÊs de ejecutar el paso 2 verÃĄ texto de la lecciÃŗn 5.3. DespuÊs + DESCIENDA hasta ver de nuevo esta lecciÃŗn. -NOTA: DespuÊs de ejecutar el paso 3 se verÃĄ la LecciÃŗn 5.3. Luego muÊvase - hacia ABAJO para ver esta lecciÃŗn de nuevo. + 2. Ahora recupere el archivo TEST utilizando el comando :r TEST donde + TEST es el nombre que ha utilizado. + El archivo que ha recuperado se colocarÃĄ debajo de la línea donde + se encuentra el cursor. - 3. Ahora recupere el fichero TEST utilizando el mandato :r TEST donde - TEST es el nombre del fichero. + 3. Para verificar que se ha recuperado el archivo, suba el cursor y + compruebe que ahora hay dos copias de la lecciÃŗn 5.3, la original y + la versiÃŗn del archivo. -NOTA: El fichero recuperado se sitÃēa a partir de la posiciÃŗn del cursor. +NOTA: TambiÊn puede leer la salida de un comando externo. Por ejemplo, + :r !ls lee la salida del comando ls y lo pega debajo de la línea + donde se encuentra el cursor. - 4. Para verificar que el fichero ha sido recuperado, mueva el cursor hacia - arriba y vea que hay dos copias de la LecciÃŗn 5.3, la original y la - versiÃŗn del fichero. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESUMEN DE LA LECCIÓN 5 - 1. :!mandato ejecuta un mandato externo. + 1. :!comando ejecuta un comando externo. Algunos ejemplos Ãētiles son: - :!dir - muestra el contenido de un directorio. - :!del NOMBRE_DE_FICHERO - borra el fichero NOMBRE_DE FICHERO. - - 2. :#,#w NOMBRE_DE _FICHERO guarda desde las líneas # hasta la # en el - fichero NOMBRE_DE_FICHERO. - - 3. :r NOMBRE_DE _FICHERO recupera el fichero del disco NOMBRE_DE FICHERO - y lo inserta en el fichero en curso a partir de la posiciÃŗn del cursor. - + (Windows) (Unix) + :!dir :!ls - muestra el contenido de un directorio. + :!del ARCHIVO :!rm ARCHIVO - borra el fichero ARCHIVO. + 2. :w ARCHIVO escribe el archivo actual de Vim en el disco con el + nombre de ARCHIVO. + 3. v movimiento :w ARCHIVO guarda las líneas seleccionadas visualmente + en el archivo ARCHIVO. + 4. :r ARCHIVO recupera del disco el archivo ARCHIVO y lo pega debajo + de la posiciÃŗn del cursor. + 5. :r !dir lee la salida del comando dir y lo pega debajo de la + posiciÃŗn del cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 6.1: EL MANDATO ÂĢOPENÂģ (abrir) + LecciÃŗn 6.1: EL COMANDO OPEN ** Pulse o para abrir una línea debajo del cursor - y situarle en modo Insert ** + y situarle en modo Insertar ** + 1. Mueva el cursor a la línea inferior seÃąalada con --->. - 1. Mueva el cursor a la línea de abajo seÃąalada con --->. + 2. Pulse la letra minÃēscula o para abrir una línea por DEBAJO del cursor + y situarle en modo Insertar. + + 3. Ahora escriba algÃēn texto y despuÊs pulse para salir del modo + insertar. - 2. Pulse o (minÃēscula) para abrir una línea por DEBAJO del cursor - y situarle en modo Insert. +---> DespuÊs de pulsar o el cursor se sitÃēa en la línea abierta en modo Insertar. - 3. Ahora copie la línea seÃąalada con ---> y pulse para salir del - modo Insert. + 4. Para abrir una línea por ENCIMA del cursor, simplemente pulse una O + mayÃēscula, en lugar de una o minÃēscula. Pruebe este en la línea siguiente. + +---> Abra una línea sobre esta pulsando O cuando el cursor estÃĄ en esta línea. ----> Luego de pulsar o el cursor se sitÃēa en la línea abierta en modo Insert. - 4. Para abrir una línea por encima del cursor, simplemente pulse una O - mayÃēscula, en lugar de una o minÃēscula. Pruebe este en la línea siguiente. -Abra una línea sobre Êsta pulsando Mayu-O cuando el curso estÃĄ en esta línea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 6.2: EL MANDATO ÂĢAPPENDÂģ (aÃąadir) + LecciÃŗn 6.2: EL COMANDO APPEND (aÃąadir) + ** Pulse a para insertar texto DESPUÉS del cursor. ** + 1. Mueva el cursor al inicio de la primera línea inferior seÃąalada con --->. - 1. Mueva el cursor al final de la primera línea de abajo seÃąalada con ---> - pulsando $ en modo Normal. + 2. Escriba e hasta que el cursor estÊ al final de lín . - 2. Escriba una a (minÃēscula) para aÃąadir texto DESPUÉS del carÃĄcter - que estÃĄ sobre el cursor. (A mayÃēscula aÃąade texto al final de la línea). + 3. Escriba una a (minÃēscula) para aÃąadir texto DESPUÉS del cursor. -Nota: ÂĄEsto evita el pulsar i , el Ãēltimo carÃĄcter, el texto a insertar, - , cursor a la derecha y, finalmente, x , sÃŗlo para aÃąadir algo - al final de una línea! + 4. Complete la palabra como en la línea inferior. Pulse para salir + del modo insertar. + + 5. Utilice e para moverse hasta la siguiente palabra incompleta y + repita los pasos 3 y 4. - 3. Complete ahora la primera línea. NÃŗtese que append es exactamente lo - mismo que modo Insert, excepto por el lugar donde se inserta el texto. +---> Esta lín le permit prati cÃŗmo aÃąad texto a una línea. +---> Esta línea le permitirÃĄ practicar cÃŗmo aÃąadir texto a una línea. ----> Esta línea le permitirÃĄ praticar ----> Esta línea le permitirÃĄ praticar el aÃąadido de texto al final de una línea. +NOTA: a, i y A todos entran en el modo Insertar, la Ãēnica diferencia es + dÃŗnde ubican los caracteres insertados. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 6.3: OTRA VERSIÓN DE ÂĢREPLACEÂģ (remplazar) + LecciÃŗn 6.3: OTRA VERSIÓN DE REPLACE (remplazar) + ** Pulse una R mayÃēscula para sustituir mÃĄs de un carÃĄcter. ** + 1. Mueva el cursor a la primera línea inferior seÃąalada con --->. Mueva + el cursor al inicio de la primera xxx . - 1. Mueva el cursor a la primera línea de abajo seÃąalada con --->. + 2. Ahora pulse R y escriba el nÃēmero que aparece en la línea inferior, + esto reemplazarÃĄ el texto xxx . + + 3. Pulse para abandonar el modo Reemplazar. Observe que el resto de + la línea permanece sin modificaciones. - 2. SitÃēe el cursor al comienzo de la primera palabra que sea diferente - de las de la segunda línea marcada con ---> (la palabra 'anterior'). + 4. Repita los pasos para reemplazar el texto xxx que queda. - 3. Ahora pulse R y sustituya el resto del texto de la primera línea - escribiendo sobre el viejo texto para que la primera línea sea igual - que la primera. +---> Sumar 123 a xxx da un resultado de xxx. +---> Sumar 123 a 456 da un resultado de 579. ----> Para hacer que esta línea sea igual que la anterior use las teclas. ----> Para hacer que esta línea sea igual que la siguiente escriba R y el texto. +NOTA: El modo Reemplazar es como el modo Insertar, pero cada carÃĄcter escrito + elimina un carÃĄcter ya existente. - 4. NÃŗtese que cuando pulse para salir, el texto no alterado permanece. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 6.4: COPIAR Y PEGAR TEXTO -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 6.4: FIJAR OPCIONES + ** Utilice el operador y para copiar texto y p para pegarlo. ** - ** Fijar una opciÃŗn de forma que una bÃēsqueda o sustituciÃŗn ignore la caja ** - (Para el concepto de caja de una letra, vÊase la nota al final del fichero) + 1. Mueva el cursor a la línea inferior marcada con ---> y posicione el + cursor despuÊs de "a)". + 2. Inicie el modo Visual con v y mueva el cursor justo antes de "primer". - 1. Busque 'ignorar' introduciendo: - /ignorar - Repita varias veces la bÃēsque pulsando la tecla n + 3. Pulse y para copiar ("yank") el texto resaltado. - 2. Fije la opciÃŗn 'ic' (Ignorar la caja de la letra) escribiendo: - :set ic + 4. Mueva el cursor al final de la siguiente línea mediante: j$ - 3. Ahora busque 'ignorar' de nuevo pulsando n - Repita la bÃēsqueda varias veces mÃĄs pulsando la tecla n + 5. Pulse p para poner (pegar) el texto. DespuÊs escriba: el segundo . - 4. Fije las opciones 'hlsearch' y 'insearch': - :set hls is + 6. Utilice el modo visual para seleccionar " elemento.", y cÃŗpielo con y + mueva el cursor al final de la siguiente línea con j$ y pegue el texto + reciÊn copiado con p . - 5. Ahora introduzca la orden de bÃēsqueda otra vez, y vea quÊ pasa: - /ignore +---> a) este es el primer elemento. + b) +NOTA: TambiÊn puede utilizar y como un operador: yw copia una palabra, + yy copia la línea completa donde estÃĄ el cursor, despuÊs p pegarÃĄ + esa línea. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 6 + LecciÃŗn 6.5: ACTIVAR (SET) UNA OPCIÓN - 1. Pulsando o abre una línea por DEBAJO del cursor y sitÃēa el cursor en - la línea abierta en modo Insert. - Pulsando una O mayÃēscula se abre una línea SOBRE la que estÃĄ el cursor. + ** Active una opciÃŗn para buscar o sustituir ignorando si estÃĄ + en mayÃēsculas o minÃēsculas el texto. ** - 2. Pulse una a para insertar texto DESPUÉS del carÃĄcter sobre el cursor. - Pulsando una A mayÃēscula aÃąade automÃĄticamente texto al final de la - línea. + 1. Busque la cadena de texto 'ignorar' escribiendo: /ignorar + Repita la bÃēsqueda varias veces pulsando n . - 3. Pulsando una R mayÃēscula se entra en modo Replace hasta que, para salir, - se pulse . + 2. Active la opciÃŗn 'ic' (Ignore case o ignorar mayÃēsculas y minÃēsculas) + mediante: :set ic - 4. Escribiendo ÂĢ:set xxxÂģ fija la opciÃŗn ÂĢxxxÂģ + 3. Ahora busque de nuevo 'ignorar' pulsando n + Observe que ahora tambiÊn se encuentran Ignorar e IGNORAR. + 4. Active las opciones 'hlsearch' y 'incsearch' escribiendo: :set hls is + 5. Ahora escriba de nuevo el comando de bÃēsqueda y vea quÊ ocurre: /ignore + 6. Para inhabilitar el ignorar la distinciÃŗn de mayÃēsculas y minÃēsculas + escriba: :set noic +NOTA: Para eliminar el resaltado de las coincidencias escriba: :nohlsearch +NOTA: Si quiere ignorar las mayÃēsculas y minÃēsculas, solo para un comando + de bÃēsqueda, utilice \c en la frase: /ignorar\c +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMEN DE LA LECCIÓN 6 + 1. Escriba o para abrir una línea por DEBAJO de la posiciÃŗn del cursor y + entrar en modo Insertar. + Escriba O para abrir una línea por ENCIMA de la posiciÃŗn del cursor y + entrar en modo Insertar + + 2. Escriba a para insertar texto DESPUÉS del cursor. + Escriba A para insertar texto al final de la línea. + + 3. El comando e mueve el cursor al final de una palabra. + + 4. El operador y copia (yank) texto, p lo pega (pone). + + 5. Al escribir una R mayÃēscula entra en el modo Reemplazar hasta que + se pulsa . + + 6. Al escribir ":set xxx" activa la opciÃŗn "xxx". Algunas opciones son: + 'ic' 'ignorecase' ignorar mayÃēsculas/minÃēsculas al buscar + 'is' 'incsearch' mostrar las coincidencias parciales para la bÃēsqueda + de una frase + 'hls' 'hlsearch' resalta todas las coincidencias de la frases + Puedes utilizar tanto los nombre largos o cortos de las opciones. + + 7. AÃąade "no" para inhabilitar una opciÃŗn: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LecciÃŗn 7: MANDATOS PARA LA AYUDA EN LÍNEA + LecciÃŗn 7: OBTENER AYUDA - ** Utilice el sistema de ayuda en línea ** + ** Utilice el sistema de ayuda en línea ** - Vim dispone de un sistema de ayuda en línea. Para activarlo, pruebe una + Vim dispone de un sistema de ayuda en línea. Para comenzar, pruebe una de estas tres formas: - pulse la tecla (si dispone de ella) - pulse la tecla (si dispone de ella) - escriba :help - Escriba :q para cerrar la ventana de ayuda. + Lea el texto en la ventana de ayuda para descubrir cÃŗmo funciona la ayuda. + Escriba CTRL-W CTRL-W para saltar de una ventana a otra. + Escriba :q para cerrar la ventana de ayuda. Puede encontrar ayuda en casi cualquier tema aÃąadiendo un argumento al - mandato ÂĢ:helpÂģ mandato. Pruebe Êstos: + comando ÂĢ:helpÂģ. Pruebe Êstos (no olvide pulsar ): + + :help w + :help c_CTRL-D + :help insert-index + :help user-manual +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 7.2: CREAR UN SCRIPT DE INICIO + + + ** Habilitar funcionalidades en Vim ** + + Vim tiene muchas mÃĄs funcionalidades que Vi, pero algunas estÃĄn + inhabilitadas de manera predeterminada. + Para empezar a utilizar mÃĄs funcionalidades debería crear un archivo + llamado "vimrc". + + 1. Comience a editar el archivo "vimrc". Esto depende de su sistema: + :e ~/.vimrc para Unix + :e ~/_vimrc para Windows + + 2. Ahora lea el contenido del archivo "vimrc" de ejemplo: + :r $VIMRUNTIME/vimrc_example.vim + + 3. Guarde el archivo mediante: + :w + + La prÃŗxima vez que inicie Vim, este usarÃĄ el resaltado de sintaxis. + Puede aÃąadir todos sus ajustes preferidos a este archivo "vimrc". + Para mÃĄs informaciÃŗn escriba :help vimrc-intro + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LecciÃŗn 7.3: COMPLETADO + + + ** Completado de la línea de comandos con CTRL-D o ** + + 1. AsegÃērese de que Vim no estÃĄ en el modo compatible: :set nocp + + 2. Vea quÊ archivos existen en el directorio con: :!ls o :!dir + + 3. Escriba el inicio de un comando: :e + + 4. Pulse CTRL-D y Vim mostrarÃĄ una lista de comandos que empiezan con "e". + + 5. AÃąada d y Vim completarÃĄ el nombre del comando a ":edit". + + 6. Ahora aÃąada un espacio y el inicio del nombre de un archivo: :edit FIL + + 7. Pulse . Vim completarÃĄ el nombre (si solo hay uno). + +NOTA: El completado funciona con muchos comandos. Solo pulse CTRL-D o + . Es especialmente Ãētil para :help . + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMEN DE LA LECCIÓN 7 + + + 1. Escriba :help o pulse o para abrir la ventana de ayuda. + + 2. Escriba :help cmd para encontrar ayuda sobre cmd . + + 3. Escriba CTRL-W CTRL-W para saltar a otra ventana. + + 4. Escriba :q para cerrar la ventana de ayuda. + + 5. Cree un fichero vimrc de inicio para guardar sus ajustes preferidos. + + 6. Cuando escriba un comando : pulse CTRL-D para ver posibles opciones. + Pulse para utilizar una de las opciones de completado. + + + + - :help w - :help c_ - :help insert-index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -744,13 +994,15 @@ Nota: ÂĄEsto evita el pulsar i , el Ãēltimo carÃĄcter, el texto a insertar, Aquí concluye el tutor de Vim. EstÃĄ pensado para dar una visiÃŗn breve del editor Vim, lo suficiente para permitirle usar el editor de forma bastante sencilla. EstÃĄ muy lejos de estar completo pues Vim tiene muchísimos mÃĄs - mandatos. + comandos. Lea el siguiente manual de usuario: ":help user-manual". Para lecturas y estudios posteriores se recomienda el libro: - Learning the Vi Editor - por Linda Lamb - Editorial: O'Reilly & Associates Inc. - Es un buen libro para llegar a saber casi todo lo que desee hacer con Vi. - La sexta ediciÃŗn incluye tambiÊn informaciÃŗn sobre Vim. + Vim - Vi Improved - de Steve Oualline + Editado por: New Riders + El primer libro dedicado completamente a Vim. Especialmente Ãētil para + reciÊn principiantes. + Tiene muchos ejemplos e imÃĄgenes. + Vea https://iccf-holland.org/click5.html Este tutorial ha sido escrito por Michael C. Pierce y Robert K. Ware, Colorado School of Mines utilizando ideas suministradas por Charles Smith, @@ -760,10 +1012,12 @@ Nota: ÂĄEsto evita el pulsar i , el Ãēltimo carÃĄcter, el texto a insertar, Modificado para Vim por Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + Traducido del inglÊs por: - Eduardo F. Amatria - Correo electrÃŗnico: eferna1@platea.pntic.mec.es + * Eduardo F. Amatria + Correo electrÃŗnico: eferna1@platea.pntic.mec.es + * Victorhck + Correo electrÃŗnico: victorhck@opensuse.org ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.fr b/runtime/tutor/tutor.fr index a139fb4992c0b..35f7440001614 100644 --- a/runtime/tutor/tutor.fr +++ b/runtime/tutor/tutor.fr @@ -906,9 +906,9 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez soit appuyīŋŊ. 6. Taper ":set xxx" active l'option "xxx". Quelques options sont : - 'ic' 'ingnorecase' pour ignorer la casse lors des recherches. - 'is' 'incsearch' pour montrer les appariements partiels. - 'hls' 'hlsearch' pour mettre en surbrillance les appariements. + 'ic' 'ignorecase' pour ignorer la casse lors des recherches. + 'is' 'incsearch' pour montrer les appariements partiels. + 'hls' 'hlsearch' pour mettre en surbrillance les appariements. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -950,7 +950,7 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez 1. Commencez īŋŊ īŋŊditer le fichier "vimrc". Ceci dīŋŊpend de votre systīŋŊme : :edit ~/.vimrc pour Unix - :edit $VIM/_vimrc pour Windows + :edit ~/_vimrc pour Windows 2. Lisez maintenant le fichier d'exemple "vimrc" : :r $VIMRUNTIME/vimrc_example.vim diff --git a/runtime/tutor/tutor.fr.utf-8 b/runtime/tutor/tutor.fr.utf-8 index 972439b9fcf48..35eab89d87dae 100644 --- a/runtime/tutor/tutor.fr.utf-8 +++ b/runtime/tutor/tutor.fr.utf-8 @@ -906,9 +906,9 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez soit appuyÊ. 6. Taper ":set xxx" active l'option "xxx". Quelques options sont : - 'ic' 'ingnorecase' pour ignorer la casse lors des recherches. - 'is' 'incsearch' pour montrer les appariements partiels. - 'hls' 'hlsearch' pour mettre en surbrillance les appariements. + 'ic' 'ignorecase' pour ignorer la casse lors des recherches. + 'is' 'incsearch' pour montrer les appariements partiels. + 'hls' 'hlsearch' pour mettre en surbrillance les appariements. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -950,7 +950,7 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez 1. Commencez à Êditer le fichier "vimrc". Ceci dÊpend de votre système : :edit ~/.vimrc pour Unix - :edit $VIM/_vimrc pour Windows + :edit ~/_vimrc pour Windows 2. Lisez maintenant le fichier d'exemple "vimrc" : :r $VIMRUNTIME/vimrc_example.vim diff --git a/runtime/tutor/tutor.hr b/runtime/tutor/tutor.hr index 90443bf659d8d..fced37437e58e 100644 --- a/runtime/tutor/tutor.hr +++ b/runtime/tutor/tutor.hr @@ -883,7 +883,7 @@ NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi 1. Uredite "vimrc" datoteku. Ovo ovisi o vaīŋŊem sistemu: :e ~/.vimrc za Unix - :e $VIM/_vimrc za MS-Windows + :e ~/_vimrc za MS-Windows 2. Sada uīŋŊitajte primjer sadrīŋŊaja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim @@ -951,7 +951,7 @@ NAPOMENA: Mogu IzdavaīŋŊ: New Riders Prva knjiga potpuno posveīŋŊena Vim-u. Vrlo korisna za poīŋŊetnike. Sa mnogo primjera i slika. - Posjetite http://iccf-holland.org/click5.html + Posjetite https://iccf-holland.org/click5.html SljedeīŋŊa knjiga je neīŋŊto starija i viīŋŊe o Vi-u nego o Vim-u, preporuīŋŊamo: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.hr.cp1250 b/runtime/tutor/tutor.hr.cp1250 index 1956a8aba05e9..f968053b26dce 100644 --- a/runtime/tutor/tutor.hr.cp1250 +++ b/runtime/tutor/tutor.hr.cp1250 @@ -883,7 +883,7 @@ NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi 1. Uredite "vimrc" datoteku. Ovo ovisi o vaīŋŊem sistemu: :e ~/.vimrc za Unix - :e $VIM/_vimrc za MS-Windows + :e ~/_vimrc za MS-Windows 2. Sada uīŋŊitajte primjer sadrīŋŊaja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim @@ -951,7 +951,7 @@ NAPOMENA: Mogu IzdavaīŋŊ: New Riders Prva knjiga potpuno posveīŋŊena Vim-u. Vrlo korisna za poīŋŊetnike. Sa mnogo primjera i slika. - Posjetite http://iccf-holland.org/click5.html + Posjetite https://iccf-holland.org/click5.html SljedeīŋŊa knjiga je neīŋŊto starija i viīŋŊe o Vi-u nego o Vim-u, preporuīŋŊamo: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.hr.utf-8 b/runtime/tutor/tutor.hr.utf-8 index 79838ec7f27ca..291def02084b7 100644 --- a/runtime/tutor/tutor.hr.utf-8 +++ b/runtime/tutor/tutor.hr.utf-8 @@ -883,7 +883,7 @@ NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi 1. Uredite "vimrc" datoteku. Ovo ovisi o vaÅĄem sistemu: :e ~/.vimrc za Unix - :e $VIM/_vimrc za MS-Windows + :e ~/_vimrc za MS-Windows 2. Sada učitajte primjer sadrÅžaja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim @@ -951,7 +951,7 @@ NAPOMENA: Moguće je dopuniti mnoge naredbe. Koristite CTRL-D i . Izdavač: New Riders Prva knjiga potpuno posvećena Vim-u. Vrlo korisna za početnike. Sa mnogo primjera i slika. - Posjetite http://iccf-holland.org/click5.html + Posjetite https://iccf-holland.org/click5.html Sljedeća knjiga je neÅĄto starija i viÅĄe o Vi-u nego o Vim-u, preporučamo: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.hu b/runtime/tutor/tutor.hu index 2a7afce6108de..d895e19740635 100644 --- a/runtime/tutor/tutor.hu +++ b/runtime/tutor/tutor.hu @@ -779,8 +779,8 @@ Megj: A Vimben a sor legv kell egy "vimrc" fīŋŊjlt. 1. KezdjīŋŊk el szerkeszteni a "vimrc" fīŋŊjlt, ennek mīŋŊdja: - :edit ~/.vimrc Unixon, Linuxon - :edit $VIM/_vimrc MS-Windowson + :edit ~/.vimrc Unixon, Linuxon + :edit ~/_vimrc MS-Windowson 2. Most szīŋŊrjuk be a pīŋŊlda "vimrc" fīŋŊjl szīŋŊvegīŋŊt: @@ -810,7 +810,7 @@ Megj: A Vimben a sor legv Publisher: New Riders The first book completely dedicated to Vim. Especially useful for beginners. There are many examples and pictures. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html This book is older and more about Vi than Vim, but also recommended: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.hu.cp1250 b/runtime/tutor/tutor.hu.cp1250 index 2a7afce6108de..d895e19740635 100644 --- a/runtime/tutor/tutor.hu.cp1250 +++ b/runtime/tutor/tutor.hu.cp1250 @@ -779,8 +779,8 @@ Megj: A Vimben a sor legv kell egy "vimrc" fīŋŊjlt. 1. KezdjīŋŊk el szerkeszteni a "vimrc" fīŋŊjlt, ennek mīŋŊdja: - :edit ~/.vimrc Unixon, Linuxon - :edit $VIM/_vimrc MS-Windowson + :edit ~/.vimrc Unixon, Linuxon + :edit ~/_vimrc MS-Windowson 2. Most szīŋŊrjuk be a pīŋŊlda "vimrc" fīŋŊjl szīŋŊvegīŋŊt: @@ -810,7 +810,7 @@ Megj: A Vimben a sor legv Publisher: New Riders The first book completely dedicated to Vim. Especially useful for beginners. There are many examples and pictures. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html This book is older and more about Vi than Vim, but also recommended: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.hu.utf-8 b/runtime/tutor/tutor.hu.utf-8 index 67adcc5655785..f2e0d403c6bb9 100644 --- a/runtime/tutor/tutor.hu.utf-8 +++ b/runtime/tutor/tutor.hu.utf-8 @@ -779,8 +779,8 @@ Megj: A Vimben a sor legvÊgÊre is lehet ÃĄllni, azonban ez elődjÊben kell egy "vimrc" fÃĄjlt. 1. KezdjÃŧk el szerkeszteni a "vimrc" fÃĄjlt, ennek mÃŗdja: - :edit ~/.vimrc Unixon, Linuxon - :edit $VIM/_vimrc MS-Windowson + :edit ~/.vimrc Unixon, Linuxon + :edit ~/_vimrc MS-Windowson 2. Most szÃērjuk be a pÊlda "vimrc" fÃĄjl szÃļvegÊt: @@ -810,7 +810,7 @@ Megj: A Vimben a sor legvÊgÊre is lehet ÃĄllni, azonban ez elődjÊben Publisher: New Riders The first book completely dedicated to Vim. Especially useful for beginners. There are many examples and pictures. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html This book is older and more about Vi than Vim, but also recommended: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.it b/runtime/tutor/tutor.it index 80862edb4cda9..ce3b9707b9aa1 100644 --- a/runtime/tutor/tutor.it +++ b/runtime/tutor/tutor.it @@ -882,7 +882,7 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c 1. Comincia a editare il file "vimrc". Questo dipende dal tuo sistema: :e ~/.vimrc per Unix - :e $VIM/_vimrc per MS-Windows + :e ~/_vimrc per MS-Windows 2. Ora leggi i contenuti del file "vimrc" distribuito come esempio: @@ -951,7 +951,7 @@ NOTA: Il completamento Vim - Vi Improved - di Steve Oualline Editore: New Riders Il primo libro completamente dedicato a Vim. Utile specie per principianti. Contiene molti esempi e figure. - Vedi http://iccf-holland.org/click5.html + Vedi https://iccf-holland.org/click5.html Quest'altro libro īŋŊ piīŋŊ su Vi che su Vim, ma īŋŊ pure consigliato: Learning the Vi Editor - di Linda Lamb e Arnold Robbins diff --git a/runtime/tutor/tutor.it.utf-8 b/runtime/tutor/tutor.it.utf-8 index c1602b5fc21f5..d1f62e27749de 100644 --- a/runtime/tutor/tutor.it.utf-8 +++ b/runtime/tutor/tutor.it.utf-8 @@ -882,7 +882,7 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c 1. Comincia a editare il file "vimrc". Questo dipende dal tuo sistema: :e ~/.vimrc per Unix - :e $VIM/_vimrc per MS-Windows + :e ~/_vimrc per MS-Windows 2. Ora leggi i contenuti del file "vimrc" distribuito come esempio: @@ -951,7 +951,7 @@ NOTA: Il completamento è disponibile per molti comandi. Prova a battere Vim - Vi Improved - di Steve Oualline Editore: New Riders Il primo libro completamente dedicato a Vim. Utile specie per principianti. Contiene molti esempi e figure. - Vedi http://iccf-holland.org/click5.html + Vedi https://iccf-holland.org/click5.html Quest'altro libro è piÚ su Vi che su Vim, ma è pure consigliato: Learning the Vi Editor - di Linda Lamb e Arnold Robbins diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc index b89980585c66f..92e040db349ce 100644 --- a/runtime/tutor/tutor.ja.euc +++ b/runtime/tutor/tutor.ja.euc @@ -8,7 +8,7 @@ īŋŊË¤Ę¤Ã¤Æ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊåĄŧīŋŊČĨęĨĸīŋŊīŋŊīŋŊÎģīŋŊīŋŊīŋŊīŋŊΤīŋŊÉŦīŋŊפĘģīŋŊīŋŊÖ¤ĪĄīŋŊīŋŊФīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊΤˤɤīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊȤīŋŊīŋŊΤīŋŊīŋŊˤīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊč¤Ŋ25īŋŊīŋŊīŋŊīŋŊ30ĘŦīŋŊĮ¤īŋŊīŋŊīŋŊ + īŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊȤīŋŊīŋŊΤīŋŊīŋŊˤīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊč¤Ŋ30ĘŦīŋŊĮ¤īŋŊīŋŊīŋŊ ATTENTION: īŋŊʲīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŅĨīŋŊīŋŊŪĨīŋŊÉ¤Ë¤Ī¤īŋŊīŋŊīŋŊʸīŋŊΤīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤâ¤ĸīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊ @@ -24,7 +24,7 @@ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.1: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΰīŋŊư - ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊË¤ĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊͤīŋŊ h,j,k,l īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊË¤ĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊͤīŋŊ h,j,k,l īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** ^ k īŋŊŌĨīŋŊīŋŊ: h īŋŊīŋŊīŋŊīŋŊīŋŊĪēīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ < h l > l īŋŊīŋŊīŋŊīŋŊīŋŊĪąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -65,11 +65,12 @@ NOTE: :q! 5. 1.3īŋŊŪ¤ĮĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.3: īŋŊÆĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔŊīŋŊ - īŋŊīŋŊīŋŊ - ** īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤÆĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ x īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤÆĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ x īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -87,12 +88,11 @@ NOTE: - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.4: īŋŊÆĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔŊīŋŊ - īŋŊīŋŊīŋŊīŋŊ - ** īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤÆĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ i īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤÆĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ i īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -115,10 +115,10 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.5: īŋŊÆĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔŊīŋŊ - īŋŊɲīŋŊ - ** īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊÉ˛Ã¤īŋŊīŋŊīŋŊˤīŋŊ A īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ ** + ** īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊÉ˛Ã¤īŋŊīŋŊīŋŊˤīŋŊ A īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŦīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊäƤâ¤ĢīŋŊŪ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŦīŋŊīŋŊīŋŊΚԤΤɤīŋŊʸīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊäƤâ¤ĢīŋŊŪ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 2. īŋŊÉ˛Ã¤īŋŊÉŦīŋŊפʞīŋŊīŋŊīŋŊ A īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -137,18 +137,17 @@ NOTE: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.6: īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔŊīŋŊ - - ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊÆŊīŋŊÎģīŋŊīŋŊīŋŊīŋŊˤīŋŊ :wq īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊÆŊīŋŊÎģīŋŊīŋŊīŋŊīŋŊˤīŋŊ :wq īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** !! NOTE: īŋŊʲīŋŊīŋŊÎĨīŋŊīŋŊÆĨÃĨפīŋŊšԤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊËĄīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊɤīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ!! - 1. īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.2 īŋŊĮ¤īŋŊäīŋŊīŋŊč¤ĻīŋŊīŋŊ :q! īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆĄīŋŊīŋŊīŋŊīŋŊÎĨīŋŊīŋŊåĄŧīŋŊČĨęĨĸīŋŊīŋŊīŋŊÎģ - īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ뤤īŋŊĪĄīŋŊīŋŊˤīŋŊÃŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊĮ°Ę˛īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤīŋŊԤäƤâ¤ĢīŋŊŪ¤īŋŊ - īŋŊŪ¤īŋŊīŋŊīŋŊ + 1. īŋŊˤīŋŊÃŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊĮ°Ę˛īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤīŋŊԤäƤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤Ę¤īŋŊīŋŊīŋŊĐĄīŋŊ + īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 1.2 īŋŊĮ¤īŋŊäīŋŊīŋŊč¤ĻīŋŊīŋŊ :q! īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆĄīŋŊīŋŊīŋŊīŋŊÎĨīŋŊīŋŊåĄŧīŋŊČĨęĨĸīŋŊīŋŊīŋŊÎģ + īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊ×ĨȤĮ¤īŋŊīŋŊÎĨīŋŊīŋŊŪĨīŋŊɤōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ: vim tutor - 'vim' īŋŊīŋŊ Vim īŋŊīŋŊīŋŊĮĨīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊëĨŗīŋŊŪĨīŋŊÉĄīŋŊ'tutor' īŋŊīŋŊīŋŊÔŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ - ĖžīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊƤīŋŊ褤īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊ×ĨȤĮ¤īŋŊīŋŊÎĨīŋŊīŋŊŪĨīŋŊɤōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ: vim file.txt + 'vim' īŋŊīŋŊ Vim īŋŊīŋŊīŋŊĮĨīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊëĨŗīŋŊŪĨīŋŊÉĄīŋŊ'file.txt' īŋŊīŋŊīŋŊÔŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊ + īŋŊīŋŊĖžīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖžīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 3. īŋŊīŋŊīŋŊÎĨīŋŊÃĨīŋŊīŋŊīŋŊĮŗØ¤īŋŊīŋŊīŋŊč¤ĻīŋŊËĄīŋŊīŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -186,9 +185,9 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2.1: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** ÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ ** + ** ÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ ** - 1. īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤĮ¤īŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊĮ§īŋŊīŋŊīŋŊë¤ŋīŋŊīŋŊīŋŊ īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 1. īŋŊÎŧ¤ËĨÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤīŋŊīŋŊë¤ŋīŋŊīŋŊ īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 2. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -196,22 +195,22 @@ NOTE: 4. ÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŋīŋŊīŋŊīŋŊ dw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊīŋŊČĄīŋŊdw īŋŊȤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊęĄŧīŋŊīŋŊÎēĮ˛īŋŊīŋŊԤ˸īŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊīŋŊפīŋŊÖ°īŋŊäƤīŋŊīŋŊŪ¤Ã¤īŋŊīŋŊīŋŊīŋŊˤīŋŊ īŋŊō˛Ą¤īŋŊīŋŊƤīŋŊīŋŊÄžīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + NOTE: d īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊęĄŧīŋŊīŋŊÎēĮ˛īŋŊīŋŊԤ˸īŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊVim īŋŊīŋŊ + īŋŊīŋŊīŋŊʤīŋŊīŋŊīŋŊ w īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊΤīŋŊīŋŊԤäƤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊ⤡ d īŋŊĘŗīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊÉŊīŋŊīŋŊīŋŊīŋŊīŋŊė¤ŋ + īŋŊīŋŊīŋŊΞīŋŊīŋŊīŋŊīŋŊÖ°īŋŊäƤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ īŋŊō˛Ą¤īŋŊīŋŊƤīŋŊīŋŊÄžīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ ---> īŋŊīŋŊīŋŊīŋŊ ʸ īŋŊīŋŊ īŋŊˤīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊĤīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊ ÉŦīŋŊפΤʤīŋŊ ÃąīŋŊīŋŊ īŋŊīŋŊ īŋŊŪ¤Ū¤īŋŊīŋŊ īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 5. 3 īŋŊīŋŊīŋŊīŋŊ 4 īŋŊŪ¤Į¤īŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʤīŋŊŪ¤ĮˇīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2.2 īŋŊØŋƤߤۤīŋŊīŋŊį¤ĻīŋŊīŋŊ - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2.2: īŋŊīŋŊīŋŊīŋŊžīŋŊÎēīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** īŋŊÔ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ d$ īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ ** + ** īŋŊÔ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ d$ īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ ** - 1. īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤĮ¤īŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊĮ§īŋŊīŋŊīŋŊīŋŊΤīŋŊ īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 1. īŋŊÎŧ¤ËĨÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤīŋŊīŋŊë¤ŋīŋŊīŋŊ īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 2. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -232,7 +231,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2.3: īŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊČĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ - ÂŋīŋŊīŋŊīŋŊÎĨīŋŊīŋŊŪĨīŋŊɤĪĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊČĨâĄŧīŋŊīŋŊīŋŊīŋŊķ¤Ģ¤īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊŅšīŋŊīŋŊīŋŊäīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊŅšīŋŊīŋŊīŋŊäīŋŊīŋŊīŋŊÂŋīŋŊīŋŊīŋŊÎĨīŋŊīŋŊŪĨīŋŊɤĪĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊČĨâĄŧīŋŊīŋŊīŋŊīŋŊķ¤Ģ¤īŋŊʤīŋŊŪ¤īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ d īŋŊÎĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊĪŧīŋŊīŋŊīŋŊīŋŊÍ¤Ë¤Ę¤Ã¤Æ¤īŋŊīŋŊŪ¤īŋŊ: d īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ @@ -248,7 +247,7 @@ NOTE: īŋŊĤۤīŋŊ de īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÃąīŋŊīŋŊÎŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ -NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÍ¤ĪĄīŋŊīŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤÆĨīŋŊīŋŊŪĨīŋŊɤʤīŋŊīŋŊËĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊō˛Ą¤īŋŊīŋŊīŋŊ +NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÍ¤ĪĄīŋŊīŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤˤÆĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊʤīŋŊīŋŊËĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊō˛Ą¤īŋŊīŋŊīŋŊ īŋŊߤۤīŋŊīŋŊį¤ĻīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŦīŋŊīŋŊÅĒīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ֤˰īŋŊưīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -259,7 +258,7 @@ NOTE: 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤īŋŊīŋŊīŋŊÆŦīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 2. 2w īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊÃąīŋŊīŋŊ2īŋŊīŋŊĘŦīŋŊīŋŊīŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 2. 2w īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊÃąīŋŊīŋŊ2īŋŊīŋŊĘŦīŋŊīŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 3. 3e īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊ3īŋŊīŋŊīŋŊܤīŋŊÃąīŋŊīŋŊÎŊīŋŊÃŧīŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -284,24 +283,24 @@ NOTE: īŋŊīŋŊīŋŊÂŋīŋŊīŋŊīŋŊÎēīŋŊīŋŊīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊŪ¤īŋŊ: d īŋŊīŋŊīŋŊīŋŊ īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ - 1. ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊԤΚīŋŊÆŦīŋŊīŋŊĘŦīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 1. ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ÎēĮŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 2. UPPER CASE īŋŊīŋŊÃąīŋŊīŋŊ2īŋŊĤīŋŊ d2w īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆēīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 2. īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊ2īŋŊĤīŋŊ d2w īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆēīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 3. UPPER CASE īŋŊȤīŋŊīŋŊīŋŊĪĸÂŗīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊīŋŊ1īŋŊĤÎĨīŋŊīŋŊŪĨīŋŊÉ¤Č°Û¤Ę¤ëĨĢīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊꤡīŋŊīŋŊ + 3. ĪĸÂŗīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊōĄĸ°Û¤Ę¤ëĨĢīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊꤡīŋŊīŋŊ1īŋŊĤÎĨīŋŊīŋŊŪĨīŋŊɤĮēīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊÆĨÃĨīŋŊ 1 īŋŊīŋŊ 2 īŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ---> īŋŊīŋŊīŋŊīŋŊABC DEīŋŊÔ¤īŋŊFGHI JK LMN OPÃąīŋŊīŋŊīŋŊQ RS TUVīŋŊīŋŊīŋŊË¤Ę¤Ã¤īŋŊīŋŊīŋŊ -NOTE: īŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊ d īŋŊČĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊδ֤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊČ¤Ã¤īŋŊīŋŊīŋŊįĄĸīŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊΤʤīŋŊ - īŋŊīŋŊīŋŊÎĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊΤč¤ĻīŋŊīŋŊưīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - īŋŊīŋŊ: 3dw īŋŊīŋŊ d3w īŋŊīŋŊÆąīŋŊīŋŊīŋŊĮĄīŋŊ3w īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2.6: īŋŊÔ¤īŋŊīŋŊīŋŊīŋŊ - ** īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dd īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dd īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŲ¤īŋŊÂŋīŋŊīŋŊīŋŊΤĮĄīŋŊViīŋŊÎĨĮĨīŋŊīŋŊīŋŊīŋŊĘĄīŋŊīŋŊĪšÔ¤ÎēīŋŊīŋŊīŋŊīŋŊ d īŋŊīŋŊ2īŋŊķĨŋĨīŋŊīŋŊפīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÃąīŋŊʤīŋŊΤˡīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊ @@ -319,24 +318,25 @@ NOTE: ---> 6) īŋŊīŋŊīŋŊīŋŊīŋŊδŤīŋŊ ---> 7) īŋŊīŋŊīŋŊŪĨīŋŊīŋŊīŋŊĘĄīŋŊ +2īŋŊķĨŋĨīŋŊīŋŊפīŋŊ1īŋŊÔ¤īŋŊīŋŊФīŋŊīŋŊÆēīŋŊīŋŊҤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊËĄīŋŊΰƞīŋŊīŋŊĮŊŌ¤Ų¤ëĨĒīŋŊÚĨėĄŧīŋŊīŋŊīŋŊĮ¤īŋŊưīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2.7: īŋŊīŋŊīŋŊÄžīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** īŋŊĮ¸īŋŊÎĨīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊäīŋŊīŋŊˤīŋŊ u īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊU īŋŊĪšīŋŊīŋŊīŋŊīŋŊΤÎŧīŋŊäĮ¤īŋŊīŋŊīŋŊ ** + ** īŋŊĮ¸īŋŊÎĨīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊäīŋŊīŋŊˤīŋŊ u īŋŊō˛Ą¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊU īŋŊĪšīŋŊīŋŊīŋŊīŋŊΤÎŧīŋŊīŋŊäīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊĮŊīŋŊδְ㤤īŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 2. x īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊƤīŋŊīŋŊīŋŊʤīŋŊīŋŊīŋŊÆŦīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 2. x īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆēĮŊīŋŊΤīŋŊīŋŊīŋŊʤīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊu īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆēĮ¸īŋŊËŧšԤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊäīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 4. īŋŊīŋŊīŋŊŲ¤ĪĄīŋŊx īŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊƸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 4. īŋŊīŋŊīŋŊŲ¤ĪĄīŋŊx īŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊÆšīŋŊīŋŊīŋŊθīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 5. īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊ U īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆĄīŋŊīŋŊÔ¤ō¸ĩ¤ÎžīŋŊīŋŊÖ¤īŋŊīŋŊᤡīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 6. u īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊÄžīŋŊīŋŊīŋŊīŋŊ U īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊäīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 6. u īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊÄžīŋŊīŋŊīŋŊīŋŊ U īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊäīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 7. īŋŊĮ¤ĪĨīŋŊīŋŊŪĨīŋŊɤīŋŊÆŧšԤīŋŊīŋŊīŋŊΤīŋŊ CTRL-R (CTRL īŋŊō˛Ą¤īŋŊīŋŊīŋŊīŋŊŪ¤īŋŊ R īŋŊīŋŊīŋŊĮ¤īŋŊ)īŋŊīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆ¤ß¤Ū¤īŋŊīŋŊį¤Ļ(īŋŊīŋŊäÎŧīŋŊīŋŊ)īŋŊīŋŊ + īŋŊīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆ¤ß¤Ū¤īŋŊīŋŊį¤Ļ(īŋŊīŋŊīŋŊäīŋŊīŋŊÎŧīŋŊīŋŊäīŋŊ)īŋŊīŋŊ ----> īŋŊīŋŊīŋŊΤΚԤΤδְ㤤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊÎŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊäīŋŊīŋŊŪ¤Ū¤īŋŊīŋŊīŋŊīŋŊīŋŊ +---> īŋŊīŋŊīŋŊΤΚԤΤδְ㤤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊÎŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊäīŋŊīŋŊŪ¤Ū¤īŋŊīŋŊīŋŊīŋŊīŋŊ 8. īŋŊīŋŊīŋŊīŋŊĪ¤Č¤Æ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĘĨīŋŊīŋŊŪĨīŋŊɤĮ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2 īŋŊīŋŊīŋŊīŋŊØŋƤߤۤīŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -347,45 +347,47 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 2 īŋŊīŋŊīŋŊīŋŊ - 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÔ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ d$ īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 3. īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dd īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊéŧĄīŋŊīŋŊÃąīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ de īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÔ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ d$ īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 4. īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ dd īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 4. īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊˤĪŋīŋŊīŋŊͤīŋŊīŋŊīŋŊÍŋīŋŊīŋŊīŋŊŪ¤īŋŊ: 2w - 5. īŋŊŅšīŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊëĨŗīŋŊŪĨīŋŊɤΡīŋŊīŋŊīŋŊīŋŊīŋŊ + 5. īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊˤĪŋīŋŊīŋŊͤīŋŊīŋŊīŋŊÍŋīŋŊīŋŊīŋŊŪ¤īŋŊ: 2w + 6. īŋŊŅšīŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊëĨŗīŋŊŪĨīŋŊɤΡīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊ [īŋŊīŋŊīŋŊīŋŊ] īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊė¤žīŋŊīŋŊ: īŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊ - īŋŊīŋŊīŋŊ d īŋŊīŋŊīŋŊīŋŊĮ˛īŋŊīŋŊō¤š¤ë¤ĢīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊÎĨīŋŊīŋŊŪĨīŋŊɤō˛ŋ˛ķˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊ - īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ - w (ÃąīŋŊīŋŊ)īŋŊīŋŊ $ (īŋŊīŋŊīŋŊīŋŊ)īŋŊʤɤīŋŊīŋŊīŋŊĮĄīŋŊīŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤβīŋŊīŋŊīŋŊīŋŊФīŋŊīŋŊīŋŊƯīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊë¤ĢīŋŊīŋŊ + [īŋŊīŋŊīŋŊīŋŊ] - īŋŊīŋŊīŋŊÎĨīŋŊīŋŊŪĨīŋŊɤō˛ŋ˛ķˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊ + īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ - w (ÃąīŋŊīŋŊ)īŋŊīŋŊ e (ÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ)īŋŊīŋŊ$ (īŋŊīŋŊīŋŊīŋŊ)īŋŊʤɤīŋŊīŋŊīŋŊĮĄīŋŊīŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊ + īŋŊīŋŊīŋŊīŋŊīŋŊФīŋŊīŋŊīŋŊƯīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ĢīŋŊīŋŊ - 6. īŋŊÔ¤īŋŊīŋŊīŋŊÆŦīŋŊ˰īŋŊưīŋŊīŋŊīŋŊīŋŊˤĪĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊ: 0 + 7. īŋŊÔ¤īŋŊīŋŊīŋŊÆŦīŋŊ˰īŋŊưīŋŊīŋŊīŋŊīŋŊˤĪĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊ: 0 + + 8. īŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊäīŋŊ: u (īŋŊīŋŊʸīŋŊīŋŊ u) + īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊäīŋŊ: U (īŋŊīŋŊʸīŋŊīŋŊ U) + īŋŊīŋŊīŋŊäīŋŊīŋŊÎŧīŋŊīŋŊäīŋŊ: CTRL-R - 7. īŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊäīŋŊ: u (īŋŊīŋŊʸīŋŊīŋŊ u) - īŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊäīŋŊ: U (īŋŊīŋŊʸīŋŊīŋŊ U) - īŋŊīŋŊäīŋŊīŋŊÎŧīŋŊäīŋŊ: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 3.1: ÅŊīŋŊīŋŊīŋŊÕ¤īŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** īŋŊĮ¸īŋŊËēīŋŊīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ōĨĢĄīŋŊīŋŊīŋŊīŋŊīŋŊθīŋŊīŋŊÅŊīŋŊīŋŊīŋŊÕ¤īŋŊīŋŊīŋŊˤīŋŊ p īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊĮ¸īŋŊËēīŋŊīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ōĨĢĄīŋŊīŋŊīŋŊīŋŊīŋŊθīŋŊīŋŊÅŊīŋŊīŋŊīŋŊÕ¤īŋŊīŋŊīŋŊˤīŋŊ p īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** - 1. īŋŊʲīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÎēĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 1. ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊʲīŋŊīŋŊÎēĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 2. dd īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆšÔ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊVim īŋŊÎĨĐĨÃĨÕĨīŋŊīŋŊËŗīŋŊĮŧīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 2. dd īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆšÔ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊVim īŋŊÎĨėĨ¸īŋŊīŋŊīŋŊīŋŊīŋŊËŗīŋŊĮŧīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊīŋŊīŋŊč¤ĸīŋŊīŋŊŲ¤īŋŊīŋŊīŋŊīŋŊ֤ΞīŋŊÎšÔ¤Ū¤ĮĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊīŋŊīŋŊč¤ĸīŋŊīŋŊŲ¤īŋŊīŋŊīŋŊīŋŊ֤ΞīŋŊΚԤĮ¤īŋŊīŋŊīŋŊ c) īŋŊÔ¤Ū¤ĮĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊ + īŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 4. īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤīŋŊ p īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆŗīŋŊĮŧīŋŊīŋŊīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊīŋŊˤīŋŊīŋŊᤡīŋŊŪ¤īŋŊīŋŊīŋŊ + 4. īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤīŋŊ p īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆŗīŋŊĮŧīŋŊīŋŊīŋŊīŋŊīŋŊÔ¤ōĨĢĄīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊīŋŊīŋŊᤡīŋŊŪ¤īŋŊīŋŊīŋŊ 5. īŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʤīŋŊīŋŊͤËĨīŋŊīŋŊÆĨÃĨīŋŊ 2 īŋŊīŋŊīŋŊīŋŊ 4 īŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - d) īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊؤ֤īŋŊīŋŊȤīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ? - b) īŋŊīŋŊīŋŊßĨīŋŊīŋŊīŋŊĤīŋŊīŋŊīŋŊ - c) īŋŊÎˇÃ¤Č¤ĪŗØ¤Ö¤īŋŊÎĄīŋŊ - a) īŋŊĐĨīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊ +---> d) īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊؤ֤īŋŊīŋŊȤīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ? +---> b) īŋŊīŋŊīŋŊßĨīŋŊīŋŊīŋŊĤīŋŊīŋŊīŋŊ +---> c) īŋŊÎˇÃ¤Č¤ĪŗØ¤Ö¤īŋŊÎĄīŋŊ +---> a) īŋŊĐĨīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊ @@ -393,7 +395,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 3.2: īŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ r īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊ x īŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ rx īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -416,38 +418,38 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 3.3: īŋŊŅšīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** ÃąīŋŊīŋŊΰīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ⤡īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ cw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** ÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ ce īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 2. lubw īŋŊīŋŊ u īŋŊΰīŋŊīŋŊÖ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - 3. cw īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ(īŋŊīŋŊīŋŊΞīŋŊīŋŊ 'ine' īŋŊČĨīŋŊīŋŊīŋŊīŋŊīŋŊ)īŋŊīŋŊ + 3. ce īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ(īŋŊīŋŊīŋŊΞīŋŊīŋŊ 'ine' īŋŊČĨīŋŊīŋŊīŋŊīŋŊīŋŊ)īŋŊīŋŊ - 4. īŋŊīŋŊīŋŊδְ㤤(īŋŊŅšīŋŊīŋŊīŋŊīŋŊŲ¤īŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆŦ)īŋŊ˰īŋŊưīŋŊīŋŊīŋŊë¤ŋīŋŊīŋŊīŋŊ īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 4. īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊƤīŋŊīŋŊéŧĄīŋŊδְ㤤(īŋŊŅšīŋŊīŋŊīŋŊīŋŊŲ¤īŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆŦ)īŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 5. īŋŊĮŊīŋŊΚԤīŋŊīŋŊīŋŊīŋŊΚԤīŋŊīŋŊͤˤʤīŋŊŪ¤ĮĨīŋŊīŋŊÆĨÃĨīŋŊ 3 īŋŊīŋŊ 4 īŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. -cw īŋŊīŋŊÃąīŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤Ę¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊīŋŊīŋŊÕ¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - +ce īŋŊīŋŊÃąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊåĄĸīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊīŋŊīŋŊÕ¤īŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ +cc īŋŊīŋŊÆąīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊФīŋŊīŋŊÆšÔ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 3.4: c īŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊžīŋŊīŋŊīŋŊŅšīŋŊ - ** īŋŊŅšīŋŊīŋŊīŋŊīŋŊŪĨīŋŊÉ¤ĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊÆąīŋŊīŋŊīŋŊͤËĨīŋŊīŋŊÖĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊŅšīŋŊīŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆąīŋŊīŋŊīŋŊͤËĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** - 1. īŋŊŅšīŋŊīŋŊīŋŊīŋŊŪĨīŋŊÉ¤ĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊÆąīŋŊīŋŊīŋŊč¤ĻīŋŊīŋŊưīŋŊīŋŊō¤ˇ¤Ū¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΡīŋŊīŋŊīŋŊīŋŊīŋŊ + 1. īŋŊŅšīŋŊīŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆąīŋŊīŋŊīŋŊč¤ĻīŋŊīŋŊưīŋŊīŋŊō¤ˇ¤Ū¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΡīŋŊīŋŊīŋŊīŋŊīŋŊ c [īŋŊīŋŊīŋŊīŋŊ] īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊ - 2. īŋŊīŋŊīŋŊÖĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊÆąīŋŊīŋŊīŋŊĮĄīŋŊw īŋŊīŋŊÃąīŋŊėĄĸ $ īŋŊĪšīŋŊīŋŊīŋŊīŋŊʤɤȤīŋŊīŋŊäīŋŊīŋŊīŋŊΤĮ¤īŋŊīŋŊīŋŊ + 2. īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆąīŋŊīŋŊīŋŊĮĄīŋŊw īŋŊīŋŊÃąīŋŊėĄĸ $ īŋŊĪšīŋŊīŋŊīŋŊīŋŊʤɤȤīŋŊīŋŊäīŋŊīŋŊīŋŊΤĮ¤īŋŊīŋŊīŋŊ - 3. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 3. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 4. īŋŊĮŊīŋŊδְ㤤īŋŊØĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -470,7 +472,7 @@ NOTE: ʸīŋŊīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 3. īŋŊŅšīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤĮ¤ĪĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÎĨâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊĮģīŋŊīŋŊę¤ĩīŋŊīŋŊëŊĒÃŧīŋŊŪ¤Į¤īŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊīŋŊĮŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊ㤨īŋŊīŋŊ cw īŋŊʤīŋŊĐĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÃąīŋŊīŋŊÎŊīŋŊīŋŊīŋŊīŋŊŪ¤ĮĄīŋŊ + īŋŊīŋŊīŋŊīŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊīŋŊĮŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊ㤨īŋŊīŋŊ ce īŋŊʤīŋŊĐĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÃąīŋŊīŋŊÎŊīŋŊīŋŊīŋŊīŋŊŪ¤ĮĄīŋŊ c$ īŋŊʤīŋŊĐšÔ¤ÎŊīŋŊīŋŊīŋŊīŋŊŪ¤Į¤īŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 4. īŋŊŅšīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤΡīŋŊīŋŊīŋŊīŋŊīŋŊ @@ -485,7 +487,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 4.1: īŋŊīŋŊīŋŊÖ¤ČĨÕĨīŋŊīŋŊīŋŊīŋŊīŋŊΞīŋŊīŋŊīŋŊ ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤Î°īŋŊīŋŊÖ¤ČĨÕĨīŋŊīŋŊīŋŊīŋŊīŋŊΞīŋŊīŋŊÖ¤īŋŊÉŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ CTRL-G īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊԤ˰īŋŊưīŋŊīŋŊīŋŊīŋŊˤīŋŊ G īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊԤ˰īŋŊưīŋŊīŋŊīŋŊīŋŊˤīŋŊ G īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** NOTE: īŋŊīŋŊīŋŊÆĨÃĨפīŋŊšԤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊËĄīŋŊīŋŊīŋŊīŋŊÎĨīŋŊÃĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤīŋŊīŋŊܤīŋŊīŋŊˤīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ!! @@ -496,7 +498,7 @@ NOTE: NOTE: īŋŊīŋŊīŋŊĖ¤ÎąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΰīŋŊīŋŊÖ¤īŋŊÉŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤīŋŊīŋŊë¤ĢīŋŊ⤡īŋŊīŋŊŪ¤īŋŊīŋŊķĄŖ¤īŋŊīŋŊīŋŊīŋŊ 'ruler' īŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊ(:help 'ruler' īŋŊōģ˛žīŋŊ)īŋŊīŋŊīŋŊīŋŊīŋŊꤚīŋŊë¤ŗīŋŊȤīŋŊÉŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 2. īŋŊĮ˛īŋŊīŋŊԤ˰īŋŊưīŋŊīŋŊīŋŊë¤ŋīŋŊīŋŊīŋŊ G īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + 2. īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊÎēĮ˛īŋŊīŋŊԤ˰īŋŊưīŋŊīŋŊīŋŊë¤ŋīŋŊīŋŊīŋŊ G īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆŦīŋŊ˰īŋŊưīŋŊīŋŊīŋŊīŋŊˤīŋŊ gg īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 3. īŋŊīŋŊۤɤΚԤīŋŊīŋŊÖšīŋŊōĨŋĨīŋŊīŋŊפīŋŊ G īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊīŋŊĮŊīŋŊīŋŊ CTRL-G īŋŊō˛Ą¤īŋŊīŋŊīŋŊīŋŊīŋŊ @@ -508,19 +510,19 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 4.2: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊīŋŊ - ** īŋŊīŋŊīŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ / īŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ** + ** īŋŊīŋŊīŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ / īŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊÎĄīŋŊīŋŊŪĨīŋŊâĄŧīŋŊɤīŋŊ / īŋŊȤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˰īŋŊīŋŊÖ˛īŋŊīŋŊīŋŊ : īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊ ÆąīŋŊīŋŊīŋŊͤīŋŊ / īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŗīŋŊȤËĩīŋŊīŋŊŤīŋŊīŋŊĮ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 2. īŋŊĮ¤ĪĄīŋŊ'errroor' īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊīŋŊīŋŊīŋŊė¤ŦīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÃąīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ - 3. ÆąīŋŊīŋŊīŋŊīŋŊīŋŊâ¤ĻīŋŊīŋŊīŋŊŲ¸īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊ ÃąīŋŊīŋŊ n īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 3. ÆąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâ¤ĻīŋŊīŋŊīŋŊŲ¸īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊ ÃąīŋŊīŋŊ n īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˸īŋŊīŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊ N īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ 4. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˸īŋŊīŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĪĄīŋŊ/ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ ? īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 5. īŋŊīŋŊīŋŊΞīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ CTRL-O (Ctrl īŋŊō˛Ą¤īŋŊÂŗīŋŊīŋŊīŋŊʤīŋŊīŋŊīŋŊ o ʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ)īŋŊōĨŋĨīŋŊīŋŊפīŋŊ + 5. īŋŊīŋŊīŋŊΞīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ CTRL-O (Ctrl īŋŊō˛Ą¤īŋŊÂŗīŋŊīŋŊīŋŊʤīŋŊīŋŊīŋŊʸīŋŊīŋŊ o īŋŊōĨŋĨīŋŊīŋŊīŋŊ)īŋŊōĨŋĨīŋŊīŋŊפīŋŊ īŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊË¤Ī¤īŋŊīŋŊīŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊCTRL-I īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ ---> "errroor" īŋŊīŋŊ error īŋŊČĨīŋŊīŋŊÚĨë¤ŦīŋŊ㤤īŋŊŪ¤īŋŊ; errroor īŋŊΤīŋŊīŋŊīŋŊīŋŊīŋŊ error īŋŊĮ¤īŋŊīŋŊīŋŊ @@ -531,7 +533,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 4.3: īŋŊĐąīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤō¸ĄēīŋŊ - ** īŋŊĐąīŋŊīŋŊīŋŊīŋŊīŋŊ ),] īŋŊīŋŊ } īŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ % īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊĐąīŋŊīŋŊīŋŊīŋŊīŋŊ ),] īŋŊīŋŊ } īŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ % īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊīŋŊīŋŊīŋŊ ---> īŋŊĮŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤īŋŊ (,[ īŋŊīŋŊ { īŋŊΤɤė¤ĢīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -554,7 +556,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 4.4: īŋŊְ㤤īŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊËĄ - ** 'old' īŋŊīŋŊ 'new' īŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ :s/old/new/g īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** 'old' īŋŊīŋŊ 'new' īŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ :s/old/new/g īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -567,9 +569,8 @@ NOTE: ---> thee best time to see thee flowers is in thee spring. - 4. ĘŖīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊé¸ĢīŋŊĤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ - :#,#s/old/new/g #,# īŋŊˤīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĪ°Ī¤ÎŗīŋŊīŋŊΤČŊīŋŊÎģīŋŊΚīŋŊīŋŊÖšīŋŊīŋŊīŋŊīŋŊꤡīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊ + 4. ĘŖīŋŊīŋŊīŋŊÔ¤īŋŊīŋŊé¸ĢīŋŊĤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÆ¤Î˛ÕŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ + :#,#s/old/new/g #,# īŋŊˤīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĪ°Ī¤ÎŗīŋŊīŋŊΤČŊīŋŊÎģīŋŊΚīŋŊīŋŊÖšīŋŊīŋŊīŋŊīŋŊꤚīŋŊëĄŖ :%s/old/new/g īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤĮ¸īŋŊīŋŊĤīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊФīŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊëĄŖ :%s/old/new/gc īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤĮ¸īŋŊīŋŊĤīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊФīŋŊīŋŊÆĄīŋŊ1īŋŊīŋŊ1īŋŊÄŗīŋŊĮ§īŋŊīŋŊȤīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊëĄŖ @@ -593,7 +594,7 @@ NOTE: 4. īŋŊīŋŊīŋŊßšÔ¤ÎēĮŊīŋŊīŋŊ old īŋŊīŋŊ new īŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊëĄŖ :s/old/new īŋŊīŋŊīŋŊßšÔ¤īŋŊīŋŊīŋŊīŋŊƤīŋŊ old īŋŊīŋŊ new īŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊëĄŖ :s/old/new/g - 2īŋŊĤīŋŊ # īŋŊÖ¤Į¸īŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊëĄŖ :#,#s/old/new/g + 2īŋŊĤīŋŊ # īŋŊԤδ֤Į¸īŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊëĄŖ :#,#s/old/new/g īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤθīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊëĄŖ :%s/old/new/g 'c' īŋŊīŋŊäīŋŊīŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊīŋŊŲ¤ËŗīŋŊĮ§īŋŊīŋŊīŋŊīŋŊëĄŖ :%s/old/new/gc @@ -601,10 +602,10 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 5.1: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊšԤīŋŊīŋŊīŋŊīŋŊīŋŊËĄ - ** :! īŋŊθīŋŊËŧšԤīŋŊīŋŊëŗ°īŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** :! īŋŊθīŋŊËŧšԤīŋŊīŋŊëŗ°īŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊīŋŊīŋŊˤÎēĮ˛īŋŊīŋŊīŋŊīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŦīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊč¤ĻīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤīŋŊīŋŊīŋŊīŋŊ : īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊĮĨīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊפĮ¤īŋŊīŋŊīŋŊīŋŊͤˤʤīŋŊŪ¤īŋŊīŋŊīŋŊ + īŋŊīŋŊīŋŊīŋŊĮĨīŋŊīŋŊŪĨīŋŊÉĨéĨ¤īŋŊīŋŊĖŋīŋŊá¤ŦīŋŊīŋŊīŋŊīŋŊīŋŊפĮ¤īŋŊīŋŊīŋŊīŋŊͤˤʤīŋŊŪ¤īŋŊīŋŊīŋŊ 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ ! īŋŊȤīŋŊīŋŊīŋŊʸīŋŊīŋŊ(īŋŊīŋŊÃ˛īŋŊīŋŊ)īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊĮŗīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊëĨŗīŋŊŪĨīŋŊɤīŋŊīŋŊšԤĮ¤īŋŊīŋŊīŋŊīŋŊͤˤʤīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -624,7 +625,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 5.2: īŋŊīŋŊīŋŊīŋŊžīŋŊÎĨÕĨīŋŊīŋŊīŋŊīŋŊīŋŊØŊņ¤­šīŋŊīŋŊīŋŊ - ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊīŋŊˤīŋŊ :w īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĖž īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŅšīŋŊīŋŊīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊīŋŊˤīŋŊ :w īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĖž īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊĮĨīŋŊīŋŊėĨ¯īŋŊČĨīŋŊΰīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊë¤ŋīŋŊīŋŊīŋŊ :!dir īŋŊ⤡īŋŊīŋŊīŋŊīŋŊ :!ls īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ īŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊ īŋŊō˛Ą¤īŋŊīŋŊÎ¤Ī´īŋŊīŋŊˤīŋŊ¸īŋŊΤĮ¤īŋŊīŋŊÍĄīŋŊ @@ -634,7 +635,7 @@ NOTE: 3. īŋŊĮ¤īŋŊ :w TEST īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ (TEST īŋŊĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĖžīŋŊĮ¤īŋŊ)īŋŊīŋŊ 4. īŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΤīŋŊ TEST īŋŊȤīŋŊīŋŊīŋŊĖžīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - īŋŊâ¤ĻīŋŊīŋŊīŋŊīŋŊ :!dir īŋŊ⤡īŋŊīŋŊīŋŊīŋŊ :!ls īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆŗīŋŊĮ§īŋŊīŋŊīŋŊÆ¤ß¤Ū¤īŋŊīŋŊį¤ĻīŋŊīŋŊ + īŋŊâ¤ĻīŋŊīŋŊīŋŊīŋŊ :!dir īŋŊ⤡īŋŊīŋŊīŋŊīŋŊ :!ls īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊÆĨĮĨīŋŊīŋŊėĨ¯īŋŊČĨīŋŊīŋŊīŋŊĮ§īŋŊīŋŊīŋŊÆ¤ß¤Ū¤īŋŊīŋŊį¤ĻīŋŊīŋŊ NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊÎģīŋŊīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĖž TEST īŋŊČļīŋŊīŋŊËĩīŋŊưīŋŊīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊåĄŧīŋŊČĨęĨĸīŋŊīŋŊīŋŊĘŖīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊå¤ŦīŋŊīŋŊΤīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ @@ -647,7 +648,7 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 5.3: īŋŊīŋŊīŋŊō¤ˇ¤īŋŊīŋŊņ¤­šīŋŊīŋŊīŋŊ -** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊΰīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊīŋŊË¤ĪĄīŋŊv īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :w FILENAME īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** +** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊΰīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ¸īŋŊīŋŊīŋŊīŋŊË¤ĪĄīŋŊv īŋŊâĄŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :w FILENAME īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊīŋŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -660,20 +661,20 @@ NOTE: īŋŊō˛Ą¤īŋŊīŋŊīŋŊīŋŊīŋŊ :'<,'>w TEST īŋŊČ¤Ę¤Ã¤Æ¤īŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊĮ§īŋŊīŋŊīŋŊÆ˛īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ 5. Vim īŋŊīŋŊ TEST īŋŊȤīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊō¤ĩ¤ė¤ŋīŋŊÔ¤īŋŊņ¤­šīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ - !dir īŋŊ⤡īŋŊīŋŊīŋŊīŋŊ !ls īŋŊĮ¤īŋŊīŋŊīŋŊīŋŊīŋŊĮ§īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + :!dir īŋŊ⤡īŋŊīŋŊīŋŊīŋŊ :!ls īŋŊĮ¤īŋŊīŋŊīŋŊīŋŊīŋŊĮ§īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊĪēīŋŊīŋŊīŋŊīŋŊīŋŊʤīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊīŋŊÆ˛īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÎĨīŋŊÃĨīŋŊīŋŊīŋŊĮģīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ NOTE: v īŋŊō˛Ą¤īŋŊīŋŊČĄīŋŊVisual īŋŊīŋŊīŋŊō¤ŦģΤۤīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤĮĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΰΤīŋŊ īŋŊ᤭īŋŊīŋŊīŋŊ➎īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊËĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΰΤīŋŊīŋŊФīŋŊīŋŊÆĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊīŋŊÅŦīŋŊīŋŊ - īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊ㤨īŋŊīŋŊ d īŋŊĪĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + īŋŊĮ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊ㤨īŋŊīŋŊ d īŋŊĪĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 5.4: īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊÎŧīŋŊīŋŊīŋŊČšīŋŊĘģ - ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ :r īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĖž īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊ :r īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĖž īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** - 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʲīŋŊīŋŊΚԤ˚īŋŊī¤ģīŋŊŪ¤īŋŊīŋŊīŋŊ + 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊō¤ŗ¤ÎšÔ¤Î¤īŋŊīŋŊīŋŊīŋŊīŋŊËšīŋŊī¤ģīŋŊŪ¤īŋŊīŋŊīŋŊ NOTE: īŋŊīŋŊīŋŊÆĨÃĨīŋŊ 2 īŋŊÎŧšԸåĄĸīŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 5.3 īŋŊÎĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˲īŋŊīŋŊīŋŊīŋŊäƤīŋŊ īŋŊÎĨīŋŊÃĨīŋŊīŋŊīŋŊ˰īŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -682,19 +683,18 @@ NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ TEST īŋŊĪģȤīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖžīŋŊīŋŊīŋŊΤīŋŊīŋŊȤĮ¤īŋŊīŋŊīŋŊ īŋŊɤߚīŋŊīŋŊŪ¤ė¤ŋīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊĪĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊԤβīŋŊīŋŊˤīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ§īŋŊīŋŊīŋŊÆ¤ß¤Ū¤īŋŊīŋŊį¤ĻīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊᤚīŋŊČĄīŋŊīŋŊīŋŊÃĨīŋŊīŋŊīŋŊ5.3 īŋŊīŋŊ + 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ§īŋŊīŋŊīŋŊÆ¤ß¤Ū¤īŋŊīŋŊį¤ĻīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊᤚīŋŊČĄīŋŊīŋŊīŋŊÃĨīŋŊīŋŊīŋŊ5.3 īŋŊīŋŊ īŋŊīŋŊīŋŊęĨ¸īŋŊĘĨīŋŊČĨÕĨīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊΤīŋŊ2īŋŊĤīŋŊīŋŊīŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊī¤ĢīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ -NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤÎŊīŋŊīŋŊΤīŋŊīŋŊɤߚīŋŊīŋŊ⤺īŋŊȤīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊ㤨īŋŊĐĄīŋŊ +NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤÎŊīŋŊīŋŊΤīŋŊīŋŊɤߚīŋŊīŋŊ⤺īŋŊȤīŋŊĮ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊ㤨īŋŊĐĄīŋŊ :r !ls īŋŊīŋŊ ls īŋŊīŋŊīŋŊŪĨīŋŊɤÎŊīŋŊīŋŊΤōĨĢĄīŋŊīŋŊīŋŊīŋŊīŋŊʲīŋŊīŋŊīŋŊīŋŊɤߚīŋŊīŋŊߤۤīŋŊīŋŊīŋŊ - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 5 īŋŊīŋŊīŋŊīŋŊ - 1. :!command īŋŊˤīŋŊäīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊšԤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 1. :!command īŋŊˤīŋŊäīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊšԤīŋŊīŋŊëĄŖ īŋŊ褝īŋŊȤīŋŊīŋŊīŋŊ: (Windows) (Unix) @@ -717,13 +717,14 @@ NOTE: īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 6.1: īŋŊīŋŊīŋŊīŋŊīŋŊ×ĨķĨŗĨŪĨīŋŊīŋŊ - ** o īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊΚԤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊ ** + ** o īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊΚԤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ 2. o (īŋŊīŋŊʸīŋŊīŋŊ) īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊÆĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊβīŋŊīŋŊΚԤōŗĢ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊÎģīŋŊīŋŊīŋŊīŋŊŲ¤īŋŊ īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + 3. īŋŊīŋŊīŋŊīŋŊīŋŊĤīŋŊʸīŋŊīŋŊīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊƤīŋŊīŋŊéĄĸīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊÎģīŋŊīŋŊīŋŊīŋŊŲ¤īŋŊ īŋŊīŋŊ + īŋŊīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ---> o īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊČĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĪŗīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊԤذīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -735,12 +736,11 @@ NOTE: - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 6.2: īŋŊɲÃĨīŋŊīŋŊŪĨīŋŊīŋŊ - ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÎŧīŋŊīŋŊΰīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊÉ˛Ã¤īŋŊīŋŊīŋŊˤīŋŊ a īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÎŧīŋŊīŋŊΰīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊÉ˛Ã¤īŋŊīŋŊīŋŊˤīŋŊ a īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ ---> īŋŊĮŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊĮŊīŋŊΚԤذīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ @@ -763,7 +763,7 @@ NOTE: a, i īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 6.3: īŋŊīŋŊīŋŊīŋŊžīŋŊīŋŊīŋŊÖ´īŋŊīŋŊīŋŊËĄ - ** 1ʸīŋŊīŋŊīŋŊĘžīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊ R īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ ** + ** 1ʸīŋŊīŋŊīŋŊĘžīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊ R īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ ** 1. īŋŊʲīŋŊīŋŊīŋŊ ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊÔ¤ËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊĮŊīŋŊīŋŊ xxx īŋŊīŋŊīŋŊīŋŊÆŦīŋŊ˰īŋŊưīŋŊīŋŊ īŋŊŪ¤īŋŊīŋŊīŋŊ @@ -781,12 +781,11 @@ NOTE: a, i NOTE: īŋŊÖ´īŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊɤËģīŋŊīŋŊƤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƤÎĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊė¤ŋʸīŋŊīŋŊīŋŊĪ´īŋŊ¸īŋŊīŋŊʸīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 6.4: īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤÎĨīŋŊīŋŊÔĄīŋŊīŋŊČĨÚĄīŋŊīŋŊīŋŊīŋŊīŋŊ - ** īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤÎĨīŋŊīŋŊÔĄīŋŊīŋŊˤĪĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊ y īŋŊōĄĸĨÚĄīŋŊīŋŊīŋŊīŋŊȤˤīŋŊ p īŋŊīŋŊȤīŋŊīŋŊŪ¤īŋŊ ** + ** īŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤÎĨīŋŊīŋŊÔĄīŋŊīŋŊˤĪĨīŋŊīŋŊÚĨėĄŧīŋŊīŋŊ y īŋŊōĄĸĨÚĄīŋŊīŋŊīŋŊīŋŊȤˤīŋŊ p īŋŊīŋŊȤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. ---> īŋŊČŧīŋŊīŋŊīŋŊīŋŊė¤ŋīŋŊԤذīŋŊưīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ "a)" īŋŊθīŋŊīŋŊīŋŊÖ¤īŋŊīŋŊƤīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -804,12 +803,13 @@ NOTE: ---> a) this is the first item. b) - NOTE: ÃąīŋŊīŋŊīŋŊ1īŋŊīŋŊ yank īŋŊīŋŊīŋŊīŋŊΤīŋŊ y īŋŊōĨĒĨÚĨėĄŧīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊ yw īŋŊȤīŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + NOTE: y īŋŊōĨĒĨÚĨėĄŧīŋŊīŋŊīŋŊȤīŋŊīŋŊÆģȤīŋŊīŋŊīŋŊīŋŊȤīŋŊĮ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊyw īŋŊīŋŊÃąīŋŊīŋŊīŋŊ1īŋŊīŋŊ yank īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + yy īŋŊĪšÔ¤īŋŊ1īŋŊīŋŊ yank īŋŊīŋŊīŋŊīŋŊp īŋŊĮ¤īŋŊīŋŊΚԤīŋŊ put īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 6.5: īŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ - ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊÎēŨ¤īŋŊīŋŊīŋŊʸīŋŊīŋŊ/īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊĖĩīŋŊ뤚īŋŊīŋŊË¤ĪĄīŋŊīŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊꤡīŋŊŪ¤īŋŊ ** + ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊÎēŨ¤īŋŊīŋŊīŋŊʸīŋŊīŋŊ/īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊĖĩīŋŊ뤚īŋŊīŋŊË¤ĪĄīŋŊīŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊꤡīŋŊŪ¤īŋŊīŋŊīŋŊ ** 1. īŋŊīŋŊīŋŊīŋŊīŋŊͤīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊīŋŊ 'ignore' īŋŊō¸ĄēīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊį¤Ļ: /ignore n īŋŊō˛Ą¤īŋŊīŋŊÆ˛īŋŊīŋŊŲ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊōˇĢ¤īŋŊīŋŊÖ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -826,7 +826,7 @@ NOTE: 6. īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊÎļīŋŊīŋŊˤīŋŊĖĩīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊˤĪŧīŋŊīŋŊīŋŊīŋŊͤīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊŪ¤īŋŊ: :set noic NOTE: īŋŊŪĨÃĨīŋŊīŋŊÎļīŋŊÄ´ÉŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤĪŧīŋŊīŋŊīŋŊīŋŊͤīŋŊīŋŊīŋŊīŋŊΤīŋŊīŋŊŪ¤īŋŊ: :nohlsearch -NOTE: 1īŋŊĤθīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊÎļīŋŊīŋŊˤīŋŊīŋŊá¤ŋīŋŊīŋŊīŋŊʤīŋŊĐĄīŋŊīŋŊÕĨėĄŧīŋŊīŋŊīŋŊīŋŊ \c +NOTE: 1īŋŊĤθīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊÎļīŋŊīŋŊˤīŋŊīŋŊá¤ŋīŋŊīŋŊīŋŊʤīŋŊĐĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ \c īŋŊīŋŊīŋŊīŋŊҤīŋŊīŋŊŪ¤īŋŊ: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 6 īŋŊīŋŊīŋŊīŋŊ @@ -835,13 +835,13 @@ NOTE: 1 O (īŋŊīŋŊʸīŋŊīŋŊ) īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊČĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΞīŋŊΚԤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊâĄŧīŋŊÉ¤Ë¤Ę¤ëĄŖ 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊÎŧīŋŊīŋŊīŋŊīŋŊīŋŊÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊÉ˛Ã¤īŋŊīŋŊīŋŊˤīŋŊ a īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊëĄŖ - īŋŊīŋŊīŋŊīŋŊīŋŊËŧīŋŊưīŋŊĮĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊʸīŋŊīŋŊ A īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊëĄŖ + īŋŊīŋŊīŋŊīŋŊīŋŊËĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊʸīŋŊīŋŊ A īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊëĄŖ - 3. e īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊÃąīŋŊīŋŊÎŊīŋŊÃŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊëĄŖ + 3. e īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊÃąīŋŊīŋŊÎŊīŋŊÃŧīŋŊËĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊưīŋŊīŋŊīŋŊëĄŖ 4. y īŋŊīŋŊīŋŊÚĨėĄŧīŋŊīŋŊīŋŊĪĨÆĨīŋŊīŋŊīŋŊīŋŊȤīŋŊ yank (īŋŊīŋŊīŋŊÔĄīŋŊ)īŋŊīŋŊīŋŊīŋŊp īŋŊΤīŋŊīŋŊīŋŊīŋŊ put (īŋŊÚĄīŋŊīŋŊīŋŊīŋŊīŋŊ)īŋŊīŋŊīŋŊëĄŖ - 5. īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊ R īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊęĄĸīŋŊō˛Ą¤īŋŊīŋŊīŋŊČ´īŋŊīŋŊīŋŊëĄŖ + 5. īŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊ R īŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊīŋŊīŋŊīŋŊÖ´īŋŊīŋŊâĄŧīŋŊɤīŋŊīŋŊīŋŊīŋŊęĄĸ īŋŊō˛Ą¤īŋŊīŋŊīŋŊČ´īŋŊīŋŊīŋŊëĄŖ 6. ":set xxx" īŋŊČĨīŋŊīŋŊīŋŊīŋŊפīŋŊīŋŊīŋŊČĨīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊ "xxx" īŋŊīŋŊīŋŊīŋŊīŋŊę¤ĩīŋŊīŋŊëĄŖ 'ic' 'ignorecase' īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊÎļīŋŊīŋŊˤīŋŊīŋŊʤīŋŊ @@ -849,7 +849,7 @@ NOTE: 1 'hls' 'hlsearch' īŋŊŪĨÃĨīŋŊīŋŊīŋŊīŋŊ뤚īŋŊŲ¤Æ¤īŋŊÄ´ÉŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ ÄšīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÃģīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɤīŋŊīŋŊīŋŊÎĨīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊĖžīŋŊĮ¤īŋŊīŋŊīŋŊҤĮ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 7. īŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊīŋŊĖĩīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊˤīŋŊ "no" īŋŊīŋŊīŋŊīŋŊÍŋīŋŊīŋŊīŋŊŪ¤īŋŊ: :set noic + 7. īŋŊīŋŊīŋŊ×ĨīŋŊīŋŊīŋŊīŋŊīŋŊĖĩīŋŊīŋŊīŋŊˤīŋŊīŋŊīŋŊˤīŋŊ "no" īŋŊīŋŊīŋŊīŋŊÍŋīŋŊīŋŊīŋŊīŋŊ: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊÃĨīŋŊīŋŊīŋŊ 7.1: īŋŊīŋŊīŋŊīŋŊéĨ¤īŋŊīŋŊØĨīŋŊ×ĨīŋŊīŋŊŪĨīŋŊīŋŊ @@ -883,15 +883,15 @@ NOTE: 1 īŋŊīŋŊīŋŊīŋŊīŋŊÔ˛Ä¤Č¤Ę¤Ã¤Æ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÂŋīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊħīŋŊīŋŊȤīŋŊīŋŊΤīŋŊīŋŊīŋŊīŋŊˤīŋŊ "vimrc" īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 1. "vimrc" īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔŊīŋŊīŋŊōŗĢģΤīŋŊīŋŊëĄŖīŋŊīŋŊīŋŊīŋŊĪĨīŋŊīŋŊīŋŊīŋŊÆĨīŋŊ˰īŋŊ¸īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - :edit ~/.vimrc UNIX īŋŊīŋŊīŋŊīŋŊ - :edit $VIM/_vimrc Windows īŋŊīŋŊīŋŊīŋŊ + 1. "vimrc" īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÔŊīŋŊīŋŊōŗĢģΤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĪĨīŋŊīŋŊīŋŊīŋŊÆĨīŋŊ˰īŋŊ¸īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ + :e ~/.vimrc UNIX īŋŊīŋŊīŋŊīŋŊ + :e ~/_vimrc Windows īŋŊīŋŊīŋŊīŋŊ 2. īŋŊīŋŊīŋŊīŋŊīŋŊĮĨīŋŊīŋŊīŋŊ×ĨīŋŊīŋŊ "vimrc" īŋŊīŋŊīŋŊɤߚīŋŊīŋŊߤۤīŋŊīŋŊīŋŊ - :read $VIMRUNTIME/vimrc_example.vim + :r $VIMRUNTIME/vimrc_example.vim 3. īŋŊʲīŋŊīŋŊΤč¤ĻīŋŊËĨÕĨīŋŊīŋŊīŋŊīŋŊīŋŊØŊņ¤­šīŋŊīŋŊߤۤīŋŊīŋŊīŋŊ - :write + :w īŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊưīŋŊīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊīŋŊŤīŋŊīŋŊīŋŊʸīŋŊīŋŊīŋŊȤīŋŊīŋŊīŋŊč¤ĻīŋŊˤʤīŋŊĮ¤īŋŊīŋŊį¤ĻīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ "vimrc" īŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊØĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊߤīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÉ˛Ã¤īŋŊīŋŊë¤ŗīŋŊȤīŋŊīŋŊĮ¤īŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -907,7 +907,7 @@ NOTE: 1 2. īŋŊīŋŊīŋŊߤÎĨĮĨīŋŊīŋŊėĨ¯īŋŊČĨīŋŊËēߤīŋŊÕĨīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :!ls īŋŊīŋŊ :!dir īŋŊĮŗīŋŊĮ§īŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - 3. īŋŊīŋŊīŋŊŪĨīŋŊÉ¤ÎŗīŋŊīŋŊΤōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ: :e + 3. īŋŊīŋŊīŋŊŪĨīŋŊɤīŋŊīŋŊīŋŊÆŦīŋŊōĨŋĨīŋŊīŋŊפīŋŊīŋŊŪ¤īŋŊ: :e 4. CTRL-D īŋŊō˛Ą¤īŋŊīŋŊīŋŊ Vim īŋŊīŋŊ "e" īŋŊīŋŊīŋŊīŋŊΤۤëĨŗīŋŊŪĨīŋŊɤΰīŋŊīŋŊīŋŊīŋŊīŋŊÉŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ @@ -955,7 +955,7 @@ NOTE: īŋŊīŋŊīŋŊĮŧīŋŊ: New Riders īŋŊĮŊīŋŊīŋŊīŋŊܤδīŋŊīŋŊīŋŊīŋŊīŋŊ Vim īŋŊΤīŋŊīŋŊīŋŊËŊņ¤Ģ¤īŋŊŪ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȤīŋŊī¤ąīŋŊéŋ´īŋŊÔ¤Ë¤Ī¤īŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊīŋŊ ÂŋīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĮ¤īŋŊīŋŊĮēܤīŋŊīŋŊīŋŊƤīŋŊīŋŊŪ¤īŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊURLīŋŊōģ˛žČ¤īŋŊīŋŊÆ˛īŋŊīŋŊīŋŊīŋŊīŋŊ http://iccf-holland.org/click5.html + īŋŊīŋŊīŋŊīŋŊURLīŋŊōģ˛žČ¤īŋŊīŋŊÆ˛īŋŊīŋŊīŋŊīŋŊīŋŊ https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊīŋŊīŋŊ Vi īŋŊˤĤīŋŊīŋŊÆŊņ¤Ģ¤ė¤ŋīŋŊŤīŋŊīŋŊܤĮ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ¤īŋŊ: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.ja.sjis b/runtime/tutor/tutor.ja.sjis index 0562a0036aed3..ab463801cc499 100644 --- a/runtime/tutor/tutor.ja.sjis +++ b/runtime/tutor/tutor.ja.sjis @@ -8,7 +8,7 @@ īŋŊɂȂīŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊB īŋŊ`īŋŊīŋŊīŋŊ[īŋŊgīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˂ɕKīŋŊvīŋŊȎīŋŊīŋŊԂ́AīŋŊoīŋŊīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˂ɂĮ‚ꂞ - īŋŊīŋŊīŋŊīŋŊīŋŊԂīŋŊīŋŊgīŋŊīŋŊīŋŊĖ‚īŋŊīŋŊɂīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊæ‚ģ25īŋŊīŋŊīŋŊīŋŊ30īŋŊīŋŊīŋŊłīŋŊīŋŊB + īŋŊīŋŊīŋŊīŋŊīŋŊԂīŋŊīŋŊgīŋŊīŋŊīŋŊĖ‚īŋŊīŋŊɂīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊæ‚ģ30īŋŊīŋŊīŋŊłīŋŊīŋŊB ATTENTION: īŋŊȉīŋŊīŋŊĖ—īŋŊīŋŊKīŋŊpīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊɂ͂īŋŊīŋŊĖ•īŋŊīŋŊ͂īŋŊĪXīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊKīŋŊīŋŊīŋŊnīŋŊ߂īŋŊO @@ -24,7 +24,7 @@ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.1: īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊĖˆÚ“īŋŊ - ** īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊɂ́AīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊlīŋŊīŋŊ h,j,k,l īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊɂ́AīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊlīŋŊīŋŊ h,j,k,l īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** ^ k īŋŊqīŋŊīŋŊīŋŊg: h īŋŊLīŋŊ[īŋŊ͍īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB < h l > l īŋŊLīŋŊ[īŋŊ͉EīŋŊīŋŊīŋŊīŋŊīŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -65,11 +65,12 @@ NOTE: :q! 5. 1.3īŋŊ܂ŃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.3: īŋŊeīŋŊLīŋŊXīŋŊgīŋŊŌW - īŋŊ폜 - ** īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂăJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ x īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂăJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ x īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -87,12 +88,11 @@ NOTE: - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.4: īŋŊeīŋŊLīŋŊXīŋŊgīŋŊŌW - īŋŊ}īŋŊīŋŊ - ** īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂăeīŋŊLīŋŊXīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ i īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂăeīŋŊLīŋŊXīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ i īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -115,10 +115,10 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.5: īŋŊeīŋŊLīŋŊXīŋŊgīŋŊŌW - īŋŊĮ‰īŋŊ - ** īŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊĮ‰īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ A īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤 ** + ** īŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊĮ‰īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ A īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ܂īŋŊīŋŊīŋŊB + īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖsīŋŊĖ‚Į‚Ė•īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ܂īŋŊīŋŊīŋŊB 2. īŋŊĮ‰īŋŊīŋŊīŋŊīŋŊKīŋŊvīŋŊȏꏊīŋŊīŋŊ A īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -137,18 +137,17 @@ NOTE: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.6: īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ•ŌW - - ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊۑīŋŊīŋŊīŋŊīŋŊďIīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :wq īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊۑīŋŊīŋŊīŋŊīŋŊďIīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :wq īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** !! NOTE: īŋŊȉīŋŊīŋŊ˃XīŋŊeīŋŊbīŋŊvīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊOīŋŊɁAīŋŊ܂īŋŊīŋŊSīŋŊĖ‚īŋŊĮ‚īŋŊłīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ!! - 1. īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.2 īŋŊłīŋŊīŋŊīŋŊīŋŊīŋŊ悤īŋŊīŋŊ :q! īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊāAīŋŊīŋŊīŋŊ˃`īŋŊīŋŊīŋŊ[īŋŊgīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊIīŋŊīŋŊ - īŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊé‚ĸīŋŊ́AīŋŊƂ˒[īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊꍇīŋŊ͂īŋŊīŋŊīŋŊīŋŊÅˆČ‰īŋŊīŋŊĖ“īŋŊīŋŊeīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊīŋŊ܂īŋŊ - īŋŊ܂īŋŊīŋŊīŋŊB + 1. īŋŊƂ˒[īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊꍇīŋŊ͂īŋŊīŋŊīŋŊīŋŊÅˆČ‰īŋŊīŋŊĖ“īŋŊīŋŊeīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊīŋŊłȂīŋŊīŋŊīŋŊ΁A + īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 1.2 īŋŊłīŋŊīŋŊīŋŊīŋŊīŋŊ悤īŋŊīŋŊ :q! īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊāAīŋŊīŋŊīŋŊ˃`īŋŊīŋŊīŋŊ[īŋŊgīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊIīŋŊīŋŊ + īŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 2. īŋŊVīŋŊFīŋŊīŋŊīŋŊvīŋŊīŋŊīŋŊīŋŊīŋŊvīŋŊgīŋŊłīŋŊīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ: vim tutor - 'vim' īŋŊīŋŊ Vim īŋŊGīŋŊfīŋŊBīŋŊ^īŋŊīŋŊīŋŊNīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊA'tutor' īŋŊÍ•ŌWīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊOīŋŊłīŋŊīŋŊBīŋŊĪXīŋŊīŋŊīŋŊĂīŋŊīŋŊæ‚ĸīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 2. īŋŊVīŋŊFīŋŊīŋŊīŋŊvīŋŊīŋŊīŋŊīŋŊīŋŊvīŋŊgīŋŊłīŋŊīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ: vim file.txt + 'vim' īŋŊīŋŊ Vim īŋŊGīŋŊfīŋŊBīŋŊ^īŋŊīŋŊīŋŊNīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊA'file.txt' īŋŊÍ•ŌWīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊ + īŋŊĖ–īŋŊīŋŊOīŋŊłīŋŊīŋŊBīŋŊĪXīŋŊłīŋŊīŋŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ–īŋŊīŋŊOīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 3. īŋŊOīŋŊ˃īŋŊīŋŊbīŋŊXīŋŊīŋŊīŋŊŊwīŋŊņ‚ž‚悤īŋŊɁAīŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊAīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -186,9 +185,9 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2.1: īŋŊ폜īŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊPīŋŊīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤 ** + ** īŋŊPīŋŊīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB ** - 1. īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊłīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊé‚ŊīŋŊ߂īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 1. īŋŊmīŋŊīŋŊīŋŊɃmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂīŋŊīŋŊé‚ŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 2. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -196,22 +195,22 @@ NOTE: 4. īŋŊPīŋŊīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊé‚ŊīŋŊ߂īŋŊ dw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - NOTE: īŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƁAdw īŋŊƂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊXīŋŊNīŋŊīŋŊīŋŊ[īŋŊīŋŊīŋŊĖÅ‰īŋŊīŋŊsīŋŊɌīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - īŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊԈīŋŊīŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĂīŋŊč’ŧīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + NOTE: d īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƁAīŋŊīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊXīŋŊNīŋŊīŋŊīŋŊ[īŋŊīŋŊīŋŊĖÅ‰īŋŊīŋŊsīŋŊɌīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBVim īŋŊīŋŊ + īŋŊīŋŊīŋŊȂīŋŊīŋŊīŋŊ w īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊŌ‚īŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊ d īŋŊȊOīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊę‚Ŋ + īŋŊīŋŊīŋŊ͉īŋŊīŋŊīŋŊīŋŊԈīŋŊīŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊB īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĂīŋŊč’ŧīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB ---> īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊ īŋŊɂīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ‚īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊĖ‚īŋŊīŋŊīŋŊ īŋŊKīŋŊvīŋŊ˂ȂīŋŊ īŋŊPīŋŊīŋŊ īŋŊīŋŊ īŋŊ܂܂īŋŊīŋŊ īŋŊīŋŊīŋŊ܂īŋŊīŋŊB 5. 3 īŋŊīŋŊīŋŊīŋŊ 4 īŋŊ܂łđ•ļ‚īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȂīŋŊ܂ŌJīŋŊīŋŊԂīŋŊīŋŊAīŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2.2 īŋŊ֐iīŋŊŨ‚Ü‚īŋŊīŋŊ傤īŋŊB - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2.2: īŋŊīŋŊīŋŊĖ‘īŋŊīŋŊĖíœīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊsīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ d$ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤 ** + ** īŋŊsīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ d$ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB ** - 1. īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊłīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 1. īŋŊmīŋŊīŋŊīŋŊɃmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂīŋŊīŋŊé‚ŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 2. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -232,7 +231,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2.3: īŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊƃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊīŋŊīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊ̓IīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊƃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊeīŋŊLīŋŊXīŋŊgīŋŊÉ•ĪXīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + īŋŊeīŋŊLīŋŊXīŋŊgīŋŊÉ•ĪXīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊé‘ŊīŋŊīŋŊīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊ̓IīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊƃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȂīŋŊ܂īŋŊīŋŊB īŋŊ폜īŋŊRīŋŊ}īŋŊīŋŊīŋŊh d īŋŊ˃IīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊ͎īŋŊīŋŊĖ—līŋŊɂȂīŋŊīŋŊĂīŋŊīŋŊ܂īŋŊ: d īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ @@ -248,7 +247,7 @@ NOTE: īŋŊ‚܂īŋŊ de īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƁAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊĖIīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB -NOTE: īŋŊ`īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊlīŋŊ́AīŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂăRīŋŊ}īŋŊīŋŊīŋŊhīŋŊȂīŋŊīŋŊɃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ +NOTE: īŋŊ`īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊlīŋŊ́AīŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂăIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊȂīŋŊīŋŊɃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊŨ‚Ü‚īŋŊīŋŊ傤īŋŊBīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړIīŋŊīŋŊꗗīŋŊŎīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊʒuīŋŊɈړīŋŊīŋŊīŋŊīŋŊīŋŊ͂īŋŊīŋŊłīŋŊīŋŊB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -259,7 +258,7 @@ NOTE: 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊːæ“ĒīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 2. 2w īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĒPīŋŊīŋŊ2īŋŊ•īŋŊīŋŊOīŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 2. 2w īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĒPīŋŊīŋŊ2īŋŊ•īŋŊīŋŊīŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB 3. 3e īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊ3īŋŊÂ–Ú‚Ė’PīŋŊīŋŊĖIīŋŊ[īŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -284,24 +283,24 @@ NOTE: īŋŊīŋŊč‘ŊīŋŊīŋŊīŋŊĖíœīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊ܂īŋŊ: d īŋŊīŋŊīŋŊl īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ - 1. ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊĖsīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 1. ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊĖÅīŋŊīŋŊĖ‘å•ļīŋŊīŋŊīŋŊĖ’PīŋŊīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 2. UPPER CASE īŋŊĖ’PīŋŊīŋŊ2īŋŊ‚īŋŊ d2w īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊč폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 2. īŋŊå•ļīŋŊīŋŊīŋŊĖ’PīŋŊīŋŊ2īŋŊ‚īŋŊ d2w īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊč폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 3. UPPER CASE īŋŊƂīŋŊīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊīŋŊīŋŊA1īŋŊÂ‚ĖƒRīŋŊ}īŋŊīŋŊīŋŊhīŋŊÆˆŲ‚Č‚īŋŊJīŋŊEīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊwīŋŊč‚ĩīŋŊA + 3. īŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊå•ļīŋŊīŋŊīŋŊĖ’PīŋŊīŋŊīŋŊīŋŊAīŋŊŲ‚Č‚īŋŊJīŋŊEīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊwīŋŊč‚ĩīŋŊīŋŊ1īŋŊÂ‚ĖƒRīŋŊ}īŋŊīŋŊīŋŊhīŋŊō폜īŋŊīŋŊīŋŊA īŋŊXīŋŊeīŋŊbīŋŊv 1 īŋŊīŋŊ 2 īŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊ܂īŋŊīŋŊB ---> īŋŊīŋŊīŋŊīŋŊABC DEīŋŊsīŋŊīŋŊFGHI JK LMN OPīŋŊPīŋŊīŋŊīŋŊQ RS TUVīŋŊYīŋŊīŋŊɂȂīŋŊīŋŊīŋŊīŋŊB -NOTE: īŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^ d īŋŊƃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊĖŠÔ‚ÉƒJīŋŊEīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊīŋŊīŋŊꍇīŋŊAīŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊ˂ȂīŋŊ - īŋŊꍇīŋŊ˃īŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊĖ‚æ‚¤īŋŊɓīŋŊīŋŊė‚ĩīŋŊ܂īŋŊīŋŊB - īŋŊīŋŊ: 3dw īŋŊīŋŊ d3w īŋŊ͓īŋŊīŋŊīŋŊīŋŊŁA3w īŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2.6: īŋŊsīŋŊĖ‘īŋŊīŋŊīŋŊ - ** īŋŊsīŋŊSīŋŊĖ‚īŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dd īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊsīŋŊSīŋŊĖ‚īŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dd īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** īŋŊsīŋŊSīŋŊĖ‚īŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊpīŋŊxīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˂ŁAViīŋŊ˃fīŋŊUīŋŊCīŋŊiīŋŊ[īŋŊ͍sīŋŊĖíœīŋŊīŋŊ d īŋŊīŋŊ2īŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊȒPīŋŊȂīŋŊīŋŊĖ‚ÉŒīŋŊīŋŊ߂܂īŋŊīŋŊīŋŊīŋŊB @@ -319,24 +318,25 @@ NOTE: ---> 6) īŋŊīŋŊīŋŊīŋŊīŋŊ͊ÂīŋŊ ---> 7) īŋŊIīŋŊ}īŋŊGīŋŊīŋŊīŋŊiīŋŊ[ +2īŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊ1īŋŊsīŋŊɑ΂īŋŊīŋŊčīŋŊpīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ@īŋŊ͈ȉīŋŊīŋŊŏqīŋŊׂīŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊłīŋŊīŋŊīŋŊīŋŊė‚ĩīŋŊ܂īŋŊīŋŊB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2.7: īŋŊīŋŊč’ŧīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊŌīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ u īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBU īŋŊ͍sīŋŊSīŋŊĖ‚ĖŽīŋŊīŋŊīŋŊłīŋŊīŋŊB ** + ** īŋŊŌīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ u īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBU īŋŊ͍sīŋŊSīŋŊĖ‚ĖŽīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊAīŋŊŏīŋŊīŋŊĖŠÔˆá‚ĸīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊ īŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 2. x īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊȂīŋŊīŋŊæ“ĒīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 2. x īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊčŏīŋŊīŋŊĖ‚īŋŊīŋŊīŋŊȂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 3. īŋŊīŋŊīŋŊīŋŊīŋŊAu īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊčŌīŋŊɎīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 4. īŋŊīŋŊīŋŊxīŋŊ́Ax īŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊČīŋŊīŋŊīŋŊSīŋŊďCīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 4. īŋŊīŋŊīŋŊxīŋŊ́Ax īŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊčsīŋŊīŋŊīŋŊˌīŋŊīŋŊīŋŊSīŋŊďCīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 5. īŋŊå•ļīŋŊīŋŊīŋŊīŋŊ U īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊāAīŋŊsīŋŊīŋŊīŋŊīŋŊīŋŊĖīŋŊԂɖ߂īŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 6. u īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĒīŋŊīŋŊOīŋŊīŋŊ U īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 6. u īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĒīŋŊīŋŊOīŋŊīŋŊ U īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 7. īŋŊł̓RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊĎīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊ CTRL-R (CTRL īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊ R īŋŊīŋŊłīŋŊ)īŋŊ𐔉īŋŊ - īŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĂŨ‚Ü‚īŋŊīŋŊ傤(īŋŊīŋŊīŋŊīŋŊĖŽīŋŊīŋŊ)īŋŊB + īŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĂŨ‚Ü‚īŋŊīŋŊ傤(īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖŽīŋŊīŋŊīŋŊīŋŊīŋŊ)īŋŊB ----> īŋŊīŋŊīŋŊĖ‚ĖsīŋŊĖ‚ĖŠÔˆá‚ĸīŋŊīŋŊīŋŊCīŋŊīŋŊīŋŊXīŋŊīŋŊīŋŊAīŋŊīŋŊłīŋŊīŋŊīŋŊīŋŊĖCīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂܂īŋŊīŋŊīŋŊīŋŊB +---> īŋŊīŋŊīŋŊĖ‚ĖsīŋŊĖ‚ĖŠÔˆá‚ĸīŋŊīŋŊīŋŊCīŋŊīŋŊīŋŊXīŋŊīŋŊīŋŊAīŋŊīŋŊłīŋŊīŋŊīŋŊīŋŊĖCīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂܂īŋŊīŋŊīŋŊīŋŊB 8. īŋŊīŋŊīŋŊīŋŊ͂ƂĂīŋŊīŋŊ֗īŋŊīŋŊȃRīŋŊ}īŋŊīŋŊīŋŊhīŋŊłīŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2 īŋŊvīŋŊīŋŊ֐iīŋŊŨ‚Ü‚īŋŊīŋŊ傤īŋŊB @@ -347,45 +347,47 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 2 īŋŊvīŋŊīŋŊ - 1. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 2. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊsīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ d$ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 3. īŋŊsīŋŊSīŋŊĖ‚īŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dd īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 1. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊįŽŸīŋŊĖ’PīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 2. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ de īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 3. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊsīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ d$ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 4. īŋŊsīŋŊSīŋŊĖ‚īŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊɂīŋŊ dd īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 4. īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊɂ͐īŋŊīŋŊlīŋŊīŋŊtīŋŊ^īŋŊīŋŊīŋŊ܂īŋŊ: 2w - 5. īŋŊĪXīŋŊɗpīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊˌ`īŋŊīŋŊīŋŊīŋŊ + 5. īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊɂ͐īŋŊīŋŊlīŋŊīŋŊtīŋŊ^īŋŊīŋŊīŋŊ܂īŋŊ: 2w + 6. īŋŊĪXīŋŊɗpīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊˌ`īŋŊīŋŊīŋŊīŋŊ īŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^ [īŋŊīŋŊīŋŊl] īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊę‚ŧīŋŊīŋŊ: īŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^ - īŋŊ폜 d īŋŊ˗ۂʼnīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ邩īŋŊB - īŋŊīŋŊīŋŊl - īŋŊīŋŊīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊīŋŊīŋŊB - īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ - w (īŋŊPīŋŊīŋŊ)īŋŊīŋŊ $ (īŋŊsīŋŊīŋŊ)īŋŊȂĮ‚˗ۂŁAīŋŊeīŋŊLīŋŊXīŋŊgīŋŊˉīŋŊīŋŊɑ΂īŋŊīŋŊēīŋŊīŋŊīŋŊīŋŊīŋŊ - īŋŊīŋŊīŋŊ邩īŋŊB + [īŋŊīŋŊīŋŊl] - īŋŊīŋŊīŋŊ˃RīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊīŋŊīŋŊB + īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ - w (īŋŊPīŋŊīŋŊ)īŋŊīŋŊ e (īŋŊPīŋŊꖖīŋŊīŋŊ)īŋŊA$ (īŋŊsīŋŊīŋŊ)īŋŊȂĮ‚˗ۂŁAīŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊ + īŋŊīŋŊīŋŊɑ΂īŋŊīŋŊēīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ邩īŋŊB - 6. īŋŊsīŋŊːæ“ĒīŋŊɈړīŋŊīŋŊīŋŊīŋŊīŋŊɂ̓[īŋŊīŋŊīŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊ: 0 + 7. īŋŊsīŋŊːæ“ĒīŋŊɈړīŋŊīŋŊīŋŊīŋŊīŋŊɂ̓[īŋŊīŋŊīŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊ: 0 + + 8. īŋŊOīŋŊīŋŊĖ“īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: u (īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ u) + īŋŊsīŋŊSīŋŊĖ‚Ė•ĪXīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: U (īŋŊå•ļīŋŊīŋŊ U) + īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖŽīŋŊīŋŊīŋŊīŋŊīŋŊ: CTRL-R - 7. īŋŊOīŋŊīŋŊĖ“īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: u (īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ u) - īŋŊsīŋŊSīŋŊĖ‚Ė•ĪXīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: U (īŋŊå•ļīŋŊīŋŊ U) - īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖŽīŋŊīŋŊīŋŊīŋŊ: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 3.1: īŋŊ\īŋŊīŋŊtīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊŌīŋŊɍ폜īŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊīŋŊīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˌīŋŊɓ\īŋŊīŋŊtīŋŊīŋŊīŋŊīŋŊɂīŋŊ p īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊŌīŋŊɍ폜īŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊīŋŊīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˌīŋŊɓ\īŋŊīŋŊtīŋŊīŋŊīŋŊīŋŊɂīŋŊ p īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** - 1. īŋŊȉīŋŊīŋŊĖ’iīŋŊīŋŊīŋŊĖÅīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 1. ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊȉīŋŊīŋŊĖÅīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 2. dd īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊčsīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊAVim īŋŊ˃oīŋŊbīŋŊtīŋŊ@īŋŊɊiīŋŊ[īŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 2. dd īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊčsīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊAVim īŋŊ˃īŋŊīŋŊWīŋŊXīŋŊ^īŋŊɊiīŋŊ[īŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 3. īŋŊ폜īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊ{īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊׂīŋŊīŋŊʒuīŋŊĖīŋŊĖsīŋŊ܂ŁAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 3. īŋŊ폜īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊ{īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊׂīŋŊīŋŊʒuīŋŊĖīŋŊĖsīŋŊłīŋŊīŋŊīŋŊ c) īŋŊsīŋŊ܂ŁAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊ + īŋŊ܂īŋŊīŋŊ傤īŋŊB - 4. īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊīŋŊ p īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĊiīŋŊ[īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊʂɖ߂īŋŊīŋŊ܂īŋŊīŋŊB + 4. īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊīŋŊ p īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĊiīŋŊ[īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊɖ߂īŋŊīŋŊ܂īŋŊīŋŊB 5. īŋŊīŋŊīŋŊԂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȂīŋŊlīŋŊɃXīŋŊeīŋŊbīŋŊv 2 īŋŊīŋŊīŋŊīŋŊ 4 īŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - d) īŋŊMīŋŊīŋŊīŋŊīŋŊīŋŊwīŋŊԂīŋŊīŋŊƂīŋŊīŋŊłīŋŊīŋŊīŋŊ? - b) īŋŊXīŋŊ~īŋŊīŋŊīŋŊ͐‚īŋŊīŋŊA - c) īŋŊmīŋŊbīŋŊƂ͊wīŋŊԂīŋŊīŋŊˁA - a) īŋŊoīŋŊīŋŊīŋŊ͐ԂīŋŊīŋŊA +---> d) īŋŊMīŋŊīŋŊīŋŊīŋŊīŋŊwīŋŊԂīŋŊīŋŊƂīŋŊīŋŊłīŋŊīŋŊīŋŊ? +---> b) īŋŊXīŋŊ~īŋŊīŋŊīŋŊ͐‚īŋŊīŋŊA +---> c) īŋŊmīŋŊbīŋŊƂ͊wīŋŊԂīŋŊīŋŊˁA +---> a) īŋŊoīŋŊīŋŊīŋŊ͐ԂīŋŊīŋŊA @@ -393,7 +395,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 3.2: īŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ r īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊ x īŋŊɒuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ rx īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -416,38 +418,38 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 3.3: īŋŊĪXīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊPīŋŊīŋŊĖˆę•”īŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ͑SīŋŊĖ‚īŋŊĪXīŋŊīŋŊīŋŊīŋŊɂīŋŊ cw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊPīŋŊīŋŊĖ–īŋŊīŋŊīŋŊīŋŊ܂łīŋŊĪXīŋŊīŋŊīŋŊīŋŊɂīŋŊ ce īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 2. lubw īŋŊīŋŊ u īŋŊĖˆĘ’uīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - 3. cw īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤(īŋŊīŋŊīŋŊĖę‡ 'ine' īŋŊƃ^īŋŊCīŋŊv)īŋŊB + 3. ce īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤(īŋŊīŋŊīŋŊĖę‡ 'ine' īŋŊƃ^īŋŊCīŋŊv)īŋŊB - 4. īŋŊīŋŊīŋŊĖŠÔˆá‚ĸ(īŋŊĪXīŋŊīŋŊīŋŊׂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊːæ“Ē)īŋŊɈړīŋŊīŋŊīŋŊīŋŊé‚ŊīŋŊ߂īŋŊ īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 4. īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĂīŋŊīŋŊįŽŸīŋŊĖŠÔˆá‚ĸ(īŋŊĪXīŋŊīŋŊīŋŊׂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊːæ“Ē)īŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB 5. īŋŊŏīŋŊīŋŊĖsīŋŊīŋŊīŋŊīŋŊīŋŊĖsīŋŊĖ—līŋŊɂȂīŋŊ܂ŃXīŋŊeīŋŊbīŋŊv 3 īŋŊīŋŊ 4 īŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊ܂īŋŊīŋŊB ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. -cw īŋŊ͒PīŋŊīŋŊīŋŊĪXīŋŊīŋŊīŋŊ邾īŋŊīŋŊīŋŊłȂīŋŊīŋŊAīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊ邱īŋŊƂɒīŋŊīŋŊĶ‚īŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - +ce īŋŊ͒PīŋŊīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊAīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊ邱īŋŊƂɒīŋŊīŋŊĶ‚īŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB +cc īŋŊ͓īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƂīŋŊīŋŊsīŋŊSīŋŊĖ‚É‘Î‚īŋŊīŋŊčsīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 3.4: c īŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‘īŋŊīŋŊĖ•ĪX - ** īŋŊĪXīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊ́AīŋŊ폜īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊƓīŋŊīŋŊīŋŊīŋŊlīŋŊɃIīŋŊuīŋŊWīŋŊFīŋŊNīŋŊgīŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊĪXīŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊ́AīŋŊ폜īŋŊƓīŋŊīŋŊīŋŊīŋŊlīŋŊɃīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** - 1. īŋŊĪXīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊ́AīŋŊ폜īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊƓīŋŊīŋŊīŋŊīŋŊ悤īŋŊȓīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊˌ`īŋŊīŋŊīŋŊīŋŊ + 1. īŋŊĪXīŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊ́AīŋŊ폜īŋŊƓīŋŊīŋŊīŋŊīŋŊ悤īŋŊȓīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊˌ`īŋŊīŋŊīŋŊīŋŊ c [īŋŊīŋŊīŋŊl] īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊ - 2. īŋŊIīŋŊuīŋŊWīŋŊFīŋŊNīŋŊgīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŁAw īŋŊ͒PīŋŊīŋŊA $ īŋŊ͍sīŋŊīŋŊīŋŊȂĮ‚Æ‚īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˂łīŋŊīŋŊB + 2. īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŁAw īŋŊ͒PīŋŊīŋŊA $ īŋŊ͍sīŋŊīŋŊīŋŊȂĮ‚Æ‚īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˂łīŋŊīŋŊB - 3. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 3. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 4. īŋŊŏīŋŊīŋŊĖŠÔˆá‚ĸīŋŊփJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -470,7 +472,7 @@ NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB 3. īŋŊĪXīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊł̓JīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ˃īŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊŎwīŋŊ肺īŋŊīŋŊīŋŊIīŋŊ[īŋŊ܂łīŋŊīŋŊ - īŋŊXīŋŊīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊ”\īŋŊłīŋŊīŋŊBīŋŊá‚ĻīŋŊīŋŊ cw īŋŊȂīŋŊ΃JīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊĖIīŋŊīŋŊīŋŊ܂ŁA + īŋŊXīŋŊīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊ”\īŋŊłīŋŊīŋŊBīŋŊá‚ĻīŋŊīŋŊ ce īŋŊȂīŋŊ΃JīŋŊ[īŋŊ\īŋŊīŋŊīŋŊʒuīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊĖIīŋŊīŋŊīŋŊ܂ŁA c$ īŋŊȂīŋŊ΍sīŋŊĖIīŋŊīŋŊīŋŊ܂łīŋŊĪXīŋŊīŋŊīŋŊ܂īŋŊīŋŊB 4. īŋŊĪXīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊˌ`īŋŊīŋŊīŋŊīŋŊ @@ -485,7 +487,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 4.1: īŋŊʒuīŋŊƃtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖīŋŊīŋŊ ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊÅ‚ĖˆĘ’uīŋŊƃtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖīŋŊԂīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ CTRL-G īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊīŋŊīŋŊsīŋŊɈړīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ G īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊīŋŊīŋŊsīŋŊɈړīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ G īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** NOTE: īŋŊXīŋŊeīŋŊbīŋŊvīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊOīŋŊɁAīŋŊīŋŊīŋŊ˃īŋŊīŋŊbīŋŊXīŋŊīŋŊīŋŊSīŋŊĂɖڂīŋŊʂīŋŊīŋŊ܂īŋŊīŋŊ傤!! @@ -496,7 +498,7 @@ NOTE: NOTE: īŋŊīŋŊƂˉEīŋŊīŋŊīŋŊīŋŊīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊĖˆĘ’uīŋŊīŋŊīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĂīŋŊīŋŊ邩īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊīŋŊ 'ruler' īŋŊIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊ(:help 'ruler' īŋŊīŋŊīŋŊQīŋŊīŋŊ)īŋŊīŋŊŨ’股īŋŊ邱īŋŊƂŕ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 2. īŋŊʼnīŋŊīŋŊsīŋŊɈړīŋŊīŋŊīŋŊīŋŊé‚ŊīŋŊ߂īŋŊ G īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB + 2. īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖÅ‰īŋŊīŋŊsīŋŊɈړīŋŊīŋŊīŋŊīŋŊé‚ŊīŋŊ߂īŋŊ G īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊːæ“ĒīŋŊɈړīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ gg īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 3. īŋŊīŋŊŲ‚Į‚ĖsīŋŊĖ”ÔīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊ G īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊBīŋŊŏīŋŊīŋŊīŋŊ CTRL-G īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊs @@ -508,19 +510,19 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 4.2: īŋŊīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ / īŋŊƁAīŋŊOīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB** + ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ / īŋŊƁAīŋŊOīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊmīŋŊ[īŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊīŋŊ / īŋŊƂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊʈīŋŊԉīŋŊīŋŊīŋŊ : īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊlīŋŊīŋŊ / īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ邱īŋŊƂɋCīŋŊÂīŋŊīŋŊłīŋŊīŋŊ傤īŋŊB 2. īŋŊł́A'errroor' īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊBīŋŊīŋŊīŋŊę‚ĒīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊPīŋŊīŋŊłīŋŊīŋŊB - 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊxīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƂīŋŊīŋŊīŋŊ īŋŊPīŋŊīŋŊ n īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 3. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊxīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƂīŋŊīŋŊīŋŊ īŋŊPīŋŊīŋŊ n īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB īŋŊtīŋŊīŋŊīŋŊīŋŊīŋŊɌīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƂīŋŊīŋŊīŋŊ N īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB 4. īŋŊtīŋŊīŋŊīŋŊīŋŊīŋŊɌīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊꍇīŋŊ́A/ īŋŊĖ‘īŋŊīŋŊīŋŊīŋŊ ? īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 5. īŋŊīŋŊīŋŊĖęŠīŋŊɖ߂īŋŊɂīŋŊ CTRL-O (Ctrl īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȂīŋŊīŋŊīŋŊ o īŋŊīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊv)īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊ + 5. īŋŊīŋŊīŋŊĖęŠīŋŊɖ߂īŋŊɂīŋŊ CTRL-O (Ctrl īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊȂīŋŊīŋŊį•ļīŋŊīŋŊ o īŋŊīŋŊīŋŊ^īŋŊCīŋŊv)īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊ īŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊɖ߂īŋŊɂ͂īŋŊīŋŊīŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊ܂īŋŊīŋŊBCTRL-I īŋŊ͑OīŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊīŋŊB ---> "errroor" īŋŊīŋŊ error īŋŊƃXīŋŊyīŋŊīŋŊīŋŊīŋŊīŋŊá‚ĸīŋŊ܂īŋŊ; errroor īŋŊ͂īŋŊīŋŊīŋŊīŋŊīŋŊ error īŋŊłīŋŊīŋŊB @@ -531,7 +533,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 4.3: īŋŊΉīŋŊīŋŊīŋŊīŋŊ銇īŋŊʂīŋŊīŋŊīŋŊīŋŊīŋŊ - ** īŋŊΉīŋŊīŋŊīŋŊīŋŊīŋŊ ),] īŋŊīŋŊ } īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ % īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊΉīŋŊīŋŊīŋŊīŋŊīŋŊ ),] īŋŊīŋŊ } īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ % īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊīŋŊīŋŊīŋŊ ---> īŋŊŎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊīŋŊ (,[ īŋŊīŋŊ { īŋŊĖ‚Į‚ꂊīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -554,7 +556,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 4.4: īŋŊԈá‚ĸīŋŊīŋŊĪXīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ@ - ** 'old' īŋŊīŋŊ 'new' īŋŊɒuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :s/old/new/g īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** 'old' īŋŊīŋŊ 'new' īŋŊɒuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :s/old/new/g īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -567,9 +569,8 @@ NOTE: ---> thee best time to see thee flowers is in thee spring. - 4. īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊįŒŠīŋŊ‚īŋŊīŋŊé•ļīŋŊīŋŊīŋŊīŋŊĪXīŋŊīŋŊīŋŊīŋŊɂīŋŊ - :#,#s/old/new/g #,# īŋŊɂ͒uīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÍˆÍ‚ĖŠJīŋŊnīŋŊƏIīŋŊīŋŊīŋŊĖsīŋŊԍīŋŊīŋŊīŋŊīŋŊwīŋŊč‚ĩīŋŊīŋŊ - īŋŊīŋŊīŋŊB + 4. īŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊįŒŠīŋŊ‚īŋŊīŋŊé•ļīŋŊīŋŊīŋŊĖ‘SīŋŊÄ‚Ė‰ĶīŋŊīŋŊīŋŊĪXīŋŊīŋŊīŋŊīŋŊɂīŋŊ + :#,#s/old/new/g #,# īŋŊɂ͒uīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÍˆÍ‚ĖŠJīŋŊnīŋŊƏIīŋŊīŋŊīŋŊĖsīŋŊԍīŋŊīŋŊīŋŊīŋŊwīŋŊ肷īŋŊīŋŊB :%s/old/new/g īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊSīŋŊĖ‚ÅŒīŋŊīŋŊ‚īŋŊīŋŊīŋŊīŋŊīŋŊĖ‚É‘Î‚īŋŊīŋŊÄ•ĪXīŋŊīŋŊīŋŊīŋŊB :%s/old/new/gc īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊSīŋŊĖ‚ÅŒīŋŊīŋŊ‚īŋŊīŋŊīŋŊīŋŊīŋŊĖ‚É‘Î‚īŋŊīŋŊāA1īŋŊīŋŊ1īŋŊŠmīŋŊFīŋŊīŋŊīŋŊƂīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊĪXīŋŊīŋŊīŋŊīŋŊB @@ -593,7 +594,7 @@ NOTE: 4. īŋŊīŋŊīŋŊŨsīŋŊĖÅīŋŊīŋŊīŋŊ old īŋŊīŋŊ new īŋŊɒuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊB :s/old/new īŋŊīŋŊīŋŊŨsīŋŊĖ‘SīŋŊĂīŋŊ old īŋŊīŋŊ new īŋŊɒuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊB :s/old/new/g - 2īŋŊ‚īŋŊ # īŋŊԂŌīŋŊīŋŊīŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊB :#,#s/old/new/g + 2īŋŊ‚īŋŊ # īŋŊsīŋŊĖŠÔ‚ÅŒīŋŊīŋŊīŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊB :#,#s/old/new/g īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ’īŋŊīŋŊĖ‘SīŋŊÄ‚ĖŒīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊB :%s/old/new/g 'c' īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƒuīŋŊīŋŊīŋŊĖ“xīŋŊɊmīŋŊFīŋŊīŋŊīŋŊīŋŊīŋŊ߂īŋŊB :%s/old/new/gc @@ -601,10 +602,10 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 5.1: īŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ@ - ** :! īŋŊˌīŋŊɎīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** :! īŋŊˌīŋŊɎīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊīŋŊĘ‚ĖÅ‰īŋŊīŋŊīŋŊīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊ悤īŋŊAīŋŊīŋŊīŋŊīŋŊeīŋŊīŋŊīŋŊīŋŊ : īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB - īŋŊīŋŊīŋŊīŋŊŃRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊłīŋŊīŋŊīŋŊlīŋŊɂȂīŋŊ܂īŋŊīŋŊB + īŋŊīŋŊīŋŊīŋŊŃRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊ߂īŋŊīŋŊ^īŋŊCīŋŊvīŋŊłīŋŊīŋŊīŋŊlīŋŊɂȂīŋŊ܂īŋŊīŋŊB 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ ! īŋŊƂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ(īŋŊīŋŊīŋŊQīŋŊīŋŊ)īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB īŋŊīŋŊīŋŊīŋŊŊOīŋŊīŋŊīŋŊVīŋŊFīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊłīŋŊīŋŊīŋŊlīŋŊɂȂīŋŊ܂īŋŊīŋŊB @@ -624,7 +625,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 5.2: īŋŊīŋŊīŋŊĖ‘īŋŊīŋŊ˃tīŋŊ@īŋŊCīŋŊīŋŊīŋŊ֏īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ - ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊÖ•ĪXīŋŊīŋŊۑīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :w īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊÖ•ĪXīŋŊīŋŊۑīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :w īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊfīŋŊBīŋŊīŋŊīŋŊNīŋŊgīŋŊīŋŊīŋŊĖˆę——īŋŊ𓾂é‚ŊīŋŊ߂īŋŊ :!dir īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :!ls īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB īŋŊīŋŊīŋŊĖ‚īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‚ÍŠīŋŊīŋŊɂīŋŊīŋŊīŋŊīŋŊmīŋŊłīŋŊīŋŊˁB @@ -634,7 +635,7 @@ NOTE: 3. īŋŊłīŋŊ :w TEST īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤 (TEST īŋŊ́AīŋŊIīŋŊņ‚žƒtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊ)īŋŊB 4. īŋŊīŋŊīŋŊīŋŊɂīŋŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊSīŋŊĖ‚īŋŊ TEST īŋŊƂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊOīŋŊŕۑīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊx :!dir īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :!ls īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĊmīŋŊFīŋŊīŋŊīŋŊĂŨ‚Ü‚īŋŊīŋŊ傤īŋŊB + īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊx :!dir īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :!ls īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊăfīŋŊBīŋŊīŋŊīŋŊNīŋŊgīŋŊīŋŊīŋŊīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊĂŨ‚Ü‚īŋŊīŋŊ傤īŋŊB NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊīŋŊIīŋŊīŋŊīŋŊīŋŊīŋŊAīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ TEST īŋŊƋīŋŊīŋŊɋNīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƁAīŋŊۑīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ`īŋŊīŋŊīŋŊ[īŋŊgīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊīŋŊã‚ĒīŋŊīŋŊ͂īŋŊīŋŊłīŋŊīŋŊB @@ -647,7 +648,7 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 5.3: īŋŊIīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ -** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖˆĘ’uīŋŊīŋŊۑīŋŊīŋŊīŋŊīŋŊīŋŊɂ́Av īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :w FILENAME īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** +** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖˆę•”īŋŊīŋŊۑīŋŊīŋŊīŋŊīŋŊīŋŊɂ́Av īŋŊīŋŊīŋŊ[īŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :w FILENAME īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -660,20 +661,20 @@ NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊOīŋŊīŋŊ :'<,'>w TEST īŋŊÆ‚Č‚īŋŊīŋŊĂīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊĉīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊB 5. Vim īŋŊīŋŊ TEST īŋŊƂīŋŊīŋŊīŋŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊɑIīŋŊīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŪ‚Å‚īŋŊīŋŊ傤īŋŊB - !dir īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ !ls īŋŊłīŋŊīŋŊīŋŊīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + :!dir īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ :!ls īŋŊłīŋŊīŋŊīŋŊīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊ܂īŋŊīŋŊB īŋŊīŋŊīŋŊīŋŊ͍폜īŋŊīŋŊīŋŊȂīŋŊīŋŊłīŋŊīŋŊīŋŊīŋŊĉīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊBīŋŊīŋŊīŋŊ˃īŋŊīŋŊbīŋŊXīŋŊīŋŊīŋŊŎgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊīŋŊB NOTE: v īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƁAVisual īŋŊIīŋŊīŋŊīŋŊīŋŊīŋŊnīŋŊ܂īŋŊ܂īŋŊīŋŊBīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊ𓮂īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƂŁAīŋŊIīŋŊīŋŊ͈͂īŋŊ īŋŊå‚ĢīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊɁAīŋŊīŋŊīŋŊĖ‘IīŋŊīŋŊ͈͂ɑ΂īŋŊīŋŊăIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊīŋŊKīŋŊp - īŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊá‚ĻīŋŊīŋŊ d īŋŊ̓eīŋŊLīŋŊXīŋŊgīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB + īŋŊłīŋŊīŋŊ܂īŋŊīŋŊBīŋŊá‚ĻīŋŊīŋŊ d īŋŊ̓eīŋŊLīŋŊXīŋŊgīŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 5.4: īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖŽæžīŋŊƍīŋŊīŋŊīŋŊ - ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ’īŋŊīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :r īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ’īŋŊīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ :r īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** - 1. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊȉīŋŊīŋŊĖsīŋŊɍīŋŊīŋŊ킹īŋŊ܂īŋŊīŋŊB + 1. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖsīŋŊĖ‚īŋŊīŋŊīŋŊīŋŊīŋŊɍīŋŊīŋŊ킹īŋŊ܂īŋŊīŋŊB NOTE: īŋŊXīŋŊeīŋŊbīŋŊv 2 īŋŊĖŽīŋŊīŋŊsīŋŊīŋŊAīŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 5.3 īŋŊ˃eīŋŊLīŋŊXīŋŊgīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊɉīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĂīŋŊ īŋŊ˃īŋŊīŋŊbīŋŊXīŋŊīŋŊīŋŊɈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -682,19 +683,18 @@ NOTE: īŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊīŋŊīŋŊ TEST īŋŊ͎gīŋŊīŋŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ–īŋŊīŋŊOīŋŊĖ‚īŋŊīŋŊƂłīŋŊīŋŊB īŋŊĮ‚ŨīŋŊīŋŊ܂ę‚ŊīŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊ́AīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊsīŋŊˉīŋŊīŋŊɂīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 3. īŋŊ捞īŋŊņ‚žƒtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊĂŨ‚Ü‚īŋŊīŋŊ傤īŋŊBīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊ߂īŋŊīŋŊƁAīŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ5.3 īŋŊīŋŊ + 3. īŋŊīŋŊ荞īŋŊņ‚žƒtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊīŋŊmīŋŊFīŋŊīŋŊīŋŊĂŨ‚Ü‚īŋŊīŋŊ傤īŋŊBīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊ߂īŋŊīŋŊƁAīŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ5.3 īŋŊīŋŊ īŋŊIīŋŊīŋŊīŋŊWīŋŊiīŋŊīŋŊīŋŊƃtīŋŊ@īŋŊCīŋŊīŋŊīŋŊɂīŋŊīŋŊīŋŊīŋŊĖ‚īŋŊ2īŋŊ‚īŋŊīŋŊīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊ킩īŋŊīŋŊ܂īŋŊīŋŊB -NOTE: īŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊĖoīŋŊ͂īŋŊĮ‚ŨīŋŊīŋŊŪ‚īŋŊīŋŊƂīŋŊīŋŊoīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊá‚ĻīŋŊ΁A +NOTE: īŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊĖoīŋŊ͂īŋŊĮ‚ŨīŋŊīŋŊŪ‚īŋŊīŋŊƂīŋŊīŋŊłīŋŊīŋŊ܂īŋŊīŋŊBīŋŊá‚ĻīŋŊ΁A :r !ls īŋŊīŋŊ ls īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊĖoīŋŊ͂īŋŊīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊȉīŋŊīŋŊɓĮ‚ŨīŋŊīŋŊŨ‚Ü‚īŋŊīŋŊB - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 5 īŋŊvīŋŊīŋŊ - 1. :!command īŋŊɂīŋŊīŋŊīŋŊīŋŊ īŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 1. :!command īŋŊɂīŋŊīŋŊīŋŊīŋŊ īŋŊOīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊīŋŊīŋŊīŋŊB īŋŊ悭īŋŊgīŋŊīŋŊīŋŊīŋŊ: (Windows) (Unix) @@ -717,13 +717,14 @@ NOTE: īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 6.1: īŋŊIīŋŊ[īŋŊvīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** o īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƁAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖsīŋŊīŋŊīŋŊJīŋŊīŋŊīŋŊAīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊīŋŊ܂īŋŊ ** + ** o īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƁAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖsīŋŊīŋŊīŋŊJīŋŊīŋŊīŋŊAīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB 2. o (īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ) īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊāAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊˉīŋŊīŋŊĖsīŋŊīŋŊīŋŊJīŋŊīŋŊīŋŊAīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 3. īŋŊīŋŊīŋŊīŋŊɑ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊīŋŊīŋŊIīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊׂīŋŊ īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + 3. īŋŊīŋŊīŋŊīŋŊīŋŊ‚īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊAīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊīŋŊīŋŊIīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊׂīŋŊ īŋŊīŋŊ + īŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ---> o īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊ͊JīŋŊīŋŊīŋŊīŋŊīŋŊsīŋŊֈړīŋŊīŋŊīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -735,12 +736,11 @@ NOTE: - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 6.2: īŋŊĮ‰īŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊh - ** īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊĖŽīŋŊīŋŊĖˆĘ’uīŋŊīŋŊīŋŊīŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊĮ‰īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ a īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊĖŽīŋŊīŋŊĖˆĘ’uīŋŊīŋŊīŋŊīŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊĮ‰īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ a īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊ ---> īŋŊŎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊŏīŋŊīŋŊĖsīŋŊֈړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB @@ -763,7 +763,7 @@ NOTE: a, i īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 6.3: īŋŊīŋŊīŋŊĖ‘īŋŊīŋŊĖ’uīŋŊīŋŊīŋŊīŋŊīŋŊ@ - ** 1īŋŊīŋŊīŋŊīŋŊīŋŊȏīŋŊīŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂ͑å•ļīŋŊīŋŊīŋŊīŋŊ R īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤 ** + ** 1īŋŊīŋŊīŋŊīŋŊīŋŊȏīŋŊīŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂ͑å•ļīŋŊīŋŊīŋŊīŋŊ R īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤īŋŊB ** 1. īŋŊȉīŋŊīŋŊīŋŊ ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊŏīŋŊīŋŊīŋŊ xxx īŋŊːæ“ĒīŋŊɈړīŋŊīŋŊīŋŊ īŋŊ܂īŋŊīŋŊB @@ -781,12 +781,11 @@ NOTE: a, i NOTE: īŋŊuīŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊ͑}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɎīŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊīŋŊīŋŊAīŋŊSīŋŊÄ‚Ėƒ^īŋŊCīŋŊvīŋŊīŋŊīŋŊę‚ŊīŋŊīŋŊīŋŊīŋŊīŋŊ͊īŋŊīŋŊīŋŊīŋŊĖ•īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ폜īŋŊīŋŊīŋŊ܂īŋŊīŋŊB - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 6.4: īŋŊeīŋŊLīŋŊXīŋŊgīŋŊ˃RīŋŊsīŋŊ[īŋŊƃyīŋŊ[īŋŊXīŋŊg - ** īŋŊeīŋŊLīŋŊXīŋŊgīŋŊ˃RīŋŊsīŋŊ[īŋŊɂ̓IīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^ y īŋŊīŋŊīŋŊAīŋŊyīŋŊ[īŋŊXīŋŊgīŋŊɂīŋŊ p īŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊ܂īŋŊ ** + ** īŋŊeīŋŊLīŋŊXīŋŊgīŋŊ˃RīŋŊsīŋŊ[īŋŊɂ̓IīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^ y īŋŊīŋŊīŋŊAīŋŊyīŋŊ[īŋŊXīŋŊgīŋŊɂīŋŊ p īŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊ܂īŋŊīŋŊB ** 1. ---> īŋŊƎīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊsīŋŊֈړīŋŊīŋŊīŋŊīŋŊAīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊ "a)" īŋŊˌīŋŊɒuīŋŊīŋŊīŋŊĂīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -804,12 +803,13 @@ NOTE: ---> a) this is the first item. b) - NOTE: īŋŊPīŋŊīŋŊīŋŊ1īŋŊīŋŊ yank īŋŊīŋŊīŋŊīŋŊĖ‚īŋŊ y īŋŊīŋŊīŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊƂīŋŊīŋŊīŋŊ yw īŋŊƂīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊoīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + NOTE: y īŋŊīŋŊīŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊƂīŋŊīŋŊĎgīŋŊīŋŊīŋŊīŋŊīŋŊƂīŋŊīŋŊłīŋŊīŋŊ܂īŋŊīŋŊByw īŋŊ͒PīŋŊīŋŊīŋŊ1īŋŊīŋŊ yank īŋŊīŋŊīŋŊ܂īŋŊīŋŊB + yy īŋŊ͍sīŋŊīŋŊ1īŋŊīŋŊ yank īŋŊīŋŊīŋŊAp īŋŊłīŋŊīŋŊĖsīŋŊīŋŊ put īŋŊīŋŊīŋŊ܂īŋŊīŋŊB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 6.5: īŋŊIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊːŨ’īŋŊ - ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊuīŋŊīŋŊīŋŊĖÛ‚É‘å•ļīŋŊīŋŊ/īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊđ–ŗŽīŋŊīŋŊīŋŊīŋŊīŋŊɂ́AīŋŊIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŨ’č‚ĩīŋŊ܂īŋŊ ** + ** īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊuīŋŊīŋŊīŋŊĖÛ‚É‘å•ļīŋŊīŋŊ/īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊđ–ŗŽīŋŊīŋŊīŋŊīŋŊīŋŊɂ́AīŋŊIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŨ’č‚ĩīŋŊ܂īŋŊīŋŊB ** 1. īŋŊīŋŊīŋŊĖ—līŋŊɓīŋŊīŋŊ͂īŋŊīŋŊīŋŊ 'ignore' īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊ傤: /ignore n īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĉīŋŊīŋŊxīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊJīŋŊīŋŊԂīŋŊīŋŊ܂īŋŊīŋŊB @@ -826,7 +826,7 @@ NOTE: 6. īŋŊå•ļīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‹īŋŊĘ‚đ–ŗŒīŋŊīŋŊɂīŋŊīŋŊīŋŊɂ͎īŋŊīŋŊĖ—līŋŊɓīŋŊīŋŊ͂īŋŊīŋŊ܂īŋŊ: :set noic NOTE: īŋŊ}īŋŊbīŋŊ`īŋŊĖ‹īŋŊīŋŊīŋŊīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ߂īŋŊɂ͎īŋŊīŋŊĖ—līŋŊɓīŋŊīŋŊ͂īŋŊīŋŊ܂īŋŊ: :nohlsearch -NOTE: 1īŋŊÂ‚ĖŒīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊå•ļīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‹īŋŊʂīŋŊīŋŊīŋŊ߂īŋŊīŋŊīŋŊīŋŊȂīŋŊ΁AīŋŊtīŋŊīŋŊīŋŊ[īŋŊYīŋŊīŋŊ \c +NOTE: 1īŋŊÂ‚ĖŒīŋŊīŋŊīŋŊīŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊīŋŊīŋŊīŋŊīŋŊå•ļīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‹īŋŊʂīŋŊīŋŊīŋŊ߂īŋŊīŋŊīŋŊīŋŊȂīŋŊ΁AīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ \c īŋŊīŋŊīŋŊgīŋŊpīŋŊīŋŊīŋŊ܂īŋŊ: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 6 īŋŊvīŋŊīŋŊ @@ -835,13 +835,13 @@ NOTE: 1 O (īŋŊå•ļīŋŊīŋŊ) īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊĖīŋŊĖsīŋŊő}īŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɂȂīŋŊB 2. īŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊĖ•īŋŊīŋŊīŋŊīŋŊĖŽīŋŊīŋŊīŋŊīŋŊīŋŊeīŋŊLīŋŊXīŋŊgīŋŊīŋŊĮ‰īŋŊīŋŊīŋŊīŋŊīŋŊɂīŋŊ a īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊB - īŋŊsīŋŊīŋŊīŋŊɎīŋŊīŋŊīŋŊīŋŊŃeīŋŊLīŋŊXīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂ͑å•ļīŋŊīŋŊ A īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊB + īŋŊsīŋŊīŋŊīŋŊɃeīŋŊLīŋŊXīŋŊgīŋŊīŋŊ}īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɂ͑å•ļīŋŊīŋŊ A īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊB - 3. e īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊ͒PīŋŊīŋŊĖIīŋŊ[īŋŊīŋŊīŋŊJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊB + 3. e īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊ͒PīŋŊīŋŊĖIīŋŊ[īŋŊɃJīŋŊ[īŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊړīŋŊīŋŊīŋŊīŋŊīŋŊB 4. y īŋŊIīŋŊyīŋŊīŋŊīŋŊ[īŋŊ^īŋŊ̓eīŋŊLīŋŊXīŋŊgīŋŊīŋŊ yank (īŋŊRīŋŊsīŋŊ[)īŋŊīŋŊīŋŊAp īŋŊ͂īŋŊīŋŊīŋŊīŋŊ put (īŋŊyīŋŊ[īŋŊXīŋŊg)īŋŊīŋŊīŋŊīŋŊB - 5. īŋŊå•ļīŋŊīŋŊīŋŊīŋŊ R īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƒuīŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊīŋŊAīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƔīŋŊīŋŊīŋŊīŋŊīŋŊB + 5. īŋŊå•ļīŋŊīŋŊīŋŊīŋŊ R īŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƒuīŋŊīŋŊīŋŊīŋŊīŋŊ[īŋŊhīŋŊɓīŋŊīŋŊīŋŊA īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƔīŋŊīŋŊīŋŊīŋŊīŋŊB 6. ":set xxx" īŋŊƃ^īŋŊCīŋŊvīŋŊīŋŊīŋŊīŋŊƃIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊ "xxx" īŋŊīŋŊīŋŊŨ’肺īŋŊīŋŊīŋŊB 'ic' 'ignorecase' īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊɑå•ļīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĖ‹īŋŊʂīŋŊīŋŊȂīŋŊ @@ -849,7 +849,7 @@ NOTE: 1 'hls' 'hlsearch' īŋŊ}īŋŊbīŋŊ`īŋŊīŋŊīŋŊ邷īŋŊׂĂīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊAīŋŊZīŋŊīŋŊīŋŊīŋŊīŋŊAīŋŊĮ‚īŋŊīŋŊīŋŊ˃IīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊłīŋŊīŋŊgīŋŊpīŋŊłīŋŊīŋŊ܂īŋŊīŋŊB - 7. īŋŊIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊđ–ŗŒīŋŊīŋŊɂīŋŊīŋŊīŋŊɂīŋŊ "no" īŋŊīŋŊtīŋŊ^īŋŊīŋŊīŋŊ܂īŋŊ: :set noic + 7. īŋŊIīŋŊvīŋŊVīŋŊīŋŊīŋŊīŋŊīŋŊđ–ŗŒīŋŊīŋŊɂīŋŊīŋŊīŋŊɂīŋŊ "no" īŋŊīŋŊtīŋŊ^īŋŊīŋŊīŋŊīŋŊ: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ īŋŊīŋŊīŋŊbīŋŊXīŋŊīŋŊ 7.1: īŋŊIīŋŊīŋŊīŋŊīŋŊīŋŊCīŋŊīŋŊīŋŊwīŋŊīŋŊīŋŊvīŋŊRīŋŊ}īŋŊīŋŊīŋŊh @@ -883,15 +883,15 @@ NOTE: 1 īŋŊgīŋŊpīŋŊsīŋŊÂ‚Æ‚Č‚īŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊč‘ŊīŋŊīŋŊīŋŊĖ“īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊ͂īŋŊīŋŊ߂īŋŊɂīŋŊ "vimrc" īŋŊtīŋŊ@īŋŊCīŋŊīŋŊ īŋŊīŋŊīŋŊėŦīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 1. "vimrc" īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ•ŌWīŋŊīŋŊīŋŊJīŋŊnīŋŊīŋŊīŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊ̓VīŋŊXīŋŊeīŋŊīŋŊīŋŊɈˑīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - :edit ~/.vimrc UNIX īŋŊīŋŊīŋŊīŋŊ - :edit $VIM/_vimrc Windows īŋŊīŋŊīŋŊīŋŊ + 1. "vimrc" īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊĖ•ŌWīŋŊīŋŊīŋŊJīŋŊnīŋŊīŋŊīŋŊ܂īŋŊīŋŊBīŋŊīŋŊīŋŊīŋŊ̓VīŋŊXīŋŊeīŋŊīŋŊīŋŊɈˑīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB + :e ~/.vimrc UNIX īŋŊīŋŊīŋŊīŋŊ + :e ~/_vimrc Windows īŋŊīŋŊīŋŊīŋŊ 2. īŋŊīŋŊīŋŊīŋŊīŋŊŃTīŋŊīŋŊīŋŊvīŋŊīŋŊīŋŊīŋŊ "vimrc" īŋŊīŋŊĮ‚ŨīŋŊīŋŊŨ‚Ü‚īŋŊīŋŊB - :read $VIMRUNTIME/vimrc_example.vim + :r $VIMRUNTIME/vimrc_example.vim 3. īŋŊȉīŋŊīŋŊĖ‚æ‚¤īŋŊɃtīŋŊ@īŋŊCīŋŊīŋŊīŋŊ֏īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŨ‚Ü‚īŋŊīŋŊB - :write + :w īŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊīŋŊNīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊƁAīŋŊFīŋŊÂīŋŊīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊgīŋŊīŋŊīŋŊīŋŊ悤īŋŊɂȂīŋŊłīŋŊīŋŊ傤īŋŊB īŋŊīŋŊīŋŊīŋŊ "vimrc" īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊցAīŋŊīŋŊīŋŊDīŋŊŨ‚ːŨ’īŋŊīŋŊĮ‰īŋŊīŋŊīŋŊīŋŊ邱īŋŊƂīŋŊīŋŊłīŋŊīŋŊ܂īŋŊīŋŊB @@ -907,7 +907,7 @@ NOTE: 1 2. īŋŊīŋŊīŋŊŨ‚ĖƒfīŋŊBīŋŊīŋŊīŋŊNīŋŊgīŋŊīŋŊīŋŊɍŨ‚īŋŊtīŋŊ@īŋŊCīŋŊīŋŊīŋŊīŋŊ :!ls īŋŊīŋŊ :!dir īŋŊŊmīŋŊFīŋŊīŋŊīŋŊ܂īŋŊīŋŊB - 3. īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊˊJīŋŊnīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ: :e + 3. īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊːæ“ĒīŋŊīŋŊīŋŊ^īŋŊCīŋŊvīŋŊīŋŊīŋŊ܂īŋŊ: :e 4. CTRL-D īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊ "e" īŋŊīŋŊīŋŊīŋŊnīŋŊ܂īŋŊRīŋŊ}īŋŊīŋŊīŋŊhīŋŊĖˆę——īŋŊīŋŊ\īŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊB @@ -955,7 +955,7 @@ NOTE: īŋŊoīŋŊŎīŋŊ: New Riders īŋŊŏīŋŊīŋŊĖ–{īŋŊ͊īŋŊīŋŊSīŋŊīŋŊ Vim īŋŊĖ‚īŋŊīŋŊ߂ɏīŋŊīŋŊīŋŊīŋŊīŋŊ܂īŋŊīŋŊīŋŊīŋŊBīŋŊƂīŋŊ킯īŋŊīŋŊīŋŊSīŋŊŌ‚É‚Í‚īŋŊīŋŊīŋŊīŋŊ߂łīŋŊīŋŊB īŋŊīŋŊīŋŊīŋŊīŋŊĖ—īŋŊīŋŊīŋŊ}īŋŊłīŋŊīŋŊfīŋŊڂīŋŊīŋŊīŋŊĂīŋŊīŋŊ܂īŋŊīŋŊB - īŋŊīŋŊīŋŊīŋŊURLīŋŊīŋŊīŋŊQīŋŊƂīŋŊīŋŊĉīŋŊīŋŊīŋŊīŋŊīŋŊ http://iccf-holland.org/click5.html + īŋŊīŋŊīŋŊīŋŊURLīŋŊīŋŊīŋŊQīŋŊƂīŋŊīŋŊĉīŋŊīŋŊīŋŊīŋŊīŋŊ https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊīŋŊīŋŊ Vi īŋŊɂ‚īŋŊīŋŊďīŋŊīŋŊīŋŊīŋŊę‚ŊīŋŊÂīŋŊīŋŊ{īŋŊłīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊEīŋŊīŋŊīŋŊ܂īŋŊ: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.ja.utf-8 b/runtime/tutor/tutor.ja.utf-8 index a604d9ac5de4a..8eaa72cf0550b 100644 --- a/runtime/tutor/tutor.ja.utf-8 +++ b/runtime/tutor/tutor.ja.utf-8 @@ -8,7 +8,7 @@ ãĢãĒãŖãĻいぞす。 チãƒĨãƒŧトãƒĒã‚ĸãƒĢを厌äē†ã™ã‚‹ãŽãĢåŋ…čρãĒ時間は、čĻšãˆãŸã‚ŗãƒžãƒŗãƒ‰ã‚’čŠĻすぎãĢおれだ - け時間をäŊŋうぎかãĢもよりぞすが、およそ25から30分です。 + け時間をäŊŋうぎかãĢもよりぞすが、およそ30分です。 ATTENTION: äģĨä¸‹ãŽįˇ´įŋ’į”¨ã‚ŗãƒžãƒŗãƒ‰ãĢはこぎ文įĢ ã‚’å¤‰æ›´ã™ã‚‹ã‚‚ãŽã‚‚ã‚ã‚Šãžã™ã€‚įˇ´įŋ’を始める前 @@ -24,7 +24,7 @@ ãƒŦãƒƒã‚šãƒŗ 1.1: ã‚Ģãƒŧã‚ŊãƒĢぎį§ģ動 - ** ã‚Ģãƒŧã‚ŊãƒĢをį§ģ動するãĢは、į¤ēされる様ãĢ h,j,k,l をæŠŧしぞす ** + ** ã‚Ģãƒŧã‚ŊãƒĢをį§ģ動するãĢは、į¤ēされる様ãĢ h,j,k,l をæŠŧしぞす。 ** ^ k ãƒ’ãƒŗãƒˆ: h キãƒŧはåˇĻ斚向ãĢį§ģ動しぞす。 < h l > l キãƒŧã¯åŗæ–šå‘ãĢį§ģ動しぞす。 @@ -65,11 +65,12 @@ NOTE: :q! は全ãĻãŽå¤‰æ›´ã‚’į ´æŖ„ã—ãžã™ã€‚ãƒŦãƒƒã‚šãƒŗãĢãĻ変 5. 1.3ぞでã‚Ģãƒŧã‚ŊãƒĢをį§ģ動させぞしょう。 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 1.3: ãƒ†ã‚­ã‚šãƒˆįˇ¨é›† - 削除 - ** ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻã‚Ģãƒŧã‚ŊãƒĢぎ下ぎ文字を削除するãĢは x をæŠŧしぞす ** + ** ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻã‚Ģãƒŧã‚ŊãƒĢぎ下ぎ文字を削除するãĢは x をæŠŧしぞす。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -87,12 +88,11 @@ NOTE: 全ãĻぎãƒŦãƒƒã‚šãƒŗã‚’é€šã˜ãĻ、čĻšãˆã‚ˆã†ã¨ã™ã‚‹ãŽã§ã¯ãĒく - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 1.4: ãƒ†ã‚­ã‚šãƒˆįˇ¨é›† - æŒŋå…Ĩ - ** ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻテキ゚トをæŒŋå…ĨするãĢは i をæŠŧしぞす ** + ** ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻテキ゚トをæŒŋå…ĨするãĢは i をæŠŧしぞす。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -115,10 +115,10 @@ NOTE: 全ãĻぎãƒŦãƒƒã‚šãƒŗã‚’é€šã˜ãĻ、čĻšãˆã‚ˆã†ã¨ã™ã‚‹ãŽã§ã¯ãĒく ãƒŦãƒƒã‚šãƒŗ 1.5: ãƒ†ã‚­ã‚šãƒˆįˇ¨é›† - čŋŊ加 - ** テキ゚トをčŋŊ加するãĢは A をæŠŧしぞしょう ** + ** テキ゚トをčŋŊ加するãĢは A をæŠŧしぞしょう。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 - ã‚Ģãƒŧã‚ŊãƒĢがそぎ文字上ãĢã‚ãŖãĻもかぞいぞせん。 + ã‚Ģãƒŧã‚ŊãƒĢãŒããŽčĄŒãŽãŠãŽæ–‡å­—ä¸ŠãĢã‚ãŖãĻもかぞいぞせん。 2. čŋŊ加がåŋ…čρãĒ場所で A をã‚ŋイプしぞしょう。 @@ -137,18 +137,17 @@ NOTE: 全ãĻぎãƒŦãƒƒã‚šãƒŗã‚’é€šã˜ãĻ、čĻšãˆã‚ˆã†ã¨ã™ã‚‹ãŽã§ã¯ãĒく ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 1.6: ãƒ•ã‚Ąã‚¤ãƒĢãŽįˇ¨é›† - - ** ãƒ•ã‚Ąã‚¤ãƒĢをäŋå­˜ã—ãĻįĩ‚äē†ã™ã‚‹ãĢは :wq とã‚ŋイプしぞす ** + ** ãƒ•ã‚Ąã‚¤ãƒĢをäŋå­˜ã—ãĻįĩ‚äē†ã™ã‚‹ãĢは :wq とã‚ŋイプしぞす。 ** !! NOTE: äģĨä¸‹ãŽã‚šãƒ†ãƒƒãƒ—ã‚’åŽŸčĄŒã™ã‚‹å‰ãĢ、ぞず全äŊ“ã‚’čĒ­ã‚“ã§ãã ã•ã„!! - 1. ãƒŦãƒƒã‚šãƒŗ 1.2 ã§ã‚„ãŖãŸã‚ˆã†ãĢ :q! をã‚ŋイプしãĻ、こぎチãƒĨãƒŧトãƒĒã‚ĸãƒĢをįĩ‚äē† - しぞす。あるいは、åˆĨぎį̝æœĢがある場合はそこでäģĨä¸‹ãŽå†…åŽšã‚’čĄŒãŖãĻもかぞい - ぞせん。 + 1. åˆĨぎį̝æœĢがある場合はそこでäģĨä¸‹ãŽå†…åŽšã‚’čĄŒãŖãĻください。そうでãĒければ、 + ãƒŦãƒƒã‚šãƒŗ 1.2 ã§ã‚„ãŖãŸã‚ˆã†ãĢ :q! をã‚ŋイプしãĻ、こぎチãƒĨãƒŧトãƒĒã‚ĸãƒĢをįĩ‚äē† + しぞす。 - 2. ã‚ˇã‚§ãƒĢãƒ—ãƒ­ãƒŗãƒ—ãƒˆã§ã“ãŽã‚ŗãƒžãƒŗãƒ‰ã‚’ã‚ŋイプしぞす: vim tutor - 'vim' が Vim ã‚¨ãƒ‡ã‚Ŗã‚ŋをčĩˇå‹•ã™ã‚‹ã‚ŗãƒžãƒŗãƒ‰ã€'tutor' ã¯įˇ¨é›†ã—ãŸã„ãƒ•ã‚Ąã‚¤ãƒĢぎ - 名前です。変更しãĻã‚‚ã‚ˆã„ãƒ•ã‚Ąã‚¤ãƒĢをäŊŋいぞしょう。 + 2. ã‚ˇã‚§ãƒĢãƒ—ãƒ­ãƒŗãƒ—ãƒˆã§ã“ãŽã‚ŗãƒžãƒŗãƒ‰ã‚’ã‚ŋイプしぞす: vim file.txt + 'vim' が Vim ã‚¨ãƒ‡ã‚Ŗã‚ŋをčĩˇå‹•ã™ã‚‹ã‚ŗãƒžãƒŗãƒ‰ã€'file.txt' ã¯įˇ¨é›†ã—ãŸã„ãƒ•ã‚Ąã‚¤ãƒĢ + ãŽåå‰ã§ã™ã€‚å¤‰æ›´ã§ãã‚‹ãƒ•ã‚Ąã‚¤ãƒĢぎ名前をäŊŋいぞしょう。 3. 前ぎãƒŦãƒƒã‚šãƒŗã§å­ĻんだようãĢ、テキ゚トをæŒŋå…Ĩ、削除しぞす。 @@ -186,9 +185,9 @@ NOTE: キãƒŧをæŠŧすとノãƒŧマãƒĢãƒĸãƒŧドãĢį§ģčĄŒã—ãžã™ã€‚ããŽ ãƒŦãƒƒã‚šãƒŗ 2.1: å‰Šé™¤ã‚ŗãƒžãƒŗãƒ‰ - ** 単čĒžãŽæœĢ尞ぞでを削除するãĢは dw とã‚ŋイプしぞしょう ** + ** 単čĒžãŽæœĢ尞ぞでを削除するãĢは dw とã‚ŋイプしぞしょう。 ** - 1. ノãƒŧマãƒĢãƒĸãƒŧドであることをįĸēčĒã™ã‚‹ãŸã‚ãĢ をæŠŧしぞしょう。 + 1. įĸē原ãĢノãƒŧマãƒĢãƒĸãƒŧドãĢするため をæŠŧしぞしょう。 2. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -196,22 +195,22 @@ NOTE: キãƒŧをæŠŧすとノãƒŧマãƒĢãƒĸãƒŧドãĢį§ģčĄŒã—ãžã™ã€‚ããŽ 4. 単čĒžã‚’å‰Šé™¤ã™ã‚‹ãŸã‚ãĢ dw とã‚ŋイプしぞしょう。 - NOTE: ã‚ŋイプすると、dw という文字が゚クãƒĒãƒŧãƒŗãŽæœ€ä¸‹čĄŒãĢįžã‚ã‚Œãžã™ã€‚ - ã‚ŋã‚¤ãƒ—ã‚’é–“é•ãŖãĻã—ãžãŖãŸæ™‚ãĢは をæŠŧしãĻã‚„ã‚Šį›´ã—ãžã—ã‚‡ã†ã€‚ + NOTE: d をã‚ŋイプすると、そぎ文字が゚クãƒĒãƒŧãƒŗãŽæœ€ä¸‹čĄŒãĢįžã‚ã‚Œãžã™ã€‚Vim は + あãĒたが w をã‚ŋã‚¤ãƒ—ã™ã‚‹ãŽã‚’åž…ãŖãĻいぞす。もし d äģĨå¤–ãŽæ–‡å­—ãŒčĄ¨į¤ēされた + 時はäŊ•ã‹é–“é•ãŖãĻいぞす。 をæŠŧしãĻã‚„ã‚Šį›´ã—ãžã—ã‚‡ã†ã€‚ ---> こぎ 文 į´™ ãĢは いくつかぎ たぎしい åŋ…čĻãŽãĒい 単čĒž が åĢぞれãĻ いぞす。 5. 3 から 4 ãžã§ã‚’æ–‡ãŒæ­Ŗã—ããĒã‚‹ãžã§įš°ã‚Ščŋ”し、ãƒŦãƒƒã‚šãƒŗ 2.2 ã¸é€˛ãŋぞしょう。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 2.2: そぎäģ–ãŽå‰Šé™¤ã‚ŗãƒžãƒŗãƒ‰ - ** čĄŒãŽæœĢ尞ぞでを削除するãĢは d$ とã‚ŋイプしぞしょう ** + ** čĄŒãŽæœĢ尞ぞでを削除するãĢは d$ とã‚ŋイプしぞしょう。 ** - 1. ノãƒŧマãƒĢãƒĸãƒŧドであることをįĸēčĒã™ã‚‹ãŽãĢ をæŠŧしぞしょう。 + 1. įĸē原ãĢノãƒŧマãƒĢãƒĸãƒŧドãĢするため をæŠŧしぞしょう。 2. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -232,7 +231,7 @@ NOTE: キãƒŧをæŠŧすとノãƒŧマãƒĢãƒĸãƒŧドãĢį§ģčĄŒã—ãžã™ã€‚ããŽ ãƒŦãƒƒã‚šãƒŗ 2.3: ã‚ĒペãƒŦãƒŧã‚ŋとãƒĸãƒŧã‚ˇãƒ§ãƒŗ - å¤šããŽã‚ŗãƒžãƒŗãƒ‰ã¯ã‚ĒペãƒŦãƒŧã‚ŋとãƒĸãƒŧã‚ˇãƒ§ãƒŗã‹ã‚‰ãƒ†ã‚­ã‚šãƒˆãĢ変更を加えぞす。 + テキ゚トãĢå¤‰æ›´ã‚’åŠ ãˆã‚‹å¤šããŽã‚ŗãƒžãƒŗãƒ‰ã¯ã‚ĒペãƒŦãƒŧã‚ŋとãƒĸãƒŧã‚ˇãƒ§ãƒŗã‹ã‚‰ãĒりぞす。 å‰Šé™¤ã‚ŗãƒžãƒŗãƒ‰ d ぎã‚ĒペãƒŦãƒŧã‚ŋはæŦĄãŽæ§˜ãĢãĒãŖãĻいぞす: d ãƒĸãƒŧã‚ˇãƒ§ãƒŗ @@ -248,7 +247,7 @@ NOTE: キãƒŧをæŠŧすとノãƒŧマãƒĢãƒĸãƒŧドãĢį§ģčĄŒã—ãžã™ã€‚ããŽ つぞり de とã‚ŋイプすると、ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰å˜čĒžãŽįĩ‚わりぞでを削除しぞす。 -NOTE: 冒é™ēしたいäēēは、ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻã‚ŗãƒžãƒŗãƒ‰ãĒしãĢãƒĸãƒŧã‚ˇãƒ§ãƒŗã‚’æŠŧしãĻ +NOTE: 冒é™ēしたいäēēは、ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻã‚ĒペãƒŦãƒŧã‚ŋãĒしãĢãƒĸãƒŧã‚ˇãƒ§ãƒŗã‚’æŠŧしãĻ ãŋぞしょう。ã‚Ģãƒŧã‚ŊãƒĢãŒį›Žįš„čĒžä¸€čĻ§ã§į¤ēされるäŊįŊŽãĢį§ģ動するはずです。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -259,7 +258,7 @@ NOTE: 冒é™ēしたいäēēは、ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻã‚ŗãƒžãƒŗãƒ‰ãĒしãĢ 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãŽå…ˆé ­ãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞす。 - 2. 2w をã‚ŋイプしãĻ単čĒž2つ分前ãĢį§ģ動しぞす。 + 2. 2w をã‚ŋイプしãĻ単čĒž2つ分先ãĢį§ģ動しぞす。 3. 3e をã‚ŋイプしãĻ3ã¤į›ŽãŽå˜čĒžãŽįĩ‚į̝ãĢį§ģ動しぞす。 @@ -284,24 +283,24 @@ NOTE: 冒é™ēしたいäēēは、ノãƒŧマãƒĢãƒĸãƒŧドãĢãĻã‚ŗãƒžãƒŗãƒ‰ãĒしãĢ ã‚ˆã‚Šå¤šããŽå‰Šé™¤ãŒčĄŒãˆãžã™: d 数値 ãƒĸãƒŧã‚ˇãƒ§ãƒŗ - 1. ---> とį¤ēã•ã‚ŒãŸčĄŒãŽčĄŒé ­éƒ¨åˆ†ãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 + 1. ---> とį¤ēã•ã‚ŒãŸčĄŒãŽæœ€åˆãŽå¤§æ–‡å­—ãŽå˜čĒžãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 - 2. UPPER CASE ぎ単čĒž2つを d2w とã‚ŋイプしãĻ削除しぞす。 + 2. 大文字ぎ単čĒž2つを d2w とã‚ŋイプしãĻ削除しぞす。 - 3. UPPER CASE ã¨ã„ã†é€Ŗįļšã—た単čĒžã‚’ã€1ã¤ãŽã‚ŗãƒžãƒŗãƒ‰ã¨į•°ãĒるã‚Ģã‚Ļãƒŗãƒˆã‚’æŒ‡åŽšã—ã€ + 3. 逪įļšã—た大文字ぎ単čĒžã‚’ã€į•°ãĒるã‚Ģã‚Ļãƒŗãƒˆã‚’æŒ‡åŽšã—ãŸ1ã¤ãŽã‚ŗãƒžãƒŗãƒ‰ã§å‰Šé™¤ã—ã€ ゚テップ 1 と 2 ã‚’įš°ã‚Ščŋ”しぞす。 ---> こぎABC DEčĄŒãŽFGHI JK LMN OP単čĒžã¯Q RS TUVįļēéē—ãĢãĒãŖãŸã€‚ -NOTE: ã‚ĒペãƒŦãƒŧã‚ŋ d とãƒĸãƒŧã‚ˇãƒ§ãƒŗãŽé–“ãĢã‚Ģã‚Ļãƒŗãƒˆã‚’äŊŋãŖãŸå ´åˆã€ã‚ĒペãƒŦãƒŧã‚ŋぎãĒい - 場合ぎãƒĸãƒŧã‚ˇãƒ§ãƒŗãŽã‚ˆã†ãĢ動äŊœã—ぞす。 - 例: 3dw と d3w ã¯åŒį­‰ã§ã€3w を削除しぞす。 + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 2.6: čĄŒãŽæ“äŊœ - ** čĄŒå…¨äŊ“を削除するãĢは dd とã‚ŋイプしぞす ** + ** čĄŒå…¨äŊ“を削除するãĢは dd とã‚ŋイプしぞす。 ** čĄŒå…¨äŊ“を削除するé ģåēĻが多いぎで、Viぎデã‚ļイナãƒŧã¯čĄŒãŽå‰Šé™¤ã‚’ d ぎ2回ã‚ŋイプと ã„ã†į°Ąå˜ãĒもぎãĢæąēめぞした。 @@ -319,24 +318,25 @@ NOTE: ã‚ĒペãƒŦãƒŧã‚ŋ d とãƒĸãƒŧã‚ˇãƒ§ãƒŗãŽé–“ãĢã‚Ģã‚Ļãƒŗãƒˆã‚’äŊŋãŖãŸå ´ ---> 6) į ‚įŗ–ã¯į”˜ã„ ---> 7) ã‚Ēマエãƒĸナãƒŧ +2回ã‚ŋイプで1行ãĢ寞しãĻäŊœį”¨ã•ã›ã‚‹æ–šæŗ•ã¯äģĨ下でčŋ°ãšã‚‹ã‚ĒペãƒŦãƒŧã‚ŋでも動äŊœã—ぞす。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 2.7: ã‚„ã‚Šį›´ã—ã‚ŗãƒžãƒŗãƒ‰ - ** æœ€åžŒãŽã‚ŗãƒžãƒŗãƒ‰ã‚’å–ã‚Šæļˆã™ãĢは u をæŠŧしぞす。U ã¯čĄŒå…¨äŊ“ぎ取æļˆã§ã™ã€‚ ** + ** æœ€åžŒãŽã‚ŗãƒžãƒŗãƒ‰ã‚’å–ã‚Šæļˆã™ãĢは u をæŠŧしぞす。U ã¯čĄŒå…¨äŊ“ぎ取りæļˆã—です。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動し、最初ぎ間違いãĢã‚Ģãƒŧã‚ŊãƒĢ をį§ģ動しぞしょう。 - 2. x をã‚ŋイプしãĻいらãĒい先頭ぎ文字を削除しぞしょう。 + 2. x をã‚ŋイプしãĻ最初ぎいらãĒい文字を削除しぞしょう。 3. さぁ、u をã‚ŋイプしãĻ最垌ãĢåŽŸčĄŒã—ãŸã‚ŗãƒžãƒŗãƒ‰ã‚’å–ã‚Šæļˆã—ぞしょう。 - 4. äģŠåēĻは、x をäŊŋį”¨ã—ãĻčĒ¤ã‚Šã‚’å…¨ãĻäŋŽæ­Ŗã—ぞしょう。 + 4. äģŠåēĻは、x をäŊŋį”¨ã—ãĻčĄŒå†…ãŽčĒ¤ã‚Šã‚’å…¨ãĻäŋŽæ­Ŗã—ぞしょう。 5. 大文字ぎ U をã‚ŋイプしãĻã€čĄŒã‚’å…ƒãŽįŠļ態ãĢæˆģしぞしょう。 - 6. u をã‚ŋイプしãĻį›´å‰ãŽ U ã‚ŗãƒžãƒŗãƒ‰ã‚’å–æļˆã—ぞしょう。 + 6. u をã‚ŋイプしãĻį›´å‰ãŽ U ã‚ŗãƒžãƒŗãƒ‰ã‚’å–ã‚Šæļˆã—ぞしょう。 7. ã§ã¯ã‚ŗãƒžãƒŗãƒ‰ã‚’å†åŽŸčĄŒã™ã‚‹ãŽãĢ CTRL-R (CTRL をæŠŧしたぞぞ R を打つ)を数回 - ã‚ŋイプしãĻãŋぞしょう(取æļˆãŽå–æļˆ)。 + ã‚ŋイプしãĻãŋぞしょう(取りæļˆã—ぎ取りæļˆã—)。 ----> ã“ãŽãŽčĄŒãŽãŽé–“é•ã„ã‚’äŋŽæ­Ŗã€…し、垌でそれらぎäŋŽæ­Ŗã‚’を取æļˆã—ぞぞすす。 +---> ã“ãŽãŽčĄŒãŽãŽé–“é•ã„ã‚’äŋŽæ­Ŗã€…し、垌でそれらぎäŋŽæ­Ŗã‚’を取りæļˆã—ぞぞすす。 8. これはとãĻもäžŋ刊ãĒã‚ŗãƒžãƒŗãƒ‰ã§ã™ã€‚ã•ããƒŦãƒƒã‚šãƒŗ 2 čĻį´„ã¸é€˛ãŋぞしょう。 @@ -347,45 +347,47 @@ NOTE: ã‚ĒペãƒŦãƒŧã‚ŋ d とãƒĸãƒŧã‚ˇãƒ§ãƒŗãŽé–“ãĢã‚Ģã‚Ļãƒŗãƒˆã‚’äŊŋãŖãŸå ´ ãƒŦãƒƒã‚šãƒŗ 2 čρᴄ - 1. ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰å˜čĒžãŽæœĢ尞ぞでを削除するãĢは dw とã‚ŋイプしぞす。 - 2. ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰čĄŒãŽæœĢ尞ぞでを削除するãĢは d$ とã‚ŋイプしぞす。 - 3. čĄŒå…¨äŊ“を削除するãĢは dd とã‚ŋイプしぞす。 + 1. ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰æŦĄãŽå˜čĒžãžã§ã‚’å‰Šé™¤ã™ã‚‹ãĢは dw とã‚ŋイプしぞす。 + 2. ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰å˜čĒžãŽæœĢ尞ぞでを削除するãĢは de とã‚ŋイプしぞす。 + 3. ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰čĄŒãŽæœĢ尞ぞでを削除するãĢは d$ とã‚ŋイプしぞす。 + 4. čĄŒå…¨äŊ“を削除するãĢは dd とã‚ŋイプしぞす。 - 4. ãƒĸãƒŧã‚ˇãƒ§ãƒŗã‚’įš°ã‚Ščŋ”すãĢは数値をäģ˜ä¸Žã—ぞす: 2w - 5. 変更ãĢį”¨ã„ã‚‹ã‚ŗãƒžãƒŗãƒ‰ãŽåŊĸåŧã¯ + 5. ãƒĸãƒŧã‚ˇãƒ§ãƒŗã‚’įš°ã‚Ščŋ”すãĢは数値をäģ˜ä¸Žã—ぞす: 2w + 6. 変更ãĢį”¨ã„ã‚‹ã‚ŗãƒžãƒŗãƒ‰ãŽåŊĸåŧã¯ ã‚ĒペãƒŦãƒŧã‚ŋ [数値] ãƒĸãƒŧã‚ˇãƒ§ãƒŗ - それぞれ: ã‚ĒペãƒŦãƒŧã‚ŋ - 削除 d ãŽéĄžã§äŊ•をするか。 - 数値 - ããŽã‚ŗãƒžãƒŗãƒ‰ã‚’äŊ•å›žįš°ã‚Ščŋ”すか。 - ãƒĸãƒŧã‚ˇãƒ§ãƒŗ - w (単čĒž)や $ (行æœĢ)ãĒãŠãŽéĄžã§ã€ãƒ†ã‚­ã‚šãƒˆãŽäŊ•ãĢ寞しãĻ働きか - けるか。 + [数値] - ããŽã‚ŗãƒžãƒŗãƒ‰ã‚’äŊ•å›žįš°ã‚Ščŋ”すか。 + ãƒĸãƒŧã‚ˇãƒ§ãƒŗ - w (単čĒž)や e (単čĒžæœĢå°ž)、$ (行æœĢ)ãĒãŠãŽéĄžã§ã€ãƒ†ã‚­ã‚šãƒˆãŽ + äŊ•ãĢ寞しãĻ働きかけるか。 - 6. čĄŒãŽå…ˆé ­ãĢį§ģ動するãĢはã‚ŧロをäŊŋį”¨ã—ãžã™: 0 + 7. čĄŒãŽå…ˆé ­ãĢį§ģ動するãĢはã‚ŧロをäŊŋį”¨ã—ãžã™: 0 + + 8. 前回ぎ動äŊœã‚’取りæļˆã™: u (小文字 u) + čĄŒå…¨äŊ“ぎ変更を取りæļˆã™: U (大文字 U) + 取りæļˆã—ぎ取りæļˆã—: CTRL-R - 7. 前回ぎ動äŊœã‚’取æļˆã™: u (小文字 u) - čĄŒå…¨äŊ“ぎ変更を取æļˆã™: U (大文字 U) - 取æļˆã—ぎ取æļˆã—: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 3.1: č˛ŧりäģ˜ã‘ã‚ŗãƒžãƒŗãƒ‰ - ** 最垌ãĢå‰Šé™¤ã•ã‚ŒãŸčĄŒã‚’ã‚Ģãƒŧã‚ŊãƒĢぎ垌ãĢč˛ŧりäģ˜ã‘ã‚‹ãĢは p をã‚ŋイプしぞす ** + ** 最垌ãĢå‰Šé™¤ã•ã‚ŒãŸčĄŒã‚’ã‚Ģãƒŧã‚ŊãƒĢぎ垌ãĢč˛ŧりäģ˜ã‘ã‚‹ãĢは p をã‚ŋイプしぞす。 ** - 1. äģĨ下ぎæŽĩčŊãŽæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 + 1. ---> とį¤ēされたäģĨä¸‹ãŽæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 - 2. dd とã‚ŋイプしãĻčĄŒã‚’å‰Šé™¤ã—ã€Vim ãŽãƒãƒƒãƒ•ã‚ĄãĢæ ŧį´ã—ãžã—ã‚‡ã†ã€‚ + 2. dd とã‚ŋイプしãĻčĄŒã‚’å‰Šé™¤ã—ã€Vim ぎãƒŦジ゚ã‚ŋãĢæ ŧį´ã—ãžã—ã‚‡ã†ã€‚ - 3. å‰Šé™¤ã—ãŸčĄŒãŒæœŦæĨあるずきäŊįŊŽãŽä¸ŠãŽčĄŒãžã§ã€ã‚Ģãƒŧã‚ŊãƒĢをį§ģ動させぞしょう。 + 3. å‰Šé™¤ã—ãŸčĄŒãŒæœŦæĨあるずきäŊįŊŽãŽä¸ŠãŽčĄŒã§ã‚ã‚‹ c) čĄŒãžã§ã€ã‚Ģãƒŧã‚ŊãƒĢをį§ģ動させ + ぞしょう。 - 4. ノãƒŧマãƒĢãƒĸãƒŧドで p をã‚ŋイプしãĻæ ŧį´ã—ãŸčĄŒã‚’į”ģéĸãĢæˆģしぞす。 + 4. ノãƒŧマãƒĢãƒĸãƒŧドで p をã‚ŋイプしãĻæ ŧį´ã—ãŸčĄŒã‚’ã‚Ģãƒŧã‚ŊãƒĢぎ下ãĢæˆģしぞす。 5. 順į•ĒãŒæ­Ŗã—ããĒる様ãĢ゚テップ 2 から 4 ã‚’įš°ã‚Ščŋ”しぞしょう。 - d) č˛´æ–šã‚‚å­Ļãļことができる? - b) ゚ミãƒŦは青い、 - c) įŸĨæĩとはå­Ļãļもぎ、 - a) バナはčĩ¤ã„、 +---> d) č˛´æ–šã‚‚å­Ļãļことができる? +---> b) ゚ミãƒŦは青い、 +---> c) įŸĨæĩとはå­Ļãļもぎ、 +---> a) バナはčĩ¤ã„、 @@ -393,7 +395,7 @@ NOTE: ã‚ĒペãƒŦãƒŧã‚ŋ d とãƒĸãƒŧã‚ˇãƒ§ãƒŗãŽé–“ãĢã‚Ģã‚Ļãƒŗãƒˆã‚’äŊŋãŖãŸå ´ ãƒŦãƒƒã‚šãƒŗ 3.2: įŊŽãæ›ãˆã‚ŗãƒžãƒŗãƒ‰ - ** ã‚Ģãƒŧã‚ŊãƒĢぎ下ぎ文字をįŊŽãæ›ãˆã‚‹ãĢは r をã‚ŋイプしぞす ** + ** ã‚Ģãƒŧã‚ŊãƒĢぎ下ぎ文字を x ãĢįŊŽãæ›ãˆã‚‹ãĢは rx をã‚ŋイプしぞす。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -416,38 +418,38 @@ NOTE: 原際ãĢčŠĻしぞしょう。æąēしãĻčĻšãˆã‚‹ã ã‘ãĢはしãĒいこ ãƒŦãƒƒã‚šãƒŗ 3.3: å¤‰æ›´ã‚ŗãƒžãƒŗãƒ‰ - ** 単čĒžãŽä¸€éƒ¨ã€ã‚‚ã—ãã¯å…¨äŊ“を変更するãĢは cw とã‚ŋイプしぞす ** + ** 単čĒžãŽæœĢ尞ぞでを変更するãĢは ce とã‚ŋイプしぞす。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 2. lubw ぎ u ぎäŊįŊŽãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 - 3. cw とã‚ŋã‚¤ãƒ—ã—ã€æ­Ŗã—ã„å˜čĒžã‚’ã‚ŋイプしぞしょう(こぎ場合 'ine' とã‚ŋイプ)。 + 3. ce とã‚ŋã‚¤ãƒ—ã—ã€æ­Ŗã—ã„å˜čĒžã‚’ã‚ŋイプしぞしょう(こぎ場合 'ine' とã‚ŋイプ)。 - 4. æŦĄãŽé–“違い(変更すずき文字ぎ先頭)ãĢį§ģ動するためãĢ をã‚ŋイプしぞす。 + 4. をã‚ŋイプしãĻからæŦĄãŽé–“違い(変更すずき文字ぎ先頭)ãĢį§ģ動しぞす。 5. æœ€åˆãŽčĄŒãŒæŦĄãŽčĄŒãŽæ§˜ãĢãĒるぞで゚テップ 3 と 4 ã‚’įš°ã‚Ščŋ”しぞす。 ---> This lubw has a few wptfd that mrrf changing usf the change operator. ---> This line has a few words that need changing using the change operator. -cw は単čĒžã‚’å¤‰æ›´ã™ã‚‹ã ã‘ã§ãĒく、æŒŋå…Ĩã‚‚čĄŒãˆã‚‹ã“ã¨ãĢæŗ¨æ„ã—ãžã—ã‚‡ã†ã€‚ - +ce は単čĒžã‚’å‰Šé™¤ã—ãŸåžŒã€æŒŋå…ĨãƒĸãƒŧドãĢå…ĨることãĢæŗ¨æ„ã—ãžã—ã‚‡ã†ã€‚ +cc ã¯åŒã˜ã“ã¨ã‚’čĄŒå…¨äŊ“ãĢ寞しãĻčĄŒã„ãžã™ã€‚ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 3.4: c をäŊŋį”¨ã—ãŸããŽäģ–ぎ変更 - ** å¤‰æ›´ã‚ŗãƒžãƒŗãƒ‰ã¯ã€å‰Šé™¤ã‚ŗãƒžãƒŗãƒ‰ã¨åŒã˜æ§˜ãĢã‚ĒブジェクトをäŊŋį”¨ã—ãžã™ ** + ** 変更ã‚ĒペãƒŦãƒŧã‚ŋは、削除と同じ様ãĢãƒĸãƒŧã‚ˇãƒ§ãƒŗã‚’äŊŋį”¨ã—ãžã™ã€‚ ** - 1. å¤‰æ›´ã‚ŗãƒžãƒŗãƒ‰ã¯ã€å‰Šé™¤ã‚ŗãƒžãƒŗãƒ‰ã¨åŒã˜ã‚ˆã†ãĒ動äŊœã‚’しぞす。そぎåŊĸåŧã¯ + 1. 変更ã‚ĒペãƒŦãƒŧã‚ŋは、削除と同じようãĒ動äŊœã‚’しぞす。そぎåŊĸåŧã¯ c [数値] ãƒĸãƒŧã‚ˇãƒ§ãƒŗ - 2. ã‚Ēブジェクトも同じで、w は単čĒžã€ $ ã¯čĄŒæœĢãĒãŠã¨ã„ãŖãŸã‚‚ãŽã§ã™ã€‚ + 2. ãƒĸãƒŧã‚ˇãƒ§ãƒŗã‚‚åŒã˜ã§ã€w は単čĒžã€ $ ã¯čĄŒæœĢãĒãŠã¨ã„ãŖãŸã‚‚ãŽã§ã™ã€‚ - 3. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 + 3. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 4. 最初ぎ間違いへã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -470,7 +472,7 @@ NOTE: ã‚ŋイプ中ぎ間違いはバック゚ペãƒŧ゚キãƒŧをäŊŋãŖãĻį›´ã™ 文字をã‚ŋイプしぞす。 3. å¤‰æ›´ã‚ŗãƒžãƒŗãƒ‰ã§ã¯ã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰į‰šåŽšãŽãƒĸãƒŧã‚ˇãƒ§ãƒŗã§æŒ‡åŽšã•ã‚Œã‚‹įĩ‚įĢ¯ãžã§ã‚’å¤‰ - 更することが可čƒŊです。䞋えば cw ãĒらばã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰å˜čĒžãŽįĩ‚わりぞで、 + 更することが可čƒŊです。䞋えば ce ãĒらばã‚Ģãƒŧã‚ŊãƒĢäŊįŊŽã‹ã‚‰å˜čĒžãŽįĩ‚わりぞで、 c$ ãĒã‚‰ã°čĄŒãŽįĩ‚わりぞでを変更しぞす。 4. å¤‰æ›´ã‚ŗãƒžãƒŗãƒ‰ãŽåŊĸåŧã¯ @@ -485,7 +487,7 @@ NOTE: ã‚ŋイプ中ぎ間違いはバック゚ペãƒŧ゚キãƒŧをäŊŋãŖãĻį›´ã™ ãƒŦãƒƒã‚šãƒŗ 4.1: äŊįŊŽã¨ãƒ•ã‚Ąã‚¤ãƒĢãŽæƒ…å ą ** ãƒ•ã‚Ąã‚¤ãƒĢ内でぎäŊįŊŽã¨ãƒ•ã‚Ąã‚¤ãƒĢぎįŠļæ…‹ã‚’čĄ¨į¤ēするãĢは CTRL-G をã‚ŋイプしぞす。 - ãƒ•ã‚Ąã‚¤ãƒĢå†…ãŽã‚ã‚‹čĄŒãĢį§ģ動するãĢは G をã‚ŋイプしぞす ** + ãƒ•ã‚Ąã‚¤ãƒĢå†…ãŽã‚ã‚‹čĄŒãĢį§ģ動するãĢは G をã‚ŋイプしぞす。 ** NOTE: ã‚šãƒ†ãƒƒãƒ—ã‚’åŽŸčĄŒã™ã‚‹å‰ãĢ、こぎãƒŦãƒƒã‚šãƒŗå…¨ãĻãĢį›Žã‚’é€šã—ãžã—ã‚‡ã†!! @@ -496,7 +498,7 @@ NOTE: ã‚ŋイプ中ぎ間違いはバック゚ペãƒŧ゚キãƒŧをäŊŋãŖãĻį›´ã™ NOTE: į”ģéĸãŽåŗä¸‹éš…ãĢã‚Ģãƒŧã‚ŊãƒĢぎäŊįŊŽãŒčĄ¨į¤ēされãĻいるかもしれぞせん。これは 'ruler' ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗ(:help 'ruler' ã‚’å‚į…§)ã‚’č¨­åŽšã™ã‚‹ã“ã¨ã§čĄ¨į¤ēされぞす。 - 2. æœ€ä¸‹čĄŒãĢį§ģ動するためãĢ G をã‚ŋイプしぞしょう。 + 2. ãƒ•ã‚Ąã‚¤ãƒĢãŽæœ€ä¸‹čĄŒãĢį§ģ動するためãĢ G をã‚ŋイプしぞしょう。 ãƒ•ã‚Ąã‚¤ãƒĢぎ先頭ãĢį§ģ動するãĢは gg とã‚ŋイプしぞしょう。 3. 先ãģãŠãŽčĄŒãŽį•Ēåˇã‚’ã‚ŋイプし G をã‚ŋイプしぞしょう。最初ãĢ CTRL-G をæŠŧã—ãŸčĄŒ @@ -508,19 +510,19 @@ NOTE: į”ģéĸãŽåŗä¸‹éš…ãĢã‚Ģãƒŧã‚ŊãƒĢぎäŊįŊŽãŒčĄ¨į¤ēされãĻいるかも ãƒŦãƒƒã‚šãƒŗ 4.2: 検į´ĸã‚ŗãƒžãƒŗãƒ‰ - ** čĒžåĨを検į´ĸするãĢは / と、前斚検į´ĸするčĒžåĨをã‚ŋイプしぞす。** + ** čĒžåĨを検į´ĸするãĢは / と、前斚検į´ĸするčĒžåĨをã‚ŋイプしぞす。 ** 1. ノãƒŧマãƒĢãƒĸãƒŧドで / という文字をã‚ŋイプしぞす。į”ģéĸ一į•Ē下ãĢ : ã‚ŗãƒžãƒŗãƒ‰ã¨ 同じ様ãĢ / ãŒįžã‚Œã‚‹ã“ã¨ãĢ気ãĨくでしょう。 2. では、'errroor' とã‚ŋイプしぞしょう。これが検į´ĸしたい単čĒžã§ã™ã€‚ - 3. 同じčĒžã‚’ã‚‚ã†ä¸€åēĻæ¤œį´ĸするときは 単ãĢ n をã‚ŋイプしぞす。 + 3. 同じčĒžåĨをもう一åēĻæ¤œį´ĸするときは 単ãĢ n をã‚ŋイプしぞす。 逆斚向ãĢčĒžåĨを検į´ĸするときは N をã‚ŋイプしぞす。 4. 逆斚向ãĢčĒžåĨを検į´ĸする場合は、/ ぎäģŖã‚ã‚ŠãĢ ? ã‚ŗãƒžãƒŗãƒ‰ã‚’äŊŋį”¨ã—ãžã™ã€‚ - 5. 元ぎ場所ãĢæˆģるãĢは CTRL-O (Ctrl をæŠŧしįļšã‘ãĒがら o 文字ã‚ŋイプ)をã‚ŋイプし + 5. 元ぎ場所ãĢæˆģるãĢは CTRL-O (Ctrl をæŠŧしįļšã‘ãĒがら文字 o をã‚ŋイプ)をã‚ŋイプし ぞす。さらãĢæˆģるãĢã¯ã“ã‚Œã‚’įš°ã‚Ščŋ”しぞす。CTRL-I は前斚向です。 ---> "errroor" は error と゚ペãƒĢが違いぞす; errroor はいわゆる error です。 @@ -531,7 +533,7 @@ NOTE: 検į´ĸãŒãƒ•ã‚Ąã‚¤ãƒĢぎįĩ‚わりãĢ達すると、ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗ 'wrapsc ãƒŦãƒƒã‚šãƒŗ 4.3: 寞åŋœã™ã‚‹æ‹Ŧåŧ§ã‚’検į´ĸ - ** 寞åŋœã™ã‚‹ ),] や } を検į´ĸするãĢは % をã‚ŋイプしぞす ** + ** 寞åŋœã™ã‚‹ ),] や } を検į´ĸするãĢは % をã‚ŋイプしぞす。 ** 1. 下ぎ ---> でį¤ēã•ã‚ŒãŸčĄŒã§ (,[ か { ぎおれかãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -554,7 +556,7 @@ NOTE: こぎ抟čƒŊはæ‹Ŧåŧ§ãŒä¸€č‡´ã—ãĻいãĒいプログナムをデバッ ãƒŦãƒƒã‚šãƒŗ 4.4: é–“é•ã„ã‚’å¤‰æ›´ã™ã‚‹æ–šæŗ• - ** 'old' を 'new' ãĢįŊŽæ›ã™ã‚‹ãĢは :s/old/new/g とã‚ŋイプしぞす ** + ** 'old' を 'new' ãĢįŊŽæ›ã™ã‚‹ãĢは :s/old/new/g とã‚ŋイプしぞす。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 @@ -567,9 +569,8 @@ NOTE: こぎ抟čƒŊはæ‹Ŧåŧ§ãŒä¸€č‡´ã—ãĻいãĒいプログナムをデバッ ---> thee best time to see thee flowers is in thee spring. - 4. č¤‡æ•°čĄŒã‹ã‚‰čĻ‹ã¤ã‹ã‚‹æ–‡å­—ã‚’å¤‰æ›´ã™ã‚‹ãĢは - :#,#s/old/new/g #,# ãĢはįŊŽãæ›ãˆã‚‹į¯„å›˛ãŽé–‹å§‹ã¨įĩ‚äē†ãŽčĄŒį•Ēåˇã‚’æŒ‡åŽšã—ãž - す。 + 4. č¤‡æ•°čĄŒã‹ã‚‰čĻ‹ã¤ã‹ã‚‹æ–‡å­—ãŽå…¨ãĻãŽįŽ‡æ‰€ã‚’å¤‰æ›´ã™ã‚‹ãĢは + :#,#s/old/new/g #,# ãĢはįŊŽãæ›ãˆã‚‹į¯„å›˛ãŽé–‹å§‹ã¨įĩ‚äē†ãŽčĄŒį•Ēåˇã‚’æŒ‡åŽšã™ã‚‹ã€‚ :%s/old/new/g ãƒ•ã‚Ąã‚¤ãƒĢ全äŊ“でčĻ‹ã¤ã‹ã‚‹ã‚‚ãŽãĢ寞しãĻ変更する。 :%s/old/new/gc ãƒ•ã‚Ąã‚¤ãƒĢ全äŊ“でčĻ‹ã¤ã‹ã‚‹ã‚‚ãŽãĢ寞しãĻ、1つ1つįĸēčĒã‚’ã¨ã‚ŠãĒ がら変更する。 @@ -593,7 +594,7 @@ NOTE: こぎ抟čƒŊはæ‹Ŧåŧ§ãŒä¸€č‡´ã—ãĻいãĒいプログナムをデバッ 4. įžåœ¨čĄŒãŽæœ€åˆãŽ old を new ãĢįŊŽæ›ã™ã‚‹ã€‚ :s/old/new įžåœ¨čĄŒãŽå…¨ãĻぎ old を new ãĢįŊŽæ›ã™ã‚‹ã€‚ :s/old/new/g - 2つぎ # 間でčĒžåĨをįŊŽæ›ã™ã‚‹ã€‚ :#,#s/old/new/g + 2つぎ # čĄŒãŽé–“ã§čĒžåĨをįŊŽæ›ã™ã‚‹ã€‚ :#,#s/old/new/g ãƒ•ã‚Ąã‚¤ãƒĢぎ中ぎ全ãĻぎ検į´ĸčĒžåĨをįŊŽæ›ã™ã‚‹ã€‚ :%s/old/new/g 'c' を加えるとįŊŽæ›ãŽåēĻãĢįĸēčĒã‚’æą‚ã‚ã‚‹ã€‚ :%s/old/new/gc @@ -601,10 +602,10 @@ NOTE: こぎ抟čƒŊはæ‹Ŧåŧ§ãŒä¸€č‡´ã—ãĻいãĒいプログナムをデバッ ãƒŦãƒƒã‚šãƒŗ 5.1: å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ã‚’åŽŸčĄŒã™ã‚‹æ–šæŗ• - ** :! ぎ垌ãĢåŽŸčĄŒã™ã‚‹å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ã‚’ã‚ŋイプしぞす ** + ** :! ぎ垌ãĢåŽŸčĄŒã™ã‚‹å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ã‚’ã‚ŋイプしぞす。 ** 1. į”ģéĸぎ最下部ãĢã‚Ģãƒŧã‚ŊãƒĢがį§ģå‹•ã™ã‚‹ã‚ˆã†ã€æ…Ŗã‚ŒčĻĒしんだ : をã‚ŋイプしぞしょう。 - ã“ã‚Œã§ã‚ŗãƒžãƒŗãƒ‰ãŒã‚ŋイプできる様ãĢãĒりぞす。 + ã“ã‚Œã§ã‚ŗãƒžãƒŗãƒ‰ãƒŠã‚¤ãƒŗå‘Ŋäģ¤ãŒã‚ŋイプできる様ãĢãĒりぞす。 2. ここで ! という文字(感嘆įŦĻ)をã‚ŋイプしぞしょう。 ã“ã‚Œã§å¤–éƒ¨ã‚ˇã‚§ãƒĢã‚ŗãƒžãƒŗãƒ‰ãŒåŽŸčĄŒã§ãã‚‹æ§˜ãĢãĒりぞす。 @@ -624,7 +625,7 @@ NOTE: 全ãĻぎ : ã‚ŗãƒžãƒŗãƒ‰ã¯ をæŠŧしãĻįĩ‚äē†ã—ãĒければãĒ ãƒŦãƒƒã‚šãƒŗ 5.2: そぎäģ–ãŽãƒ•ã‚Ąã‚¤ãƒĢへ書きčžŧãŋ - ** ãƒ•ã‚Ąã‚¤ãƒĢへ変更をäŋå­˜ã™ã‚‹ãĢは :w ãƒ•ã‚Ąã‚¤ãƒĢ名 とã‚ŋイプしぞす ** + ** ãƒ•ã‚Ąã‚¤ãƒĢへ変更をäŋå­˜ã™ã‚‹ãĢは :w ãƒ•ã‚Ąã‚¤ãƒĢ名 とã‚ŋイプしぞす。 ** 1. ãƒ‡ã‚ŖãƒŦクトãƒĒぎ一čĻ§ã‚’åž—ã‚‹ãŸã‚ãĢ :!dir もしくは :!ls とã‚ŋイプしぞしょう。 こぎあと をæŠŧすぎはæ—ĸãĢご存įŸĨですね。 @@ -634,7 +635,7 @@ NOTE: 全ãĻぎ : ã‚ŗãƒžãƒŗãƒ‰ã¯ をæŠŧしãĻįĩ‚äē†ã—ãĒければãĒ 3. では :w TEST とã‚ŋイプしぞしょう (TEST ã¯ã€é¸ã‚“ã ãƒ•ã‚Ąã‚¤ãƒĢ名です)。 4. これãĢã‚ˆã‚Šãƒ•ã‚Ąã‚¤ãƒĢ全äŊ“が TEST という名前でäŋå­˜ã•れぞす。 - もう一åēĻ :!dir もしくは :!ls とã‚ŋイプしãĻįĸēčĒã—ãĻãŋぞしょう。 + もう一åēĻ :!dir もしくは :!ls とã‚ŋイプしãĻãƒ‡ã‚ŖãƒŦクトãƒĒをįĸēčĒã—ãĻãŋぞしょう。 NOTE: ここで Vim をįĩ‚äē†ã—ã€ãƒ•ã‚Ąã‚¤ãƒĢ名 TEST ã¨å…ąãĢčĩˇå‹•すると、äŋå­˜ã—た時ぎ チãƒĨãƒŧトãƒĒã‚ĸãƒĢãŽč¤‡čŖŊができ上がるはずです。 @@ -647,7 +648,7 @@ NOTE: ここで Vim をįĩ‚äē†ã—ã€ãƒ•ã‚Ąã‚¤ãƒĢ名 TEST ã¨å…ąãĢčĩˇå‹•すると ãƒŦãƒƒã‚šãƒŗ 5.3: 選択した書きčžŧãŋ -** ãƒ•ã‚Ąã‚¤ãƒĢぎäŊįŊŽã‚’äŋå­˜ã™ã‚‹ãĢは、v ãƒĸãƒŧã‚ˇãƒ§ãƒŗã¨ :w FILENAME をã‚ŋイプしぞす。 ** +** ãƒ•ã‚Ąã‚¤ãƒĢぎ一部をäŋå­˜ã™ã‚‹ãĢは、v ãƒĸãƒŧã‚ˇãƒ§ãƒŗã¨ :w FILENAME をã‚ŋイプしぞす。 ** 1. ã“ãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞす。 @@ -660,20 +661,20 @@ NOTE: ここで Vim をįĩ‚äē†ã—ã€ãƒ•ã‚Ąã‚¤ãƒĢ名 TEST ã¨å…ąãĢčĩˇå‹•すると をæŠŧす前ãĢ :'<,'>w TEST とãĒãŖãĻいることをįĸēčĒã—ãĻ下さい。 5. Vim は TEST ã¨ã„ã†ãƒ•ã‚Ąã‚¤ãƒĢãĢé¸æŠžã•ã‚ŒãŸčĄŒã‚’æ›¸ãčžŧむでしょう。 - !dir もしくは !ls でそれをįĸēčĒã—ãžã™ã€‚ + :!dir もしくは :!ls でそれをįĸēčĒã—ãžã™ã€‚ それは削除しãĒいでおいãĻ下さい。æŦĄãŽãƒŦãƒƒã‚šãƒŗã§äŊŋį”¨ã—ãžã™ã€‚ NOTE: v をæŠŧすと、Visual 選択が始ぞりぞす。ã‚Ģãƒŧã‚ŊãƒĢã‚’å‹•ã‹ã™ã“ã¨ã§ã€é¸æŠžį¯„å›˛ã‚’ 大きくも小さくもできぞす。さらãĢã€ããŽé¸æŠžį¯„å›˛ãĢ寞しãĻã‚ĒペãƒŦãƒŧã‚ŋã‚’éŠį”¨ - きぞす。䞋えば d はテキ゚トを削除しぞす。 + できぞす。䞋えば d はテキ゚トを削除しぞす。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 5.4: ãƒ•ã‚Ąã‚¤ãƒĢぎ取čžŧと合äŊĩ - ** ãƒ•ã‚Ąã‚¤ãƒĢぎ中čēĢをæŒŋå…ĨするãĢは :r ãƒ•ã‚Ąã‚¤ãƒĢ名 とã‚ŋイプしぞす ** + ** ãƒ•ã‚Ąã‚¤ãƒĢぎ中čēĢをæŒŋå…ĨするãĢは :r ãƒ•ã‚Ąã‚¤ãƒĢ名 とã‚ŋイプしぞす。 ** - 1. ã‚Ģãƒŧã‚ŊãƒĢをäģĨä¸‹ãŽčĄŒãĢ合わせぞす。 + 1. ã‚Ģãƒŧã‚ŊãƒĢã‚’ã“ãŽčĄŒãŽã™ãä¸ŠãĢ合わせぞす。 NOTE: ゚テップ 2 ãŽåŽŸčĄŒåžŒã€ãƒŦãƒƒã‚šãƒŗ 5.3 ãŽãƒ†ã‚­ã‚šãƒˆãŒįžã‚Œãžã™ã€‚ä¸‹ãĢä¸‹ãŒãŖãĻこ ぎãƒŦãƒƒã‚šãƒŗãĢį§ģ動しぞしょう。 @@ -682,19 +683,18 @@ NOTE: ゚テップ 2 ãŽåŽŸčĄŒåžŒã€ãƒŦãƒƒã‚šãƒŗ 5.3 ãŽãƒ†ã‚­ã‚šãƒˆãŒįžã‚Œ ここでいう TEST はäŊŋã†ãƒ•ã‚Ąã‚¤ãƒĢぎ名前ぎことです。 čĒ­ãŋčžŧãžã‚ŒãŸãƒ•ã‚Ąã‚¤ãƒĢは、ã‚Ģãƒŧã‚ŊãƒĢčĄŒãŽä¸‹ãĢありぞす。 - 3. 取čžŧã‚“ã ãƒ•ã‚Ąã‚¤ãƒĢをįĸēčĒã—ãĻãŋぞしょう。ã‚Ģãƒŧã‚ŊãƒĢをæˆģすと、ãƒŦãƒƒã‚šãƒŗ5.3 ぎ + 3. 取りčžŧã‚“ã ãƒ•ã‚Ąã‚¤ãƒĢをįĸēčĒã—ãĻãŋぞしょう。ã‚Ģãƒŧã‚ŊãƒĢをæˆģすと、ãƒŦãƒƒã‚šãƒŗ5.3 ぎ ã‚ĒãƒĒジナãƒĢã¨ãƒ•ã‚Ąã‚¤ãƒĢãĢよるもぎぎ2つがあることがわかりぞす。 -NOTE: å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ãŽå‡ē力をčĒ­ãŋčžŧむこともå‡ēæĨぞす。䞋えば、 +NOTE: å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ãŽå‡ē力をčĒ­ãŋčžŧむこともできぞす。䞋えば、 :r !ls は ls ã‚ŗãƒžãƒŗãƒ‰ãŽå‡ē力をã‚Ģãƒŧã‚ŊãƒĢäģĨ下ãĢčĒ­ãŋčžŧãŋぞす。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 5 čρᴄ - 1. :!command ãĢã‚ˆãŖãĻ å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ã‚’åŽŸčĄŒã—ãžã™ã€‚ + 1. :!command ãĢã‚ˆãŖãĻ å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ã‚’åŽŸčĄŒã™ã‚‹ã€‚ よくäŊŋう䞋: (Windows) (Unix) @@ -717,13 +717,14 @@ NOTE: å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ãŽå‡ē力をčĒ­ãŋčžŧむこともå‡ēæĨぞす。䞋え ãƒŦãƒƒã‚šãƒŗ 6.1: ã‚Ēãƒŧãƒ—ãƒŗã‚ŗãƒžãƒŗãƒ‰ - ** o をã‚ŋイプすると、ã‚Ģãƒŧã‚ŊãƒĢãŽä¸‹ãŽčĄŒãŒé–‹ãã€æŒŋå…ĨãƒĸãƒŧドãĢå…Ĩりぞす ** + ** o をã‚ŋイプすると、ã‚Ģãƒŧã‚ŊãƒĢãŽä¸‹ãŽčĄŒãŒé–‹ãã€æŒŋå…ĨãƒĸãƒŧドãĢå…Ĩりぞす。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞしょう。 2. o (小文字) をã‚ŋイプしãĻ、ã‚Ģãƒŧã‚ŊãƒĢãŽä¸‹ãŽčĄŒã‚’é–‹ãã€æŒŋå…ĨãƒĸãƒŧドãĢå…Ĩりぞす。 - 3. さらãĢæŒŋå…Ĩãƒĸãƒŧドをįĩ‚äē†ã™ã‚‹į‚ēãĢ をã‚ŋイプしぞす。 + 3. いくつか文字をã‚ŋイプしãĻから、æŒŋå…Ĩãƒĸãƒŧドをįĩ‚äē†ã™ã‚‹į‚ēãĢ を + ã‚ŋイプしぞす。 ---> o をã‚ŋイプするとã‚Ģãƒŧã‚ŊãƒĢã¯é–‹ã„ãŸčĄŒã¸į§ģ動しæŒŋå…ĨãƒĸãƒŧドãĢå…Ĩりぞす。 @@ -735,12 +736,11 @@ NOTE: å¤–éƒ¨ã‚ŗãƒžãƒŗãƒ‰ãŽå‡ē力をčĒ­ãŋčžŧむこともå‡ēæĨぞす。䞋え - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 6.2: čŋŊåŠ ã‚ŗãƒžãƒŗãƒ‰ - ** ã‚Ģãƒŧã‚ŊãƒĢぎæŦĄãŽäŊįŊŽã‹ã‚‰ãƒ†ã‚­ã‚šãƒˆã‚’čŋŊ加するãĢは a とã‚ŋイプしぞす ** + ** ã‚Ģãƒŧã‚ŊãƒĢぎæŦĄãŽäŊįŊŽã‹ã‚‰ãƒ†ã‚­ã‚šãƒˆã‚’čŋŊ加するãĢは a とã‚ŋイプしぞす。 ** 1. ã‚Ģãƒŧã‚ŊãƒĢを ---> でį¤ēã•ã‚ŒãŸæœ€åˆãŽčĄŒã¸į§ģ動しぞしょう。 @@ -763,7 +763,7 @@ NOTE: a, i と A は同じæŒŋå…Ĩãƒĸãƒŧドへį§ģりぞすが、文字がæŒŋå…Ĩさ ãƒŦãƒƒã‚šãƒŗ 6.3: そぎäģ–ぎįŊŽæ›æ–šæŗ• - ** 1文字äģĨ上をįŊŽãæ›ãˆã‚‹ãĢは大文字ぎ R とã‚ŋイプしぞしょう ** + ** 1文字äģĨ上をįŊŽãæ›ãˆã‚‹ãĢは大文字ぎ R とã‚ŋイプしぞしょう。 ** 1. äģĨ下ぎ ---> とį¤ēã•ã‚ŒãŸčĄŒãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動しぞす。最初ぎ xxx ぎ先頭ãĢį§ģ動し ぞす。 @@ -781,12 +781,11 @@ NOTE: a, i と A は同じæŒŋå…Ĩãƒĸãƒŧドへį§ģりぞすが、文字がæŒŋå…Ĩさ NOTE: įŊŽæ›ãƒĸãƒŧドはæŒŋå…ĨãƒĸãƒŧドãĢäŧŧãĻいぞすが、全ãĻぎã‚ŋイプされた文字はæ—ĸ存ぎ文字 を削除しぞす。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 6.4: ãƒ†ã‚­ã‚šãƒˆãŽã‚ŗãƒ”ãƒŧとペãƒŧ゚ト - ** ãƒ†ã‚­ã‚šãƒˆãŽã‚ŗãƒ”ãƒŧãĢはã‚ĒペãƒŦãƒŧã‚ŋ y を、ペãƒŧ゚トãĢは p をäŊŋいぞす ** + ** ãƒ†ã‚­ã‚šãƒˆãŽã‚ŗãƒ”ãƒŧãĢはã‚ĒペãƒŦãƒŧã‚ŋ y を、ペãƒŧ゚トãĢは p をäŊŋいぞす。 ** 1. ---> とį¤ēã•ã‚ŒãŸčĄŒã¸į§ģ動し、ã‚Ģãƒŧã‚ŊãƒĢを "a)" ぎ垌ãĢįŊŽã„ãĻおきぞす。 @@ -804,12 +803,13 @@ NOTE: įŊŽæ›ãƒĸãƒŧドはæŒŋå…ĨãƒĸãƒŧドãĢäŧŧãĻいぞすが、全ãĻぎã‚ŋイ ---> a) this is the first item. b) - NOTE: 単čĒžã‚’1つ yank するぎãĢ y をã‚ĒペãƒŦãƒŧã‚ŋとしãĻ yw とすることもå‡ēæĨぞす。 + NOTE: y をã‚ĒペãƒŦãƒŧã‚ŋとしãĻäŊŋうこともできぞす。yw は単čĒžã‚’1つ yank しぞす。 + yy ã¯čĄŒã‚’1つ yank し、p ã§ããŽčĄŒã‚’ put しぞす。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 6.5: ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗãŽč¨­åŽš - ** 検į´ĸやįŊŽæ›ãŽéš›ãĢ大文字/å°æ–‡å­—ã‚’į„ĄčĻ–ã™ã‚‹ãĢは、ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗã‚’č¨­åŽšã—ãžã™ ** + ** 検į´ĸやįŊŽæ›ãŽéš›ãĢ大文字/å°æ–‡å­—ã‚’į„ĄčĻ–ã™ã‚‹ãĢは、ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗã‚’č¨­åŽšã—ãžã™ã€‚ ** 1. æŦĄãŽæ§˜ãĢå…Ĩ力しãĻ 'ignore' を検į´ĸしぞしょう: /ignore n をæŠŧしãĻäŊ•åēĻか検į´ĸã‚’įš°ã‚Ščŋ”しぞす。 @@ -826,7 +826,7 @@ NOTE: įŊŽæ›ãƒĸãƒŧドはæŒŋå…ĨãƒĸãƒŧドãĢäŧŧãĻいぞすが、全ãĻぎã‚ŋイ 6. 大文字小文字ぎåŒēåˆĨã‚’į„ĄåŠšãĢするãĢはæŦĄãŽæ§˜ãĢå…Ĩ力しぞす: :set noic NOTE: マッチぎåŧˇčĒŋ襨į¤ēをやめるãĢはæŦĄãŽæ§˜ãĢå…Ĩ力しぞす: :nohlsearch -NOTE: 1つぎ検į´ĸã‚ŗãƒžãƒŗãƒ‰ã ã‘å¤§æ–‡å­—å°æ–‡å­—ãŽåŒēåˆĨをやめたいãĒらば、フãƒŦãƒŧã‚ēãĢ \c +NOTE: 1つぎ検į´ĸã‚ŗãƒžãƒŗãƒ‰ã ã‘å¤§æ–‡å­—å°æ–‡å­—ãŽåŒēåˆĨをやめたいãĒらば、čĒžåĨ内で \c をäŊŋį”¨ã—ãžã™: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 6 čρᴄ @@ -835,13 +835,13 @@ NOTE: 1つぎ検į´ĸã‚ŗãƒžãƒŗãƒ‰ã ã‘å¤§æ–‡å­—å°æ–‡å­—ãŽåŒēåˆĨをやめたい O (大文字) をã‚ŋイプするとã‚Ģãƒŧã‚ŊãƒĢãŽä¸ŠãŽčĄŒã§æŒŋå…ĨãƒĸãƒŧドãĢãĒる。 2. ã‚Ģãƒŧã‚ŊãƒĢ上ぎ文字ぎæŦĄã‹ã‚‰ãƒ†ã‚­ã‚šãƒˆã‚’čŋŊ加するãĢは a とã‚ŋイプする。 - 行æœĢãĢč‡Ē動でテキ゚トをæŒŋå…ĨするãĢは大文字 A をã‚ŋイプする。 + 行æœĢãĢテキ゚トをæŒŋå…ĨするãĢは大文字 A をã‚ŋイプする。 - 3. e ã‚ŗãƒžãƒŗãƒ‰ã¯å˜čĒžãŽįĩ‚į̝郍ã‚Ģãƒŧã‚ŊãƒĢをį§ģ動する。 + 3. e ã‚ŗãƒžãƒŗãƒ‰ã¯å˜čĒžãŽįĩ‚į̝ãĢã‚Ģãƒŧã‚ŊãƒĢをį§ģ動する。 4. y ã‚ĒペãƒŦãƒŧã‚ŋはテキ゚トを yank (ã‚ŗãƒ”ãƒŧ)し、p はそれを put (ペãƒŧ゚ト)する。 - 5. 大文字ぎ R をã‚ŋイプするとįŊŽæ›ãƒĸãƒŧドãĢå…Ĩり、をæŠŧすと抜ける。 + 5. 大文字ぎ R をã‚ŋイプするとįŊŽæ›ãƒĸãƒŧドãĢå…Ĩり、 をæŠŧすと抜ける。 6. ":set xxx" とã‚ŋイプするとã‚Ēãƒ—ã‚ˇãƒ§ãƒŗ "xxx" ãŒč¨­åŽšã•ã‚Œã‚‹ã€‚ 'ic' 'ignorecase' 検į´ĸ時ãĢ大文字小文字ぎåŒēåˆĨしãĒい @@ -849,7 +849,7 @@ NOTE: 1つぎ検į´ĸã‚ŗãƒžãƒŗãƒ‰ã ã‘å¤§æ–‡å­—å°æ–‡å­—ãŽåŒēåˆĨをやめたい 'hls' 'hlsearch' マッチするすずãĻをåŧˇčĒŋ襨į¤ēする é•ˇã„æ–šã€įŸ­ã„æ–šã€ãŠãĄã‚‰ãŽã‚Ēãƒ—ã‚ˇãƒ§ãƒŗåã§ã‚‚äŊŋį”¨ã§ããžã™ã€‚ - 7. ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗã‚’į„ĄåŠšãĢするãĢは "no" をäģ˜ä¸Žã—ぞす: :set noic + 7. ã‚Ēãƒ—ã‚ˇãƒ§ãƒŗã‚’į„ĄåŠšãĢするãĢは "no" をäģ˜ä¸Žã™ã‚‹: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ãƒŦãƒƒã‚šãƒŗ 7.1: ã‚ĒãƒŗãƒŠã‚¤ãƒŗãƒ˜ãƒĢãƒ—ã‚ŗãƒžãƒŗãƒ‰ @@ -883,15 +883,15 @@ NOTE: 1つぎ検į´ĸã‚ŗãƒžãƒŗãƒ‰ã ã‘å¤§æ–‡å­—å°æ–‡å­—ãŽåŒēåˆĨをやめたい äŊŋį”¨ä¸å¯ã¨ãĒãŖãĻã„ãžã™ã€‚ã‚ˆã‚Šå¤šããŽį‰šåž´ã‚’äŊŋいはじめるãĢは "vimrc" ãƒ•ã‚Ąã‚¤ãƒĢ をäŊœæˆã—ぞす。 - 1. "vimrc" ãƒ•ã‚Ąã‚¤ãƒĢãŽįˇ¨é›†ã‚’é–‹å§‹ã™ã‚‹ã€‚ã“ã‚Œã¯ã‚ˇã‚šãƒ†ãƒ ãĢ䞝存しぞす。 - :edit ~/.vimrc UNIX 向け - :edit $VIM/_vimrc Windows 向け + 1. "vimrc" ãƒ•ã‚Ąã‚¤ãƒĢãŽįˇ¨é›†ã‚’é–‹å§‹ã—ãžã™ã€‚ã“ã‚Œã¯ã‚ˇã‚šãƒ†ãƒ ãĢ䞝存しぞす。 + :e ~/.vimrc UNIX 向け + :e ~/_vimrc Windows 向け 2. ここでã‚ĩãƒŗãƒ—ãƒĢぎ "vimrc" をčĒ­ãŋčžŧãŋぞす。 - :read $VIMRUNTIME/vimrc_example.vim + :r $VIMRUNTIME/vimrc_example.vim 3. äģĨ下ぎようãĢãƒ•ã‚Ąã‚¤ãƒĢへ書きčžŧãŋぞす。 - :write + :w æŦĄå›ž Vim をčĩˇå‹•ã™ã‚‹ã¨ã€č‰˛ãĨけ構文がäŊŋえるようãĢãĒるでしょう。 こぎ "vimrc" ãƒ•ã‚Ąã‚¤ãƒĢへ、おåĨŊãŋãŽč¨­åŽšã‚’čŋŊ加することができぞす。 @@ -907,7 +907,7 @@ NOTE: 1つぎ検į´ĸã‚ŗãƒžãƒŗãƒ‰ã ã‘å¤§æ–‡å­—å°æ–‡å­—ãŽåŒēåˆĨをやめたい 2. įžåœ¨ãŽãƒ‡ã‚ŖãƒŦクトãƒĒãĢåœ¨ã‚‹ãƒ•ã‚Ąã‚¤ãƒĢを :!ls か :!dir でįĸēčĒã—ãžã™ã€‚ - 3. ã‚ŗãƒžãƒŗãƒ‰ãŽé–‹å§‹ã‚’ã‚ŋイプしぞす: :e + 3. ã‚ŗãƒžãƒŗãƒ‰ãŽå…ˆé ­ã‚’ã‚ŋイプしぞす: :e 4. CTRL-D をæŠŧすと Vim は "e" ã‹ã‚‰å§‹ãžã‚‹ã‚ŗãƒžãƒŗãƒ‰ãŽä¸€čĻ§ã‚’čĄ¨į¤ēしぞす。 @@ -955,7 +955,7 @@ NOTE: čŖœåŽŒã¯å¤šããŽã‚ŗãƒžãƒŗãƒ‰ã§å‹•äŊœã—ぞす。そしãĻ CTRL-D と ė„ 눌ëŸŦ ":edit" ëĒ…ë šė–´ëĨŧ ė™„ė„ąí•´ 봅니다. - 6. ė´ė œ ëšˆėš¸ 하나ëĨŧ ėļ”ę°€í•œ 뒤, ėĄ´ėžŦ 파ėŧ ė´ëĻ„ė„ ė•ž ëļ€ëļ„ė„ ėž…ë Ĩ합니다: :edit FIL + 6. ė´ė œ ëšˆėš¸ 하나ëĨŧ ėļ”ę°€í•œ 뒤, ėĄ´ėžŦ하는 파ėŧ ė´ëĻ„ė˜ ė•ž ëļ€ëļ„ė„ ėž…ë Ĩ합니다: :edit FIL 7. ė„ 눌ëŸŦ 파ėŧ ė´ëĻ„ė„ ė™„ė„ą ė‹œí‚ĩ니다. @@ -949,7 +949,7 @@ ce 는 ë‹¨ė–´ëĨŧ ėš˜í™˜í•˜ëŠ” 것 ëŋë§Œ ė•„ë‹ˆëŧ, ë‚´ėšŠė„ ė‚Ŋėž…í•  눘 ėžˆ ėļœíŒė‚Ŧ: New Riders ė´ ėą…ė€ ė™„ė „ížˆ ëš”ė— ëŒ€í•´ė„œë§Œ ë‹¤ëŖ¨ęŗ  ėžˆėŠĩ니다. 특히 ė´ˆëŗ´ėžë“¤ė—ę˛Œ ėœ ėšŠí•Šë‹ˆë‹¤. ë§Žė€ ė˜ˆė œė™€ ꡸ëĻŧė´ ėžˆėŠĩ니다. - ë‹¤ėŒė„ ė°¸ęŗ í•˜ė‹­ė‹œė˜¤: http://iccf-holland.org/click5.html + ë‹¤ėŒė„ ė°¸ęŗ í•˜ė‹­ė‹œė˜¤: https://iccf-holland.org/click5.html ë‹¤ėŒ ėą…ė€ ėĸ€ ė˜¤ëž˜ëœ ėą…ėœŧ로 ëš”ëŗ´ë‹¤ëŠ” Vi뗐 대해 ë‹¤ëŖ¨ęŗ  ėžˆė§€ë§Œ, ė—­ė‹œ ėļ”ė˛œí•  만 합니다: diff --git a/runtime/tutor/tutor.ko.euc b/runtime/tutor/tutor.ko.euc index 551b9a0ffbb9c..b93bb3be3c3ac 100644 --- a/runtime/tutor/tutor.ko.euc +++ b/runtime/tutor/tutor.ko.euc @@ -878,8 +878,8 @@ ce īŋŊĘŊīŋŊīŋŊĪ´īŋŊ. īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊáē¸īŋŊīŋŊīŋŊīŋŊ, "vimrc" īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊÕ´Ī´īŋŊ. 1. "vimrc" īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊÕŊôīŋŊ. īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊĪ´īŋŊ īŋŊÃŊīŋŊīŋŊÛŋīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊŲ¸īŋŊīŋŊĪ´īŋŊ: - :e ~/.vimrc UnixīŋŊīŋŊ īŋŊīŋŊīŋŊ - :e $VIM/_vimrc MS-WindowsīŋŊīŋŊ īŋŊīŋŊīŋŊ + :e ~/.vimrc UnixīŋŊīŋŊ īŋŊīŋŊīŋŊ + :e ~/_vimrc MS-WindowsīŋŊīŋŊ īŋŊīŋŊīŋŊ 2. īŋŊīŋŊīŋŊīŋŊ "vimrc"īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊĐžīŋŊīŋŊīŋŊÔ´Ī´īŋŊ: :r $VIMRUNTIME/vimrc_example.vim @@ -907,7 +907,7 @@ ce 5. īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ ":edit" īŋŊīŋŊīŋŊÉžî¸Ļ īŋŊĪŧīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊĪ´īŋŊ. - 6. īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊÄ­ īŋŊĪŗīŋŊīŋŊīŋŊ īŋŊß°īŋŊīŋŊīŋŊ īŋŊīŋŊ, īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊˏīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊÎēīŋŊīŋŊīŋŊ īŋŊÔˇīŋŊīŋŊÕ´Ī´īŋŊ: :edit FIL + 6. īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊÄ­ īŋŊĪŗīŋŊīŋŊīŋŊ īŋŊß°īŋŊīŋŊīŋŊ īŋŊīŋŊ, īŋŊīŋŊīŋŊīŋŊīŋŊĪ´īŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊˏīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊÎēīŋŊīŋŊīŋŊ īŋŊÔˇīŋŊīŋŊÕ´Ī´īŋŊ: :edit FIL 7. īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊˏīŋŊīŋŊīŋŊ īŋŊĪŧīŋŊ īŋŊīŋŊÅĩīŋŊĪ´īŋŊ. @@ -949,7 +949,7 @@ ce īŋŊīŋŊīŋŊĮģīŋŊ: New Riders īŋŊīŋŊ ÃĨīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊØŧīŋŊīŋŊīŋŊ īŋŊŲˇīŋŊīŋŊ īŋŊÖŊīŋŊīŋŊĪ´īŋŊ. ƯīŋŊīŋŊ īŋŊĘēīŋŊīŋŊÚĩéŋĄīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊÕ´Ī´īŋŊ. īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ׸īŋŊīŋŊīŋŊ īŋŊÖŊīŋŊīŋŊĪ´īŋŊ. - īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊĪŊĘŊÃŋīŋŊ: http://iccf-holland.org/click5.html + īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊĪŊĘŊÃŋīŋŊ: https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊ ÃĨīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ ÃĨīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊŲ´īŋŊ ViīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ īŋŊŲˇīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ, īŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊÃĩīŋŊīŋŊ īŋŊīŋŊ īŋŊÕ´Ī´īŋŊ: diff --git a/runtime/tutor/tutor.ko.utf-8 b/runtime/tutor/tutor.ko.utf-8 index 942fdb44a864f..993c43de8c7b6 100644 --- a/runtime/tutor/tutor.ko.utf-8 +++ b/runtime/tutor/tutor.ko.utf-8 @@ -878,8 +878,8 @@ ce 는 ë‹¨ė–´ëĨŧ ėš˜í™˜í•˜ëŠ” 것 ëŋë§Œ ė•„ë‹ˆëŧ, ë‚´ėšŠė„ ė‚Ŋėž…í•  눘 ėžˆ ė•ŠėŠĩ니다. 더 ë§Žė€ 기ëŠĨė„ ė¨ëŗ´ë ¤ëŠ´, "vimrc" ëŧ는 파ėŧė„ ë§Œë“¤ė–´ė•ŧ 합니다. 1. "vimrc" 파ėŧė„ ėˆ˜ė •í•Šė‹œë‹¤. ė´ 파ėŧė€ ė‚ŦėšŠí•˜ëŠ” ė‹œėŠ¤í…œė— 따ëŧ 다ëĻ…ë‹ˆë‹¤: - :e ~/.vimrc Unixė˜ ę˛Ŋ뚰 - :e $VIM/_vimrc MS-Windowsė˜ ę˛Ŋ뚰 + :e ~/.vimrc Unixė˜ ę˛Ŋ뚰 + :e ~/_vimrc MS-Windowsė˜ ę˛Ŋ뚰 2. ė´ė œ "vimrc"ė˜ 똈렜ëĨŧ ėŊė–´ë“¤ėž…ë‹ˆë‹¤: :r $VIMRUNTIME/vimrc_example.vim @@ -907,7 +907,7 @@ ce 는 ë‹¨ė–´ëĨŧ ėš˜í™˜í•˜ëŠ” 것 ëŋë§Œ ė•„ë‹ˆëŧ, ë‚´ėšŠė„ ė‚Ŋėž…í•  눘 ėžˆ 5. ė„ 눌ëŸŦ ":edit" ëĒ…ë šė–´ëĨŧ ė™„ė„ąí•´ 봅니다. - 6. ė´ė œ ëšˆėš¸ 하나ëĨŧ ėļ”ę°€í•œ 뒤, ėĄ´ėžŦ 파ėŧ ė´ëĻ„ė„ ė•ž ëļ€ëļ„ė„ ėž…ë Ĩ합니다: :edit FIL + 6. ė´ė œ ëšˆėš¸ 하나ëĨŧ ėļ”ę°€í•œ 뒤, ėĄ´ėžŦ하는 파ėŧ ė´ëĻ„ė˜ ė•ž ëļ€ëļ„ė„ ėž…ë Ĩ합니다: :edit FIL 7. ė„ 눌ëŸŦ 파ėŧ ė´ëĻ„ė„ ė™„ė„ą ė‹œí‚ĩ니다. @@ -949,7 +949,7 @@ ce 는 ë‹¨ė–´ëĨŧ ėš˜í™˜í•˜ëŠ” 것 ëŋë§Œ ė•„ë‹ˆëŧ, ë‚´ėšŠė„ ė‚Ŋėž…í•  눘 ėžˆ ėļœíŒė‚Ŧ: New Riders ė´ ėą…ė€ ė™„ė „ížˆ ëš”ė— ëŒ€í•´ė„œë§Œ ë‹¤ëŖ¨ęŗ  ėžˆėŠĩ니다. 특히 ė´ˆëŗ´ėžë“¤ė—ę˛Œ ėœ ėšŠí•Šë‹ˆë‹¤. ë§Žė€ ė˜ˆė œė™€ ꡸ëĻŧė´ ėžˆėŠĩ니다. - ë‹¤ėŒė„ ė°¸ęŗ í•˜ė‹­ė‹œė˜¤: http://iccf-holland.org/click5.html + ë‹¤ėŒė„ ė°¸ęŗ í•˜ė‹­ė‹œė˜¤: https://iccf-holland.org/click5.html ë‹¤ėŒ ėą…ė€ ėĸ€ ė˜¤ëž˜ëœ ėą…ėœŧ로 ëš”ëŗ´ë‹¤ëŠ” Vi뗐 대해 ë‹¤ëŖ¨ęŗ  ėžˆė§€ë§Œ, ė—­ė‹œ ėļ”ė˛œí•  만 합니다: diff --git a/runtime/tutor/tutor.lv.utf-8 b/runtime/tutor/tutor.lv.utf-8 index 8f7ab56e33a49..e1ca778d0321c 100644 --- a/runtime/tutor/tutor.lv.utf-8 +++ b/runtime/tutor/tutor.lv.utf-8 @@ -916,8 +916,8 @@ PIEZÄĒME: Ja vēlaties meklēt gan lielos, gan mazos burtus vienā meklējumā, pēc noklusÄ“ÅĄanas, nav ieslēgtas. Lai tās ieslēgtu, izveidojiet "vimrc" failu. 1. AtkarÄĢbā no lietotās operētājsistēmas, atveriet "vimrc" failu sekojoÅĄi: - :e ~/.vimrc Unix-veidÄĢgā (t.sk. MacOS un Linux) - :e $VIM/_vimrc VMS-veidÄĢgā (t.sk. MS-Windows) + :e ~/.vimrc Unix-veidÄĢgā (t.sk. MacOS un Linux) + :e ~/_vimrc VMS-veidÄĢgā (t.sk. MS-Windows) 2. Ielasiet "vimrc" ÅĄablona faila saturu, ievadot: :r $VIMRUNTIME/vimrc_example.vim @@ -986,7 +986,7 @@ PIEZÄĒME: PabeigÅĄana strādā daŞādām komandām. Vim - Vi Improved, Steve Oualline, New Riders Å ÄĢ grāmata ir tieÅĄi par Vim, un ir Äŧoti ieteicama iesācējiem. - Daudzi piemēri un attēli no tās pieejami: http://iccf-holland.org/click5.html + Daudzi piemēri un attēli no tās pieejami: https://iccf-holland.org/click5.html Otra, vecāka grāmata ir par Vi, nevis Vim, bet arÄĢ ir Äŧoti noderÄĢga: diff --git a/runtime/tutor/tutor.nb b/runtime/tutor/tutor.nb index 2f1d14c29087d..9eb6dfa93a6c8 100644 --- a/runtime/tutor/tutor.nb +++ b/runtime/tutor/tutor.nb @@ -884,7 +884,7 @@ Merk: Hvis du vil ignorere store/sm 1. Start redigeringen av īŋŊvimrcīŋŊ-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix - :e $VIM/_vimrc for MS Windows + :e ~/_vimrc for MS Windows 2. Les inn eksempelfilen for īŋŊvimrcīŋŊ: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ MERK: Fullf Utgiver: New Riders Den fīŋŊrste boken som er fullt og helt dedisert til Vim. Spesielt nyttig for nybegynnere. Inneholder mange eksempler og illustrasjoner. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Denne boken er eldre og handler mer om Vi enn Vim, men anbefales ogsīŋŊ: īŋŊLearning the Vi EditorīŋŊ av Linda Lamb diff --git a/runtime/tutor/tutor.nb.utf-8 b/runtime/tutor/tutor.nb.utf-8 index f9d49c2a24194..6a8a4e9463254 100644 --- a/runtime/tutor/tutor.nb.utf-8 +++ b/runtime/tutor/tutor.nb.utf-8 @@ -884,7 +884,7 @@ Merk: Hvis du vil ignorere store/smÃĨ bokstaver for kun en søkekommando, bruk 1. Start redigeringen av ÂĢvimrcÂģ-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix - :e $VIM/_vimrc for MS Windows + :e ~/_vimrc for MS Windows 2. Les inn eksempelfilen for ÂĢvimrcÂģ: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ MERK: Fullføring fungerer for mange kommandoer. Prøv ved ÃĨ trykke CTRL-D og Utgiver: New Riders Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for nybegynnere. Inneholder mange eksempler og illustrasjoner. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Denne boken er eldre og handler mer om Vi enn Vim, men anbefales ogsÃĨ: ÂĢLearning the Vi EditorÂģ av Linda Lamb diff --git a/runtime/tutor/tutor.nl b/runtime/tutor/tutor.nl index 3afa8a583d17b..eb5414d2dcc28 100644 --- a/runtime/tutor/tutor.nl +++ b/runtime/tutor/tutor.nl @@ -864,7 +864,7 @@ 1. Bewerk het bestand 'vimrc'. Hoe dat moet hangt af van je systeem: :e ~/.vimrc voor Unix - :e $VIM/_vimrc voor MS-Windows + :e ~/_vimrc voor MS-Windows 2. Lees de inhoud van het voorbeeld-bestand: :r $VIMRUNTIME/vimrc_example.vim @@ -927,7 +927,7 @@ Uitgever: New Riders Dit is het eerste boek dat geheel aan Vim is gewijd. Speciaal geschikt voor beginners. Met veel voorbeelden en afbeeldingen. - Zie http://iccf-holland.org/click5.html + Zie https://iccf-holland.org/click5.html Het volgende boek is ouder en gaat meer over Vi dan Vim, maar het wordt toch aanbevolen: diff --git a/runtime/tutor/tutor.nl.utf-8 b/runtime/tutor/tutor.nl.utf-8 index 2884ce3149486..1f4be70fefd5f 100644 --- a/runtime/tutor/tutor.nl.utf-8 +++ b/runtime/tutor/tutor.nl.utf-8 @@ -864,7 +864,7 @@ 1. Bewerk het bestand 'vimrc'. Hoe dat moet hangt af van je systeem: :e ~/.vimrc voor Unix - :e $VIM/_vimrc voor MS-Windows + :e ~/_vimrc voor MS-Windows 2. Lees de inhoud van het voorbeeld-bestand: :r $VIMRUNTIME/vimrc_example.vim @@ -927,7 +927,7 @@ Uitgever: New Riders Dit is het eerste boek dat geheel aan Vim is gewijd. Speciaal geschikt voor beginners. Met veel voorbeelden en afbeeldingen. - Zie http://iccf-holland.org/click5.html + Zie https://iccf-holland.org/click5.html Het volgende boek is ouder en gaat meer over Vi dan Vim, maar het wordt toch aanbevolen: diff --git a/runtime/tutor/tutor.no b/runtime/tutor/tutor.no index 2f1d14c29087d..9eb6dfa93a6c8 100644 --- a/runtime/tutor/tutor.no +++ b/runtime/tutor/tutor.no @@ -884,7 +884,7 @@ Merk: Hvis du vil ignorere store/sm 1. Start redigeringen av īŋŊvimrcīŋŊ-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix - :e $VIM/_vimrc for MS Windows + :e ~/_vimrc for MS Windows 2. Les inn eksempelfilen for īŋŊvimrcīŋŊ: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ MERK: Fullf Utgiver: New Riders Den fīŋŊrste boken som er fullt og helt dedisert til Vim. Spesielt nyttig for nybegynnere. Inneholder mange eksempler og illustrasjoner. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Denne boken er eldre og handler mer om Vi enn Vim, men anbefales ogsīŋŊ: īŋŊLearning the Vi EditorīŋŊ av Linda Lamb diff --git a/runtime/tutor/tutor.no.utf-8 b/runtime/tutor/tutor.no.utf-8 index f9d49c2a24194..6a8a4e9463254 100644 --- a/runtime/tutor/tutor.no.utf-8 +++ b/runtime/tutor/tutor.no.utf-8 @@ -884,7 +884,7 @@ Merk: Hvis du vil ignorere store/smÃĨ bokstaver for kun en søkekommando, bruk 1. Start redigeringen av ÂĢvimrcÂģ-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix - :e $VIM/_vimrc for MS Windows + :e ~/_vimrc for MS Windows 2. Les inn eksempelfilen for ÂĢvimrcÂģ: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ MERK: Fullføring fungerer for mange kommandoer. Prøv ved ÃĨ trykke CTRL-D og Utgiver: New Riders Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for nybegynnere. Inneholder mange eksempler og illustrasjoner. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Denne boken er eldre og handler mer om Vi enn Vim, men anbefales ogsÃĨ: ÂĢLearning the Vi EditorÂģ av Linda Lamb diff --git a/runtime/tutor/tutor.pl b/runtime/tutor/tutor.pl index 96aa45c90b728..e6834315686f0 100644 --- a/runtime/tutor/tutor.pl +++ b/runtime/tutor/tutor.pl @@ -888,7 +888,7 @@ 1. PoczīŋŊtek edycji pliku "vimrc" zaleīŋŊy od Twojego systemu: :edit ~/.vimrc dla Uniksa - :edit $VIM/_vimrc dla MS-Windows + :edit ~/_vimrc dla MS-Windows 2. Teraz wczytaj przykīŋŊadowy plik "vimrc": :read $VIMRUNTIME/vimrc_example.vim 3. Zapisz plik: @@ -954,7 +954,7 @@ Wydawca: New Riders Pierwsza ksiīŋŊīŋŊka caīŋŊkowicie poīŋŊwiīŋŊcona Vimowi. UīŋŊyteczna zwīŋŊaszcza dla poczīŋŊtkujīŋŊcych. Zawiera wiele przykīŋŊadīŋŊw i ilustracji. - Zobacz http://iccf-holland.org./click5.html + Zobacz https://iccf-holland.org./click5.html Starsza pozycja i bardziej o Vi niīŋŊ o Vimie, ale takīŋŊe warta polecenia: diff --git a/runtime/tutor/tutor.pl.cp1250 b/runtime/tutor/tutor.pl.cp1250 index 8c647e131d9f9..129f8ec4f5136 100644 --- a/runtime/tutor/tutor.pl.cp1250 +++ b/runtime/tutor/tutor.pl.cp1250 @@ -888,7 +888,7 @@ Uwaga: Aby ignorowa 1. PoczīŋŊtek edycji pliku "vimrc" zaleīŋŊy od Twojego systemu: :edit ~/.vimrc dla Uniksa - :edit $VIM/_vimrc dla MS-Windows + :edit ~/_vimrc dla MS-Windows 2. Teraz wczytaj przykīŋŊadowy plik "vimrc": :read $VIMRUNTIME/vimrc_example.vim 3. Zapisz plik: @@ -954,7 +954,7 @@ UWAGA: Uzupe Wydawca: New Riders Pierwsza ksiīŋŊīŋŊka caīŋŊkowicie poīŋŊwiīŋŊcona Vimowi. UīŋŊyteczna zwīŋŊaszcza dla poczīŋŊtkujīŋŊcych. Zawiera wiele przykīŋŊadīŋŊw i ilustracji. - Zobacz http://iccf-holland.org./click5.html + Zobacz https://iccf-holland.org./click5.html Starsza pozycja i bardziej o Vi niīŋŊ o Vimie, ale takīŋŊe warta polecenia: diff --git a/runtime/tutor/tutor.pl.utf-8 b/runtime/tutor/tutor.pl.utf-8 index 3faaaa801704b..7856837b65a23 100644 --- a/runtime/tutor/tutor.pl.utf-8 +++ b/runtime/tutor/tutor.pl.utf-8 @@ -888,7 +888,7 @@ Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c HīŋŊ algum texto faltando nes HīŋŊ algum texto faltando nesta linha. - HīŋŊ algum texto faltan ----> HīŋŊ algum texto faltando aqui. +---> HīŋŊ algum texto faltan + HīŋŊ algum texto faltando aqui. 5. Quando se sentir confortīŋŊvel adicionando texto, vīŋŊ para a LiīŋŊīŋŊo 1.6. @@ -901,7 +901,7 @@ NOTA: Se quiser ignorar a diferen 1. Comece a editar o arquivo "vimrc". Isso depende do sistema: :e ~/.vimrc para Unix - :e $VIM/_vimrc para MS-Windows + :e ~/_vimrc para MS-Windows 2. Agora, leia o conteīŋŊdo do arquivo "vimrc" de exemplo: :r $VIMRUNTIME/vimrc_example.vim @@ -975,7 +975,7 @@ NOTA: A completa Editora: New Riders Este īŋŊ o primeiro livro completamente dedicado ao Vim. Especialmente īŋŊtil para iniciantes, com muitos exemplos e ilustraīŋŊīŋŊes. - Veja http://iccf-holland.org/click5.html + Veja https://iccf-holland.org/click5.html Esse livro īŋŊ mais antigo e mais sobre o Vi do que sobre o Vim, mas tambīŋŊm īŋŊ recomendado: diff --git a/runtime/tutor/tutor.pt.utf-8 b/runtime/tutor/tutor.pt.utf-8 index be21ca5a124fa..9d8e758867753 100644 --- a/runtime/tutor/tutor.pt.utf-8 +++ b/runtime/tutor/tutor.pt.utf-8 @@ -131,8 +131,8 @@ NOTA: Enquanto segue este tutorial, nÃŖo tente memorizar, aprenda pelo uso. ---> HÃĄ algum texto faltando nes HÃĄ algum texto faltando nesta linha. - HÃĄ algum texto faltan ----> HÃĄ algum texto faltando aqui. +---> HÃĄ algum texto faltan + HÃĄ algum texto faltando aqui. 5. Quando se sentir confortÃĄvel adicionando texto, vÃĄ para a LiÃ§ÃŖo 1.6. @@ -900,8 +900,8 @@ NOTA: Se quiser ignorar a diferença entre maiÃēsculas e minÃēsculas em apenas arquivo "vimrc". 1. Comece a editar o arquivo "vimrc". Isso depende do sistema: - :e ~/.vimrc para Unix - :e $VIM/_vimrc para MS-Windows + :e ~/.vimrc para Unix + :e ~/_vimrc para MS-Windows 2. Agora, leia o conteÃēdo do arquivo "vimrc" de exemplo: :r $VIMRUNTIME/vimrc_example.vim @@ -975,7 +975,7 @@ NOTA: A completaÃ§ÃŖo funciona com muitos comandos. Basta pressionar CTRL-D e Editora: New Riders Este Ê o primeiro livro completamente dedicado ao Vim. Especialmente Ãētil para iniciantes, com muitos exemplos e ilustraçÃĩes. - Veja http://iccf-holland.org/click5.html + Veja https://iccf-holland.org/click5.html Esse livro Ê mais antigo e mais sobre o Vi do que sobre o Vim, mas tambÊm Ê recomendado: diff --git a/runtime/tutor/tutor.ru b/runtime/tutor/tutor.ru index f4bc62e86344c..d1b5fd6bf9545 100644 --- a/runtime/tutor/tutor.ru +++ b/runtime/tutor/tutor.ru @@ -916,7 +916,7 @@ 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ `vimrc'. īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: :e ~/.vimrc īŋŊīŋŊīŋŊ Unix - :e $VIM/_vimrc īŋŊīŋŊīŋŊ MS-Windows + :e ~/_vimrc īŋŊīŋŊīŋŊ MS-Windows 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ `vimrc': :r $VIMRUNTIME/vimrc_example.vim @@ -980,7 +980,7 @@ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vim. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ. - īŋŊīŋŊ. http://iccf-holland.org/click5.html + īŋŊīŋŊ. https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vi, īŋŊīŋŊīŋŊ Vim, īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: diff --git a/runtime/tutor/tutor.ru.cp1251 b/runtime/tutor/tutor.ru.cp1251 index 39a0019b85f87..4493f0ee323e5 100644 --- a/runtime/tutor/tutor.ru.cp1251 +++ b/runtime/tutor/tutor.ru.cp1251 @@ -916,7 +916,7 @@ 1. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊ `vimrc'. īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: :e ~/.vimrc īŋŊīŋŊīŋŊ Unix - :e $VIM/_vimrc īŋŊīŋŊīŋŊ MS-Windows + :e ~/_vimrc īŋŊīŋŊīŋŊ MS-Windows 2. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ `vimrc': :r $VIMRUNTIME/vimrc_example.vim @@ -980,7 +980,7 @@ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vim. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ. īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ. - īŋŊīŋŊ. http://iccf-holland.org/click5.html + īŋŊīŋŊ. https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ Vi, īŋŊīŋŊīŋŊ Vim, īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊ īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ: diff --git a/runtime/tutor/tutor.ru.utf-8 b/runtime/tutor/tutor.ru.utf-8 index aa9ba407ce927..0c13f5d4bf4f8 100644 --- a/runtime/tutor/tutor.ru.utf-8 +++ b/runtime/tutor/tutor.ru.utf-8 @@ -916,7 +916,7 @@ 1. ĐžŅ‚Ņ€ĐĩдаĐēŅ‚Đ¸Ņ€ŅƒĐšŅ‚Đĩ ĐŊĐžĐ˛Ņ‹Đš Ņ„Đ°ĐšĐģ `vimrc'. Đ•ĐŗĐž Ņ€Đ°ŅĐŋĐžĐģĐžĐļĐĩĐŊиĐĩ ĐˇĐ°Đ˛Đ¸ŅĐ¸Ņ‚ ĐžŅ‚ Đ¸ŅĐŋĐžĐģŅŒĐˇŅƒĐĩĐŧОК ŅĐ¸ŅŅ‚ĐĩĐŧŅ‹: :e ~/.vimrc Đ´ĐģŅ Unix - :e $VIM/_vimrc Đ´ĐģŅ MS-Windows + :e ~/_vimrc Đ´ĐģŅ MS-Windows 2. ĐĸĐĩĐŋĐĩŅ€ŅŒ ĐŋŅ€ĐžŅ‡Đ¸Ņ‚Đ°ĐšŅ‚Đĩ ĐŋŅ€Đ¸ĐŧĐĩŅ€ Ņ„Đ°ĐšĐģа `vimrc': :r $VIMRUNTIME/vimrc_example.vim @@ -980,7 +980,7 @@ Đ­Ņ‚Đ° ĐēĐŊĐ¸ĐŗĐ° ĐŋĐžĐģĐŊĐžŅŅ‚ŅŒŅŽ ĐŋĐžŅĐ˛ŅŅ‰ĐĩĐŊа Vim. ĐžŅĐžĐąĐĩĐŊĐŊĐž ĐŋĐžĐģĐĩСĐŊа ĐžĐŊа ĐąŅƒĐ´ĐĩŅ‚ ĐŊĐžĐ˛Đ¸Ņ‡ĐēаĐŧ. ХОдĐĩŅ€ĐļĐ¸Ņ‚ ĐŧĐŊĐžĐļĐĩŅŅ‚Đ˛Đž ĐŋŅ€Đ¸ĐŧĐĩŅ€ĐžĐ˛ и иĐģĐģŅŽŅŅ‚Ņ€Đ°Ņ†Đ¸Đš. - ĐĄĐŧ. http://iccf-holland.org/click5.html + ĐĄĐŧ. https://iccf-holland.org/click5.html ĐĄĐģĐĩĐ´ŅƒŅŽŅ‰Đ°Ņ ĐēĐŊĐ¸ĐŗĐ° йОĐģĐĩĐĩ ĐŋĐžŅ‡Ņ‚ĐĩĐŊĐŊĐžĐŗĐž Đ˛ĐžĐˇŅ€Đ°ŅŅ‚Đ° и ĐŋĐžŅĐ˛ŅŅ‰ĐĩĐŊа йОĐģҌ҈Đĩ Vi, ҇ĐĩĐŧ Vim, ОдĐŊаĐēĐž Ņ‚Đ°ĐēĐļĐĩ Ņ€ĐĩĐēĐžĐŧĐĩĐŊĐ´ŅƒĐĩŅ‚ŅŅ: diff --git a/runtime/tutor/tutor.sk b/runtime/tutor/tutor.sk index 671bab91c9cfc..35b04c804bf7e 100644 --- a/runtime/tutor/tutor.sk +++ b/runtime/tutor/tutor.sk @@ -916,7 +916,7 @@ POZN 1. ZaīŋŊni editovaīŋŊ "vimrc" sīŋŊbor, to zīŋŊvisīŋŊ na pouīŋŊitom systīŋŊme: :e ~/.vimrc pre Unix - :e $VIM/_vimrc pre MS-Windows + :e ~/_vimrc pre MS-Windows 2. Teraz si preīŋŊīŋŊtaj text prīŋŊkladu "vimrc" sīŋŊboru: @@ -986,7 +986,7 @@ POZN VydavateīŋŊ: New Riders PrvīŋŊ kniha urīŋŊenīŋŊ pre Vim. īŋŊpeciīŋŊlne vhodnīŋŊ pre zaīŋŊiatoīŋŊnīŋŊkov. Obsahuje mnoīŋŊstvo prīŋŊkladov a obrīŋŊzkov. - Pozri na http://iccf-holland.org/click5.html + Pozri na https://iccf-holland.org/click5.html TīŋŊto kniha je starīŋŊia a je viac o Vi ako o Vim, ale je tieīŋŊ odporīŋŊīŋŊanīŋŊ: Learning the Vi Editor - od Linda Lamb diff --git a/runtime/tutor/tutor.sk.cp1250 b/runtime/tutor/tutor.sk.cp1250 index cc4675fcf0c2c..a1aee207c5fec 100644 --- a/runtime/tutor/tutor.sk.cp1250 +++ b/runtime/tutor/tutor.sk.cp1250 @@ -916,7 +916,7 @@ POZN 1. ZaīŋŊni editovaīŋŊ "vimrc" sīŋŊbor, to zīŋŊvisīŋŊ na pouīŋŊitom systīŋŊme: :e ~/.vimrc pre Unix - :e $VIM/_vimrc pre MS-Windows + :e ~/_vimrc pre MS-Windows 2. Teraz si preīŋŊīŋŊtaj text prīŋŊkladu "vimrc" sīŋŊboru: @@ -986,7 +986,7 @@ POZN VydavateīŋŊ: New Riders PrvīŋŊ kniha urīŋŊenīŋŊ pre Vim. īŋŊpeciīŋŊlne vhodnīŋŊ pre zaīŋŊiatoīŋŊnīŋŊkov. Obsahuje mnoīŋŊstvo prīŋŊkladov a obrīŋŊzkov. - Pozri na http://iccf-holland.org/click5.html + Pozri na https://iccf-holland.org/click5.html TīŋŊto kniha je starīŋŊia a je viac o Vi ako o Vim, ale je tieīŋŊ odporīŋŊīŋŊanīŋŊ: Learning the Vi Editor - od Linda Lamb diff --git a/runtime/tutor/tutor.sk.utf-8 b/runtime/tutor/tutor.sk.utf-8 index c62995dad5c56..d25e9cbfe999e 100644 --- a/runtime/tutor/tutor.sk.utf-8 +++ b/runtime/tutor/tutor.sk.utf-8 @@ -916,7 +916,7 @@ POZNÁMKA: Ak chceÅĄ nerozlyÅĄovaÅĨ veÄžkosÅĨ písmen len pre jedno 1. Začni editovaÅĨ "vimrc" sÃēbor, to zÃĄvisí na pouÅžitom systÊme: :e ~/.vimrc pre Unix - :e $VIM/_vimrc pre MS-Windows + :e ~/_vimrc pre MS-Windows 2. Teraz si prečítaj text príkladu "vimrc" sÃēboru: @@ -986,7 +986,7 @@ POZNÁMKA: Dokončovanie funguje pre veÄža príkazov. VyskÃēÅĄaj stlačenie VydavateÄž: New Riders PrvÃĄ kniha určenÃĄ pre Vim. Å peciÃĄlne vhodnÃĄ pre začiatočníkov. Obsahuje mnoÅžstvo príkladov a obrÃĄzkov. - Pozri na http://iccf-holland.org/click5.html + Pozri na https://iccf-holland.org/click5.html TÃĄto kniha je starÅĄia a je viac o Vi ako o Vim, ale je tieÅž odporÃēčanÃĄ: Learning the Vi Editor - od Linda Lamb diff --git a/runtime/tutor/tutor.sr.cp1250 b/runtime/tutor/tutor.sr.cp1250 index a99aacc34ab68..c4d0064cd8911 100644 --- a/runtime/tutor/tutor.sr.cp1250 +++ b/runtime/tutor/tutor.sr.cp1250 @@ -882,7 +882,7 @@ NAPOMENA: Ako 1. Otvorite "vimrc" fajl. Ovo zavisi od vaīŋŊeg sistema: :e ~/.vimrc za Unix - :e $VIM/_vimrc za MS-Windows + :e ~/_vimrc za MS-Windows 2. Onda uīŋŊitajte primer sadrīŋŊaja "vimrc" fajla: :r $VIMRUNTIME/vimrc_example.vim @@ -951,7 +951,7 @@ NAPOMENA: Mogu IzdavaīŋŊ: New Riders Prva knjiga potpuno posveīŋŊena Vim-u. NaroīŋŊito korisna za poīŋŊetnike. Ima mnoīŋŊtvo primera i slika. - Vidite http://iccf-holland.org/click5.html + Vidite https://iccf-holland.org/click5.html SledeīŋŊa knjiga je starija i viīŋŊe govori o Vi-u nego o Vim-u, ali je takoīŋŊe preporuīŋŊujemo: diff --git a/runtime/tutor/tutor.sr.utf-8 b/runtime/tutor/tutor.sr.utf-8 index d9115d82facdd..5bad8483c441e 100644 --- a/runtime/tutor/tutor.sr.utf-8 +++ b/runtime/tutor/tutor.sr.utf-8 @@ -882,7 +882,7 @@ NAPOMENA: Ako Åželite da ne razlikujete veličinu slova u samo jednoj komandi 1. Otvorite "vimrc" fajl. Ovo zavisi od vaÅĄeg sistema: :e ~/.vimrc za Unix - :e $VIM/_vimrc za MS-Windows + :e ~/_vimrc za MS-Windows 2. Onda učitajte primer sadrÅžaja "vimrc" fajla: :r $VIMRUNTIME/vimrc_example.vim @@ -951,7 +951,7 @@ NAPOMENA: Moguće je dopuniti mnoge komande. Samo probajte CTRL-D i . Izdavač: New Riders Prva knjiga potpuno posvećena Vim-u. Naročito korisna za početnike. Ima mnoÅĄtvo primera i slika. - Vidite http://iccf-holland.org/click5.html + Vidite https://iccf-holland.org/click5.html Sledeća knjiga je starija i viÅĄe govori o Vi-u nego o Vim-u, ali je takođe preporučujemo: diff --git a/runtime/tutor/tutor.sv b/runtime/tutor/tutor.sv index 59f0f65f90eff..42836a801def7 100644 --- a/runtime/tutor/tutor.sv +++ b/runtime/tutor/tutor.sv @@ -786,8 +786,8 @@ Notera: Detta undviker att beh standard. FīŋŊr att bīŋŊrja anvīŋŊnda fler funktioner mīŋŊste du skapa en "vimrc"-fil. 1. BīŋŊrja redigera "vimrc"-filen, detta beror pīŋŊ ditt system: - :edit ~/.vimrc fīŋŊr Unix - :edit $VIM/_vimrc fīŋŊr MS-Windows + :edit ~/.vimrc fīŋŊr Unix + :edit ~/_vimrc fīŋŊr MS-Windows 2. LīŋŊs nu texten i exempel "vimrc"-filen: @@ -812,7 +812,7 @@ Notera: Detta undviker att beh FīŋŊrlag: New Riders Den fīŋŊrsta boken som īŋŊr endast behandlar Vim. Speciellt anvīŋŊndbar fīŋŊr nybīŋŊrjare. Det finns mīŋŊnga exempel och bilder. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Den hīŋŊr boken īŋŊr īŋŊldre och behandlar mer Vi īŋŊn Vim, men rekommenderas ocksīŋŊ: Learning the Vi Editor - av Linda Lamb diff --git a/runtime/tutor/tutor.sv.utf-8 b/runtime/tutor/tutor.sv.utf-8 index 967fc82a72116..c8cacc6240453 100644 --- a/runtime/tutor/tutor.sv.utf-8 +++ b/runtime/tutor/tutor.sv.utf-8 @@ -786,8 +786,8 @@ Notera: Detta undviker att behÃļva skriva i , det sista tecknet, texten att standard. FÃļr att bÃļrja använda fler funktioner mÃĨste du skapa en "vimrc"-fil. 1. BÃļrja redigera "vimrc"-filen, detta beror pÃĨ ditt system: - :edit ~/.vimrc fÃļr Unix - :edit $VIM/_vimrc fÃļr MS-Windows + :edit ~/.vimrc fÃļr Unix + :edit ~/_vimrc fÃļr MS-Windows 2. Läs nu texten i exempel "vimrc"-filen: @@ -812,7 +812,7 @@ Notera: Detta undviker att behÃļva skriva i , det sista tecknet, texten att FÃļrlag: New Riders Den fÃļrsta boken som är endast behandlar Vim. Speciellt användbar fÃļr nybÃļrjare. Det finns mÃĨnga exempel och bilder. - Se http://iccf-holland.org/click5.html + Se https://iccf-holland.org/click5.html Den här boken är äldre och behandlar mer Vi än Vim, men rekommenderas ocksÃĨ: Learning the Vi Editor - av Linda Lamb diff --git a/runtime/tutor/tutor.tr.iso9 b/runtime/tutor/tutor.tr.iso9 index d3a7405216f85..601b54a5839be 100644 --- a/runtime/tutor/tutor.tr.iso9 +++ b/runtime/tutor/tutor.tr.iso9 @@ -1,8 +1,8 @@ -=============================================================================== -= V I M T u t o r ' a h o īŋŊ g e l d i n i z ! - SīŋŊrīŋŊm 1.7 = -=============================================================================== +================================================================================ += V I M T u t o r ' a h o īŋŊ g e l d i n i z ! -- SīŋŊrīŋŊm 1.7 = +================================================================================ - Vim, bu gibi bir eīŋŊitmen ile aīŋŊīŋŊklanmasīŋŊ gereken īŋŊok fazla komut barīŋŊndīŋŊran, + Vim, bīŋŊyle bir eīŋŊitmen ile aīŋŊīŋŊklanmasīŋŊ gereken īŋŊok fazla komut barīŋŊndīŋŊran, oldukīŋŊa kuvvetli bir metin dīŋŊzenleyicidir. Bu eīŋŊitmen Vim'i īŋŊok amaīŋŊlīŋŊ bir dīŋŊzenleyici olarak kolaylīŋŊkla kullanabileceīŋŊiniz yeterli sayīŋŊda komutu aīŋŊīŋŊklamak iīŋŊin tasarlanmīŋŊīŋŊtīŋŊr. @@ -16,27 +16,28 @@ īŋŊalīŋŊīŋŊtīŋŊrdīŋŊysanīŋŊz zaten bir kopyasīŋŊnīŋŊ almīŋŊīŋŊ oldunuz). Bu eīŋŊitmenin kullanarak īŋŊīŋŊretmek iīŋŊin tasarlandīŋŊīŋŊīŋŊnīŋŊ unutmamak īŋŊnemlidir. - Bu īŋŊu anlama gelir; komutlarīŋŊ īŋŊīŋŊrenmek iīŋŊin doīŋŊru bir īŋŊekilde īŋŊalīŋŊīŋŊtīŋŊrmanīŋŊz - gerekir. EīŋŊer sadece yazīŋŊlanlarīŋŊ okursanīŋŊz komutlarīŋŊ unutursunuz. + Bu īŋŊu anlama gelir; komutlarīŋŊ īŋŊīŋŊrenmek iīŋŊin doīŋŊru bir īŋŊekilde īŋŊalīŋŊīŋŊtīŋŊrma- + nīŋŊz gerekir. EīŋŊer sadece yazīŋŊlanlarīŋŊ okursanīŋŊz komutlarīŋŊ unutursunuz. - īŋŊimdi Caps-Lock dīŋŊīŋŊmenizin basīŋŊlīŋŊ olmadīŋŊīŋŊīŋŊna emin olun ve Ders 1.1'in + īŋŊimdi Caps Lock dīŋŊīŋŊmenizin basīŋŊlīŋŊ olmadīŋŊīŋŊīŋŊna emin olun ve Ders 1.1'in ekranīŋŊ tamamen doldurmasīŋŊ iīŋŊin j dīŋŊīŋŊmesine yeterli miktarda basīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.1: īŋŊMLECīŋŊ HAREKET ETTīŋŊRMEK -īŋŊevirmen Notu: TīŋŊm derslerde gīŋŊrdīŋŊīŋŊīŋŊnīŋŊzde bu dīŋŊīŋŊmeye basmanīŋŊz gerekir. + +īŋŊevirmen Notu: TīŋŊm derslerde gīŋŊrdīŋŊīŋŊīŋŊnīŋŊzde bu dīŋŊīŋŊmeye basīŋŊn. ** īŋŊmleci hareket ettirmek iīŋŊin h,j,k,l dīŋŊīŋŊmelerine basīŋŊn. ** ^ - k īŋŊpucu: h dīŋŊīŋŊmesi soldadīŋŊr ve sola doīŋŊru hareket eder. - < h l > l dīŋŊīŋŊmesi saīŋŊdadīŋŊr ve saīŋŊa doīŋŊru hareket eder. - j j dīŋŊīŋŊmesi aīŋŊaīŋŊīŋŊ doīŋŊru bir oka benzer. + k īŋŊpucu: h dīŋŊīŋŊmesi soldadīŋŊr ve sola doīŋŊru hareket eder. + < h l > l dīŋŊīŋŊmesi saīŋŊdadīŋŊr ve saīŋŊa doīŋŊru hareket eder. + j j dīŋŊīŋŊmesi aīŋŊaīŋŊīŋŊ doīŋŊru bir oka benzer. v 1. īŋŊmleci kendinizi rahat hissedinceye dek ekranda dolaīŋŊtīŋŊrīŋŊn. - 2. j dīŋŊīŋŊmesini kendisini yineleyinceye dek basīŋŊlīŋŊ tutun. + 2. j dīŋŊīŋŊmesine basīŋŊn ve ekranīŋŊn aīŋŊaīŋŊīŋŊya kaydīŋŊīŋŊīŋŊnīŋŊ gīŋŊrīŋŊn. 3. AīŋŊaīŋŊīŋŊ dīŋŊīŋŊmesini kullanarak, Ders 1.2'ye geīŋŊin. @@ -46,7 +47,7 @@ NOT: Ok dīŋŊīŋŊmeleri de aynīŋŊ iīŋŊe yarar. Ancak hjkl dīŋŊīŋŊmelerini kullanarak īŋŊok daha hīŋŊzlīŋŊ hareket edebilirsiniz. GerīŋŊekten. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.2: VīŋŊM'DEN īŋŊIKIīŋŊ @@ -64,7 +65,7 @@ 5. īŋŊmleci Ders 1.3'e taīŋŊīŋŊyīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.3: METīŋŊN DīŋŊZENLEME - METīŋŊN SīŋŊLME @@ -84,7 +85,7 @@ NOT: Bu eīŋŊitmende ilerledikīŋŊe ezberlemeye īŋŊalīŋŊīŋŊmayīŋŊn, deneyerek īŋŊīŋŊrenin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.4: METīŋŊN DīŋŊZENLEME - METīŋŊN GīŋŊRME @@ -92,8 +93,8 @@ 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ īŋŊLK satīŋŊra gīŋŊtīŋŊrīŋŊn. - 2. īŋŊlk satīŋŊrīŋŊ ikincisinin aynīŋŊsīŋŊ gibi yapmak iīŋŊin, imleci eklenmesi gereken - metinden sonraki ilk karakterin īŋŊzerine gīŋŊtīŋŊrīŋŊn. + 2. īŋŊlk satīŋŊrīŋŊ ikincisinin aynīŋŊsīŋŊ gibi yapmak iīŋŊin, imleci eklenmesi + gereken metinden sonraki ilk karakterin īŋŊzerine gīŋŊtīŋŊrīŋŊn. 3. i'ye basīŋŊn ve gerekli eklemeleri yapīŋŊn. @@ -105,7 +106,7 @@ 5. ArtīŋŊk yapabildiīŋŊinizi dīŋŊīŋŊīŋŊnīŋŊyorsanīŋŊz bir sonraki bīŋŊlīŋŊme geīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.5: METīŋŊN DīŋŊZENLEME - METīŋŊN EKLEME @@ -128,7 +129,7 @@ 5. ArtīŋŊk rahatīŋŊa metin ekleyebildiīŋŊinizi dīŋŊīŋŊīŋŊnīŋŊyorsanīŋŊz Ders 1.6'ya geīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.6: DOSYA DīŋŊZENLEME @@ -137,7 +138,7 @@ !! NOT: AīŋŊaīŋŊīŋŊdaki adīŋŊmlarīŋŊ uygulamadan īŋŊnce tīŋŊm bu bīŋŊlīŋŊmīŋŊ iyice okuyun! 1. Bu eīŋŊitmeni Ders 1.2'de yaptīŋŊīŋŊīŋŊnīŋŊz gibi :q! yazarak kapatīŋŊn. Veya baīŋŊka - bir uīŋŊbirime eriīŋŊiminiz varsa orada yapīŋŊn. + bir uīŋŊbirime eriīŋŊiminiz varsa orada yapīŋŊn. 2. Komut istemi ekranīŋŊnda īŋŊu komutu girin: vim tutor . 'vim', Vim dīŋŊzenleyicisini aīŋŊmak iīŋŊin kullanacaīŋŊīŋŊnīŋŊz komut olup 'tutor' da @@ -153,7 +154,7 @@ 6. YukarīŋŊdaki adīŋŊmlarīŋŊ okuduktan ve anladīŋŊktan sonra YAPIN. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1: īŋŊZET @@ -179,12 +180,12 @@ i metin girin imleīŋŊten īŋŊnce girer A metin girin satīŋŊrdan sonra ekler - NOT: dīŋŊīŋŊmesine basmak sizi Normal kipe geri dīŋŊndīŋŊrīŋŊr veya istenmeyen ve - yarīŋŊm yazīŋŊlmīŋŊīŋŊ bir komutu iptal eder. + NOT: dīŋŊīŋŊmesine basmak sizi Normal kipe geri dīŋŊndīŋŊrīŋŊr veya istenmeyen + veya yarīŋŊm yazīŋŊlmīŋŊīŋŊ bir komutu iptal eder. īŋŊimdi Ders 2 ile bu eīŋŊitmeni sīŋŊrdīŋŊrīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.1: SīŋŊLME KOMUTLARI @@ -206,8 +207,8 @@ 5. TīŋŊmce dīŋŊzelene kadar adīŋŊm 3 ve 4'īŋŊ tekrar edin ve Ders 2.2'ye geīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 2.2: DAHA FAZLA SīŋŊLME KOMUTU + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 2.2: DAHA FAZLA SīŋŊLME KOMUTLARI ** SatīŋŊrīŋŊ sonuna kadar silmek iīŋŊin d$ yazīŋŊn. ** @@ -228,19 +229,19 @@ 5. Neler olduīŋŊunu anlamak iīŋŊin Ders 2.3'e gidin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 2.3: īŋŊīŋŊLETMENLER VE HAREKETLER + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 2.3: īŋŊīŋŊLEīŋŊLER VE HAREKETLER - Metin deīŋŊiīŋŊtiren birīŋŊok komut iīŋŊletmenler ve eklerden oluīŋŊur. Bir d iīŋŊletmeni + Metin deīŋŊiīŋŊtiren birīŋŊok komut iīŋŊleīŋŊler ve eklerden oluīŋŊur. Bir d iīŋŊleci iīŋŊeren silme komutu iīŋŊin kullanīŋŊlan biīŋŊim aīŋŊaīŋŊīŋŊdaki gibidir: d hareket Burada: - d - silme iīŋŊletmenidir. - hareket - iīŋŊletmenin neyi iīŋŊleteceīŋŊidir (aīŋŊaīŋŊīŋŊda listelenmiīŋŊtir). + d - silme iīŋŊlecidir. + hareket - iīŋŊlecin neyi iīŋŊleteceīŋŊidir (aīŋŊaīŋŊīŋŊda listelenmiīŋŊtir). Hareketlerin kīŋŊsa bir listesi iīŋŊin: @@ -250,14 +251,14 @@ Demeli ki, de komutunu girmek imleīŋŊten sīŋŊzcīŋŊīŋŊīŋŊn sonuna kadar siler. - NOT: Normal kipte hiīŋŊbir hareket olmadan yalnīŋŊzca iīŋŊletmeni girmek imleci + NOT: Normal kipte hiīŋŊbir hareket olmadan yalnīŋŊzca iīŋŊleci girmek imleci yukarīŋŊda belirtildiīŋŊi gibi hareket ettirir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.4: BīŋŊR HAREKET īŋŊLE BīŋŊRLīŋŊKTE SAYIM KULLANMAK - ** Bir hareketten īŋŊnce sayīŋŊ kullanmak o hareketi sayīŋŊ kadar tekrarlatīŋŊr. ** + ** Bir hareketten īŋŊnce sayīŋŊ kullanmak o hareketi sayīŋŊca tekrarlatīŋŊr. ** 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ satīŋŊrīŋŊn BAīŋŊINA gīŋŊtīŋŊrīŋŊn. @@ -273,13 +274,13 @@ 6. Ders 2.5'e geīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.5: BīŋŊR SAYIM KULLANARAK DAHA FAZLA SīŋŊLME īŋŊīŋŊLEMīŋŊ - ** Bir iīŋŊletmen ile birlikte sayīŋŊ kullanmak iīŋŊletmeni o kadar tekrarlatīŋŊr. ** + ** Bir iīŋŊleīŋŊ ile birlikte sayīŋŊ kullanmak iīŋŊleci o kadar tekrarlatīŋŊr. ** - YukarīŋŊda sīŋŊzīŋŊ edilen silme iīŋŊletmeni ve hareketinin arasīŋŊna sayīŋŊ ekleyerek + YukarīŋŊda sīŋŊzīŋŊ edilen silme iīŋŊleci ve hareketinin arasīŋŊna sayīŋŊ ekleyerek yapīŋŊlan iīŋŊlemi o sayīŋŊ kadar tekrarlatabilirsiniz. d [sayīŋŊ] hareket @@ -294,7 +295,7 @@ ---> Bu ABC īŋŊDE satīŋŊrdaki FGīŋŊ HIīŋŊ JKLM NOīŋŊ PRSīŋŊT sīŋŊzcīŋŊkler UīŋŊ VY temizlenmiīŋŊtir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.6: SATIRLARDA īŋŊīŋŊLEM YAPMA @@ -302,7 +303,7 @@ BīŋŊtīŋŊn bir satīŋŊr silme iīŋŊlemi īŋŊok sīŋŊk kullanīŋŊldīŋŊīŋŊīŋŊndan dolayīŋŊ, Vi tasarīŋŊmcīŋŊlarīŋŊ bir satīŋŊrīŋŊ tamamen silmek iīŋŊin iki d yazmanīŋŊn daha kolay - olduīŋŊuna karar verdiler. + olduīŋŊuna karar vermiīŋŊler. 1. īŋŊmleci aīŋŊaīŋŊīŋŊdaki tīŋŊmceciīŋŊin ikinci satīŋŊrīŋŊna gīŋŊtīŋŊrīŋŊn. @@ -320,11 +321,11 @@ ---> 6) īŋŊeker tatlīŋŊdīŋŊr ---> 7) Ve sen de īŋŊylesin -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.7: GERīŋŊ AL KOMUTU - ** Son komutu geri almak iīŋŊin u, bīŋŊtīŋŊn bir satīŋŊrīŋŊ dīŋŊzeltmek iīŋŊin U yazīŋŊn. ** + ** Komutu geri almak iīŋŊin u, bīŋŊtīŋŊn bir satīŋŊrīŋŊ dīŋŊzeltmek iīŋŊin U yazīŋŊn. ** 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ satīŋŊrda ve ilk hatanīŋŊn īŋŊzerine koyun. @@ -345,7 +346,7 @@ 8. Bunlar son derece kullanīŋŊīŋŊlīŋŊ komutlardīŋŊr. īŋŊimdi Ders 2 īŋŊzete geīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2: īŋŊZET @@ -359,12 +360,12 @@ 5. Normal kipte bir komut biīŋŊimi īŋŊīŋŊyledir: - iīŋŊletmen [sayīŋŊ] hareket + iīŋŊleīŋŊ [sayīŋŊ] hareket burada: - iīŋŊletmen - ne yapīŋŊlacaīŋŊīŋŊ, silmek iīŋŊin d īŋŊrneīŋŊinde olduīŋŊu gibi + iīŋŊleīŋŊ - ne yapīŋŊlacaīŋŊīŋŊ, silmek iīŋŊin d īŋŊrneīŋŊinde olduīŋŊu gibi [sayīŋŊ] - komutun kaīŋŊ kere tekrar edeceīŋŊini gīŋŊsteren isteīŋŊe baīŋŊlīŋŊ sayīŋŊ - hareket - iīŋŊletmenin nice davranacaīŋŊīŋŊ, w (sīŋŊzcīŋŊk), $ (satīŋŊr sonu) gibi. + hareket - iīŋŊlecin nice davranacaīŋŊīŋŊ, w (sīŋŊzcīŋŊk), $ (satīŋŊr sonu) gibi 6. Bir satīŋŊrīŋŊn baīŋŊīŋŊna gelmek iīŋŊin sīŋŊfīŋŊr (0) kullanīŋŊn. @@ -372,7 +373,7 @@ Bir satīŋŊrdaki tīŋŊm deīŋŊiīŋŊiklikleri geri almak iīŋŊin U (bīŋŊyīŋŊk U) yazīŋŊn. Geri almalarīŋŊ geri almak iīŋŊin R kullanīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.1: KOY KOMUTU @@ -395,11 +396,11 @@ ---> c) AkīŋŊl īŋŊīŋŊrenilir, ---> a) GīŋŊller kīŋŊrmīŋŊzīŋŊdīŋŊr, -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.2: DEīŋŊīŋŊīŋŊTīŋŊR KOMUTU - ** īŋŊmlecin altīŋŊndaki karakteri baīŋŊkasīŋŊ ile deīŋŊiīŋŊtirmek iīŋŊin rx kullanīŋŊn. ** + ** īŋŊmlecin altīŋŊndaki karakteri baīŋŊkasīŋŊ ile deīŋŊiīŋŊtirmek iīŋŊin rx yapīŋŊn. ** 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ īŋŊLK satīŋŊra gīŋŊtīŋŊrīŋŊn. @@ -416,11 +417,11 @@ NOT: UnutmayīŋŊn, ezberleyerek deīŋŊil deneyerek īŋŊīŋŊrenin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 3.3: DEīŋŊīŋŊīŋŊTīŋŊR īŋŊīŋŊLETMENīŋŊ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 3.3: DEīŋŊīŋŊīŋŊTīŋŊR īŋŊīŋŊLECīŋŊ - ** Bir sīŋŊzcīŋŊīŋŊīŋŊ imleīŋŊten sīŋŊzcīŋŊk sonuna kadar deīŋŊiīŋŊtirmek iīŋŊin ce kullanīŋŊn. ** + ** Bir sīŋŊzcīŋŊīŋŊīŋŊ imleīŋŊten sīŋŊzcīŋŊk sonuna kadar deīŋŊiīŋŊtirmek iīŋŊin ce yapīŋŊn. ** 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ īŋŊLK satīŋŊra gīŋŊtīŋŊrīŋŊn. @@ -435,16 +436,16 @@ ---> Bu sutar deīŋŊiīŋŊtir komutu ile deīŋŊiīŋŊneli gereken birkaīŋŊ mīŋŊzgīŋŊīŋŊ iīŋŊeriyor. ---> Bu satīŋŊr deīŋŊiīŋŊtir komutu ile deīŋŊiīŋŊmesi gereken birkaīŋŊ sīŋŊzcīŋŊk iīŋŊeriyor. - ce'nin sadece sīŋŊzcīŋŊīŋŊīŋŊ deīŋŊiīŋŊtirmediīŋŊini, aynīŋŊ zamanda sizi INSERT kipine + ce'nin sadece sīŋŊzcīŋŊīŋŊīŋŊ deīŋŊiīŋŊtirmediīŋŊini, aynīŋŊ zamanda sizi EKLE kipine aldīŋŊīŋŊīŋŊna da dikkat edin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.4: c'YīŋŊ KULLANARAK DAHA FAZLA DEīŋŊīŋŊīŋŊTīŋŊRME - ** DeīŋŊiīŋŊtir iīŋŊletmeni sil komutu ile aynīŋŊ hareketlerle kullanīŋŊlīŋŊr. ** + ** DeīŋŊiīŋŊtir iīŋŊleci sil komutu ile aynīŋŊ hareketlerle kullanīŋŊlīŋŊr. ** - 1. DeīŋŊiīŋŊtir iīŋŊletmeni sil ile aynīŋŊ yolla īŋŊalīŋŊīŋŊīŋŊr. BiīŋŊim īŋŊīŋŊyledir: + 1. DeīŋŊiīŋŊtir iīŋŊleci sil ile aynīŋŊ yolla īŋŊalīŋŊīŋŊīŋŊr. BiīŋŊim īŋŊīŋŊyledir: c [sayīŋŊ] hareket @@ -461,7 +462,7 @@ ---> Bu satīŋŊrīŋŊn sonu dīŋŊzeltilmek iīŋŊin c$ komutu kullanīŋŊlarak yardīŋŊma ihtiyaīŋŊ duyuyor. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3: īŋŊZET @@ -472,7 +473,7 @@ 2. īŋŊmlecin altīŋŊndaki karakteri deīŋŊiīŋŊtirmek iīŋŊin īŋŊnce r ardīŋŊndan da yazmak istediīŋŊiniz karakteri yazīŋŊn. - 3. DeīŋŊiīŋŊtir iīŋŊletmeni belirlenen nesneyi, imleīŋŊten hareketin sonuna kadar + 3. DeīŋŊiīŋŊtir iīŋŊleci belirlenen nesneyi, imleīŋŊten hareketin sonuna kadar deīŋŊiīŋŊtirme imkanīŋŊ verir. īŋŊrneīŋŊin, bir sīŋŊzcīŋŊīŋŊīŋŊ imleīŋŊten sīŋŊzcīŋŊk sonuna kadar deīŋŊiīŋŊtirmek iīŋŊin cw, bir satīŋŊrīŋŊn tamamīŋŊnīŋŊ deīŋŊiīŋŊtirmek iīŋŊinse c$ yazīŋŊn. @@ -483,7 +484,7 @@ īŋŊimdi bir sonraki derse geīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.1: īŋŊMLEīŋŊ KONUMU VE DOSYA DURUMU @@ -507,7 +508,7 @@ 4. YapabileceīŋŊinizi dīŋŊīŋŊīŋŊndīŋŊīŋŊīŋŊnīŋŊzde, adīŋŊm 1'den 3'e kadar yapīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.2: ARAMA KOMUTU @@ -526,10 +527,10 @@ ---> "hatttaa" hatayīŋŊ yazmanīŋŊn doīŋŊru yolu deīŋŊil; hatttaa bir hata. -Not: Arama dosyanīŋŊn sonuna ulaīŋŊtīŋŊīŋŊīŋŊnda dosyanīŋŊn baīŋŊīŋŊndan sīŋŊrecektir. Bunu devre - dīŋŊīŋŊīŋŊ bīŋŊrakmak iīŋŊin 'wrapscan' seīŋŊeneīŋŊini sīŋŊfīŋŊrlayīŋŊn. +Not: Arama dosyanīŋŊn sonuna ulaīŋŊtīŋŊīŋŊīŋŊnda dosyanīŋŊn baīŋŊīŋŊndan sīŋŊrecektir. Bunu + devre dīŋŊīŋŊīŋŊ bīŋŊrakmak iīŋŊin 'wrapscan' seīŋŊeneīŋŊini sīŋŊfīŋŊrlayīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.3: UYAN AYRAīŋŊLAR ARAMASI @@ -543,7 +544,7 @@ Not: Arama dosyan 4. Uyan ilk parantezin īŋŊzerine geri dīŋŊnmek iīŋŊin yine % yazīŋŊn. - 5. īŋŊmleci baīŋŊka bir (), [] veya {} īŋŊzerine gīŋŊtīŋŊrīŋŊn ve % iīŋŊletmeninin neler + 5. īŋŊmleci baīŋŊka bir (), [] veya {} īŋŊzerine gīŋŊtīŋŊrīŋŊn ve % iīŋŊlecinin neler yaptīŋŊīŋŊīŋŊnīŋŊ gīŋŊzlemleyin. ---> Bu iīŋŊerisinde ( )'ler, ['ler ] ve {'ler } bulunan bir satīŋŊrdīŋŊr. @@ -551,7 +552,7 @@ Not: Arama dosyan NOT: Bu iīŋŊerisinde eīŋŊi olmayan ayraīŋŊlar bulunan bir programīŋŊn hatalarīŋŊnīŋŊ ayīŋŊklamak iīŋŊin son derece yararlīŋŊdīŋŊr. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.4: BUL/DEīŋŊīŋŊīŋŊTīŋŊR KOMUTU @@ -575,7 +576,7 @@ Not: Arama dosyan :%s/eski/yeni/gc yazīŋŊn. Bu tīŋŊm dosyadaki her oluīŋŊumu deīŋŊiīŋŊtirir ancak her birini deīŋŊiīŋŊtirmeden īŋŊnce bize sorar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4: īŋŊZET @@ -584,22 +585,22 @@ Not: Arama dosyan [sayīŋŊ] G belirtilen satīŋŊr numarasīŋŊna gider. gg ilk satīŋŊra gider. - 2. Bir sīŋŊzcīŋŊk īŋŊbeīŋŊinden īŋŊnce / yazmak, īŋŊLERīŋŊ yīŋŊnde o īŋŊbeīŋŊi aratīŋŊr. - Bir sīŋŊzcīŋŊk īŋŊbeīŋŊinden īŋŊnce ? yazmak, GERīŋŊ yīŋŊnde o īŋŊbeīŋŊi aratīŋŊr. - Bir aramadan sonra, aynīŋŊ yīŋŊndeki bir sonraki karīŋŊīŋŊlaīŋŊmayīŋŊ bulmak iīŋŊin n, + 2. SīŋŊzcīŋŊk īŋŊbeīŋŊinden īŋŊnce / yazmak, īŋŊLERīŋŊ yīŋŊnde o īŋŊbeīŋŊi aratīŋŊr. + SīŋŊzcīŋŊk īŋŊbeīŋŊinden īŋŊnce ? yazmak, GERīŋŊ yīŋŊnde o īŋŊbeīŋŊi aratīŋŊr. + Aramadan sonra, aynīŋŊ yīŋŊndeki bir sonraki karīŋŊīŋŊlaīŋŊmayīŋŊ bulmak iīŋŊin n, veya zīŋŊt yīŋŊndekini bulmak iīŋŊin N yazīŋŊn. O sizi eski konumlara, I daha yeni konumlara gīŋŊtīŋŊrīŋŊr. 3. īŋŊmleīŋŊ bir (), [], {} ayracīŋŊ īŋŊzerindeyken % yazmak, uyan diīŋŊer eīŋŊ ayracīŋŊ bulur. - 4. Bir satīŋŊrdaki ilk 'eski'yi 'yeni' ile deīŋŊiīŋŊtirmek iīŋŊin :s/eski/yeni, - Bir satīŋŊrdaki tīŋŊm 'eski'leri 'yeni' ile deīŋŊiīŋŊtirmek iīŋŊin :s/eski/yeni/g, + 4. SatīŋŊrdaki ilk 'eski'yi 'yeni' ile deīŋŊiīŋŊtirmek iīŋŊin :s/eski/yeni, + SatīŋŊrdaki tīŋŊm 'eski'leri 'yeni' ile deīŋŊiīŋŊtirmek iīŋŊin :s/eski/yeni/g, īŋŊki satīŋŊr arasīŋŊndaki īŋŊbekleri deīŋŊiīŋŊtirmek iīŋŊin :#,#s/eski/yeni/g, - Bir dosyadaki tīŋŊm karīŋŊīŋŊlaīŋŊmalarīŋŊ deīŋŊiīŋŊtirmek iīŋŊin :%s/eski/yeni/g yazīŋŊn. + Dosyadaki tīŋŊm karīŋŊīŋŊlaīŋŊmalarīŋŊ deīŋŊiīŋŊtirmek iīŋŊin :%s/eski/yeni/g yazīŋŊn. Her seferinde onay sormasīŋŊ iīŋŊin :%s/eski/yeni/gc kullanīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.1: BIR DIīŋŊ KOMUT īŋŊALIīŋŊTIRMAK @@ -617,10 +618,10 @@ Not: Arama dosyan NOT: Herhangi bir dīŋŊīŋŊ komutu bu yolla īŋŊalīŋŊīŋŊtīŋŊrmak mīŋŊmkīŋŊndīŋŊr. - NOT: TīŋŊm : komutlarīŋŊndan sonra dīŋŊīŋŊmesine basīŋŊlmalīŋŊdīŋŊr. Bundan sonra - bunu her zaman anīŋŊmsatmayacaīŋŊīŋŊz. + NOT: TīŋŊm : komutlarīŋŊndan sonra dīŋŊīŋŊmesine basīŋŊlmalīŋŊdīŋŊr. Bundan + sonra bunu her zaman anīŋŊmsatmayacaīŋŊīŋŊz. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.2: DOSYA YAZMAYA DEVAM @@ -641,11 +642,11 @@ Not: Arama dosyan kaydettiīŋŊiniz vimtutor'un gerīŋŊek bir kopyasīŋŊ olduīŋŊunu gīŋŊrīŋŊrsīŋŊnīŋŊz. 5. īŋŊimdi dosyayīŋŊ īŋŊu komutlarīŋŊ vererek silin: - Windows: :!del DENEME - Unix (macOS, Linux, Haiku): :!rm DENEME + Windows: :!del DENEME + Unix (macOS, Linux, Haiku): :!rm DENEME -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 5.3: YAZMAK īŋŊīŋŊīŋŊN METīŋŊN SEīŋŊME + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 5.3: YAZMA īŋŊīŋŊīŋŊN METīŋŊN SEīŋŊME ** DosyanīŋŊn bir bīŋŊlīŋŊmīŋŊnīŋŊ kaydetmek iīŋŊin, v hareket :w DOSYA_ADI yazīŋŊn. ** @@ -663,7 +664,7 @@ Not: Arama dosyan 5. Vim seīŋŊilen satīŋŊrlarīŋŊ DENEME dosyasīŋŊna yazacaktīŋŊr. :!ls veya :!dir ile bakarak dosyayīŋŊ gīŋŊrīŋŊn. HenīŋŊz silmeyin; bir sonraki derste kullanacaīŋŊīŋŊz. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.4: DOSYALARI BīŋŊRLEīŋŊTīŋŊRME VE BīŋŊLīŋŊM EKLEME @@ -671,20 +672,20 @@ Not: Arama dosyan 1. īŋŊmleci bu satīŋŊrīŋŊn hemen bir īŋŊstīŋŊne koyun. - NOT: īŋŊkinci adīŋŊmīŋŊ gerīŋŊekleīŋŊtirdikten sonra Ders 5.3'īŋŊn metnini gīŋŊreceksiniz. + NOT: īŋŊkinci adīŋŊmdan sonra Ders 5.3'īŋŊn metnini gīŋŊreceksiniz. SonrasīŋŊnda AīŋŊAīŋŊI dīŋŊīŋŊmesi ile bu derse geri gelin. 2. īŋŊimdi :r DENEME komutunu kullanarak DENEME dosyasīŋŊnīŋŊ bu dosyanīŋŊn iīŋŊine getirin. GetirdiīŋŊiniz dosya imlecin hemen altīŋŊna yerleīŋŊtirilir. 3. DosyanīŋŊn getirildiīŋŊini doīŋŊrulamak iīŋŊin YUKARI dīŋŊīŋŊmesini kullanarak - Ders 5.3'īŋŊn iki adet kopyasīŋŊ olduīŋŊunu gīŋŊrīŋŊn, īŋŊzgīŋŊn sīŋŊrīŋŊmīŋŊ ve kopyasīŋŊ. + Ders 5.3'īŋŊn iki adet kopyasīŋŊ olduīŋŊunu gīŋŊrīŋŊn, īŋŊzgīŋŊn sīŋŊrīŋŊmīŋŊ ve kopyasīŋŊ. NOT: Bu komutu kullanarak bir dīŋŊīŋŊ komutun īŋŊīŋŊktīŋŊsīŋŊnīŋŊ da dosyanīŋŊn iīŋŊine - koyabilirsiniz. īŋŊrneīŋŊin :r :!ls yazmak ls komutunun vereceīŋŊi īŋŊīŋŊktīŋŊyīŋŊ + koyabilirsiniz. īŋŊrneīŋŊin :r !ls yazmak ls komutunun vereceīŋŊi īŋŊīŋŊktīŋŊyīŋŊ dosyanīŋŊn iīŋŊinde hemen imlecin altīŋŊndaki satīŋŊra koyar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5: īŋŊZET @@ -704,40 +705,40 @@ Not: Arama dosyan 5. :r !dir veya !ls bu iki komutun (dosyalarīŋŊ listeleme) iīŋŊeriklerini okur ve dosyanīŋŊn iīŋŊine yerleīŋŊtirir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.1: AīŋŊ KOMUTU - ** īŋŊmlecin aīŋŊaīŋŊīŋŊsīŋŊna bir satīŋŊr aīŋŊmak ve INSERT kipine geīŋŊmek iīŋŊin o yazīŋŊn. ** + ** īŋŊmlecin aīŋŊaīŋŊīŋŊsīŋŊna satīŋŊr aīŋŊmak ve EKLE kipine geīŋŊmek iīŋŊin o yazīŋŊn. ** 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ satīŋŊra gīŋŊtīŋŊrīŋŊn. - 2. īŋŊmlecin aīŋŊaīŋŊīŋŊsīŋŊna bir satīŋŊr aīŋŊmak ve INSERT kipine geīŋŊmek iīŋŊin o + 2. īŋŊmlecin aīŋŊaīŋŊīŋŊsīŋŊna bir satīŋŊr aīŋŊmak ve EKLE kipine geīŋŊmek iīŋŊin o (kīŋŊīŋŊīŋŊk harfle) yazīŋŊn. - 3. īŋŊimdi herhangi bir metin girin ve INSERT kipinden īŋŊīŋŊkmak iīŋŊin + 3. īŋŊimdi herhangi bir metin girin ve EKLE kipinden īŋŊīŋŊkmak iīŋŊin dīŋŊīŋŊmesine basīŋŊn. ----> o yazdīŋŊktan sonra imleīŋŊ INSERT kipinde aīŋŊīŋŊlan satīŋŊrīŋŊn īŋŊzerine gider. +---> o yazdīŋŊktan sonra imleīŋŊ EKLE kipinde aīŋŊīŋŊlan satīŋŊrīŋŊn īŋŊzerine gider. 4. īŋŊmlecin īŋŊzerinde bir satīŋŊr aīŋŊmak iīŋŊin, yalnīŋŊzca bīŋŊyīŋŊk O yazīŋŊn. Bunu aīŋŊaīŋŊīŋŊdaki satīŋŊrda deneyin. ---> Bu satīŋŊrīŋŊn īŋŊzerine bir satīŋŊr aīŋŊmak iīŋŊin imleīŋŊ bu satīŋŊrdayken O yazīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.2: EKLE KOMUTU - ** īŋŊmleīŋŊten sonra metin eklemek iīŋŊin a yazīŋŊn. ** + ** īŋŊmleīŋŊten sonra metin eklemek iīŋŊin a yazīŋŊn. ** 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ satīŋŊra gīŋŊtīŋŊrīŋŊn. - 2. īŋŊmleīŋŊ satīŋŊ'nīŋŊn sonuna gelinceye dek e dīŋŊīŋŊmesine basīŋŊn. + 2. īŋŊmleīŋŊ satīŋŊrīŋŊn sonuna gelinceye dek e dīŋŊīŋŊmesine basīŋŊn. 3. īŋŊmleīŋŊten SONRA metin eklemek iīŋŊin a yazīŋŊn. - 4. īŋŊimdi ilk satīŋŊrīŋŊ ikincisi gibi tamamlayīŋŊn. INSERT kipinden īŋŊīŋŊkmak iīŋŊin + 4. īŋŊimdi ilk satīŋŊrīŋŊ ikincisi gibi tamamlayīŋŊn. EKLE kipinden īŋŊīŋŊkmak iīŋŊin dīŋŊīŋŊmesine basīŋŊn. 5. e dīŋŊīŋŊmesini kullanarak bir sonraki yarīŋŊm sīŋŊzcīŋŊīŋŊe gidin ve adīŋŊm 3 ve 4'īŋŊ @@ -746,7 +747,7 @@ Not: Arama dosyan ---> Bu satīŋŊ īŋŊalīŋŊīŋŊabilirsiniz. īŋŊalīŋŊ met ekl ---> Bu satīŋŊrda īŋŊalīŋŊīŋŊabilirsiniz. īŋŊalīŋŊīŋŊīŋŊrken metin eklemeyi kullanīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.3: BīŋŊR BAīŋŊKA DEīŋŊīŋŊīŋŊTīŋŊR KOMUTU @@ -758,7 +759,7 @@ Not: Arama dosyan 2. īŋŊimdi R dīŋŊīŋŊmesine basīŋŊn ve ikinci satīŋŊrdaki sayīŋŊyīŋŊ ilk satīŋŊrdaki xxx'in yerine yazīŋŊn. - 3. dīŋŊīŋŊmesine basarak REPLACE kipinden īŋŊīŋŊkīŋŊn. SatīŋŊrīŋŊn geri kalanīŋŊnīŋŊn + 3. dīŋŊīŋŊmesine basarak DEīŋŊīŋŊīŋŊTīŋŊR kipinden īŋŊīŋŊkīŋŊn. SatīŋŊrīŋŊn geri kalanīŋŊnīŋŊn deīŋŊiīŋŊmediīŋŊini gīŋŊzlemleyin. 4. Kalan xxx'i de deīŋŊiīŋŊtirmek iīŋŊin adīŋŊmlarīŋŊ tekrarlayīŋŊn. @@ -766,14 +767,15 @@ Not: Arama dosyan ---> 123 sayīŋŊsīŋŊna xxx eklemek size yyy toplamīŋŊnīŋŊ verir. ---> 123 sayīŋŊsīŋŊna 456 eklemek size 579 toplamīŋŊnīŋŊ verir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.4: METīŋŊN KOPYALA VE YAPIīŋŊTIR - ** y iīŋŊletmenini kullanarak metin kopyalayīŋŊn ve p kullanarak yapīŋŊīŋŊtīŋŊrīŋŊn. ** - 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ satīŋŊra getirin ve "a)"nīŋŊn ardīŋŊna koyun. + ** y iīŋŊlecini kullanarak metin kopyalayīŋŊn ve p kullanarak yapīŋŊīŋŊtīŋŊrīŋŊn. ** + + 1. īŋŊmleci aīŋŊaīŋŊīŋŊda ---> ile imlenmiīŋŊ satīŋŊra getirin, "a)"nīŋŊn ardīŋŊna koyun. - 2. v ile VISUAL kipine geīŋŊin ve imleci "ilk" sīŋŊzcīŋŊīŋŊīŋŊnīŋŊn īŋŊncesine getirin. + 2. v ile GīŋŊRSEL kipe geīŋŊin ve imleci "ilk" sīŋŊzcīŋŊīŋŊīŋŊnīŋŊn īŋŊncesine getirin. 3. y dīŋŊīŋŊmesine basarak seīŋŊili metni kopyalayīŋŊn. @@ -781,16 +783,16 @@ Not: Arama dosyan 5. p dīŋŊīŋŊmesine basarak metni yapīŋŊīŋŊtīŋŊrīŋŊn. Akabinde dīŋŊīŋŊmesine basīŋŊn. - 6. VISUAL kipine geīŋŊerek "īŋŊge" sīŋŊzcīŋŊīŋŊīŋŊnīŋŊ seīŋŊin, y ile kopyalayīŋŊn, j$ ile + 6. GīŋŊRSEL kipe geīŋŊerek "īŋŊge" sīŋŊzcīŋŊīŋŊīŋŊnīŋŊ seīŋŊin, y ile kopyalayīŋŊn, j$ ile ikinci satīŋŊrīŋŊn sonuna gidin ve p ile sīŋŊzcīŋŊīŋŊīŋŊ yapīŋŊīŋŊtīŋŊrīŋŊn. ---> a) Bu ilk īŋŊge ---> b) - NOT: y komutunu bir iīŋŊletmen olarak da kullanabilirsiniz; yw komutu yalnīŋŊzca + NOT: y komutunu bir iīŋŊleīŋŊ olarak da kullanabilirsiniz; yw komutu yalnīŋŊzca bir sīŋŊzcīŋŊīŋŊīŋŊ kopyalar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.4: SET KOMUTU @@ -815,12 +817,12 @@ Not: Arama dosyan NOT: EīŋŊer yalnīŋŊzca bir arama iīŋŊlemi iīŋŊin BīŋŊYīŋŊK/kīŋŊīŋŊīŋŊk harf ayrīŋŊmsīŋŊz arama yapmak istiyorsanīŋŊz /ignore\c komutunu kullanīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 6 īŋŊZET 1. o komutu imlecin altīŋŊnda bir satīŋŊr aīŋŊar ve imleci bu aīŋŊīŋŊlmīŋŊīŋŊ satīŋŊra - INSERT kipinde yerleīŋŊtirir. + EKLE kipinde yerleīŋŊtirir. O komutu imlecin īŋŊzerinde bir satīŋŊr aīŋŊar. 2. a komutu imleīŋŊten sonra metin giriīŋŊine olanak verir. @@ -828,9 +830,9 @@ Not: Arama dosyan 3. e komutu imleci bir sīŋŊzcīŋŊīŋŊīŋŊn sonuna taīŋŊīŋŊr. - 4. y iīŋŊletmeni metni kopyalar, p iīŋŊletmeni yapīŋŊīŋŊtīŋŊrīŋŊr. + 4. y iīŋŊleci metni kopyalar, p iīŋŊleci yapīŋŊīŋŊtīŋŊrīŋŊr. - 5. R komutu REPLACE (DEīŋŊīŋŊīŋŊTīŋŊR) kipine girer ve 'ye basīŋŊlana kadar kalīŋŊr. + 5. R komutu DEīŋŊīŋŊīŋŊTīŋŊR kipine girer ve 'ye basīŋŊlana kadar kalīŋŊr. 6. ":set xxx" yazmak "xxx" seīŋŊeneīŋŊini ayarlar. BazīŋŊ seīŋŊenekler: 'ic' 'ignorecase' BīŋŊYīŋŊK/kīŋŊīŋŊīŋŊk harf ayrīŋŊmīŋŊnīŋŊ arama yaparken kapatīŋŊr. @@ -840,34 +842,36 @@ Not: Arama dosyan 7. Bir ayarīŋŊ kapatmak iīŋŊin "no" ekleyin, īŋŊrneīŋŊin :set noic. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7.1: YARDIM KAYNAKLARI ** īŋŊevrimiīŋŊi yardīŋŊm sistemini kullanīŋŊn ** - Vim geniīŋŊ bir īŋŊeirimiīŋŊi yardīŋŊm sistemine sahiptir. BaīŋŊlamak iīŋŊin īŋŊu īŋŊīŋŊīŋŊnīŋŊ + Vim geniīŋŊ bir īŋŊevrimiīŋŊi yardīŋŊm sistemine sahiptir. BaīŋŊlamak iīŋŊin īŋŊu īŋŊīŋŊīŋŊnīŋŊ deneyebilirsiniz: + - (eīŋŊer varsa) dīŋŊīŋŊmesine basīŋŊn - (eīŋŊer varsa) dīŋŊīŋŊmesine basīŋŊn - :help yazīŋŊn ve dīŋŊīŋŊmesine basīŋŊn - YardīŋŊm penceresindeki metinleri okuyarak yardīŋŊm sisteminin nasīŋŊl īŋŊalīŋŊīŋŊtīŋŊīŋŊīŋŊnīŋŊ - īŋŊīŋŊrenin. + YardīŋŊm penceresindeki metinleri okuyarak yardīŋŊm sisteminin nasīŋŊl + īŋŊalīŋŊīŋŊtīŋŊīŋŊīŋŊnīŋŊ īŋŊīŋŊrenin. Bir pencereden diīŋŊerine geīŋŊmek iīŋŊin W ikilisini kullanīŋŊn. YardīŋŊm penceresini kapatmak iīŋŊin :q yazīŋŊp dīŋŊīŋŊmesine basīŋŊn. ":help" komutuna deīŋŊiīŋŊken (argīŋŊman) vererek herhangi bir konu hakkīŋŊnda - yardīŋŊm alabilirsini. īŋŊunlarīŋŊ deneyin ( dīŋŊīŋŊmesine basmayīŋŊ unutmayīŋŊn): + yardīŋŊm alabilirsiniz. īŋŊunlarīŋŊ deneyin: :help w :help c_ D :help insert-index :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7.2: BīŋŊR BAīŋŊLANGIīŋŊ BETīŋŊīŋŊīŋŊ OLUīŋŊTURUN + ** Vim'in īŋŊzelliklerine bakīŋŊn ** Vim Vi'dan īŋŊok daha fazla īŋŊzelliīŋŊe sahiptir fakat birīŋŊoīŋŊu īŋŊntanīŋŊmlīŋŊ olarak @@ -877,7 +881,7 @@ Not: Arama dosyan 1. "vimrc" dosyasīŋŊnīŋŊ dīŋŊzenlemeye baīŋŊlayīŋŊn. īŋŊīŋŊletim sistemlerine gīŋŊre: :e ~/.vimrc Unix iīŋŊin - :e $VIM/_vimrc Windows iīŋŊin + :e ~/_vimrc Windows iīŋŊin 2. īŋŊimdi īŋŊrnek "vimrc" dosyasīŋŊ iīŋŊeriīŋŊini okuyun: @@ -889,20 +893,24 @@ Not: Arama dosyan TīŋŊm tercih ettiīŋŊiniz ayarlarīŋŊ bu "vimrc" dosyasīŋŊna ekleyebilirsiniz. Daha fazla bilgi iīŋŊin :help vimrc-intro yazīŋŊn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7.3: TAMAMLAMA + ** D ve ile komut istemi ekranīŋŊnda tamamlama ** - 1. :set nocp komutunu kullanarak Vim'in uyumlu kipte olmadīŋŊīŋŊīŋŊndan emin olun. + 1. :set nocp komutunu kullanarak Vim'in uyumlu kipte olmadīŋŊīŋŊīŋŊndan + emin olun. 2. BulunduīŋŊunuz dizindeki dosyalara :!ls veya :!dir ile bakīŋŊn. - 3. Bir komutun baīŋŊlangīŋŊcīŋŊnīŋŊ yazīŋŊn, īŋŊrneīŋŊin :e. + 3. Bir komutun baīŋŊ kīŋŊsmīŋŊnīŋŊ yazīŋŊn, īŋŊrneīŋŊin :e. - 4. D'ye bastīŋŊīŋŊīŋŊnīŋŊzda Vim size e ile baīŋŊlayan komutlarīŋŊ gīŋŊsterecektir. + 4. D'ye bastīŋŊīŋŊīŋŊnīŋŊzda Vim size e ile baīŋŊlayan komutlarīŋŊ + gīŋŊsterecektir. - 5. d kullandīŋŊīŋŊīŋŊnīŋŊzda Vim komutu kendinden :edit olarak tamamlayacaktīŋŊr. + 5. d kullandīŋŊīŋŊīŋŊnīŋŊzda Vim komutu kendinden :edit olarak + tamamlayacaktīŋŊr. 6. īŋŊimdi bir boīŋŊluk ekleyin ve var olan bir dosyanīŋŊn baīŋŊ harflerini yazīŋŊn. īŋŊrneīŋŊin :edit DOS. @@ -913,9 +921,10 @@ Not: Arama dosyan NOT: Tamamlama birīŋŊok komut iīŋŊin īŋŊalīŋŊīŋŊīŋŊr. YalnīŋŊzca D ve ikililerini deneyin. īŋŊzellikle :help iīŋŊin īŋŊok yararlīŋŊdīŋŊr. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7: īŋŊZET + 1. :help yazmak veya veya dīŋŊīŋŊmelerine basmak yardīŋŊm penceresini aīŋŊar. @@ -931,12 +940,13 @@ Not: Arama dosyan 6. Bir : komutu girerken D'ye basarak olanaklīŋŊ tamamlama seīŋŊeneklerini gīŋŊrebilirsiniz. 'a basarak tamamlamayīŋŊ seīŋŊin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Burada Vim EīŋŊitmeni tamamlanmīŋŊīŋŊ oldu. EīŋŊitmendeki amaīŋŊ Vim dīŋŊzenleyicisi + BīŋŊylece Vim EīŋŊitmeni tamamlanmīŋŊīŋŊ oldu. EīŋŊitmendeki amaīŋŊ Vim dīŋŊzenleyicisi hakkīŋŊnda kīŋŊsa bir bilgi vermek ve onu kolayca kullanmanīŋŊzīŋŊ saīŋŊlamaktīŋŊ. - Vim'in tamamīŋŊnīŋŊ īŋŊīŋŊretmek īŋŊok zordur zira Vim birīŋŊok komuta sahiptir. Bundan - sonra ":help user-manual" komutu ile kullanīŋŊcīŋŊ kīŋŊlavuzunu okumalīŋŊsīŋŊnīŋŊz. + Vim'in tamamīŋŊnīŋŊ īŋŊīŋŊretmek īŋŊok zordur zira Vim birīŋŊok komuta sahiptir. + Bundan sonra ":help user-manual" komutu ile kullanīŋŊcīŋŊ kīŋŊlavuzunu + okumalīŋŊsīŋŊnīŋŊz. Daha fazla okuma ve īŋŊalīŋŊīŋŊma iīŋŊin īŋŊu kitabīŋŊ īŋŊneriyoruz: @@ -946,7 +956,7 @@ Not: Arama dosyan TīŋŊmīŋŊyle Vim iīŋŊin hazīŋŊrlanmīŋŊīŋŊ ilk kitaptīŋŊr. īŋŊzellikle ilk kullanīŋŊcīŋŊlar iīŋŊin īŋŊok uygundur. Kitapta birīŋŊok īŋŊrnek ve resim bulunmaktadīŋŊr. - http://iccf-holland.org/click5.html adresine bakabilirsiniz. + https://iccf-holland.org/click5.html adresine bakabilirsiniz. Bu kitap daha eskidir ve Vim'den daha īŋŊok Vi iīŋŊindir ancak tavsiye edilir: @@ -962,7 +972,10 @@ Not: Arama dosyan Vim iīŋŊin deīŋŊiīŋŊtiren: Bram Moolenaar - TīŋŊrkīŋŊe īŋŊeviri: Serkan "heartsmagic" īŋŊalīŋŊīŋŊ (2005), adresimeyaz (at) yahoo com - 2019 GīŋŊncelleme: Emir SARI, emirsari (at) gmail com + TīŋŊrkīŋŊe īŋŊeviri: + Serkan "heartsmagic" īŋŊalīŋŊīŋŊ (2005), adresimeyaz (at) yahoo (dot) com + + 2019 GīŋŊncelleme: + Emir SARI, bitigchi (at) me (dot) com -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.tr.utf-8 b/runtime/tutor/tutor.tr.utf-8 index 24cb8c0ce745a..95a7c8094cf7e 100644 --- a/runtime/tutor/tutor.tr.utf-8 +++ b/runtime/tutor/tutor.tr.utf-8 @@ -1,8 +1,8 @@ -=============================================================================== -= V I M T u t o r ' a h o ş g e l d i n i z ! - SÃŧrÃŧm 1.7 = -=============================================================================== +================================================================================ += V I M T u t o r ' a h o ş g e l d i n i z ! -- SÃŧrÃŧm 1.7 = +================================================================================ - Vim, bu gibi bir eğitmen ile aÃ§ÄąklanmasÄą gereken çok fazla komut barÄąndÄąran, + Vim, bÃļyle bir eğitmen ile aÃ§ÄąklanmasÄą gereken çok fazla komut barÄąndÄąran, oldukça kuvvetli bir metin dÃŧzenleyicidir. Bu eğitmen Vim'i çok amaçlÄą bir dÃŧzenleyici olarak kolaylÄąkla kullanabileceğiniz yeterli sayÄąda komutu aÃ§Äąklamak için tasarlanmÄąÅŸtÄąr. @@ -16,27 +16,28 @@ çalÄąÅŸtÄąrdÄąysanÄąz zaten bir kopyasÄąnÄą almÄąÅŸ oldunuz). Bu eğitmenin kullanarak Ãļğretmek için tasarlandığınÄą unutmamak Ãļnemlidir. - Bu şu anlama gelir; komutlarÄą Ãļğrenmek için doğru bir şekilde çalÄąÅŸtÄąrmanÄąz - gerekir. Eğer sadece yazÄąlanlarÄą okursanÄąz komutlarÄą unutursunuz. + Bu şu anlama gelir; komutlarÄą Ãļğrenmek için doğru bir şekilde çalÄąÅŸtÄąrma- + nÄąz gerekir. Eğer sadece yazÄąlanlarÄą okursanÄąz komutlarÄą unutursunuz. - Şimdi Caps-Lock dÃŧğmenizin basÄąlÄą olmadığına emin olun ve Ders 1.1'in + Şimdi Caps Lock dÃŧğmenizin basÄąlÄą olmadığına emin olun ve Ders 1.1'in ekranÄą tamamen doldurmasÄą için j dÃŧğmesine yeterli miktarda basÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.1: İMLECİ HAREKET ETTİRMEK -Çevirmen Notu: TÃŧm derslerde gÃļrdÃŧğÃŧnÃŧzde bu dÃŧğmeye basmanÄąz gerekir. + +Çevirmen Notu: TÃŧm derslerde gÃļrdÃŧğÃŧnÃŧzde bu dÃŧğmeye basÄąn. ** İmleci hareket ettirmek için h,j,k,l dÃŧğmelerine basÄąn. ** ^ - k İpucu: h dÃŧğmesi soldadÄąr ve sola doğru hareket eder. - < h l > l dÃŧğmesi sağdadÄąr ve sağa doğru hareket eder. - j j dÃŧğmesi aşağı doğru bir oka benzer. + k İpucu: h dÃŧğmesi soldadÄąr ve sola doğru hareket eder. + < h l > l dÃŧğmesi sağdadÄąr ve sağa doğru hareket eder. + j j dÃŧğmesi aşağı doğru bir oka benzer. v 1. İmleci kendinizi rahat hissedinceye dek ekranda dolaştÄąrÄąn. - 2. j dÃŧğmesini kendisini yineleyinceye dek basÄąlÄą tutun. + 2. j dÃŧğmesine basÄąn ve ekranÄąn aşağıya kaydığınÄą gÃļrÃŧn. 3. Aşağı dÃŧğmesini kullanarak, Ders 1.2'ye geçin. @@ -46,7 +47,7 @@ NOT: Ok dÃŧğmeleri de aynÄą işe yarar. Ancak hjkl dÃŧğmelerini kullanarak çok daha hÄązlÄą hareket edebilirsiniz. Gerçekten. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.2: VİM'DEN ÇIKIŞ @@ -64,7 +65,7 @@ 5. İmleci Ders 1.3'e taÅŸÄąyÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.3: METİN DÜZENLEME - METİN SİLME @@ -84,7 +85,7 @@ NOT: Bu eğitmende ilerledikçe ezberlemeye çalÄąÅŸmayÄąn, deneyerek Ãļğrenin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.4: METİN DÜZENLEME - METİN GİRME @@ -92,8 +93,8 @@ 1. İmleci aşağıda ---> ile imlenmiş İLK satÄąra gÃļtÃŧrÃŧn. - 2. İlk satÄąrÄą ikincisinin aynÄąsÄą gibi yapmak için, imleci eklenmesi gereken - metinden sonraki ilk karakterin Ãŧzerine gÃļtÃŧrÃŧn. + 2. İlk satÄąrÄą ikincisinin aynÄąsÄą gibi yapmak için, imleci eklenmesi + gereken metinden sonraki ilk karakterin Ãŧzerine gÃļtÃŧrÃŧn. 3. i'ye basÄąn ve gerekli eklemeleri yapÄąn. @@ -105,7 +106,7 @@ 5. ArtÄąk yapabildiğinizi dÃŧşÃŧnÃŧyorsanÄąz bir sonraki bÃļlÃŧme geçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.5: METİN DÜZENLEME - METİN EKLEME @@ -128,7 +129,7 @@ 5. ArtÄąk rahatça metin ekleyebildiğinizi dÃŧşÃŧnÃŧyorsanÄąz Ders 1.6'ya geçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1.6: DOSYA DÜZENLEME @@ -137,7 +138,7 @@ !! NOT: Aşağıdaki adÄąmlarÄą uygulamadan Ãļnce tÃŧm bu bÃļlÃŧmÃŧ iyice okuyun! 1. Bu eğitmeni Ders 1.2'de yaptığınÄąz gibi :q! yazarak kapatÄąn. Veya başka - bir uçbirime erişiminiz varsa orada yapÄąn. + bir uçbirime erişiminiz varsa orada yapÄąn. 2. Komut istemi ekranÄąnda şu komutu girin: vim tutor . 'vim', Vim dÃŧzenleyicisini açmak için kullanacağınÄąz komut olup 'tutor' da @@ -153,7 +154,7 @@ 6. YukarÄądaki adÄąmlarÄą okuduktan ve anladÄąktan sonra YAPIN. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 1: ÖZET @@ -179,12 +180,12 @@ i metin girin imleçten Ãļnce girer A metin girin satÄąrdan sonra ekler - NOT: dÃŧğmesine basmak sizi Normal kipe geri dÃļndÃŧrÃŧr veya istenmeyen ve - yarÄąm yazÄąlmÄąÅŸ bir komutu iptal eder. + NOT: dÃŧğmesine basmak sizi Normal kipe geri dÃļndÃŧrÃŧr veya istenmeyen + veya yarÄąm yazÄąlmÄąÅŸ bir komutu iptal eder. Şimdi Ders 2 ile bu eğitmeni sÃŧrdÃŧrÃŧn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.1: SİLME KOMUTLARI @@ -206,8 +207,8 @@ 5. TÃŧmce dÃŧzelene kadar adÄąm 3 ve 4'Ãŧ tekrar edin ve Ders 2.2'ye geçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 2.2: DAHA FAZLA SİLME KOMUTU + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 2.2: DAHA FAZLA SİLME KOMUTLARI ** SatÄąrÄą sonuna kadar silmek için d$ yazÄąn. ** @@ -228,19 +229,19 @@ 5. Neler olduğunu anlamak için Ders 2.3'e gidin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 2.3: İŞLETMENLER VE HAREKETLER + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 2.3: İŞLEÇLER VE HAREKETLER - Metin değiştiren birçok komut işletmenler ve eklerden oluşur. Bir d işletmeni + Metin değiştiren birçok komut işleçler ve eklerden oluşur. Bir d işleci içeren silme komutu için kullanÄąlan biçim aşağıdaki gibidir: d hareket Burada: - d - silme işletmenidir. - hareket - işletmenin neyi işleteceğidir (aşağıda listelenmiştir). + d - silme işlecidir. + hareket - işlecin neyi işleteceğidir (aşağıda listelenmiştir). Hareketlerin kÄąsa bir listesi için: @@ -250,14 +251,14 @@ Demeli ki, de komutunu girmek imleçten sÃļzcÃŧğÃŧn sonuna kadar siler. - NOT: Normal kipte hiçbir hareket olmadan yalnÄązca işletmeni girmek imleci + NOT: Normal kipte hiçbir hareket olmadan yalnÄązca işleci girmek imleci yukarÄąda belirtildiği gibi hareket ettirir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.4: BİR HAREKET İLE BİRLİKTE SAYIM KULLANMAK - ** Bir hareketten Ãļnce sayÄą kullanmak o hareketi sayÄą kadar tekrarlatÄąr. ** + ** Bir hareketten Ãļnce sayÄą kullanmak o hareketi sayÄąca tekrarlatÄąr. ** 1. İmleci aşağıda ---> ile imlenmiş satÄąrÄąn BAŞINA gÃļtÃŧrÃŧn. @@ -273,13 +274,13 @@ 6. Ders 2.5'e geçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.5: BİR SAYIM KULLANARAK DAHA FAZLA SİLME İŞLEMİ - ** Bir işletmen ile birlikte sayÄą kullanmak işletmeni o kadar tekrarlatÄąr. ** + ** Bir işleç ile birlikte sayÄą kullanmak işleci o kadar tekrarlatÄąr. ** - YukarÄąda sÃļzÃŧ edilen silme işletmeni ve hareketinin arasÄąna sayÄą ekleyerek + YukarÄąda sÃļzÃŧ edilen silme işleci ve hareketinin arasÄąna sayÄą ekleyerek yapÄąlan işlemi o sayÄą kadar tekrarlatabilirsiniz. d [sayÄą] hareket @@ -294,7 +295,7 @@ ---> Bu ABC ÇDE satÄąrdaki FGĞ HIİ JKLM NOÖ PRSŞT sÃļzcÃŧkler UÜ VY temizlenmiştir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.6: SATIRLARDA İŞLEM YAPMA @@ -302,7 +303,7 @@ BÃŧtÃŧn bir satÄąr silme işlemi çok sÄąk kullanÄąldığından dolayÄą, Vi tasarÄąmcÄąlarÄą bir satÄąrÄą tamamen silmek için iki d yazmanÄąn daha kolay - olduğuna karar verdiler. + olduğuna karar vermişler. 1. İmleci aşağıdaki tÃŧmceciğin ikinci satÄąrÄąna gÃļtÃŧrÃŧn. @@ -320,11 +321,11 @@ ---> 6) Şeker tatlÄądÄąr ---> 7) Ve sen de Ãļylesin -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2.7: GERİ AL KOMUTU - ** Son komutu geri almak için u, bÃŧtÃŧn bir satÄąrÄą dÃŧzeltmek için U yazÄąn. ** + ** Komutu geri almak için u, bÃŧtÃŧn bir satÄąrÄą dÃŧzeltmek için U yazÄąn. ** 1. İmleci aşağıda ---> ile imlenmiş satÄąrda ve ilk hatanÄąn Ãŧzerine koyun. @@ -345,7 +346,7 @@ 8. Bunlar son derece kullanÄąÅŸlÄą komutlardÄąr. Şimdi Ders 2 Özete geçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 2: ÖZET @@ -359,12 +360,12 @@ 5. Normal kipte bir komut biçimi şÃļyledir: - işletmen [sayÄą] hareket + işleç [sayÄą] hareket burada: - işletmen - ne yapÄąlacağı, silmek için d Ãļrneğinde olduğu gibi + işleç - ne yapÄąlacağı, silmek için d Ãļrneğinde olduğu gibi [sayÄą] - komutun kaç kere tekrar edeceğini gÃļsteren isteğe bağlÄą sayÄą - hareket - işletmenin nice davranacağı, w (sÃļzcÃŧk), $ (satÄąr sonu) gibi. + hareket - işlecin nice davranacağı, w (sÃļzcÃŧk), $ (satÄąr sonu) gibi 6. Bir satÄąrÄąn baÅŸÄąna gelmek için sÄąfÄąr (0) kullanÄąn. @@ -372,7 +373,7 @@ Bir satÄąrdaki tÃŧm değişiklikleri geri almak için U (bÃŧyÃŧk U) yazÄąn. Geri almalarÄą geri almak için R kullanÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.1: KOY KOMUTU @@ -395,11 +396,11 @@ ---> c) AkÄąl Ãļğrenilir, ---> a) GÃŧller kÄąrmÄązÄądÄąr, -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.2: DEĞİŞTİR KOMUTU - ** İmlecin altÄąndaki karakteri başkasÄą ile değiştirmek için rx kullanÄąn. ** + ** İmlecin altÄąndaki karakteri başkasÄą ile değiştirmek için rx yapÄąn. ** 1. İmleci aşağıda ---> ile imlenmiş İLK satÄąra gÃļtÃŧrÃŧn. @@ -416,11 +417,11 @@ NOT: UnutmayÄąn, ezberleyerek değil deneyerek Ãļğrenin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 3.3: DEĞİŞTİR İŞLETMENİ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 3.3: DEĞİŞTİR İŞLECİ - ** Bir sÃļzcÃŧğÃŧ imleçten sÃļzcÃŧk sonuna kadar değiştirmek için ce kullanÄąn. ** + ** Bir sÃļzcÃŧğÃŧ imleçten sÃļzcÃŧk sonuna kadar değiştirmek için ce yapÄąn. ** 1. İmleci aşağıda ---> ile imlenmiş İLK satÄąra gÃļtÃŧrÃŧn. @@ -435,16 +436,16 @@ ---> Bu sutar değiştir komutu ile değişneli gereken birkaç mÃļzgÃŧç içeriyor. ---> Bu satÄąr değiştir komutu ile değişmesi gereken birkaç sÃļzcÃŧk içeriyor. - ce'nin sadece sÃļzcÃŧğÃŧ değiştirmediğini, aynÄą zamanda sizi INSERT kipine + ce'nin sadece sÃļzcÃŧğÃŧ değiştirmediğini, aynÄą zamanda sizi EKLE kipine aldığına da dikkat edin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3.4: c'Yİ KULLANARAK DAHA FAZLA DEĞİŞTİRME - ** Değiştir işletmeni sil komutu ile aynÄą hareketlerle kullanÄąlÄąr. ** + ** Değiştir işleci sil komutu ile aynÄą hareketlerle kullanÄąlÄąr. ** - 1. Değiştir işletmeni sil ile aynÄą yolla çalÄąÅŸÄąr. Biçim şÃļyledir: + 1. Değiştir işleci sil ile aynÄą yolla çalÄąÅŸÄąr. Biçim şÃļyledir: c [sayÄą] hareket @@ -461,7 +462,7 @@ ---> Bu satÄąrÄąn sonu dÃŧzeltilmek için c$ komutu kullanÄąlarak yardÄąma ihtiyaç duyuyor. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 3: ÖZET @@ -472,7 +473,7 @@ 2. İmlecin altÄąndaki karakteri değiştirmek için Ãļnce r ardÄąndan da yazmak istediğiniz karakteri yazÄąn. - 3. Değiştir işletmeni belirlenen nesneyi, imleçten hareketin sonuna kadar + 3. Değiştir işleci belirlenen nesneyi, imleçten hareketin sonuna kadar değiştirme imkanÄą verir. Örneğin, bir sÃļzcÃŧğÃŧ imleçten sÃļzcÃŧk sonuna kadar değiştirmek için cw, bir satÄąrÄąn tamamÄąnÄą değiştirmek içinse c$ yazÄąn. @@ -483,7 +484,7 @@ Şimdi bir sonraki derse geçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.1: İMLEÇ KONUMU VE DOSYA DURUMU @@ -507,7 +508,7 @@ 4. Yapabileceğinizi dÃŧşÃŧndÃŧğÃŧnÃŧzde, adÄąm 1'den 3'e kadar yapÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.2: ARAMA KOMUTU @@ -526,10 +527,10 @@ ---> "hatttaa" hatayÄą yazmanÄąn doğru yolu değil; hatttaa bir hata. -Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bunu devre - dÄąÅŸÄą bÄąrakmak için 'wrapscan' seçeneğini sÄąfÄąrlayÄąn. +Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bunu + devre dÄąÅŸÄą bÄąrakmak için 'wrapscan' seçeneğini sÄąfÄąrlayÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.3: UYAN AYRAÇLAR ARAMASI @@ -543,7 +544,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 4. Uyan ilk parantezin Ãŧzerine geri dÃļnmek için yine % yazÄąn. - 5. İmleci başka bir (), [] veya {} Ãŧzerine gÃļtÃŧrÃŧn ve % işletmeninin neler + 5. İmleci başka bir (), [] veya {} Ãŧzerine gÃļtÃŧrÃŧn ve % işlecinin neler yaptığınÄą gÃļzlemleyin. ---> Bu içerisinde ( )'ler, ['ler ] ve {'ler } bulunan bir satÄąrdÄąr. @@ -551,7 +552,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu NOT: Bu içerisinde eşi olmayan ayraçlar bulunan bir programÄąn hatalarÄąnÄą ayÄąklamak için son derece yararlÄądÄąr. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4.4: BUL/DEĞİŞTİR KOMUTU @@ -575,7 +576,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu :%s/eski/yeni/gc yazÄąn. Bu tÃŧm dosyadaki her oluşumu değiştirir ancak her birini değiştirmeden Ãļnce bize sorar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 4: ÖZET @@ -584,22 +585,22 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu [sayÄą] G belirtilen satÄąr numarasÄąna gider. gg ilk satÄąra gider. - 2. Bir sÃļzcÃŧk Ãļbeğinden Ãļnce / yazmak, İLERİ yÃļnde o Ãļbeği aratÄąr. - Bir sÃļzcÃŧk Ãļbeğinden Ãļnce ? yazmak, GERİ yÃļnde o Ãļbeği aratÄąr. - Bir aramadan sonra, aynÄą yÃļndeki bir sonraki karÅŸÄąlaşmayÄą bulmak için n, + 2. SÃļzcÃŧk Ãļbeğinden Ãļnce / yazmak, İLERİ yÃļnde o Ãļbeği aratÄąr. + SÃļzcÃŧk Ãļbeğinden Ãļnce ? yazmak, GERİ yÃļnde o Ãļbeği aratÄąr. + Aramadan sonra, aynÄą yÃļndeki bir sonraki karÅŸÄąlaşmayÄą bulmak için n, veya zÄąt yÃļndekini bulmak için N yazÄąn. O sizi eski konumlara, I daha yeni konumlara gÃļtÃŧrÃŧr. 3. İmleç bir (), [], {} ayracÄą Ãŧzerindeyken % yazmak, uyan diğer eş ayracÄą bulur. - 4. Bir satÄąrdaki ilk 'eski'yi 'yeni' ile değiştirmek için :s/eski/yeni, - Bir satÄąrdaki tÃŧm 'eski'leri 'yeni' ile değiştirmek için :s/eski/yeni/g, + 4. SatÄąrdaki ilk 'eski'yi 'yeni' ile değiştirmek için :s/eski/yeni, + SatÄąrdaki tÃŧm 'eski'leri 'yeni' ile değiştirmek için :s/eski/yeni/g, İki satÄąr arasÄąndaki Ãļbekleri değiştirmek için :#,#s/eski/yeni/g, - Bir dosyadaki tÃŧm karÅŸÄąlaşmalarÄą değiştirmek için :%s/eski/yeni/g yazÄąn. + Dosyadaki tÃŧm karÅŸÄąlaşmalarÄą değiştirmek için :%s/eski/yeni/g yazÄąn. Her seferinde onay sormasÄą için :%s/eski/yeni/gc kullanÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.1: BIR DIŞ KOMUT ÇALIŞTIRMAK @@ -617,10 +618,10 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu NOT: Herhangi bir dÄąÅŸ komutu bu yolla çalÄąÅŸtÄąrmak mÃŧmkÃŧndÃŧr. - NOT: TÃŧm : komutlarÄąndan sonra dÃŧğmesine basÄąlmalÄądÄąr. Bundan sonra - bunu her zaman anÄąmsatmayacağız. + NOT: TÃŧm : komutlarÄąndan sonra dÃŧğmesine basÄąlmalÄądÄąr. Bundan + sonra bunu her zaman anÄąmsatmayacağız. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.2: DOSYA YAZMAYA DEVAM @@ -641,11 +642,11 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu kaydettiğiniz vimtutor'un gerçek bir kopyasÄą olduğunu gÃļrÃŧrsÃŧnÃŧz. 5. Şimdi dosyayÄą şu komutlarÄą vererek silin: - Windows: :!del DENEME - Unix (macOS, Linux, Haiku): :!rm DENEME + Windows: :!del DENEME + Unix (macOS, Linux, Haiku): :!rm DENEME -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 5.3: YAZMAK İÇİN METİN SEÇME + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ders 5.3: YAZMA İÇİN METİN SEÇME ** DosyanÄąn bir bÃļlÃŧmÃŧnÃŧ kaydetmek için, v hareket :w DOSYA_ADI yazÄąn. ** @@ -663,7 +664,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 5. Vim seçilen satÄąrlarÄą DENEME dosyasÄąna yazacaktÄąr. :!ls veya :!dir ile bakarak dosyayÄą gÃļrÃŧn. HenÃŧz silmeyin; bir sonraki derste kullanacağız. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5.4: DOSYALARI BİRLEŞTİRME VE BÖLÜM EKLEME @@ -671,20 +672,20 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 1. İmleci bu satÄąrÄąn hemen bir ÃŧstÃŧne koyun. - NOT: İkinci adÄąmÄą gerçekleştirdikten sonra Ders 5.3'Ãŧn metnini gÃļreceksiniz. + NOT: İkinci adÄąmdan sonra Ders 5.3'Ãŧn metnini gÃļreceksiniz. SonrasÄąnda AŞAĞI dÃŧğmesi ile bu derse geri gelin. 2. Şimdi :r DENEME komutunu kullanarak DENEME dosyasÄąnÄą bu dosyanÄąn içine getirin. Getirdiğiniz dosya imlecin hemen altÄąna yerleştirilir. 3. DosyanÄąn getirildiğini doğrulamak için YUKARI dÃŧğmesini kullanarak - Ders 5.3'Ãŧn iki adet kopyasÄą olduğunu gÃļrÃŧn, ÃļzgÃŧn sÃŧrÃŧmÃŧ ve kopyasÄą. + Ders 5.3'Ãŧn iki adet kopyasÄą olduğunu gÃļrÃŧn, ÃļzgÃŧn sÃŧrÃŧmÃŧ ve kopyasÄą. NOT: Bu komutu kullanarak bir dÄąÅŸ komutun Ã§ÄąktÄąsÄąnÄą da dosyanÄąn içine - koyabilirsiniz. Örneğin :r :!ls yazmak ls komutunun vereceği Ã§ÄąktÄąyÄą + koyabilirsiniz. Örneğin :r !ls yazmak ls komutunun vereceği Ã§ÄąktÄąyÄą dosyanÄąn içinde hemen imlecin altÄąndaki satÄąra koyar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 5: ÖZET @@ -704,40 +705,40 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 5. :r !dir veya !ls bu iki komutun (dosyalarÄą listeleme) içeriklerini okur ve dosyanÄąn içine yerleştirir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.1: AÇ KOMUTU - ** İmlecin aşağısÄąna bir satÄąr açmak ve INSERT kipine geçmek için o yazÄąn. ** + ** İmlecin aşağısÄąna satÄąr açmak ve EKLE kipine geçmek için o yazÄąn. ** 1. İmleci aşağıda ---> ile imlenmiş satÄąra gÃļtÃŧrÃŧn. - 2. İmlecin aşağısÄąna bir satÄąr açmak ve INSERT kipine geçmek için o + 2. İmlecin aşağısÄąna bir satÄąr açmak ve EKLE kipine geçmek için o (kÃŧçÃŧk harfle) yazÄąn. - 3. Şimdi herhangi bir metin girin ve INSERT kipinden Ã§Äąkmak için + 3. Şimdi herhangi bir metin girin ve EKLE kipinden Ã§Äąkmak için dÃŧğmesine basÄąn. ----> o yazdÄąktan sonra imleç INSERT kipinde aÃ§Äąlan satÄąrÄąn Ãŧzerine gider. +---> o yazdÄąktan sonra imleç EKLE kipinde aÃ§Äąlan satÄąrÄąn Ãŧzerine gider. 4. İmlecin Ãŧzerinde bir satÄąr açmak için, yalnÄązca bÃŧyÃŧk O yazÄąn. Bunu aşağıdaki satÄąrda deneyin. ---> Bu satÄąrÄąn Ãŧzerine bir satÄąr açmak için imleç bu satÄąrdayken O yazÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.2: EKLE KOMUTU - ** İmleçten sonra metin eklemek için a yazÄąn. ** + ** İmleçten sonra metin eklemek için a yazÄąn. ** 1. İmleci aşağıda ---> ile imlenmiş satÄąra gÃļtÃŧrÃŧn. - 2. İmleç satÄą'nÄąn sonuna gelinceye dek e dÃŧğmesine basÄąn. + 2. İmleç satÄąrÄąn sonuna gelinceye dek e dÃŧğmesine basÄąn. 3. İmleçten SONRA metin eklemek için a yazÄąn. - 4. Şimdi ilk satÄąrÄą ikincisi gibi tamamlayÄąn. INSERT kipinden Ã§Äąkmak için + 4. Şimdi ilk satÄąrÄą ikincisi gibi tamamlayÄąn. EKLE kipinden Ã§Äąkmak için dÃŧğmesine basÄąn. 5. e dÃŧğmesini kullanarak bir sonraki yarÄąm sÃļzcÃŧğe gidin ve adÄąm 3 ve 4'Ãŧ @@ -746,7 +747,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu ---> Bu satÄą çalÄąÅŸabilirsiniz. ÇalÄą met ekl ---> Bu satÄąrda çalÄąÅŸabilirsiniz. ÇalÄąÅŸÄąrken metin eklemeyi kullanÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.3: BİR BAŞKA DEĞİŞTİR KOMUTU @@ -758,7 +759,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 2. Şimdi R dÃŧğmesine basÄąn ve ikinci satÄąrdaki sayÄąyÄą ilk satÄąrdaki xxx'in yerine yazÄąn. - 3. dÃŧğmesine basarak REPLACE kipinden Ã§ÄąkÄąn. SatÄąrÄąn geri kalanÄąnÄąn + 3. dÃŧğmesine basarak DEĞİŞTİR kipinden Ã§ÄąkÄąn. SatÄąrÄąn geri kalanÄąnÄąn değişmediğini gÃļzlemleyin. 4. Kalan xxx'i de değiştirmek için adÄąmlarÄą tekrarlayÄąn. @@ -766,14 +767,15 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu ---> 123 sayÄąsÄąna xxx eklemek size yyy toplamÄąnÄą verir. ---> 123 sayÄąsÄąna 456 eklemek size 579 toplamÄąnÄą verir. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.4: METİN KOPYALA VE YAPIŞTIR - ** y işletmenini kullanarak metin kopyalayÄąn ve p kullanarak yapÄąÅŸtÄąrÄąn. ** - 1. İmleci aşağıda ---> ile imlenmiş satÄąra getirin ve "a)"nÄąn ardÄąna koyun. + ** y işlecini kullanarak metin kopyalayÄąn ve p kullanarak yapÄąÅŸtÄąrÄąn. ** + + 1. İmleci aşağıda ---> ile imlenmiş satÄąra getirin, "a)"nÄąn ardÄąna koyun. - 2. v ile VISUAL kipine geçin ve imleci "ilk" sÃļzcÃŧğÃŧnÃŧn Ãļncesine getirin. + 2. v ile GÖRSEL kipe geçin ve imleci "ilk" sÃļzcÃŧğÃŧnÃŧn Ãļncesine getirin. 3. y dÃŧğmesine basarak seçili metni kopyalayÄąn. @@ -781,16 +783,16 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 5. p dÃŧğmesine basarak metni yapÄąÅŸtÄąrÄąn. Akabinde dÃŧğmesine basÄąn. - 6. VISUAL kipine geçerek "Ãļge" sÃļzcÃŧğÃŧnÃŧ seçin, y ile kopyalayÄąn, j$ ile + 6. GÖRSEL kipe geçerek "Ãļge" sÃļzcÃŧğÃŧnÃŧ seçin, y ile kopyalayÄąn, j$ ile ikinci satÄąrÄąn sonuna gidin ve p ile sÃļzcÃŧğÃŧ yapÄąÅŸtÄąrÄąn. ---> a) Bu ilk Ãļge ---> b) - NOT: y komutunu bir işletmen olarak da kullanabilirsiniz; yw komutu yalnÄązca + NOT: y komutunu bir işleç olarak da kullanabilirsiniz; yw komutu yalnÄązca bir sÃļzcÃŧğÃŧ kopyalar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 6.4: SET KOMUTU @@ -815,12 +817,12 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu NOT: Eğer yalnÄązca bir arama işlemi için BÜYÜK/kÃŧçÃŧk harf ayrÄąmsÄąz arama yapmak istiyorsanÄąz /ignore\c komutunu kullanÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DERS 6 ÖZET 1. o komutu imlecin altÄąnda bir satÄąr açar ve imleci bu aÃ§ÄąlmÄąÅŸ satÄąra - INSERT kipinde yerleştirir. + EKLE kipinde yerleştirir. O komutu imlecin Ãŧzerinde bir satÄąr açar. 2. a komutu imleçten sonra metin girişine olanak verir. @@ -828,9 +830,9 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 3. e komutu imleci bir sÃļzcÃŧğÃŧn sonuna taÅŸÄąr. - 4. y işletmeni metni kopyalar, p işletmeni yapÄąÅŸtÄąrÄąr. + 4. y işleci metni kopyalar, p işleci yapÄąÅŸtÄąrÄąr. - 5. R komutu REPLACE (DEĞİŞTİR) kipine girer ve 'ye basÄąlana kadar kalÄąr. + 5. R komutu DEĞİŞTİR kipine girer ve 'ye basÄąlana kadar kalÄąr. 6. ":set xxx" yazmak "xxx" seçeneğini ayarlar. BazÄą seçenekler: 'ic' 'ignorecase' BÜYÜK/kÃŧçÃŧk harf ayrÄąmÄąnÄą arama yaparken kapatÄąr. @@ -840,34 +842,36 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 7. Bir ayarÄą kapatmak için "no" ekleyin, Ãļrneğin :set noic. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7.1: YARDIM KAYNAKLARI ** Çevrimiçi yardÄąm sistemini kullanÄąn ** - Vim geniş bir çeirimiçi yardÄąm sistemine sahiptir. Başlamak için şu ÃŧçÃŧnÃŧ + Vim geniş bir çevrimiçi yardÄąm sistemine sahiptir. Başlamak için şu ÃŧçÃŧnÃŧ deneyebilirsiniz: + - (eğer varsa) dÃŧğmesine basÄąn - (eğer varsa) dÃŧğmesine basÄąn - :help yazÄąn ve dÃŧğmesine basÄąn - YardÄąm penceresindeki metinleri okuyarak yardÄąm sisteminin nasÄąl çalÄąÅŸtığınÄą - Ãļğrenin. + YardÄąm penceresindeki metinleri okuyarak yardÄąm sisteminin nasÄąl + çalÄąÅŸtığınÄą Ãļğrenin. Bir pencereden diğerine geçmek için W ikilisini kullanÄąn. YardÄąm penceresini kapatmak için :q yazÄąp dÃŧğmesine basÄąn. ":help" komutuna değişken (argÃŧman) vererek herhangi bir konu hakkÄąnda - yardÄąm alabilirsini. ŞunlarÄą deneyin ( dÃŧğmesine basmayÄą unutmayÄąn): + yardÄąm alabilirsiniz. ŞunlarÄą deneyin: :help w :help c_ D :help insert-index :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7.2: BİR BAŞLANGIÇ BETİĞİ OLUŞTURUN + ** Vim'in Ãļzelliklerine bakÄąn ** Vim Vi'dan çok daha fazla Ãļzelliğe sahiptir fakat birçoğu ÃļntanÄąmlÄą olarak @@ -877,7 +881,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 1. "vimrc" dosyasÄąnÄą dÃŧzenlemeye başlayÄąn. İşletim sistemlerine gÃļre: :e ~/.vimrc Unix için - :e $VIM/_vimrc Windows için + :e ~/_vimrc Windows için 2. Şimdi Ãļrnek "vimrc" dosyasÄą içeriğini okuyun: @@ -889,20 +893,24 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu TÃŧm tercih ettiğiniz ayarlarÄą bu "vimrc" dosyasÄąna ekleyebilirsiniz. Daha fazla bilgi için :help vimrc-intro yazÄąn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7.3: TAMAMLAMA + ** D ve ile komut istemi ekranÄąnda tamamlama ** - 1. :set nocp komutunu kullanarak Vim'in uyumlu kipte olmadığından emin olun. + 1. :set nocp komutunu kullanarak Vim'in uyumlu kipte olmadığından + emin olun. 2. Bulunduğunuz dizindeki dosyalara :!ls veya :!dir ile bakÄąn. - 3. Bir komutun başlangÄącÄąnÄą yazÄąn, Ãļrneğin :e. + 3. Bir komutun baş kÄąsmÄąnÄą yazÄąn, Ãļrneğin :e. - 4. D'ye bastığınÄązda Vim size e ile başlayan komutlarÄą gÃļsterecektir. + 4. D'ye bastığınÄązda Vim size e ile başlayan komutlarÄą + gÃļsterecektir. - 5. d kullandığınÄązda Vim komutu kendinden :edit olarak tamamlayacaktÄąr. + 5. d kullandığınÄązda Vim komutu kendinden :edit olarak + tamamlayacaktÄąr. 6. Şimdi bir boşluk ekleyin ve var olan bir dosyanÄąn baş harflerini yazÄąn. Örneğin :edit DOS. @@ -913,9 +921,10 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu NOT: Tamamlama birçok komut için çalÄąÅŸÄąr. YalnÄązca D ve ikililerini deneyin. Özellikle :help için çok yararlÄądÄąr. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ders 7: ÖZET + 1. :help yazmak veya veya dÃŧğmelerine basmak yardÄąm penceresini açar. @@ -931,12 +940,13 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu 6. Bir : komutu girerken D'ye basarak olanaklÄą tamamlama seçeneklerini gÃļrebilirsiniz. 'a basarak tamamlamayÄą seçin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Burada Vim Eğitmeni tamamlanmÄąÅŸ oldu. Eğitmendeki amaç Vim dÃŧzenleyicisi + BÃļylece Vim Eğitmeni tamamlanmÄąÅŸ oldu. Eğitmendeki amaç Vim dÃŧzenleyicisi hakkÄąnda kÄąsa bir bilgi vermek ve onu kolayca kullanmanÄązÄą sağlamaktÄą. - Vim'in tamamÄąnÄą Ãļğretmek çok zordur zira Vim birçok komuta sahiptir. Bundan - sonra ":help user-manual" komutu ile kullanÄącÄą kÄąlavuzunu okumalÄąsÄąnÄąz. + Vim'in tamamÄąnÄą Ãļğretmek çok zordur zira Vim birçok komuta sahiptir. + Bundan sonra ":help user-manual" komutu ile kullanÄącÄą kÄąlavuzunu + okumalÄąsÄąnÄąz. Daha fazla okuma ve çalÄąÅŸma için şu kitabÄą Ãļneriyoruz: @@ -946,7 +956,7 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu TÃŧmÃŧyle Vim için hazÄąrlanmÄąÅŸ ilk kitaptÄąr. Özellikle ilk kullanÄącÄąlar için çok uygundur. Kitapta birçok Ãļrnek ve resim bulunmaktadÄąr. - http://iccf-holland.org/click5.html adresine bakabilirsiniz. + https://iccf-holland.org/click5.html adresine bakabilirsiniz. Bu kitap daha eskidir ve Vim'den daha çok Vi içindir ancak tavsiye edilir: @@ -962,7 +972,10 @@ Not: Arama dosyanÄąn sonuna ulaştığında dosyanÄąn baÅŸÄąndan sÃŧrecektir. Bu Vim için değiştiren: Bram Moolenaar - TÃŧrkçe çeviri: Serkan "heartsmagic" ÇalÄąÅŸ (2005), adresimeyaz (at) yahoo com - 2019 GÃŧncelleme: Emir SARI, emirsari (at) gmail com + TÃŧrkçe çeviri: + Serkan "heartsmagic" ÇalÄąÅŸ (2005), adresimeyaz (at) yahoo (dot) com + + 2019 GÃŧncelleme: + Emir SARI, bitigchi (at) me (dot) com -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.uk.utf-8 b/runtime/tutor/tutor.uk.utf-8 index 34d83ebd4c0b9..541c74fdd890b 100644 --- a/runtime/tutor/tutor.uk.utf-8 +++ b/runtime/tutor/tutor.uk.utf-8 @@ -894,8 +894,8 @@ Ņ„Đ°ĐšĐģ "vimrc". 1. ĐŸĐžŅ‡ĐŊŅ–Ņ‚ŅŒ Ņ€ĐĩĐ´Đ°ĐŗŅƒĐ˛Đ°ĐŊĐŊŅ Ņ„Đ°ĐšĐģ҃ "vimrc" . ĐĻĐĩ СаĐģĐĩĐļĐ¸Ņ‚ŅŒ Đ˛Ņ–Đ´ Đ˛Đ°ŅˆĐžŅ— ŅĐ¸ŅŅ‚ĐĩĐŧи: - :e ~/.vimrc Đ´ĐģŅ Unix - :e $VIM/_vimrc Đ´ĐģŅ MS-Windows + :e ~/.vimrc Đ´ĐģŅ Unix + :e ~/_vimrc Đ´ĐģŅ MS-Windows 2. ĐĸĐĩĐŋĐĩŅ€ ĐŋŅ€ĐžŅ‡Đ¸Ņ‚Đ°ĐšŅ‚Đĩ ĐŋŅ€Đ¸ĐēĐģад вĐŧŅ–ŅŅ‚Ņƒ "vimrc" : :r $VIMRUNTIME/vimrc_example.vim @@ -965,7 +965,7 @@ Publisher: New Riders ĐžŅĐžĐąĐģивО ĐēĐžŅ€Đ¸ŅĐŊа Đ´ĐģŅ ĐŋĐžŅ‡Đ°Ņ‚ĐēŅ–Đ˛Ņ†Ņ–Đ˛. ĐĸаĐŧ ĐąĐ°ĐŗĐ°Ņ‚Đž ĐŋŅ€Đ¸ĐēĐģĐ°Đ´Ņ–Đ˛ Ņ– Ņ–ĐģŅŽŅŅ‚Ņ€Đ°Ņ†Ņ–Đš. - Đ”Đ¸Đ˛Ņ–Ņ‚ŅŒŅŅ http://iccf-holland.org/click5.html + Đ”Đ¸Đ˛Ņ–Ņ‚ŅŒŅŅ https://iccf-holland.org/click5.html ĐĻŅ– ŅƒŅ€ĐžĐēи ĐąŅƒĐģи ĐŊаĐŋĐ¸ŅĐ°ĐŊŅ– МайĐēĐģĐžĐŧ ĐĄ. ĐŸŅ–Ņ€ŅĐžĐŧ Ņ‚Đ° РОйĐĩŅ€Ņ‚ĐžĐŧ ĐŖĐ°Ņ€ĐžĐŧ. diff --git a/runtime/tutor/tutor.utf-8 b/runtime/tutor/tutor.utf-8 index 426fb575697dc..98c41778453ca 100644 --- a/runtime/tutor/tutor.utf-8 +++ b/runtime/tutor/tutor.utf-8 @@ -7,7 +7,7 @@ enough of the commands that you will be able to easily use Vim as an all-purpose editor. - The approximate time required to complete the tutor is 25-30 minutes, + The approximate time required to complete the tutor is 30 minutes, depending upon how much time is spent with experimentation. ATTENTION: @@ -143,12 +143,12 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. !! NOTE: Before executing any of the steps below, read this entire lesson!! - 1. Exit this tutor as you did in lesson 1.2: :q! - Or, if you have access to another terminal, do the following there. + 1. If you have access to another terminal, do the following there. + Otherwise, exit this tutor as you did in lesson 1.2: :q! - 2. At the shell prompt type this command: vim tutor - 'vim' is the command to start the Vim editor, 'tutor' is the name of the - file you wish to edit. Use a file that may be changed. + 2. At the shell prompt type this command: vim file.txt + 'vim' is the command to start the Vim editor, 'file.txt' is the name of + the file you wish to edit. Use the name of a file that you can change. 3. Insert and delete text as you learned in the previous lessons. @@ -319,6 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> 6) Sugar is sweet ---> 7) And so are you. +Doubling to operate on a line also works for operators mentioned below. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.7: THE UNDO COMMAND @@ -346,25 +347,25 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2 SUMMARY + 1. To delete from the cursor up to the next word type: dw + 2. To delete from the cursor up to the end of the word type: de + 3. To delete from the cursor to the end of a line type: d$ + 4. To delete a whole line type: dd - 1. To delete from the cursor up to the next word type: dw - 2. To delete from the cursor to the end of a line type: d$ - 3. To delete a whole line type: dd - - 4. To repeat a motion prepend it with a number: 2w - 5. The format for a change command is: + 5. To repeat a motion prepend it with a number: 2w + 6. The format for a change command is: operator [number] motion where: operator - is what to do, such as d for delete [number] - is an optional count to repeat the motion motion - moves over the text to operate on, such as w (word), - $ (to the end of line), etc. + e (end of word), $ (end of the line), etc. - 6. To move to the start of the line use a zero: 0 + 7. To move to the start of the line use a zero: 0 - 7. To undo previous actions, type: u (lowercase u) + 8. To undo previous actions, type: u (lowercase u) To undo all the changes on a line, type: U (capital U) - To undo the undo's, type: CTRL-R + To undo the undo's, type: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 3.1: THE PUT COMMAND @@ -432,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization. ---> This line has a few words that need changing using the change operator. Notice that ce deletes the word and places you in Insert mode. - + cc does the same for the whole line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -802,7 +803,8 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an ---> a) this is the first item. b) - NOTE: You can also use y as an operator; yw yanks one word. + NOTE: You can also use y as an operator: yw yanks one word, + yy yanks the whole line, then p puts that line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.5: SET OPTION @@ -879,11 +881,11 @@ NOTE: If you want to ignore case for just one search command, use \c ** Enable Vim features ** Vim has many more features than Vi, but most of them are disabled by - default. To start using more features you have to create a "vimrc" file. + default. To start using more features you should create a "vimrc" file. 1. Start editing the "vimrc" file. This depends on your system: :e ~/.vimrc for Unix - :e $VIM/_vimrc for Windows + :e ~/_vimrc for Windows 2. Now read the example "vimrc" file contents: :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +955,7 @@ NOTE: Completion works for many commands. Just try pressing CTRL-D and Publisher: New Riders The first book completely dedicated to Vim. Especially useful for beginners. There are many examples and pictures. - See http://iccf-holland.org/click5.html + See https://iccf-holland.org/click5.html This book is older and more about Vi than Vim, but also recommended: Learning the Vi Editor - by Linda Lamb diff --git a/runtime/tutor/tutor.vi.utf-8 b/runtime/tutor/tutor.vi.utf-8 index ea7142ad7b6fa..2e967c84c000d 100644 --- a/runtime/tutor/tutor.vi.utf-8 +++ b/runtime/tutor/tutor.vi.utf-8 @@ -765,8 +765,8 @@ ChÃē ÃŊ: Láģ‡nh này thay cho viáģ‡c gÃĩ i , kÃŊ táģą cuáģ‘i cÚng, văn báēŖn Đáģƒ sáģ­ dáģĨng cÃĄc tính năng này báēĄn cáē§n pháēŖi táēĄo máģ™t táē­p tin "vimrc". 1. SoáēĄn tháēŖo táģ‡p tin "vimrc", pháģĨ thuáģ™c vào háģ‡ tháģ‘ng cáģ§a báēĄn: - :edit ~/.vimrc đáģ‘i váģ›i Unix - :edit $VIM/_vimrc đáģ‘i váģ›i MS-Windows + :edit ~/.vimrc đáģ‘i váģ›i Unix + :edit ~/_vimrc đáģ‘i váģ›i MS-Windows 2. BÃĸy giáģ Ä‘áģc táē­p tin "vimrc" ví dáģĨ: @@ -792,7 +792,7 @@ ChÃē ÃŊ: Láģ‡nh này thay cho viáģ‡c gÃĩ i , kÃŊ táģą cuáģ‘i cÚng, văn báēŖn Nhà xuáēĨt báēŖn: New Riders Cuáģ‘n sÃĄch đáē§u tiÃĒn dành hoàn toàn cho Vim. Đáēˇc biáģ‡t cÃŗ ích cho ngưáģi máģ›i. CÃŗ ráēĨt nhiáģu ví dáģĨ và tranh áēŖnh. - HÃŖy xem: http://iccf-holland.org/click5.html + HÃŖy xem: https://iccf-holland.org/click5.html Cuáģ‘n sÃĄch tiáēŋp theo này xuáēĨt báēŖn sáģ›m hÆĄn và nÃŗi nhiáģu váģ Vi hÆĄn là Vim, nhưng cÅŠng ráēĨt nÃĒn đáģc: diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim index 9517f6942b637..dc6972486e3e1 100644 --- a/runtime/tutor/tutor.vim +++ b/runtime/tutor/tutor.vim @@ -1,7 +1,7 @@ " Vim tutor support file " Author: Eduardo F. Amatria " Maintainer: Bram Moolenaar -" Last Change: 2019 Mar 30 +" Last Change: 2019 Nov 11 " This Vim script is used for detecting if a translation of the " tutor file exist, i.e., a tutor.xx file, where xx is the language. @@ -108,7 +108,7 @@ endif " The Turkish tutor is available in two encodings, guess which one to use if s:ext =~? '\.tr' - if &enc == "iso-8859-9" + if &enc == "iso-8859-9" || &enc == "cp1254" let s:ext = ".tr.iso9" endif endif diff --git a/runtime/tutor/tutor.zh.big5 b/runtime/tutor/tutor.zh.big5 index 3b9753a2e7ddc..6a4e2cb3bc2ce 100644 --- a/runtime/tutor/tutor.zh.big5 +++ b/runtime/tutor/tutor.zh.big5 @@ -778,7 +778,7 @@ Open up a line above this by typing Shift-O while the cursor is on this line. 1. īŋŊ}īŋŊlīŋŊsīŋŊīŋŊvimrcīŋŊīŋŊīŋŊAīŋŊoīŋŊīŋŊīŋŊMīŋŊ_īŋŊzīŋŊŌ¨ĪĨÎĒīŋŊīŋŊŪ§@īŋŊtīŋŊÎĄJ :edit ~/.vimrc īŋŊoīŋŊOUnixīŋŊtīŋŊÎŠŌ¨ĪĨÎĒīŋŊīŋŊRīŋŊO - :edit $VIM/_vimrc īŋŊoīŋŊOWindowsīŋŊtīŋŊÎŠŌ¨ĪĨÎĒīŋŊīŋŊRīŋŊO + :edit ~/_vimrc īŋŊoīŋŊOWindowsīŋŊtīŋŊÎŠŌ¨ĪĨÎĒīŋŊīŋŊRīŋŊO 2. īŋŊīŋŊīŋŊ۞ɤJvimrcīŋŊSīŋŊŌ¤īŋŊīŋŊJ @@ -805,7 +805,7 @@ Open up a line above this by typing Shift-O while the cursor is on this line. īŋŊXīŋŊīŋŊīŋŊīŋŊīŋŊJNew Riders īŋŊoīŋŊOīŋŊĤ@īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊvimīŋŊīŋŊīŋŊīŋŊīŋŊyīŋŊCīŋŊīŋŊ_īŋŊīŋŊĮŽÍ¯SīŋŊOīŋŊīŋŊīŋŊÎĄCīŋŊ䤤īŋŊŲĨ]īŋŊtīŋŊīŋŊīŋŊjīŋŊqīŋŊīŋŊīŋŊ - īŋŊMīŋŊĪĨÜĄCīŋŊīŋŊīŋŊīŋŊīŋŊÔąīŋŊīŋŊAīŋŊĐŗXīŋŊīŋŊ http://iccf-holland.org/click5.html + īŋŊMīŋŊĪĨÜĄCīŋŊīŋŊīŋŊīŋŊīŋŊÔąīŋŊīŋŊAīŋŊĐŗXīŋŊīŋŊ https://iccf-holland.org/click5.html īŋŊHīŋŊUīŋŊoīŋŊīŋŊīŋŊҤīŋŊīŋŊīŋŊҤFīŋŊĶĨBīŋŊīŋŊīŋŊeīŋŊDīŋŊnīŋŊOviīŋŊͤīŋŊīŋŊOvimīŋŊAīŋŊīŋŊīŋŊOīŋŊ]īŋŊČąoīŋŊīŋŊīŋŊËĄJ diff --git a/runtime/tutor/tutor.zh.euc b/runtime/tutor/tutor.zh.euc index 50852f810501f..16a031a3b9405 100644 --- a/runtime/tutor/tutor.zh.euc +++ b/runtime/tutor/tutor.zh.euc @@ -883,7 +883,7 @@ 1. īŋŊīŋŊĘŧīŋŊāŧ­ vimrc īŋŊÄŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊČĄīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊĘšīŋŊÃĩIJīŋŊīŋŊīŋŊĪĩÍŗīŋŊīŋŊ :edit ~/.vimrc īŋŊīŋŊīŋŊīŋŊ Unix ĪĩÍŗīŋŊīŋŊĘšīŋŊÃĩīŋŊīŋŊīŋŊīŋŊīŋŊ - :edit $VIM/_vimrc īŋŊīŋŊīŋŊīŋŊ MS-Windows ĪĩÍŗīŋŊīŋŊĘšīŋŊÃĩīŋŊīŋŊīŋŊīŋŊīŋŊ + :edit ~/_vimrc īŋŊīŋŊīŋŊīŋŊ MS-Windows ĪĩÍŗīŋŊīŋŊĘšīŋŊÃĩīŋŊīŋŊīŋŊīŋŊīŋŊ 2. īŋŊīŋŊīŋŊÅļīŋŊČĄ vimrc ĘžīŋŊīŋŊīŋŊÄŧīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŨŖīŋŊ :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ īŋŊīŋŊīŋŊīŋŊīŋŊįŖēNew Riders īŋŊīŋŊīŋŊĮĩīŋŊŌģīŋŊīŋŊīŋŊīŋŊČĢīŋŊīŋŊīŋŊīŋŊ Vim īŋŊīŋŊīŋŊéŧŽīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÚŗīŋŊҧīŋŊīŋŊīŋŊØąīŋŊīŋŊīŋŊīŋŊÃĄīŋŊīŋŊīŋŊīŋŊаīŋŊīŋŊīŋŊīŋŊĐ´īŋŊīŋŊīŋŊĘĩīŋŊīŋŊ īŋŊīŋŊÍŧĘžīŋŊīŋŊ - īŋŊīŋŊÖĒīŋŊīŋŊīŋŊéŖŦīŋŊīŋŊīŋŊīŋŊīŋŊ http://iccf-holland.org/click5.html + īŋŊīŋŊÖĒīŋŊīŋŊīŋŊéŖŦīŋŊīŋŊīŋŊīŋŊīŋŊ https://iccf-holland.org/click5.html īŋŊīŋŊīŋŊīŋŊīŋŊâąžīŋŊīŋŊČŊīŋŊīŋŊīŋŊīŋŊËļīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŨ¸īŋŊīŋŊīŋŊīŋŊĮšīŋŊīŋŊīŋŊ Vi īŋŊīŋŊīŋŊīŋŊ VimīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊŌ˛ÖĩīŋŊīŋŊīŋŊÆŧīŋŊīŋŊīŋŊ Learning the Vi Editor - īŋŊīŋŊīŋŊßŖīŋŊLinda Lamb diff --git a/runtime/tutor/tutor.zh.utf-8 b/runtime/tutor/tutor.zh.utf-8 index 885faf48fb08a..fc35259837955 100644 --- a/runtime/tutor/tutor.zh.utf-8 +++ b/runtime/tutor/tutor.zh.utf-8 @@ -778,7 +778,7 @@ Open up a line above this by typing Shift-O while the cursor is on this line. 1. 開始ᎍčŧ¯vimrc文äģļīŧŒé€™å–æąēäēŽæ‚¨æ‰€äŊŋį”¨įš„æ“äŊœįŗģįĩąī¸° :edit ~/.vimrc 這是Unixįŗģįĩ࿉€äŊŋį”¨įš„å‘Ŋäģ¤ - :edit $VIM/_vimrc 這是Windowsįŗģįĩ࿉€äŊŋį”¨įš„å‘Ŋäģ¤ + :edit ~/_vimrc 這是Windowsįŗģįĩ࿉€äŊŋį”¨įš„å‘Ŋäģ¤ 2. æŽĨč‘—å°Žå…ĨvimrcčŒƒäž‹æ–‡äģļ @@ -805,7 +805,7 @@ Open up a line above this by typing Shift-O while the cursor is on this line. å‡ēį‰ˆį¤žī¸°New Riders 這是įŦŦ一æœŦ厌全čŦ›č§Ŗvimįš„æ›¸įąã€‚å°äēŽåˆå­¸č€…į‰šåˆĨæœ‰į”¨ã€‚å…ļ中還包åĢ有大量å¯Ļ例 - 和圖į¤ē。æŦ˛įŸĨčŠŗæƒ…īŧŒčĢ‹č¨Ē問 http://iccf-holland.org/click5.html + 和圖į¤ē。æŦ˛įŸĨčŠŗæƒ…īŧŒčĢ‹č¨Ē問 https://iccf-holland.org/click5.html äģĨ下這æœŦ書比čŧƒč€äē†č€Œä¸”內厚ä¸ģčĻæ˜¯vič€Œä¸æ˜¯vimīŧŒäŊ†æ˜¯äšŸå€ŧ垗推č–Ļ diff --git a/runtime/tutor/tutor.zh_cn.utf-8 b/runtime/tutor/tutor.zh_cn.utf-8 index d986ab2645c7c..65a766e2280e5 100644 --- a/runtime/tutor/tutor.zh_cn.utf-8 +++ b/runtime/tutor/tutor.zh_cn.utf-8 @@ -883,7 +883,7 @@ 1. åŧ€å§‹įŧ–čž‘ vimrc 文äģļīŧŒå…ˇäŊ“å‘Ŋäģ¤å–冺äēŽæ‚¨æ‰€äŊŋį”¨įš„æ“äŊœįŗģįģŸīŧš :edit ~/.vimrc čŋ™æ˜¯ Unix įŗģį쟿‰€äŊŋį”¨įš„å‘Ŋäģ¤ - :edit $VIM/_vimrc čŋ™æ˜¯ MS-Windows įŗģį쟿‰€äŊŋį”¨įš„å‘Ŋäģ¤ + :edit ~/_vimrc čŋ™æ˜¯ MS-Windows įŗģį쟿‰€äŊŋį”¨įš„å‘Ŋäģ¤ 2. æŽĨį€č¯ģ取 vimrc į¤ē䞋文äģļįš„å†…åŽšīŧš :r $VIMRUNTIME/vimrc_example.vim @@ -953,7 +953,7 @@ å‡ēį‰ˆį¤žīŧšNew Riders čŋ™æ˜¯įŦŦ一æœŦåŽŒå…¨čŽ˛č§Ŗ Vim įš„äšĻįąã€‚åŽƒå¯šäēŽåˆå­Ļč€…į‰šåˆĢæœ‰į”¨ã€‚å…ļ中包åĢ有大量厞䞋 和回į¤ē。 - æŦ˛įŸĨč¯Ļ情īŧŒč¯ˇčŽŋ问 http://iccf-holland.org/click5.html + æŦ˛įŸĨč¯Ļ情īŧŒč¯ˇčŽŋ问 https://iccf-holland.org/click5.html äģĨ下čŋ™æœŦäšĻæ¯”čžƒč€äē†č€Œä¸”å†…åŽšæ›´å¤šæ˜¯å…ŗäēŽ Vi 而非 VimīŧŒäŊ†æ˜¯äšŸå€ŧåž—æŽ¨čīŧš Learning the Vi Editor - äŊœč€…īŧšLinda Lamb diff --git a/runtime/tutor/tutor.zh_tw.utf-8 b/runtime/tutor/tutor.zh_tw.utf-8 index 885faf48fb08a..fc35259837955 100644 --- a/runtime/tutor/tutor.zh_tw.utf-8 +++ b/runtime/tutor/tutor.zh_tw.utf-8 @@ -778,7 +778,7 @@ Open up a line above this by typing Shift-O while the cursor is on this line. 1. 開始ᎍčŧ¯vimrc文äģļīŧŒé€™å–æąēäēŽæ‚¨æ‰€äŊŋį”¨įš„æ“äŊœįŗģįĩąī¸° :edit ~/.vimrc 這是Unixįŗģįĩ࿉€äŊŋį”¨įš„å‘Ŋäģ¤ - :edit $VIM/_vimrc 這是Windowsįŗģįĩ࿉€äŊŋį”¨įš„å‘Ŋäģ¤ + :edit ~/_vimrc 這是Windowsįŗģįĩ࿉€äŊŋį”¨įš„å‘Ŋäģ¤ 2. æŽĨč‘—å°Žå…ĨvimrcčŒƒäž‹æ–‡äģļ @@ -805,7 +805,7 @@ Open up a line above this by typing Shift-O while the cursor is on this line. å‡ēį‰ˆį¤žī¸°New Riders 這是įŦŦ一æœŦ厌全čŦ›č§Ŗvimįš„æ›¸įąã€‚å°äēŽåˆå­¸č€…į‰šåˆĨæœ‰į”¨ã€‚å…ļ中還包åĢ有大量å¯Ļ例 - 和圖į¤ē。æŦ˛įŸĨčŠŗæƒ…īŧŒčĢ‹č¨Ē問 http://iccf-holland.org/click5.html + 和圖į¤ē。æŦ˛įŸĨčŠŗæƒ…īŧŒčĢ‹č¨Ē問 https://iccf-holland.org/click5.html äģĨ下這æœŦ書比čŧƒč€äē†č€Œä¸”內厚ä¸ģčĻæ˜¯vič€Œä¸æ˜¯vimīŧŒäŊ†æ˜¯äšŸå€ŧ垗推č–Ļ diff --git a/runtime/vim.desktop b/runtime/vim.desktop index 25c4736a8227d..a8672cb2c225b 100644 --- a/runtime/vim.desktop +++ b/runtime/vim.desktop @@ -2,27 +2,56 @@ # Edit the src/po/vim.desktop.in file instead. [Desktop Entry] # Translators: This is the Application Name used in the Vim desktop file +Name[ca]=Vim Name[de]=Vim Name[eo]=Vim +Name[es]=Vim +Name[fi]=Vim +Name[fr]=Vim +Name[ga]=Vim +Name[it]=Vim +Name[ru]=Vim +Name[sr]=Vim Name[tr]=Vim +Name[uk]=Vim +Name[zh_CN]=Vim Name=Vim # Translators: This is the Generic Application Name used in the Vim desktop file +GenericName[ca]=Editor de text GenericName[de]=Texteditor GenericName[eo]=Tekstoredaktilo +GenericName[es]=Editor de texto +GenericName[fi]=Tekstinmuokkain +GenericName[fr]=Éditeur de texte +GenericName[ga]=EagarthÃŗir TÊacs +GenericName[it]=Editor di testi GenericName[ja]=ãƒ†ã‚­ã‚šãƒˆã‚¨ãƒ‡ã‚Ŗã‚ŋ +GenericName[ru]=ĐĸĐĩĐēŅŅ‚ĐžĐ˛Ņ‹Đš Ņ€ĐĩдаĐēŅ‚ĐžŅ€ +GenericName[sr]=Đ•Đ´Đ¸Ņ‚ĐžŅ€ Ņ‚ĐĩĐēҁ҂ GenericName[tr]=Metin DÃŧzenleyici +GenericName[uk]=Đ ĐĩдаĐēŅ‚ĐžŅ€ ĐĸĐĩĐēŅŅ‚Ņƒ +GenericName[zh_CN]=文æœŦįŧ–čž‘å™¨ GenericName=Text Editor # Translators: This is the comment used in the Vim desktop file +Comment[ca]=Edita fitxers de text Comment[de]=Textdateien bearbeiten Comment[eo]=Redakti tekstajn dosierojn +Comment[es]=Editar archivos de texto +Comment[fi]=Muokkaa tekstitiedostoja +Comment[fr]=Éditer des fichiers texte +Comment[ga]=Cuir comhaid tÊacs in eagar +Comment[it]=Edita file di testo Comment[ja]=ãƒ†ã‚­ã‚šãƒˆãƒ•ã‚Ąã‚¤ãƒĢã‚’įˇ¨é›†ã—ãžã™ -Comment[tr]=Metin dosyalarÄą dÃŧzenle +Comment[ru]=Đ ĐĩдаĐēŅ‚Đ¸Ņ€ĐžĐ˛Đ°ĐŊиĐĩ Ņ‚ĐĩĐēŅŅ‚ĐžĐ˛Ņ‹Ņ… Ņ„Đ°ĐšĐģОв +Comment[sr]=ĐŖŅ€ĐĩŅ’ŅƒŅ˜Ņ‚Đĩ Ņ‚ĐĩĐēҁ҂ Ņ„Đ°Ņ˜ĐģОвĐĩ +Comment[tr]=Metin dosyalarÄą dÃŧzenleyin +Comment[uk]=Đ ĐĩĐ´Đ°ĐŗŅƒĐ˛Đ°Ņ‚Đ¸ Ņ‚ĐĩĐēŅŅ‚ĐžĐ˛Ņ– Ņ„Đ°ĐšĐģи +Comment[zh_CN]=įŧ–čž‘æ–‡æœŦ文äģļ Comment=Edit text files # The translations should come from the po file. Leave them here for now, they will # be overwritten by the po file when generating the desktop.file. GenericName[da]=Teksteditor GenericName[pl]=Edytor tekstu -GenericName[sr]=Đ•Đ´Đ¸Ņ‚ĐžŅ€ Ņ‚ĐĩĐēŅŅ‚Đ° GenericName[is]=Ritvinnsluforrit Comment[af]=Redigeer tekslÃĒers Comment[am]=የáŒŊሑፍ ፋይሎá‰Ŋ á‹ĢáˆĩተáŠĢክሉ @@ -32,20 +61,15 @@ Comment[be]=Đ ŅĐ´Đ°ĐŗĐ°Đ˛Đ°ĐŊҌĐŊĐĩ Ņ‚ŅĐēŅŅ‚Đ°Đ˛Ņ‹Ņ… Ņ„Đ°ĐšĐģĐ°Ņž Comment[bg]=Đ ĐĩдаĐēŅ‚Đ¸Ņ€Đ°ĐŊĐĩ ĐŊа Ņ‚ĐĩĐēŅŅ‚ĐžĐ˛Đ¸ Ņ„Đ°ĐšĐģОвĐĩ Comment[bn]=āĻŸā§‡āĻ•ā§āĻ¸ā§āϟ āĻĢāĻžāχāϞ āĻāĻĄāĻŋāϟ āĻ•āϰ⧁āύ Comment[bs]=Izmijeni tekstualne datoteke -Comment[ca]=Edita fitxers de text Comment[cs]=Úprava textovÃŊch souborů Comment[cy]=Golygu ffeiliau testun Comment[da]=Rediger tekstfiler Comment[el]=Î•Ī€ÎĩΞÎĩĪÎŗÎąĪƒÎ¯Îą ÎąĪĪ‡ÎĩÎ¯Ī‰ÎŊ ÎēÎĩΚÎŧέÎŊÎŋĪ… Comment[en_CA]=Edit text files Comment[en_GB]=Edit text files -Comment[es]=Edita archivos de texto Comment[et]=Redigeeri tekstifaile Comment[eu]=Editatu testu-fitxategiak Comment[fa]=ŲˆÛŒØąØ§ÛŒØ´ ŲžØąŲˆŲ†Ø¯Ų‡â€ŒŲ‡Ø§ÛŒ Ų…ØĒŲ†ÛŒ -Comment[fi]=Muokkaa tekstitiedostoja -Comment[fr]=Édite des fichiers texte -Comment[ga]=Eagar comhad TÊacs Comment[gu]=āǞāĒ–āĒžāĒŖ āĒĢāĒžāLJāǞāĢ‹āĒŽāĒžāĒ‚ āĒĢā̇āǰāĒĢāĒžāǰ āĒ•āǰāĢ‹ Comment[he]=×ĸרוך קב×Ļי טקץט Comment[hi]=ā¤Ēā¤žā¤  ā¤Ģā¤ŧā¤žā¤‡ā¤˛āĨ‡ā¤‚ ⤏⤂ā¤Ēā¤žā¤Ļā¤ŋ⤤ ⤕⤰āĨ‡ā¤‚ @@ -53,7 +77,6 @@ Comment[hr]=Uređivanje tekstualne datoteke Comment[hu]=SzÃļvegfÃĄjlok szerkesztÊse Comment[id]=Edit file teks Comment[is]=Vinna með textaskrÃĄr -Comment[it]=Modifica file di testo Comment[kn]=ā˛Ēā˛ āŗā˛¯ ā˛•ā˛Ąā˛¤ā˛—ā˛ŗā˛¨āŗā˛¨āŗ ➏➂ā˛Ēā˛žā˛Ļā˛ŋ➏⺁ Comment[ko]=í…ėŠ¤íŠ¸ 파ėŧė„ íŽ¸ė§‘í•Šë‹ˆë‹¤ Comment[lt]=Redaguoti tekstines bylas @@ -74,34 +97,38 @@ Comment[pl]=Edytuj pliki tekstowe Comment[pt]=Editar ficheiros de texto Comment[pt_BR]=Edite arquivos de texto Comment[ro]=Editare fişiere text -Comment[ru]=Đ ĐĩдаĐēŅ‚ĐžŅ€ Ņ‚ĐĩĐēŅŅ‚ĐžĐ˛Ņ‹Ņ… Ņ„Đ°ĐšĐģОв Comment[sk]=Úprava textovÃŊch sÃēborov Comment[sl]=Urejanje datotek z besedili Comment[sq]=PÃĢrpuno files teksti -Comment[sr]=ИСĐŧĐĩĐŊи Ņ‚ĐĩĐēŅŅ‚ŅƒĐ°ĐģĐŊĐĩ Đ´Đ°Ņ‚ĐžŅ‚ĐĩĐēĐĩ Comment[sr@Latn]=Izmeni tekstualne datoteke Comment[sv]=Redigera textfiler Comment[ta]=āŽ‰āŽ°ā¯ˆ āŽ•ā¯‹āŽĒā¯āŽĒā¯āŽ•āŽŗā¯ˆ āŽ¤ā¯ŠāŽ•ā¯āŽ•ā¯āŽ•āŽĩā¯āŽŽā¯ Comment[th]=āšā¸āš‰āš„ā¸‚āšā¸Ÿāš‰ā¸Ąā¸‚āš‰ā¸­ā¸„ā¸§ā¸˛ā¸Ą Comment[tk]=Metin faÃŊllary editle -Comment[uk]=Đ ĐĩдаĐēŅ‚ĐžŅ€ Ņ‚ĐĩĐēŅŅ‚ĐžĐ˛Đ¸Ņ… Ņ„Đ°ĐšĐģŅ–Đ˛ Comment[vi]=SoáēĄn tháēŖo táē­p tin văn báēŖn Comment[wa]=AsspougnÃŽ des fitchÃŽs tecses -Comment[zh_CN]=įŧ–čž‘æ–‡æœŦ文äģļ Comment[zh_TW]=ᎍčŧ¯æ–‡å­—æĒ” TryExec=vim Exec=vim %F Terminal=true Type=Application # Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon! +Keywords[ca]=Text;editor; Keywords[de]=Text;Editor; Keywords[eo]=Teksto;redaktilo; +Keywords[es]=Texto;editor; +Keywords[fi]=Teksti;muokkain;editori; +Keywords[fr]=Texte;Êditeur; +Keywords[ga]=TÊacs;eagarthÃŗir; +Keywords[it]=Testo;editor; Keywords[ja]=テキ゚ト;ã‚¨ãƒ‡ã‚Ŗã‚ŋ; +Keywords[ru]=Ņ‚ĐĩĐēҁ҂;Ņ‚ĐĩĐēŅŅ‚ĐžĐ˛Ņ‹Đš Ņ€ĐĩдаĐēŅ‚ĐžŅ€; +Keywords[sr]=ĐĸĐĩĐēҁ҂;ĐĩĐ´Đ¸Ņ‚ĐžŅ€; Keywords[tr]=Metin;dÃŧzenleyici; +Keywords[uk]=Ņ‚ĐĩĐēҁ҂;Ņ€ĐĩдаĐēŅ‚ĐžŅ€; +Keywords[zh_CN]=Text;editor;文æœŦ;įŧ–čž‘å™¨; Keywords=Text;editor; # Translators: This is the Icon file name. Do NOT translate -Icon[de]=gvim -Icon[eo]=gvim Icon=gvim Categories=Utility;TextEditor; StartupNotify=false diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim index b05793bd10154..e11e4cff55596 100644 --- a/runtime/vimrc_example.vim +++ b/runtime/vimrc_example.vim @@ -1,12 +1,13 @@ " An example for a vimrc file. " " Maintainer: Bram Moolenaar -" Last change: 2019 Jan 26 +" Last change: 2019 Dec 17 " " To use it, copy it to -" for Unix and OS/2: ~/.vimrc +" for Unix: ~/.vimrc " for Amiga: s:.vimrc -" for MS-DOS and Win32: $VIM\_vimrc +" for MS-Windows: $VIM\_vimrc +" for Haiku: ~/config/settings/vim/vimrc " for OpenVMS: sys$login:.vimrc " When started as "evim", evim.vim will already have done these settings, bail diff --git a/src/GvimExt/GvimExt.reg b/src/GvimExt/GvimExt.reg index 17d085a415f6f..129ce6e529e3c 100644 --- a/src/GvimExt/GvimExt.reg +++ b/src/GvimExt/GvimExt.reg @@ -15,6 +15,6 @@ REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Vim\Gvim] "path"="gvim.exe" -[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 8.1] - "DisplayName"="Vim 8.1: Edit with Vim popup menu entry" +[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 8.2] + "DisplayName"="Vim 8.2: Edit with Vim popup menu entry" "UninstallString"="uninstall.exe" diff --git a/src/GvimExt/Make_ming.mak b/src/GvimExt/Make_ming.mak index a6ab3ae10e26e..5cde1847f53e6 100644 --- a/src/GvimExt/Make_ming.mak +++ b/src/GvimExt/Make_ming.mak @@ -49,11 +49,13 @@ WINVER = 0x0501 endif CXX := $(CROSS_COMPILE)g++ WINDRES := $(CROSS_COMPILE)windres -WINDRES_CXX = $(CXX) -WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED +# this used to have --preprocessor, but it's no longer supported +WINDRES_FLAGS = LIBS := -luuid -lgdi32 RES := gvimext.res +ifeq ($(findstring clang++,$(CXX)),) DEFFILE = gvimext_ming.def +endif OBJ := gvimext.o DLL := gvimext.dll diff --git a/src/GvimExt/Makefile b/src/GvimExt/Makefile index 975ba1170525e..4b83f52dd5e4e 100644 --- a/src/GvimExt/Makefile +++ b/src/GvimExt/Makefile @@ -10,6 +10,9 @@ TARGETOS = WINNT !ifndef APPVER APPVER = 5.01 !endif +!ifndef WINVER +WINVER = 0x0501 +!endif !if "$(DEBUG)" != "yes" NODEBUG = 1 @@ -53,6 +56,13 @@ olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib # include CPUARG cflags = $(cflags) $(CPUARG) +# set WINVER and _WIN32_WINNT +cflags = $(cflags) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) + +!if "$(CL)" == "/D_USING_V110_SDK71_" +rcflags = $(rcflags) /D_USING_V110_SDK71_ +!endif + SUBSYSTEM = console !if "$(SUBSYSTEM_VER)" != "" SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER) diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp index 53d96df8bfb87..dd26eb1b694b3 100644 --- a/src/GvimExt/gvimext.cpp +++ b/src/GvimExt/gvimext.cpp @@ -35,6 +35,15 @@ UINT cbFiles = 0; * enough */ #define BUFSIZE 1100 +// The "Edit with Vim" shell extension provides these choices when +// a new instance of Gvim is selected: +// - use tabpages +// - enable diff mode +// - none of the above +#define EDIT_WITH_VIM_USE_TABPAGES (2) +#define EDIT_WITH_VIM_IN_DIFF_MODE (1) +#define EDIT_WITH_VIM_NO_OPTIONS (0) + // // Get the name of the Gvim executable to use, with the path. // When "runtime" is non-zero, we were called to find the runtime directory. @@ -161,7 +170,6 @@ static char *null_libintl_bindtextdomain(const char *, const char *); static int dyn_libintl_init(char *dir); static void dyn_libintl_end(void); -static wchar_t *oldenv = NULL; static HINSTANCE hLibintlDLL = 0; static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext; static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain; @@ -205,17 +213,17 @@ dyn_libintl_init(char *dir) if (buf != NULL && buf2 != NULL) { GetEnvironmentVariableW(L"PATH", buf, len); -#ifdef _WIN64 +# ifdef _WIN64 _snwprintf(buf2, len2, L"%S\\GvimExt64;%s", dir, buf); -#else +# else _snwprintf(buf2, len2, L"%S\\GvimExt32;%s", dir, buf); -#endif +# endif SetEnvironmentVariableW(L"PATH", buf2); hLibintlDLL = LoadLibrary(GETTEXT_DLL); -#ifdef GETTEXT_DLL_ALT +# ifdef GETTEXT_DLL_ALT if (!hLibintlDLL) hLibintlDLL = LoadLibrary(GETTEXT_DLL_ALT); -#endif +# endif SetEnvironmentVariableW(L"PATH", buf); } free(buf); @@ -273,56 +281,7 @@ null_libintl_textdomain(const char* /* domainname */) dyn_gettext_load(void) { char szBuff[BUFSIZE]; - char szLang[BUFSIZE]; DWORD len; - HKEY keyhandle; - int gotlang = 0; - - strcpy(szLang, "LANG="); - - // First try getting the language from the registry, this can be - // used to overrule the system language. - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, - KEY_READ, &keyhandle) == ERROR_SUCCESS) - { - len = BUFSIZE; - if (RegQueryValueEx(keyhandle, "lang", 0, NULL, (BYTE*)szBuff, &len) - == ERROR_SUCCESS) - { - szBuff[len] = 0; - strcat(szLang, szBuff); - gotlang = 1; - } - RegCloseKey(keyhandle); - } - - if (!gotlang && getenv("LANG") == NULL) - { - // Get the language from the system. - // Could use LOCALE_SISO639LANGNAME, but it's not in Win95. - // LOCALE_SABBREVLANGNAME gives us three letters, like "enu", we use - // only the first two. - len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, - (LPTSTR)szBuff, BUFSIZE); - if (len >= 2 && _strnicmp(szBuff, "en", 2) != 0) - { - // There are a few exceptions (probably more) - if (_strnicmp(szBuff, "cht", 3) == 0 - || _strnicmp(szBuff, "zht", 3) == 0) - strcpy(szBuff, "zh_TW"); - else if (_strnicmp(szBuff, "chs", 3) == 0 - || _strnicmp(szBuff, "zhc", 3) == 0) - strcpy(szBuff, "zh_CN"); - else if (_strnicmp(szBuff, "jp", 2) == 0) - strcpy(szBuff, "ja"); - else - szBuff[2] = 0; // truncate to two-letter code - strcat(szLang, szBuff); - gotlang = 1; - } - } - if (gotlang) - putenv(szLang); // Try to locate the runtime files. The path is used to find libintl.dll // and the vim.mo files. @@ -378,10 +337,8 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */) inc_cRefThisDLL() { #ifdef FEAT_GETTEXT - if (g_cRefThisDll == 0) { + if (g_cRefThisDll == 0) dyn_gettext_load(); - oldenv = GetEnvironmentStringsW(); - } #endif InterlockedIncrement((LPLONG)&g_cRefThisDll); } @@ -390,13 +347,8 @@ inc_cRefThisDLL() dec_cRefThisDLL() { #ifdef FEAT_GETTEXT - if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) { + if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) dyn_gettext_free(); - if (oldenv != NULL) { - FreeEnvironmentStringsW(oldenv); - oldenv = NULL; - } - } #else InterlockedDecrement((LPLONG)&g_cRefThisDll); #endif @@ -670,7 +622,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, if (cbFiles > 1) { mii.wID = idCmd++; - mii.dwTypeData = _("Edit with &multiple Vims"); + mii.dwTypeData = _("Edit with Vim using &tabpages"); mii.cch = lstrlen(mii.dwTypeData); InsertMenuItem(hMenu, indexMenu++, TRUE, &mii); @@ -783,6 +735,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) { HRESULT hr = E_INVALIDARG; + int gvimExtraOptions; // If HIWORD(lpcmi->lpVerb) then we have been called programmatically // and lpVerb is a command that should be invoked. Otherwise, the shell @@ -807,29 +760,32 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) switch (idCmd) { case 0: - hr = InvokeGvim(lpcmi->hwnd, - lpcmi->lpDirectory, - lpcmi->lpVerb, - lpcmi->lpParameters, - lpcmi->nShow); + gvimExtraOptions = EDIT_WITH_VIM_USE_TABPAGES; break; case 1: - hr = InvokeSingleGvim(lpcmi->hwnd, - lpcmi->lpDirectory, - lpcmi->lpVerb, - lpcmi->lpParameters, - lpcmi->nShow, - 0); + gvimExtraOptions = EDIT_WITH_VIM_NO_OPTIONS; break; case 2: - hr = InvokeSingleGvim(lpcmi->hwnd, - lpcmi->lpDirectory, - lpcmi->lpVerb, - lpcmi->lpParameters, - lpcmi->nShow, - 1); + gvimExtraOptions = EDIT_WITH_VIM_IN_DIFF_MODE; break; + default: + // If execution reaches this point we likely have an + // inconsistency between the code that setup the menus + // and this code that determines what the user + // selected. This should be detected and fixed during + // development. + return E_FAIL; } + + LPCMINVOKECOMMANDINFOEX lpcmiex = (LPCMINVOKECOMMANDINFOEX)lpcmi; + LPCWSTR currentDirectory = lpcmi->cbSize == sizeof(CMINVOKECOMMANDINFOEX) ? lpcmiex->lpDirectoryW : NULL; + + hr = InvokeSingleGvim(lpcmi->hwnd, + currentDirectory, + lpcmi->lpVerb, + lpcmi->lpParameters, + lpcmi->nShow, + gvimExtraOptions); } } return hr; @@ -930,82 +886,13 @@ searchpath(char *name) return (char *)""; } -STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, - LPCSTR /* pszWorkingDir */, - LPCSTR /* pszCmd */, - LPCSTR /* pszParam */, - int /* iShowCmd */) -{ - wchar_t m_szFileUserClickedOn[BUFSIZE]; - wchar_t cmdStrW[BUFSIZE]; - UINT i; - - for (i = 0; i < cbFiles; i++) - { - DragQueryFileW((HDROP)medium.hGlobal, - i, - m_szFileUserClickedOn, - sizeof(m_szFileUserClickedOn)); - - getGvimInvocationW(cmdStrW); - wcscat(cmdStrW, L" \""); - - if ((wcslen(cmdStrW) + wcslen(m_szFileUserClickedOn) + 2) < BUFSIZE) - { - wcscat(cmdStrW, m_szFileUserClickedOn); - wcscat(cmdStrW, L"\""); - - STARTUPINFOW si; - PROCESS_INFORMATION pi; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - - // Start the child process. - if (!CreateProcessW(NULL, // No module name (use command line). - cmdStrW, // Command line. - NULL, // Process handle not inheritable. - NULL, // Thread handle not inheritable. - FALSE, // Set handle inheritance to FALSE. - oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT, - oldenv, // Use unmodified environment block. - NULL, // Use parent's starting directory. - &si, // Pointer to STARTUPINFO structure. - &pi) // Pointer to PROCESS_INFORMATION structure. - ) - { - MessageBox( - hParent, - _("Error creating process: Check if gvim is in your path!"), - _("gvimext.dll error"), - MB_OK); - } - else - { - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - } - } - else - { - MessageBox( - hParent, - _("Path length too long!"), - _("gvimext.dll error"), - MB_OK); - } - } - - return NOERROR; -} - STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, - LPCSTR /* pszWorkingDir */, + LPCWSTR workingDir, LPCSTR /* pszCmd */, LPCSTR /* pszParam */, int /* iShowCmd */, - int useDiff) + int gvimExtraOptions) { wchar_t m_szFileUserClickedOn[BUFSIZE]; wchar_t *cmdStrW; @@ -1019,8 +906,10 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, return E_FAIL; getGvimInvocationW(cmdStrW); - if (useDiff) + if (gvimExtraOptions == EDIT_WITH_VIM_IN_DIFF_MODE) wcscat(cmdStrW, L" -d"); + else if (gvimExtraOptions == EDIT_WITH_VIM_USE_TABPAGES) + wcscat(cmdStrW, L" -p"); for (i = 0; i < cbFiles; i++) { DragQueryFileW((HDROP)medium.hGlobal, @@ -1057,9 +946,9 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. - oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT, - oldenv, // Use unmodified environment block. - NULL, // Use parent's starting directory. + 0, // No creation flags. + NULL, // Use parent's environment block. + workingDir, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi) // Pointer to PROCESS_INFORMATION structure. ) diff --git a/src/GvimExt/gvimext.h b/src/GvimExt/gvimext.h index e43e75fdd786d..b85f32e204608 100644 --- a/src/GvimExt/gvimext.h +++ b/src/GvimExt/gvimext.h @@ -44,12 +44,6 @@ #include #include -/* Accommodate old versions of VC that don't have a modern Platform SDK */ -#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR) -# undef UINT_PTR -# define UINT_PTR UINT -#endif - #define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i))) // Initialize GUIDs (should be done only and at-least once per DLL/EXE) @@ -129,18 +123,12 @@ class CShellExt : public IContextMenu, int iShowCmd, int idHWnd); - STDMETHODIMP InvokeGvim(HWND hParent, - LPCSTR pszWorkingDir, - LPCSTR pszCmd, - LPCSTR pszParam, - int iShowCmd); - STDMETHODIMP InvokeSingleGvim(HWND hParent, - LPCSTR pszWorkingDir, + LPCWSTR workingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd, - int useDiff); + int gvimExtraOptions); public: int m_cntOfHWnd; diff --git a/src/INSTALL b/src/INSTALL index 3da9141d222cc..05153410c4fa5 100644 --- a/src/INSTALL +++ b/src/INSTALL @@ -15,8 +15,7 @@ See INSTALLpc.txt for PC (Windows XP/Vista/7/8/10) See INSTALLvms.txt for VMS See INSTALLx.txt for cross-compiling on Unix See ../READMEdir/README_390.txt for z/OS and OS/390 Unix -See ../runtime/doc/os_beos.txt for BeBox - +See ../runtime/doc/os_haiku.txt for Haiku 1. Generic ========== @@ -40,13 +39,54 @@ version of Vim that is small and starts up quickly, see the Makefile for how to disable the GUI and X11. If you don't have GUI libraries and/or X11, these features will be disabled automatically. +To build Vim on Ubuntu from scratch on a clean system using git: + Install tools required to be able to get and build Vim: + % sudo apt install git + % sudo apt install make + % sudo apt install clang + % sudo apt install libtool-bin + + Build Vim with default features: + % git clone https://github.com/vim/vim.git + % cd vim/src + % make + + Run tests to check there are no problems: + % make test + + Install Vim in /usr/local: + % sudo make install + + Add X windows clipboard support (also needed for GUI): + % sudo apt install libxt-dev + % make reconfig + + Add GUI support: + % sudo apt install libgtk-3-dev + % make reconfig + + Add Python 3 support: + % sudo apt install libpython3-dev + Uncomment this line in Makefile: + "CONF_OPT_PYTHON3 = --enable-python3interp" + % make reconfig + + Debugging: + % sudo apt install valgrind + Uncomment this line in Makefile: + CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 + % make reconfig + % make test_{test-name} + See output in testdir/valgrind.test_{test-name} + + See the start of Makefile for more detailed instructions about how to compile Vim. If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS before starting configure. Example: - env CFLAGS=-I/usr/local/include LIBS=-lm make + env CFLAGS=-I/usr/local/include LIBS=-lm make This is only needed for things that configure doesn't offer a specific argument for or figures out by itself. First try running configure without extra @@ -95,8 +135,12 @@ These configure arguments can be used to select which GUI to use: --disable-motif-check --disable-athena-check +This configure argument can be used to disable the GUI, even when the necessary +files are found: +--disable-gui + --enable-gui defaults to "auto", so it will automatically look for a GUI (in -the order of GTK, Motif, then Athena). If one is found, then is uses it and +the order of GTK, Motif, then Athena). If one is found, then it is used and does not proceed to check any of the remaining ones. Otherwise, it moves on to the next one. @@ -182,203 +226,4 @@ OS/2 support was removed in patch 7.4.1008 4. Atari MiNT ============= -[NOTE: this is quite old, it might not work anymore] - -To compile Vim for MiNT you may either copy Make_mint.mak to Makefile or use -the Unix Makefile adapted for the MiNT configuration. - -Now proceed as described in the Unix section. - -Prerequisites: - -You need a curses or termcap library that supports non-alphanumeric -termcap names. If you don't have any, link with termlib.o. - ------------------------------------------------------------------------------ - -The rest of this file is based on the INSTALL file that comes with GNU -autoconf 2.12. Not everything applies to Vim. Read Makefile too! - - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.ac' is used to create `configure' by a program -called `autoconf'. You only need `configure.ac' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. +Atari MiNT support was removed in patch 8.2.1215. diff --git a/src/INSTALLami.txt b/src/INSTALLami.txt index 0acd6fdffea7b..a2c9faf2470fa 100644 --- a/src/INSTALLami.txt +++ b/src/INSTALLami.txt @@ -1,4 +1,4 @@ -INSTALLami.txt - Installation of Vim from source on Amiga +INSTALLami.txt - Installation of Vim from source on Amiga and MorphOS This file contains instructions for compiling Vim. If you already have an executable version of Vim, you don't need this. @@ -7,28 +7,13 @@ The file "feature.h" can be edited to match your preferences. You can skip this, then you will get the default behavior as is documented, which should be fine for most people. - Summary: -make -f Make_manx.mak Manx C -make -f Make_sas.mak Lattice/SAS C -make -f Make_dice.mak DICE - -The Manx compiler is preferred, it was used to produce the Amiga executable -and has been tested most. You should not get any errors or warnings. - -The SAS compiler can be used. Older versions (6.0 to 6.3) don't work with the -optimizer switched on. This seems to be fixed with 6.5 or 6.56, but this has -not been tested much. Also disable optimizing when the compiler runs out of -memory or crashes the system (yes, that happens; did I say the Manx compiler -is preferred?). - -The DICE makefile has been reported to work by one person only. - -You will have to set the "VIM" environment variable to the location of the -documentation files. - +make -f Make_ami.mak gcc +make -f Make_ami.mak CC=vc vbcc -MorphOS +Please note that currently only gcc has been tested. VBCC would need its own +CFLAGS, but should otherwise work out of the box. For cross-compiling, UNM +can be used to override uname and thereby set the target. An example is shown +below: -Use the Make_morph.mak Makefile: - make -f Make_morph.mak +make -f Make_ami.mak CC=ppc-morphos-gcc UNM=MorphOS diff --git a/src/INSTALLmac.txt b/src/INSTALLmac.txt index e957682a14559..9980d258c4eee 100644 --- a/src/INSTALLmac.txt +++ b/src/INSTALLmac.txt @@ -1,72 +1,83 @@ -INSTALLmac.txt - Installation of Vim on Macintosh +INSTALLmac.txt - Installation of Vim on Apple MacOS This file contains instructions for compiling Vim. If you already have an executable version of Vim, you don't need this. -First, make sure you've installed Xcode or CommandLineToots. If not, open a -terminal and do - - $ make --version - -A window pops up instructing you to install the developer tools. +MacOS Classic is no longer supported. If you really want it use Vim 6.4. +Only '/' is supported as path separator. ---------------------------------------------------------------------------- -Summary +Prerequisites ---------------------------------------------------------------------------- -1 MacOS X - 1.1. Carbon interface - 1.2. X (Athena, GTK, Motif) or plain text. +Make sure you've installed Xcode and CommandLineTools. You can download Xcode +from the Mac App Store, for free. -MacOS Classic is no longer supported. If you really want it use Vim 6.4. +To check for CommandLineTools open a terminal and do: ----------------------------------------------------------------------------- -1 MacOS X ----------------------------------------------------------------------------- + $ make --version -1.0 Considerations +If not installed yet a window pops up instructing you to install the developer +tools. - Only '/' supported as path separator. +If you don't have the source yet, best is to use git (which you need to +install first), see http://www.vim.org/git.php +Or you can download and unpack the Unix tar archive, see + http://www.vim.org/download.php -1.1 Carbon interface (default) - You can compile vim with the standard Unix routine: - cd .../src +---------------------------------------------------------------------------- +Build and install the terminal version. +---------------------------------------------------------------------------- + +You can compile vim with the standard Unix routine: + cd vim/src make make test sudo make install - "make" will create a working Vim.app application bundle in the src - directory. You can move this bundle (the Vim.app directory) anywhere - you want. Or use "make install" to move it to /Applications. +If you get an error "glibtool: command not found" search on stackoverflow for +mac-osx-where-can-i-download-glibtool. + +With Homebrew, run: + + brew install libtool + +To build libtool from source: + + 1. Download the source code from https://www.gnu.org/software/libtool/. - You need at least Xcode 1.5 to compile Vim 7.0. + 2. Run these commands from the root of the source code directory: - Configure will create a universal binary if possible. This requires - installing the universal SDK (currently for 10.4). + ./configure --program-prefix=g + make + sudo make install - To overrule the architecture do this before running make: - ./configure --with-mac-arch=intel - or - ./configure --with-mac-arch=ppc +---------------------------------------------------------------------------- +Build and install the GUI version with X-Windows +---------------------------------------------------------------------------- + +First, install XQuartz, which you can download from https://www.xquartz.org. +To tell configure to use a GUI you can edit the Makefile and uncomment these +two lines (remove the # at the start of the line): -1.2 X-Windows or Plain Text + CONF_OPT_GUI = --enable-gui=athena + CONF_OPT_DARWIN = --disable-darwin - If you do not want the Carbon interface, you must explicitly tell - configure to use a different GUI. +Do "make distclean" to start with a clean slate. +Then build as with the terminal version above. +Instead of "athena" you can try "gtk2" but you probably need to install GTK +first. - cd .../src - ./configure --disable-darwin --enable-gui=gtk2 - make; make install - NOTE: The following GUI options are supported: - no (for text), motif, athena, nextaw - gtk, gtk2, gnome, gnome2, +---------------------------------------------------------------------------- +Notes +---------------------------------------------------------------------------- - NOTE: You need to first install XFree86 and XDarwin. - Please visit http://www.XDarwin.org +Mac-specific configure options are explained in the Makefile: + --disable-darwin + --with-mac-arch ------------------------------------------------------- diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt index ce80a9aa4a987..43d024a4a3510 100644 --- a/src/INSTALLpc.txt +++ b/src/INSTALLpc.txt @@ -33,8 +33,8 @@ Contents: 10. Building with Perl support 11. Building with Ruby support 12. Building with Tcl support -13. Building with Terminal support -14. Building with DirectX (DirectWrite) support +13. Building with DirectX (DirectWrite) support +14. Building with libsodium support 15. Windows 3.1 16. MS-DOS @@ -44,7 +44,7 @@ Contents: The currently recommended way (that means it has been verified to work) is using the "Visual Studio Community 2015" installation. This includes the SDK needed to target Windows XP. But not older Windows versions (95, 98), see -|msvc-2008-express| below for that +"OLDER VERSIONS" below for that. 1. Microsoft Visual C++ @@ -62,12 +62,8 @@ under "Universal Windows App Development Tools" Visual Studio ------------- -Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008, -VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions -should also work for VS 4 and VS 5.) - -Using VS C++ 2008 Express is recommended if you need the binary to run on -Windows 95 or 97, see |msvc-2008-express| below. +Building with Visual Studio (VS2010, VS2012, VS2013, VS2015, VS2017 and VS2019) +is straightforward. To build Vim from the command line with MSVC, use Make_mvc.mak. Visual Studio installed a batch file called vcvars32.bat, which you must @@ -82,7 +78,7 @@ nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc. Make_mvc.mak allows a Vim to be built with various different features and debug support. -For compiling Gvim with IME support on far-east Windows, add IME=yes +For compiling gVim with IME support on far-east Windows, add IME=yes to the parameters you pass to Make_mvc.mak. See the specific files for comments and options. @@ -91,26 +87,6 @@ These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and Ron Aaron; they have been tested. -Visual C++ 2008 Express Edition *msvc-2008-express* -------------------------------- - -Visual C++ 2008 Express Edition can be downloaded for free from: - http://www.microsoft.com/express/downloads/ -This includes the IDE and the debugger. - -To set the environment execute the msvc2008.bat script. You can then build -Vim with Make_mvc.mak. - -For building 64 bit binaries you also need to install the SDK: -"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1" -You don't need the examples and documentation. - -If you get an error that Win32.mak can't be found, you have to set the -variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC -puts include files in the following directory: - set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include - - Visual C++ 2010 Express Edition *msvc-2010-express* ------------------------------- @@ -162,6 +138,9 @@ compiler by using the "x64" option: The following Visual C++ team blog can serve as a reference page: http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx +VC 2019 dropped support for targeting Windows XP. If you want a binary that +targeting Windows XP, use VC 2017 or earlier. + Cross compile support for Windows on ARM64 ------------------------------------------ @@ -177,85 +156,15 @@ OLDER VERSIONS The minimal supported version is Windows XP. Building with older compilers might still work, but these instructions might be outdated. -If you need the executable to run on Windows 98 or ME, use the 2003 one -|msvc-2003-toolkit|. - -Visual C++ Toolkit 2003 *msvc-2003-toolkit* ------------------------ - -You could download the Microsoft Visual C++ Toolkit 2003 from - http://msdn.microsoft.com/visualc/vctoolkit2003/ -Unfortunately this URL is no longer valid. Unofficial downloads appear to be -available from links mentioned on these pages (use at your own risk): - http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html - http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit - -This contains the command-line tools (compiler, linker, CRT headers, -and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE. -To compile and debug Vim with the VC2003 Toolkit, you will also need -|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|, -and |windbg-download|. - -It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|, -which is freely available in perpetuity. - -The free Code::Blocks IDE works with the VC2003 Toolkit, as described at - http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE -(This site also takes you through configuring a number of other -free C compilers for Win32.) - -To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first -execute the following commands in a cmd.exe window (the msvcsetup.bat batch -file can be used): - - set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH% - call "%VCToolkitInstallDir%vcvars32.bat" - set MSVCVer=7.1 - call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd" - set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB% - -Now you can build Vim with Make_mvc.mak. - - -Getting the Windows Platform SDK *ms-platform-sdk* - -You will also need a copy of the Windows Platform SDK. Specifically, you need -the Windows Core SDK subset of the Platform SDK, which contains the Windows -headers and libraries. You need to search for it, Microsoft keeps changing -the URL. - - -Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist* - -You need the .NET Framework 1.1 Redistributable Package from - http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3 -or from Windows Update: - http://windowsupdate.microsoft.com/ -This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe, -which is needed to link Vim. - - -Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk* - -You need the .NET Framework 1.1 SDK from - http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d -This contains some additional libraries needed to compile Vim, -such as msvcrt.lib. You must install |dotnet-1.1-redist| before -installing the .NET 1.1 SDK. - - -Getting the WinDbg debugger *windbg-download* - -The Debugging Tools for Windows can be downloaded from - http://www.microsoft.com/whdc/devtools/debugging/default.mspx -This includes the WinDbg debugger, which you will want if you ever need -to debug Vim itself. An earlier version of the Debugging Tools -is also available through the Platform SDK, |ms-platform-sdk|. +If you need the executable to run on Windows 98 or ME, use the 2005 one +|msvc-2005-express|, and use the source code before 8.0.0029. Visual C++ 2005 Express Edition *msvc-2005-express* ------------------------------- +NOTE: this most likely does not work + Visual C++ 2005 Express Edition can be downloaded for free from: http://msdn.microsoft.com/vstudio/express/visualC/default.aspx This includes the IDE and the debugger. You will also need @@ -265,6 +174,23 @@ Instructions for integrating the Platform SDK into VC Express: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx +Visual C++ 2008 Express Edition *msvc-2008-express* +------------------------------- + +NOTE: this most likely does not work + +Visual C++ 2008 Express Edition can be downloaded for free from: + http://www.microsoft.com/express/downloads/ +This includes the IDE and the debugger. + +To set the environment execute the msvc2008.bat script. You can then build +Vim with Make_mvc.mak. + +For building 64 bit binaries you also need to install the SDK: +"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1" +You don't need the examples and documentation. + + 2. MSYS2 with MinGW =================== @@ -284,7 +210,8 @@ open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS. Execute: $ pacman -Syu -And restart MSYS2 console (select "MSYS2 MSYS" icon from the Start Menu). +And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start +Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit"). Then execute: $ pacman -Su @@ -355,42 +282,64 @@ This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat: If you have msys64 in another location you will need to adjust the paths for that. +2.5. Build Vim with Clang -3. MinGW -======== +The following package group is required for building Vim with Clang: -(written by Ron Aaron: ) +* mingw-w64-clang-x86_64-clang -This is about how to produce a Win32 binary of gvim with MinGW. +Use the following command to install it: -First, you need to get the 'mingw32' compiler, which is free for the download -at: + $ pacman -S mingw-w64-clang-x86_64-clang - http://www.mingw.org/ +Go to the source directory of Vim, then execute the make command. E.g.: -or you can use 'MinGW-w64' compiler. + CC=clang + CXX=clang++ + # To build Vim without the GUI support + make -f Make_ming.mak GUI=no + # To build Vim with the GUI support + make -f Make_ming.mak GUI=yes XPM=no + +To build Vim with the address sanitizer (ASAN), execute the following command: + + CC=clang + CXX=clang++ + make -f Make_ming.mak DEBUG=yes ASAN=yes + +3. MinGW +======== + +(written by Ron Aaron: , updated by Ken Takata, et al.) + +This is about how to produce a Win32 binary of gvim with MinGW from the normal +Command Prompt window. (To use MSYS2 console, see above.) + +First, you need to get the 'MinGW-w64' compiler, which is free for the +download at: http://mingw-w64.sourceforge.net/ Or a compiler provided on msys2: - https://msys2.github.io/ + https://www.msys2.org/ -Once you have downloaded the compiler binaries, unpack them on your hard disk -somewhere, and put them on your PATH. If you are on Win95/98 you can edit -your AUTOEXEC.BAT file with a line like: +The original 'mingw32' compiler is outdated, and may no longer work: - set PATH=C:\MinGW\bin;%PATH% + http://www.mingw.org/ -or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance), -System, Advanced, and edit the environment from there. If you use msys2 -compilers, set your installed paths (normally one of the following): +Once you have downloaded the compiler binaries, unpack them on your hard disk +somewhere, and put them on your PATH. Go to the Control Panel, (Performance +and Maintenance), System, Advanced, and edit the environment from there. If +you use the standalone MinGW-w64 compiler, the path may depend on your +installation. If you use msys2 compilers, set your installed paths (normally +one of the following): C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds) C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds) C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds) -Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window: +Test if gcc is on your path. From a Command Prompt window: C:\> gcc --version gcc (GCC) 4.8.1 @@ -473,8 +422,7 @@ Now you have created the Windows binary from your Linux box! Have fun... 6. Building with Python support =============================== -For building with MSVC 2008 the "Windows Installer" from www.python.org -works fine. +For building with MSVC the "Windows Installer" from www.python.org works fine. When building, you need to set the following variables at least: @@ -534,8 +482,8 @@ You will end up with a Python-enabled, Win32 version. Enjoy! 7. Building with Python3 support ================================ -For building with MSVC 2008 the "Windows Installer" from www.python.org -works fine. Python 3.6 is recommended. +For building with MSVC the "Windows Installer" from www.python.org works fine. +Python 3.6 is recommended. When building, you need to set the following variables at least: @@ -569,7 +517,7 @@ libstdc++-6.dll.) 8. Building with Racket or MzScheme support -======================================== +=========================================== 1) Building with Racket support (newest) @@ -886,23 +834,7 @@ Or when using MinGW (as one line): TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 -13. Building with Terminal support -================================== - -Vim with Terminal support can be built with either MSVC, MinGW or Cygwin. -This uses the included libvterm and winpty. No extra header files or -libraries are needed for building. Just set TERMINAL to yes. - -E.g. When using MSVC: - - nmake -f Make_mvc.mak TERMINAL=yes - -Or when using MinGW: - - mingw32-make -f Make_ming.mak TERMINAL=yes - - -14. Building with DirectX (DirectWrite) support +13. Building with DirectX (DirectWrite) support =============================================== Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW. @@ -936,6 +868,41 @@ Just set DIRECTX to yes: mingw32-make -f Make_ming.mak DIRECTX=yes +14. Building with libsodium support +=================================== + +For better encryption support, you can build Vim with libsodium. + +A) Using MSVC + +You can download the latest libsodium library from here: + https://download.libsodium.org/libsodium/releases/ + +At this moment, libsodium-1.0.18-stable-msvc.zip is the latest package. +Unpack it to anywhere you like, and specify the path to the SODIUM option: + + nmake -f Make_mvc.mak SODIUM=C:/path/to/libsodium + (libsodium.dll will be used as the libsodium DLL name.) + +B) Using MinGW + +If you use msys2, you can install the libsodium package by pacman (or pacboy): + + $ pacman -S mingw-w64-x86_64-libsodium # for 64-bit Vim + $ pacman -S mingw-w64-i686-libsodium # for 32-bit Vim + $ pacboy -S libsodium:m # for both 32-bit and 64-bit Vim + +Then set SODIUM to yes: + + mingw32-make -f Make_ming.mak SODIUM=yes + (libsodium-23.dll will be used as the libsodium DLL name.) + +Or you can set the path to libsodium explicitly: + + mingw32-make -f Make_ming.mak SODIUM=C:/path/to/libsodium + (libsodium.dll will be used as the libsodium DLL name.) + + 15. Windows 3.1x ================ @@ -957,44 +924,45 @@ work on MS-DOS because of the limited amount of memory available. After you've built the Vim binaries as described above, you're ready to install Vim on your system. However, if you've obtained the Vim sources using Git, Mercurial or by downloading them as a unix tar file, you must -first create a "vim81" directory. If you instead downloaded the sources as +first create a "vim82" directory. If you instead downloaded the sources as zip files, you can skip this setup as the zip archives already have the correct directory structure. - A. Create a Vim "runtime" subdirectory named "vim81" + A. Create a Vim "runtime" subdirectory named "vim82" ----------------------------------------------------- If you obtained your Vim sources as zip files, you can skip this step. Otherwise, continue reading. Go to the directory that contains the Vim "src" and "runtime" - directories and create a new subdirectory named "vim81". + directories and create a new subdirectory named "vim82". - Copy the "runtime" files into "vim81": - copy runtime\* vim81 + Copy the "runtime" files into "vim82": + copy runtime\* vim82 + xcopy /s runtime\* vim82 - B. Copy the new binaries into the "vim81" directory + B. Copy the new binaries into the "vim82" directory ---------------------------------------------------- Regardless of how you installed the Vim sources, you need to copy the - new binaries you created above into "vim81": + new binaries you created above into "vim82": - copy src\*.exe vim81 - copy src\tee\tee.exe vim81 - copy src\xxd\xxd.exe vim81 + copy src\*.exe vim82 + copy src\tee\tee.exe vim82 + copy src\xxd\xxd.exe vim82 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit - versions of gvimext.dll. They should be copied to "vim81\GvimExt32" and - "vim81\GvimExt64" respectively. + versions of gvimext.dll. They should be copied to "vim82\GvimExt32" and + "vim82\GvimExt64" respectively. First, build the 32-bit version, then: - mkdir vim81\GvimExt32 - copy src\GvimExt\gvimext.dll vim81\GvimExt32 + mkdir vim82\GvimExt32 + copy src\GvimExt\gvimext.dll vim82\GvimExt32 Next, clean the 32-bit version and build the 64-bit version, then: - mkdir vim81\GvimExt64 - copy src\GvimExt\gvimext.dll vim81\GvimExt64 + mkdir vim82\GvimExt64 + copy src\GvimExt\gvimext.dll vim82\GvimExt64 - C. Copy gettext and iconv DLLs into the "vim81" directory + C. Copy gettext and iconv DLLs into the "vim82" directory ---------------------------------------------------------- Get gettext and iconv DLLs from the following site: https://github.com/mlocati/gettext-iconv-windows/releases @@ -1002,7 +970,7 @@ correct directory structure. Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract DLLs and place them as follows: - vim81\ + vim82\ | libintl-8.dll | libiconv-2.dll | libgcc_s_sjlj-1.dll (only for 32-bit) @@ -1016,18 +984,18 @@ correct directory structure. libintl-8.dll libiconv-2.dll - The DLLs in the "vim81" should be the same bitness with the (g)vim.exe. + The DLLs in the "vim82" should be the same bitness with the (g)vim.exe. - D. Move the "vim81" directory into the Vim installation subdirectory + D. Move the "vim82" directory into the Vim installation subdirectory --------------------------------------------------------------------- - Move the "vim81" subdirectory into the subdirectory where you want Vim + Move the "vim82" subdirectory into the subdirectory where you want Vim to be installed. Typically, this subdirectory will be named "vim". - If you already have a "vim81" subdirectory in "vim", delete it first + If you already have a "vim82" subdirectory in "vim", delete it first by running its uninstall.exe program. E. Install Vim --------------- - "cd" to your Vim installation subdirectory "vim\vim81" and run the + "cd" to your Vim installation subdirectory "vim\vim82" and run the "install.exe" program. It will ask you a number of questions about how you would like to have your Vim setup. Among these are: - You can tell it to write a "_vimrc" file with your preferences in the diff --git a/src/INSTALLvms.txt b/src/INSTALLvms.txt index 7966e6fab05ae..e336da4cbe2ae 100644 --- a/src/INSTALLvms.txt +++ b/src/INSTALLvms.txt @@ -9,12 +9,12 @@ If you already have an executable version of Vim, you don't need this. If you skip settings described here, then you will get the default Vim behavior as it is documented, which should be fine for most users. -The file "feature.h" can be edited to match your preferences, but this files +The file "feature.h" can be edited to match your preferences, but this file does not describe possibilities hidden in feature.h acrobatics, however -parameters from MAKE_VMS.MMS actively uses and sets up parameters in relation +parameters from MAKE_VMS.MMS actively use and set up parameters in relation with feature.h -More information and case analysis you can found in os_vms.txt +More information and case analysis you can find in os_vms.txt ([runtime.doc]os_vms.txt or :help vms from vim prompt) Contents: @@ -145,7 +145,7 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/ Parameter name : VIM_XIM Description : X Input Method. For entering special languages - like chinese and Japanese. Please define just + like Chinese and Japanese. Please define just one: VIM_XIM or VIM_HANGULIN Options: : YES - Build with support Uncommented - build without support. @@ -198,7 +198,7 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/ more information can be found in os_vms_fix.com file itself. NOTE: even if os_vms_fix.com will fix all pre-processor directives it will - leave singe (long) line directives. You have to fix them manually. + leave single (long) line directives. You have to fix them manually. Known problematic files are option.h and option.c 4.2. After the conversion you can continue building as it has been described @@ -210,7 +210,7 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/ XXD.EXE you should change to subdirectory <.CTAGS> or <.XXD> and build them separately. -5.2. In these directories you can found one make file for VMS as well. +5.2. In these directories you can find one make file for VMS as well. Please read the detailed build instructions in the related *.MMS file. 6. Deployment @@ -300,7 +300,7 @@ perl_env : So far it works just on Alpha and IA64. More information at: http://www.openvms.compaq.com/openvms/products/ips/gtk.html - You need also the OpenVMS Porting Library: + You also need the OpenVMS Porting Library: http://www.openvms.compaq.com/openvms/products/ips/porting.html Source code for GTK and porting library that is used to build @@ -319,7 +319,7 @@ perl_env : Build it as normally. - Used sharable images are: + Used shareable images are: gtk_root:[glib]libglib.exe /share,- gtk_root:[glib.gmodule]libgmodule.exe /share,- gtk_root:[gtk.gdk]libgdk.exe /share,- @@ -346,7 +346,7 @@ perl_env : Edit PERL_INC = to point to perl includes directory where is extern.h - Build as usually. + Build as usual. 7.4 PYTHON @@ -358,7 +358,7 @@ perl_env : python.h is located. Enable Python feature at make_vms.mms with VIM_PYTHON = YES - Build as usually. + Build as usual. 7.5 TCL @@ -371,13 +371,13 @@ perl_env : Edit TCL_INC = to point to TCL includes directory where is tcl.h - Build as usually. + Build as usual. 8. Notes 8.1. New Compaq C compiler - If you are using Compaq C compiler V6.2 or newer, Informational messages + If you are using Compaq C compiler V6.2 or newer, informational messages of the type QUESTCOMPARE will be displayed. You should ignore those messages ; they are generated only because some test comparisons are done with variables which type vary depending on the OS. Under VMS, those are diff --git a/src/INSTALLx.txt b/src/INSTALLx.txt index e03f54d4a3ecf..c120a1d385f44 100644 --- a/src/INSTALLx.txt +++ b/src/INSTALLx.txt @@ -131,14 +131,6 @@ vim_cv_toupper_broken: Whether the "toupper" C library function works correctly. Set to "yes" if you know it's broken, otherwise set to "no". -vim_cv_tty_group: - The default group of pseudo terminals. Either set to the numeric value - of your tty group or to "world" if they are world accessible. - -vim_cv_tty_mode: - The default mode of pseudo terminals if they are not world accessible. - Most probably the value "0620". - 4. EXAMPLE: =========== @@ -153,7 +145,6 @@ vim_cv_stat_ignores_slash=yes \ vim_cv_tgetent=zero \ vim_cv_terminfo=yes \ vim_cv_toupper_broken=no \ -vim_cv_tty_group=world \ ./configure \ --build=i586-linux \ --host=armeb-xscale-linux-gnu \ diff --git a/src/Make_all.mak b/src/Make_all.mak index 591350f41348c..6a6d2fe14eda4 100644 --- a/src/Make_all.mak +++ b/src/Make_all.mak @@ -5,6 +5,7 @@ # Argument for running ctags. TAGS_FILES = \ *.c \ + *.cc \ *.cpp \ *.h \ auto/*.c \ diff --git a/src/Make_ami.mak b/src/Make_ami.mak new file mode 100644 index 0000000000000..dd674dc616137 --- /dev/null +++ b/src/Make_ami.mak @@ -0,0 +1,207 @@ +# +# Makefile for AROS, AmigaOS4 and MorphOS. +# +BIN = vim +CC ?= gcc +LD = $(CC) +UNM ?= $(shell uname) +DEBUG ?= no +BUILD ?= huge +CFLAGS = -c -O3 + +# Common compiler flags +CFLAGS += \ + -DNO_ARP \ + -DUSE_TMPNAM \ + -DHAVE_STDARG_H \ + -DHAVE_TGETENT \ + -DHAVE_TERMCAP \ + -DNEW_SHELLSIZE \ + -I proto \ + -Wno-attributes \ + -Wextra + +# Vim 'huge' build +ifeq ($(BUILD),huge) +CFLAGS += \ + -DFEAT_BROWSE \ + -DFEAT_MOUSE \ + -DFEAT_HUGE +else + +# Vim 'big' build +ifeq ($(BUILD),big) +CFLAGS += \ + -DFEAT_BROWSE \ + -DFEAT_MOUSE \ + -DFEAT_BIG +else + +# Vim 'normal' build +ifeq ($(BUILD),normal) +CFLAGS +=\ + -DFEAT_BROWSE \ + -DFEAT_MOUSE \ + -DFEAT_NORMAL +else + +# Vim 'small' build +ifeq ($(BUILD),small) +CFLAGS += -DFEAT_SMALL +else + +# Vim 'tiny' build +ifeq ($(BUILD),tiny) +CFLAGS += -DFEAT_TINY +endif +endif +endif +endif +endif + +# OS specific compiler flags +ifeq ($(UNM),AmigaOS) +LDFLAGS = -mcrt=clib2 -lauto -lm -lnet +CFLAGS += -DHAVE_FSYNC -D__USE_INLINE__ -mcrt=clib2 +else +ifeq ($(UNM),AROS) +LDFLAGS = -DHAVE_FSYNC -ldebug +else +ifeq ($(UNM),MorphOS) +LDFLAGS = -ldebug -noixemul +endif +endif +endif + +# Patch level used for Amiga style version string +ifdef PATCHLEVEL +CFLAGS += -DPATCHLEVEL=\"$(PATCHLEVEL)\" +endif + +# Common sources +SRC += \ + alloc.c \ + arabic.c \ + arglist.c \ + autocmd.c \ + beval.c \ + blob.c \ + blowfish.c \ + buffer.c \ + bufwrite.c \ + change.c \ + charset.c \ + cindent.c \ + clientserver.c \ + clipboard.c \ + cmdhist.c \ + cmdexpand.c \ + crypt.c \ + crypt_zip.c \ + debugger.c \ + dict.c \ + diff.c \ + digraph.c \ + drawline.c \ + drawscreen.c \ + edit.c \ + eval.c \ + evalbuffer.c \ + evalfunc.c \ + evalvars.c \ + evalwindow.c \ + ex_cmds.c \ + ex_cmds2.c \ + ex_docmd.c \ + ex_eval.c \ + ex_getln.c \ + fileio.c \ + filepath.c \ + findfile.c \ + float.c \ + fold.c \ + getchar.c \ + hardcopy.c \ + hashtab.c \ + help.c \ + highlight.c \ + if_cscope.c \ + indent.c \ + insexpand.c \ + json.c \ + list.c \ + locale.c \ + main.c \ + mark.c \ + map.c \ + match.c \ + mbyte.c \ + memfile.c \ + memline.c \ + menu.c \ + message.c \ + misc1.c \ + misc2.c \ + mouse.c \ + move.c \ + normal.c \ + ops.c \ + option.c \ + optionstr.c \ + os_amiga.c \ + popupmenu.c \ + popupwin.c \ + quickfix.c \ + regexp.c \ + register.c \ + screen.c \ + scriptfile.c \ + search.c \ + session.c \ + sha256.c \ + sign.c \ + spell.c \ + spellfile.c \ + spellsuggest.c \ + strings.c \ + syntax.c \ + tag.c \ + term.c \ + termlib.c \ + testing.c \ + textformat.c \ + textobject.c \ + textprop.c \ + time.c \ + typval.c \ + ui.c \ + undo.c \ + usercmd.c \ + userfunc.c \ + version.c \ + viminfo.c \ + vim9cmds.c \ + vim9compile.c \ + vim9execute.c \ + vim9expr.c \ + vim9instr.c \ + vim9script.c \ + vim9type.c \ + window.c \ + xdiff/xdiffi.c \ + xdiff/xemit.c \ + xdiff/xhistogram.c \ + xdiff/xpatience.c \ + xdiff/xprepare.c \ + xdiff/xutils.c + +OBJ = $(SRC:.c=.o) + +# Build everything - Ignoring header dependencies. +$(BIN): $(OBJ) + ${LD} -o $(BIN) $(OBJ) $(LDFLAGS) + +# Clean up +.PHONY: clean +clean: + $(RM) -fv $(OBJ) $(BIN) diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index 24c1338504d27..9c004fa8d2094 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -32,24 +32,31 @@ # Set to TINY to make minimal version (few features). FEATURES=HUGE -# set to yes for a debug build +# Set to yes for a debug build. DEBUG=no -# set to yes to create a mapfile +# Set to yes to create a mapfile. #MAP=yes -# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization +# Set to yes to measure code coverage. +COVERAGE=no + +# Better encryption support using libsodium. +# Set to yes or specify the path to the libsodium directory to enable it. +#SODIUM=yes + +# Set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization. OPTIMIZE=MAXSPEED -# set to yes to make gvim, no for vim +# Set to yes to make gvim, no for vim. GUI=yes -# set to yes to enable the DLL support (EXPERIMENTAL). +# Set to yes to enable the DLL support (EXPERIMENTAL). # Creates vim{32,64}.dll, and stub gvim.exe and vim.exe. # "GUI" should be also set to "yes". #VIMDLL=yes -# set to no if you do not want to use DirectWrite (DirectX) +# Set to no if you do not want to use DirectWrite (DirectX). # MinGW-w64 is needed, and ARCH should be set to i686 or x86-64. DIRECTX=yes @@ -115,7 +122,7 @@ endif ifndef CTAGS # this assumes ctags is Exuberant ctags -CTAGS = ctags -I INIT+ --fields=+S +CTAGS = ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S endif # Link against the shared version of libstdc++ by default. Set @@ -210,14 +217,19 @@ MKDIR = mkdir DIRSLASH = \\ endif endif +# set $CC to "gcc" unless it matches "clang" +ifeq ($(findstring clang,$(CC)),) CC := $(CROSS_COMPILE)gcc +endif +# set $CXX to "g++" unless it matches "clang" +ifeq ($(findstring clang,$(CXX)),) CXX := $(CROSS_COMPILE)g++ +endif ifeq ($(UNDER_CYGWIN),yes) WINDRES := $(CROSS_COMPILE)windres else WINDRES := windres endif -WINDRES_CC = $(CC) # Get the default ARCH. ifndef ARCH @@ -461,6 +473,8 @@ RUBY_PLATFORM = i586-mswin32 RUBY_PLATFORM = i386-mingw32 else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw32),) RUBY_PLATFORM = x64-mingw32 + else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw-ucrt),) +RUBY_PLATFORM = x64-mingw-ucrt else RUBY_PLATFORM = i386-mswin32 endif @@ -474,7 +488,9 @@ RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER) # Base name of msvcrXX.dll which is used by ruby's dll. RUBY_MSVCRT_NAME = msvcrt endif - ifeq ($(ARCH),x86-64) + ifeq ($(RUBY_PLATFORM),x64-mingw-ucrt) +RUBY_INSTALL_NAME = x64-ucrt-ruby$(RUBY_API_VER) + else ifeq ($(ARCH),x86-64) RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) else RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) @@ -510,8 +526,11 @@ endif ########################################################################### CFLAGS = -I. -Iproto $(DEFINES) -pipe -march=$(ARCH) -Wall +# To get additional compiler warnings +#CFLAGS += -Wextra -pedantic CXXFLAGS = -std=gnu++11 -WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED +# This used to have --preprocessor, but it's no longer supported +WINDRES_FLAGS = EXTRA_LIBS = ifdef GETTEXT @@ -569,11 +588,8 @@ ifdef RUBY CFLAGS += -DFEAT_RUBY $(RUBYINC) ifeq (yes, $(DYNAMIC_RUBY)) CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER) endif - ifeq (no, $(DYNAMIC_RUBY)) CFLAGS += -DRUBY_VERSION=$(RUBY_VER) - endif ifneq ($(findstring w64-mingw32,$(CC)),) # A workaround for MinGW-w64 CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE @@ -591,6 +607,8 @@ ifdef PYTHON3 CFLAGS += -DFEAT_PYTHON3 ifeq (yes, $(DYNAMIC_PYTHON3)) CFLAGS += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\" + else +CFLAGS += -DPYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\" endif endif @@ -627,7 +645,10 @@ NBDEBUG_SRC = nbdebug.c endif ifeq ($(CHANNEL),yes) -DEFINES += -DFEAT_JOB_CHANNEL +DEFINES += -DFEAT_JOB_CHANNEL -DFEAT_IPV6 + ifeq ($(shell expr "$$(($(WINVER)))" \>= "$$((0x600))"),1) +DEFINES += -DHAVE_INET_NTOP + endif endif ifeq ($(TERMINAL),yes) @@ -655,6 +676,24 @@ DEFINES += -DFEAT_DIRECTX_COLOR_EMOJI endif endif +ifdef SODIUM +DEFINES += -DHAVE_SODIUM + ifeq ($(SODIUM),yes) +SODIUM_DLL = libsodium-23.dll + else +SODIUM_DLL = libsodium.dll +CFLAGS += -I $(SODIUM)/include + endif + ifndef DYNAMIC_SODIUM +DYNAMIC_SODIUM=yes + endif + ifeq ($(DYNAMIC_SODIUM),yes) +DEFINES += -DDYNAMIC_SODIUM -DDYNAMIC_SODIUM_DLL=\"$(SODIUM_DLL)\" + else +SODIUMLIB = -lsodium + endif +endif + # Only allow XPM for a GUI build. ifeq (yes, $(GUI)) @@ -691,17 +730,38 @@ else CFLAGS += -Os else ifeq ($(OPTIMIZE), MAXSPEED) CFLAGS += -O3 -CFLAGS += -fomit-frame-pointer -freg-struct-return +CFLAGS += -fomit-frame-pointer + ifeq ($(findstring clang,$(CC)),) +# Only GCC supports the "reg-struct-return" option. Clang doesn't support this. +CFLAGS += -freg-struct-return + endif else # SPEED CFLAGS += -O2 endif LFLAGS += -s endif +ifeq ($(COVERAGE),yes) +CFLAGS += --coverage +LFLAGS += --coverage +endif + +# If the ASAN=yes argument is supplied, then compile Vim with the address +# sanitizer (asan). Only supported by MingW64 clang compiler. +# May make Vim twice as slow. Errors are reported on stderr. +# More at: https://code.google.com/p/address-sanitizer/ +# Useful environment variable: +# set ASAN_OPTIONS=print_stacktrace=1 log_path=asan +ifeq ($(ASAN),yes) +#CFLAGS += -g -O0 -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer +CFLAGS += -g -O0 -fsanitize-recover=all -fsanitize=address -fno-omit-frame-pointer +endif + LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o CUIOBJ = $(OUTDIR)/iscygpty.o OBJ = \ + $(OUTDIR)/alloc.o \ $(OUTDIR)/arabic.o \ $(OUTDIR)/arglist.o \ $(OUTDIR)/autocmd.o \ @@ -713,6 +773,8 @@ OBJ = \ $(OUTDIR)/change.o \ $(OUTDIR)/charset.o \ $(OUTDIR)/cindent.o \ + $(OUTDIR)/clientserver.o \ + $(OUTDIR)/clipboard.o \ $(OUTDIR)/cmdexpand.o \ $(OUTDIR)/cmdhist.o \ $(OUTDIR)/crypt.o \ @@ -737,19 +799,24 @@ OBJ = \ $(OUTDIR)/fileio.o \ $(OUTDIR)/filepath.o \ $(OUTDIR)/findfile.o \ + $(OUTDIR)/float.o \ $(OUTDIR)/fold.o \ $(OUTDIR)/getchar.o \ + $(OUTDIR)/gui_xim.o \ $(OUTDIR)/hardcopy.o \ $(OUTDIR)/hashtab.o \ + $(OUTDIR)/help.o \ $(OUTDIR)/highlight.o \ $(OUTDIR)/if_cscope.o \ $(OUTDIR)/indent.o \ $(OUTDIR)/insexpand.o \ $(OUTDIR)/json.o \ $(OUTDIR)/list.o \ + $(OUTDIR)/locale.o \ $(OUTDIR)/main.o \ $(OUTDIR)/map.o \ $(OUTDIR)/mark.o \ + $(OUTDIR)/match.o \ $(OUTDIR)/memfile.o \ $(OUTDIR)/memline.o \ $(OUTDIR)/menu.o \ @@ -781,26 +848,38 @@ OBJ = \ $(OUTDIR)/spell.o \ $(OUTDIR)/spellfile.o \ $(OUTDIR)/spellsuggest.o \ + $(OUTDIR)/strings.o \ $(OUTDIR)/syntax.o \ $(OUTDIR)/tag.o \ $(OUTDIR)/term.o \ $(OUTDIR)/testing.o \ + $(OUTDIR)/textformat.o \ + $(OUTDIR)/textobject.o \ $(OUTDIR)/textprop.o \ + $(OUTDIR)/time.o \ + $(OUTDIR)/typval.o \ $(OUTDIR)/ui.o \ $(OUTDIR)/undo.o \ $(OUTDIR)/usercmd.o \ $(OUTDIR)/userfunc.o \ $(OUTDIR)/version.o \ + $(OUTDIR)/vim9cmds.o \ + $(OUTDIR)/vim9compile.o \ + $(OUTDIR)/vim9execute.o \ + $(OUTDIR)/vim9expr.o \ + $(OUTDIR)/vim9instr.o \ + $(OUTDIR)/vim9script.o \ + $(OUTDIR)/vim9type.o \ $(OUTDIR)/viminfo.o \ $(OUTDIR)/winclip.o \ $(OUTDIR)/window.o ifeq ($(VIMDLL),yes) -OBJ += $(OUTDIR)/os_w32dll.o $(OUTDIR)/vimrcd.o -EXEOBJC = $(OUTDIR)/os_w32exec.o $(OUTDIR)/vimrcc.o -EXEOBJG = $(OUTDIR)/os_w32exeg.o $(OUTDIR)/vimrcg.o +OBJ += $(OUTDIR)/os_w32dll.o $(OUTDIR)/vimresd.o +EXEOBJC = $(OUTDIR)/os_w32exec.o $(OUTDIR)/vimresc.o +EXEOBJG = $(OUTDIR)/os_w32exeg.o $(OUTDIR)/vimresg.o else -OBJ += $(OUTDIR)/os_w32exe.o $(OUTDIR)/vimrc.o +OBJ += $(OUTDIR)/os_w32exe.o $(OUTDIR)/vimres.o endif ifdef PERL @@ -846,8 +925,8 @@ OBJ += $(OUTDIR)/netbeans.o endif ifeq ($(CHANNEL),yes) -OBJ += $(OUTDIR)/channel.o -LIB += -lwsock32 +OBJ += $(OUTDIR)/job.o $(OUTDIR)/channel.o +LIB += -lwsock32 -lws2_32 endif ifeq ($(DIRECTX),yes) @@ -922,6 +1001,9 @@ EXELFLAGS += -municode ifneq ($(DEBUG),yes) EXELFLAGS += -s endif + ifeq ($(COVERAGE),yes) +EXELFLAGS += --coverage + endif DEFINES += $(DEF_GUI) -DVIMDLL OBJ += $(GUIOBJ) $(CUIOBJ) OUTDIR = dobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH) @@ -1017,29 +1099,42 @@ ifeq (yes, $(MAP)) LFLAGS += -Wl,-Map=$(TARGET).map endif +# The default stack size on Windows is 2 MB. With the default stack size, the +# following tests fail with the clang address sanitizer: +# Test_listdict_compare, Test_listdict_compare_complex, Test_deep_recursion, +# Test_map_error, Test_recursive_define, Test_recursive_addstate +# To increase the stack size to 16MB, uncomment the following line: +#LFLAGS += -Wl,-stack -Wl,0x1000000 + all: $(MAIN_TARGET) vimrun.exe xxd/xxd.exe tee/tee.exe install.exe uninstall.exe GvimExt/gvimext.dll vimrun.exe: vimrun.c $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB) -install.exe: dosinst.c +install.exe: dosinst.c dosinst.h version.h $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid -uninstall.exe: uninstall.c +uninstall.exe: uninstall.c dosinst.h version.h $(CC) $(CFLAGS) -o uninstall.exe uninstall.c $(LIB) -lole32 +$(OBJ): | $(OUTDIR) + +$(EXEOBJG): | $(OUTDIR) + +$(EXEOBJC): | $(OUTDIR) + ifeq ($(VIMDLL),yes) -$(TARGET): $(OUTDIR) $(OBJ) - $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) +$(TARGET): $(OBJ) + $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB) -$(GVIMEXE): $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll +$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll $(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE) -$(VIMEXE): $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll +$(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll $(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE) else -$(TARGET): $(OUTDIR) $(OBJ) - $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) +$(TARGET): $(OBJ) + $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB) endif upx: exes @@ -1071,6 +1166,7 @@ clean: -$(DEL) $(OUTDIR)$(DIRSLASH)pathdef.c -rmdir $(OUTDIR) -$(DEL) $(MAIN_TARGET) vimrun.exe install.exe uninstall.exe + -$(DEL) *.map ifdef PERL -$(DEL) if_perl.c -$(DEL) auto$(DIRSLASH)if_perl.c @@ -1082,10 +1178,27 @@ endif $(MAKE) -C xxd -f Make_ming.mak clean $(MAKE) -C tee clean +# Run vim script to generate the Ex command lookup table. +# This only needs to be run when a command name has been added or changed. +# If this fails because you don't have Vim yet, first build and install Vim +# without changes. +cmdidxs: ex_cmds.h + vim --clean -N -X --not-a-term -u create_cmdidxs.vim -c quit + +# Run vim script to generate the normal/visual mode command lookup table. +# This only needs to be run when a new normal/visual mode command has been +# added. If this fails because you don't have Vim yet: +# - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command. +# - run "make nvcmdidxs" to generate nv_cmdidxs.h +nvcmdidxs: nv_cmds.h + $(CC) $(CFLAGS) -o create_nvcmdidxs.exe create_nvcmdidxs.c $(LIB) + vim --clean -N -X --not-a-term -u create_nvcmdidxs.vim -c quit + -$(DEL) create_nvcmdidxs.exe + ########################################################################### -INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h globals.h \ +INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h errors.h globals.h \ keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \ - spell.h structs.h term.h beval.h $(NBDEBUG_INCL) + spell.h structs.h termdefs.h beval.h $(NBDEBUG_INCL) GUI_INCL = gui.h ifeq ($(DIRECTX),yes) GUI_INCL += gui_dwrite.h @@ -1104,21 +1217,21 @@ $(OUTDIR)/%.o : %.c $(INCL) $(CC) -c $(CFLAGS) $< -o $@ ifeq ($(VIMDLL),yes) -$(OUTDIR)/vimrcc.o: vim.rc gvim.exe.mnf version.h gui_w32_rc.h vim.ico +$(OUTDIR)/vimresc.o: vim.rc vim.manifest version.h gui_w32_rc.h vim.ico $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) -UFEAT_GUI_MSWIN \ --input-format=rc --output-format=coff -i vim.rc -o $@ -$(OUTDIR)/vimrcg.o: vim.rc gvim.exe.mnf version.h gui_w32_rc.h vim.ico +$(OUTDIR)/vimresg.o: vim.rc vim.manifest version.h gui_w32_rc.h vim.ico $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \ --input-format=rc --output-format=coff -i vim.rc -o $@ -$(OUTDIR)/vimrcd.o: vim.rc version.h gui_w32_rc.h \ +$(OUTDIR)/vimresd.o: vim.rc version.h gui_w32_rc.h \ tools.bmp tearoff.bmp vim.ico vim_error.ico \ vim_alert.ico vim_info.ico vim_quest.ico $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) -DRCDLL -DVIMDLLBASE=\\\"$(VIMDLLBASE)\\\" \ --input-format=rc --output-format=coff -i vim.rc -o $@ else -$(OUTDIR)/vimrc.o: vim.rc gvim.exe.mnf version.h gui_w32_rc.h \ +$(OUTDIR)/vimres.o: vim.rc vim.manifest version.h gui_w32_rc.h \ tools.bmp tearoff.bmp vim.ico vim_error.ico \ vim_alert.ico vim_info.ico vim_quest.ico $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \ @@ -1128,6 +1241,44 @@ endif $(OUTDIR): $(MKDIR) $(OUTDIR) +$(OUTDIR)/buffer.o: buffer.c $(INCL) version.h + +$(OUTDIR)/evalfunc.o: evalfunc.c $(INCL) version.h + +$(OUTDIR)/evalvars.o: evalvars.c $(INCL) version.h + +$(OUTDIR)/ex_cmds.o: ex_cmds.c $(INCL) version.h + +$(OUTDIR)/ex_cmds2.o: ex_cmds2.c $(INCL) version.h + +$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmdidxs.h + +$(OUTDIR)/hardcopy.o: hardcopy.c $(INCL) version.h + +$(OUTDIR)/misc1.o: misc1.c $(INCL) version.h + +$(OUTDIR)/normal.o: normal.c $(INCL) nv_cmdidxs.h nv_cmds.h + +$(OUTDIR)/netbeans.o: netbeans.c $(INCL) version.h + +$(OUTDIR)/version.o: version.c $(INCL) version.h + +$(OUTDIR)/vim9cmds.o: vim9cmds.c $(INCL) vim9.h + +$(OUTDIR)/vim9compile.o: vim9compile.c $(INCL) vim9.h + +$(OUTDIR)/vim9execute.o: vim9execute.c $(INCL) vim9.h + +$(OUTDIR)/vim9expr.o: vim9expr.c $(INCL) vim9.h + +$(OUTDIR)/vim9instr.o: vim9instr.c $(INCL) vim9.h + +$(OUTDIR)/vim9script.o: vim9script.c $(INCL) vim9.h + +$(OUTDIR)/vim9type.o: vim9type.c $(INCL) vim9.h + +$(OUTDIR)/viminfo.o: viminfo.c $(INCL) version.h + $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp gui_dwrite.h $(CC) -c $(CFLAGS) $(CXXFLAGS) gui_dwrite.cpp -o $@ @@ -1140,10 +1291,10 @@ $(OUTDIR)/beval.o: beval.c $(INCL) $(GUI_INCL) $(OUTDIR)/gui_beval.o: gui_beval.c $(INCL) $(GUI_INCL) $(CC) -c $(CFLAGS) gui_beval.c -o $@ -$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL) $(GUI_INCL) +$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL) $(GUI_INCL) version.h $(CC) -c $(CFLAGS) gui_w32.c -o $@ -$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h +$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) $(CC) -c $(CFLAGS) if_cscope.c -o $@ $(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) $(MZSCHEME_INCL) $(MZ_EXTRA_DEP) @@ -1164,7 +1315,7 @@ $(OUTDIR)/if_perl.o: auto/if_perl.c $(INCL) $(CC) -c $(CFLAGS) auto/if_perl.c -o $@ -$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL) +$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL) version.h ifeq (16, $(RUBY)) $(CC) $(CFLAGS) -U_WIN32 -c -o $@ if_ruby.c endif @@ -1202,6 +1353,7 @@ $(OUTDIR)/pathdef.o: $(PATHDEF_SRC) $(INCL) CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" \ -DVSNPRINTF=vim_vsnprintf \ + -DSNPRINTF=vim_snprintf \ -DIS_COMBINING_FUNCTION=utf_iscomposing_uint \ -DWCWIDTH_FUNCTION=utf_uint2cells \ -DGET_SPECIAL_PTY_TYPE_FUNCTION=get_special_pty_type @@ -1214,7 +1366,7 @@ $(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS) $(CC) -c $(CFLAGS) $< -o $@ -$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak +$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak | $(OUTDIR) ifneq (sh.exe, $(SHELL)) @echo creating $(PATHDEF_SRC) @echo '/* pathdef.c */' > $(PATHDEF_SRC) diff --git a/src/Make_mint.mak b/src/Make_mint.mak deleted file mode 100644 index 97a2e4b4d1399..0000000000000 --- a/src/Make_mint.mak +++ /dev/null @@ -1,56 +0,0 @@ -# -# Makefile for Vim on MiNT vim:ts=8:sw=8:tw=78 -# -# This is a wrapper around the Unix Makefile. It is configured to accompany -# the MiNT distribution of Vim. -# -# See "Makefile" for instructions how to run "make". -# -# BUT: Always run: "make -f Make_mint.mak config", -# and then: "make -f Make_mint.mak"! -# Otherwise the postprocessing won't get done. -# - -### This Makefile has been successfully tested on these systems. -### Check the (*) column for remarks, listed below. -### Later code changes may cause small problems, otherwise Vim is supposed to -### compile and run without problems. - -#system: configurations: version (*) tested by: -#------------- ------------------------ ------- - ---------- -#MiNT 1.12.5 gcc gcc-2.6.1 3.29 Jens Felderhoff -#MiNT 1.12.6 gcc gcc-2.6.1 -GUI 4.6b Jens Felderhoff -#MiNT 1.12.6 gcc gcc-2.6.1 -GUI 4.6 Jens Felderhoff - -# set this to the pathname prefix of your symbol link editor, i.e. if it is -# /usr/local/bin/sym-ld set: -# -SYMLDPREFIX = /usr/local/bin/sym- -#SYMLDPREFIX = /gnu/bin/sym- - -POSTPROCESS = fixstk 20k $(VIMTARGET) -DBGPOSTPROCESS = fixstk 20k $(DBGTARGET) -DBGLDFLAGS = -B$(SYMLDPREFIX) -DBGTARGET = $(VIMTARGET).sym - - -# Default target is making the executable and then do the post processing -all: $(VIMTARGET) $(TOOLS) - $(POSTPROCESS) - -debug: $(DBGTARGET) - $(DBGPOSTPROCESS) - -#################### include the Unix Makefile ############### - -include Makefile - - -### (M) MiNT with gcc 2.6.1 and gdb 3.5 -CC = gcc -mint -CFLAGS = -g -O -Iproto - -$(DBGTARGET): $(OBJ) version.c version.h - $(CC) -c $(ALL_CFLAGS) version.c - $(CC) $(LDFLAGS) $(DBGLDFLAGS) -o $(DBGTARGET) -g $(OBJ) \ - version.o $(ALL_LIBS) diff --git a/src/Make_morph.mak b/src/Make_morph.mak deleted file mode 100644 index bb5805c4d2d2a..0000000000000 --- a/src/Make_morph.mak +++ /dev/null @@ -1,122 +0,0 @@ -# -# Makefile for VIM, using MorphOS SDK (gcc 2.95.3) -# - -CFLAGS = -c \ - -pipe \ - -O2 \ - -Wall \ - \ - -DNO_ARP \ - -DUSE_TMPNAM \ - \ - -I proto \ - \ - -noixemul - -PRG = Vim -LIBS = -noixemul -s -CC = gcc -LD = gcc -OBJDUMP = objdump -RM = rm - -.c.o: - ${CC} ${CFLAGS} $< -o $@ - -SRC = arabic.c \ - arglist.c \ - autocmd.c \ - blowfish.c \ - buffer.c \ - bufwrite.c \ - change.c \ - charset.c \ - cindent.c \ - cmdexpand.c \ - cmdhist.c \ - crypt.c \ - crypt_zip.c \ - debugger.c \ - dict.c \ - diff.c \ - digraph.c \ - drawline.c \ - drawscreen.c \ - edit.c \ - eval.c \ - evalbuffer.c \ - evalfunc.c \ - evalvars.c \ - evalwindow.c \ - ex_cmds.c \ - ex_cmds2.c \ - ex_docmd.c \ - ex_eval.c \ - ex_getln.c \ - fileio.c \ - filepath.c \ - findfile.c \ - fold.c \ - getchar.c \ - hardcopy.c \ - hashtab.c \ - highlight.c \ - indent.c \ - insexpand.c \ - json.c \ - list.c \ - main.c \ - map.c \ - mark.c \ - mbyte.c \ - memfile.c \ - memline.c \ - menu.c \ - message.c \ - misc1.c \ - misc2.c \ - mouse.c \ - move.c \ - normal.c \ - ops.c \ - option.c \ - optionstr.c \ - os_amiga.c \ - popupmenu.c \ - profiler.c \ - quickfix.c \ - regexp.c \ - register.c \ - scriptfile.c \ - screen.c \ - search.c \ - session.c \ - sha256.c \ - sign.c \ - spell.c \ - spellfile.c \ - spellsuggest.c \ - syntax.c \ - tag.c \ - term.c \ - testing.c \ - textprop.c \ - ui.c \ - undo.c \ - usercmd.c \ - userfunc.c \ - version.c \ - viminfo.c \ - window.c \ - -OBJ = $(SRC:.c=.o) - -$(PRG): $(OBJ) - ${LD} -o $(PRG) $(OBJ) $(LIBS) - -dump: $(PRG) - $(OBJDUMP) --reloc --disassemble-all $(PRG) > $(PRG).s - -clean: - $(RM) -fv $(OBJ) $(PRG) $(PRG).s diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 11058086be389..52282cb1e77c6 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -1,7 +1,7 @@ # Makefile for Vim on Win32 (Windows XP/2003/Vista/7/8/10) and Win64, -# using the Microsoft Visual C++ compilers. Known to work with VC5, VC6 (VS98), -# VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005), VC9 (VS2008), VC10 (VS2010), -# VC11 (VS2012), VC12 (VS2013), VC14 (VS2015) and VC15 (VS2017) +# using the Microsoft Visual C++ compilers. Known to work with VC10 (VS2010), +# VC11 (VS2012), VC12 (VS2013), VC14 (VS2015), VC14.1 (VS2017) and +# VC14.2 (VS2019). # # To build using other Windows compilers, see INSTALLpc.txt # @@ -15,14 +15,12 @@ # This will build the console version of Vim with no additional interfaces. # To add features, define any of the following: # -# For MSVC 11, if you want to include Win32.mak, you need to specify -# where the file is, e.g.: -# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include" -# -# !!!! After changing features do "nmake clean" first !!!! +# !!!! After changing any features do "nmake clean" first !!!! # # Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE) # +# Name to add to the version: MODIFIED_BY=[name of modifier] +# # GUI interface: GUI=yes (default is no) # # GUI with DirectWrite (DirectX): DIRECTX=yes @@ -33,15 +31,22 @@ # # OLE interface: OLE=yes (usually with GUI=yes) # -# IME support: IME=yes (requires GUI=yes) +# IME support: IME=yes (default is yes) # DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default # is yes) -# Global IME support: GIME=yes (requires GUI=yes) # -# Terminal support: TERMINAL=yes (default is yes) +# Terminal support: TERMINAL=yes (default is yes if FEATURES is HUGE) +# Will also enable CHANNEL # # Sound support: SOUND=yes (default is yes) # +# Sodium support: SODIUM=[Path to Sodium directory] +# DYNAMIC_SODIUM=yes (to load the Sodium DLL dynamically) +# You need to install the msvc package from +# https://download.libsodium.org/libsodium/releases/ +# and package the libsodium.dll with Vim +# +# # DLL support (EXPERIMENTAL): VIMDLL=yes (default is no) # Creates vim{32,64}.dll, and stub gvim.exe and vim.exe. # The shared codes between the GUI and the console are built into @@ -109,13 +114,13 @@ # PostScript printing: POSTSCRIPT=yes (default is no) # # Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes) -# Requires CHANNEL. +# Requires CHANNEL. # # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes # doesn't work) # # Inter process communication: CHANNEL=[yes or no] (default is yes if GUI -# is yes) +# is yes or TERMINAL is yes) # # XPM Image Support: XPM=[path to XPM directory] # Default is "xpm", using the files included in the distribution. @@ -141,6 +146,8 @@ # # Static Code Analysis: ANALYZE=yes (works with VS2012 or later) # +# Address Sanitizer: ASAN=yes (works with VS2019 or later) +# # You can combine any of these interfaces # # Example: To build the non-debug, GUI version with Perl interface: @@ -206,9 +213,6 @@ OBJDIR = $(OBJDIR)V OBJDIR = $(OBJDIR)d !endif -# If you include Win32.mak, it requires that CPU be set appropriately. -# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64. - !ifdef PROCESSOR_ARCHITECTURE # We're on Windows NT or using VC 6+ ! ifdef CPU @@ -248,18 +252,7 @@ NODEBUG = 1 MAKEFLAGS_GVIMEXT = DEBUG=yes !endif - -# Get all sorts of useful, standard macros from the Platform SDK, -# if SDK_INCLUDE_DIR is set or USE_WIN32MAK is set to "yes". - -!ifdef SDK_INCLUDE_DIR -! include $(SDK_INCLUDE_DIR)\Win32.mak -!elseif "$(USE_WIN32MAK)"=="yes" -! include -!else -link = link -!endif - +LINK = link # Check VC version. !if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul] @@ -276,28 +269,20 @@ link = link !if $(MSVCVER) < 1900 MSVC_MAJOR = ($(MSVCVER) / 100 - 6) MSVCRT_VER = ($(MSVCVER) / 10 - 60) -# Visual C++ 2017 needs special handling -# it has an _MSC_VER of 1910->14.1, but is actually v15 with runtime v140 -# TODO: what's the maximum value? -!elseif $(MSVCVER) >= 1910 -MSVC_MAJOR = 15 -MSVCRT_VER = 140 !else MSVC_MAJOR = ($(MSVCVER) / 100 - 5) -MSVCRT_VER = ($(MSVCVER) / 10 - 50) +MSVCRT_VER = ($(MSVCVER) / 100 * 10 - 50) !endif -# Calculate MSVC_FULL for Visual C++ 8 and up. -!if $(MSVC_MAJOR) >= 8 -! if [echo MSVC_FULL=_MSC_FULL_VER> msvcfullver.c && $(CC) /EP msvcfullver.c > msvcfullver.~ 2> nul] -! message *** ERROR -! message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH. -! message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed. -! error Make aborted. -! else -! include msvcfullver.~ -! if [del msvcfullver.c msvcfullver.~] -! endif +# Calculate MSVC_FULL. +!if [echo MSVC_FULL=_MSC_FULL_VER> msvcfullver.c && $(CC) /EP msvcfullver.c > msvcfullver.~ 2> nul] +! message *** ERROR +! message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH. +! message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed. +! error Make aborted. +!else +! include msvcfullver.~ +! if [del msvcfullver.c msvcfullver.~] ! endif !endif @@ -318,14 +303,11 @@ MSVCRT_NAME = msvcr$(MSVCRT_VER) MSVCRT_NAME = vcruntime$(MSVCRT_VER) !endif -!if $(MSVC_MAJOR) == 6 -CPU = ix86 +### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET) +!ifndef WINVER +WINVER = 0x0501 !endif - -# Flag to turn on Win64 compatibility warnings for VC7.x and VC8. -WP64CHECK = /Wp64 - # Use multiprocess build USE_MP = yes @@ -340,7 +322,7 @@ FEATURES = HUGE !ifndef CTAGS # this assumes ctags is Exuberant ctags -CTAGS = ctags -I INIT+ --fields=+S +CTAGS = ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S !endif !ifndef CSCOPE @@ -389,12 +371,41 @@ SOUND = no ! endif !endif +!ifndef SODIUM +SODIUM = no +!endif +!ifndef DYNAMIC_SODIUM +DYNAMIC_SODIUM = yes +!endif + +!if "$(SODIUM)" != "no" +! if "$(CPU)" == "AMD64" +SOD_LIB = $(SODIUM)\x64\Release\v140\dynamic +! elseif "$(CPU)" == "i386" +SOD_LIB = $(SODIUM)\Win32\Release\v140\dynamic +! else +SODIUM = no +! endif +!endif + +!if "$(SODIUM)" != "no" +SOD_INC = /I "$(SODIUM)\include" +! if "$(DYNAMIC_SODIUM)" == "yes" +SODIUM_DLL = libsodium.dll +SOD_DEFS = -DHAVE_SODIUM -DDYNAMIC_SODIUM -DDYNAMIC_SODIUM_DLL=\"$(SODIUM_DLL)\" +SOD_LIB = +! else +SOD_DEFS = -DHAVE_SODIUM +SOD_LIB = $(SOD_LIB)\libsodium.lib +! endif +!endif + !ifndef NETBEANS NETBEANS = $(GUI) !endif !ifndef CHANNEL -! if "$(FEATURES)"=="HUGE" +! if "$(FEATURES)"=="HUGE" || "$(TERMINAL)"=="yes" CHANNEL = yes ! else CHANNEL = $(GUI) @@ -470,21 +481,14 @@ SOUND_LIB = winmm.lib !endif !if "$(CHANNEL)" == "yes" -CHANNEL_PRO = proto/channel.pro -CHANNEL_OBJ = $(OBJDIR)/channel.obj -CHANNEL_DEFS = -DFEAT_JOB_CHANNEL - -NETBEANS_LIB = WSock32.lib -!endif +CHANNEL_PRO = proto/job.pro proto/channel.pro +CHANNEL_OBJ = $(OBJDIR)/job.obj $(OBJDIR)/channel.obj +CHANNEL_DEFS = -DFEAT_JOB_CHANNEL -DFEAT_IPV6 +! if $(WINVER) >= 0x600 +CHANNEL_DEFS = $(CHANNEL_DEFS) -DHAVE_INET_NTOP +! endif -# Set which version of the CRT to use -!if defined(USE_MSVCRT) -# CVARS = $(cvarsdll) -# !elseif defined(MULTITHREADED) -# CVARS = $(cvarsmt) -!else -# CVARS = $(cvars) -# CVARS = $(cvarsmt) +NETBEANS_LIB = WSock32.lib Ws2_32.lib !endif # need advapi32.lib for GetUserName() @@ -493,24 +497,20 @@ NETBEANS_LIB = WSock32.lib # gdi32.lib and comdlg32.lib for printing support # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \ - comdlg32.lib ole32.lib netapi32.lib uuid.lib /machine:$(CPU) + comdlg32.lib ole32.lib netapi32.lib uuid.lib user32.lib \ + /machine:$(CPU) !if "$(DELAYLOAD)" == "yes" CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib !endif -### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET) -!ifndef WINVER -WINVER = 0x0501 -!endif - # If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal # default, use these lines. #VIMRCLOC = somewhere #VIMRUNTIMEDIR = somewhere -CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \ +CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 \ $(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \ - $(NBDEBUG_DEFS) $(XPM_DEFS) \ + $(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \ $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) #>>>>> end of choices @@ -542,68 +542,50 @@ CPUNR = sse2 !endif # Convert processor ID to MVC-compatible number -!if $(MSVC_MAJOR) < 8 -! if "$(CPUNR)" == "i586" -CPUARG = /G5 -! elseif "$(CPUNR)" == "i686" -CPUARG = /G6 -! elseif "$(CPUNR)" == "sse" -CPUARG = /G6 /arch:SSE -! elseif "$(CPUNR)" == "sse2" -CPUARG = /G7 /arch:SSE2 -! elseif "$(CPUNR)" == "avx" || "$(CPUNR)" == "avx2" -! message AVX/AVX2 Instruction Sets are not supported by Visual C++ v$(MSVC_MAJOR) -! message Falling back to SSE2 -CPUARG = /G7 /arch:SSE2 -! elseif "$(CPUNR)" == "any" -CPUARG = -! endif -!else # IA32/SSE/SSE2 are only supported on x86 -! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && ("$(CPUNR)" == "i586" || "$(CPUNR)" == "i686" || "$(CPUNR)" == "any") +!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && ("$(CPUNR)" == "i586" || "$(CPUNR)" == "i686" || "$(CPUNR)" == "any") # VC<11 generates fp87 code by default -! if $(MSVC_MAJOR) < 11 +! if $(MSVC_MAJOR) < 11 CPUARG = # VC>=11 needs explicit instructions to generate fp87 code -! else +! else CPUARG = /arch:IA32 -! endif -! elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse" +! endif +!elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse" CPUARG = /arch:SSE -! elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse2" +!elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse2" CPUARG = /arch:SSE2 -! elseif "$(CPUNR)" == "avx" +!elseif "$(CPUNR)" == "avx" # AVX is only supported by VC 10 and up -! if $(MSVC_MAJOR) < 10 -! message AVX Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) -! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" -! message Falling back to SSE2 +! if $(MSVC_MAJOR) < 10 +! message AVX Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) +! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" +! message Falling back to SSE2 CPUARG = /arch:SSE2 -! else -CPUARG = -! endif ! else -CPUARG = /arch:AVX +CPUARG = ! endif -! elseif "$(CPUNR)" == "avx2" +! else +CPUARG = /arch:AVX +! endif +!elseif "$(CPUNR)" == "avx2" # AVX is only supported by VC 10 and up -! if $(MSVC_MAJOR) < 10 -! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) -! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" -! message Falling back to SSE2 +! if $(MSVC_MAJOR) < 10 +! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) +! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" +! message Falling back to SSE2 CPUARG = /arch:SSE2 -! else +! else CPUARG = -! endif +! endif # AVX2 is only supported by VC 12U2 and up # 180030501 is the full version number for Visual Studio 2013/VC 12 Update 2 -! elseif $(MSVC_FULL) < 180030501 -! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)-$(MSVC_FULL) -! message Falling back to AVX +! elseif $(MSVC_FULL) < 180030501 +! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)-$(MSVC_FULL) +! message Falling back to AVX CPUARG = /arch:AVX -! else +! else CPUARG = /arch:AVX2 -! endif ! endif !endif @@ -632,6 +614,12 @@ NODEFAULTLIB = NODEFAULTLIB = /nodefaultlib !endif +# Specify source code charset to suppress warning C4819 on non-English +# environment. Only available from MSVC 14. +!if $(MSVC_MAJOR) >= 14 +CFLAGS = $(CFLAGS) /source-charset:utf-8 +!endif + # Use multiprocess build on MSVC 10 !if ("$(USE_MP)" == "yes") && ($(MSVC_MAJOR) >= 10) CFLAGS = $(CFLAGS) /MP @@ -648,7 +636,14 @@ CFLAGS = $(CFLAGS) -DHAVE_STDINT_H CFLAGS = $(CFLAGS) /analyze !endif +# Address Sanitizer (ASAN) generally available starting with VS2019 version +# 16.9 +!if ("$(ASAN)" == "yes") && ($(MSVC_MAJOR) >= 14) +CFLAGS = $(CFLAGS) /fsanitize=address +!endif + !ifdef NODEBUG + VIM = vim ! if "$(OPTIMIZE)" == "SPACE" OPTFLAG = /O1 @@ -658,57 +653,58 @@ OPTFLAG = /O2 OPTFLAG = /Ox ! endif -! if $(MSVC_MAJOR) >= 8 # Use link time code generation if not worried about size -! if "$(OPTIMIZE)" != "SPACE" +! if "$(OPTIMIZE)" != "SPACE" OPTFLAG = $(OPTFLAG) /GL -! endif -! endif - -# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.) -! if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8) -CFLAGS = $(CFLAGS) $(WP64CHECK) ! endif CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) -RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG +RCFLAGS = -DNDEBUG ! ifdef USE_MSVCRT CFLAGS = $(CFLAGS) /MD LIBC = msvcrt.lib ! else -LIBC = libcmt.lib CFLAGS = $(CFLAGS) /Zl /MT +LIBC = libcmt.lib ! endif + !else # DEBUG + VIM = vimd ! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86") DEBUGINFO = /ZI ! endif CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od -RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG -# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0. -! if $(MSVC_MAJOR) == 4 -LIBC = -! else +RCFLAGS = -D_DEBUG -DDEBUG +# The /fixed:no is needed for Quantify. LIBC = /fixed:no -! endif ! ifdef USE_MSVCRT CFLAGS = $(CFLAGS) /MDd LIBC = $(LIBC) msvcrtd.lib ! else -LIBC = $(LIBC) libcmtd.lib CFLAGS = $(CFLAGS) /Zl /MTd +LIBC = $(LIBC) libcmtd.lib ! endif + !endif # DEBUG +!if "$(CL)" == "/D_USING_V110_SDK71_" +RCFLAGS = $(RCFLAGS) /D_USING_V110_SDK71_ +!endif + +# Visual Studio 2005 has 'deprecated' many of the standard CRT functions +CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE +CFLAGS = $(CFLAGS) $(CFLAGS_DEPR) + !include Make_all.mak !include testdir\Make_all.mak -INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h globals.h \ +INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h errors.h globals.h \ keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \ - spell.h structs.h term.h beval.h $(NBDEBUG_INCL) + spell.h structs.h termdefs.h beval.h $(NBDEBUG_INCL) OBJ = \ + $(OUTDIR)\alloc.obj \ $(OUTDIR)\arabic.obj \ $(OUTDIR)\arglist.obj \ $(OUTDIR)\autocmd.obj \ @@ -720,6 +716,8 @@ OBJ = \ $(OUTDIR)\change.obj \ $(OUTDIR)\charset.obj \ $(OUTDIR)\cindent.obj \ + $(OUTDIR)\clientserver.obj \ + $(OUTDIR)\clipboard.obj \ $(OUTDIR)\cmdexpand.obj \ $(OUTDIR)\cmdhist.obj \ $(OUTDIR)\crypt.obj \ @@ -744,19 +742,24 @@ OBJ = \ $(OUTDIR)\fileio.obj \ $(OUTDIR)\filepath.obj \ $(OUTDIR)\findfile.obj \ + $(OUTDIR)\float.obj \ $(OUTDIR)\fold.obj \ $(OUTDIR)\getchar.obj \ + $(OUTDIR)\gui_xim.obj \ $(OUTDIR)\hardcopy.obj \ $(OUTDIR)\hashtab.obj \ + $(OUTDIR)\help.obj \ $(OUTDIR)\highlight.obj \ - $(OBJDIR)\if_cscope.obj \ + $(OUTDIR)\if_cscope.obj \ $(OUTDIR)\indent.obj \ $(OUTDIR)\insexpand.obj \ $(OUTDIR)\json.obj \ $(OUTDIR)\list.obj \ + $(OUTDIR)\locale.obj \ $(OUTDIR)\main.obj \ $(OUTDIR)\map.obj \ $(OUTDIR)\mark.obj \ + $(OUTDIR)\match.obj \ $(OUTDIR)\mbyte.obj \ $(OUTDIR)\memfile.obj \ $(OUTDIR)\memline.obj \ @@ -788,15 +791,27 @@ OBJ = \ $(OUTDIR)\spell.obj \ $(OUTDIR)\spellfile.obj \ $(OUTDIR)\spellsuggest.obj \ + $(OUTDIR)\strings.obj \ $(OUTDIR)\syntax.obj \ $(OUTDIR)\tag.obj \ $(OUTDIR)\term.obj \ $(OUTDIR)\testing.obj \ + $(OUTDIR)\textformat.obj \ + $(OUTDIR)\textobject.obj \ $(OUTDIR)\textprop.obj \ + $(OUTDIR)\time.obj \ + $(OUTDIR)\typval.obj \ $(OUTDIR)\ui.obj \ $(OUTDIR)\undo.obj \ $(OUTDIR)\usercmd.obj \ $(OUTDIR)\userfunc.obj \ + $(OUTDIR)\vim9cmds.obj \ + $(OUTDIR)\vim9compile.obj \ + $(OUTDIR)\vim9execute.obj \ + $(OUTDIR)\vim9expr.obj \ + $(OUTDIR)\vim9instr.obj \ + $(OUTDIR)\vim9script.obj \ + $(OUTDIR)\vim9type.obj \ $(OUTDIR)\viminfo.obj \ $(OUTDIR)\winclip.obj \ $(OUTDIR)\window.obj \ @@ -818,6 +833,9 @@ OLE_IDL = if_ole.idl OLE_LIB = oleaut32.lib !endif +!ifndef IME +IME = yes +!endif !if "$(IME)" == "yes" CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME ! ifndef DYNAMIC_IME @@ -830,11 +848,6 @@ IME_LIB = imm32.lib ! endif !endif -!if "$(GIME)" == "yes" -CFLAGS = $(CFLAGS) -DGLOBAL_IME -OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj -!endif - !if "$(GUI)" == "yes" SUBSYSTEM = windows CFLAGS = $(CFLAGS) -DFEAT_GUI_MSWIN @@ -855,9 +868,7 @@ GUI_OBJ = \ $(OUTDIR)\gui_beval.obj \ $(OUTDIR)\gui_w32.obj GUI_LIB = \ - gdi32.lib version.lib $(IME_LIB) \ - winspool.lib comctl32.lib advapi32.lib shell32.lib netapi32.lib \ - /machine:$(CPU) + version.lib $(IME_LIB) winspool.lib comctl32.lib !else SUBSYSTEM = console CUI_INCL = iscygpty.h @@ -995,6 +1006,9 @@ PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib ! ifndef PYTHON3_VER PYTHON3_VER = 36 ! endif +! ifndef DYNAMIC_PYTHON3_DLL +DYNAMIC_PYTHON3_DLL = python$(PYTHON3_VER).dll +! endif ! message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)" ! if "$(DYNAMIC_PYTHON3)" == "yes" ! message Python3 DLL will be loaded dynamically @@ -1004,9 +1018,10 @@ PYTHON3_OBJ = $(OUTDIR)\if_python3.obj PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC" ! if "$(DYNAMIC_PYTHON3)" == "yes" CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \ - -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\" + -DDYNAMIC_PYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\" PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib ! else +CFLAGS = $(CFLAGS) -DPYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\" PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib ! endif !endif @@ -1172,7 +1187,11 @@ RUBY_MSVCRT_NAME = $(MSVCRT_NAME) ! if "$(CPU)" == "i386" RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) ! else # CPU +! if EXIST($(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw-ucrt) +RUBY_INSTALL_NAME = x64-ucrt-ruby$(RUBY_API_VER) +! else RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER) +! endif ! endif # CPU ! endif # RUBY_INSTALL_NAME @@ -1199,10 +1218,11 @@ RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib # Do we want to load Ruby dynamically? ! if "$(DYNAMIC_RUBY)" == "yes" ! message Ruby DLL will be loaded dynamically -CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \ - -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" +CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY \ + -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" ! undef RUBY_LIB ! endif +CFLAGS = $(CFLAGS) -DRUBY_VERSION=$(RUBY_VER) !endif # RUBY # @@ -1217,6 +1237,13 @@ CFLAGS = $(CFLAGS) -DMSWINPS # CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES) +# +# MODIFIED_BY - Name of who modified a release version +# +!if "$(MODIFIED_BY)" != "" +CFLAGS = $(CFLAGS) -DMODIFIED_BY=\"$(MODIFIED_BY)\" +!endif + # # Always generate the .pdb file, so that we get debug symbols that can be used # on a crash (doesn't add overhead to the executable). @@ -1238,29 +1265,37 @@ LINK_PDB = /PDB:$(VIM).pdb -debug # CFLAGS with /Fo$(OUTDIR)/ CFLAGS_OUTDIR=$(CFLAGS) /Fo$(OUTDIR)/ +PATHDEF_SRC = $(OUTDIR)\pathdef.c + +LINKARGS1 = /nologo +LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) \ + $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \ + $(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB) + +!ifdef NODEBUG # Add /opt:ref to remove unreferenced functions and data even when /DEBUG is # added. -conflags = /nologo /opt:ref - -PATHDEF_SRC = $(OUTDIR)\pathdef.c +LINKARGS1 = $(LINKARGS1) /opt:ref +!else +LINKARGS1 = $(LINKARGS1) /opt:noref /opt:noicf +!endif -!IF "$(MAP)" == "yes" +!if "$(MAP)" == "yes" # "/map" is for debugging -conflags = $(conflags) /map -!ELSEIF "$(MAP)" == "lines" +LINKARGS1 = $(LINKARGS1) /map +!elseif "$(MAP)" == "lines" # "/mapinfo:lines" is for debugging, only works for VC6 and later -conflags = $(conflags) /map /mapinfo:lines -!ENDIF - -LINKARGS1 = $(linkdebug) $(conflags) -LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \ - $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \ - $(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB) +LINKARGS1 = $(LINKARGS1) /map /mapinfo:lines +!endif -# Report link time code generation progress if used. +# Enable link time code generation if needed. !ifdef NODEBUG -! if $(MSVC_MAJOR) >= 8 -! if "$(OPTIMIZE)" != "SPACE" +! if "$(OPTIMIZE)" != "SPACE" +! if "$(CI)" == "true" || "$(CI)" == "True" +# Enable link time code generation, but do not show the progress. +LINKARGS1 = $(LINKARGS1) /LTCG +! else +# Report link time code generation progress. LINKARGS1 = $(LINKARGS1) /LTCG:STATUS ! endif ! endif @@ -1282,14 +1317,6 @@ MAIN_TARGET = $(VIM).exe # Target to run individual tests. VIMTESTTARGET = $(VIM).exe -OLD_TEST_OUTFILES = \ - $(SCRIPTS_FIRST) \ - $(SCRIPTS_ALL) \ - $(SCRIPTS_MORE1) \ - $(SCRIPTS_MORE4) \ - $(SCRIPTS_WIN32) \ - $(SCRIPTS_GUI) - all: $(MAIN_TARGET) \ vimrun.exe \ install.exe \ @@ -1299,7 +1326,7 @@ all: $(MAIN_TARGET) \ GvimExt/gvimext.dll # To get around the command line limit: Make use of nmake's response files to -# capture the arguments for $(link) in a file using the @<=^^>) +# $LINKARGS2 may contain backslashes, quotes and chevrons, escape them all. E0_LINKARGS2 = $(LINKARGS2:\=\\) -E_LINKARGS2 = $(E0_LINKARGS2:"=\") +E00_LINKARGS2 = $(E0_LINKARGS2:"=\") # ") stop the string +E000_LINKARGS2 = $(E00_LINKARGS2:<=^^<) +E_LINKARGS2 = $(E000_LINKARGS2:>=^^>) $(PATHDEF_SRC): Make_mvc.mak @echo creating $(PATHDEF_SRC) @@ -1808,12 +1915,13 @@ $(PATHDEF_SRC): Make_mvc.mak @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC) @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC) - @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC) + @echo char_u *all_lflags = (char_u *)"$(LINK:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC) @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC) @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC) # End Custom Build proto.h: \ + proto/alloc.pro \ proto/arabic.pro \ proto/arglist.pro \ proto/autocmd.pro \ @@ -1824,6 +1932,8 @@ proto.h: \ proto/change.pro \ proto/charset.pro \ proto/cindent.pro \ + proto/clientserver.pro \ + proto/clipboard.pro \ proto/cmdexpand.pro \ proto/cmdhist.pro \ proto/crypt.pro \ @@ -1848,17 +1958,22 @@ proto.h: \ proto/fileio.pro \ proto/filepath.pro \ proto/findfile.pro \ + proto/float.pro \ proto/getchar.pro \ + proto/gui_xim.pro \ proto/hardcopy.pro \ proto/hashtab.pro \ + proto/help.pro \ proto/highlight.pro \ proto/indent.pro \ proto/insexpand.pro \ proto/json.pro \ proto/list.pro \ + proto/locale.pro \ proto/main.pro \ proto/map.pro \ proto/mark.pro \ + proto/match.pro \ proto/memfile.pro \ proto/memline.pro \ proto/menu.pro \ @@ -1890,15 +2005,27 @@ proto.h: \ proto/spell.pro \ proto/spellfile.pro \ proto/spellsuggest.pro \ + proto/strings.pro \ proto/syntax.pro \ proto/tag.pro \ proto/term.pro \ proto/testing.pro \ + proto/textformat.pro \ + proto/textobject.pro \ proto/textprop.pro \ + proto/time.pro \ + proto/typval.pro \ proto/ui.pro \ proto/undo.pro \ proto/usercmd.pro \ proto/userfunc.pro \ + proto/vim9cmds.pro \ + proto/vim9compile.pro \ + proto/vim9execute.pro \ + proto/vim9expr.pro \ + proto/vim9instr.pro \ + proto/vim9script.pro \ + proto/vim9type.pro \ proto/viminfo.pro \ proto/window.pro \ $(SOUND_PRO) \ diff --git a/src/Make_vms.mms b/src/Make_vms.mms index 3decf69116c8e..f1689bef3c9db 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -2,9 +2,9 @@ # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy -# Last change: 2019 Sep 28 +# Last change: 2021 Dec 20 # -# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 +# This script has been tested on VMS 6.2 to 8.4 on DEC Alpha, VAX and IA64 # with MMS and MMK # # The following could be built: @@ -38,13 +38,13 @@ MODEL = HUGE # GUI or terminal mode executable. # Comment out if you want just the character terminal mode only. # GUI with Motif -GUI = YES +# GUI = YES # GUI with GTK # If you have GTK installed you might want to enable this option. # NOTE: you will need to properly define GTK_DIR below -# NOTE: since Vim 7.3 GTK 2+ is used that is not ported to VMS, -# therefore this option should not be used +# NOTE: since Vim 7.3 GTK 2+ is used that is not ported to VMS, +# therefore this option should not be used # GTK = YES # GUI/Motif with XPM @@ -59,7 +59,7 @@ CCVER = YES # Uncomment if want a debug version. Resulting executable is DVIM.EXE # Development purpose only! Normally, it should not be defined. !!! -# DEBUG = YES +# DEBUG = YES # Languages support for Perl, Python, TCL etc. # If you don't need it really, leave them behind the comment. @@ -68,16 +68,13 @@ CCVER = YES # VIM_PERL = YES # VIM_PYTHON = YES # VIM_RUBY = YES +# VIM_LUA = YES # X Input Method. For entering special languages like chinese and -# Japanese. Please define just one: VIM_XIM or VIM_HANGULIN +# Japanese. # If you don't need it really, leave it behind the comment. # VIM_XIM = YES -# Internal Hangul input method. GUI only. -# If you don't need it really, leave it behind the comment. -# VIM_HANGULIN = YES - # Allow any white space to separate the fields in a tags file # When not defined, only a TAB is allowed. # VIM_TAG_ANYWHITE = YES @@ -101,7 +98,7 @@ CCVER = YES .IFDEF MMSVAX .IFDEF DECC # VAX with DECC CC_DEF = cc # /decc # some versions require /decc switch but when it is not required /ver might fail -PREFIX = /prefix=all +PREFIX = /prefix=all/name=(upper,short) OPTIMIZE= /noopt # do not optimize on VAX. The compiler has hard time with crypto functions .ELSE # VAX with VAXC CC_DEF = cc @@ -111,7 +108,7 @@ CCVER = .ENDIF .ELSE # AXP and IA64 with DECC CC_DEF = cc -PREFIX = /prefix=all +PREFIX = /prefix=all/name=(upper,short) OPTIMIZE= /opt .ENDIF @@ -169,7 +166,7 @@ GTK = "" GTK_DIR = DKA0:[WORK.GTK1210.] DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK" LIBS = ,OS_VMS_GTK.OPT/OPT -GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm +GUI_FLAG = /float=ieee/ieee=denorm GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_gtk_x11.c gui_beval.c pty.c GUI_OBJ = gui.obj gui_gtk.obj gui_gtk_f.obj gui_gtk_x11.obj gui_beval.obj pty.obj GUI_INC = ,"/gtk_root/gtk","/gtk_root/glib" @@ -181,9 +178,10 @@ MOTIF = YES .IFDEF XPM DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF","HAVE_XPM" XPM_INC = ,[.xpm.include] +XPM_LIB = ,OS_VMS_XPM.OPT/OPT .ELSE DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF" -XPM_INC = +XPM_INC = .ENDIF LIBS = ,OS_VMS_MOTIF.OPT/OPT GUI_FLAG = @@ -240,6 +238,15 @@ RUBY_LIB = ,OS_VMS_RUBY.OPT/OPT RUBY_INC = .ENDIF +.IFDEF VIM_LUA +# LUA related setup. +LUA_DEF = ,"FEAT_LUA" +LUA_SRC = if_lua.c +LUA_OBJ = if_lua.obj +LUA_LIB = ,OS_VMS_LUA.OPT/OPT +LUA_INC = ,LUA$ROOT:[INCLUDE] +.ENDIF + .IFDEF VIM_XIM # XIM related setup. .IFDEF GUI @@ -247,19 +254,10 @@ XIM_DEF = ,"FEAT_XIM" .ENDIF .ENDIF -.IFDEF VIM_HANGULIN -# HANGULIN related setup. -.IFDEF GUI -HANGULIN_DEF = ,"FEAT_HANGULIN" -HANGULIN_SRC = hangulin.c -HANGULIN_OBJ = hangulin.obj -.ENDIF -.ENDIF - .IFDEF VIM_MZSCHEME # MZSCHEME related setup MZSCH_DEF = ,"FEAT_MZSCHEME" -MZSCH_SRC = if_mzsch.c +MZSCH_SRC = if_mzsch.c MZSCH_OBJ = if_mzsch.obj .ENDIF @@ -270,7 +268,7 @@ ICONV_DEF = ,"USE_ICONV" # XDIFF related setup. XDIFF_SRC = xdiffi.c,xemit.c,xprepare.c,xutils.c,xhistogram.c,xpatience.c -XDIFF_OBJ = xdiffi.obj,xemit.obj,xprepare.obj,xutils.obj,xhistogram.obj,xpatience.obj +XDIFF_OBJ = xdiffi.obj,xemit.obj,xprepare.obj,xutils.obj,xhistogram.obj,xpatience.obj XDIFF_INC = ,[.xdiff] ###################################################################### @@ -287,27 +285,28 @@ VIMHOST = "''F$TRNLNM("SYS$NODE")'''F$TRNLNM("UCX$INET_HOST")'.''F$TRNLNM("UCX$I .SUFFIXES : .obj .c ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) - - $(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF) - + $(TCL_DEF)$(RUBY_DEF)$(LUA_DEF)$(XIM_DEF)$(TAG_DEF)$(MZSCH_DEF) - $(ICONV_DEF)) - $(CFLAGS)$(GUI_FLAG) - /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC) - $(TCL_INC)$(XDIFF_INC)$(XPM_INC)) # CFLAGS displayed in :ver information -# It is specially formated for correct display of unix like includes +# It is specially formatted for correct display of unix like includes # as $(GUI_INC) - replaced with $(GUI_INC_VER) # Otherwise should not be any other difference. ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) - - $(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF) - + $(TCL_DEF)$(RUBY_DEF)$(LUA_DEF)$(XIM_DEF)$(TAG_DEF)$(MZSCH_DEF) - $(ICONV_DEF)) - $(CFLAGS)$(GUI_FLAG) - /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC) - $(TCL_INC)$(XDIFF_INC)$(XPM_INC)) -ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \ - $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(RUBY_LIB) +ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) $(XPM_LIB)\ + $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(RUBY_LIB) $(LUA_LIB) SRC = \ + alloc.c \ arabic.c \ arglist.c \ autocmd.c \ @@ -319,6 +318,8 @@ SRC = \ change.c \ charset.c \ cindent.c \ + clientserver.c \ + clipboard.c \ cmdexpand.c \ cmdhist.c \ crypt.c \ @@ -343,10 +344,13 @@ SRC = \ fileio.c \ filepath.c, \ findfile.c \ + float.c \ fold.c \ getchar.c \ + gui_xim.c \ hardcopy.c \ hashtab.c \ + help.c \ highlight.c \ if_cscope.c \ if_xcmdsrv.c \ @@ -354,9 +358,11 @@ SRC = \ insexpand.c \ json.c \ list.c \ + locale.c \ main.c \ map.c \ mark.c \ + match.c \ mbyte.c \ memfile.c \ memline.c \ @@ -388,17 +394,29 @@ SRC = \ spell.c \ spellfile.c \ spellsuggest.c \ + strings.c \ syntax.c \ tag.c \ term.c \ termlib.c \ testing.c \ + textformat.c \ + textobject.c \ textprop.c \ + time.c \ + typval.c \ ui.c \ undo.c \ usercmd.c \ userfunc.c \ version.c \ + vim9cmds.c \ + vim9compile.c \ + vim9execute.c \ + vim9expr.c \ + vim9instr.c \ + vim9script.c \ + vim9type.c \ viminfo.c \ window.c \ $(GUI_SRC) \ @@ -406,11 +424,12 @@ SRC = \ $(PYTHON_SRC) \ $(TCL_SRC) \ $(RUBY_SRC) \ - $(HANGULIN_SRC) \ + $(LUA_SRC) \ $(MZSCH_SRC) \ $(XDIFF_SRC) OBJ = \ + alloc.obj \ arabic.obj \ arglist.obj \ autocmd.obj \ @@ -422,6 +441,8 @@ OBJ = \ change.obj \ charset.obj \ cindent.obj \ + clientserver.obj \ + clipboard.obj \ cmdexpand.obj \ cmdhist.obj \ crypt.obj \ @@ -446,10 +467,13 @@ OBJ = \ fileio.obj \ filepath.obj \ findfile.obj \ + float.obj \ fold.obj \ getchar.obj \ + gui_xim.obj \ hardcopy.obj \ hashtab.obj \ + help.obj \ highlight.obj \ if_cscope.obj \ if_mzsch.obj \ @@ -458,9 +482,11 @@ OBJ = \ insexpand.obj \ json.obj \ list.obj \ + locale.obj \ main.obj \ map.obj \ mark.obj \ + match.obj \ mbyte.obj \ memfile.obj \ memline.obj \ @@ -492,17 +518,29 @@ OBJ = \ spell.obj \ spellfile.obj \ spellsuggest.obj \ + strings.obj \ syntax.obj \ tag.obj \ term.obj \ termlib.obj \ testing.obj \ + textformat.obj \ + textobject.obj \ textprop.obj \ + time.obj \ + typval.obj \ ui.obj \ undo.obj \ usercmd.obj \ userfunc.obj \ version.obj \ + vim9cmds.obj \ + vim9compile.obj \ + vim9execute.obj \ + vim9expr.obj \ + vim9instr.obj \ + vim9script.obj \ + vim9type.obj \ viminfo.obj \ window.obj \ $(GUI_OBJ) \ @@ -510,12 +548,12 @@ OBJ = \ $(PYTHON_OBJ) \ $(TCL_OBJ) \ $(RUBY_OBJ) \ - $(HANGULIN_OBJ) \ + $(LUA_OBJ) \ $(MZSCH_OBJ) \ $(XDIFF_OBJ) # Default target is making the executable -all : [.auto]config.h mmk_compat motif_env gtk_env perl_env python_env tcl_env ruby_env $(TARGET) +all : [.auto]config.h mmk_compat motif_env gtk_env perl_env python_env tcl_env ruby_env lua_env $(TARGET) ! $@ [.auto]config.h : $(CONFIG_H) @@ -533,10 +571,13 @@ clean : -@ if "''F$SEARCH("pathdef.c")'" .NES. "" then delete/noconfirm/nolog pathdef.c;* -@ if "''F$SEARCH("if_perl.c")'" .NES. "" then delete/noconfirm/nolog if_perl.c;* -@ if "''F$SEARCH("*.opt")'" .NES. "" then delete/noconfirm/nolog *.opt;* + -@ if "''F$SEARCH("*.dmp")'" .NES. "" then delete/noconfirm/nolog *.dmp;* # Link the target $(TARGET) : $(OBJ) - $(LD_DEF) $(LDFLAGS) /exe=$(TARGET) $+ $(ALL_LIBS) +# make an OPT file - as the obj file list is too long for one command line + -@ DIRECTORY *.OBJ. /BRIEF/COLUMNS=1/NOHEADING/NOTRAILING /SELECT=FILE=(NONODE,NODEVICE,NODIRECTORY,NOVERSION)/OUTPUT=ALL_OBJS_LIST.OPT + $(LD_DEF) $(LDFLAGS) /exe=$(TARGET) ALL_OBJS_LIST.OPT/OPT $(ALL_LIBS) .c.obj : $(CC_DEF) $(ALL_CFLAGS) $< @@ -551,7 +592,7 @@ pathdef.c : check_ccver $(CONFIG_H) -@ write pd "char_u *default_vim_dir = (char_u *)"$(VIMLOC)";" -@ write pd "char_u *default_vimruntime_dir = (char_u *)"$(VIMRUN)";" -@ write pd "char_u *all_cflags = (char_u *)""$(CC_DEF)$(ALL_CFLAGS_VER)"";" - -@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) *.OBJ $(ALL_LIBS)"";" + -@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) ALL_OBJS_LIST.OPT/OPT $(ALL_LIBS)"";" -@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";" -@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";" -@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";" @@ -559,8 +600,7 @@ pathdef.c : check_ccver $(CONFIG_H) -@ close pd if_perl.c : if_perl.xs - -@ $(PERL) PERL_ROOT:[LIB.ExtUtils]xsubpp -prototypes -typemap - - PERL_ROOT:[LIB.ExtUtils]typemap if_perl.xs >> $@ + -@ $(PERL) PERL_ROOT:[LIB.ExtUtils]xsubpp -prototypes -typemap - PERL_ROOT:[LIB.ExtUtils]typemap if_perl.xs >> $@ make_vms.mms : -@ write sys$output "The name of the makefile MUST be !!!" @@ -585,6 +625,18 @@ check_ccver : motif_env : .IFDEF XPM -@ write sys$output "using DECW/Motif/XPM environment." + -@ write sys$output "creating OS_VMS_XPM.OPT file." + -@ open/write opt_file OS_VMS_XPM.OPT +.IFDEF MMSVAX + -@ write opt_file "[.xpm.vms.vax]libxpm.olb/lib" +.ENDIF +.IFDEF MMSALPHA + -@ write opt_file "[.xpm.vms.axp]libxpm.olb/lib" +.ENDIF +.IFDEF MMSIA64 + -@ write opt_file "[.xpm.vms.ia64]libxpm.olb/lib" +.ENDIF + -@ close opt_file .ELSE -@ write sys$output "using DECW/Motif environment." .ENDIF @@ -681,368 +733,452 @@ ruby_env : -@ ! .ENDIF +.IFDEF VIM_LUA +lua_env : + -@ write sys$output "using LUA environment:" + -@ write sys$output " include path: ""$(LUA_INC)""" + -@ write sys$output "creating OS_VMS_LUA.OPT file." + -@ open/write opt_file OS_VMS_LUA.OPT + -@ write opt_file "LUA$ROOT:[LIB]LUA$SHR.EXE /share" + -@ close opt_file +.ELSE +lua_env : + -@ ! +.ENDIF + +alloc.obj : alloc.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h arabic.obj : arabic.c vim.h arglist.obj : arglist.c vim.h [.auto]config.h feature.h os_unix.h autocmd.obj : autocmd.c vim.h [.auto]config.h feature.h os_unix.h blowfish.obj : blowfish.c vim.h [.auto]config.h feature.h os_unix.h -blob.obj : blob.c vim.h [.auto]config.h feature.h os_unix.h +blob.obj : blob.c vim.h [.auto]config.h feature.h os_unix.h buffer.obj : buffer.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h bufwrite.obj : bufwrite.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h change.obj : change.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h charset.obj : charset.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h cindent.obj : cindent.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h +clientserver.obj : clientserver.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h +clipboard.obj : clipboard.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h cmdexpand.obj : cmdexpand.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h cmdhist.obj : cmdhist.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h crypt.obj : crypt.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ - globals.h + errors.h globals.h crypt_zip.obj : crypt_zip.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h + proto.h errors.h globals.h debugger.obj : debugger.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h dict.obj : dict.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ - globals.h + errors.h globals.h diff.obj : diff.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h digraph.obj : digraph.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h drawline.obj : drawline.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h drawscreen.obj : drawscreen.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h edit.obj : edit.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h eval.obj : eval.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h \ - version.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h evalbuffer.obj : evalbuffer.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + proto.h errors.h globals.h evalfunc.obj : evalfunc.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + proto.h errors.h globals.h version.h evalvars.obj : evalvars.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + proto.h errors.h globals.h version.h evalwindow.obj : evalwindow.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + proto.h errors.h globals.h ex_cmds.obj : ex_cmds.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h ex_cmds2.obj : ex_cmds2.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h ex_docmd.obj : ex_docmd.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h ex_cmdidxs.h ex_eval.obj : ex_eval.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h ex_getln.obj : ex_getln.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h fileio.obj : fileio.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h filepath.obj : filepath.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h findfile.obj : findfile.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h +float.obj : float.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h fold.obj : fold.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h getchar.obj : getchar.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h +gui_xim.obj : gui_xim.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h hardcopy.obj : hardcopy.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h version.h hashtab.obj : hashtab.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h +help.obj : help.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h highlight.obj : highlight.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h if_cscope.obj : if_cscope.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h if_cscope.h + errors.h globals.h if_xcmdsrv.obj : if_xcmdsrv.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h if_mzsch.obj : if_mzsch.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro ex_cmds.h proto.h \ - globals.h if_mzsch.h + errors.h globals.h if_mzsch.h indent.obj : indent.c vim.h [.auto]config.h feature.h os_unix.h insexpand.obj : insexpand.c vim.h [.auto]config.h feature.h os_unix.h json.obj : json.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h \ - version.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h list.obj : list.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ + beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ + errors.h globals.h +locale.obj : locale.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ - globals.h + errors.h globals.h main.obj : main.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h \ arabic.c map.obj : map.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h mark.obj : mark.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h +match.obj : match.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h memfile.obj : memfile.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h memline.obj : memline.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h menu.obj : menu.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h message.obj : message.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h misc1.obj : misc1.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h \ version.h misc2.obj : misc2.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h mouse.obj : mouse.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h move.obj : move.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h mbyte.obj : mbyte.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h normal.obj : normal.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h nv_cmdidxs.h nv_cmds.h ops.obj : ops.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h option.obj : option.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h optiondefs.h + errors.h globals.h optiondefs.h optionstr.obj : optionstr.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h os_unix.obj : os_unix.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h os_unixx.h + errors.h globals.h os_unixx.h os_vms.obj : os_vms.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h os_unixx.h + errors.h globals.h os_unixx.h pathdef.obj : pathdef.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h popupmenu.obj : popupmenu.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h popupwin.obj : popupwin.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h profiler.obj : profiler.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h quickfix.obj : quickfix.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h regexp.obj : regexp.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h register.obj : register.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h scriptfile.obj : scriptfile.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h screen.obj : screen.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h search.obj : search.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h session.obj : session.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h sha256.obj : sha256.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ - globals.h + errors.h globals.h sign.obj : sign.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ - globals.h + errors.h globals.h spell.obj : spell.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h spellfile.obj : spellfile.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h + proto.h errors.h globals.h spellsuggest.obj : spellsuggest.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h + proto.h errors.h globals.h +strings.obj : strings.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ + regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ + proto.h errors.h globals.h syntax.obj : syntax.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h tag.obj : tag.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h term.obj : term.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h termlib.obj : termlib.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h testing.obj : testing.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h +textformat.obj : textformat.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h +textobject.obj : textobject.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h textprop.obj : textprop.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h +time.obj : time.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h +typval.obj : typval.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h ui.obj : ui.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h undo.obj : undo.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h usercmd.obj : usercmd.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h + proto.h errors.h globals.h userfunc.obj : userfunc.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h option.h structs.h \ + ascii.h keymap.h termdefs.h macros.h option.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \ - proto.h globals.h + proto.h errors.h globals.h version.obj : version.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h viminfo.obj : viminfo.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h +vim9cmds.obj : vim9cmds.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h +vim9compile.obj : vim9compile.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h +vim9execute.obj : vim9execute.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h +vim9expr.obj : vim9expr.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h +vim9instr.obj : vim9instr.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h +vim9script.obj : vim9script.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h +vim9type.obj : vim9type.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h window.obj : window.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h gui.obj : gui.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h gui_gtk.obj : gui_gtk.c gui_gtk_f.h vim.h [.auto]config.h feature.h \ - os_unix.h ascii.h keymap.h term.h macros.h structs.h \ + os_unix.h ascii.h keymap.h termdefs.h macros.h structs.h \ regexp.h gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h \ - proto.h globals.h [-.pixmaps]stock_icons.h + proto.h errors.h globals.h [-.pixmaps]stock_icons.h gui_gtk_f.obj : gui_gtk_f.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h gui_gtk_f.h + errors.h globals.h gui_gtk_f.h gui_motif.obj : gui_motif.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h [-.pixmaps]alert.xpm [-.pixmaps]error.xpm \ + errors.h globals.h [-.pixmaps]alert.xpm [-.pixmaps]error.xpm \ [-.pixmaps]generic.xpm [-.pixmaps]info.xpm [-.pixmaps]quest.xpm gui_athena.obj : gui_athena.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h gui_at_sb.h + errors.h globals.h gui_at_sb.h gui_gtk_x11.obj : gui_gtk_x11.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h gui_gtk_f.h [-.runtime]vim32x32.xpm \ - [-.runtime]vim16x16.xpm [-.runtime]vim48x48.xpm + errors.h globals.h gui_gtk_f.h [-.runtime]vim32x32.xpm \ + [-.runtime]vim16x16.xpm [-.runtime]vim48x48.xpm version.h gui_x11.obj : gui_x11.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h [-.runtime]vim32x32.xpm \ + errors.h globals.h [-.runtime]vim32x32.xpm \ [-.runtime]vim16x16.xpm [-.runtime]vim48x48.xpm [-.pixmaps]tb_new.xpm \ [-.pixmaps]tb_open.xpm [-.pixmaps]tb_close.xpm [-.pixmaps]tb_save.xpm \ [-.pixmaps]tb_print.xpm [-.pixmaps]tb_cut.xpm [-.pixmaps]tb_copy.xpm \ @@ -1060,61 +1196,50 @@ gui_x11.obj : gui_x11.c vim.h [.auto]config.h feature.h os_unix.h \ [-.pixmaps]tb_vsplit.xpm [-.pixmaps]tb_maxwidth.xpm \ [-.pixmaps]tb_minwidth.xpm gui_at_sb.obj : gui_at_sb.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h gui_at_sb.h + errors.h globals.h gui_at_sb.h gui_at_fs.obj : gui_at_fs.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h gui_at_sb.h + errors.h globals.h gui_at_sb.h pty.obj : pty.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \ - [.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h -hangulin.obj : hangulin.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ - gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h if_perl.obj : [.auto]if_perl.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h if_perlsfio.obj : if_perlsfio.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h if_python.obj : if_python.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h if_tcl.obj : if_tcl.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h if_ruby.obj : if_ruby.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h +if_lua.obj : if_lua.c vim.h [.auto]config.h feature.h os_unix.h \ + errors.h globals.h version.h beval.obj : beval.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h option.h ex_cmds.h proto.h \ - globals.h + errors.h globals.h gui_beval.obj : gui_beval.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ - gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h -workshop.obj : workshop.c [.auto]config.h integration.h vim.h feature.h \ - os_unix.h ascii.h keymap.h term.h macros.h structs.h \ - regexp.h gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h \ - proto.h globals.h version.h workshop.h -wsdebug.obj : wsdebug.c -integration.obj : integration.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h integration.h + errors.h globals.h netbeans.obj : netbeans.c vim.h [.auto]config.h feature.h os_unix.h \ - ascii.h keymap.h term.h macros.h structs.h regexp.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ - globals.h version.h + errors.h globals.h version.h gui_xmdlg.obj : gui_xmdlg.c [.auto]config.h vim.h feature.h os_unix.h gui_xmebw.obj : gui_xmebw.c [.auto]config.h vim.h feature.h os_unix.h xdiffi.obj : [.xdiff]xdiffi.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h @@ -1122,4 +1247,4 @@ xemit.obj : [.xdiff]xemit.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h o xprepare.obj : [.xdiff]xprepare.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h xutils.obj : [.xdiff]xutils.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h xhistogram.obj : [.xdiff]xhistogram.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h -xpatience.obj : [.xdiff]xpatience.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h +xpatience.obj : [.xdiff]xpatience.c [.xdiff]xinclude.h [.auto]config.h vim.h feature.h os_unix.h diff --git a/src/Makefile b/src/Makefile index 90390e03352cc..b33b2a207248d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,8 +21,8 @@ # the first column of a line is removed. # - If you want a version of Vim that is small and starts up quickly, # you might want to disable the GUI, X11, Perl, Python and Tcl. -# - Uncomment the line with --disable-gui if you have Motif, GTK and/or -# Athena but don't want to make gvim (the GUI version of Vim with nice +# - Uncomment the line with --disable-gui if you have Motif and/or GTK +# but don't want to make gvim (the GUI version of Vim with nice # menus and scrollbars, but makes Vim bigger and startup slower). # - Uncomment --disable-darwin if on Mac OS X but you want to compile a # Unix version. @@ -182,10 +182,7 @@ #Irix 6.5 cc ? 6.0 (S) David Harrison #Irix 64 bit 4.5 (K) Jon Wright #Linux 2.0 gcc-2.7.2 Infomagic Motif 4.3 (3) Ronald Rietman -#Linux 2.0.31 gcc +X11 +GUI Athena 5.0w (U) Darren Hiebert -#LynxOS 3.0.1 2.9-gnupro-98r2 +X11 +GUI Athena 5.7.1(O) Lorenz Hahn -#LynxOS 3.1.0 2.9-gnupro-98r2 +X11 +GUI Athena 5.7.1(O) Lorenz Hahn -#NEC UP4800 UNIX_SV 4.2MP cc +X11R6 Motif,Athena4.6b (Q) Lennart Schultz +#NEC UP4800 UNIX_SV 4.2MP cc +X11R6 Motif 4.6b (Q) Lennart Schultz #NetBSD 1.0A gcc-2.4.5 -X11 -GUI 3.21 (X) Juergen Weigert #QNX 4.2 wcc386-10.6 -X11 4.2 (D) G.F. Desrochers #QNX 4.23 Watcom -X11 4.2 (F) John Oleynick @@ -199,18 +196,15 @@ #Solaris 2.4 (Sparc) cc +X11 +GUI 3.29 (9) Glauber #Solaris 2.4/2.5 clcc +X11 -GUI openwin 3.20 (7) Robert Colon #Solaris 2.5 (sun4m) cc (SC4.0) +X11R6 +GUI (CDE) 4.6b (E) Andrew Large -#Solaris 2.5 cc +X11 +GUI Athena 4.2 (9) Sonia Heimann #Solaris 2.5 gcc 2.5.6 +X11 Motif 5.0m (R) Ant. Colombo #Solaris 2.6 gcc 2.8.1 ncurses 5.3 (G) Larry W. Virden #Solaris with -lthread 5.5 (W) K. Nagano #Solaris gcc (b) Riccardo #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar -#SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert -#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz +#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif 4.6b (P) Lennart Schultz #Tandem/NSK (c) Matthew Woehlke #Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro #ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst -#Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar # }}} # (*) Remarks: {{{ @@ -329,7 +323,7 @@ CClink = $(CC) # GUI - For creating Vim with GUI (gvim) (B) # Uncomment this line when you don't want to get the GUI version, although you -# have GTK, Motif and/or Athena. Also use --without-x if you don't want X11 +# have GTK and/or Motif. Also use --without-x if you don't want X11 # at all. #CONF_OPT_GUI = --disable-gui @@ -343,12 +337,10 @@ CClink = $(CC) #CONF_OPT_GUI = --enable-gnome-check #CONF_OPT_GUI = --disable-gtk3-check #CONF_OPT_GUI = --disable-motif-check -#CONF_OPT_GUI = --disable-athena-check -#CONF_OPT_GUI = --disable-nextaw-check # Uncomment one of these lines to select a specific GUI to use. # When using "yes" or nothing, configure will use the first one found: GTK+, -# Motif or Athena. +# or Motif. # # GTK versions that are known not to work 100% are rejected. # Use "--disable-gtktest" to accept them anyway. @@ -372,11 +364,6 @@ CClink = $(CC) #CONF_OPT_GUI = --enable-gui=gtk3 --disable-gtktest #CONF_OPT_GUI = --enable-gui=motif #CONF_OPT_GUI = --enable-gui=motif --with-motif-lib="-static -lXm -shared" -#CONF_OPT_GUI = --enable-gui=athena -#CONF_OPT_GUI = --enable-gui=nextaw - -# Carbon GUI for Mac OS X -#CONF_OPT_GUI = --enable-gui=carbon # Uncomment this line to run an individual test with gvim. #GUI_TESTARG = GUI_FLAG=-g @@ -389,7 +376,8 @@ CClink = $(CC) # Select the architecture supported. Default is to build for the current # platform. Use "both" for a universal binary. That probably doesn't work # when including Perl, Python, etc. -#CONF_OPT_DARWIN = --with-mac-arch=i386 +# NOTE: ppc probably doesn't work anymore, +#CONF_OPT_DARWIN = --with-mac-arch=intel #CONF_OPT_DARWIN = --with-mac-arch=ppc #CONF_OPT_DARWIN = --with-mac-arch=both @@ -401,6 +389,8 @@ CClink = $(CC) # LUA # Uncomment one of these when you want to include the Lua interface. # First one is for static linking, second one for dynamic loading. +# Debian package is "lua5.3" and "liblua5.3-dev" or "lua5.4" and +# "liblua5.4-dev". # Use --with-luajit if you want to use LuaJIT instead of Lua. # Set PATH environment variable to find lua or luajit executable. # This requires at least "normal" features, "tiny" and "small" don't work. @@ -413,9 +403,11 @@ CClink = $(CC) # MZSCHEME # Uncomment this when you want to include the MzScheme interface. +# You may have to build racket from source to make this work. # NOTE: does not work well together with valgrind. #CONF_OPT_MZSCHEME = --enable-mzschemeinterp # PLT/mrscheme/drscheme Home dir; the PLTHOME environment variable also works +#CONF_OPT_PLTHOME = --with-plthome=/usr/local #CONF_OPT_PLTHOME = --with-plthome=/usr/local/plt #CONF_OPT_PLTHOME = --with-plthome=/usr/local/drscheme #CONF_OPT_PLTHOME = --with-plthome=/home/me/mz @@ -423,8 +415,8 @@ CClink = $(CC) # PERL # Uncomment one of these when you want to include the Perl interface. # First one is for static linking, second one for dynamic loading. +# Debian package is "libperl-dev" # The Perl option sometimes causes problems, because it adds extra flags -# # to the command line. If you see strange flags during compilation, check in # auto/config.mk where they come from. If it's PERL_CFLAGS, try commenting # the next line. @@ -436,7 +428,10 @@ CClink = $(CC) # PYTHON # Uncomment lines here when you want to include the Python interface. +# Debian package is "libpython3-dev". # This requires at least "normal" features, "tiny" and "small" don't work. +# Python 3 is preferred, Python 2 (often referred to as "Python") has been +# deprecated for a long time. # NOTE: This may cause threading to be enabled, which has side effects (such # as using different libraries and debugging becomes more difficult). # For Python3 support make a symbolic link in /usr/local/bin: @@ -455,7 +450,7 @@ CClink = $(CC) # RUBY # Uncomment this when you want to include the Ruby interface. # First one for static linking, second one for loading when used. -# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu). +# Debian package is "ruby-dev". # This requires at least "normal" features, "tiny" and "small" don't work. #CONF_OPT_RUBY = --enable-rubyinterp #CONF_OPT_RUBY = --enable-rubyinterp=dynamic @@ -464,6 +459,7 @@ CClink = $(CC) # TCL # Uncomment this when you want to include the Tcl interface. # First one is for static linking, second one for dynamic loading. +# Debian package is "tcl-dev". #CONF_OPT_TCL = --enable-tclinterp #CONF_OPT_TCL = --enable-tclinterp=dynamic #CONF_OPT_TCL = --enable-tclinterp --with-tclsh=tclsh8.4 @@ -504,11 +500,8 @@ CClink = $(CC) # XIM - X Input Method. Special character input support for X11 (Chinese, # Japanese, special symbols, etc). Also needed for dead-key support. # When omitted it's automatically enabled for the X-windows GUI. -# HANGUL - Input Hangul (Korean) language using internal routines. -# Uncomment one of these when you want to input a multibyte language. #CONF_OPT_INPUT = --enable-xim #CONF_OPT_INPUT = --disable-xim -#CONF_OPT_INPUT = --enable-hangulinput # FONTSET - X fontset support for output of languages with many characters. # Uncomment this when you want to output a multibyte language. @@ -523,6 +516,8 @@ CClink = $(CC) # though you have gpm libraries and includes. # For Debian/Ubuntu gpm support requires the libgpm-dev package. #CONF_OPT_GPM = --disable-gpm +# Use this to enable dynamic loading of the GPM library. +#CONF_OPT_GPM = --enable-gpm=dynamic # sysmouse - For mouse support on FreeBSD and DragonFly console via sysmouse # Uncomment this when you do not want do include sysmouse support, even @@ -534,6 +529,10 @@ CClink = $(CC) # CONF_OPT_CANBERRA = --enable-canberra # CONF_OPT_CANBERRA = --disable-canberra +# libsodium - For enhanced encryption. Default is on. +# Uncomment the next line to not use libsodium +# CONF_OPT_SODIUM = --disable-libsodium + # FEATURES - For creating Vim with more or less features # Uncomment one of these lines when you want to include few to many features. # The default is "huge" for most systems. @@ -614,12 +613,13 @@ CClink = $(CC) # Use this with GCC to check for mistakes, unused arguments, etc. # Note: If you use -Wextra and get warnings in GTK code about function -# parameters, you can add -Wno-cast-function-type -#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-cast-function-type -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 +# parameters, you can add -Wno-cast-function-type (but not with clang) +#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-cast-function-type -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 +#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 # Add -Wpedantic to find // comments and other C99 constructs. # Better disable Perl and Python to avoid a lot of warnings. #CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wunused-result -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -#CFLAGS = -g -O2 -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wunused-result -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 +#CFLAGS = -g -O2 -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wno-cast-function-type -Wunused-result -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 #PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter @@ -687,16 +687,31 @@ LINT_OPTIONS = -beprxzF # 7. Open the objects/index.html file in a web browser to view the coverage # information. # -# PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage # LDFLAGS=--coverage +# PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage -DWE_ARE_PROFILING -DUSE_GCOV_FLUSH +# Alternate flags +# PROFILE_CFLAGS=-g -O0 --coverage -DWE_ARE_PROFILING -DUSE_GCOV_FLUSH -# Uncomment one of the next two lines to compile Vim with the -# address sanitizer or with the undefined sanitizer. Works with gcc and -# clang. May make Vim twice as slow. Errors reported on stderr. +# Uncomment the next lines to compile Vim with the address sanitizer (asan) and +# with the undefined sanitizer. Works with gcc. +# You should also use -DEXITFREE to avoid false reports. +# May make Vim twice as slow. Errors are reported on stderr. # More at: https://code.google.com/p/address-sanitizer/ -#SANITIZER_CFLAGS = -g -O0 -fsanitize=address -fno-omit-frame-pointer -#SANITIZER_CFLAGS = -g -O0 -fsanitize=undefined -fno-omit-frame-pointer +# Useful environment variables: +# $ export ASAN_OPTIONS="print_stacktrace=1 log_path=asan" +# $ export LSAN_OPTIONS="suppressions=`pwd`/testdir/lsan-suppress.txt" +# When running tests output can be found in testdir/asan.* +#SANITIZER_CFLAGS = -g -O0 -fsanitize-recover=all \ +# -fsanitize=address -fsanitize=undefined \ +# -fno-omit-frame-pointer + +# Similarly when compiling with clang and using ubsan. +# $ export UBSAN_OPTIONS="print_stacktrace=1 log_path=ubsan" +# $ export LSAN_OPTIONS="suppressions=`pwd`/testdir/lsan-suppress.txt" +# When running tests output can be found in testdir/ubsan.* +#SANITIZER_CFLAGS = -g -O0 -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer + SANITIZER_LIBS = $(SANITIZER_CFLAGS) # MEMORY LEAK DETECTION @@ -711,9 +726,9 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS) # detected. Useful when using a tool to find errors. #ABORT_CFLAGS = -DABORT_ON_INTERNAL_ERROR -##################################################### -### Specific systems, check if yours is listed! ### {{{ -##################################################### +#################################################### +### Specific systems, check if yours is listed ### {{{ +#################################################### ### Uncomment things here only if the values chosen by configure are wrong. ### It's better to adjust configure.ac and "make autoconf", if you can! @@ -763,22 +778,11 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS) # needed to avoid a problem where strings.h gets included #CFLAGS = -qsrcmsg -O2 -qmaxmem=8192 -D__STR31__ -### (W) Solaris with multi-threaded libraries (-lthread): -### If suspending doesn't work properly, try using this line: -#EXTRA_DEFS = -D_REENTRANT - ### (7) Solaris 2.4/2.5 with Centerline compiler #CC = clcc #X_LIBS_DIR = -L/usr/openwin/lib -R/usr/openwin/lib #CFLAGS = -O -### (9) Solaris 2.x with cc (SunPro), using Athena. -### Only required for compiling gui_at_sb.c. -### Symptom: "identifier redeclared: vim_XawScrollbarSetThumb" -### Use one of the lines (either Full ANSI or no ANSI at all) -#CFLAGS = $(CFLAGS) -Xc -#CFLAGS = $(CFLAGS) -Xs - ### Solaris 2.3 with X11 and specific cc #CC=/opt/SUNWspro/bin/cc -O -Xa -v -R/usr/openwin/lib @@ -969,7 +973,7 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS) # The value of QUOTESED comes from auto/config.mk. # Uncomment the next line to use the default value. -# QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/' +# QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/' -e 's/ */ /g' ##################### end of system specific lines ################### }}} @@ -1036,7 +1040,7 @@ MAN1DIR = /man1 ### Vim version (adjusted by a script) VIMMAJOR = 8 -VIMMINOR = 1 +VIMMINOR = 2 ### Location of Vim files (should not need to be changed, and {{{1 ### some things might not work when they are changed!) @@ -1047,6 +1051,7 @@ COLSUBDIR = /colors SYNSUBDIR = /syntax INDSUBDIR = /indent AUTOSUBDIR = /autoload +IMPORTSUBDIR = /import PLUGSUBDIR = /plugin FTPLUGSUBDIR = /ftplugin LANGSUBDIR = /lang @@ -1069,6 +1074,7 @@ PODIR = po ### SYNSUBLOC location for syntax files ### INDSUBLOC location for indent files ### AUTOSUBLOC location for standard autoload files +### IMPORTSUBLOC location for standard import files ### PLUGSUBLOC location for standard plugin files ### FTPLUGSUBLOC location for ftplugin files ### LANGSUBLOC location for language files @@ -1091,6 +1097,7 @@ COLSUBLOC = $(VIMRTLOC)$(COLSUBDIR) SYNSUBLOC = $(VIMRTLOC)$(SYNSUBDIR) INDSUBLOC = $(VIMRTLOC)$(INDSUBDIR) AUTOSUBLOC = $(VIMRTLOC)$(AUTOSUBDIR) +IMPORTSUBLOC = $(VIMRTLOC)$(IMPORTSUBDIR) PLUGSUBLOC = $(VIMRTLOC)$(PLUGSUBDIR) FTPLUGSUBLOC = $(VIMRTLOC)$(FTPLUGSUBDIR) LANGSUBLOC = $(VIMRTLOC)$(LANGSUBDIR) @@ -1121,9 +1128,6 @@ SYS_DELMENU_FILE = $(DESTDIR)$(SCRIPTLOC)/delmenu.vim ### Name of the bugreport file target. SYS_BUGR_FILE = $(DESTDIR)$(SCRIPTLOC)/bugreport.vim -### Name of the rgb.txt file target. -SYS_RGB_FILE = $(DESTDIR)$(SCRIPTLOC)/rgb.txt - ### Name of the file type detection file target. SYS_FILETYPE_FILE = $(DESTDIR)$(SCRIPTLOC)/filetype.vim @@ -1198,6 +1202,9 @@ INDSOURCE = ../runtime/indent # Where to copy the standard plugin files from AUTOSOURCE = ../runtime/autoload +# Where to copy the standard import files from +IMPORTSOURCE = ../runtime/import + # Where to copy the standard plugin files from PLUGSOURCE = ../runtime/plugin @@ -1243,8 +1250,8 @@ LINKIT = @echo >/dev/null ### 'configure --enable-gui' can enable one of these for you if you did set ### a corresponding CONF_OPT_GUI above and have X11. ### Override configures choice by uncommenting all the following lines. -### As they are, the GUI is disabled. Replace "NONE" with "ATHENA" or "MOTIF" -### for enabling the Athena or Motif GUI. +### As they are, the GUI is disabled. Replace "NONE" with "MOTIF" +### for enabling the Motif GUI. #GUI_SRC = $(NONE_SRC) #GUI_OBJ = $(NONE_OBJ) #GUI_DEFS = $(NONE_DEFS) @@ -1295,54 +1302,6 @@ MOTIF_MAN_TARGETS = yes MOTIF_TESTTARGET = gui MOTIF_BUNDLE = -### Athena GUI -### Use Xaw3d to make the menus look a little bit nicer -#XAW_LIB = -lXaw3d -XAW_LIB = -lXaw - -### When using Xaw3d, uncomment/comment the following lines to also get the -### scrollbars from Xaw3d. -#ATHENA_SRC = gui.c gui_athena.c gui_x11.c gui_beval.c gui_at_fs.c -#ATHENA_OBJ = objects/gui.o objects/gui_athena.o objects/gui_x11.o \ -# objects/gui_beval.o objects/gui_at_fs.o -#ATHENA_DEFS = -DFEAT_GUI_ATHENA $(NARROW_PROTO) \ -# -Dvim_scrollbarWidgetClass=scrollbarWidgetClass \ -# -Dvim_XawScrollbarSetThumb=XawScrollbarSetThumb -ATHENA_SRC = gui.c gui_athena.c gui_x11.c gui_beval.c \ - gui_at_sb.c gui_at_fs.c -ATHENA_OBJ = objects/gui.o objects/gui_athena.o objects/gui_x11.o \ - objects/gui_beval.o \ - objects/gui_at_sb.o objects/gui_at_fs.o -ATHENA_DEFS = -DFEAT_GUI_ATHENA $(NARROW_PROTO) - -ATHENA_IPATH = $(GUI_INC_LOC) -ATHENA_LIBS_DIR = $(GUI_LIB_LOC) -ATHENA_LIBS1 = $(XAW_LIB) -ATHENA_LIBS2 = -lXt -ATHENA_INSTALL = install_normal install_gui_extra -ATHENA_TARGETS = installglinks -ATHENA_MAN_TARGETS = yes -ATHENA_TESTTARGET = gui -ATHENA_BUNDLE = - -### neXtaw GUI -NEXTAW_LIB = -lneXtaw - -NEXTAW_SRC = gui.c gui_athena.c gui_x11.c gui_beval.c gui_at_fs.c -NEXTAW_OBJ = objects/gui.o objects/gui_athena.o objects/gui_x11.o \ - objects/gui_beval.o objects/gui_at_fs.o -NEXTAW_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $(NARROW_PROTO) - -NEXTAW_IPATH = $(GUI_INC_LOC) -NEXTAW_LIBS_DIR = $(GUI_LIB_LOC) -NEXTAW_LIBS1 = $(NEXTAW_LIB) -NEXTAW_LIBS2 = -lXt -NEXTAW_INSTALL = install_normal install_gui_extra -NEXTAW_TARGETS = installglinks -NEXTAW_MAN_TARGETS = yes -NEXTAW_TESTTARGET = gui -NEXTAW_BUNDLE = - ### (J) Sun OpenWindows 3.2 (SunOS 4.1.x) or earlier that produce these ld # errors: ld: Undefined symbol # _get_wmShellWidgetClass @@ -1368,27 +1327,23 @@ PHOTONGUI_MAN_TARGETS = yes PHOTONGUI_TESTTARGET = gui PHOTONGUI_BUNDLE = -# CARBON GUI -CARBONGUI_SRC = gui.c gui_mac.c -CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o -CARBONGUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \ - -Wall -Wno-unknown-pragmas \ - -mdynamic-no-pic -pipe -CARBONGUI_IPATH = -I. -Iproto -CARBONGUI_LIBS_DIR = -CARBONGUI_LIBS1 = -framework Carbon -CARBONGUI_LIBS2 = -CARBONGUI_INSTALL = install_macosx -CARBONGUI_TARGETS = -CARBONGUI_MAN_TARGETS = -CARBONGUI_TESTTARGET = gui -CARBONGUI_BUNDLE = gui_bundle -APPDIR = $(VIMNAME).app -CARBONGUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET) +### Haiku GUI +HAIKUGUI_SRC = gui.c gui_haiku.cc +HAIKUGUI_OBJ = objects/gui.o objects/gui_haiku.o +HAIKUGUI_DEFS = -DFEAT_GUI_HAIKU +HAIKUGUI_IPATH = +HAIKUGUI_LIBS_DIR = +HAIKUGUI_LIBS1 = -lbe -lroot -ltracker -ltranslation -lsupc++ -lstdc++ +HAIKUGUI_LIBS2 = +HAIKUGUI_INSTALL = install_normal install_haiku_extra +HAIKUGUI_TARGETS = installglinks_haiku +HAIKUGUI_MAN_TARGETS = +HAIKUGUI_TESTTARGET = gui +HAIKUGUI_BUNDLE = # All GUI files -ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c -ALL_GUI_PRO = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_athena.pro gui_gtk_x11.pro gui_x11.pro gui_w32.pro gui_photon.pro +ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_gtk_x11.c gui_x11.c gui_haiku.cc +ALL_GUI_PRO = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_gtk_x11.pro gui_x11.pro gui_w32.pro gui_photon.pro # }}} @@ -1444,12 +1399,12 @@ CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \ # -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \ # -D__extension__= -D__restrict="" \ # -D__gnuc_va_list=char -D__builtin_va_list=char - # # This is for cproto 3 patchlevel 9 or above (currently 4.6, 4.7g) # __inline and __attribute__ are now recognized by cproto +# __attribute() is not recognized and used in X11/Intrinsic.h # -D"foo()=" is not supported by all compilers so do not use it -NO_ATTR= +NO_ATTR = -D"__attribute\\(x\\)=" # # Use this for cproto 3 patchlevel 6 or below (use "cproto -V" to check): # PROTO_FLAGS = -f4 -d -E"$(CPP)" $(NO_ATTR) @@ -1479,16 +1434,17 @@ POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(EXTRA_DEFS) ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(ABORT_CFLAGS) $(POST_DEFS) +ALL_IF_CFLAGS = $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) +ALL_IF_CFLAGS_EXTRA = $(LUA_CFLAGS_EXTRA) $(PERL_CFLAGS_EXTRA) $(PYTHON_CFLAGS_EXTRA) $(PYTHON3_CFLAGS_EXTRA) $(RUBY_CFLAGS_EXTRA) $(TCL_CFLAGS_EXTRA) + # Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together # with "-E". OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS) -LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) \ - $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) \ - $(PYTHON3_CFLAGS) $(TCL_CFLAGS) $(VTERM_CFLAGS) \ +LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(ALL_IF_CFLAGS) $(VTERM_CFLAGS) \ -Dinline= -D__extension__= -Dalloca=alloca -LINT_EXTRA = -DHANGUL_INPUT -D"__attribute__(x)=" +LINT_EXTRA = -D"__attribute__(x)=" DEPEND_CFLAGS = -DPROTO -DDEPEND -DFEAT_GUI $(LINT_CFLAGS) @@ -1524,6 +1480,7 @@ DEST_COL = $(DESTDIR)$(COLSUBLOC) DEST_SYN = $(DESTDIR)$(SYNSUBLOC) DEST_IND = $(DESTDIR)$(INDSUBLOC) DEST_AUTO = $(DESTDIR)$(AUTOSUBLOC) +DEST_IMPORT = $(DESTDIR)$(IMPORTSUBLOC) DEST_PLUG = $(DESTDIR)$(PLUGSUBLOC) DEST_FTP = $(DESTDIR)$(FTPLUGSUBLOC) DEST_LANG = $(DESTDIR)$(LANGSUBLOC) @@ -1561,6 +1518,9 @@ DEST_MAN_PL_I = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR) DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR) DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) +DEST_MAN_TR = $(DEST_MAN_TOP)/tr$(MAN1DIR) +DEST_MAN_TR_I = $(DEST_MAN_TOP)/tr.ISO8859-9$(MAN1DIR) +DEST_MAN_TR_U = $(DEST_MAN_TOP)/tr.UTF-8$(MAN1DIR) # stuff common to all systems include Make_all.mak @@ -1576,6 +1536,7 @@ include testdir/Make_all.mak # ALL_SRC: source files used for make depend and make lint BASIC_SRC = \ + alloc.c \ arabic.c \ arglist.c \ autocmd.c \ @@ -1586,6 +1547,8 @@ BASIC_SRC = \ change.c \ charset.c \ cindent.c \ + clientserver.c \ + clipboard.c \ cmdexpand.c \ cmdhist.c \ crypt.c \ @@ -1610,10 +1573,13 @@ BASIC_SRC = \ fileio.c \ filepath.c \ findfile.c \ + float.c \ fold.c \ getchar.c \ + gui_xim.c \ hardcopy.c \ hashtab.c \ + help.c \ highlight.c \ if_cscope.c \ if_xcmdsrv.c \ @@ -1621,9 +1587,12 @@ BASIC_SRC = \ insexpand.c \ json.c \ list.c \ + locale.c \ main.c \ map.c \ mark.c \ + match.c \ + mbyte.c \ memfile.c \ memline.c \ menu.c \ @@ -1632,7 +1601,6 @@ BASIC_SRC = \ misc2.c \ mouse.c \ move.c \ - mbyte.c \ normal.c \ ops.c \ option.c \ @@ -1646,8 +1614,8 @@ BASIC_SRC = \ quickfix.c \ regexp.c \ register.c \ - scriptfile.c \ screen.c \ + scriptfile.c \ search.c \ session.c \ sha256.c \ @@ -1656,17 +1624,29 @@ BASIC_SRC = \ spell.c \ spellfile.c \ spellsuggest.c \ + strings.c \ syntax.c \ tag.c \ term.c \ terminal.c \ testing.c \ + textformat.c \ + textobject.c \ textprop.c \ + time.c \ + typval.c \ ui.c \ undo.c \ usercmd.c \ userfunc.c \ version.c \ + vim9cmds.c \ + vim9compile.c \ + vim9execute.c \ + vim9expr.c \ + vim9instr.c \ + vim9script.c \ + vim9type.c \ viminfo.c \ window.c \ bufwrite.c \ @@ -1676,7 +1656,6 @@ SRC = $(BASIC_SRC) \ $(GUI_SRC) \ $(TERM_SRC) \ $(XDIFF_SRC) \ - $(HANGULIN_SRC) \ $(LUA_SRC) \ $(MZSCHEME_SRC) \ $(PERL_SRC) \ @@ -1684,9 +1663,9 @@ SRC = $(BASIC_SRC) \ $(TCL_SRC) \ $(RUBY_SRC) -EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \ +EXTRA_SRC = if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \ if_python.c if_python3.c if_tcl.c if_ruby.c \ - gui_beval.c netbeans.c channel.c \ + gui_beval.c netbeans.c job.c channel.c \ $(GRESOURCE_SRC) # Unittest files @@ -1704,13 +1683,13 @@ UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(KWORD_TEST_TARGET) $(MEMFILE_TEST_TARGE RUN_UNITTESTS = run_json_test run_kword_test run_memfile_test run_message_test # All sources, also the ones that are not configured -ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) \ - $(EXTRA_SRC) $(TERM_SRC) $(XDIFF_SRC) +ALL_LOCAL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC) +ALL_SRC = $(ALL_LOCAL_SRC) $(TERM_SRC) $(XDIFF_SRC) # Which files to check with lint. Select one of these three lines. ALL_SRC # checks more, but may not work well for checking a GUI that wasn't configured. # The perl sources also don't work well with lint. -LINT_SRC = $(BASIC_SRC) $(GUI_SRC) $(HANGULIN_SRC) \ +LINT_SRC = $(BASIC_SRC) $(GUI_SRC) \ $(PYTHON_SRC) $(PYTHON3_SRC) $(TCL_SRC) \ $(NETBEANS_SRC) $(CHANNEL_SRC) $(TERM_SRC) #LINT_SRC = $(SRC) @@ -1718,6 +1697,7 @@ LINT_SRC = $(BASIC_SRC) $(GUI_SRC) $(HANGULIN_SRC) \ #LINT_SRC = $(BASIC_SRC) OBJ_COMMON = \ + objects/alloc.o \ objects/arabic.o \ objects/arglist.o \ objects/autocmd.o \ @@ -1727,6 +1707,8 @@ OBJ_COMMON = \ objects/blob.o \ objects/blowfish.o \ objects/cindent.o \ + objects/clientserver.o \ + objects/clipboard.o \ objects/cmdexpand.o \ objects/cmdhist.o \ objects/crypt.o \ @@ -1751,26 +1733,30 @@ OBJ_COMMON = \ objects/fileio.o \ objects/filepath.o \ objects/findfile.o \ + objects/float.o \ objects/fold.o \ objects/getchar.o \ + objects/gui_xim.o \ objects/hardcopy.o \ objects/hashtab.o \ + objects/help.o \ objects/highlight.o \ - $(HANGULIN_OBJ) \ objects/if_cscope.o \ objects/if_xcmdsrv.o \ objects/indent.o \ objects/insexpand.o \ objects/list.o \ + objects/locale.o \ objects/map.o \ objects/mark.o \ + objects/match.o \ + objects/mbyte.o \ objects/memline.o \ objects/menu.o \ objects/misc1.o \ objects/misc2.o \ objects/mouse.o \ objects/move.o \ - objects/mbyte.o \ objects/normal.o \ objects/ops.o \ objects/option.o \ @@ -1784,8 +1770,8 @@ OBJ_COMMON = \ objects/quickfix.o \ objects/regexp.o \ objects/register.o \ - objects/scriptfile.o \ objects/screen.o \ + objects/scriptfile.o \ objects/search.o \ objects/session.o \ objects/sha256.o \ @@ -1794,17 +1780,29 @@ OBJ_COMMON = \ objects/spell.o \ objects/spellfile.o \ objects/spellsuggest.o \ + objects/strings.o \ objects/syntax.o \ objects/tag.o \ objects/term.o \ objects/terminal.o \ objects/testing.o \ + objects/textformat.o \ + objects/textobject.o \ objects/textprop.o \ + objects/time.o \ + objects/typval.o \ objects/ui.o \ objects/undo.o \ objects/usercmd.o \ objects/userfunc.o \ objects/version.o \ + objects/vim9cmds.o \ + objects/vim9compile.o \ + objects/vim9execute.o \ + objects/vim9expr.o \ + objects/vim9instr.o \ + objects/vim9script.o \ + objects/vim9type.o \ objects/viminfo.o \ objects/window.o \ objects/bufwrite.o \ @@ -1820,7 +1818,7 @@ OBJ_COMMON = \ $(OS_EXTRA_OBJ) \ $(NETBEANS_OBJ) \ $(CHANNEL_OBJ) \ - $(XDIFF_OBJS) + $(XDIFF_OBJS_USED) # The files included by tests are not in OBJ_COMMON. OBJ_MAIN = \ @@ -1873,14 +1871,20 @@ ALL_OBJ = $(OBJ_COMMON) \ PRO_AUTO = \ + alloc.pro \ arabic.pro \ arglist.pro \ autocmd.pro \ + beval.pro \ blowfish.pro \ buffer.pro \ + bufwrite.pro \ change.pro \ + channel.pro \ charset.pro \ cindent.pro \ + clientserver.pro \ + clipboard.pro \ cmdexpand.pro \ cmdhist.pro \ crypt.pro \ @@ -1905,11 +1909,14 @@ PRO_AUTO = \ fileio.pro \ filepath.pro \ findfile.pro \ + float.pro \ fold.pro \ getchar.pro \ + gui_xim.pro \ + gui_beval.pro \ hardcopy.pro \ hashtab.pro \ - hangulin.pro \ + help.pro \ highlight.pro \ if_cscope.pro \ if_lua.pro \ @@ -1920,11 +1927,14 @@ PRO_AUTO = \ if_xcmdsrv.pro \ indent.pro \ insexpand.pro \ + job.pro \ json.pro \ list.pro \ + locale.pro \ main.pro \ map.pro \ mark.pro \ + match.pro \ mbyte.pro \ memfile.pro \ memline.pro \ @@ -1934,6 +1944,7 @@ PRO_AUTO = \ misc2.pro \ mouse.pro \ move.pro \ + netbeans.pro \ normal.pro \ ops.pro \ option.pro \ @@ -1947,8 +1958,8 @@ PRO_AUTO = \ quickfix.pro \ regexp.pro \ register.pro \ - scriptfile.pro \ screen.pro \ + scriptfile.pro \ search.pro \ session.pro \ sha256.pro \ @@ -1957,33 +1968,37 @@ PRO_AUTO = \ spell.pro \ spellfile.pro \ spellsuggest.pro \ + strings.pro \ syntax.pro \ tag.pro \ term.pro \ terminal.pro \ termlib.pro \ testing.pro \ + textformat.pro \ + textobject.pro \ textprop.pro \ + time.pro \ + typval.pro \ ui.pro \ undo.pro \ usercmd.pro \ userfunc.pro \ version.pro \ + vim9cmds.pro \ + vim9compile.pro \ + vim9execute.pro \ + vim9expr.pro \ + vim9instr.pro \ + vim9script.pro \ + vim9type.pro \ viminfo.pro \ window.pro \ - bufwrite.pro \ - beval.pro \ - gui_beval.pro \ - netbeans.pro \ - channel.pro \ $(ALL_GUI_PRO) \ $(TCL_PRO) -# Resources used for the Mac are in one directory. -RSRC_DIR = os_mac_rsrc - PRO_MANUAL = os_amiga.pro os_win32.pro \ - os_mswin.pro winclip.pro os_beos.pro os_vms.pro $(PERL_PRO) + os_mswin.pro winclip.pro os_vms.pro $(PERL_PRO) # Default target is making the executable and tools all: $(VIMTARGET) $(TOOLS) languages $(GUI_BUNDLE) @@ -2024,7 +2039,7 @@ config auto/config.mk: auto/configure config.mk.in config.h.in $(CONF_ARGS4) $(CONF_ARGS5) $(CONF_ARGS6) \ $(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \ $(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \ - $(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA); \ + $(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA) $(CONF_OPT_SODIUM); \ fi # Use "make reconfig" to rerun configure without cached values. @@ -2067,9 +2082,21 @@ autoconf: # This only needs to be run when a command name has been added or changed. # If this fails because you don't have Vim yet, first build and install Vim # without changes. +# This requires a "vim" executable with the +eval feature. cmdidxs: ex_cmds.h - vim --clean -X -u create_cmdidxs.vim - + vim --clean -X --not-a-term -S create_cmdidxs.vim -c quit + +# Run vim script to generate the normal/visual mode command lookup table. +# This only needs to be run when a new normal/visual mode command has been +# added. +# This requires a "vim" executable with the +eval feature. +# If this fails because you don't have Vim yet: +# - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command. +# - run "make nvcmdidxs" to generate nv_cmdidxs.h +nvcmdidxs: auto/config.mk nv_cmds.h + $(CC) -I$(srcdir) $(ALL_CFLAGS) create_nvcmdidxs.c -o create_nvcmdidxs + vim --clean -X --not-a-term -S create_nvcmdidxs.vim -c quit + -rm -f create_nvcmdidxs # The normal command to compile a .c file to its .o file. # Without or with ALL_CFLAGS. @@ -2081,6 +2108,7 @@ CCC = $(CCC_NF) $(ALL_CFLAGS) # A shell script is used to try linking without unnecessary libraries. $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h $(CCC) version.c -o objects/version.o + @$(BUILD_DATE_MSG) @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ -o $(VIMTARGET) $(OBJ) $(ALL_LIBS)" \ MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \ @@ -2150,15 +2178,11 @@ winclip.pro: winclip.c $(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ -os_beos.pro: os_beos.c - $(CPROTO) -D__BEOS__ -UHAVE_CONFIG_H $< > proto/$@ - echo "/* vim: set ft=c : */" >> proto/$@ - os_vms.pro: os_vms.c # must use os_vms_conf.h for auto/config.h mv auto/config.h auto/config.h.save cp os_vms_conf.h auto/config.h - $(CPROTO) -DVMS -UFEAT_GUI_ATHENA -UFEAT_GUI_NEXTAW -UFEAT_GUI_MOTIF -UFEAT_GUI_GTK $< > proto/$@ + $(CPROTO) -DVMS -UFEAT_GUI_MOTIF -UFEAT_GUI_GTK $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ rm auto/config.h mv auto/config.h.save auto/config.h @@ -2175,8 +2199,7 @@ gui_gtk_gresources.pro: auto/gui_gtk_gresources.c notags: -rm -f tags -# Note: tags is made for the currently configured version, can't include both -# Motif and Athena GUI +# Note: tags is made for the currently configured version. # You can ignore error messages for missing files. tags TAGS: notags $(TAGPRG) $(TAGS_FILES) @@ -2201,8 +2224,6 @@ test check: unittests $(TERM_TEST) scripttests # # This will produce a lot of garbage on your screen, including a few error # messages. Don't worry about that. -# If there is a real error, there will be a difference between "testXX.out" and -# a "testXX.ok" file. # If everything is alright, the final message will be "ALL DONE". If not you # get "TEST FAILURE". # @@ -2220,8 +2241,14 @@ scripttests: testgui: cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) GUI_FLAG=-g $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) +testtiny: + cd testdir; $(MAKE) -f Makefile tiny VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE) + +# Run benchmarks. benchmark: - cd testdir; $(MAKE) -f Makefile benchmark VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE) + cd testdir; \ + $(MAKE) -f Makefile benchmarkclean; \ + $(MAKE) -f Makefile benchmark VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE) unittesttargets: $(MAKE) -f Makefile $(UNITTEST_TARGETS) @@ -2246,24 +2273,18 @@ run_message_test: $(MESSAGE_TEST_TARGET) $(VALGRIND) ./$(MESSAGE_TEST_TARGET) || exit 1; echo $* passed; # Run the libvterm tests. -# This currently doesn't work on Mac, only run on Linux for now. +# This works only on GNU make, not on BSD make. +# Libtool requires "gcc". test_libvterm: - @if test `uname` = "Linux"; then \ - cd libvterm; $(MAKE) -f Makefile test \ - CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"; \ + @if $(MAKE) --version 2>/dev/null | grep -qs "GNU Make"; then \ + if test -x "/usr/bin/gcc"; then \ + cd libvterm; $(MAKE) -f Makefile test CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"; \ + fi \ fi # Run individual OLD style test. # These do not depend on the executable, compile it when needed. -test1 \ - test_eval \ - test39 \ - test42 test44 test48 test49 \ - test52 test59 \ - test64 test69 \ - test70 test72 \ - test86 test87 test88 \ - test94 test95 test99: +$(SCRIPTS_TINY): cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) # Run individual NEW style test. @@ -2272,7 +2293,7 @@ test1 \ # export TEST_FILTER=Test_terminal_wipe_buffer # A partial match also works: # export TEST_FILTER=wipe_buffer -$(NEW_TESTS): +$(NEW_TESTS) test_vim9: cd testdir; $(MAKE) $@ VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) newtests: @@ -2361,6 +2382,7 @@ installruntime: installrtbase installmacros installpack installtutor installspel installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \ $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \ $(DEST_FTP) $(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml \ + $(DEST_IMPORT) $(DEST_IMPORT)/dist \ $(DEST_PLUG) $(DEST_TUTOR) $(DEST_SPELL) $(DEST_COMP) -$(SHELL) ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS) # Generate the help tags with ":helptags" to handle all languages. @@ -2394,9 +2416,6 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \ chmod $(VIMSCRIPTMOD) $(EVIM_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/mswin.vim $(MSWIN_FILE) chmod $(VIMSCRIPTMOD) $(MSWIN_FILE) -# install the rgb.txt file - $(INSTALL_DATA) $(SCRIPTSOURCE)/rgb.txt $(SYS_RGB_FILE) - chmod $(VIMSCRIPTMOD) $(SYS_RGB_FILE) # install the bugreport file $(INSTALL_DATA) $(SCRIPTSOURCE)/bugreport.vim $(SYS_BUGR_FILE) chmod $(VIMSCRIPTMOD) $(SYS_BUGR_FILE) @@ -2426,9 +2445,9 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \ cd $(PRINTSOURCE); $(INSTALL_DATA) *.ps $(DEST_PRINT) cd $(DEST_PRINT); chmod $(FILEMOD) *.ps # install the colorscheme files - cd $(COLSOURCE); $(INSTALL_DATA_R) *.vim tools README.txt $(DEST_COL) - cd $(DEST_COL); chmod $(DIRMOD) tools - cd $(DEST_COL); chmod $(HELPMOD) *.vim README.txt tools/*.vim + cd $(COLSOURCE); $(INSTALL_DATA_R) *.vim lists tools README.txt $(DEST_COL) + cd $(DEST_COL); chmod $(DIRMOD) lists tools + cd $(DEST_COL); chmod $(HELPMOD) *.vim README.txt lists/*.vim tools/*.vim # install the syntax files cd $(SYNSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_SYN) cd $(DEST_SYN); chmod $(HELPMOD) *.vim README.txt @@ -2442,12 +2461,15 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \ cd $(DEST_AUTO)/dist; chmod $(HELPMOD) *.vim cd $(AUTOSOURCE)/xml; $(INSTALL_DATA) *.vim $(DEST_AUTO)/xml cd $(DEST_AUTO)/xml; chmod $(HELPMOD) *.vim +# install the standard import files + cd $(IMPORTSOURCE)/dist; $(INSTALL_DATA) *.vim $(DEST_IMPORT)/dist + cd $(DEST_IMPORT)/dist; chmod $(HELPMOD) *.vim # install the standard plugin files cd $(PLUGSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_PLUG) cd $(DEST_PLUG); chmod $(HELPMOD) *.vim README.txt # install the ftplugin files cd $(FTPLUGSOURCE); $(INSTALL_DATA) *.vim README.txt logtalk.dict $(DEST_FTP) - cd $(DEST_FTP); chmod $(HELPMOD) *.vim README.txt + cd $(DEST_FTP); chmod $(HELPMOD) *.vim README.txt logtalk.dict # install the compiler files cd $(COMPSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_COMP) cd $(DEST_COMP); chmod $(HELPMOD) *.vim README.txt @@ -2470,11 +2492,11 @@ installpack: $(DEST_VIM) $(DEST_RT) $(DEST_PACK) chmod $(FILEMOD) `find $(DEST_PACK) -type f -print` # install the tutor files -installtutorbin: $(DEST_VIM) +installtutorbin: $(DEST_BIN) $(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor -installgtutorbin: $(DEST_VIM) +installgtutorbin: $(DEST_BIN) $(INSTALL_DATA) gvimtutor $(DEST_BIN)/$(GVIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(GVIMNAME)tutor @@ -2539,6 +2561,10 @@ install-tool-languages: -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_TR) "-tr" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_TR_I) "-tr" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_TR_U) "-tr.UTF-8" $(INSTALLMANARGS) + # install the language specific files, if they were unpacked install-languages: languages $(DEST_LANG) $(DEST_KMAP) @@ -2560,6 +2586,9 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP) -$(SHELL) ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_TR) "-tr" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_TR_I) "-tr" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_TR_U) "-tr.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_DA) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ @@ -2596,6 +2625,12 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP) $(DEST_MAN_RU) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_TR) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_TR_I) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_TR_U) $(INSTALLMLARGS) if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) LOCALEDIR=$(DEST_LANG) \ INSTALL_DATA=$(INSTALL_DATA) FILEMOD=$(FILEMOD) install; \ @@ -2664,7 +2699,8 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \ $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) $(DEST_FTP) \ $(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_PLUG): + $(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml \ + $(DEST_IMPORT) $(DEST_IMPORT)/dist $(DEST_PLUG): $(MKDIR_P) $@ -chmod $(DIRMOD) $@ @@ -2769,6 +2805,9 @@ uninstall_runtime: -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh uninstall $(DEST_MAN_TR) "" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh uninstall $(DEST_MAN_TR_I) "" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh uninstall $(DEST_MAN_TR_U) "" $(INSTALLMANARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ @@ -2807,6 +2846,12 @@ uninstall_runtime: $(DEST_MAN_RU) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_TR) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_TR_I) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_TR_U) $(INSTALLMLARGS) -rm -f $(DEST_MAN)/xxd.1 -rm -f $(DEST_MAN_DA)/xxd.1 $(DEST_MAN_DA_I)/xxd.1 $(DEST_MAN_DA_U)/xxd.1 -rm -f $(DEST_MAN_DE)/xxd.1 $(DEST_MAN_DE_I)/xxd.1 $(DEST_MAN_DE_U)/xxd.1 @@ -2817,7 +2862,6 @@ uninstall_runtime: -rm -f $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1 -rm -f $(DEST_HELP)/*.txt $(DEST_HELP)/tags $(DEST_HELP)/*.pl -rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-?? - -rm -f $(SYS_RGB_FILE) -rm -f $(SYS_MENU_FILE) $(SYS_SYNMENU_FILE) $(SYS_DELMENU_FILE) -rm -f $(SYS_BUGR_FILE) $(VIM_DEFAULTS_FILE) $(EVIM_FILE) $(MSWIN_FILE) -rm -f $(DEST_SCRIPT)/gvimrc_example.vim $(DEST_SCRIPT)/vimrc_example.vim @@ -2827,6 +2871,7 @@ uninstall_runtime: -rm -f $(SYS_OPTWIN_FILE) -rm -f $(DEST_COL)/*.vim $(DEST_COL)/README.txt -rm -rf $(DEST_COL)/tools + -rm -rf $(DEST_COL)/lists -rm -f $(DEST_SYN)/*.vim $(DEST_SYN)/README.txt -rm -f $(DEST_IND)/*.vim $(DEST_IND)/README.txt -rm -rf $(DEST_MACRO) @@ -2842,8 +2887,10 @@ uninstall_runtime: -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 + -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) + -rmdir $(DEST_IMPORT)/dist $(DEST_IMPORT) -rmdir $(DEST_PLUG) $(DEST_RT) # This will fail when other Vim versions are installed, no worries. -rmdir $(DEST_VIM) @@ -2853,13 +2900,12 @@ uninstall_runtime: clean celan: testclean -rm -f *.o core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o -rm -rf objects - -rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c auto/gui_gtk_gresources.c auto/gui_gtk_gresources.h + -rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c auto/gui_gtk_gresources.c auto/gui_gtk_gresources.h auto/os_haiku.rdef -rm -f conftest* *~ auto/link.sed -rm -f testdir/opt_test.vim -rm -f $(UNITTEST_TARGETS) -rm -f runtime pixmaps - -rm -rf $(APPDIR) - -rm -rf mzscheme_base.c + -rm -f mzscheme_base.c -rm -rf libvterm/.libs libterm/t/.libs libvterm/src/*.o libvterm/src/*.lo libvterm/t/*.o libvterm/t/*.lo libvterm/t/harness libvterm/libvterm.la if test -d $(PODIR); then \ cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \ @@ -2886,7 +2932,7 @@ clean celan: testclean # % make SHADOWDIR = shadow -LINKEDFILES = ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak +LINKEDFILES = ../*.[chm] ../*.cc ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak shadow: runtime pixmaps $(MKDIR_P) $(SHADOWDIR) @@ -2904,11 +2950,6 @@ shadow: runtime pixmaps cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* . $(MKDIR_P) $(SHADOWDIR)/xdiff cd $(SHADOWDIR)/xdiff; ln -s ../../xdiff/*.[ch] . - if test -d $(RSRC_DIR); then \ - cd $(SHADOWDIR); \ - ln -s ../infplist.xml .; \ - ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \ - fi $(MKDIR_P) $(SHADOWDIR)/testdir cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \ ../../testdir/Make_all.mak \ @@ -2921,8 +2962,9 @@ shadow: runtime pixmaps ../../testdir/sautest \ ../../testdir/samples \ ../../testdir/dumps \ - ../../testdir/test83-tags? \ - ../../testdir/*.ok . + ../../testdir/*.ok \ + ../../testdir/testluaplugin \ + . # After updating Vim new files may have been created, use this to refresh the # symbolic links in the shadow directory. This isn't guaranteed to catch all @@ -2941,7 +2983,7 @@ pixmaps: # Update the synmenu.vim file with the latest Syntax menu. # This is only needed when runtime/makemenu.vim was changed. menu: ./vim ../runtime/makemenu.vim - ./vim -u ../runtime/makemenu.vim + ./vim --clean -X --not-a-term -S ../runtime/makemenu.vim # Start configure from scratch scrub scratch: @@ -2976,7 +3018,13 @@ depend: -@rm -f Makefile~ cp Makefile Makefile~ sed -e '/\#\#\# Dependencies/q' < Makefile > tmp_make - -for i in $(ALL_SRC); do echo $$i; \ + -for i in $(ALL_LOCAL_SRC); do echo $$i; \ + $(CPP_DEPEND) $$i | \ + sed -e 's+^\([^ ]*\.o\)+objects/\1+' >> tmp_make; done + -for i in $(TERM_SRC); do echo $$i; \ + $(CPP_DEPEND) $$i | \ + sed -e 's+^\([^ ]*\.o\)+objects/vterm_\1+' >> tmp_make; done + -for i in $(XDIFF_SRC); do echo $$i; \ $(CPP_DEPEND) $$i | \ sed -e 's+^\([^ ]*\.o\)+objects/\1+' -e 's+xdiff/\.\./++g' >> tmp_make; done mv tmp_make Makefile @@ -3004,6 +3052,14 @@ auto/if_perl.c: if_perl.xs auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in CC="$(CC) $(OSDEF_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh +auto/os_haiku.rdef: os_haiku.rdef.in + @echo creating $@ + @echo '/* This file is automatically created by Makefile */' >> $@ + @echo '/* DO NOT EDIT! Change Makefile only. */' >> $@ + @cat $(srcdir)/os_haiku.rdef.in >> auto/os_haiku.rdef + sed -i "s|@MAJOR@|$(VIMMAJOR)|" auto/os_haiku.rdef + sed -i "s|@MINOR@|$(VIMMINOR)|" auto/os_haiku.rdef + auto/pathdef.c: Makefile auto/config.mk -@echo creating $@ -@echo '/* pathdef.c */' > $@ @@ -3046,6 +3102,14 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register gui_gtk_res.xml; \ fi +# Dependencies through vim.h that most targets depend on. Used by targets +# that are not taken care of by "make depend". +VIM_H_DEPENDENCIES = \ + vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ + proto.h globals.h errors.h + # All the object files are put in the "objects" directory. Since not all make # commands understand putting object files in another directory, it must be # specified for each file separately. @@ -3061,6 +3125,9 @@ objects/.dirstamp: # time. $(ALL_OBJ): objects/.dirstamp +objects/alloc.o: alloc.c + $(CCC) -o $@ alloc.c + objects/arabic.o: arabic.c $(CCC) -o $@ arabic.c @@ -3079,6 +3146,9 @@ objects/blowfish.o: blowfish.c objects/buffer.o: buffer.c $(CCC) -o $@ buffer.c +objects/bufwrite.o: bufwrite.c + $(CCC) -o $@ bufwrite.c + objects/change.o: change.c $(CCC) -o $@ change.c @@ -3088,6 +3158,12 @@ objects/charset.o: charset.c objects/cindent.o: cindent.c $(CCC) -o $@ cindent.c +objects/clientserver.o: clientserver.c + $(CCC) -o $@ clientserver.c + +objects/clipboard.o: clipboard.c + $(CCC) -o $@ clipboard.c + objects/cmdexpand.o: cmdexpand.c $(CCC) -o $@ cmdexpand.c @@ -3160,6 +3236,9 @@ objects/filepath.o: filepath.c objects/findfile.o: findfile.c $(CCC) -o $@ findfile.c +objects/float.o: float.c + $(CCC) -o $@ float.c + objects/fold.o: fold.c $(CCC) -o $@ fold.c @@ -3172,18 +3251,12 @@ objects/hardcopy.o: hardcopy.c objects/hashtab.o: hashtab.c $(CCC) -o $@ hashtab.c +objects/help.o: help.c + $(CCC) -o $@ help.c + objects/gui.o: gui.c $(CCC) -o $@ gui.c -objects/gui_at_fs.o: gui_at_fs.c - $(CCC) -o $@ gui_at_fs.c - -objects/gui_at_sb.o: gui_at_sb.c - $(CCC) -o $@ gui_at_sb.c - -objects/gui_athena.o: gui_athena.c - $(CCC) -o $@ gui_athena.c - objects/beval.o: beval.c $(CCC) -o $@ beval.c @@ -3202,6 +3275,9 @@ objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c objects/gui_gtk_x11.o: gui_gtk_x11.c $(CCC) -o $@ gui_gtk_x11.c +objects/gui_haiku.o: gui_haiku.cc + $(CCC) -o $@ gui_haiku.cc + objects/gui_motif.o: gui_motif.c $(CCC) -o $@ gui_motif.c @@ -3214,15 +3290,12 @@ objects/gui_xmebw.o: gui_xmebw.c objects/gui_x11.o: gui_x11.c $(CCC) -o $@ gui_x11.c +objects/gui_xim.o: gui_xim.c + $(CCC) -o $@ gui_xim.c + objects/gui_photon.o: gui_photon.c $(CCC) -o $@ gui_photon.c -objects/gui_mac.o: gui_mac.c - $(CCC) -o $@ gui_mac.c - -objects/hangulin.o: hangulin.c - $(CCC) -o $@ hangulin.c - objects/highlight.o: highlight.c $(CCC) -o $@ highlight.c @@ -3233,7 +3306,7 @@ objects/if_xcmdsrv.o: if_xcmdsrv.c $(CCC) -o $@ if_xcmdsrv.c objects/if_lua.o: if_lua.c - $(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) -o $@ if_lua.c + $(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) $(LUA_CFLAGS_EXTRA) -o $@ if_lua.c objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA) $(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c @@ -3242,22 +3315,22 @@ mzscheme_base.c: $(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base objects/if_perl.o: auto/if_perl.c - $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/if_perl.c + $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) $(PERL_CFLAGS_EXTRA) -o $@ auto/if_perl.c objects/if_perlsfio.o: if_perlsfio.c - $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c + $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) $(PERL_CFLAGS_EXTRA) -o $@ if_perlsfio.c objects/if_python.o: if_python.c if_py_both.h - $(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c + $(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c objects/if_python3.o: if_python3.c if_py_both.h - $(CCC_NF) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python3.c + $(CCC_NF) $(PYTHON3_CFLAGS) $(ALL_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c objects/if_ruby.o: if_ruby.c - $(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) -o $@ if_ruby.c + $(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) $(RUBY_CFLAGS_EXTRA) -o $@ if_ruby.c objects/if_tcl.o: if_tcl.c - $(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ if_tcl.c + $(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) $(TCL_CFLAGS_EXTRA) -o $@ if_tcl.c objects/indent.o: indent.c $(CCC) -o $@ indent.c @@ -3265,6 +3338,9 @@ objects/indent.o: indent.c objects/insexpand.o: insexpand.c $(CCC) -o $@ insexpand.c +objects/job.o: job.c + $(CCC) -o $@ job.c + objects/json.o: json.c $(CCC) -o $@ json.c @@ -3277,6 +3353,9 @@ objects/kword_test.o: kword_test.c objects/list.o: list.c $(CCC) -o $@ list.c +objects/locale.o: locale.c + $(CCC) -o $@ locale.c + objects/main.o: main.c $(CCC) -o $@ main.c @@ -3286,6 +3365,9 @@ objects/map.o: map.c objects/mark.o: mark.c $(CCC) -o $@ mark.c +objects/match.o: match.c + $(CCC) -o $@ match.c + objects/memfile.o: memfile.c $(CCC) -o $@ memfile.c @@ -3326,30 +3408,30 @@ objects/ops.o: ops.c $(CCC) -o $@ ops.c objects/option.o: option.c optiondefs.h - $(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c + $(CCC_NF) $(ALL_IF_CFLAGS) $(ALL_CFLAGS) $(ALL_IF_CFLAGS_EXTRA) -o $@ option.c objects/optionstr.o: optionstr.c - $(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ optionstr.c + $(CCC_NF) $(ALL_IF_CFLAGS) $(ALL_CFLAGS) $(ALL_IF_CFLAGS_EXTRA) -o $@ optionstr.c -objects/os_beos.o: os_beos.c - $(CCC) -o $@ os_beos.c - -objects/os_qnx.o: os_qnx.c +objects/os_qnx.o: os_qnx.c $(VIM_H_DEPENDENCIES) $(CCC) -o $@ os_qnx.c +objects/os_haiku.rsrc: auto/os_haiku.rdef + cat $< | $(CCC) -E - | grep -v '^#' | rc -o "$@" - + objects/os_macosx.o: os_macosx.m $(CCC) -o $@ os_macosx.m -objects/os_mac_conv.o: os_mac_conv.c +objects/os_mac_conv.o: os_mac_conv.c $(VIM_H_DEPENDENCIES) $(CCC) -o $@ os_mac_conv.c objects/os_unix.o: os_unix.c $(CCC) -o $@ os_unix.c -objects/os_mswin.o: os_mswin.c +objects/os_mswin.o: os_mswin.c $(VIM_H_DEPENDENCIES) $(CCC) -o $@ os_mswin.c -objects/winclip.o: winclip.c +objects/winclip.o: winclip.c $(VIM_H_DEPENDENCIES) $(CCC) -o $@ winclip.c objects/pathdef.o: auto/pathdef.c @@ -3406,6 +3488,9 @@ objects/spellfile.o: spellfile.c objects/spellsuggest.o: spellsuggest.c $(CCC) -o $@ spellsuggest.c +objects/strings.o: strings.c + $(CCC) -o $@ strings.c + objects/syntax.o: syntax.c $(CCC) -o $@ syntax.c @@ -3421,9 +3506,21 @@ objects/terminal.o: terminal.c $(TERM_DEPS) objects/testing.o: testing.c $(CCC) -o $@ testing.c +objects/textformat.o: textformat.c + $(CCC) -o $@ textformat.c + +objects/textobject.o: textobject.c + $(CCC) -o $@ textobject.c + objects/textprop.o: textprop.c $(CCC) -o $@ textprop.c +objects/time.o: time.c + $(CCC) -o $@ time.c + +objects/typval.o: typval.c + $(CCC) -o $@ typval.c + objects/ui.o: ui.c $(CCC) -o $@ ui.c @@ -3436,29 +3533,49 @@ objects/usercmd.o: usercmd.c objects/userfunc.o: userfunc.c $(CCC) -o $@ userfunc.c +objects/vim9cmds.o: vim9cmds.c + $(CCC) -o $@ vim9cmds.c + +objects/vim9compile.o: vim9compile.c + $(CCC) -o $@ vim9compile.c + +objects/vim9execute.o: vim9execute.c + $(CCC) -o $@ vim9execute.c + +objects/vim9expr.o: vim9expr.c + $(CCC) -o $@ vim9expr.c + +objects/vim9instr.o: vim9instr.c + $(CCC) -o $@ vim9instr.c + +objects/vim9script.o: vim9script.c + $(CCC) -o $@ vim9script.c + +objects/vim9type.o: vim9type.c + $(CCC) -o $@ vim9type.c + objects/viminfo.o: viminfo.c $(CCC) -o $@ viminfo.c objects/window.o: window.c $(CCC) -o $@ window.c -objects/bufwrite.o: bufwrite.c - $(CCC) -o $@ bufwrite.c - objects/netbeans.o: netbeans.c $(CCC) -o $@ netbeans.c objects/channel.o: channel.c $(CCC) -o $@ channel.c -Makefile: - @echo The name of the makefile MUST be "Makefile" (with capital M)!!!! +# Dependencies that "make depend" doesn't find +objects/gui_gtk_x11.o: version.h + # Build rules for libvterm. Putting them here allows for adding compilation # options specific for Vim. Since the .o files go into objects/ we do need to # prefix vterm_ to avoid name clashes. CCCTERM = $(CCC_NF) $(VTERM_CFLAGS) $(ALL_CFLAGS) -DINLINE="" \ -DVSNPRINTF=vim_vsnprintf \ + -DSNPRINTF=vim_snprintf \ -DIS_COMBINING_FUNCTION=utf_iscomposing_uint \ -DWCWIDTH_FUNCTION=utf_uint2cells @@ -3483,7 +3600,7 @@ objects/vterm_screen.o: libvterm/src/screen.c $(TERM_DEPS) objects/vterm_state.o: libvterm/src/state.c $(TERM_DEPS) $(CCCTERM) -o $@ libvterm/src/state.c -objects/vterm_unicode.o: libvterm/src/unicode.c $(TERM_DEPS) +objects/vterm_unicode.o: libvterm/src/unicode.c $(TERM_DEPS) libvterm/src/fullwidth.inc $(CCCTERM) -o $@ libvterm/src/unicode.c objects/vterm_vterm.o: libvterm/src/vterm.c $(TERM_DEPS) @@ -3510,516 +3627,661 @@ objects/xpatience.o: xdiff/xpatience.c $(XDIFF_INCL) $(CCCDIFF) -o $@ xdiff/xpatience.c -############################################################################### -### MacOS X installation -### -### This installs a runnable Vim.app in $(prefix) - -REZ = /Developer/Tools/Rez -RESDIR = $(APPDIR)/Contents/Resources -VERSION = $(VIMMAJOR).$(VIMMINOR) - -### Common flags -M4FLAGSX = $(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \ - -DAPP_VER=$(VERSION) - -install_macosx: gui_bundle -# Remove the link to the runtime dir, don't want to copy all of that. - -rm $(RESDIR)/vim/runtime - $(INSTALL_DATA_R) $(APPDIR) $(DESTDIR)$(prefix) -# Generate the help tags file now, it won't work with "make installruntime". - -@srcdir=`pwd`; cd $(HELPSOURCE); $(MAKE) VIMEXE=$$srcdir/$(VIMTARGET) vimtags -# Install the runtime files. Recursive! - $(MKDIR_P) $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime - srcdir=`pwd`; $(MAKE) -f Makefile installruntime \ - VIMEXE=$$srcdir/$(VIMTARGET) \ - prefix=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \ - exec_prefix=$(DESTDIR)$(prefix)/$(APPDIR)/Contents \ - BINDIR=$(DESTDIR)$(prefix)/$(APPDIR)/Contents/MacOS \ - VIMLOC=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \ - VIMRTLOC=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR)/runtime -# Put the link back. - ln -s `pwd`/../runtime $(RESDIR)/vim -# Copy rgb.txt, Mac doesn't always have X11 - $(INSTALL_DATA) $(SCRIPTSOURCE)/rgb.txt $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime -# TODO: Create the vimtutor and/or gvimtutor application. - -gui_bundle: $(RESDIR) bundle-dir bundle-executable bundle-info bundle-resource \ - bundle-language - -$(RESDIR): - $(MKDIR_P) $@ +Makefile: + @echo The name of the makefile MUST be "Makefile" (with capital M)!!!! -bundle-dir: $(APPDIR)/Contents $(VIMTARGET) -# Make a link to the runtime directory, so that we can try out the executable -# without installing it. - $(MKDIR_P) $(RESDIR)/vim - -ln -s `pwd`/../runtime $(RESDIR)/vim - -bundle-executable: $(VIMTARGET) - $(MKDIR_P) $(APPDIR)/Contents/MacOS - cp $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET) - -bundle-info: bundle-dir - @echo "Creating PkgInfo" - @echo -n "APPLVIM!" > $(APPDIR)/Contents/PkgInfo - @echo "Creating Info.plist" - m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist - -bundle-resource: bundle-dir bundle-rsrc - cp -f $(RSRC_DIR)/*.icns $(RESDIR) - -### Classic resources -# Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9) -# This file is also required for OS X Vim. -bundle-rsrc: os_mac.rsr.hqx - @echo "Creating resource fork" - python dehqx.py $< - rm -f gui_mac.rsrc - mv gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc - -# po/Make_osx.pl says something about generating a Mac message file -# for Ukrainian. Would somebody using Mac OS X in Ukrainian -# *really* be upset that Carbon Vim was not localised in -# Ukrainian? -# -#bundle-language: bundle-dir po/Make_osx.pl -# cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) -bundle-language: bundle-dir -$(APPDIR)/Contents: - $(MKDIR_P) $(APPDIR)/Contents/MacOS - $(MKDIR_P) $(RESDIR)/English.lproj +############################################################################### +# +# Haiku installation +# +# This rule: +# - add resources to already installed vim binary to avoid +# stripping them during install; +# - update system MIME database with info about vim application. +# +install_haiku_extra: $(DEST_BIN)/$(VIMTARGET) objects/os_haiku.rsrc + xres -o $(DEST_BIN)/$(VIMTARGET) objects/os_haiku.rsrc + mimeset $(DEST_BIN)/$(VIMTARGET) +# List of g*-links that should be replaced with shell script equivalents. +# This solves the problem of them from Tracker. +# +HAIKU_GLINKS = $(DEST_BIN)/$(GVIMTARGET) \ + $(DEST_BIN)/$(GVIEWTARGET) \ + $(DEST_BIN)/$(GVIMDIFFTARGET) \ + $(DEST_BIN)/$(RGVIMTARGET) \ + $(DEST_BIN)/$(RGVIEWTARGET) + +# This rule: +# - Replace gvim link with copy of vim binary. +# - Replace g*-links with shell script equivalents to solve the +# problem of calling them from Tracker, +# - Add icon resources to mentioned g*-link shell scripts +# - in case gui-less vim.con executable available use it. +# +installglinks_haiku: $(HAIKU_GLINKS) install_haiku_extra + @catattr -r "BEOS:ICON" $(DEST_BIN)/$(GVIMTARGET) > ~icon.attr + for i in $(HAIKU_GLINKS); do \ + rm $$i ; \ + echo "#!/bin/sh" > $$i ; \ + case $$i in \ + $(DEST_BIN)/$(GVIMTARGET)) \ + cp $(DEST_BIN)/$(VIMTARGET) $$i ; \ + if [ -f $(VIMTARGET).con ] ; then \ + $(STRIP) $(VIMTARGET).con ; \ + mv $(VIMTARGET).con $(DEST_BIN)/$(VIMTARGET) ; \ + fi ;; \ + $(DEST_BIN)/$(GVIEWTARGET)) printf "%s -R %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ + $(DEST_BIN)/$(GVIMDIFFTARGET)) printf "%s -d %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ + $(DEST_BIN)/$(RGVIMTARGET)) printf "%s -Z %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ + $(DEST_BIN)/$(RGVIEWTARGET)) printf "%s -Z -R %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ + *) printf "%s %c%c" $(GVIMTARGET) '$$' '*' >> $$i;; \ + esac ; \ + chmod $(BINMOD) $$i ; \ + addattr -f ~icon.attr -t \'VICN\' BEOS:ICON $$i ; \ + done + addattr -f ~icon.attr -t \'VICN\' BEOS:ICON $(DEST_BIN)/$(VIMNAME)tutor + @rm ~icon.attr ############################################################################### ### (automatically generated by 'make depend') ### Dependencies: +objects/alloc.o: alloc.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/arabic.o: arabic.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/arglist.o: arglist.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/autocmd.o: autocmd.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/beval.o: beval.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/blob.o: blob.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/blowfish.o: blowfish.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/buffer.o: buffer.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/change.o: change.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/charset.o: charset.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/cindent.o: cindent.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/cmdexpand.o: cmdexpand.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/clientserver.o: clientserver.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h +objects/clipboard.o: clipboard.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h +objects/cmdexpand.o: cmdexpand.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/cmdhist.o: cmdhist.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/crypt.o: crypt.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/crypt_zip.o: crypt_zip.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/debugger.o: debugger.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/dict.o: dict.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/diff.o: diff.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h xdiff/xdiff.h vim.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h xdiff/xdiff.h xdiff/../vim.h objects/digraph.o: digraph.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/drawline.o: drawline.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/drawscreen.o: drawscreen.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/drawscreen.o: drawscreen.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/edit.o: edit.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/eval.o: eval.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h -objects/evalbuffer.o: evalbuffer.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/evalbuffer.o: evalbuffer.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/evalfunc.o: evalfunc.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h -objects/evalvars.o: evalvars.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h +objects/evalvars.o: evalvars.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/evalwindow.o: evalwindow.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/ex_cmds.o: ex_cmds.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/ex_cmds2.o: ex_cmds2.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/ex_docmd.o: ex_docmd.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h ex_cmdidxs.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h ex_cmdidxs.h objects/ex_eval.o: ex_eval.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/ex_getln.o: ex_getln.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/fileio.o: fileio.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/filepath.o: filepath.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/findfile.o: findfile.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/float.o: float.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/fold.o: fold.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/getchar.o: getchar.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/gui_xim.o: gui_xim.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/hardcopy.o: hardcopy.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/hashtab.o: hashtab.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/highlight.o: highlight.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/help.o: help.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/highlight.o: highlight.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/if_cscope.o: if_cscope.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h if_cscope.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/if_xcmdsrv.o: if_xcmdsrv.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h version.h objects/indent.o: indent.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/insexpand.o: insexpand.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/json.o: json.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/list.o: list.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/locale.o: locale.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/main.o: main.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/map.o: map.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/mark.o: mark.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/match.o: match.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/mbyte.o: mbyte.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/memfile.o: memfile.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/memline.o: memline.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/menu.o: menu.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/message.o: message.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/misc1.o: misc1.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/misc2.o: misc2.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/mouse.o: mouse.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/move.o: move.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/mbyte.o: mbyte.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/normal.o: normal.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h nv_cmds.h nv_cmdidxs.h objects/ops.o: ops.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/option.o: option.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h optiondefs.h -objects/optionstr.o: optionstr.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h optiondefs.h +objects/optionstr.o: optionstr.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/os_unix.o: os_unix.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h os_unixx.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h os_unixx.h objects/pathdef.o: auto/pathdef.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/popupmenu.o: popupmenu.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h +objects/popupmenu.o: popupmenu.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/popupwin.o: popupwin.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/profiler.o: profiler.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/pty.o: pty.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/quickfix.o: quickfix.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/regexp.o: regexp.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h regexp_bt.c regexp_nfa.c + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h regexp_bt.c regexp_nfa.c objects/register.o: register.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/scriptfile.o: scriptfile.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/screen.o: screen.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/scriptfile.o: scriptfile.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/search.o: search.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/session.o: session.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/session.o: session.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/sha256.o: sha256.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/sign.o: sign.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/sound.o: spell.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/sound.o: sound.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/spell.o: spell.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/spellfile.o: spellfile.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/spellsuggest.o: spellsuggest.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h +objects/strings.o: strings.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/syntax.o: syntax.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/tag.o: tag.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/term.o: term.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h libvterm/include/vterm.h \ - libvterm/include/vterm_keycodes.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/terminal.o: terminal.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h libvterm/include/vterm.h \ - libvterm/include/vterm_keycodes.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/testing.o: testing.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/textformat.o: textformat.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h +objects/textobject.o: textobject.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/textprop.o: textprop.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/time.o: time.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/typval.o: typval.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/ui.o: ui.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/undo.o: undo.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/usercmd.o: usercmd.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/userfunc.o: userfunc.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/version.o: version.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h -objects/viminfo.o: viminfo.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h +objects/vim9cmds.o: vim9cmds.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h vim9.h +objects/vim9compile.o: vim9compile.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h vim9.h +objects/vim9execute.o: vim9execute.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h vim9.h +objects/vim9expr.o: vim9expr.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h vim9.h +objects/vim9instr.o: vim9instr.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h vim9.h +objects/vim9script.o: vim9script.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h vim9.h +objects/vim9type.o: vim9type.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h +objects/viminfo.o: viminfo.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/window.o: window.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/bufwrite.o: bufwrite.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/gui.o: gui.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/gui_gtk.o: gui_gtk.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_gtk_f.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h gui_gtk_f.h objects/gui_gtk_f.o: gui_gtk_f.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_gtk_f.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h gui_gtk_f.h objects/gui_motif.o: gui_motif.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_xmebw.h ../pixmaps/alert.xpm ../pixmaps/error.xpm \ - ../pixmaps/generic.xpm ../pixmaps/info.xpm ../pixmaps/quest.xpm \ - gui_x11_pm.h ../pixmaps/tb_new.xpm ../pixmaps/tb_open.xpm \ - ../pixmaps/tb_close.xpm ../pixmaps/tb_save.xpm ../pixmaps/tb_print.xpm \ - ../pixmaps/tb_cut.xpm ../pixmaps/tb_copy.xpm ../pixmaps/tb_paste.xpm \ - ../pixmaps/tb_find.xpm ../pixmaps/tb_find_next.xpm \ - ../pixmaps/tb_find_prev.xpm ../pixmaps/tb_find_help.xpm \ - ../pixmaps/tb_exit.xpm ../pixmaps/tb_undo.xpm ../pixmaps/tb_redo.xpm \ - ../pixmaps/tb_help.xpm ../pixmaps/tb_macro.xpm ../pixmaps/tb_make.xpm \ - ../pixmaps/tb_save_all.xpm ../pixmaps/tb_jump.xpm \ - ../pixmaps/tb_ctags.xpm ../pixmaps/tb_load_session.xpm \ - ../pixmaps/tb_save_session.xpm ../pixmaps/tb_new_session.xpm \ - ../pixmaps/tb_blank.xpm ../pixmaps/tb_maximize.xpm \ - ../pixmaps/tb_split.xpm ../pixmaps/tb_minimize.xpm \ - ../pixmaps/tb_shell.xpm ../pixmaps/tb_replace.xpm \ - ../pixmaps/tb_vsplit.xpm ../pixmaps/tb_maxwidth.xpm \ - ../pixmaps/tb_minwidth.xpm -objects/gui_xmdlg.o: gui_xmdlg.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h -objects/gui_xmebw.o: gui_xmebw.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_xmebwp.h gui_xmebw.h -objects/gui_athena.o: gui_athena.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_at_sb.h gui_x11_pm.h ../pixmaps/tb_new.xpm \ - ../pixmaps/tb_open.xpm ../pixmaps/tb_close.xpm ../pixmaps/tb_save.xpm \ - ../pixmaps/tb_print.xpm ../pixmaps/tb_cut.xpm ../pixmaps/tb_copy.xpm \ - ../pixmaps/tb_paste.xpm ../pixmaps/tb_find.xpm \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h gui_xmebw.h \ + ../pixmaps/alert.xpm ../pixmaps/error.xpm ../pixmaps/generic.xpm \ + ../pixmaps/info.xpm ../pixmaps/quest.xpm gui_x11_pm.h \ + ../pixmaps/tb_new.xpm ../pixmaps/tb_open.xpm ../pixmaps/tb_close.xpm \ + ../pixmaps/tb_save.xpm ../pixmaps/tb_print.xpm ../pixmaps/tb_cut.xpm \ + ../pixmaps/tb_copy.xpm ../pixmaps/tb_paste.xpm ../pixmaps/tb_find.xpm \ ../pixmaps/tb_find_next.xpm ../pixmaps/tb_find_prev.xpm \ ../pixmaps/tb_find_help.xpm ../pixmaps/tb_exit.xpm \ ../pixmaps/tb_undo.xpm ../pixmaps/tb_redo.xpm ../pixmaps/tb_help.xpm \ @@ -4032,88 +4294,114 @@ objects/gui_athena.o: gui_athena.c vim.h protodef.h auto/config.h feature.h \ ../pixmaps/tb_shell.xpm ../pixmaps/tb_replace.xpm \ ../pixmaps/tb_vsplit.xpm ../pixmaps/tb_maxwidth.xpm \ ../pixmaps/tb_minwidth.xpm +objects/gui_xmdlg.o: gui_xmdlg.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h +objects/gui_xmebw.o: gui_xmebw.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h gui_xmebwp.h gui_xmebw.h objects/gui_gtk_x11.o: gui_gtk_x11.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h auto/gui_gtk_gresources.h gui_gtk_f.h \ - ../runtime/vim32x32.xpm ../runtime/vim16x16.xpm ../runtime/vim48x48.xpm + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h auto/gui_gtk_gresources.h \ + gui_gtk_f.h ../runtime/vim32x32.xpm ../runtime/vim16x16.xpm \ + ../runtime/vim48x48.xpm objects/gui_x11.o: gui_x11.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h ../runtime/vim32x32.xpm ../runtime/vim16x16.xpm \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h ../runtime/vim32x32.xpm ../runtime/vim16x16.xpm \ ../runtime/vim48x48.xpm -objects/gui_at_sb.o: gui_at_sb.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_at_sb.h -objects/gui_at_fs.o: gui_at_fs.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h gui_at_sb.h +objects/gui_haiku.o: gui_haiku.cc vim.h protodef.h auto/config.h feature.h \ + os_unix.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/json_test.o: json_test.c main.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h json.c + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h json.c objects/kword_test.o: kword_test.c main.c vim.h protodef.h auto/config.h \ - feature.h os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h \ - option.h beval.h proto/gui_beval.pro structs.h regexp.h gui.h alloc.h \ - ex_cmds.h spell.h proto.h globals.h charset.c + feature.h os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h \ + option.h beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h charset.c objects/memfile_test.o: memfile_test.c main.c vim.h protodef.h auto/config.h \ - feature.h os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h \ - option.h beval.h proto/gui_beval.pro structs.h regexp.h gui.h alloc.h \ - ex_cmds.h spell.h proto.h globals.h memfile.c + feature.h os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h \ + option.h beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h memfile.c objects/message_test.o: message_test.c main.c vim.h protodef.h auto/config.h \ - feature.h os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h \ - option.h beval.h proto/gui_beval.pro structs.h regexp.h gui.h alloc.h \ - ex_cmds.h spell.h proto.h globals.h message.c -objects/hangulin.o: hangulin.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + feature.h os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h \ + option.h beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h message.c objects/if_lua.o: if_lua.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/if_mzsch.o: if_mzsch.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h if_mzsch.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h if_mzsch.h objects/if_perl.o: auto/if_perl.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/if_perlsfio.o: if_perlsfio.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/if_python.o: if_python.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h if_py_both.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h if_py_both.h objects/if_python3.o: if_python3.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h if_py_both.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h if_py_both.h objects/if_tcl.o: if_tcl.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/if_ruby.o: if_ruby.c protodef.h auto/config.h vim.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h objects/gui_beval.o: gui_beval.c vim.h protodef.h auto/config.h feature.h \ - os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/netbeans.o: netbeans.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h version.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h version.h +objects/job.o: job.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/channel.o: channel.c vim.h protodef.h auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \ - proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \ - proto.h globals.h + auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c objects/vterm_encoding.o: libvterm/src/encoding.c libvterm/src/vterm_internal.h \ libvterm/include/vterm.h libvterm/include/vterm_keycodes.h \ @@ -4128,67 +4416,80 @@ objects/vterm_parser.o: libvterm/src/parser.c libvterm/src/vterm_internal.h \ libvterm/include/vterm.h libvterm/include/vterm_keycodes.h objects/vterm_pen.o: libvterm/src/pen.c libvterm/src/vterm_internal.h \ libvterm/include/vterm.h libvterm/include/vterm_keycodes.h -objects/vterm_state.o: libvterm/src/state.c libvterm/src/vterm_internal.h \ - libvterm/include/vterm.h libvterm/include/vterm_keycodes.h objects/vterm_screen.o: libvterm/src/screen.c libvterm/src/vterm_internal.h \ libvterm/include/vterm.h libvterm/include/vterm_keycodes.h \ libvterm/src/rect.h libvterm/src/utf8.h -objects/vterm_unicode.o: libvterm/src/unicode.c libvterm/src/vterm_internal.h \ +objects/vterm_state.o: libvterm/src/state.c libvterm/src/vterm_internal.h \ libvterm/include/vterm.h libvterm/include/vterm_keycodes.h +objects/vterm_unicode.o: libvterm/src/unicode.c libvterm/src/vterm_internal.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h \ + libvterm/src/fullwidth.inc objects/vterm_vterm.o: libvterm/src/vterm.c libvterm/src/vterm_internal.h \ libvterm/include/vterm.h libvterm/include/vterm_keycodes.h \ libvterm/src/utf8.h objects/xdiffi.o: xdiff/xdiffi.c xdiff/xinclude.h auto/config.h \ xdiff/xmacros.h xdiff/xdiff.h vim.h protodef.h \ auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h \ - macros.h option.h beval.h proto/gui_beval.pro \ - structs.h regexp.h gui.h alloc.h \ + auto/osdef.h ascii.h keymap.h \ + termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h \ ex_cmds.h spell.h proto.h globals.h \ - xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h \ - xdiff/xemit.h + errors.h xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h \ + xdiff/xdiffi.h xdiff/xemit.h objects/xemit.o: xdiff/xemit.c xdiff/xinclude.h auto/config.h \ xdiff/xmacros.h xdiff/xdiff.h vim.h protodef.h \ auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h \ - macros.h option.h beval.h proto/gui_beval.pro \ - structs.h regexp.h gui.h alloc.h \ + auto/osdef.h ascii.h keymap.h \ + termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h \ ex_cmds.h spell.h proto.h globals.h \ - xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h \ - xdiff/xemit.h + errors.h xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h \ + xdiff/xdiffi.h xdiff/xemit.h objects/xprepare.o: xdiff/xprepare.c xdiff/xinclude.h auto/config.h \ xdiff/xmacros.h xdiff/xdiff.h vim.h protodef.h \ auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h \ - macros.h option.h beval.h proto/gui_beval.pro \ - structs.h regexp.h gui.h alloc.h \ + auto/osdef.h ascii.h keymap.h \ + termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h \ ex_cmds.h spell.h proto.h globals.h \ - xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h \ - xdiff/xemit.h + errors.h xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h \ + xdiff/xdiffi.h xdiff/xemit.h objects/xutils.o: xdiff/xutils.c xdiff/xinclude.h auto/config.h \ xdiff/xmacros.h xdiff/xdiff.h vim.h protodef.h \ auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h \ - macros.h option.h beval.h proto/gui_beval.pro \ - structs.h regexp.h gui.h alloc.h \ + auto/osdef.h ascii.h keymap.h \ + termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h \ ex_cmds.h spell.h proto.h globals.h \ - xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h \ - xdiff/xemit.h + errors.h xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h \ + xdiff/xdiffi.h xdiff/xemit.h objects/xhistogram.o: xdiff/xhistogram.c xdiff/xinclude.h auto/config.h \ xdiff/xmacros.h xdiff/xdiff.h vim.h protodef.h \ auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h \ - macros.h option.h beval.h proto/gui_beval.pro \ - structs.h regexp.h gui.h alloc.h \ + auto/osdef.h ascii.h keymap.h \ + termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h \ ex_cmds.h spell.h proto.h globals.h \ - xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h \ - xdiff/xemit.h + errors.h xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h \ + xdiff/xdiffi.h xdiff/xemit.h objects/xpatience.o: xdiff/xpatience.c xdiff/xinclude.h auto/config.h \ xdiff/xmacros.h xdiff/xdiff.h vim.h protodef.h \ auto/config.h feature.h os_unix.h \ - auto/osdef.h ascii.h keymap.h term.h \ - macros.h option.h beval.h proto/gui_beval.pro \ - structs.h regexp.h gui.h alloc.h \ + auto/osdef.h ascii.h keymap.h \ + termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h alloc.h \ ex_cmds.h spell.h proto.h globals.h \ - xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h \ - xdiff/xemit.h + errors.h xdiff/xtypes.h xdiff/xutils.h xdiff/xprepare.h \ + xdiff/xdiffi.h xdiff/xemit.h diff --git a/src/README.md b/src/README.md index 5d173084259b1..cefbecaef092a 100644 --- a/src/README.md +++ b/src/README.md @@ -23,6 +23,7 @@ Most code can be found in a file with an obvious name (incomplete list): File name | Description --------------- | ----------- +alloc.c | memory management arglist.c | handling argument list autocmd.c | autocommands blob.c | blob data type @@ -30,6 +31,8 @@ buffer.c | manipulating buffers (loaded files) bufwrite.c | writing a buffer to file change.c | handling changes to text cindent.c | C and Lisp indentation +clientserver.c | client server functionality +clipboard.c | handling the clipboard cmdexpand.c | command-line completion cmdhist.c | command-line history debugger.c | vim script debugger @@ -46,11 +49,15 @@ filepath.c | dealing with file names and paths findfile.c | search for files in 'path' fold.c | folding getchar.c | getting characters and key mapping +help.c | vim help related functions highlight.c | syntax highlighting indent.c | text indentation insexpand.c | Insert mode completion -mark.c | marks +locale.c | locale/language handling map.c | mapping and abbreviations +mark.c | marks +match.c | highlight matching +float.c | floating point functions mbyte.c | multi-byte character handling memfile.c | storing lines for buffers in a swapfile memline.c | storing lines for buffers in memory @@ -74,11 +81,16 @@ sign.c | signs spell.c | spell checking core spellfile.c | spell file handling spellsuggest.c | spell correction suggestions +strings.c | string manipulation functions syntax.c | syntax and other highlighting tag.c | tags term.c | terminal handling, termcap codes testing.c | testing: assert and test functions +textformat.c | text formatting +textobject.c | text objects textprop.c | text properties +time.c | time and timer functions +typval.c | vim script type/value functions undo.c | undo and redo usercmd.c | user defined commands userfunc.c | user defined functions @@ -220,4 +232,4 @@ If you would like to help making Vim better, see the file. -This is `README.md` for version 8.1 of the Vim source code. +This is `README.md` for version 8.2 of the Vim source code. diff --git a/src/VisVim/README_VisVim.txt b/src/VisVim/README_VisVim.txt index d96becf113046..f96f102d1ba50 100644 --- a/src/VisVim/README_VisVim.txt +++ b/src/VisVim/README_VisVim.txt @@ -213,7 +213,7 @@ Troubleshooting Cause: You can't delete an item you once added to the add-ins list box. Explanation: M$ just didn't put a 'delete' button in the dialog box. - Unfortunately there is no DEL key accellerator as well... + Unfortunately there is no DEL key accelerator as well... Workaround: You can't kill it, but you can knock it out: 1. Uncheck the check box in front of 'Vim Developer Studio Add-in'. diff --git a/src/alloc.c b/src/alloc.c new file mode 100644 index 0000000000000..a8584de7396db --- /dev/null +++ b/src/alloc.c @@ -0,0 +1,903 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * alloc.c: functions for memory management + */ + +#include "vim.h" + +/********************************************************************** + * Various routines dealing with allocation and deallocation of memory. + */ + +#if defined(MEM_PROFILE) || defined(PROTO) + +# define MEM_SIZES 8200 +static __thread long_u mem_allocs[MEM_SIZES]; +static __thread long_u mem_frees[MEM_SIZES]; +static __thread long_u mem_allocated; +static __thread long_u mem_freed; +static __thread long_u mem_peak; +static __thread long_u num_alloc; +static __thread long_u num_freed; + + static void +mem_pre_alloc_s(size_t *sizep) +{ + *sizep += sizeof(size_t); +} + + static void +mem_pre_alloc_l(size_t *sizep) +{ + *sizep += sizeof(size_t); +} + + static void +mem_post_alloc( + void **pp, + size_t size) +{ + if (*pp == NULL) + return; + size -= sizeof(size_t); + *(long_u *)*pp = size; + if (size <= MEM_SIZES-1) + mem_allocs[size-1]++; + else + mem_allocs[MEM_SIZES-1]++; + mem_allocated += size; + if (mem_allocated - mem_freed > mem_peak) + mem_peak = mem_allocated - mem_freed; + num_alloc++; + *pp = (void *)((char *)*pp + sizeof(size_t)); +} + + static void +mem_pre_free(void **pp) +{ + long_u size; + + *pp = (void *)((char *)*pp - sizeof(size_t)); + size = *(size_t *)*pp; + if (size <= MEM_SIZES-1) + mem_frees[size-1]++; + else + mem_frees[MEM_SIZES-1]++; + mem_freed += size; + num_freed++; +} + +/* + * called on exit via atexit() + */ + void +vim_mem_profile_dump(void) +{ + int i, j; + + printf("\r\n"); + j = 0; + for (i = 0; i < MEM_SIZES - 1; i++) + { + if (mem_allocs[i] || mem_frees[i]) + { + if (mem_frees[i] > mem_allocs[i]) + printf("\r\n%s", _("ERROR: ")); + printf("[%4d / %4lu-%-4lu] ", i + 1, mem_allocs[i], mem_frees[i]); + j++; + if (j > 3) + { + j = 0; + printf("\r\n"); + } + } + } + + i = MEM_SIZES - 1; + if (mem_allocs[i]) + { + printf("\r\n"); + if (mem_frees[i] > mem_allocs[i]) + puts(_("ERROR: ")); + printf("[>%d / %4lu-%-4lu]", i, mem_allocs[i], mem_frees[i]); + } + + printf(_("\n[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"), + mem_allocated, mem_freed, mem_allocated - mem_freed, mem_peak); + printf(_("[calls] total re/malloc()'s %lu, total free()'s %lu\n\n"), + num_alloc, num_freed); +} + +#endif // MEM_PROFILE + +#ifdef FEAT_EVAL + int +alloc_does_fail(size_t size) +{ + if (alloc_fail_countdown == 0) + { + if (--alloc_fail_repeat <= 0) + alloc_fail_id = 0; + do_outofmem_msg(size); + return TRUE; + } + --alloc_fail_countdown; + return FALSE; +} +#endif + +/* + * Some memory is reserved for error messages and for being able to + * call mf_release_all(), which needs some memory for mf_trans_add(). + */ +#define KEEP_ROOM (2 * 8192L) +#define KEEP_ROOM_KB (KEEP_ROOM / 1024L) + +/* + * The normal way to allocate memory. This handles an out-of-memory situation + * as well as possible, still returns NULL when we're completely out. + */ + void * +alloc(size_t size) +{ + return lalloc(size, TRUE); +} + +#if defined(FEAT_QUICKFIX) || defined(PROTO) +/* + * alloc() with an ID for alloc_fail(). + */ + void * +alloc_id(size_t size, alloc_id_T id UNUSED) +{ +#ifdef FEAT_EVAL + if (alloc_fail_id == id && alloc_does_fail(size)) + return NULL; +#endif + return lalloc(size, TRUE); +} +#endif + +/* + * Allocate memory and set all bytes to zero. + */ + void * +alloc_clear(size_t size) +{ + void *p; + + p = lalloc(size, TRUE); + if (p != NULL) + (void)vim_memset(p, 0, size); + return p; +} + +/* + * Same as alloc_clear() but with allocation id for testing + */ + void * +alloc_clear_id(size_t size, alloc_id_T id UNUSED) +{ +#ifdef FEAT_EVAL + if (alloc_fail_id == id && alloc_does_fail(size)) + return NULL; +#endif + return alloc_clear(size); +} + +/* + * Allocate memory like lalloc() and set all bytes to zero. + */ + void * +lalloc_clear(size_t size, int message) +{ + void *p; + + p = lalloc(size, message); + if (p != NULL) + (void)vim_memset(p, 0, size); + return p; +} + +/* + * Low level memory allocation function. + * This is used often, KEEP IT FAST! + */ + void * +lalloc(size_t size, int message) +{ + void *p; // pointer to new storage space + static int releasing = FALSE; // don't do mf_release_all() recursive + int try_again; +#if defined(HAVE_AVAIL_MEM) + static size_t allocated = 0; // allocated since last avail check +#endif + + // Safety check for allocating zero bytes + if (size == 0) + { + // Don't hide this message + emsg_silent = 0; + iemsg(_(e_internal_error_lalloc_zero)); + return NULL; + } + +#ifdef MEM_PROFILE + mem_pre_alloc_l(&size); +#endif + + // Loop when out of memory: Try to release some memfile blocks and + // if some blocks are released call malloc again. + for (;;) + { + // Handle three kinds of systems: + // 1. No check for available memory: Just return. + // 2. Slow check for available memory: call mch_avail_mem() after + // allocating KEEP_ROOM amount of memory. + // 3. Strict check for available memory: call mch_avail_mem() + if ((p = malloc(size)) != NULL) + { +#ifndef HAVE_AVAIL_MEM + // 1. No check for available memory: Just return. + goto theend; +#else + // 2. Slow check for available memory: call mch_avail_mem() after + // allocating (KEEP_ROOM / 2) amount of memory. + allocated += size; + if (allocated < KEEP_ROOM / 2) + goto theend; + allocated = 0; + + // 3. check for available memory: call mch_avail_mem() + if (mch_avail_mem(TRUE) < KEEP_ROOM_KB && !releasing) + { + free(p); // System is low... no go! + p = NULL; + } + else + goto theend; +#endif + } + // Remember that mf_release_all() is being called to avoid an endless + // loop, because mf_release_all() may call alloc() recursively. + if (releasing) + break; + releasing = TRUE; + + clear_sb_text(TRUE); // free any scrollback text + try_again = mf_release_all(); // release as many blocks as possible + + releasing = FALSE; + if (!try_again) + break; + } + + if (message && p == NULL) + do_outofmem_msg(size); + +theend: +#ifdef MEM_PROFILE + mem_post_alloc(&p, size); +#endif + return p; +} + +/* + * lalloc() with an ID for alloc_fail(). + */ +#if defined(FEAT_SIGNS) || defined(PROTO) + void * +lalloc_id(size_t size, int message, alloc_id_T id UNUSED) +{ +#ifdef FEAT_EVAL + if (alloc_fail_id == id && alloc_does_fail(size)) + return NULL; +#endif + return (lalloc(size, message)); +} +#endif + +#if defined(MEM_PROFILE) || defined(PROTO) +/* + * realloc() with memory profiling. + */ + void * +mem_realloc(void *ptr, size_t size) +{ + void *p; + + mem_pre_free(&ptr); + mem_pre_alloc_s(&size); + + p = realloc(ptr, size); + + mem_post_alloc(&p, size); + + return p; +} +#endif + +/* +* Avoid repeating the error message many times (they take 1 second each). +* Did_outofmem_msg is reset when a character is read. +*/ + void +do_outofmem_msg(size_t size) +{ + if (!did_outofmem_msg) + { + // Don't hide this message + emsg_silent = 0; + + // Must come first to avoid coming back here when printing the error + // message fails, e.g. when setting v:errmsg. + did_outofmem_msg = TRUE; + + semsg(_(e_out_of_memory_allocating_nr_bytes), (long_u)size); + + if (starting == NO_SCREEN) + // Not even finished with initializations and already out of + // memory? Then nothing is going to work, exit. + mch_exit(123); + } +} + +#if defined(EXITFREE) || defined(PROTO) + +/* + * Free everything that we allocated. + * Can be used to detect memory leaks, e.g., with ccmalloc. + * NOTE: This is tricky! Things are freed that functions depend on. Don't be + * surprised if Vim crashes... + * Some things can't be freed, esp. things local to a library function. + */ + void +free_all_mem(void) +{ + buf_T *buf, *nextbuf; + + // When we cause a crash here it is caught and Vim tries to exit cleanly. + // Don't try freeing everything again. + if (entered_free_all_mem) + return; + entered_free_all_mem = TRUE; + // Don't want to trigger autocommands from here on. + block_autocmds(); + + // Close all tabs and windows. Reset 'equalalways' to avoid redraws. + p_ea = FALSE; + if (first_tabpage != NULL && first_tabpage->tp_next != NULL) + do_cmdline_cmd((char_u *)"tabonly!"); + if (!ONE_WINDOW) + do_cmdline_cmd((char_u *)"only!"); + +# if defined(FEAT_SPELL) + // Free all spell info. + spell_free_all(); +# endif + +# if defined(FEAT_BEVAL_TERM) + ui_remove_balloon(); +# endif +# ifdef FEAT_PROP_POPUP + if (curwin != NULL) + close_all_popups(TRUE); +# endif + + // Clear user commands (before deleting buffers). + ex_comclear(NULL); + + // When exiting from mainerr_arg_missing curbuf has not been initialized, + // and not much else. + if (curbuf != NULL) + { +# ifdef FEAT_MENU + // Clear menus. + do_cmdline_cmd((char_u *)"aunmenu *"); +# ifdef FEAT_MULTI_LANG + do_cmdline_cmd((char_u *)"menutranslate clear"); +# endif +# endif + // Clear mappings, abbreviations, breakpoints. + do_cmdline_cmd((char_u *)"lmapclear"); + do_cmdline_cmd((char_u *)"xmapclear"); + do_cmdline_cmd((char_u *)"mapclear"); + do_cmdline_cmd((char_u *)"mapclear!"); + do_cmdline_cmd((char_u *)"abclear"); +# if defined(FEAT_EVAL) + do_cmdline_cmd((char_u *)"breakdel *"); +# endif +# if defined(FEAT_PROFILE) + do_cmdline_cmd((char_u *)"profdel *"); +# endif +# if defined(FEAT_KEYMAP) + do_cmdline_cmd((char_u *)"set keymap="); +# endif + } + + free_titles(); +# if defined(FEAT_SEARCHPATH) + free_findfile(); +# endif + + // Obviously named calls. + free_all_autocmds(); + clear_termcodes(); + free_all_marks(); + alist_clear(&global_alist); + free_homedir(); + free_users(); + free_search_patterns(); + free_old_sub(); + free_last_insert(); + free_insexpand_stuff(); + free_prev_shellcmd(); + free_regexp_stuff(); + free_tag_stuff(); + free_xim_stuff(); + free_cd_dir(); +# ifdef FEAT_SIGNS + free_signs(); +# endif +# ifdef FEAT_EVAL + set_expr_line(NULL, NULL); +# endif +# ifdef FEAT_DIFF + if (curtab != NULL) + diff_clear(curtab); +# endif + clear_sb_text(TRUE); // free any scrollback text + + // Free some global vars. + free_username(); +# ifdef FEAT_CLIPBOARD + vim_regfree(clip_exclude_prog); +# endif + vim_free(last_cmdline); + vim_free(new_last_cmdline); + set_keep_msg(NULL, 0); + + // Clear cmdline history. + p_hi = 0; + init_history(); +# ifdef FEAT_PROP_POPUP + clear_global_prop_types(); +# endif + +# ifdef FEAT_QUICKFIX + { + win_T *win; + tabpage_T *tab; + + qf_free_all(NULL); + // Free all location lists + FOR_ALL_TAB_WINDOWS(tab, win) + qf_free_all(win); + } +# endif + + // Close all script inputs. + close_all_scripts(); + + if (curwin != NULL) + // Destroy all windows. Must come before freeing buffers. + win_free_all(); + + // Free all option values. Must come after closing windows. + free_all_options(); + + // Free all buffers. Reset 'autochdir' to avoid accessing things that + // were freed already. +# ifdef FEAT_AUTOCHDIR + p_acd = FALSE; +# endif + for (buf = firstbuf; buf != NULL; ) + { + bufref_T bufref; + + set_bufref(&bufref, buf); + nextbuf = buf->b_next; + close_buffer(NULL, buf, DOBUF_WIPE, FALSE, FALSE); + if (bufref_valid(&bufref)) + buf = nextbuf; // didn't work, try next one + else + buf = firstbuf; + } + +# ifdef FEAT_ARABIC + free_arshape_buf(); +# endif + + // Clear registers. + clear_registers(); + ResetRedobuff(); + ResetRedobuff(); + +# if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) + vim_free(serverDelayedStartName); +# endif + + // highlight info + free_highlight(); + + reset_last_sourcing(); + + if (first_tabpage != NULL) + { + free_tabpage(first_tabpage); + first_tabpage = NULL; + } + +# ifdef UNIX + // Machine-specific free. + mch_free_mem(); +# endif + + // message history + for (;;) + if (delete_first_msg() == FAIL) + break; + +# ifdef FEAT_JOB_CHANNEL + channel_free_all(); +# endif +# ifdef FEAT_TIMERS + timer_free_all(); +# endif +# ifdef FEAT_EVAL + // must be after channel_free_all() with unrefs partials + eval_clear(); +# endif +# ifdef FEAT_JOB_CHANNEL + // must be after eval_clear() with unrefs jobs + job_free_all(); +# endif + + free_termoptions(); + free_cur_term(); + + // screenlines (can't display anything now!) + free_screenlines(); + +# if defined(FEAT_SOUND) + sound_free(); +# endif +# if defined(USE_XSMP) + xsmp_close(); +# endif +# ifdef FEAT_GUI_GTK + gui_mch_free_all(); +# endif +# ifdef FEAT_TCL + vim_tcl_finalize(); +# endif + clear_hl_tables(); + + vim_free(IObuff); + vim_free(NameBuff); +# ifdef FEAT_QUICKFIX + check_quickfix_busy(); +# endif +# ifdef FEAT_EVAL + free_resub_eval_result(); +# endif +} +#endif + +/* + * Copy "p[len]" into allocated memory, ignoring NUL characters. + * Returns NULL when out of memory. + */ + char_u * +vim_memsave(char_u *p, size_t len) +{ + char_u *ret = alloc(len); + + if (ret != NULL) + mch_memmove(ret, p, len); + return ret; +} + +/* + * Replacement for free() that ignores NULL pointers. + * Also skip free() when exiting for sure, this helps when we caught a deadly + * signal that was caused by a crash in free(). + * If you want to set NULL after calling this function, you should use + * VIM_CLEAR() instead. + */ + void +vim_free(void *x) +{ + if (x != NULL && !really_exiting) + { +#ifdef MEM_PROFILE + mem_pre_free(&x); +#endif + free(x); + } +} + +/************************************************************************ + * Functions for handling growing arrays. + */ + +/* + * Clear an allocated growing array. + */ + void +ga_clear(garray_T *gap) +{ + vim_free(gap->ga_data); + ga_init(gap); +} + +/* + * Clear a growing array that contains a list of strings. + */ + void +ga_clear_strings(garray_T *gap) +{ + int i; + + if (gap->ga_data != NULL) + for (i = 0; i < gap->ga_len; ++i) + vim_free(((char_u **)(gap->ga_data))[i]); + ga_clear(gap); +} + +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * Copy a growing array that contains a list of strings. + */ + int +ga_copy_strings(garray_T *from, garray_T *to) +{ + int i; + + ga_init2(to, sizeof(char_u *), 1); + if (ga_grow(to, from->ga_len) == FAIL) + return FAIL; + + for (i = 0; i < from->ga_len; ++i) + { + char_u *orig = ((char_u **)from->ga_data)[i]; + char_u *copy; + + if (orig == NULL) + copy = NULL; + else + { + copy = vim_strsave(orig); + if (copy == NULL) + { + to->ga_len = i; + ga_clear_strings(to); + return FAIL; + } + } + ((char_u **)to->ga_data)[i] = copy; + } + to->ga_len = from->ga_len; + return OK; +} +#endif + +/* + * Initialize a growing array. Don't forget to set ga_itemsize and + * ga_growsize! Or use ga_init2(). + */ + void +ga_init(garray_T *gap) +{ + gap->ga_data = NULL; + gap->ga_maxlen = 0; + gap->ga_len = 0; +} + + void +ga_init2(garray_T *gap, size_t itemsize, int growsize) +{ + ga_init(gap); + gap->ga_itemsize = (int)itemsize; + gap->ga_growsize = growsize; +} + +/* + * Make room in growing array "gap" for at least "n" items. + * Return FAIL for failure, OK otherwise. + */ + int +ga_grow(garray_T *gap, int n) +{ + if (gap->ga_maxlen - gap->ga_len < n) + return ga_grow_inner(gap, n); + return OK; +} + +/* + * Same as ga_grow() but uses an allocation id for testing. + */ + int +ga_grow_id(garray_T *gap, int n, alloc_id_T id UNUSED) +{ +#ifdef FEAT_EVAL + if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T))) + return FAIL; +#endif + + return ga_grow(gap, n); +} + + int +ga_grow_inner(garray_T *gap, int n) +{ + size_t old_len; + size_t new_len; + char_u *pp; + + if (n < gap->ga_growsize) + n = gap->ga_growsize; + + // A linear growth is very inefficient when the array grows big. This + // is a compromise between allocating memory that won't be used and too + // many copy operations. A factor of 1.5 seems reasonable. + if (n < gap->ga_len / 2) + n = gap->ga_len / 2; + + new_len = (size_t)gap->ga_itemsize * (gap->ga_len + n); + pp = vim_realloc(gap->ga_data, new_len); + if (pp == NULL) + return FAIL; + old_len = (size_t)gap->ga_itemsize * gap->ga_maxlen; + vim_memset(pp + old_len, 0, new_len - old_len); + gap->ga_maxlen = gap->ga_len + n; + gap->ga_data = pp; + return OK; +} + +/* + * For a growing array that contains a list of strings: concatenate all the + * strings with a separating "sep". + * Returns NULL when out of memory. + */ + char_u * +ga_concat_strings(garray_T *gap, char *sep) +{ + int i; + int len = 0; + int sep_len = (int)STRLEN(sep); + char_u *s; + char_u *p; + + for (i = 0; i < gap->ga_len; ++i) + len += (int)STRLEN(((char_u **)(gap->ga_data))[i]) + sep_len; + + s = alloc(len + 1); + if (s != NULL) + { + *s = NUL; + p = s; + for (i = 0; i < gap->ga_len; ++i) + { + if (p != s) + { + STRCPY(p, sep); + p += sep_len; + } + STRCPY(p, ((char_u **)(gap->ga_data))[i]); + p += STRLEN(p); + } + } + return s; +} + +/* + * Make a copy of string "p" and add it to "gap". + * When out of memory nothing changes and FAIL is returned. + */ + int +ga_copy_string(garray_T *gap, char_u *p) +{ + char_u *cp = vim_strsave(p); + + if (cp == NULL) + return FAIL; + + if (ga_grow(gap, 1) == FAIL) + { + vim_free(cp); + return FAIL; + } + ((char_u **)(gap->ga_data))[gap->ga_len++] = cp; + return OK; +} + +/* + * Add string "p" to "gap". + * When out of memory "p" is freed and FAIL is returned. + */ + int +ga_add_string(garray_T *gap, char_u *p) +{ + if (ga_grow(gap, 1) == FAIL) + return FAIL; + ((char_u **)(gap->ga_data))[gap->ga_len++] = p; + return OK; +} + +/* + * Concatenate a string to a growarray which contains bytes. + * When "s" is NULL memory allocation fails does not do anything. + * Note: Does NOT copy the NUL at the end! + */ + void +ga_concat(garray_T *gap, char_u *s) +{ + int len; + + if (s == NULL || *s == NUL) + return; + len = (int)STRLEN(s); + if (ga_grow(gap, len) == OK) + { + mch_memmove((char *)gap->ga_data + gap->ga_len, s, (size_t)len); + gap->ga_len += len; + } +} + +/* + * Concatenate 'len' bytes from string 's' to a growarray. + * When "s" is NULL does not do anything. + */ + void +ga_concat_len(garray_T *gap, char_u *s, size_t len) +{ + if (s == NULL || *s == NUL || len == 0) + return; + if (ga_grow(gap, (int)len) == OK) + { + mch_memmove((char *)gap->ga_data + gap->ga_len, s, len); + gap->ga_len += (int)len; + } +} + +/* + * Append one byte to a growarray which contains bytes. + */ + int +ga_append(garray_T *gap, int c) +{ + if (ga_grow(gap, 1) == FAIL) + return FAIL; + *((char *)gap->ga_data + gap->ga_len) = c; + ++gap->ga_len; + return OK; +} + +#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(MSWIN) \ + || defined(PROTO) +/* + * Append the text in "gap" below the cursor line and clear "gap". + */ + void +append_ga_line(garray_T *gap) +{ + // Remove trailing CR. + if (gap->ga_len > 0 + && !curbuf->b_p_bin + && ((char_u *)gap->ga_data)[gap->ga_len - 1] == CAR) + --gap->ga_len; + ga_append(gap, NUL); + ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE); + gap->ga_len = 0; +} +#endif + diff --git a/src/alloc.h b/src/alloc.h index 8babde3bd7f1f..651e01f2418a1 100644 --- a/src/alloc.h +++ b/src/alloc.h @@ -8,26 +8,42 @@ /* * alloc.h: enumeration of alloc IDs. + * Used by test_alloc_fail() to test memory allocation failures. * Each entry must be on exactly one line, GetAllocId() depends on that. */ typedef enum { - aid_none = 0, - aid_qf_dirname_start, - aid_qf_dirname_now, - aid_qf_namebuf, - aid_qf_module, - aid_qf_errmsg, - aid_qf_pattern, - aid_tagstack_items, - aid_tagstack_from, - aid_tagstack_details, - aid_sign_getdefined, - aid_sign_getplaced, - aid_sign_define_by_name, - aid_sign_getlist, - aid_sign_getplaced_dict, - aid_sign_getplaced_list, - aid_insert_sign, - aid_sign_getinfo, - aid_last + aid_none = 0, + aid_qf_dirname_start, + aid_qf_dirname_now, + aid_qf_namebuf, + aid_qf_module, + aid_qf_errmsg, + aid_qf_pattern, + aid_qf_efm_fmtstr, + aid_qf_efm_fmtpart, + aid_qf_title, + aid_qf_mef_name, + aid_qf_qfline, + aid_qf_qfinfo, + aid_qf_dirstack, + aid_qf_multiline_pfx, + aid_qf_makecmd, + aid_qf_linebuf, + aid_tagstack_items, + aid_tagstack_from, + aid_tagstack_details, + aid_sign_getdefined, + aid_sign_getplaced, + aid_sign_define_by_name, + aid_sign_getlist, + aid_sign_getplaced_dict, + aid_sign_getplaced_list, + aid_insert_sign, + aid_sign_getinfo, + aid_newbuf_bvars, + aid_newwin_wvars, + aid_newtabpage_tvars, + aid_blob_alloc, + aid_get_func, + aid_last } alloc_id_T; diff --git a/src/arabic.c b/src/arabic.c index c6a58b37519a7..e75d3b5eeaac8 100644 --- a/src/arabic.c +++ b/src/arabic.c @@ -163,8 +163,6 @@ static __thread struct achar { #define a_BYTE_ORDER_MARK 0xfeff -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - /* * Find the struct achar pointer to the given Arabic char. * Returns NULL if not found. @@ -175,7 +173,7 @@ find_achar(int c) int h, m, l; // using binary search to find c - h = ARRAY_SIZE(achars); + h = ARRAY_LENGTH(achars); l = 0; while (l < h) { diff --git a/src/arglist.c b/src/arglist.c index b1a6a0b2f59f5..5c2236927e076 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -17,12 +17,29 @@ #define AL_ADD 2 #define AL_DEL 3 +// This flag is set whenever the argument list is being changed and calling a +// function that might trigger an autocommand. +static int arglist_locked = FALSE; + + static int +check_arglist_locked(void) +{ + if (arglist_locked) + { + emsg(_(e_cannot_change_arglist_recursively)); + return FAIL; + } + return OK; +} + /* * Clear an argument list: free all file names and reset it to zero entries. */ void alist_clear(alist_T *al) { + if (check_arglist_locked() == FAIL) + return; while (--al->al_ga.ga_len >= 0) vim_free(AARGLIST(al)[al->al_ga.ga_len].ae_fname); ga_clear(&al->al_ga); @@ -34,7 +51,7 @@ alist_clear(alist_T *al) void alist_init(alist_T *al) { - ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5); + ga_init2(&al->al_ga, sizeof(aentry_T), 5); } /* @@ -126,17 +143,12 @@ alist_set( int fnum_len) { int i; - static int recursive = 0; - if (recursive) - { - emsg(_(e_au_recursive)); + if (check_arglist_locked() == FAIL) return; - } - ++recursive; alist_clear(al); - if (ga_grow(&al->al_ga, count) == OK) + if (GA_GROW_OK(&al->al_ga, count)) { for (i = 0; i < count; ++i) { @@ -152,7 +164,11 @@ alist_set( // May set buffer name of a buffer previously used for the // argument list, so that it's re-used by alist_add. if (fnum_list != NULL && i < fnum_len) + { + arglist_locked = TRUE; buf_set_name(fnum_list[i], files[i]); + arglist_locked = FALSE; + } alist_add(al, files[i], use_curbuf ? 2 : 1); ui_breakcheck(); @@ -163,8 +179,6 @@ alist_set( FreeWild(count, files); if (al == &global_alist) arg_had_last = FALSE; - - --recursive; } /* @@ -179,6 +193,10 @@ alist_add( { if (fname == NULL) // don't add NULL file names return; + if (check_arglist_locked() == FAIL) + return; + arglist_locked = TRUE; + #ifdef BACKSLASH_IN_FILENAME slash_adjust(fname); #endif @@ -187,6 +205,8 @@ alist_add( AARGLIST(al)[al->al_ga.ga_len].ae_fnum = buflist_add(fname, BLN_LISTED | (set_fnum == 2 ? BLN_CURBUF : 0)); ++al->al_ga.ga_len; + + arglist_locked = FALSE; } #if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) @@ -255,7 +275,7 @@ do_one_arg(char_u *str) static int get_arglist(garray_T *gap, char_u *str, int escaped) { - ga_init2(gap, (int)sizeof(char_u *), 20); + ga_init2(gap, sizeof(char_u *), 20); while (*str != NUL) { if (ga_grow(gap, 1) == FAIL) @@ -295,10 +315,10 @@ get_arglist_exp( return FAIL; if (wig == TRUE) i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, - fcountp, fnamesp, EW_FILE|EW_NOTFOUND); + fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD); else i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, - fcountp, fnamesp, EW_FILE|EW_NOTFOUND); + fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD); ga_clear(&ga); return i; @@ -334,7 +354,8 @@ alist_add_list( int i; int old_argcount = ARGCOUNT; - if (ga_grow(&ALIST(curwin)->al_ga, count) == OK) + if (check_arglist_locked() != FAIL + && GA_GROW_OK(&ALIST(curwin)->al_ga, count)) { if (after < 0) after = 0; @@ -343,6 +364,7 @@ alist_add_list( if (after < ARGCOUNT) mch_memmove(&(ARGLIST[after + count]), &(ARGLIST[after]), (ARGCOUNT - after) * sizeof(aentry_T)); + arglist_locked = TRUE; for (i = 0; i < count; ++i) { int flags = BLN_LISTED | (will_edit ? BLN_CURBUF : 0); @@ -350,6 +372,7 @@ alist_add_list( ARGLIST[after + i].ae_fname = files[i]; ARGLIST[after + i].ae_fnum = buflist_add(files[i], flags); } + arglist_locked = FALSE; ALIST(curwin)->al_ga.ga_len += count; if (old_argcount > 0 && curwin->w_arg_idx >= after) curwin->w_arg_idx += count; @@ -382,6 +405,9 @@ do_arglist( int match; int arg_escaped = TRUE; + if (check_arglist_locked() == FAIL) + return FAIL; + // Set default argument for ":argadd" command. if (what == AL_ADD && *str == NUL) { @@ -409,7 +435,7 @@ do_arglist( p = file_pat_to_reg_pat(p, NULL, NULL, FALSE); if (p == NULL) break; - regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0); + regmatch.regprog = vim_regcomp(p, magic_isset() ? RE_MAGIC : 0); if (regmatch.regprog == NULL) { vim_free(p); @@ -434,7 +460,7 @@ do_arglist( vim_regfree(regmatch.regprog); vim_free(p); if (!didone) - semsg(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]); + semsg(_(e_no_match_str_2), ((char_u **)new_ga.ga_data)[i]); } ga_clear(&new_ga); } @@ -445,7 +471,7 @@ do_arglist( ga_clear(&new_ga); if (i == FAIL || exp_count == 0) { - emsg(_(e_nomatch)); + emsg(_(e_no_match)); return FAIL; } @@ -531,6 +557,8 @@ ex_args(exarg_T *eap) if (eap->cmdidx != CMD_args) { + if (check_arglist_locked() == FAIL) + return; alist_unlink(ALIST(curwin)); if (eap->cmdidx == CMD_argglobal) ALIST(curwin) = &global_alist; @@ -540,6 +568,8 @@ ex_args(exarg_T *eap) if (*eap->arg != NUL) { + if (check_arglist_locked() == FAIL) + return; // ":args file ..": define new argument list, handle like ":next" // Also for ":argslocal file .." and ":argsglobal file ..". ex_next(eap); @@ -569,7 +599,7 @@ ex_args(exarg_T *eap) garray_T *gap = &curwin->w_alist->al_ga; // ":argslocal": make a local copy of the global argument list. - if (ga_grow(gap, GARGCOUNT) == OK) + if (GA_GROW_OK(gap, GARGCOUNT)) for (i = 0; i < GARGCOUNT; ++i) if (GARGLIST[i].ae_fname != NULL) { @@ -638,16 +668,16 @@ do_argfile(exarg_T *eap, int argn) char_u *p; int old_arg_idx = curwin->w_arg_idx; - if (ERROR_IF_POPUP_WINDOW) + if (ERROR_IF_ANY_POPUP_WINDOW) return; if (argn < 0 || argn >= ARGCOUNT) { if (ARGCOUNT <= 1) - emsg(_("E163: There is only one file to edit")); + emsg(_(e_there_is_only_one_file_to_edit)); else if (argn < 0) - emsg(_("E164: Cannot go before first file")); + emsg(_(e_cannot_go_before_first_file)); else - emsg(_("E165: Cannot go beyond last file")); + emsg(_(e_cannot_go_beyond_last_file)); } else { @@ -657,7 +687,7 @@ do_argfile(exarg_T *eap, int argn) #endif // split window or create new tab page first - if (*eap->cmd == 's' || cmdmod.tab != 0) + if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) { if (win_split(0, 0) == FAIL) return; @@ -728,6 +758,33 @@ ex_next(exarg_T *eap) } } +/* + * ":argdedupe" + */ + void +ex_argdedupe(exarg_T *eap UNUSED) +{ + int i; + int j; + + for (i = 0; i < ARGCOUNT; ++i) + for (j = i + 1; j < ARGCOUNT; ++j) + if (fnamecmp(ARGLIST[i].ae_fname, ARGLIST[j].ae_fname) == 0) + { + vim_free(ARGLIST[j].ae_fname); + mch_memmove(ARGLIST + j, ARGLIST + j + 1, + (ARGCOUNT - j - 1) * sizeof(aentry_T)); + --ARGCOUNT; + + if (curwin->w_arg_idx == j) + curwin->w_arg_idx = i; + else if (curwin->w_arg_idx > j) + --curwin->w_arg_idx; + + --j; + } +} + /* * ":argedit" */ @@ -740,9 +797,7 @@ ex_argedit(exarg_T *eap) if (do_arglist(eap->arg, AL_ADD, i, TRUE) == FAIL) return; -#ifdef FEAT_TITLE maketitle(); -#endif if (curwin->w_arg_idx == 0 && (curbuf->b_ml.ml_flags & ML_EMPTY) @@ -762,9 +817,7 @@ ex_argadd(exarg_T *eap) do_arglist(eap->arg, AL_ADD, eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1, FALSE); -#ifdef FEAT_TITLE maketitle(); -#endif } /* @@ -776,20 +829,33 @@ ex_argdelete(exarg_T *eap) int i; int n; - if (eap->addr_count > 0) + if (check_arglist_locked() == FAIL) + return; + + if (eap->addr_count > 0 || *eap->arg == NUL) { - // ":1,4argdel": Delete all arguments in the range. - if (eap->line2 > ARGCOUNT) + // ":argdel" works like ":.argdel" + if (eap->addr_count == 0) + { + if (curwin->w_arg_idx >= ARGCOUNT) + { + emsg(_(e_no_argument_to_delete)); + return; + } + eap->line1 = eap->line2 = curwin->w_arg_idx + 1; + } + else if (eap->line2 > ARGCOUNT) + // ":1,4argdel": Delete all arguments in the range. eap->line2 = ARGCOUNT; n = eap->line2 - eap->line1 + 1; if (*eap->arg != NUL) // Can't have both a range and an argument. - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); else if (n <= 0) { // Don't give an error for ":%argdel" if the list is empty. if (eap->line1 != 1 || eap->line2 != 0) - emsg(_(e_invrange)); + emsg(_(e_invalid_range)); } else { @@ -808,13 +874,9 @@ ex_argdelete(exarg_T *eap) curwin->w_arg_idx = ARGCOUNT - 1; } } - else if (*eap->arg == NUL) - emsg(_(e_argreq)); else do_arglist(eap->arg, AL_DEL, 0, FALSE); -#ifdef FEAT_TITLE maketitle(); -#endif } /* @@ -864,17 +926,26 @@ do_arg_all( // int opened_len; // length of opened[] int use_firstwin = FALSE; // use first window for arglist + int tab_drop_empty_window = FALSE; int split_ret = OK; int p_ea_save; alist_T *alist; // argument list to be used buf_T *buf; tabpage_T *tpnext; - int had_tab = cmdmod.tab; + int had_tab = cmdmod.cmod_tab; win_T *old_curwin, *last_curwin; tabpage_T *old_curtab, *last_curtab; win_T *new_curwin = NULL; tabpage_T *new_curtab = NULL; + int prev_arglist_locked = arglist_locked; +#ifdef FEAT_CMDWIN + if (cmdwin_type != 0) + { + emsg(_(e_invalid_in_cmdline_window)); + return; + } +#endif if (ARGCOUNT <= 0) { // Don't give an error message. We don't want it when the ":all" @@ -893,13 +964,14 @@ do_arg_all( // watch out for its size to be changed. alist = curwin->w_alist; ++alist->al_refcount; + arglist_locked = TRUE; old_curwin = curwin; old_curtab = curtab; -# ifdef FEAT_GUI +#ifdef FEAT_GUI need_mouse_correct = TRUE; -# endif +#endif // Try closing all windows that are not in the argument list. // Also close windows that are not full width; @@ -1027,13 +1099,16 @@ do_arg_all( last_curwin = curwin; last_curtab = curtab; win_enter(lastwin, FALSE); - // ":drop all" should re-use an empty window to avoid "--remote-tab" + // ":tab drop file" should re-use an empty window to avoid "--remote-tab" // leaving an empty tab page when executed locally. if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1 && curbuf->b_ffname == NULL && !curbuf->b_changed) + { use_firstwin = TRUE; + tab_drop_empty_window = TRUE; + } - for (i = 0; i < count && i < opened_len && !got_int; ++i) + for (i = 0; i < count && !got_int; ++i) { if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1) arg_had_last = TRUE; @@ -1042,7 +1117,7 @@ do_arg_all( // Move the already present window to below the current window if (curwin->w_arg_idx != i) { - for (wpnext = firstwin; wpnext != NULL; wpnext = wpnext->w_next) + FOR_ALL_WINDOWS(wpnext) { if (wpnext->w_arg_idx == i) { @@ -1054,7 +1129,7 @@ do_arg_all( else if (wpnext->w_frame->fr_parent != curwin->w_frame->fr_parent) { - emsg(_("E249: window layout changed unexpectedly")); + emsg(_(e_window_layout_changed_unexpectedly)); i = count; break; } @@ -1067,6 +1142,9 @@ do_arg_all( } else if (split_ret == OK) { + // trigger events for tab drop + if (tab_drop_empty_window && i == count - 1) + --autocmd_no_enter; if (!use_firstwin) // split current window { p_ea_save = p_ea; @@ -1091,6 +1169,8 @@ do_arg_all( ((buf_hide(curwin->w_buffer) || bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0) + ECMD_OLDBUF, curwin); + if (tab_drop_empty_window && i == count - 1) + ++autocmd_no_enter; if (use_firstwin) ++autocmd_no_leave; use_firstwin = FALSE; @@ -1099,11 +1179,12 @@ do_arg_all( // When ":tab" was used open a new tab for a new window repeatedly. if (had_tab > 0 && tabpage_index(NULL) <= p_tpm) - cmdmod.tab = 9999; + cmdmod.cmod_tab = 9999; } // Remove the "lock" on the argument list. alist_unlink(alist); + arglist_locked = prev_arglist_locked; --autocmd_no_enter; @@ -1214,6 +1295,9 @@ f_argc(typval_T *argvars, typval_T *rettv) { win_T *wp; + if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL) + return; + if (argvars[0].v_type == VAR_UNKNOWN) // use the current window rettv->vval.v_number = ARGCOUNT; @@ -1249,6 +1333,12 @@ f_arglistid(typval_T *argvars, typval_T *rettv) { win_T *wp; + if (in_vim9script() + && (check_for_opt_number_arg(argvars, 0) == FAIL + || (argvars[0].v_type != VAR_UNKNOWN + && check_for_opt_number_arg(argvars, 1) == FAIL))) + return; + rettv->vval.v_number = -1; wp = find_tabwin(&argvars[0], &argvars[1], NULL); if (wp != NULL) @@ -1279,6 +1369,12 @@ f_argv(typval_T *argvars, typval_T *rettv) aentry_T *arglist = NULL; int argcount = -1; + if (in_vim9script() + && (check_for_opt_number_arg(argvars, 0) == FAIL + || (argvars[0].v_type != VAR_UNKNOWN + && check_for_opt_number_arg(argvars, 1) == FAIL))) + return; + if (argvars[0].v_type != VAR_UNKNOWN) { if (argvars[1].v_type == VAR_UNKNOWN) diff --git a/src/ascii.h b/src/ascii.h index 60a92b4825b70..ec839704ed008 100644 --- a/src/ascii.h +++ b/src/ascii.h @@ -8,14 +8,8 @@ /* * Definitions of various common control characters. - * For EBCDIC we have to use different values. */ -#ifndef EBCDIC - -/* IF_EB(ASCII_constant, EBCDIC_constant) */ -#define IF_EB(a, b) a - #define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a') #define CharOrdLow(x) ((x) - 'a') #define CharOrdUp(x) ((x) - 'A') @@ -28,7 +22,7 @@ #define NL '\012' #define NL_STR (char_u *)"\012" #define FF '\014' -#define CAR '\015' /* CR is used by Mac OS X */ +#define CAR '\015' // CR is used by Mac OS X #define ESC '\033' #define ESC_STR (char_u *)"\033" #define ESC_STR_nc "\033" @@ -37,14 +31,14 @@ #define POUND 0xA3 -#define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) /* '?' -> DEL, '@' -> ^@, etc. */ +#define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) // '?' -> DEL, '@' -> ^@, etc. #define Meta(x) ((x) | 0x80) #define CTRL_F_STR "\006" #define CTRL_H_STR "\010" #define CTRL_V_STR "\026" -#define Ctrl_AT 0 /* @ */ +#define Ctrl_AT 0 // @ #define Ctrl_A 1 #define Ctrl_B 2 #define Ctrl_C 3 @@ -71,105 +65,17 @@ #define Ctrl_X 24 #define Ctrl_Y 25 #define Ctrl_Z 26 - /* CTRL- [ Left Square Bracket == ESC*/ -#define Ctrl_BSL 28 /* \ BackSLash */ -#define Ctrl_RSB 29 /* ] Right Square Bracket */ -#define Ctrl_HAT 30 /* ^ */ + // CTRL- [ Left Square Bracket == ESC +#define Ctrl_BSL 28 // \ BackSLash +#define Ctrl_RSB 29 // ] Right Square Bracket +#define Ctrl_HAT 30 // ^ #define Ctrl__ 31 -#else - -/* EBCDIC */ - -/* IF_EB(ASCII_constant, EBCDIC_constant) */ -#define IF_EB(a, b) b - -/* - * Finding the position in the alphabet is not straightforward in EBCDIC. - * There are gaps in the code table. - * 'a' + 1 == 'b', but: 'i' + 7 == 'j' and 'r' + 8 == 's' - */ -#define CharOrd__(c) ((c) < ('j' - 'a') ? (c) : ((c) < ('s' - 'a') ? (c) - 7 : (c) - 7 - 8)) -#define CharOrdLow(x) (CharOrd__((x) - 'a')) -#define CharOrdUp(x) (CharOrd__((x) - 'A')) -#define CharOrd(x) (isupper(x) ? CharOrdUp(x) : CharOrdLow(x)) - -#define EBCDIC_CHAR_ADD_(x) ((x) < 0?'a':(x)>25?'z':"abcdefghijklmnopqrstuvwxyz"[x]) -#define EBCDIC_CHAR_ADD(c,s) (isupper(c) ? toupper(EBCDIC_CHAR_ADD_(CharOrdUp(c)+(s))) : EBCDIC_CHAR_ADD_(CharOrdLow(c)+(s))) - -#define R13_(c) ("abcdefghijklmnopqrstuvwxyz"[((c) + 13) % 26]) -#define ROT13(c, a) (isupper(c) ? toupper(R13_(CharOrdUp(c))) : R13_(CharOrdLow(c))) - -#define NUL '\000' -#define BELL '\x2f' -#define BS '\x16' -#define TAB '\x05' -#define NL '\x15' -#define NL_STR (char_u *)"\x15" -#define FF '\x0C' -#define CAR '\x0D' -#define ESC '\x27' -#define ESC_STR (char_u *)"\x27" -#define ESC_STR_nc "\x27" -#define DEL 0x07 -#define DEL_STR (char_u *)"\007" - -#define POUND 0xB1 - -#define CTRL_F_STR "\056" -#define CTRL_H_STR "\026" -#define CTRL_V_STR "\062" - -#define Ctrl_AT 0x00 /* @ */ -#define Ctrl_A 0x01 -#define Ctrl_B 0x02 -#define Ctrl_C 0x03 -#define Ctrl_D 0x37 -#define Ctrl_E 0x2D -#define Ctrl_F 0x2E -#define Ctrl_G 0x2F -#define Ctrl_H 0x16 -#define Ctrl_I 0x05 -#define Ctrl_J 0x15 -#define Ctrl_K 0x0B -#define Ctrl_L 0x0C -#define Ctrl_M 0x0D -#define Ctrl_N 0x0E -#define Ctrl_O 0x0F -#define Ctrl_P 0x10 -#define Ctrl_Q 0x11 -#define Ctrl_R 0x12 -#define Ctrl_S 0x13 -#define Ctrl_T 0x3C -#define Ctrl_U 0x3D -#define Ctrl_V 0x32 -#define Ctrl_W 0x26 -#define Ctrl_X 0x18 -#define Ctrl_Y 0x19 -#define Ctrl_Z 0x3F - /* CTRL- [ Left Square Bracket == ESC*/ -#define Ctrl_RSB 0x1D /* ] Right Square Bracket */ -#define Ctrl_BSL 0x1C /* \ BackSLash */ -#define Ctrl_HAT 0x1E /* ^ */ -#define Ctrl__ 0x1F - -#define Ctrl_chr(x) (CtrlTable[(x)]) -extern __thread char CtrlTable[]; - -#define CtrlChar(x) ((x < ' ') ? CtrlCharTable[(x)] : 0) -extern __thread char CtrlCharTable[]; - -#define MetaChar(x) ((x < ' ') ? MetaCharTable[(x)] : 0) -extern __thread char MetaCharTable[]; - -#endif /* defined EBCDIC */ - -/* TODO: EBCDIC Code page dependent (here 1047) */ -#define CSI 0x9b /* Control Sequence Introducer */ +#define CSI 0x9b // Control Sequence Introducer #define CSI_STR "\233" -#define DCS 0x90 /* Device Control String */ -#define OSC 0x9d /* Operating System Command */ -#define STERM 0x9c /* String Terminator */ +#define DCS 0x90 // Device Control String +#define OSC 0x9d // Operating System Command +#define STERM 0x9c // String Terminator /* * Character that separates dir names in a path. diff --git a/src/auto/configure b/src/auto/configure index 5c74ecea86044..31f17e93b0600 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -629,8 +629,6 @@ MSGFMT INSTALL_TOOL_LANGS INSTALL_LANGS TAGPRG -HANGULIN_OBJ -HANGULIN_SRC GUI_X_LIBS GUITYPE GUI_LIB_LOC @@ -664,12 +662,14 @@ CHANNEL_SRC NETBEANS_OBJ NETBEANS_SRC RUBY_LIBS +RUBY_CFLAGS_EXTRA RUBY_CFLAGS RUBY_PRO RUBY_OBJ RUBY_SRC vi_cv_path_ruby TCL_LIBS +TCL_CFLAGS_EXTRA TCL_CFLAGS TCL_PRO TCL_OBJ @@ -677,15 +677,18 @@ TCL_SRC vi_cv_path_tcl PYTHON3_OBJ PYTHON3_SRC +PYTHON3_CFLAGS_EXTRA PYTHON3_CFLAGS PYTHON3_LIBS vi_cv_path_python3 PYTHON_OBJ PYTHON_SRC +PYTHON_CFLAGS_EXTRA PYTHON_CFLAGS PYTHON_LIBS vi_cv_path_python PERL_LIBS +PERL_CFLAGS_EXTRA PERL_CFLAGS PERL_PRO PERL_OBJ @@ -702,6 +705,7 @@ MZSCHEME_PRO MZSCHEME_OBJ MZSCHEME_SRC vi_cv_path_mzscheme +LUA_CFLAGS_EXTRA LUA_CFLAGS LUA_LIBS LUA_PRO @@ -710,6 +714,7 @@ LUA_SRC vi_cv_path_plain_lua vi_cv_path_luajit vi_cv_path_lua +XDIFF_OBJS_USED compiledby dogvimdiff dovimdiff @@ -723,6 +728,7 @@ OS_EXTRA_SRC XCODE_SELECT CPP_MM CROSS_COMPILING +BUILD_DATE_MSG STRIP AWK FGREP @@ -756,7 +762,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -820,7 +825,6 @@ enable_multibyte enable_rightleft enable_arabic enable_farsi -enable_hangulinput enable_xim enable_fontset with_x @@ -829,9 +833,6 @@ enable_gtk2_check enable_gnome_check enable_gtk3_check enable_motif_check -enable_athena_check -enable_nextaw_check -enable_carbon_check enable_gtktest with_gnome_includes with_gnome_libs @@ -842,6 +843,7 @@ with_motif_lib with_tlib enable_largefile enable_canberra +enable_libsodium enable_acl enable_gpm enable_sysmouse @@ -895,7 +897,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1148,15 +1149,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1294,7 +1286,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1447,7 +1439,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1502,24 +1493,21 @@ Optional Features: --disable-rightleft Do not include Right-to-Left language support. --disable-arabic Do not include Arabic language support. --disable-farsi Deprecated. - --enable-hangulinput Include Hangul input support. --enable-xim Include XIM input support. --enable-fontset Include X fontset output support. - --enable-gui=OPTS X11 GUI. default=auto OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/photon/carbon + --enable-gui=OPTS X11 GUI. default=auto OPTS=auto/no/gtk2/gnome2/gtk3/motif/haiku/photon/carbon --enable-gtk2-check If auto-select GUI, check for GTK+ 2 default=yes --enable-gnome-check If GTK GUI, check for GNOME default=no --enable-gtk3-check If auto-select GUI, check for GTK+ 3 default=yes --enable-motif-check If auto-select GUI, check for Motif default=yes - --enable-athena-check If auto-select GUI, check for Athena default=yes - --enable-nextaw-check If auto-select GUI, check for neXtaw default=yes - --enable-carbon-check If auto-select GUI, check for Carbon default=yes --disable-gtktest Do not try to compile and run a test GTK program --disable-icon-cache-update update disabled --disable-desktop-database-update update disabled --disable-largefile omit support for large files --disable-canberra Do not use libcanberra. + --disable-libsodium Do not use libsodium. --disable-acl No check for ACL support. - --disable-gpm Don't use gpm (Linux mouse daemon). + --enable-gpm=OPTS Use gpm (Linux mouse daemon). default=yes OPTS=yes/no/dynamic --disable-sysmouse Don't use sysmouse (mouse in *BSD console). --disable-nls Don't support NLS (gettext()). @@ -4459,6 +4447,17 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi +if test -n "$SOURCE_DATE_EPOCH"; then + DATE_FMT="%b %d %Y %H:%M:%S" + BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u "+$DATE_FMT") + cat >>confdefs.h <<_ACEOF +#define BUILD_DATE "$BUILD_DATE" +_ACEOF + + BUILD_DATE_MSG=-"echo -e '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nNOTE: build date/time is fixed: $BUILD_DATE\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='" + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-fail-if-missing argument" >&5 $as_echo_n "checking --enable-fail-if-missing argument... " >&6; } @@ -4476,7 +4475,7 @@ with_x_arg="$with_x" if test -z "$CFLAGS"; then CFLAGS="-O" - test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" + test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations" fi if test "$GCC" = yes; then gccversion=`$CC -dumpversion` @@ -4504,9 +4503,9 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5 $as_echo "$CLANG_VERSION" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5 $as_echo_n "checking if clang supports -fno-strength-reduce... " >&6; } - if test "$CLANG_VERSION" -ge 500002075 ; then + if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'` @@ -4530,26 +4529,58 @@ fi test "$GCC" = yes && CPP_MM=M; if test -f ./toolcheck; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy tools..." >&5 -$as_echo "$as_me: checking for buggy tools..." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy tools" >&5 +$as_echo_n "checking for buggy tools... " >&6; } sh ./toolcheck 1>&6 fi OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BeOS" >&5 -$as_echo_n "checking for BeOS... " >&6; } -case `uname` in - BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o - BEOS=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uname" >&5 +$as_echo_n "checking uname... " >&6; } +if test "x$vim_cv_uname_output" = "x" ; then + vim_cv_uname_output=`(uname) 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_output" >&5 +$as_echo "$vim_cv_uname_output" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_output (cached)" >&5 +$as_echo "$vim_cv_uname_output (cached)" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uname -r" >&5 +$as_echo_n "checking uname -r... " >&6; } +if test "x$vim_cv_uname_r_output" = "x" ; then + vim_cv_uname_r_output=`(uname -r) 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_r_output" >&5 +$as_echo "$vim_cv_uname_r_output" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_r_output (cached)" >&5 +$as_echo "$vim_cv_uname_r_output (cached)" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uname -m" >&5 +$as_echo_n "checking uname -m... " >&6; } +if test "x$vim_cv_uname_m_output" = "x" ; then + vim_cv_uname_m_output=`(uname -m) 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_m_output" >&5 +$as_echo "$vim_cv_uname_m_output" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_m_output (cached)" >&5 +$as_echo "$vim_cv_uname_m_output (cached)" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Haiku" >&5 +$as_echo_n "checking for Haiku... " >&6; } +case $vim_cv_uname_output in + Haiku) HAIKU=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; };; - *) BEOS=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + *) HAIKU=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; };; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for QNX" >&5 $as_echo_n "checking for QNX... " >&6; } -case `uname` in +case $vim_cv_uname_output in QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o test -z "$with_x" && with_x=no QNX=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -4560,7 +4591,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Darwin (Mac OS X)" >&5 $as_echo_n "checking for Darwin (Mac OS X)... " >&6; } -if test "`(uname) 2>/dev/null`" = Darwin; then +if test "$vim_cv_uname_output" = Darwin; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } MACOS_X=yes @@ -4738,9 +4769,25 @@ rm -f core conftest.err conftest.$ac_objext \ MACOS_X_DARWIN=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" + $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h + CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN" - # On IRIX 5.3, sys/types and inttypes.h are conflicting. + if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then + with_x=no + fi + fi + + if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then + CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-Oz/'` + fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : @@ -4757,28 +4804,6 @@ fi done -ac_fn_c_check_header_mongrel "$LINENO" "Carbon/Carbon.h" "ac_cv_header_Carbon_Carbon_h" "$ac_includes_default" -if test "x$ac_cv_header_Carbon_Carbon_h" = xyes; then : - CARBON=yes -fi - - - if test "x$CARBON" = "xyes"; then - if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then - with_x=no - fi - fi - fi - - if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then - CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-Oz/'` - fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - for ac_header in AvailabilityMacros.h do : ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" @@ -4969,7 +4994,7 @@ esac if test "$cf_cv_ebcdic" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for z/OS Unix" >&5 $as_echo_n "checking for z/OS Unix... " >&6; } -case `uname` in +case $vim_cv_uname_output in OS/390) zOSUnix="yes"; if test "$CC" = "cc"; then ccm="$_CC_CCMODE" @@ -5009,9 +5034,9 @@ esac fi if test "$zOSUnix" = "yes"; then - QUOTESED="sed -e 's/[\\\\\"]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" + QUOTESED="sed -e 's/[\\\\\"]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/' -e 's/ */ /g'" else - QUOTESED="sed -e 's/[\\\\\"]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" + QUOTESED="sed -e 's/[\\\\\"]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/' -e 's/ */ /g'" fi @@ -5217,6 +5242,12 @@ esac +if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + has_eval=no +else + has_eval=yes +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-compiledby argument" >&5 $as_echo_n "checking --with-compiledby argument... " >&6; } @@ -5267,6 +5298,20 @@ else $as_echo "yes" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking diff feature" >&5 +$as_echo_n "checking diff feature... " >&6; } +if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled in $features version" >&5 +$as_echo "disabled in $features version" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } + $as_echo "#define FEAT_DIFF 1" >>confdefs.h + + XDIFF_OBJS_USED="\$(XDIFF_OBJS)" + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-luainterp argument" >&5 $as_echo_n "checking --enable-luainterp argument... " >&6; } # Check whether --enable-luainterp was given. @@ -5280,7 +5325,7 @@ fi $as_echo "$enable_luainterp" >&6; } if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then as_fn_error $? "cannot use Lua with tiny or small features" "$LINENO" 5 fi @@ -5475,7 +5520,29 @@ $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - vi_cv_path_lua_pfx= + + # Detect moonjit: + # https://groups.google.com/forum/#!topic/vim_use/O0vek60WuTk + lua_suf=/moonjit-2.3 + inc_path="$vi_cv_path_lua_pfx/include" + for dir in "$inc_path"/moonjit-[0-9]* ; do + if test -d "$dir" ; then + lua_suf=`basename "$dir"` + lua_suf="/$lua_suf" + break + fi + done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $inc_path$lua_suf" >&5 +$as_echo_n "checking if lua.h can be found in $inc_path$lua_suf... " >&6; } + if test -f "$inc_path$lua_suf/lua.h"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LUA_INC=$lua_suf + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + vi_cv_path_lua_pfx= + fi fi fi fi @@ -5594,7 +5661,7 @@ $as_echo "yes" >&6; } fi if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ - test "`(uname -m) 2>/dev/null`" = "x86_64"; then + test "$vim_cv_uname_m_output" = "x86_64"; then LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" fi fi @@ -5606,6 +5673,7 @@ $as_echo "yes" >&6; } + fi @@ -5806,6 +5874,9 @@ $as_echo "not found" >&6; } MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket3m.a"; then MZSCHEME_LIBS="${path}/libracket3m.a" + if test -f "${path}/librktio.a"; then + MZSCHEME_LIBS="${MZSCHEME_LIBS} ${path}/librktio.a" + fi MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket.a"; then MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a" @@ -5828,8 +5899,8 @@ $as_echo "not found" >&6; } fi if test "$GCC" = yes; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}" - elif test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + elif test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}" fi fi @@ -6026,7 +6097,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_perlinterp" >&5 $as_echo "$enable_perlinterp" >&6; } if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then as_fn_error $? "cannot use Perl with tiny or small features" "$LINENO" 5 fi @@ -6218,6 +6289,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-pythoninterp argument" >&5 $as_echo_n "checking --enable-pythoninterp argument... " >&6; } # Check whether --enable-pythoninterp was given. @@ -6230,7 +6302,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_pythoninterp" >&5 $as_echo "$enable_pythoninterp" >&6; } if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5 fi @@ -6470,13 +6542,13 @@ $as_echo "$vi_cv_dll_name_python" >&6; } $as_echo_n "checking if -pthread should be used... " >&6; } threadsafe_flag= thread_lib= - if test "`(uname) 2>/dev/null`" != Darwin; then + if test "$vim_cv_uname_output" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" - if test "`(uname) 2>/dev/null`" = FreeBSD; then + if test "$vim_cv_uname_output" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi - if test "`(uname) 2>/dev/null`" = SunOS; then + if test "$vim_cv_uname_output" = SunOS; then threadsafe_flag="-pthreads" fi fi @@ -6568,6 +6640,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-python3interp argument" >&5 $as_echo_n "checking --enable-python3interp argument... " >&6; } # Check whether --enable-python3interp was given. @@ -6580,7 +6653,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_python3interp" >&5 $as_echo "$enable_python3interp" >&6; } if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5 fi @@ -6653,7 +6726,7 @@ if ${vi_cv_var_python3_version+:} false; then : $as_echo_n "(cached) " >&6 else vi_cv_var_python3_version=` - ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` + ${vi_cv_path_python3} -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 @@ -6735,7 +6808,10 @@ else vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" - d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + d=`${vi_cv_path_python3} -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null` + if test "x$d" = "x"; then + d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + fi if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" else @@ -6815,13 +6891,13 @@ $as_echo "$vi_cv_dll_name_python3" >&6; } $as_echo_n "checking if -pthread should be used... " >&6; } threadsafe_flag= thread_lib= - if test "`(uname) 2>/dev/null`" != Darwin; then + if test "$vim_cv_uname_output" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" - if test "`(uname) 2>/dev/null`" = FreeBSD; then + if test "$vim_cv_uname_output" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi - if test "`(uname) 2>/dev/null`" = SunOS; then + if test "$vim_cv_uname_output" = SunOS; then threadsafe_flag="-pthreads" fi fi @@ -6911,6 +6987,7 @@ fi + if test "$python_ok" = yes && test "$python3_ok" = yes; then $as_echo "#define DYNAMIC_PYTHON 1" >>confdefs.h @@ -6938,7 +7015,7 @@ else * Only the first python version used will be switched on. */ - int no_rtl_global_needed_for(char *python_instsoname, char *prefix) + static int no_rtl_global_needed_for(char *python_instsoname, char *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); @@ -6957,7 +7034,7 @@ else return !needed; } - int main(int argc, char** argv) + int main() { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) @@ -7004,7 +7081,7 @@ else * Only the first python version used will be switched on. */ - int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) + static int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); @@ -7023,7 +7100,7 @@ else return !needed; } - int main(int argc, char** argv) + int main() { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) @@ -7390,7 +7467,7 @@ $as_echo_n "checking for location of Tcl include... " >&6; } if test "x$MACOS_X" != "xyes"; then tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" else - tclinc="/System/Library/Frameworks/Tcl.framework/Headers" + tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /System/Library/Frameworks/Tcl.framework/Headers `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework/Versions/Current/Headers" fi TCL_INC= for try in $tclinc; do @@ -7413,7 +7490,8 @@ $as_echo_n "checking for location of tclConfig.sh script... " >&6; } tclcnf=`echo $tclinc | sed s/include/lib/g` tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" else - tclcnf="/System/Library/Frameworks/Tcl.framework" + tclcnf=`echo $tclinc | sed s/include/lib/g` + tclcnf="$tclcnf /System/Library/Frameworks/Tcl.framework `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework" fi for try in $tclcnf; do if test -f "$try/tclConfig.sh"; then @@ -7444,8 +7522,8 @@ $as_echo_n "checking for Tcl library by myself... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/lib$trylib" >&5 $as_echo "$try/lib$trylib" >&6; } TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm" - if test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + if test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then TCL_LIBS="$TCL_LIBS -R $try" fi break 3 @@ -7490,6 +7568,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-rubyinterp argument" >&5 $as_echo_n "checking --enable-rubyinterp argument... " >&6; } # Check whether --enable-rubyinterp was given. @@ -7502,7 +7581,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5 $as_echo "$enable_rubyinterp" >&6; } if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then as_fn_error $? "cannot use Ruby with tiny or small features" "$LINENO" 5 fi @@ -7596,8 +7675,7 @@ $as_echo "$rubyhdrdir" >&6; } librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"` librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"` rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"` - if test -f "$rubylibdir/$librubya"; then - librubyarg="$librubyarg" + if test -f "$rubylibdir/$librubya" || expr "$librubyarg" : "-lruby"; then RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then librubyarg="-lruby" @@ -7628,9 +7706,12 @@ $as_echo "$rubyhdrdir" >&6; } fi $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h - RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" + RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" RUBY_LIBS= fi + if test "X$CLANG_VERSION" != "X" -a "$rubyversion" -ge 30; then + RUBY_CFLAGS="$RUBY_CFLAGS -fdeclspec" + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found; disabling Ruby" >&5 $as_echo "not found; disabling Ruby" >&6; } @@ -7651,6 +7732,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-cscope argument" >&5 $as_echo_n "checking --enable-cscope argument... " >&6; } # Check whether --enable-cscope was given. @@ -7677,7 +7759,7 @@ else fi if test "$enable_netbeans" = "yes"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny or small features" >&5 $as_echo "cannot use NetBeans with tiny or small features" >&6; } enable_netbeans="no" @@ -7700,7 +7782,7 @@ else fi if test "$enable_channel" = "yes"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny or small features" >&5 $as_echo "cannot use channels with tiny or small features" >&6; } enable_channel="no" @@ -7720,7 +7802,54 @@ $as_echo "yes" >&6; } fi if test "$enable_channel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 + if test "x$HAIKU" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnetwork" >&5 +$as_echo_n "checking for socket in -lnetwork... " >&6; } +if ${ac_cv_lib_network_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetwork $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_network_socket=yes +else + ac_cv_lib_network_socket=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_socket" >&5 +$as_echo "$ac_cv_lib_network_socket" >&6; } +if test "x$ac_cv_lib_network_socket" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNETWORK 1 +_ACEOF + + LIBS="-lnetwork $LIBS" + +fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 @@ -7765,7 +7894,76 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with IPv6 networking is possible" >&5 +$as_echo_n "checking whether compiling with IPv6 networking is possible... " >&6; } +if ${vim_cv_ipv6_networking+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* Check bitfields */ + struct nbbuf { + unsigned int initDone:1; + unsigned short signmaplen; + }; + +int +main () +{ + + /* Check creating a socket. */ + struct sockaddr_in server; + struct addrinfo *res; + (void)socket(AF_INET, SOCK_STREAM, 0); + (void)htons(100); + (void)getaddrinfo("microsoft.com", NULL, NULL, &res); + if (errno == ECONNREFUSED) + (void)connect(1, (struct sockaddr *)&server, sizeof(server)); + (void)freeaddrinfo(res); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + vim_cv_ipv6_networking="yes" +else + vim_cv_ipv6_networking="no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv6_networking" >&5 +$as_echo "$vim_cv_ipv6_networking" >&6; } + + if test "x$vim_cv_ipv6_networking" = "xyes"; then + $as_echo "#define FEAT_IPV6 1" >>confdefs.h + + for ac_func in inet_ntop +do : + ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" +if test "x$ac_cv_func_inet_ntop" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INET_NTOP 1 +_ACEOF + +fi +done + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 @@ -7810,8 +8008,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with process communication is possible" >&5 -$as_echo_n "checking whether compiling with process communication is possible... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with IPv4 networking is possible" >&5 +$as_echo_n "checking whether compiling with IPv4 networking is possible... " >&6; } +if ${vim_cv_ipv4_networking+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7847,15 +8048,17 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + vim_cv_ipv4_networking="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; enable_netbeans="no"; enable_channel="no" + vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv4_networking" >&5 +$as_echo "$vim_cv_ipv4_networking" >&6; } + fi +fi if test "$enable_netbeans" = "yes"; then $as_echo "#define FEAT_NETBEANS_INTG 1" >>confdefs.h @@ -7867,9 +8070,9 @@ fi if test "$enable_channel" = "yes"; then $as_echo "#define FEAT_JOB_CHANNEL 1" >>confdefs.h - CHANNEL_SRC="channel.c" + CHANNEL_SRC="job.c channel.c" - CHANNEL_OBJ="objects/channel.o" + CHANNEL_OBJ="objects/job.o objects/channel.o" fi @@ -7883,7 +8086,7 @@ else fi if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny or small features" >&5 $as_echo "cannot use terminal emulator with tiny or small features" >&6; } enable_terminal="no" @@ -7994,18 +8197,6 @@ if test "${enable_farsi+set}" = set; then : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-hangulinput argument" >&5 -$as_echo_n "checking --enable-hangulinput argument... " >&6; } -# Check whether --enable-hangulinput was given. -if test "${enable_hangulinput+set}" = set; then : - enableval=$enable_hangulinput; -else - enable_hangulinput="no" -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_hangulinput" >&5 -$as_echo "$enable_hangulinput" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-xim argument" >&5 $as_echo_n "checking --enable-xim argument... " >&6; } # Check whether --enable-xim was given. @@ -8774,8 +8965,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Corrected X libraries to $x_libraries" >&5 $as_echo "Corrected X libraries to $x_libraries" >&6; } X_LIBS="$X_LIBS -L$x_libraries" - if test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + if test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then X_LIBS="$X_LIBS -R $x_libraries" fi fi @@ -9020,7 +9211,7 @@ else # include # include #endif - main() + int main() { if (sizeof(wchar_t) <= 2) exit(1); @@ -9052,7 +9243,7 @@ if test "x$with_x" = xno -a "x$with_x_arg" = xyes; then as_fn_error $? "could not configure X" "$LINENO" 5 fi -test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no +test "x$with_x" = xno -a "x$HAIKU" != "xyes" -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-gui argument" >&5 $as_echo_n "checking --enable-gui argument... " >&6; } @@ -9071,13 +9262,27 @@ SKIP_GTK2=YES SKIP_GTK3=YES SKIP_GNOME=YES SKIP_MOTIF=YES -SKIP_ATHENA=YES -SKIP_NEXTAW=YES SKIP_PHOTON=YES -SKIP_CARBON=YES +SKIP_HAIKU=YES GUITYPE=NONE -if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then +if test "x$HAIKU" = "xyes"; then + SKIP_HAIKU= + case "$enable_gui_canon" in + no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 +$as_echo "no GUI support" >&6; } + SKIP_HAIKU=YES ;; + yes|"") { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - automatic GUI support" >&5 +$as_echo "yes - automatic GUI support" >&6; } ;; + auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto - automatic GUI support" >&5 +$as_echo "auto - automatic GUI support" >&6; } ;; + haiku) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Haiku GUI support" >&5 +$as_echo "Haiku GUI support" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $enable_gui GUI is not supported" >&5 +$as_echo "Sorry, $enable_gui GUI is not supported" >&6; } + SKIP_HAIKU=YES ;; + esac +elif test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then SKIP_PHOTON= case "$enable_gui_canon" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 @@ -9094,24 +9299,17 @@ $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } esac elif test "x$MACOS_X" = "xyes" -a "x$with_x" = "xno" ; then - SKIP_CARBON= case "$enable_gui_canon" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 -$as_echo "no GUI support" >&6; } - SKIP_CARBON=YES ;; +$as_echo "no GUI support" >&6; } ;; yes|"") { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - automatic GUI support" >&5 $as_echo "yes - automatic GUI support" >&6; } gui_auto=yes ;; - auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto - Carbon GUI is outdated - disable GUI support" >&5 -$as_echo "auto - Carbon GUI is outdated - disable GUI support" >&6; } - SKIP_CARBON=YES ;; - carbon) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Carbon GUI support" >&5 -$as_echo "Carbon GUI support" >&6; } ;; + auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto - disable GUI support for Mac OS" >&5 +$as_echo "auto - disable GUI support for Mac OS" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $enable_gui GUI is not supported" >&5 -$as_echo "Sorry, $enable_gui GUI is not supported" >&6; } - SKIP_CARBON=YES ;; +$as_echo "Sorry, $enable_gui GUI is not supported" >&6; } ;; esac - else case "$enable_gui_canon" in @@ -9121,11 +9319,9 @@ $as_echo "no GUI support" >&6; } ;; $as_echo "yes/auto - automatic GUI support" >&6; } gui_auto=yes SKIP_GTK2= + SKIP_GTK3= SKIP_GNOME= - SKIP_MOTIF= - SKIP_ATHENA= - SKIP_NEXTAW= - SKIP_CARBON=;; + SKIP_MOTIF=;; gtk2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 2.x GUI support" >&5 $as_echo "GTK+ 2.x GUI support" >&6; } SKIP_GTK2=;; @@ -9139,12 +9335,6 @@ $as_echo "GTK+ 3.x GUI support" >&6; } motif) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Motif GUI support" >&5 $as_echo "Motif GUI support" >&6; } SKIP_MOTIF=;; - athena) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Athena GUI support" >&5 -$as_echo "Athena GUI support" >&6; } - SKIP_ATHENA=;; - nextaw) { $as_echo "$as_me:${as_lineno-$LINENO}: result: neXtaw GUI support" >&5 -$as_echo "neXtaw GUI support" >&6; } - SKIP_NEXTAW=;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sorry, $enable_gui GUI is not supported" >&5 $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } ;; esac @@ -9221,89 +9411,6 @@ $as_echo "$enable_motif_check" >&6; } fi fi -if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for Athena" >&5 -$as_echo_n "checking whether or not to look for Athena... " >&6; } - # Check whether --enable-athena-check was given. -if test "${enable_athena_check+set}" = set; then : - enableval=$enable_athena_check; -else - enable_athena_check="yes" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_athena_check" >&5 -$as_echo "$enable_athena_check" >&6; } - if test "x$enable_athena_check" = "xno"; then - SKIP_ATHENA=YES - fi -fi - -if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for neXtaw" >&5 -$as_echo_n "checking whether or not to look for neXtaw... " >&6; } - # Check whether --enable-nextaw-check was given. -if test "${enable_nextaw_check+set}" = set; then : - enableval=$enable_nextaw_check; -else - enable_nextaw_check="yes" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nextaw_check" >&5 -$as_echo "$enable_nextaw_check" >&6; }; - if test "x$enable_nextaw_check" = "xno"; then - SKIP_NEXTAW=YES - fi -fi - -if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for Carbon" >&5 -$as_echo_n "checking whether or not to look for Carbon... " >&6; } - # Check whether --enable-carbon-check was given. -if test "${enable_carbon_check+set}" = set; then : - enableval=$enable_carbon_check; -else - enable_carbon_check="yes" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_carbon_check" >&5 -$as_echo "$enable_carbon_check" >&6; }; - if test "x$enable_carbon_check" = "xno"; then - SKIP_CARBON=YES - fi -fi - - -if test "x$MACOS_X" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Carbon GUI" >&5 -$as_echo_n "checking for Carbon GUI... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; - GUITYPE=CARBONGUI - if test "$VIMNAME" = "vim"; then - VIMNAME=Vim - fi - - if test "x$MACARCH" = "xboth"; then - CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" - else - CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" - fi - - if test x$prefix = xNONE; then - prefix=/Applications - fi - - datadir='${prefix}/Vim.app/Contents/Resources' - - SKIP_GTK2=YES; - SKIP_GNOME=YES; - SKIP_MOTIF=YES; - SKIP_ATHENA=YES; - SKIP_NEXTAW=YES; - SKIP_PHOTON=YES; - SKIP_CARBON=YES -fi - @@ -9432,6 +9539,8 @@ $as_echo "gtk test disabled" >&6; } fi if test "x$PKG_CONFIG" != "xno"; then + save_skip_gtk3=$SKIP_GTK3 + SKIP_GTK3=YES if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then { @@ -9470,6 +9579,8 @@ $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` } else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK -dev package" >&5 +$as_echo_n "checking for GTK -dev package... " >&6; } no_gtk=yes fi @@ -9568,11 +9679,11 @@ $as_echo "no" >&6; } if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK3=YES - SKIP_ATHENA=YES - SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK + else + SKIP_GTK3=$save_skip_gtk3 fi fi if test "x$GUITYPE" = "xGTK"; then @@ -9633,7 +9744,7 @@ $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FreeBSD" >&5 $as_echo_n "checking for FreeBSD... " >&6; } - if test "`(uname) 2>/dev/null`" = FreeBSD; then + if test "$vim_cv_uname_output" = FreeBSD; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" @@ -9685,6 +9796,8 @@ $as_echo "gtk test disabled" >&6; } fi if test "x$PKG_CONFIG" != "xno"; then + save_skip_gtk2=$SKIP_GTK2 + SKIP_GTK2=YES if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then { @@ -9723,6 +9836,8 @@ $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` } else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK -dev package" >&5 +$as_echo_n "checking for GTK -dev package... " >&6; } no_gtk=yes fi @@ -9822,13 +9937,13 @@ $as_echo "no" >&6; } if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK2=YES SKIP_GNOME=YES - SKIP_ATHENA=YES - SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK $as_echo "#define USE_GTK3 1" >>confdefs.h + else + SKIP_GTK2=$save_skip_gtk2 fi fi fi @@ -10089,12 +10204,12 @@ $as_echo "no" >&6; } GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Motif GUI libs" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Motif GUI libs" >&5 $as_echo_n "checking for location of Motif GUI libs... " >&6; } gui_libs="`echo $x_libraries|sed 's%/^/^/*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" GUI_LIB_LOC= for try in $gui_libs; do - for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do + for libtry in "$try"/libXm.a "$try"/libXm.dll.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do if test -f "$libtry"; then GUI_LIB_LOC=$try fi @@ -10111,8 +10226,8 @@ $as_echo "in default path" >&6; } if test -n "$GUI_LIB_LOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUI_LIB_LOC" >&5 $as_echo "$GUI_LIB_LOC" >&6; } - if test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + if test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC" fi fi @@ -10127,120 +10242,49 @@ $as_echo "" >&6; } fi if test -z "$SKIP_MOTIF"; then - SKIP_ATHENA=YES - SKIP_NEXTAW=YES GUITYPE=MOTIF fi +if test -z "$SKIP_MOTIF"; then + if test -n "$GUI_INC_LOC"; then + GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`" + fi + if test -n "$GUI_LIB_LOC"; then + GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`" + fi -GUI_X_LIBS= - -if test -z "$SKIP_ATHENA"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Athena header files can be found" >&5 -$as_echo_n "checking if Athena header files can be found... " >&6; } - cflags_save=$CFLAGS - CFLAGS="$CFLAGS $X_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ldflags_save=$LDFLAGS + LDFLAGS="$X_LIBS $LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5 +$as_echo_n "checking for XShapeQueryExtension in -lXext... " >&6; } +if ${ac_cv_lib_Xext_XShapeQueryExtension+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXext -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XShapeQueryExtension (); int main () { - +return XShapeQueryExtension (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xext_XShapeQueryExtension=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; SKIP_ATHENA=YES -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$cflags_save -fi - -if test -z "$SKIP_ATHENA"; then - GUITYPE=ATHENA -fi - -if test -z "$SKIP_NEXTAW"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if neXtaw header files can be found" >&5 -$as_echo_n "checking if neXtaw header files can be found... " >&6; } - cflags_save=$CFLAGS - CFLAGS="$CFLAGS $X_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; SKIP_NEXTAW=YES -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$cflags_save -fi - -if test -z "$SKIP_NEXTAW"; then - GUITYPE=NEXTAW -fi - -if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then - if test -n "$GUI_INC_LOC"; then - GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`" - fi - if test -n "$GUI_LIB_LOC"; then - GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`" - fi - - ldflags_save=$LDFLAGS - LDFLAGS="$X_LIBS $LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5 -$as_echo_n "checking for XShapeQueryExtension in -lXext... " >&6; } -if ${ac_cv_lib_Xext_XShapeQueryExtension+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XShapeQueryExtension (); -int -main () -{ -return XShapeQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xext_XShapeQueryExtension=yes -else - ac_cv_lib_Xext_XShapeQueryExtension=no + ac_cv_lib_Xext_XShapeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -10461,7 +10505,7 @@ done fi -if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then +if test -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" for ac_header in X11/xpm.h X11/Sunkeysym.h @@ -10498,15 +10542,14 @@ rm -f conftest* fi CPPFLAGS=$cppflags_save - if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \ - -a "x$GUITYPE" != "xNONE" ; then + if test "$enable_xim" = "auto" -a "x$GUITYPE" != "xNONE" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: X GUI selected; xim has been enabled" >&5 $as_echo "X GUI selected; xim has been enabled" >&6; } enable_xim="yes" fi fi -if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then +if test -z "$SKIP_MOTIF"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11/Xmu/Editres.h" >&5 @@ -10541,12 +10584,20 @@ if test -z "$SKIP_MOTIF"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" if test "$zOSUnix" = "yes"; then - xmheader="Xm/Xm.h" + for ac_header in Xm/Xm.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default" +if test "x$ac_cv_header_Xm_Xm_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_XM_XM_H 1 +_ACEOF + +fi + +done + else - xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h - Xm/UnhighlightT.h Xm/Notebook.h" - fi - for ac_header in $xmheader + for ac_header in Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h Xm/UnhighlightT.h Xm/Notebook.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -10559,6 +10610,7 @@ fi done + fi if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmAttributes_21 in Xm/XpmP.h" >&5 @@ -10608,6 +10660,10 @@ $as_echo "GTK+ 2 GUI selected; fontset has been disabled" >&6; } enable_fontset="no" fi +if test -z "$SKIP_HAIKU"; then + GUITYPE=HAIKUGUI +fi + if test -z "$SKIP_PHOTON"; then GUITYPE=PHOTONGUI fi @@ -10656,7 +10712,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN or MSYS environment" >&5 $as_echo_n "checking for CYGWIN or MSYS environment... " >&6; } -case `uname` in +case $vim_cv_uname_output in CYGWIN*|MSYS*) CYGWIN=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN clipboard support" >&5 @@ -10676,21 +10732,6 @@ $as_echo "no - using X11" >&6; } $as_echo "no" >&6; };; esac -if test "$enable_hangulinput" = "yes"; then - if test "x$GUITYPE" = "xNONE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI selected; hangul input has been disabled" >&5 -$as_echo "no GUI selected; hangul input has been disabled" >&6; } - enable_hangulinput=no - else - $as_echo "#define FEAT_HANGULIN 1" >>confdefs.h - - HANGULIN_SRC=hangulin.c - - HANGULIN_OBJ=objects/hangulin.o - - fi -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether toupper is broken" >&5 $as_echo_n "checking whether toupper is broken... " >&6; } @@ -10712,7 +10753,7 @@ else # include # include #endif -main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } +int main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -11870,7 +11911,7 @@ rm -f core conftest.err conftest.$ac_objext \ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: empty: automatic terminal library selection" >&5 $as_echo "empty: automatic terminal library selection" >&6; } - case "`uname -s 2>/dev/null`" in + case "$vim_cv_uname_output" in OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";; *) tlibs="tinfo ncurses termlib termcap curses";; esac @@ -11936,7 +11977,7 @@ else # include # include #endif -main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); } +int main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : res="OK" @@ -11966,7 +12007,7 @@ if test "x$olibs" = "x$LIBS"; then $as_echo_n "checking for tgetent()... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int tgetent(char *, const char *); int main () { @@ -12015,7 +12056,7 @@ else # include # include #endif -main() +int main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } _ACEOF @@ -12064,7 +12105,7 @@ else # include # include #endif -main() +int main() {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } _ACEOF @@ -12232,6 +12273,35 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether del_curterm() can be used" >&5 +$as_echo_n "checking whether del_curterm() can be used... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_TERMCAP_H +# include +#endif +#include + +int +main () +{ +if (cur_term) del_curterm(cur_term); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_DEL_CURTERM 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/select.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12278,10 +12348,18 @@ if test -c /dev/ptmx ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +// These should be in stdlib.h, but it depends on _XOPEN_SOURCE. +char *ptsname(int); +int unlockpt(int); +int grantpt(int); + int main () { -ptsname(0);grantpt(0);unlockpt(0); + + ptsname(0); + grantpt(0); + unlockpt(0); ; return 0; } @@ -12341,145 +12419,6 @@ else $as_echo "don't know" >&6; } fi -rm -f conftest_grp -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default tty permissions/group" >&5 -$as_echo_n "checking default tty permissions/group... " >&6; } -if ${vim_cv_tty_group+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - - as_fn_error $? "cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode'" "$LINENO" 5 - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include "confdefs.h" -#include -#if STDC_HEADERS -# include -# include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -main() -{ - struct stat sb; - char *x,*ttyname(); - int om, m; - FILE *fp; - - if (!(x = ttyname(0))) exit(1); - if (stat(x, &sb)) exit(1); - om = sb.st_mode; - if (om & 002) exit(0); - m = system("mesg y"); - if (m == -1 || m == 127) exit(1); - if (stat(x, &sb)) exit(1); - m = sb.st_mode; - if (chmod(x, om)) exit(1); - if (m & 002) exit(0); - if (sb.st_gid == getgid()) exit(1); - if (!(fp=fopen("conftest_grp", "w"))) - exit(1); - fprintf(fp, "%d\n", sb.st_gid); - fclose(fp); - exit(0); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - if test -f conftest_grp; then - vim_cv_tty_group=`cat conftest_grp` - if test "x$vim_cv_tty_mode" = "x" ; then - vim_cv_tty_mode=0620 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&5 -$as_echo "pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&6; } - else - vim_cv_tty_group=world - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ptys are world accessible" >&5 -$as_echo "ptys are world accessible" >&6; } - fi - -else - - vim_cv_tty_group=world - { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't determine - assume ptys are world accessible" >&5 -$as_echo "can't determine - assume ptys are world accessible" >&6; } - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tty_group" >&5 -$as_echo "$vim_cv_tty_group" >&6; } -rm -f conftest_grp - -if test "x$vim_cv_tty_group" != "xworld" ; then - cat >>confdefs.h <<_ACEOF -#define PTYGROUP $vim_cv_tty_group -_ACEOF - - if test "x$vim_cv_tty_mode" = "x" ; then - as_fn_error $? "It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)" "$LINENO" 5 - else - $as_echo "#define PTYMODE 0620" >>confdefs.h - - fi -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - -if test $ac_cv_type_signal = void; then - $as_echo "#define SIGRETURN return" >>confdefs.h - -else - $as_echo "#define SIGRETURN return 0" >>confdefs.h - -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sigcontext" >&5 $as_echo_n "checking for struct sigcontext... " >&6; } @@ -12531,7 +12470,7 @@ else #include #endif char *dagger[] = { "IFS=pwd", 0 }; -main() +int main() { char buffer[500]; extern char **environ; @@ -12578,9 +12517,9 @@ for ac_func in fchdir fchown fchmod fsync getcwd getpseudotty \ getpwent getpwnam getpwuid getrlimit gettimeofday localtime_r lstat \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ - sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ - strnicmp strpbrk strtol tgetent towlower towupper iswupper tzset \ - usleep utime utimes mblen ftruncate unsetenv posix_openpt + sigprocmask sigvec strcasecmp strcoll strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strptime strtol tgetent towlower towupper iswupper \ + tzset usleep utime utimes mblen ftruncate unsetenv posix_openpt do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -12761,7 +12700,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12807,7 +12746,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12831,7 +12770,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12876,7 +12815,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12900,7 +12839,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12958,8 +12897,14 @@ $as_echo "Defaulting to no" >&6; } enable_canberra="no" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_canberra" >&5 + if test "$enable_canberra" = "yes" -a "$has_eval" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use sound with tiny or small features" >&5 +$as_echo "cannot use sound with tiny or small features" >&6; } + enable_canberra="no" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_canberra" >&5 $as_echo "$enable_canberra" >&6; } + fi fi if test "$enable_canberra" = "yes"; then if test "x$PKG_CONFIG" != "xno"; then @@ -12974,7 +12919,9 @@ if test "$enable_canberra" = "yes"; then $as_echo_n "checking for libcanberra... " >&6; } ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $canberra_cflags" + if `echo "$CFLAGS" | grep -v "$canberra_cflags" 2>/dev/null`; then + CFLAGS="$CFLAGS $canberra_cflags" + fi LIBS="$LIBS $canberra_lib" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12996,13 +12943,77 @@ if ac_fn_c_try_link "$LINENO"; then : $as_echo "yes" >&6; }; $as_echo "#define HAVE_CANBERRA 1" >>confdefs.h else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; try installing libcanberra-dev" >&5 +$as_echo "no; try installing libcanberra-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-libsodium argument" >&5 +$as_echo_n "checking --enable-libsodium argument... " >&6; } +# Check whether --enable-libsodium was given. +if test "${enable_libsodium+set}" = set; then : + enableval=$enable_libsodium; +else + enable_libsodium="maybe" +fi + + +if test "$enable_libsodium" = "maybe"; then + if test "$features" = "big" -o "$features" = "huge"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to yes" >&5 +$as_echo "Defaulting to yes" >&6; } + enable_libsodium="yes" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to no" >&5 +$as_echo "Defaulting to no" >&6; } + enable_libsodium="no" + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libsodium" >&5 +$as_echo "$enable_libsodium" >&6; } +fi +if test "$enable_libsodium" = "yes"; then + if test "x$PKG_CONFIG" != "xno"; then + libsodium_lib=`$PKG_CONFIG --libs libsodium 2>/dev/null` + libsodium_cflags=`$PKG_CONFIG --cflags libsodium 2>/dev/null` + fi + if test "x$libsodium_lib" = "x"; then + libsodium_lib=-lsodium + libsodium_cflags= + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsodium" >&5 +$as_echo_n "checking for libsodium... " >&6; } + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $libsodium_cflags" + LIBS="$LIBS $libsodium_lib" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + # include + +int +main () +{ + + printf("%d", sodium_init()); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_SODIUM 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5 +$as_echo "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize" >&5 $as_echo_n "checking for st_blksize... " >&6; } @@ -13032,6 +13043,76 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer_create" >&5 +$as_echo_n "checking for timer_create... " >&6; } +save_LIBS="$LIBS" +LIBS="$LIBS -lrt" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static void set_flag(union sigval sv) {} + +int +main () +{ + + struct timespec ts; + struct sigevent action = {0}; + timer_t timer_id; + + action.sigev_notify = SIGEV_THREAD; + action.sigev_notify_function = set_flag; + timer_create(CLOCK_REALTIME, &action, &timer_id); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; with -lrt" >&5 +$as_echo "yes; with -lrt" >&6; }; $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h + +else + LIBS="$save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static void set_flag(union sigval sv) {} + +int +main () +{ + + struct timespec ts; + struct sigevent action = {0}; + timer_t timer_id; + + action.sigev_notify = SIGEV_THREAD; + action.sigev_notify_function = set_flag; + timer_create(CLOCK_REALTIME, &action, &timer_id); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat() ignores a trailing slash" >&5 $as_echo_n "checking whether stat() ignores a trailing slash... " >&6; } if ${vim_cv_stat_ignores_slash+:} false; then : @@ -13053,7 +13134,7 @@ else #endif #include #include -main() {struct stat st; exit(stat("configure/", &st) != 0); } +int main() {struct stat st; exit(stat("configure/", &st) != 0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -13079,6 +13160,52 @@ if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nanoseconds field of struct stat" >&5 +$as_echo_n "checking for nanoseconds field of struct stat... " >&6; } +if ${ac_cv_struct_st_mtim_nsec+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CPPFLAGS="$CPPFLAGS" + ac_cv_struct_st_mtim_nsec=no + # st_mtim.tv_nsec -- the usual case + # st_mtim._tv_nsec -- Solaris 2.6, if + # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 + # && !defined __EXTENSIONS__) + # st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2 + # st_mtime_n -- AIX 5.2 and above + # st_mtimespec.tv_nsec -- Darwin (Mac OSX) + for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do + CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct stat s; s.ST_MTIM_NSEC; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_st_mtim_nsec=$ac_val; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + CPPFLAGS="$ac_save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_mtim_nsec" >&5 +$as_echo "$ac_cv_struct_st_mtim_nsec" >&6; } +if test $ac_cv_struct_st_mtim_nsec != no; then + +cat >>confdefs.h <<_ACEOF +#define ST_MTIM_NSEC $ac_cv_struct_st_mtim_nsec +_ACEOF + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open()" >&5 $as_echo_n "checking for iconv_open()... " >&6; } save_LIBS="$LIBS" @@ -13628,8 +13755,8 @@ rm -f core conftest.err conftest.$ac_objext \ LIBS="$ac_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gpm argument" >&5 -$as_echo_n "checking --disable-gpm argument... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-gpm argument" >&5 +$as_echo_n "checking --enable-gpm argument... " >&6; } # Check whether --enable-gpm was given. if test "${enable_gpm+set}" = set; then : enableval=$enable_gpm; @@ -13638,9 +13765,9 @@ else fi -if test "$enable_gpm" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if test "$enable_gpm" = "yes" -o "$enable_gpm" = "dynamic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gpm" >&5 +$as_echo "$enable_gpm" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpm" >&5 $as_echo_n "checking for gpm... " >&6; } if ${vi_cv_have_gpm+:} false; then : @@ -13672,13 +13799,18 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_gpm" >&5 $as_echo "$vi_cv_have_gpm" >&6; } if test $vi_cv_have_gpm = yes; then - LIBS="$LIBS -lgpm" + if test "$enable_gpm" = "yes"; then + LIBS="$LIBS -lgpm" + else + $as_echo "#define DYNAMIC_GPM 1" >>confdefs.h + + fi $as_echo "#define HAVE_GPM 1" >>confdefs.h fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-sysmouse argument" >&5 @@ -13785,6 +13917,55 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dirfd" >&5 +$as_echo_n "checking for dirfd... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +DIR * dir=opendir("dirname"); dirfd(dir); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_DIRFD 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +$as_echo "not usable" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock" >&5 +$as_echo_n "checking for flock... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +flock(10, LOCK_SH); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOCK 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +$as_echo "not usable" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysctl" >&5 $as_echo_n "checking for sysctl... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13835,7 +14016,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h @@ -13843,7 +14024,8 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.mem_unit" >&5 $as_echo_n "checking for sysinfo.mem_unit... " >&6; } @@ -13871,6 +14053,35 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.uptime" >&5 +$as_echo_n "checking for sysinfo.uptime... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ + struct sysinfo sinfo; + long ut; + + (void)sysinfo(&sinfo); + ut = sinfo.uptime; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO_UPTIME 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysconf" >&5 $as_echo_n "checking for sysconf... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13896,6 +14107,30 @@ $as_echo "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_SIGSTKSZ via sysconf()" >&5 +$as_echo_n "checking for _SC_SIGSTKSZ via sysconf()... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + (void)sysconf(_SC_SIGSTKSZ); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSCONF_SIGSTKSZ 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +$as_echo "not usable" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. @@ -14053,11 +14288,11 @@ else #ifdef HAVE_INTTYPES_H # include #endif -main() { +int main() { uint32_t nr1 = (uint32_t)-1; uint32_t nr2 = (uint32_t)0xffffffffUL; - if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); - exit(0); + if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) return 1; + return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -14081,7 +14316,7 @@ bcopy_test_prog=' # include # include #endif -main() { +int main() { char buf[10]; strcpy(buf, "abcdefghi"); mch_memmove(buf, buf + 2, 3); @@ -14345,11 +14580,11 @@ fi $as_echo_n "checking how to create tags... " >&6; } test -f tags && mv tags tags.save if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then - TAGPRG="ctags -I INIT+ --fields=+S" + TAGPRG="ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then - TAGPRG="exctags -I INIT+ --fields=+S" + TAGPRG="exctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then - TAGPRG="exuberant-ctags -I INIT+ --fields=+S" + TAGPRG="exuberant-ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" else TAGPRG="ctags" (eval etags /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags" @@ -14772,11 +15007,7 @@ fi if test "$MACOS_X" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need macOS frameworks" >&5 $as_echo_n "checking whether we need macOS frameworks... " >&6; } - if test "$GUITYPE" = "CARBONGUI"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need Carbon" >&5 -$as_echo "yes, we need Carbon" >&6; } - LIBS="$LIBS -framework Carbon" - elif test "$MACOS_X_DARWIN" = "yes"; then + if test "$MACOS_X_DARWIN" = "yes"; then if test "$features" = "tiny"; then OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` @@ -14795,15 +15026,16 @@ $as_echo "yes, we need AppKit/UIKit" >&6; } $as_echo "no" >&6; } fi fi -if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then - LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + +if `echo "$CFLAGS" | grep -v D_REENTRANT >/dev/null`; then + CFLAGS="$CFLAGS -D_REENTRANT" fi DEPEND_CFLAGS_FILTER= if test "$GCC" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC 3 or later" >&5 $as_echo_n "checking for GCC 3 or later... " >&6; } - gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9]\)\..*$/\1/g'` + gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9][0-9]*\)\..*$/\1/g'` if test "$gccmajor" -gt "2"; then DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -14815,7 +15047,8 @@ $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5 $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } if test "$gccmajor" -gt "3"; then - CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + CFLAGS=`echo "$CFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else @@ -14837,12 +15070,16 @@ else $as_echo "no" >&6; } fi +LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-L /-L/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --as-needed support" >&5 $as_echo_n "checking linker --as-needed support... " >&6; } LINK_AS_NEEDED= # Check if linker supports --as-needed and --no-as-needed options if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then - LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` + if ! echo "$LDFLAGS" | grep -q -- '-Wl,[^[:space:]]*--as-needed'; then + LDFLAGS="$LDFLAGS -Wl,--as-needed" + fi LINK_AS_NEEDED=yes fi if test "$LINK_AS_NEEDED" = yes; then diff --git a/src/autocmd.c b/src/autocmd.c index 282ccb3a16895..042b7c729df1f 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -55,9 +55,7 @@ typedef struct AutoCmd char once; // "One shot": removed after execution char nested; // If autocommands nest here. char last; // last command in list -#ifdef FEAT_EVAL - sctx_T script_ctx; // script context where defined -#endif + sctx_T script_ctx; // script context where it is defined struct AutoCmd *next; // next AutoCmd in list } AutoCmd; @@ -114,12 +112,14 @@ static __thread struct event_name {"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}, @@ -148,8 +148,10 @@ static __thread struct event_name {"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}, @@ -160,6 +162,7 @@ static __thread struct event_name {"SessionLoadPost", EVENT_SESSIONLOADPOST}, {"ShellCmdPost", EVENT_SHELLCMDPOST}, {"ShellFilterPost", EVENT_SHELLFILTERPOST}, + {"SigUSR1", EVENT_SIGUSR1}, {"SourceCmd", EVENT_SOURCECMD}, {"SourcePre", EVENT_SOURCEPRE}, {"SourcePost", EVENT_SOURCEPOST}, @@ -184,10 +187,14 @@ static __thread struct event_name {"VimLeave", EVENT_VIMLEAVE}, {"VimLeavePre", EVENT_VIMLEAVEPRE}, {"WinNew", EVENT_WINNEW}, + {"WinClosed", EVENT_WINCLOSED}, {"WinEnter", EVENT_WINENTER}, {"WinLeave", EVENT_WINLEAVE}, + {"WinScrolled", EVENT_WINSCROLLED}, {"VimResized", EVENT_VIMRESIZED}, {"TextYankPost", EVENT_TEXTYANKPOST}, + {"VimSuspend", EVENT_VIMSUSPEND}, + {"VimResume", EVENT_VIMRESUME}, {NULL, (event_T)0} }; @@ -211,14 +218,14 @@ static __thread AutoPat *last_autopat[NUM_EVENTS] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -#define AUGROUP_DEFAULT -1 // default autocmd group -#define AUGROUP_ERROR -2 // erroneous autocmd group -#define AUGROUP_ALL -3 // all autocmd groups +#define AUGROUP_DEFAULT (-1) // default autocmd group +#define AUGROUP_ERROR (-2) // erroneous autocmd group +#define AUGROUP_ALL (-3) // all autocmd groups /* * struct used to keep status while executing autocommands for an event. */ -typedef struct AutoPatCmd +struct AutoPatCmd_S { AutoPat *curpat; // next AutoPat to examine AutoCmd *nextcmd; // next AutoCmd to execute @@ -227,12 +234,17 @@ typedef struct AutoPatCmd char_u *sfname; // sfname to match with char_u *tail; // tail of fname event_T event; // current event + sctx_T script_ctx; // script context where it is defined int arg_bufnr; // Initially equal to , set to zero when // buf is deleted. - struct AutoPatCmd *next; // chain of active apc-s for auto-invalidation -} AutoPatCmd; + AutoPatCmd_T *next; // chain of active apc-s for auto-invalidation +}; -static __thread AutoPatCmd *active_apc_list = NULL; /* stack of active autocommands */ +static __thread AutoPatCmd_T *active_apc_list = NULL; /* stack of active autocommands */ + +// Macro to loop over all the patterns for an autocmd event +#define FOR_ALL_AUTOCMD_PATTERNS(event, ap) \ + for ((ap) = first_autopat[(int)(event)]; (ap) != NULL; (ap) = (ap)->next) /* * augroups stores a list of autocmd group names. @@ -242,33 +254,23 @@ static __thread garray_T augroups = {0, 0, sizeof(char_u *), 10, NULL}; /* use get_deleted_augroup() to get this */ static __thread char_u *deleted_augroup = NULL; -/* - * 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 __thread int au_did_filetype INIT(= FALSE); - /* * The ID of the current group. Group 0 is the default one. */ static __thread int current_augroup = AUGROUP_DEFAULT; -static __thread int au_need_clean = FALSE; /* need to delete marked patterns */ +static __thread int au_need_clean = FALSE; // need to delete marked patterns 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); +static int do_autocmd_event(event_T event, char_u *pat, int once, int nested, char_u *cmd, int forceit, int group, int flags); static int apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap); -static void auto_next_pat(AutoPatCmd *apc, int stop_at_last); +static void auto_next_pat(AutoPatCmd_T *apc, int stop_at_last); static int au_find_group(char_u *name); static __thread event_T last_event; static __thread int last_group; -static __thread int autocmd_blocked = 0; /* block all autocmds */ +static __thread int autocmd_blocked = 0; // block all autocmds static char_u * get_deleted_augroup(void) @@ -388,7 +390,7 @@ au_cleanup(void) return; // loop over all events - for (event = (event_T)0; (int)event < (int)NUM_EVENTS; + for (event = (event_T)0; (int)event < NUM_EVENTS; event = (event_T)((int)event + 1)) { // loop over all autocommand patterns @@ -452,9 +454,9 @@ au_cleanup(void) void aubuflocal_remove(buf_T *buf) { - AutoPat *ap; - event_T event; - AutoPatCmd *apc; + AutoPat *ap; + event_T event; + AutoPatCmd_T *apc; // invalidate currently executing autocommands for (apc = active_apc_list; apc; apc = apc->next) @@ -462,10 +464,10 @@ aubuflocal_remove(buf_T *buf) apc->arg_bufnr = 0; // invalidate buflocals looping through events - for (event = (event_T)0; (int)event < (int)NUM_EVENTS; + for (event = (event_T)0; (int)event < NUM_EVENTS; event = (event_T)((int)event + 1)) // loop over all autocommand patterns - for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) + FOR_ALL_AUTOCMD_PATTERNS(event, ap) if (ap->buflocal_nr == buf->b_fnum) { au_remove_pat(ap); @@ -516,19 +518,19 @@ au_del_group(char_u *name) i = au_find_group(name); if (i == AUGROUP_ERROR) // the group doesn't exist - semsg(_("E367: No such group: \"%s\""), name); + semsg(_(e_no_such_group_str), name); else if (i == current_augroup) - emsg(_("E936: Cannot delete the current group")); + emsg(_(e_cannot_delete_current_group)); else { event_T event; AutoPat *ap; int in_use = FALSE; - for (event = (event_T)0; (int)event < (int)NUM_EVENTS; + for (event = (event_T)0; (int)event < NUM_EVENTS; event = (event_T)((int)event + 1)) { - for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) + FOR_ALL_AUTOCMD_PATTERNS(event, ap) if (ap->group == i && ap->pat != NULL) { give_warning((char_u *)_("W19: Deleting augroup that is still in use"), TRUE); @@ -581,7 +583,7 @@ do_augroup(char_u *arg, int del_group) if (del_group) { if (*arg == NUL) - emsg(_(e_argreq)); + emsg(_(e_argument_required)); else au_del_group(arg); } @@ -618,7 +620,7 @@ free_all_autocmds(void) for (current_augroup = -1; current_augroup < augroups.ga_len; ++current_augroup) - do_autocmd((char_u *)"", TRUE); + do_autocmd(NULL, (char_u *)"", TRUE); for (i = 0; i < augroups.ga_len; ++i) { @@ -707,7 +709,7 @@ find_end_event( { if (arg[1] && !VIM_ISWHITE(arg[1])) { - semsg(_("E215: Illegal character after *: %s"), arg); + semsg(_(e_illegal_character_after_star_str), arg); return NULL; } pat = arg + 1; @@ -716,12 +718,12 @@ find_end_event( { for (pat = arg; *pat && *pat != '|' && !VIM_ISWHITE(*pat); pat = p) { - if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS) + if ((int)event_name2nr(pat, &p) >= NUM_EVENTS) { if (have_group) - semsg(_("E216: No such event: %s"), pat); + semsg(_(e_no_such_event_str), pat); else - semsg(_("E216: No such group or event: %s"), pat); + semsg(_(e_no_such_group_or_event_str), pat); return NULL; } } @@ -787,7 +789,7 @@ au_event_disable(char *what) save_ei = vim_strsave(p_ei); if (save_ei != NULL) { - new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); + new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what)); if (new_ei != NULL) { if (*what == ',' && *p_ei == NUL) @@ -812,7 +814,7 @@ au_event_restore(char_u *old_ei) vim_free(old_ei); } } -# endif /* FEAT_SYN_HL */ +# endif // FEAT_SYN_HL /* * do_autocmd() -- implements the :autocmd command. Can be used in the @@ -845,23 +847,27 @@ au_event_restore(char_u *old_ei) * :autocmd * *.c show all autocommands for *.c files. * * Mostly a {group} argument can optionally appear before . + * "eap" can be NULL. */ void -do_autocmd(char_u *arg_in, int forceit) +do_autocmd(exarg_T *eap, char_u *arg_in, int forceit) { char_u *arg = arg_in; char_u *pat; char_u *envpat = NULL; char_u *cmd; + int cmd_need_free = FALSE; event_T event; - int need_free = FALSE; + char_u *tofree = NULL; int nested = FALSE; int once = FALSE; int group; int i; + int flags = 0; if (*arg == '|') { + eap->nextcmd = arg + 1; arg = (char_u *)""; group = AUGROUP_ALL; // no argument, use all groups } @@ -886,6 +892,7 @@ do_autocmd(char_u *arg_in, int forceit) pat = skipwhite(pat); if (*pat == '|') { + eap->nextcmd = pat + 1; pat = (char_u *)""; cmd = (char_u *)""; } @@ -926,7 +933,7 @@ do_autocmd(char_u *arg_in, int forceit) if (STRNCMP(cmd, "++once", 6) == 0 && VIM_ISWHITE(cmd[6])) { if (once) - semsg(_(e_duparg2), "++once"); + semsg(_(e_duplicate_argument_str), "++once"); once = TRUE; cmd = skipwhite(cmd + 6); } @@ -935,16 +942,30 @@ do_autocmd(char_u *arg_in, int forceit) if ((STRNCMP(cmd, "++nested", 8) == 0 && VIM_ISWHITE(cmd[8]))) { if (nested) - semsg(_(e_duparg2), "++nested"); + { + semsg(_(e_duplicate_argument_str), "++nested"); + return; + } nested = TRUE; cmd = skipwhite(cmd + 8); } - // Check for the old "nested" flag. + // Check for the old "nested" flag in legacy script. if (STRNCMP(cmd, "nested", 6) == 0 && VIM_ISWHITE(cmd[6])) { + if (in_vim9script()) + { + // If there ever is a :nested command this error should + // be removed and "nested" accepted as the start of the + // command. + emsg(_(e_invalid_command_nested_did_you_mean_plusplus_nested)); + return; + } if (nested) - semsg(_(e_duparg2), "nested"); + { + semsg(_(e_duplicate_argument_str), "nested"); + return; + } nested = TRUE; cmd = skipwhite(cmd + 6); } @@ -957,10 +978,14 @@ do_autocmd(char_u *arg_in, int forceit) */ if (*cmd != NUL) { + if (eap != NULL) + // Read a {} block if it follows. + cmd = may_get_cmd_block(eap, cmd, &tofree, &flags); + cmd = expand_sfile(cmd); if (cmd == NULL) // some error return; - need_free = TRUE; + cmd_need_free = TRUE; } } @@ -978,22 +1003,26 @@ do_autocmd(char_u *arg_in, int forceit) last_group = AUGROUP_ERROR; // for listing the group name if (*arg == '*' || *arg == NUL || *arg == '|') { - for (event = (event_T)0; (int)event < (int)NUM_EVENTS; - event = (event_T)((int)event + 1)) - if (do_autocmd_event(event, pat, - once, nested, cmd, forceit, group) == FAIL) - break; + if (*cmd != NUL) + emsg(_(e_cannot_define_autocommands_for_all_events)); + else + for (event = (event_T)0; (int)event < NUM_EVENTS; + event = (event_T)((int)event + 1)) + if (do_autocmd_event(event, pat, + once, nested, cmd, forceit, group, flags) == FAIL) + break; } else { while (*arg && *arg != '|' && !VIM_ISWHITE(*arg)) if (do_autocmd_event(event_name2nr(arg, &arg), pat, - once, nested, cmd, forceit, group) == FAIL) + once, nested, cmd, forceit, group, flags) == FAIL) break; } - if (need_free) + if (cmd_need_free) vim_free(cmd); + vim_free(tofree); vim_free(envpat); } @@ -1015,7 +1044,7 @@ au_get_grouparg(char_u **argp) ; if (p > arg) { - group_name = vim_strnsave(arg, (int)(p - arg)); + group_name = vim_strnsave(arg, p - arg); if (group_name == NULL) // out of memory return AUGROUP_ERROR; group = au_find_group(group_name); @@ -1043,7 +1072,8 @@ do_autocmd_event( int nested, char_u *cmd, int forceit, - int group) + int group, + int flags) { AutoPat *ap; AutoPat **prev_ap; @@ -1056,7 +1086,7 @@ do_autocmd_event( int patlen; int is_buflocal; int buflocal_nr; - char_u buflocal_pat[25]; /* for "" */ + char_u buflocal_pat[25]; // for "" if (group == AUGROUP_ALL) findgroup = current_augroup; @@ -1069,7 +1099,7 @@ do_autocmd_event( */ if (*pat == NUL) { - for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) + FOR_ALL_AUTOCMD_PATTERNS(event, ap) { if (forceit) // delete the AutoPat, if it's in the current group { @@ -1149,7 +1179,8 @@ do_autocmd_event( { if (ap->pat != NULL) { - /* Accept a pattern when: + /* + * Accept a pattern when: * - a group was specified and it's that group, or a group was * not specified and it's the current group, or a group was * not specified and we are listing @@ -1206,12 +1237,11 @@ do_autocmd_event( */ if (ap == NULL) { - /* refuse to add buffer-local ap if buffer number is invalid */ + // refuse to add buffer-local ap if buffer number is invalid if (is_buflocal && (buflocal_nr == 0 || buflist_findnr(buflocal_nr) == NULL)) { - semsg(_("E680: : invalid buffer number "), - buflocal_nr); + semsg(_(e_buffer_nr_invalid_buffer_number), buflocal_nr); return FAIL; } @@ -1226,6 +1256,22 @@ do_autocmd_event( return FAIL; } +#ifdef FEAT_EVAL + // need to initialize last_mode for the first ModeChanged + // autocmd + if (event == EVENT_MODECHANGED && !has_modechanged()) + get_mode(last_mode); +#endif + // Initialize the fields checked by the WinScrolled trigger to + // stop it from firing right after the first autocmd is defined. + if (event == EVENT_WINSCROLLED && !has_winscrolled()) + { + curwin->w_last_topline = curwin->w_topline; + curwin->w_last_leftcol = curwin->w_leftcol; + curwin->w_last_width = curwin->w_width; + curwin->w_last_height = curwin->w_height; + } + if (is_buflocal) { ap->buflocal_nr = buflocal_nr; @@ -1268,9 +1314,11 @@ do_autocmd_event( if (ac == NULL) return FAIL; ac->cmd = vim_strsave(cmd); -#ifdef FEAT_EVAL ac->script_ctx = current_sctx; - ac->script_ctx.sc_lnum += sourcing_lnum; + if (flags & UC_VIM9) + ac->script_ctx.sc_version = SCRIPT_VERSION_VIM9; +#ifdef FEAT_EVAL + ac->script_ctx.sc_lnum += SOURCING_LNUM; #endif if (ac->cmd == NULL) { @@ -1294,10 +1342,11 @@ do_autocmd_event( */ int do_doautocmd( - char_u *arg, + char_u *arg_start, int do_msg, // give message for no matching autocmds? int *did_something) { + char_u *arg = arg_start; char_u *fname; int nothing_done = TRUE; int group; @@ -1314,7 +1363,7 @@ do_doautocmd( if (*arg == '*') { - emsg(_("E217: Can't execute autocommands for ALL events")); + emsg(_(e_cant_execute_autocommands_for_all_events)); return FAIL; } @@ -1336,8 +1385,12 @@ do_doautocmd( fname, NULL, TRUE, group, curbuf, NULL)) nothing_done = FALSE; - if (nothing_done && do_msg) - msg(_("No matching autocommands")); + if (nothing_done && do_msg +#ifdef FEAT_EVAL + && !aborting() +#endif + ) + smsg(_("No matching autocommands: %s"), arg_start); if (did_something != NULL) *did_something = !nothing_done; @@ -1354,7 +1407,7 @@ do_doautocmd( void ex_doautoall(exarg_T *eap) { - int retval; + int retval = OK; aco_save_T aco; buf_T *buf; bufref_T bufref; @@ -1371,7 +1424,8 @@ ex_doautoall(exarg_T *eap) */ FOR_ALL_BUFFERS(buf) { - if (buf->b_ml.ml_mfp != NULL) + // Only do loaded buffers and skip the current buffer, it's done last. + if (buf->b_ml.ml_mfp != NULL && buf != curbuf) { // find a window for this buffer and save some values aucmd_prepbuf(&aco, buf); @@ -1381,23 +1435,30 @@ ex_doautoall(exarg_T *eap) retval = do_doautocmd(arg, FALSE, &did_aucmd); if (call_do_modelines && did_aucmd) - { // Execute the modeline settings, but don't set window-local // options if we are using the current window for another // buffer. do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0); - } // restore the current window aucmd_restbuf(&aco); // stop if there is some error or buffer was deleted if (retval == FAIL || !bufref_valid(&bufref)) + { + retval = FAIL; break; + } } } - check_cursor(); // just in case lines got deleted + // Execute autocommands for the current buffer last. + if (retval == OK) + { + do_doautocmd(arg, FALSE, &did_aucmd); + if (call_do_modelines && did_aucmd) + do_modelines(0); + } } /* @@ -1454,9 +1515,9 @@ aucmd_prepbuf( // window. Expect a few side effects... win = curwin; - aco->save_curwin = curwin; + aco->save_curwin_id = curwin->w_id; aco->save_curbuf = curbuf; - aco->save_prevwin = prevwin; + aco->save_prevwin_id = prevwin == NULL ? 0 : prevwin->w_id; if (win != NULL) { // There is a window for "buf" in the current tab page, make it the @@ -1492,7 +1553,10 @@ aucmd_prepbuf( p_acd = FALSE; #endif + // no redrawing and don't set the window title + ++RedrawingDisabled; (void)win_split_ins(0, WSP_TOP, aucmd_win, 0); + --RedrawingDisabled; (void)win_comp_pos(); // recompute window positions p_ea = save_ea; #ifdef FEAT_AUTOCHDIR @@ -1502,8 +1566,12 @@ aucmd_prepbuf( curwin = aucmd_win; } curbuf = buf; - aco->new_curwin = curwin; + aco->new_curwin_id = curwin->w_id; set_bufref(&aco->new_curbuf, curbuf); + + // disable the Visual area, the position may be invalid in another buffer + aco->save_VIsual_active = VIsual_active; + VIsual_active = FALSE; } /* @@ -1514,7 +1582,8 @@ aucmd_prepbuf( aucmd_restbuf( aco_save_T *aco) // structure holding saved values { - int dummy; + int dummy; + win_T *save_curwin; if (aco->use_aucmd_win) { @@ -1554,19 +1623,22 @@ aucmd_restbuf( (void)win_comp_pos(); // recompute window positions unblock_autocmds(); - if (win_valid(aco->save_curwin)) - curwin = aco->save_curwin; + save_curwin = win_find_by_id(aco->save_curwin_id); + if (save_curwin != NULL) + curwin = save_curwin; else // Hmm, original window disappeared. Just use the first one. curwin = firstwin; - if (win_valid(aco->save_prevwin)) - prevwin = aco->save_prevwin; + curbuf = curwin->w_buffer; +#ifdef FEAT_JOB_CHANNEL + // May need to restore insert mode for a prompt buffer. + entering_window(curwin); +#endif + prevwin = win_find_by_id(aco->save_prevwin_id); #ifdef FEAT_EVAL vars_clear(&aucmd_win->w_vars->dv_hashtab); // free all w: variables hash_init(&aucmd_win->w_vars->dv_hashtab); // re-use the hashtab #endif - curbuf = curwin->w_buffer; - vim_free(globaldir); globaldir = aco->globaldir; @@ -1580,21 +1652,28 @@ aucmd_restbuf( #endif } #if defined(FEAT_GUI) - // Hide the scrollbars from the aucmd_win and update. - gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_LEFT], FALSE); - gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE); - gui_may_update_scrollbars(); + if (gui.in_use) + { + // Hide the scrollbars from the aucmd_win and update. + gui_mch_enable_scrollbar( + &aucmd_win->w_scrollbars[SBAR_LEFT], FALSE); + gui_mch_enable_scrollbar( + &aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE); + gui_may_update_scrollbars(); + } #endif } else { - // restore curwin - if (win_valid(aco->save_curwin)) + // Restore curwin. Use the window ID, a window may have been closed + // and the memory re-used for another one. + save_curwin = win_find_by_id(aco->save_curwin_id); + if (save_curwin != NULL) { // Restore the buffer which was previously edited by curwin, if // it was changed, we are still the same window and the buffer is // valid. - if (curwin == aco->new_curwin + if (curwin->w_id == aco->new_curwin_id && curbuf != aco->new_curbuf.br_buf && bufref_valid(&aco->new_curbuf) && aco->new_curbuf.br_buf->b_ml.ml_mfp != NULL) @@ -1609,15 +1688,19 @@ aucmd_restbuf( ++curbuf->b_nwindows; } - curwin = aco->save_curwin; + curwin = save_curwin; curbuf = curwin->w_buffer; - if (win_valid(aco->save_prevwin)) - prevwin = aco->save_prevwin; - // In case the autocommand move the cursor to a position that that - // not exist in curbuf. + prevwin = win_find_by_id(aco->save_prevwin_id); + // In case the autocommand moves the cursor to a position that + // does not exist in curbuf. check_cursor(); } } + + check_cursor(); // just in case lines got deleted + VIsual_active = aco->save_VIsual_active; + if (VIsual_active) + check_pos(curbuf, &VIsual); } static __thread int autocmd_nested = FALSE; @@ -1694,7 +1777,7 @@ apply_autocmds_retval( static int has_cursorhold(void) { - return (first_autopat[(int)(get_real_state() == NORMAL_BUSY + return (first_autopat[(int)(get_real_state() == MODE_NORMAL_BUSY ? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL); } @@ -1713,12 +1796,21 @@ trigger_cursorhold(void) && !ins_compl_active()) { state = get_real_state(); - if (state == NORMAL_BUSY || (state & INSERT) != 0) + if (state == MODE_NORMAL_BUSY || (state & MODE_INSERT) != 0) return TRUE; } return FALSE; } +/* + * Return TRUE when there is a WinScrolled autocommand defined. + */ + int +has_winscrolled(void) +{ + return (first_autopat[(int)EVENT_WINSCROLLED] != NULL); +} + /* * Return TRUE when there is a CursorMoved autocommand defined. */ @@ -1782,15 +1874,6 @@ has_cmdundefined(void) return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL); } -/* - * Return TRUE when there is an FuncUndefined autocommand defined. - */ - int -has_funcundefined(void) -{ - return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL); -} - #if defined(FEAT_EVAL) || defined(PROTO) /* * Return TRUE when there is a TextYankPost autocommand defined. @@ -1813,10 +1896,25 @@ has_completechanged(void) } #endif +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * Return TRUE when there is a ModeChanged autocommand defined. + */ + int +has_modechanged(void) +{ + return (first_autopat[(int)EVENT_MODECHANGED] != NULL); +} +#endif + /* * Execute autocommands for "event" and file name "fname". * Return TRUE if some commands were executed. */ +#if TARGET_OS_IPHONE +static __thread int nesting = 0; +static __thread int filechangeshell_busy = FALSE; +#endif static int apply_autocmds_group( event_T event, @@ -1833,30 +1931,34 @@ apply_autocmds_group( int save_changed; buf_T *old_curbuf; int retval = FALSE; - char_u *save_sourcing_name; - linenr_T save_sourcing_lnum; char_u *save_autocmd_fname; int save_autocmd_fname_full; int save_autocmd_bufnr; char_u *save_autocmd_match; int save_autocmd_busy; int save_autocmd_nested; +#if !TARGET_OS_IPHONE static int nesting = 0; - AutoPatCmd patcmd; +#endif + AutoPatCmd_T patcmd; AutoPat *ap; -#ifdef FEAT_EVAL sctx_T save_current_sctx; +#ifdef FEAT_EVAL funccal_entry_T funccal_entry; char_u *save_cmdarg; long save_cmdbang; #endif +#if !TARGET_OS_IPHONE static int filechangeshell_busy = FALSE; +#endif #ifdef FEAT_PROFILE proftime_T wait_time; #endif int did_save_redobuff = FALSE; save_redo_T save_redo; int save_KeyTyped = KeyTyped; + int save_did_emsg; + ESTACK_CHECK_DECLARATION /* * Quickly return if there are no autocommands for this event or @@ -1901,7 +2003,7 @@ apply_autocmds_group( */ if (nesting == 10) { - emsg(_("E218: autocommand nesting too deep")); + emsg(_(e_autocommand_nesting_too_deep)); goto BYPASS_AU; } @@ -1935,7 +2037,8 @@ apply_autocmds_group( if (fname_io == NULL) { if (event == EVENT_COLORSCHEME || event == EVENT_COLORSCHEMEPRE - || event == EVENT_OPTIONSET) + || event == EVENT_OPTIONSET + || event == EVENT_MODECHANGED) autocmd_fname = NULL; else if (fname != NULL && !ends_excmd(*fname)) autocmd_fname = fname; @@ -1991,7 +2094,7 @@ apply_autocmds_group( { sfname = vim_strsave(fname); // Don't try expanding FileType, Syntax, FuncUndefined, WindowID, - // ColorScheme, QuickFixCmd* or DirChanged + // ColorScheme, QuickFixCmd*, DirChanged and similar. if (event == EVENT_FILETYPE || event == EVENT_SYNTAX || event == EVENT_CMDLINECHANGED @@ -2008,7 +2111,12 @@ apply_autocmds_group( || event == EVENT_COLORSCHEMEPRE || event == EVENT_OPTIONSET || event == EVENT_QUICKFIXCMDPOST - || event == EVENT_DIRCHANGED) + || event == EVENT_DIRCHANGED + || event == EVENT_DIRCHANGEDPRE + || event == EVENT_MODECHANGED + || event == EVENT_USER + || event == EVENT_WINCLOSED + || event == EVENT_WINSCROLLED) { fname = vim_strsave(fname); autocmd_fname_full = TRUE; // don't expand it later @@ -2048,14 +2156,14 @@ apply_autocmds_group( // Don't redraw while doing autocommands. ++RedrawingDisabled; - save_sourcing_name = sourcing_name; - sourcing_name = NULL; // don't free this one - save_sourcing_lnum = sourcing_lnum; - sourcing_lnum = 0; // no line number here -#ifdef FEAT_EVAL + // name and lnum are filled in later + estack_push(ETYPE_AUCMD, NULL, 0); + ESTACK_CHECK_SETUP + save_current_sctx = current_sctx; +#ifdef FEAT_EVAL # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) prof_child_enter(&wait_time); // doesn't count for the caller itself @@ -2093,15 +2201,14 @@ apply_autocmds_group( tail = gettail(fname); // Find first autocommand that matches + CLEAR_FIELD(patcmd); patcmd.curpat = first_autopat[(int)event]; - patcmd.nextcmd = NULL; patcmd.group = group; patcmd.fname = fname; patcmd.sfname = sfname; patcmd.tail = tail; patcmd.event = event; patcmd.arg_bufnr = autocmd_bufnr; - patcmd.next = NULL; auto_next_pat(&patcmd, FALSE); // found one, start executing the autocommands @@ -2129,14 +2236,20 @@ apply_autocmds_group( ap->last = FALSE; ap->last = TRUE; - // make sure cursor and topline are valid - check_lnums(TRUE); + if (nesting == 1) + // make sure cursor and topline are valid + check_lnums(TRUE); + + save_did_emsg = did_emsg; do_cmdline(NULL, getnextac, (void *)&patcmd, DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); - // restore cursor and topline, unless they were changed - reset_lnums(); + did_emsg += save_did_emsg; + + if (nesting == 1) + // restore cursor and topline, unless they were changed + reset_lnums(); #ifdef FEAT_EVAL if (eap != NULL) @@ -2154,16 +2267,16 @@ apply_autocmds_group( autocmd_busy = save_autocmd_busy; filechangeshell_busy = FALSE; autocmd_nested = save_autocmd_nested; - vim_free(sourcing_name); - sourcing_name = save_sourcing_name; - sourcing_lnum = save_sourcing_lnum; + vim_free(SOURCING_NAME); + ESTACK_CHECK_NOW + estack_pop(); vim_free(autocmd_fname); autocmd_fname = save_autocmd_fname; autocmd_fname_full = save_autocmd_fname_full; autocmd_bufnr = save_autocmd_bufnr; autocmd_match = save_autocmd_match; -#ifdef FEAT_EVAL current_sctx = save_current_sctx; +#ifdef FEAT_EVAL restore_funccal(); # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) @@ -2189,12 +2302,14 @@ apply_autocmds_group( while (au_pending_free_buf != NULL) { buf_T *b = au_pending_free_buf->b_next; + vim_free(au_pending_free_buf); au_pending_free_buf = b; } while (au_pending_free_win != NULL) { win_T *w = au_pending_free_win->w_next; + vim_free(au_pending_free_win); au_pending_free_win = w; } @@ -2211,10 +2326,8 @@ apply_autocmds_group( || event == EVENT_VIMLEAVE || event == EVENT_VIMLEAVEPRE)) { -#ifdef FEAT_TITLE if (curbuf->b_changed != save_changed) need_maketitle = TRUE; -#endif curbuf->b_changed = save_changed; } @@ -2277,15 +2390,21 @@ is_autocmd_blocked(void) */ static void auto_next_pat( - AutoPatCmd *apc, + AutoPatCmd_T *apc, int stop_at_last) // stop when 'last' flag is set { AutoPat *ap; AutoCmd *cp; char_u *name; char *s; + estack_T *entry; + char_u *namep; - VIM_CLEAR(sourcing_name); + entry = ((estack_T *)exestack.ga_data) + exestack.ga_len - 1; + + // Clear the exestack entry for this ETYPE_AUCMD entry. + VIM_CLEAR(entry->es_name); + entry->es_info.aucmd = NULL; for (ap = apc->curpat; ap != NULL && !got_int; ap = ap->next) { @@ -2305,20 +2424,22 @@ auto_next_pat( { name = event_nr2name(apc->event); s = _("%s Autocommands for \"%s\""); - sourcing_name = alloc(STRLEN(s) - + STRLEN(name) + ap->patlen + 1); - if (sourcing_name != NULL) + namep = alloc(STRLEN(s) + STRLEN(name) + ap->patlen + 1); + if (namep != NULL) { - sprintf((char *)sourcing_name, s, - (char *)name, (char *)ap->pat); + sprintf((char *)namep, s, (char *)name, (char *)ap->pat); if (p_verbose >= 8) { verbose_enter(); - smsg(_("Executing %s"), sourcing_name); + smsg(_("Executing %s"), namep); verbose_leave(); } } + // Update the exestack entry for this autocmd. + entry->es_name = namep; + entry->es_info.aucmd = apc; + apc->curpat = ap; apc->nextcmd = ap->cmds; // mark last command @@ -2335,15 +2456,28 @@ auto_next_pat( } } +/* + * Get the script context where autocommand "acp" is defined. + */ + sctx_T * +acp_script_ctx(AutoPatCmd_T *acp) +{ + return &acp->script_ctx; +} + /* * Get next autocommand command. * Called by do_cmdline() to get the next line for ":if". * Returns allocated string, or NULL for end of autocommands. */ char_u * -getnextac(int c UNUSED, void *cookie, int indent UNUSED, int do_concat UNUSED) +getnextac( + int c UNUSED, + void *cookie, + int indent UNUSED, + getline_opt_T options UNUSED) { - AutoPatCmd *acp = (AutoPatCmd *)cookie; + AutoPatCmd_T *acp = (AutoPatCmd_T *)cookie; char_u *retval; AutoCmd *ac; @@ -2389,9 +2523,8 @@ getnextac(int c UNUSED, void *cookie, int indent UNUSED, int do_concat UNUSED) if (ac->once) au_del_cmd(ac); autocmd_nested = ac->nested; -#ifdef FEAT_EVAL current_sctx = ac->script_ctx; -#endif + acp->script_ctx = current_sctx; if (ac->last) acp->nextcmd = NULL; else @@ -2427,7 +2560,7 @@ has_autocmd(event_T event, char_u *sfname, buf_T *buf) forward_slash(fname); #endif - for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) + FOR_ALL_AUTOCMD_PATTERNS(event, ap) if (ap->pat != NULL && ap->cmds != NULL && (ap->buflocal_nr == 0 ? match_file_pat(NULL, &ap->reg_prog, @@ -2456,7 +2589,7 @@ get_augroup_name(expand_T *xp UNUSED, int idx) { if (idx == augroups.ga_len) // add "END" add the end return (char_u *)"END"; - if (idx >= augroups.ga_len) // end of list + if (idx < 0 || idx >= augroups.ga_len) // end of list return NULL; if (AUGROUP_NAME(idx) == NULL || AUGROUP_NAME(idx) == get_deleted_augroup()) // skip deleted entries @@ -2641,4 +2774,441 @@ au_exists(char_u *arg) vim_free(arg_save); return retval; } + +/* + * autocmd_add() and autocmd_delete() functions + */ + static void +autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete) +{ + list_T *aucmd_list; + listitem_T *li; + dict_T *event_dict; + dictitem_T *di; + char_u *event_name = NULL; + list_T *event_list; + listitem_T *eli; + event_T event; + char_u *group_name = NULL; + int group; + char_u *pat = NULL; + list_T *pat_list; + listitem_T *pli; + char_u *cmd = NULL; + char_u *end; + int once; + int nested; + int replace; // replace the cmd for a group/event + int retval = VVAL_TRUE; + int save_augroup = current_augroup; + + rettv->v_type = VAR_BOOL; + rettv->vval.v_number = VVAL_FALSE; + + if (check_for_list_arg(argvars, 0) == FAIL) + return; + + aucmd_list = argvars[0].vval.v_list; + if (aucmd_list == NULL) + return; + + FOR_ALL_LIST_ITEMS(aucmd_list, li) + { + VIM_CLEAR(group_name); + VIM_CLEAR(cmd); + event_name = NULL; + event_list = NULL; + pat = NULL; + pat_list = NULL; + + if (li->li_tv.v_type != VAR_DICT) + continue; + + event_dict = li->li_tv.vval.v_dict; + if (event_dict == NULL) + continue; + + di = dict_find(event_dict, (char_u *)"event", -1); + if (di != NULL) + { + if (di->di_tv.v_type == VAR_STRING) + { + event_name = di->di_tv.vval.v_string; + if (event_name == NULL) + { + emsg(_(e_string_required)); + continue; + } + } + else if (di->di_tv.v_type == VAR_LIST) + { + event_list = di->di_tv.vval.v_list; + if (event_list == NULL) + { + emsg(_(e_list_required)); + continue; + } + } + else + { + emsg(_(e_string_or_list_expected)); + continue; + } + } + + group_name = dict_get_string(event_dict, (char_u *)"group", TRUE); + if (group_name == NULL || *group_name == NUL) + // if the autocmd group name is not specified, then use the current + // autocmd group + group = current_augroup; + else + { + group = au_find_group(group_name); + if (group == AUGROUP_ERROR) + { + if (delete) + { + semsg(_(e_no_such_group_str), group_name); + retval = VVAL_FALSE; + break; + } + // group is not found, create it now + group = au_new_group(group_name); + if (group == AUGROUP_ERROR) + { + semsg(_(e_no_such_group_str), group_name); + retval = VVAL_FALSE; + break; + } + + current_augroup = group; + } + } + + // if a buffer number is specified, then generate a pattern of the form + // ". Otherwise, use the pattern supplied by the user. + if (dict_has_key(event_dict, "bufnr")) + { + varnumber_T bnum; + + bnum = dict_get_number_def(event_dict, (char_u *)"bufnr", -1); + if (bnum == -1) + continue; + + vim_snprintf((char *)IObuff, IOSIZE, "", (int)bnum); + pat = IObuff; + } + else + { + di = dict_find(event_dict, (char_u *)"pattern", -1); + if (di != NULL) + { + if (di->di_tv.v_type == VAR_STRING) + { + pat = di->di_tv.vval.v_string; + if (pat == NULL) + { + emsg(_(e_string_required)); + continue; + } + } + else if (di->di_tv.v_type == VAR_LIST) + { + pat_list = di->di_tv.vval.v_list; + if (pat_list == NULL) + { + emsg(_(e_list_required)); + continue; + } + } + else + { + emsg(_(e_string_or_list_expected)); + continue; + } + } + else if (delete) + pat = (char_u *)""; + } + + once = dict_get_bool(event_dict, (char_u *)"once", FALSE); + nested = dict_get_bool(event_dict, (char_u *)"nested", FALSE); + // if 'replace' is true, then remove all the commands associated with + // this autocmd event/group and add the new command. + replace = dict_get_bool(event_dict, (char_u *)"replace", FALSE); + + cmd = dict_get_string(event_dict, (char_u *)"cmd", TRUE); + if (cmd == NULL) + { + if (delete) + cmd = vim_strsave((char_u *)""); + else + continue; + } + + if (delete && (event_name == NULL + || (event_name[0] == '*' && event_name[1] == NUL))) + { + // if the event name is not specified or '*', delete all the events + for (event = (event_T)0; (int)event < NUM_EVENTS; + event = (event_T)((int)event + 1)) + { + if (do_autocmd_event(event, pat, once, nested, cmd, delete, + group, 0) == FAIL) + { + retval = VVAL_FALSE; + break; + } + } + } + else + { + char_u *p = NULL; + + eli = NULL; + end = NULL; + while (TRUE) + { + if (event_list != NULL) + { + if (eli == NULL) + eli = event_list->lv_first; + else + eli = eli->li_next; + if (eli == NULL) + break; + if (eli->li_tv.v_type != VAR_STRING + || (p = eli->li_tv.vval.v_string) == NULL) + { + emsg(_(e_string_required)); + break; + } + } + else + { + if (p == NULL) + p = event_name; + if (p == NULL || *p == NUL) + break; + } + + event = event_name2nr(p, &end); + if (event == NUM_EVENTS || *end != NUL) + { + // this also catches something following a valid event name + semsg(_(e_no_such_event_str), p); + retval = VVAL_FALSE; + break; + } + if (pat != NULL) + { + if (do_autocmd_event(event, pat, once, nested, cmd, + delete | replace, group, 0) == FAIL) + { + retval = VVAL_FALSE; + break; + } + } + else if (pat_list != NULL) + { + FOR_ALL_LIST_ITEMS(pat_list, pli) + { + if (pli->li_tv.v_type != VAR_STRING + || pli->li_tv.vval.v_string == NULL) + { + emsg(_(e_string_required)); + continue; + } + if (do_autocmd_event(event, + pli->li_tv.vval.v_string, once, nested, + cmd, delete | replace, group, 0) == + FAIL) + { + retval = VVAL_FALSE; + break; + } + } + if (retval == VVAL_FALSE) + break; + } + if (event_name != NULL) + p = end; + } + } + + // if only the autocmd group name is specified for delete and the + // autocmd event, pattern and cmd are not specified, then delete the + // autocmd group. + if (delete && group_name != NULL && + (event_name == NULL || event_name[0] == NUL) + && (pat == NULL || pat[0] == NUL) + && (cmd == NULL || cmd[0] == NUL)) + au_del_group(group_name); + } + + VIM_CLEAR(group_name); + VIM_CLEAR(cmd); + + current_augroup = save_augroup; + rettv->vval.v_number = retval; +} + +/* + * autocmd_add() function + */ + void +f_autocmd_add(typval_T *argvars, typval_T *rettv) +{ + autocmd_add_or_delete(argvars, rettv, FALSE); +} + +/* + * autocmd_delete() function + */ + void +f_autocmd_delete(typval_T *argvars, typval_T *rettv) +{ + autocmd_add_or_delete(argvars, rettv, TRUE); +} + +/* + * autocmd_get() function + * Returns a List of autocmds. + */ + void +f_autocmd_get(typval_T *argvars, typval_T *rettv) +{ + event_T event_arg = NUM_EVENTS; + event_T event; + AutoPat *ap; + AutoCmd *ac; + list_T *event_list; + dict_T *event_dict; + char_u *event_name = NULL; + char_u *pat = NULL; + char_u *name = NULL; + int group = AUGROUP_ALL; + + if (rettv_list_alloc(rettv) == FAIL) + return; + if (check_for_opt_dict_arg(argvars, 0) == FAIL) + return; + + if (argvars[0].v_type == VAR_DICT) + { + // return only the autocmds in the specified group + if (dict_has_key(argvars[0].vval.v_dict, "group")) + { + name = dict_get_string(argvars[0].vval.v_dict, + (char_u *)"group", TRUE); + if (name == NULL) + return; + + if (*name == NUL) + group = AUGROUP_DEFAULT; + else + { + group = au_find_group(name); + if (group == AUGROUP_ERROR) + { + semsg(_(e_no_such_group_str), name); + vim_free(name); + return; + } + } + vim_free(name); + } + + // 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, + (char_u *)"event", TRUE); + if (name == NULL) + return; + + if (name[0] == '*' && name[1] == NUL) + 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) + { + semsg(_(e_no_such_event_str), name); + vim_free(name); + return; + } + event_arg = event_names[i].event; + } + vim_free(name); + } + + // return only the autocmds for the specified pattern + if (dict_has_key(argvars[0].vval.v_dict, "pattern")) + { + pat = dict_get_string(argvars[0].vval.v_dict, + (char_u *)"pattern", TRUE); + if (pat == NULL) + return; + } + } + + event_list = rettv->vval.v_list; + + // iterate through all the autocmd events + for (event = (event_T)0; (int)event < NUM_EVENTS; + event = (event_T)((int)event + 1)) + { + if (event_arg != NUM_EVENTS && event != event_arg) + continue; + + event_name = event_nr2name(event); + + // iterate through all the patterns for this autocmd event + FOR_ALL_AUTOCMD_PATTERNS(event, ap) + { + char_u *group_name; + + if (group != AUGROUP_ALL && group != ap->group) + continue; + + if (pat != NULL && STRCMP(pat, ap->pat) != 0) + continue; + + group_name = get_augroup_name(NULL, ap->group); + + // iterate through all the commands for this pattern and add one + // item for each cmd. + for (ac = ap->cmds; ac != NULL; ac = ac->next) + { + event_dict = dict_alloc(); + if (event_dict == NULL + || list_append_dict(event_list, event_dict) == FAIL) + return; + + if (dict_add_string(event_dict, "event", event_name) == FAIL + || dict_add_string(event_dict, "group", + group_name == NULL ? (char_u *)"" + : group_name) == FAIL + || (ap->buflocal_nr != 0 + && (dict_add_number(event_dict, "bufnr", + ap->buflocal_nr) == FAIL)) + || dict_add_string(event_dict, "pattern", + ap->pat) == FAIL + || dict_add_string(event_dict, "cmd", ac->cmd) == FAIL + || dict_add_bool(event_dict, "once", ac->once) == FAIL + || dict_add_bool(event_dict, "nested", + ac->nested) == FAIL) + return; + } + } + } + + vim_free(pat); +} + #endif diff --git a/src/beval.c b/src/beval.c index 8ef8e8e1d5baa..4b89af3667245 100644 --- a/src/beval.c +++ b/src/beval.c @@ -10,7 +10,7 @@ #include "vim.h" -#if defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP) || defined(PROTO) +#if defined(FEAT_BEVAL) || defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Find text under the mouse position "row" / "col". * If "getword" is TRUE the returned text in "*textp" is not the whole line but @@ -110,6 +110,8 @@ find_word_under_cursor( lbuf = vim_strnsave(lbuf, len); } } + else + scol = col; if (winp != NULL) *winp = wp; @@ -148,18 +150,18 @@ get_beval_info( int row = mouse_row; int col = mouse_col; -# ifdef FEAT_GUI +# ifdef FEAT_BEVAL_GUI if (gui.in_use) { row = Y_2_ROW(beval->y); col = X_2_COL(beval->x); } -#endif +# endif if (find_word_under_cursor(row, col, getword, FIND_IDENT + FIND_STRING + FIND_EVAL, winp, lnump, textp, colp, NULL) == OK) { -#ifdef FEAT_VARTABS +# ifdef FEAT_VARTABS vim_free(beval->vts); beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array); if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL) @@ -168,7 +170,7 @@ get_beval_info( vim_free(*textp); return FAIL; } -#endif +# endif beval->ts = (*winp)->w_buffer->b_p_ts; return OK; } @@ -239,13 +241,13 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) #endif static int recursive = FALSE; - /* Don't do anything when 'ballooneval' is off, messages scrolled the - * windows up or we have no beval area. */ + // Don't do anything when 'ballooneval' is off, messages scrolled the + // windows up or we have no beval area. if (!can_use_beval() || beval == NULL) return; - /* Don't do this recursively. Happens when the expression evaluation - * takes a long time and invokes something that checks for CTRL-C typed. */ + // Don't do this recursively. Happens when the expression evaluation + // takes a long time and invokes something that checks for CTRL-C typed. if (recursive) return; recursive = TRUE; @@ -257,7 +259,9 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) : wp->w_buffer->b_p_bexpr; if (*bexpr != NUL) { - /* Convert window pointer to number. */ + sctx_T save_sctx = current_sctx; + + // Convert window pointer to number. for (cw = firstwin; cw != wp; cw = cw->w_next) ++winnr; @@ -282,12 +286,22 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) ++sandbox; ++textlock; + if (bexpr == p_bexpr) + { + sctx_T *sp = get_option_sctx("balloonexpr"); + + if (sp != NULL) + current_sctx = *sp; + } + else + current_sctx = curbuf->b_p_script_ctx[BV_BEXPR]; + vim_free(result); - result = eval_to_string(bexpr, NULL, TRUE); + result = eval_to_string(bexpr, TRUE); - /* Remove one trailing newline, it is added when the result was a - * list and it's hardly ever useful. If the user really wants a - * trailing newline he can add two and one remains. */ + // Remove one trailing newline, it is added when the result was a + // list and it's hardly ever useful. If the user really wants a + // trailing newline he can add two and one remains. if (result != NULL) { len = STRLEN(result); @@ -298,6 +312,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) if (use_sandbox) --sandbox; --textlock; + current_sctx = save_sctx; set_vim_var_string(VV_BEVAL_TEXT, NULL, -1); if (result != NULL && result[0] != NUL) @@ -306,7 +321,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) // The 'balloonexpr' evaluation may show something on the screen // that requires a screen update. if (must_redraw) - redraw_after_callback(FALSE); + redraw_after_callback(FALSE, FALSE); recursive = FALSE; return; @@ -322,4 +337,3 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) } #endif - diff --git a/src/beval.h b/src/beval.h index 60cf1ab9dca4d..4332389642d6e 100644 --- a/src/beval.h +++ b/src/beval.h @@ -24,51 +24,51 @@ typedef enum { - ShS_NEUTRAL, /* nothing showing or pending */ - ShS_PENDING, /* data requested from debugger */ - ShS_UPDATE_PENDING, /* switching information displayed */ - ShS_SHOWING /* the balloon is being displayed */ + ShS_NEUTRAL, // nothing showing or pending + ShS_PENDING, // data requested from debugger + ShS_UPDATE_PENDING, // switching information displayed + ShS_SHOWING // the balloon is being displayed } BeState; typedef struct BalloonEvalStruct { #ifdef FEAT_BEVAL_GUI # ifdef FEAT_GUI_GTK - GtkWidget *target; /* widget we are monitoring */ + GtkWidget *target; // widget we are monitoring GtkWidget *balloonShell; GtkWidget *balloonLabel; - unsigned int timerID; /* timer for run */ - BeState showState; /* tells us whats currently going on */ + unsigned int timerID; // timer for run + BeState showState; // tells us what's currently going on int x; int y; - unsigned int state; /* Button/Modifier key state */ + unsigned int state; // Button/Modifier key state # else # if !defined(FEAT_GUI_MSWIN) - Widget target; /* widget we are monitoring */ + Widget target; // widget we are monitoring Widget balloonShell; Widget balloonLabel; - XtIntervalId timerID; /* timer for run */ - BeState showState; /* tells us whats currently going on */ - XtAppContext appContext; /* used in event handler */ + XtIntervalId timerID; // timer for run + BeState showState; // tells us what's currently going on + XtAppContext appContext; // used in event handler Position x; Position y; Position x_root; Position y_root; - int state; /* Button/Modifier key state */ + int state; // Button/Modifier key state # else HWND target; HWND balloon; int x; int y; - BeState showState; /* tells us whats currently going on */ + BeState showState; // tells us what's currently going on # endif # endif # if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN) - Dimension screen_width; /* screen width in pixels */ - Dimension screen_height; /* screen height in pixels */ + Dimension screen_width; // screen width in pixels + Dimension screen_height; // screen height in pixels # endif void (*msgCB)(struct BalloonEvalStruct *, int); - void *clientData; /* For callback */ + void *clientData; // For callback #endif int ts; // tabstop setting for this buffer @@ -79,13 +79,17 @@ typedef struct BalloonEvalStruct #ifdef FEAT_GUI_MSWIN void *tofree; #endif +#ifdef FEAT_GUI_HAIKU + int x; + int y; +#endif } BalloonEval; -#define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */ +#define EVAL_OFFSET_X 15 // displacement of beval topleft corner from pointer #define EVAL_OFFSET_Y 10 #ifdef FEAT_BEVAL_GUI # include "gui_beval.pro" #endif -#endif /* BEVAL__H and FEAT_BEVAL_GUI */ +#endif // BEVAL__H and FEAT_BEVAL_GUI diff --git a/src/blob.c b/src/blob.c index 278ced62c8d2a..0d88c757aaf8c 100644 --- a/src/blob.c +++ b/src/blob.c @@ -22,7 +22,7 @@ blob_T * blob_alloc(void) { - blob_T *blob = ALLOC_CLEAR_ONE(blob_T); + blob_T *blob = ALLOC_CLEAR_ONE_ID(blob_T, aid_blob_alloc); if (blob != NULL) ga_init2(&blob->bv_ga, 1, 100); @@ -58,28 +58,29 @@ rettv_blob_set(typval_T *rettv, blob_T *b) } int -blob_copy(typval_T *from, typval_T *to) +blob_copy(blob_T *from, typval_T *to) { int ret = OK; to->v_type = VAR_BLOB; to->v_lock = 0; - if (from->vval.v_blob == NULL) + if (from == NULL) to->vval.v_blob = NULL; else if (rettv_blob_alloc(to) == FAIL) ret = FAIL; else { - int len = from->vval.v_blob->bv_ga.ga_len; + int len = from->bv_ga.ga_len; if (len > 0) { to->vval.v_blob->bv_ga.ga_data = - vim_memsave(from->vval.v_blob->bv_ga.ga_data, len); + vim_memsave(from->bv_ga.ga_data, len); if (to->vval.v_blob->bv_ga.ga_data == NULL) len = 0; } to->vval.v_blob->bv_ga.ga_len = len; + to->vval.v_blob->bv_ga.ga_maxlen = len; } return ret; } @@ -124,13 +125,33 @@ blob_get(blob_T *b, int idx) } /* - * Store one byte "c" in blob "b" at "idx". + * Store one byte "byte" in blob "blob" at "idx". * Caller must make sure that "idx" is valid. */ void -blob_set(blob_T *b, int idx, char_u c) +blob_set(blob_T *blob, int idx, int byte) { - ((char_u*)b->bv_ga.ga_data)[idx] = c; + ((char_u*)blob->bv_ga.ga_data)[idx] = byte; +} + +/* + * Store one byte "byte" in blob "blob" at "idx". + * Append one byte if needed. + */ + void +blob_set_append(blob_T *blob, int idx, int byte) +{ + garray_T *gap = &blob->bv_ga; + + // Allow for appending a byte. Setting a byte beyond + // the end is an error otherwise. + if (idx < gap->ga_len + || (idx == gap->ga_len && ga_grow(gap, 1) == OK)) + { + blob_set(blob, idx, byte); + if (idx == gap->ga_len) + ++gap->ga_len; + } } /* @@ -188,7 +209,7 @@ write_blob(FILE *fd, blob_T *blob) if (fwrite(blob->bv_ga.ga_data, 1, blob->bv_ga.ga_len, fd) < (size_t)blob->bv_ga.ga_len) { - emsg(_(e_write)); + emsg(_(e_error_while_writing)); return FAIL; } return OK; @@ -216,9 +237,10 @@ blob2string(blob_T *blob, char_u **tofree, char_u *numbuf) { if (i > 0 && (i & 3) == 0) ga_concat(&ga, (char_u *)"."); - vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", (int)blob_get(blob, i)); + vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", blob_get(blob, i)); ga_concat(&ga, numbuf); } + ga_append(&ga, NUL); // append a NUL at the end *tofree = ga.ga_data; return *tofree; } @@ -258,74 +280,498 @@ string2blob(char_u *str) return NULL; } + int +blob_slice_or_index( + blob_T *blob, + int is_range, + varnumber_T n1, + varnumber_T n2, + int exclusive, + typval_T *rettv) +{ + long len = blob_len(blob); + + if (is_range) + { + // The resulting variable is a sub-blob. If the indexes + // are out of range the result is empty. + if (n1 < 0) + { + n1 = len + n1; + if (n1 < 0) + n1 = 0; + } + if (n2 < 0) + n2 = len + n2; + else if (n2 >= len) + n2 = len - (exclusive ? 0 : 1); + if (exclusive) + --n2; + if (n1 >= len || n2 < 0 || n1 > n2) + { + clear_tv(rettv); + rettv->v_type = VAR_BLOB; + rettv->vval.v_blob = NULL; + } + else + { + blob_T *new_blob = blob_alloc(); + long i; + + if (new_blob != NULL) + { + if (ga_grow(&new_blob->bv_ga, n2 - n1 + 1) == FAIL) + { + blob_free(new_blob); + return FAIL; + } + new_blob->bv_ga.ga_len = n2 - n1 + 1; + for (i = n1; i <= n2; i++) + blob_set(new_blob, i - n1, blob_get(blob, i)); + + clear_tv(rettv); + rettv_blob_set(rettv, new_blob); + } + } + } + else + { + // The resulting variable is a byte value. + // If the index is too big or negative that is an error. + if (n1 < 0) + n1 = len + n1; + if (n1 < len && n1 >= 0) + { + int v = blob_get(blob, n1); + + clear_tv(rettv); + rettv->v_type = VAR_NUMBER; + rettv->vval.v_number = v; + } + else + { + semsg(_(e_blob_index_out_of_range_nr), n1); + return FAIL; + } + } + return OK; +} + /* - * "remove({blob})" function + * Check if "n1"- is a valid index for a blobl with length "bloblen". + */ + int +check_blob_index(long bloblen, varnumber_T n1, int quiet) +{ + if (n1 < 0 || n1 > bloblen) + { + if (!quiet) + semsg(_(e_blob_index_out_of_range_nr), n1); + return FAIL; + } + return OK; +} + +/* + * Check if "n1"-"n2" is a valid range for a blob with length "bloblen". + */ + int +check_blob_range(long bloblen, varnumber_T n1, varnumber_T n2, int quiet) +{ + if (n2 < 0 || n2 >= bloblen || n2 < n1) + { + if (!quiet) + semsg(_(e_blob_index_out_of_range_nr), n2); + return FAIL; + } + return OK; +} + +/* + * Set bytes "n1" to "n2" (inclusive) in "dest" to the value of "src". + * Caller must make sure "src" is a blob. + * Returns FAIL if the number of bytes does not match. + */ + int +blob_set_range(blob_T *dest, long n1, long n2, typval_T *src) +{ + int il, ir; + + if (n2 - n1 + 1 != blob_len(src->vval.v_blob)) + { + emsg(_(e_blob_value_does_not_have_right_number_of_bytes)); + return FAIL; + } + + ir = 0; + for (il = n1; il <= n2; il++) + blob_set(dest, il, blob_get(src->vval.v_blob, ir++)); + return OK; +} + +/* + * "add(blob, item)" function + */ + void +blob_add(typval_T *argvars, typval_T *rettv) +{ + blob_T *b = argvars[0].vval.v_blob; + int error = FALSE; + varnumber_T n; + + if (b == NULL) + { + if (in_vim9script()) + emsg(_(e_cannot_add_to_null_blob)); + return; + } + + if (value_check_lock(b->bv_lock, (char_u *)N_("add() argument"), TRUE)) + return; + + n = tv_get_number_chk(&argvars[1], &error); + if (error) + return; + + ga_append(&b->bv_ga, (int)n); + copy_tv(&argvars[0], rettv); +} + +/* + * "remove({blob}, {idx} [, {end}])" function */ void -blob_remove(typval_T *argvars, typval_T *rettv) +blob_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg) { + blob_T *b = argvars[0].vval.v_blob; + blob_T *newblob; int error = FALSE; - long idx = (long)tv_get_number_chk(&argvars[1], &error); + long idx; long end; + int len; + char_u *p; - if (!error) + if (b != NULL && value_check_lock(b->bv_lock, arg_errmsg, TRUE)) + return; + + idx = (long)tv_get_number_chk(&argvars[1], &error); + if (error) + return; + + len = blob_len(b); + + if (idx < 0) + // count from the end + idx = len + idx; + if (idx < 0 || idx >= len) { - blob_T *b = argvars[0].vval.v_blob; - int len = blob_len(b); - char_u *p; - - if (idx < 0) - // count from the end - idx = len + idx; - if (idx < 0 || idx >= len) - { - semsg(_(e_blobidx), idx); + semsg(_(e_blob_index_out_of_range_nr), idx); + return; + } + if (argvars[2].v_type == VAR_UNKNOWN) + { + // Remove one item, return its value. + p = (char_u *)b->bv_ga.ga_data; + rettv->vval.v_number = (varnumber_T) *(p + idx); + mch_memmove(p + idx, p + idx + 1, (size_t)len - idx - 1); + --b->bv_ga.ga_len; + return; + } + + // Remove range of items, return blob with values. + end = (long)tv_get_number_chk(&argvars[2], &error); + if (error) + return; + if (end < 0) + // count from the end + end = len + end; + if (end >= len || idx > end) + { + semsg(_(e_blob_index_out_of_range_nr), end); + return; + } + newblob = blob_alloc(); + if (newblob == NULL) + return; + newblob->bv_ga.ga_len = end - idx + 1; + if (ga_grow(&newblob->bv_ga, end - idx + 1) == FAIL) + { + vim_free(newblob); + return; + } + p = (char_u *)b->bv_ga.ga_data; + mch_memmove((char_u *)newblob->bv_ga.ga_data, p + idx, + (size_t)(end - idx + 1)); + ++newblob->bv_refcount; + rettv->v_type = VAR_BLOB; + rettv->vval.v_blob = newblob; + + if (len - end - 1 > 0) + mch_memmove(p + idx, p + end + 1, (size_t)(len - end - 1)); + b->bv_ga.ga_len -= end - idx + 1; +} + +/* + * Implementation of map() and filter() for a Blob. Apply "expr" to every + * number in Blob "blob_arg" and return the result in "rettv". + */ + void +blob_filter_map( + blob_T *blob_arg, + filtermap_T filtermap, + typval_T *expr, + typval_T *rettv) +{ + blob_T *b; + int i; + typval_T tv; + varnumber_T val; + blob_T *b_ret; + int idx = 0; + int rem; + + if (filtermap == FILTERMAP_MAPNEW) + { + rettv->v_type = VAR_BLOB; + rettv->vval.v_blob = NULL; + } + if ((b = blob_arg) == NULL) + return; + + b_ret = b; + if (filtermap == FILTERMAP_MAPNEW) + { + if (blob_copy(b, rettv) == FAIL) return; + b_ret = rettv->vval.v_blob; + } + + // set_vim_var_nr() doesn't set the type + set_vim_var_type(VV_KEY, VAR_NUMBER); + + for (i = 0; i < b->bv_ga.ga_len; i++) + { + typval_T newtv; + + tv.v_type = VAR_NUMBER; + val = blob_get(b, i); + tv.vval.v_number = val; + set_vim_var_nr(VV_KEY, idx); + if (filter_map_one(&tv, expr, filtermap, &newtv, &rem) == FAIL + || did_emsg) + break; + if (newtv.v_type != VAR_NUMBER && newtv.v_type != VAR_BOOL) + { + clear_tv(&newtv); + emsg(_(e_invalid_operation_for_blob)); + break; } - if (argvars[2].v_type == VAR_UNKNOWN) + if (filtermap != FILTERMAP_FILTER) { - // Remove one item, return its value. - p = (char_u *)b->bv_ga.ga_data; - rettv->vval.v_number = (varnumber_T) *(p + idx); - mch_memmove(p + idx, p + idx + 1, (size_t)len - idx - 1); + if (newtv.vval.v_number != val) + blob_set(b_ret, i, newtv.vval.v_number); + } + else if (rem) + { + char_u *p = (char_u *)blob_arg->bv_ga.ga_data; + + mch_memmove(p + i, p + i + 1, + (size_t)b->bv_ga.ga_len - i - 1); --b->bv_ga.ga_len; + --i; } - else + ++idx; + } +} + +/* + * "insert(blob, {item} [, {idx}])" function + */ + void +blob_insert_func(typval_T *argvars, typval_T *rettv) +{ + blob_T *b = argvars[0].vval.v_blob; + long before = 0; + int error = FALSE; + int val, len; + char_u *p; + + if (b == NULL) + { + if (in_vim9script()) + emsg(_(e_cannot_add_to_null_blob)); + return; + } + + if (value_check_lock(b->bv_lock, (char_u *)N_("insert() argument"), TRUE)) + return; + + len = blob_len(b); + if (argvars[2].v_type != VAR_UNKNOWN) + { + before = (long)tv_get_number_chk(&argvars[2], &error); + if (error) + return; // type error; errmsg already given + if (before < 0 || before > len) { - blob_T *blob; - - // Remove range of items, return list with values. - end = (long)tv_get_number_chk(&argvars[2], &error); - if (error) - return; - if (end < 0) - // count from the end - end = len + end; - if (end >= len || idx > end) - { - semsg(_(e_blobidx), end); - return; - } - blob = blob_alloc(); - if (blob == NULL) - return; - blob->bv_ga.ga_len = end - idx + 1; - if (ga_grow(&blob->bv_ga, end - idx + 1) == FAIL) - { - vim_free(blob); - return; - } - p = (char_u *)b->bv_ga.ga_data; - mch_memmove((char_u *)blob->bv_ga.ga_data, p + idx, - (size_t)(end - idx + 1)); - ++blob->bv_refcount; - rettv->v_type = VAR_BLOB; - rettv->vval.v_blob = blob; + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[2])); + return; + } + } + val = tv_get_number_chk(&argvars[1], &error); + if (error) + return; + if (val < 0 || val > 255) + { + semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1])); + return; + } + + if (ga_grow(&b->bv_ga, 1) == FAIL) + return; + p = (char_u *)b->bv_ga.ga_data; + mch_memmove(p + before + 1, p + before, (size_t)len - before); + *(p + before) = val; + ++b->bv_ga.ga_len; + + copy_tv(&argvars[0], rettv); +} - mch_memmove(p + idx, p + end + 1, (size_t)(len - end)); - b->bv_ga.ga_len -= end - idx + 1; +/* + * reduce() Blob argvars[0] using the function 'funcname' with arguments in + * 'funcexe' starting with the initial value argvars[2] and return the result + * in 'rettv'. + */ + void +blob_reduce( + typval_T *argvars, + char_u *func_name, + funcexe_T *funcexe, + typval_T *rettv) +{ + blob_T *b = argvars[0].vval.v_blob; + int called_emsg_start = called_emsg; + int r; + typval_T initial; + typval_T argv[3]; + int i; + + if (argvars[2].v_type == VAR_UNKNOWN) + { + if (b == NULL || b->bv_ga.ga_len == 0) + { + semsg(_(e_reduce_of_an_empty_str_with_no_initial_value), "Blob"); + return; + } + initial.v_type = VAR_NUMBER; + initial.vval.v_number = blob_get(b, 0); + i = 1; + } + else if (argvars[2].v_type != VAR_NUMBER) + { + emsg(_(e_number_expected)); + return; + } + else + { + initial = argvars[2]; + i = 0; + } + + copy_tv(&initial, rettv); + if (b == NULL) + return; + + for ( ; i < b->bv_ga.ga_len; i++) + { + argv[0] = *rettv; + argv[1].v_type = VAR_NUMBER; + argv[1].vval.v_number = blob_get(b, i); + r = call_func(func_name, -1, rettv, 2, argv, funcexe); + clear_tv(&argv[0]); + if (r == FAIL || called_emsg != called_emsg_start) + return; + } +} + +/* + * "reverse({blob})" function + */ + void +blob_reverse(blob_T *b, typval_T *rettv) +{ + int i, len = blob_len(b); + + for (i = 0; i < len / 2; i++) + { + int tmp = blob_get(b, i); + + blob_set(b, i, blob_get(b, len - i - 1)); + blob_set(b, len - i - 1, tmp); + } + rettv_blob_set(rettv, b); +} + +/* + * blob2list() function + */ + void +f_blob2list(typval_T *argvars, typval_T *rettv) +{ + blob_T *blob; + list_T *l; + int i; + + if (rettv_list_alloc(rettv) == FAIL) + return; + + if (check_for_blob_arg(argvars, 0) == FAIL) + return; + + blob = argvars->vval.v_blob; + l = rettv->vval.v_list; + for (i = 0; i < blob_len(blob); i++) + list_append_number(l, blob_get(blob, i)); +} + +/* + * list2blob() function + */ + void +f_list2blob(typval_T *argvars, typval_T *rettv) +{ + list_T *l; + listitem_T *li; + blob_T *blob; + + if (rettv_blob_alloc(rettv) == FAIL) + return; + blob = rettv->vval.v_blob; + + if (check_for_list_arg(argvars, 0) == FAIL) + return; + + l = argvars->vval.v_list; + if (l == NULL) + return; + + CHECK_LIST_MATERIALIZE(l); + FOR_ALL_LIST_ITEMS(l, li) + { + int error; + varnumber_T n; + + error = FALSE; + n = tv_get_number_chk(&li->li_tv, &error); + if (error == TRUE || n < 0 || n > 255) + { + if (!error) + semsg(_(e_invalid_value_for_blob_nr), n); + ga_clear(&blob->bv_ga); + return; } + ga_append(&blob->bv_ga, n); } } -#endif /* defined(FEAT_EVAL) */ +#endif // defined(FEAT_EVAL) diff --git a/src/blowfish.c b/src/blowfish.c index 240106daea29f..61bf12e565442 100644 --- a/src/blowfish.c +++ b/src/blowfish.c @@ -23,8 +23,6 @@ #if defined(FEAT_CRYPT) || defined(PROTO) -#define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0])) - #define BF_BLOCK 8 #define BF_BLOCK_MASK 7 #define BF_MAX_CFB_LEN (8 * BF_BLOCK) @@ -35,28 +33,27 @@ typedef union { } block8; #if defined(MSWIN) - /* MS-Windows is always little endian */ + // MS-Windows is always little endian #else # ifdef HAVE_CONFIG_H - /* in configure.ac AC_C_BIGENDIAN() defines WORDS_BIGENDIAN when needed */ + // in configure.ac AC_C_BIGENDIAN() defines WORDS_BIGENDIAN when needed # else - error! - Please change this code to define WORDS_BIGENDIAN for big-endian machines. +# error Please change this code to define WORDS_BIGENDIAN for big-endian machines. # endif #endif -/* The state of encryption, referenced by cryptstate_T. */ +// The state of encryption, referenced by cryptstate_T. typedef struct { - UINT32_T pax[18]; /* P-array */ - UINT32_T sbx[4][256]; /* S-boxes */ + UINT32_T pax[18]; // P-array + UINT32_T sbx[4][256]; // S-boxes int randbyte_offset; int update_offset; - char_u cfb_buffer[BF_MAX_CFB_LEN]; /* up to 64 bytes used */ - int cfb_len; /* size of cfb_buffer actually used */ + char_u cfb_buffer[BF_MAX_CFB_LEN]; // up to 64 bytes used + int cfb_len; // size of cfb_buffer actually used } bf_state_T; -/* Blowfish code */ +// Blowfish code static __thread UINT32_T pax_init[18] = { 0x243f6a88u, 0x85a308d3u, 0x13198a2eu, 0x03707344u, 0xa4093822u, 0x299f31d0u, @@ -409,17 +406,17 @@ bf_key_init( char_u *key; int keylen; - /* Process the key 1001 times. - * See http://en.wikipedia.org/wiki/Key_strengthening. */ + // Process the key 1001 times. + // See http://en.wikipedia.org/wiki/Key_strengthening. key = sha256_key(password, salt, salt_len); for (i = 0; i < 1000; i++) key = sha256_key(key, salt, salt_len); - /* Convert the key from 64 hex chars to 32 binary chars. */ + // Convert the key from 64 hex chars to 32 binary chars. keylen = (int)STRLEN(key) / 2; if (keylen == 0) { - iemsg(_("E831: bf_key_init() called with empty password")); + iemsg(_(e_bf_key_init_called_with_empty_password)); return; } for (i = 0; i < keylen; i++) @@ -428,8 +425,8 @@ bf_key_init( key[i] = u; } - /* Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of - * Blowfish. */ + // Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of + // Blowfish. mch_memmove(bfs->sbx, sbx_init, 4 * 4 * 256); for (i = 0; i < 18; ++i) @@ -484,7 +481,7 @@ typedef struct { char_u salt[9]; char_u plaintxt[9]; char_u cryptxt[9]; - char_u badcryptxt[9]; /* cryptxt when big/little endian is wrong */ + char_u badcryptxt[9]; // cryptxt when big/little endian is wrong UINT32_T keysum; } struct_bf_test_data; @@ -497,9 +494,9 @@ static __thread struct_bf_test_data bf_test_data[] = { "password", "salt", "plaintxt", - "\xad\x3d\xfa\x7f\xe8\xea\x40\xf6", /* cryptxt */ - "\x72\x50\x3b\x38\x10\x60\x22\xa7", /* badcryptxt */ - 0x56701b5du /* keysum */ + "\xad\x3d\xfa\x7f\xe8\xea\x40\xf6", // cryptxt + "\x72\x50\x3b\x38\x10\x60\x22\xa7", // badcryptxt + 0x56701b5du // keysum }, }; @@ -515,14 +512,14 @@ bf_self_test(void) UINT32_T ui = 0xffffffffUL; bf_state_T state; - vim_memset(&state, 0, sizeof(bf_state_T)); + CLEAR_FIELD(state); state.cfb_len = BF_MAX_CFB_LEN; - /* We can't simply use sizeof(UINT32_T), it would generate a compiler - * warning. */ + // We can't simply use sizeof(UINT32_T), it would generate a compiler + // warning. if (ui != 0xffffffffUL || ui + 1 != 0) { err++; - emsg(_("E820: sizeof(uint32_t) != 4")); + emsg(_(e_sizeof_uint32_isnot_four)); } if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a)) @@ -537,13 +534,13 @@ bf_self_test(void) if (!bf_check_tables(state.pax, state.sbx, bf_test_data[i].keysum)) err++; - /* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */ + // Don't modify bf_test_data[i].plaintxt, self test is idempotent. memcpy(bk.uc, bf_test_data[i].plaintxt, 8); bf_e_cblock(&state, bk.uc); if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0) { if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0) - emsg(_("E817: Blowfish big/little endian use wrong")); + emsg(_(e_blowfish_big_little_endian_use_wrong)); err++; } } @@ -599,7 +596,8 @@ crypt_blowfish_encode( cryptstate_T *state, char_u *from, size_t len, - char_u *to) + char_u *to, + int last UNUSED) { bf_state_T *bfs = state->method_state; size_t i; @@ -622,7 +620,8 @@ crypt_blowfish_decode( cryptstate_T *state, char_u *from, size_t len, - char_u *to) + char_u *to, + int last UNUSED) { bf_state_T *bfs = state->method_state; size_t i; @@ -651,8 +650,8 @@ crypt_blowfish_init( return FAIL; state->method_state = bfs; - /* "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8 - * times. "blowfish2" uses a 8 byte buffer to avoid repeating. */ + // "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8 + // times. "blowfish2" uses an 8 byte buffer to avoid repeating. bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK; if (blowfish_self_test() == FAIL) @@ -673,15 +672,14 @@ blowfish_self_test(void) { if (sha256_self_test() == FAIL) { - emsg(_("E818: sha256 test failed")); + emsg(_(e_sha256_test_failed)); return FAIL; } if (bf_self_test() == FAIL) { - emsg(_("E819: Blowfish test failed")); + emsg(_(e_blowfish_test_failed)); return FAIL; } return OK; } - -#endif /* FEAT_CRYPT */ +#endif // FEAT_CRYPT diff --git a/src/buffer.c b/src/buffer.c index f7171d5edf28b..e87cf75fd4341 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -27,6 +27,12 @@ #include "vim.h" + +#ifdef FEAT_EVAL +// Determines how deeply nested %{} blocks will be evaluated in statusline. +# define MAX_STL_EVAL_DEPTH 100 +#endif + static void enter_buffer(buf_T *buf); static void buflist_getfpos(void); static char_u *buflist_match(regmatch_T *rmp, buf_T *buf, int ignore_case); @@ -38,9 +44,7 @@ static int buf_same_ino(buf_T *buf, stat_T *stp); #else static int otherfile_buf(buf_T *buf, char_u *ffname); #endif -#ifdef FEAT_TITLE static int value_changed(char_u *str, char_u **last); -#endif static int append_arg_number(win_T *wp, char_u *buf, int buflen, int add_file); static void free_buffer(buf_T *); static void free_buffer_stuff(buf_T *buf, int free_options); @@ -52,11 +56,13 @@ static void clear_wininfo(buf_T *buf); # define dev_T unsigned #endif +#define FOR_ALL_BUFS_FROM_LAST(buf) \ + for ((buf) = lastbuf; (buf) != NULL; (buf) = (buf)->b_prev) + #if defined(FEAT_QUICKFIX) static __thread char *msg_loclist = N_("[Location List]"); static __thread char *msg_qflist = N_("[Quickfix List]"); #endif -static __thread char *e_auabort = N_("E855: Autocommands caused command to abort"); // Number of times free_buffer() was called. static __thread int buf_free_count = 0; @@ -78,44 +84,42 @@ get_highest_fnum(void) */ static int read_buffer( - int read_stdin, /* read file from stdin, otherwise fifo */ - exarg_T *eap, /* for forced 'ff' and 'fenc' or NULL */ - int flags) /* extra flags for readfile() */ + int read_stdin, // read file from stdin, otherwise fifo + exarg_T *eap, // for forced 'ff' and 'fenc' or NULL + int flags) // extra flags for readfile() { int retval = OK; linenr_T line_count; - /* - * Read from the buffer which the text is already filled in and append at - * the end. This makes it possible to retry when 'fileformat' or - * 'fileencoding' was guessed wrong. - */ + // Read from the buffer which the text is already filled in and append at + // the end. This makes it possible to retry when 'fileformat' or + // 'fileencoding' was guessed wrong. line_count = curbuf->b_ml.ml_line_count; retval = readfile( read_stdin ? NULL : curbuf->b_ffname, read_stdin ? NULL : curbuf->b_fname, - (linenr_T)line_count, (linenr_T)0, (linenr_T)MAXLNUM, eap, + line_count, (linenr_T)0, (linenr_T)MAXLNUM, eap, flags | READ_BUFFER); if (retval == OK) { - /* Delete the binary lines. */ + // Delete the binary lines. while (--line_count >= 0) - ml_delete((linenr_T)1, FALSE); + ml_delete((linenr_T)1); } else { - /* Delete the converted lines. */ + // Delete the converted lines. while (curbuf->b_ml.ml_line_count > line_count) - ml_delete(line_count, FALSE); + ml_delete(line_count); } - /* Put the cursor on the first line. */ + // Put the cursor on the first line. curwin->w_cursor.lnum = 1; curwin->w_cursor.col = 0; if (read_stdin) { - /* Set or reset 'modified' before executing autocommands, so that - * it can be changed there. */ + // Set or reset 'modified' before executing autocommands, so that + // it can be changed there. if (!readonlymode && !BUFEMPTY()) changed(); else if (retval == OK) @@ -134,6 +138,7 @@ read_buffer( return retval; } +#if defined(FEAT_EVAL) || defined(PROTO) /* * Ensure buffer "buf" is loaded. Does not trigger the swap-exists action. */ @@ -145,11 +150,13 @@ buffer_ensure_loaded(buf_T *buf) aco_save_T aco; aucmd_prepbuf(&aco, buf); - swap_exists_action = SEA_NONE; + if (swap_exists_action != SEA_READONLY) + swap_exists_action = SEA_NONE; open_buffer(FALSE, NULL, 0); aucmd_restbuf(&aco); } } +#endif /* * Open current buffer, that is: open the memfile and read the file into @@ -158,9 +165,9 @@ buffer_ensure_loaded(buf_T *buf) */ int open_buffer( - int read_stdin, /* read file from stdin */ - exarg_T *eap, /* for forced 'ff' and 'fenc' or NULL */ - int flags) /* extra flags for readfile() */ + int read_stdin, // read file from stdin + exarg_T *eap, // for forced 'ff' and 'fenc' or NULL + int flags) // extra flags for readfile() { int retval = OK; bufref_T old_curbuf; @@ -169,32 +176,26 @@ open_buffer( #endif int read_fifo = FALSE; - /* - * The 'readonly' flag is only set when BF_NEVERLOADED is being reset. - * When re-entering the same buffer, it should not change, because the - * user may have reset the flag by hand. - */ + // The 'readonly' flag is only set when BF_NEVERLOADED is being reset. + // When re-entering the same buffer, it should not change, because the + // user may have reset the flag by hand. if (readonlymode && curbuf->b_ffname != NULL && (curbuf->b_flags & BF_NEVERLOADED)) curbuf->b_p_ro = TRUE; if (ml_open(curbuf) == FAIL) { - /* - * There MUST be a memfile, otherwise we can't do anything - * If we can't create one for the current buffer, take another buffer - */ - close_buffer(NULL, curbuf, 0, FALSE); + // There MUST be a memfile, otherwise we can't do anything + // If we can't create one for the current buffer, take another buffer + close_buffer(NULL, curbuf, 0, FALSE, FALSE); FOR_ALL_BUFFERS(curbuf) if (curbuf->b_ml.ml_mfp != NULL) break; - /* - * If there is no memfile at all, exit. - * This is OK, since there are no changes to lose. - */ + // If there is no memfile at all, exit. + // This is OK, since there are no changes to lose. if (curbuf == NULL) { - emsg(_("E82: Cannot allocate any buffer, exiting...")); + emsg(_(e_cannot_allocate_any_buffer_exiting)); // Don't try to do any saving, with "curbuf" NULL almost nothing // will work. @@ -202,7 +203,7 @@ open_buffer( getout(2); } - emsg(_("E83: Cannot allocate buffer, using other one...")); + emsg(_(e_cannot_allocate_buffer_using_other_one)); enter_buffer(curbuf); #ifdef FEAT_SYN_HL if (old_tw != curbuf->b_p_tw) @@ -211,12 +212,12 @@ open_buffer( return FAIL; } - /* The autocommands in readfile() may change the buffer, but only AFTER - * reading the file. */ + // The autocommands in readfile() may change the buffer, but only AFTER + // reading the file. set_bufref(&old_curbuf, curbuf); modified_was_set = FALSE; - /* mark cursor position as being invalid */ + // mark cursor position as being invalid curwin->w_valid = 0; if (curbuf->b_ffname != NULL @@ -264,7 +265,7 @@ open_buffer( #ifdef FEAT_NETBEANS_INTG netbeansFireChanges = oldFire; #endif - /* Help buffer is filtered. */ + // Help buffer is filtered. if (bt_help(curbuf)) fix_help_buffer(); } @@ -272,12 +273,10 @@ open_buffer( { int save_bin = curbuf->b_p_bin; - /* - * First read the text in binary mode into the buffer. - * Then read from that same buffer and append at the end. This makes - * it possible to retry when 'fileformat' or 'fileencoding' was - * guessed wrong. - */ + // First read the text in binary mode into the buffer. + // Then read from that same buffer and append at the end. This makes + // it possible to retry when 'fileformat' or 'fileencoding' was + // guessed wrong. curbuf->b_p_bin = TRUE; retval = readfile(NULL, NULL, (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, NULL, @@ -287,25 +286,22 @@ open_buffer( retval = read_buffer(TRUE, eap, flags); } - /* if first time loading this buffer, init b_chartab[] */ + // if first time loading this buffer, init b_chartab[] if (curbuf->b_flags & BF_NEVERLOADED) { (void)buf_init_chartab(curbuf, FALSE); -#ifdef FEAT_CINDENT parse_cino(curbuf); -#endif } - /* - * Set/reset the Changed flag first, autocmds may change the buffer. - * Apply the automatic commands, before processing the modelines. - * So the modelines have priority over autocommands. - */ - /* When reading stdin, the buffer contents always needs writing, so set - * the changed flag. Unless in readonly mode: "ls | gview -". - * When interrupted and 'cpoptions' contains 'i' set changed flag. */ + // Set/reset the Changed flag first, autocmds may change the buffer. + // Apply the automatic commands, before processing the modelines. + // So the modelines have priority over autocommands. + // + // When reading stdin, the buffer contents always needs writing, so set + // 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 */ + || modified_was_set // ":set modified" used in autocmd #ifdef FEAT_EVAL || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL) #endif @@ -313,14 +309,15 @@ open_buffer( changed(); else if (retval == OK && !read_stdin && !read_fifo) unchanged(curbuf, FALSE, TRUE); - save_file_ff(curbuf); /* keep this fileformat */ + save_file_ff(curbuf); // keep this fileformat - /* Set last_changedtick to avoid triggering a TextChanged autocommand right - * after it was added. */ + // Set last_changedtick to avoid triggering a TextChanged autocommand right + // after it was added. curbuf->b_last_changedtick = CHANGEDTICK(curbuf); + curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf); curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf); - /* require "!" to overwrite the file, because it wasn't read completely */ + // require "!" to overwrite the file, because it wasn't read completely #ifdef FEAT_EVAL if (aborting()) #else @@ -329,12 +326,12 @@ open_buffer( curbuf->b_flags |= BF_READERR; #ifdef FEAT_FOLDING - /* Need to update automatic folding. Do this before the autocommands, - * they may use the fold info. */ + // Need to update automatic folding. Do this before the autocommands, + // they may use the fold info. foldUpdateAll(curwin); #endif - /* need to set w_topline, unless some autocommand already did that. */ + // need to set w_topline, unless some autocommand already did that. if (!(curwin->w_valid & VALID_TOPLINE)) { curwin->w_topline = 1; @@ -350,27 +347,26 @@ open_buffer( if (retval == OK) { - /* - * The autocommands may have changed the current buffer. Apply the - * modelines to the correct buffer, if it still exists and is loaded. - */ + // The autocommands may have changed the current buffer. Apply the + // modelines to the correct buffer, if it still exists and is loaded. if (bufref_valid(&old_curbuf) && old_curbuf.br_buf->b_ml.ml_mfp != NULL) { aco_save_T aco; - /* Go to the buffer that was opened. */ + // Go to the buffer that was opened. aucmd_prepbuf(&aco, old_curbuf.br_buf); do_modelines(0); curbuf->b_flags &= ~(BF_CHECK_RO | BF_NEVERLOADED); + if ((flags & READ_NOWINENTER) == 0) #ifdef FEAT_EVAL - apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf, - &retval); + apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, + curbuf, &retval); #else - apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf); + apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf); #endif - /* restore curwin/curbuf and a few other things */ + // restore curwin/curbuf and a few other things aucmd_restbuf(&aco); } } @@ -413,9 +409,9 @@ buf_valid(buf_T *buf) { buf_T *bp; - /* Assume that we more often have a recent buffer, start with the last - * one. */ - for (bp = lastbuf; bp != NULL; bp = bp->b_prev) + // Assume that we more often have a recent buffer, start with the last + // one. + FOR_ALL_BUFS_FROM_LAST(bp) if (bp == buf) return TRUE; return FALSE; @@ -431,7 +427,7 @@ buf_hashtab_add(buf_T *buf) { sprintf((char *)buf->b_key, "%x", buf->b_fnum); if (hash_add(&buf_hashtab, buf->b_key) == FAIL) - emsg(_("E931: Buffer cannot be registered")); + emsg(_(e_buffer_cannot_be_registered)); } static void @@ -465,8 +461,7 @@ can_unload_buffer(buf_T *buf) } } if (!can_unload) - semsg(_("E937: Attempt to delete a buffer that is in use: %s"), - buf->b_fname); + semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str), buf->b_fname); return can_unload; } @@ -487,13 +482,18 @@ can_unload_buffer(buf_T *buf) * When "abort_if_last" is TRUE then do not close the buffer if autocommands * cause there to be only one window with this buffer. e.g. when ":quit" is * supposed to close the window but autocommands close all other windows. + * + * When "ignore_abort" is TRUE don't abort even when aborting() returns TRUE. + * + * Return TRUE when we got to the end and b_nwindows was decremented. */ - void + int close_buffer( - win_T *win, /* if not NULL, set b_last_cursor */ + win_T *win, // if not NULL, set b_last_cursor buf_T *buf, int action, - int abort_if_last) + int abort_if_last, + int ignore_abort) { int is_curbuf; int nwindows; @@ -505,67 +505,74 @@ close_buffer( int wipe_buf = (action == DOBUF_WIPE || action == DOBUF_WIPE_REUSE); int del_buf = (action == DOBUF_DEL || wipe_buf); - /* - * Force unloading or deleting when 'bufhidden' says so. - * The caller must take care of NOT deleting/freeing when 'bufhidden' is - * "hide" (otherwise we could never free or delete a buffer). - */ - if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */ + CHECK_CURBUF; + + // Force unloading or deleting when 'bufhidden' says so. + // The caller must take care of NOT deleting/freeing when 'bufhidden' is + // "hide" (otherwise we could never free or delete a buffer). + if (buf->b_p_bh[0] == 'd') // 'bufhidden' == "delete" { del_buf = TRUE; unload_buf = TRUE; } - else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */ + else if (buf->b_p_bh[0] == 'w') // 'bufhidden' == "wipe" { del_buf = TRUE; unload_buf = TRUE; wipe_buf = TRUE; } - else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */ + else if (buf->b_p_bh[0] == 'u') // 'bufhidden' == "unload" unload_buf = TRUE; #ifdef FEAT_TERMINAL if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf)) { + CHECK_CURBUF; if (term_job_running(buf->b_term)) { if (wipe_buf || unload_buf) { if (!can_unload_buffer(buf)) - return; + return FALSE; - /* Wiping out or unloading a terminal buffer kills the job. */ + // Wiping out or unloading a terminal buffer kills the job. free_terminal(buf); } else { - /* The job keeps running, hide the buffer. */ + // The job keeps running, hide the buffer. del_buf = FALSE; unload_buf = FALSE; } } + else if (buf->b_p_bh[0] == 'h' && !del_buf) + { + // Hide a terminal buffer. + unload_buf = FALSE; + } else { - /* A terminal buffer is wiped out if the job has finished. */ + // A terminal buffer is wiped out if the job has finished. del_buf = TRUE; unload_buf = TRUE; wipe_buf = TRUE; } + CHECK_CURBUF; } #endif - /* Disallow deleting the buffer when it is locked (already being closed or - * halfway a command that relies on it). Unloading is allowed. */ + // Disallow deleting the buffer when it is locked (already being closed or + // halfway a command that relies on it). Unloading is allowed. if ((del_buf || wipe_buf) && !can_unload_buffer(buf)) - return; + return FALSE; - /* check no autocommands closed the window */ + // check no autocommands closed the window if (win != NULL && win_valid_any_tab(win)) { - /* Set b_last_cursor when closing the last window for the buffer. - * Remember the last cursor position and window options of the buffer. - * This used to be only for the current window, but then options like - * 'foldmethod' may be lost with a ":only" command. */ + // Set b_last_cursor when closing the last window for the buffer. + // Remember the last cursor position and window options of the buffer. + // This used to be only for the current window, but then options like + // 'foldmethod' may be lost with a ":only" command. if (buf->b_nwindows == 1) set_last_cursor(win); buflist_setfpos(buf, win, @@ -575,48 +582,53 @@ close_buffer( set_bufref(&bufref, buf); - /* When the buffer is no longer in a window, trigger BufWinLeave */ + // When the buffer is no longer in a window, trigger BufWinLeave if (buf->b_nwindows == 1) { ++buf->b_locked; + ++buf->b_locked_split; if (apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, FALSE, buf) && !bufref_valid(&bufref)) { - /* Autocommands deleted the buffer. */ + // Autocommands deleted the buffer. aucmd_abort: - emsg(_(e_auabort)); - return; + emsg(_(e_autocommands_caused_command_to_abort)); + return FALSE; } --buf->b_locked; + --buf->b_locked_split; if (abort_if_last && one_window()) - /* Autocommands made this the only window. */ + // Autocommands made this the only window. goto aucmd_abort; - /* When the buffer becomes hidden, but is not unloaded, trigger - * BufHidden */ + // When the buffer becomes hidden, but is not unloaded, trigger + // BufHidden if (!unload_buf) { ++buf->b_locked; + ++buf->b_locked_split; if (apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname, FALSE, buf) && !bufref_valid(&bufref)) - /* Autocommands deleted the buffer. */ + // Autocommands deleted the buffer. goto aucmd_abort; --buf->b_locked; + --buf->b_locked_split; if (abort_if_last && one_window()) - /* Autocommands made this the only window. */ + // Autocommands made this the only window. goto aucmd_abort; } #ifdef FEAT_EVAL - if (aborting()) /* autocmds may abort script processing */ - return; + // autocmds may abort script processing + if (!ignore_abort && aborting()) + return FALSE; #endif } - /* If the buffer was in curwin and the window has changed, go back to that - * window, if it still exists. This avoids that ":edit x" triggering a - * "tabnext" BufUnload autocmd leaves a window behind without a buffer. */ + // If the buffer was in curwin and the window has changed, go back to that + // window, if it still exists. This avoids that ":edit x" triggering a + // "tabnext" BufUnload autocmd leaves a window behind without a buffer. if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { block_autocmds(); @@ -626,26 +638,26 @@ close_buffer( nwindows = buf->b_nwindows; - /* decrease the link count from windows (unless not in any window) */ + // decrease the link count from windows (unless not in any window) if (buf->b_nwindows > 0) --buf->b_nwindows; #ifdef FEAT_DIFF if (diffopt_hiddenoff() && !unload_buf && buf->b_nwindows == 0) - diff_buf_delete(buf); /* Clear 'diff' for hidden buffer. */ + diff_buf_delete(buf); // Clear 'diff' for hidden buffer. #endif - /* Return when a window is displaying the buffer or when it's not - * unloaded. */ + // Return when a window is displaying the buffer or when it's not + // unloaded. if (buf->b_nwindows > 0 || !unload_buf) - return; + return FALSE; - /* Always remove the buffer when there is no file name. */ + // Always remove the buffer when there is no file name. if (buf->b_ffname == NULL) del_buf = TRUE; - /* When closing the current buffer stop Visual mode before freeing - * anything. */ + // When closing the current buffer stop Visual mode before freeing + // anything. if (buf == curbuf && VIsual_active #if defined(EXITFREE) && !entered_free_all_mem @@ -653,40 +665,40 @@ close_buffer( ) end_visual_mode(); - /* - * Free all things allocated for this buffer. - * Also calls the "BufDelete" autocommands when del_buf is TRUE. - */ - /* Remember if we are closing the current buffer. Restore the number of - * windows, so that autocommands in buf_freeall() don't get confused. */ + // Free all things allocated for this buffer. + // Also calls the "BufDelete" autocommands when del_buf is TRUE. + // + // Remember if we are closing the current buffer. Restore the number of + // windows, so that autocommands in buf_freeall() don't get confused. is_curbuf = (buf == curbuf); buf->b_nwindows = nwindows; - buf_freeall(buf, (del_buf ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0)); + buf_freeall(buf, (del_buf ? BFA_DEL : 0) + + (wipe_buf ? BFA_WIPE : 0) + + (ignore_abort ? BFA_IGNORE_ABORT : 0)); - /* Autocommands may have deleted the buffer. */ + // Autocommands may have deleted the buffer. if (!bufref_valid(&bufref)) - return; + return FALSE; #ifdef FEAT_EVAL - if (aborting()) /* autocmds may abort script processing */ - return; + // autocmds may abort script processing + if (!ignore_abort && aborting()) + return FALSE; #endif - /* - * It's possible that autocommands change curbuf to the one being deleted. - * This might cause the previous curbuf to be deleted unexpectedly. But - * in some cases it's OK to delete the curbuf, because a new one is - * obtained anyway. Therefore only return if curbuf changed to the - * deleted buffer. - */ + // It's possible that autocommands change curbuf to the one being deleted. + // This might cause the previous curbuf to be deleted unexpectedly. But + // in some cases it's OK to delete the curbuf, because a new one is + // obtained anyway. Therefore only return if curbuf changed to the + // deleted buffer. if (buf == curbuf && !is_curbuf) - return; + return FALSE; if (win_valid_any_tab(win) && win->w_buffer == buf) - win->w_buffer = NULL; /* make sure we don't use the buffer now */ + win->w_buffer = NULL; // make sure we don't use the buffer now - /* Autocommands may have opened or closed windows for this buffer. - * Decrement the count for the close we do here. */ + // Autocommands may have opened or closed windows for this buffer. + // Decrement the count for the close we do here. if (buf->b_nwindows > 0) --buf->b_nwindows; @@ -695,6 +707,10 @@ close_buffer( */ if (wipe_buf) { + // Do not wipe out the buffer if it is used in a window. + if (buf->b_nwindows > 0) + return FALSE; + if (action == DOBUF_WIPE_REUSE) { // we can re-use this buffer number, store it @@ -722,20 +738,22 @@ close_buffer( { if (del_buf) { - /* Free all internal variables and reset option values, to make - * ":bdel" compatible with Vim 5.7. */ + // Free all internal variables and reset option values, to make + // ":bdel" compatible with Vim 5.7. free_buffer_stuff(buf, TRUE); - /* Make it look like a new buffer. */ + // Make it look like a new buffer. buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED; - /* Init the options when loaded again. */ + // Init the options when loaded again. buf->b_p_initialized = FALSE; } buf_clear_file(buf); if (del_buf) buf->b_p_bl = FALSE; } + // NOTE: at this point "curbuf" may be invalid! + return TRUE; } /* @@ -752,7 +770,7 @@ buf_clear_file(buf_T *buf) buf->b_p_bomb = FALSE; buf->b_start_bomb = FALSE; buf->b_ml.ml_mfp = NULL; - buf->b_ml.ml_flags = ML_EMPTY; /* empty buffer */ + buf->b_ml.ml_flags = ML_EMPTY; // empty buffer #ifdef FEAT_NETBEANS_INTG netbeans_deleted_all_lines(buf); #endif @@ -762,9 +780,10 @@ buf_clear_file(buf_T *buf) * buf_freeall() - free all things allocated for a buffer that are related to * the file. Careful: get here with "curwin" NULL when exiting. * flags: - * BFA_DEL buffer is going to be deleted - * BFA_WIPE buffer is going to be wiped out - * BFA_KEEP_UNDO do not free undo information + * BFA_DEL buffer is going to be deleted + * BFA_WIPE buffer is going to be wiped out + * BFA_KEEP_UNDO do not free undo information + * BFA_IGNORE_ABORT don't abort even when aborting() returns TRUE */ void buf_freeall(buf_T *buf, int flags) @@ -775,15 +794,16 @@ buf_freeall(buf_T *buf, int flags) win_T *the_curwin = curwin; tabpage_T *the_curtab = curtab; - /* Make sure the buffer isn't closed by autocommands. */ + // Make sure the buffer isn't closed by autocommands. ++buf->b_locked; + ++buf->b_locked_split; set_bufref(&bufref, buf); if (buf->b_ml.ml_mfp != NULL) { if (apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf) && !bufref_valid(&bufref)) - /* autocommands deleted the buffer */ + // autocommands deleted the buffer return; } if ((flags & BFA_DEL) && buf->b_p_bl) @@ -791,7 +811,7 @@ buf_freeall(buf_T *buf, int flags) if (apply_autocmds(EVENT_BUFDELETE, buf->b_fname, buf->b_fname, FALSE, buf) && !bufref_valid(&bufref)) - /* autocommands deleted the buffer */ + // autocommands deleted the buffer return; } if (flags & BFA_WIPE) @@ -799,14 +819,15 @@ buf_freeall(buf_T *buf, int flags) if (apply_autocmds(EVENT_BUFWIPEOUT, buf->b_fname, buf->b_fname, FALSE, buf) && !bufref_valid(&bufref)) - /* autocommands deleted the buffer */ + // autocommands deleted the buffer return; } --buf->b_locked; + --buf->b_locked_split; - /* If the buffer was in curwin and the window has changed, go back to that - * window, if it still exists. This avoids that ":edit x" triggering a - * "tabnext" BufUnload autocmd leaves a window behind without a buffer. */ + // If the buffer was in curwin and the window has changed, go back to that + // window, if it still exists. This avoids that ":edit x" triggering a + // "tabnext" BufUnload autocmd leaves a window behind without a buffer. if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { block_autocmds(); @@ -815,29 +836,28 @@ buf_freeall(buf_T *buf, int flags) } #ifdef FEAT_EVAL - if (aborting()) /* autocmds may abort script processing */ + // autocmds may abort script processing + if ((flags & BFA_IGNORE_ABORT) == 0 && aborting()) return; #endif - /* - * It's possible that autocommands change curbuf to the one being deleted. - * This might cause curbuf to be deleted unexpectedly. But in some cases - * it's OK to delete the curbuf, because a new one is obtained anyway. - * Therefore only return if curbuf changed to the deleted buffer. - */ + // It's possible that autocommands change curbuf to the one being deleted. + // This might cause curbuf to be deleted unexpectedly. But in some cases + // it's OK to delete the curbuf, because a new one is obtained anyway. + // Therefore only return if curbuf changed to the deleted buffer. if (buf == curbuf && !is_curbuf) return; #ifdef FEAT_DIFF - diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */ + diff_buf_delete(buf); // Can't use 'diff' for unloaded buffer. #endif #ifdef FEAT_SYN_HL - /* Remove any ownsyntax, unless exiting. */ + // Remove any ownsyntax, unless exiting. if (curwin != NULL && curwin->w_buffer == buf) reset_synblock(curwin); #endif #ifdef FEAT_FOLDING - /* No folds in an empty buffer. */ + // No folds in an empty buffer. { win_T *win; tabpage_T *tp; @@ -851,20 +871,20 @@ buf_freeall(buf_T *buf, int flags) #ifdef FEAT_TCL tcl_buffer_free(buf); #endif - ml_close(buf, TRUE); /* close and delete the memline/memfile */ - buf->b_ml.ml_line_count = 0; /* no lines in buffer */ + ml_close(buf, TRUE); // close and delete the memline/memfile + buf->b_ml.ml_line_count = 0; // no lines in buffer if ((flags & BFA_KEEP_UNDO) == 0) { - u_blockfree(buf); /* free the memory allocated for undo */ - u_clearall(buf); /* reset all undo information */ + u_blockfree(buf); // free the memory allocated for undo + u_clearall(buf); // reset all undo information } #ifdef FEAT_SYN_HL - syntax_clear(&buf->b_s); /* reset syntax info */ + syntax_clear(&buf->b_s); // reset syntax info #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP clear_buf_prop_types(buf); #endif - buf->b_flags &= ~BF_READERR; /* a read error is no longer relevant */ + buf->b_flags &= ~BF_READERR; // a read error is no longer relevant } /* @@ -877,7 +897,7 @@ free_buffer(buf_T *buf) ++buf_free_count; free_buffer_stuff(buf, TRUE); #ifdef FEAT_EVAL - /* b:changedtick uses an item in buf_T, remove it now */ + // b:changedtick uses an item in buf_T, remove it now dictitem_remove(buf->b_vars, (dictitem_T *)&buf->b_ct_di); unref_var_dict(buf->b_vars); remove_listeners(buf); @@ -918,13 +938,17 @@ free_buffer(buf_T *buf) if (autocmd_busy) { - /* Do not free the buffer structure while autocommands are executing, - * it's still needed. Free it when autocmd_busy is reset. */ + // Do not free the buffer structure while autocommands are executing, + // it's still needed. Free it when autocmd_busy is reset. buf->b_next = au_pending_free_buf; au_pending_free_buf = buf; } else + { vim_free(buf); + if (curbuf == buf) + curbuf = NULL; // make clear it's not to be used + } } /* @@ -952,11 +976,11 @@ init_changedtick(buf_T *buf) static void free_buffer_stuff( buf_T *buf, - int free_options) /* free options as well */ + int free_options) // free options as well { if (free_options) { - clear_wininfo(buf); /* including window-local options */ + clear_wininfo(buf); // including window-local options free_buf_options(buf, TRUE); #ifdef FEAT_SPELL ga_clear(&buf->b_s.b_langp); @@ -966,10 +990,11 @@ free_buffer_stuff( { varnumber_T tick = CHANGEDTICK(buf); - vars_clear(&buf->b_vars->dv_hashtab); /* free all buffer variables */ + vars_clear(&buf->b_vars->dv_hashtab); // free all buffer variables hash_init(&buf->b_vars->dv_hashtab); init_changedtick(buf); CHANGEDTICK(buf) = tick; + remove_listeners(buf); } #endif uc_clear(&buf->b_ucmds); // clear local user commands @@ -979,11 +1004,27 @@ free_buffer_stuff( #ifdef FEAT_NETBEANS_INTG netbeans_file_killed(buf); #endif - map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); /* clear local mappings */ - map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); /* clear local abbrevs */ + map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); // clear local mappings + map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); // clear local abbrevs VIM_CLEAR(buf->b_start_fenc); } +/* + * Free one wininfo_T. + */ + void +free_wininfo(wininfo_T *wip) +{ + if (wip->wi_optset) + { + clear_winopt(&wip->wi_opt); +#ifdef FEAT_FOLDING + deleteFoldRecurse(&wip->wi_folds); +#endif + } + vim_free(wip); +} + /* * Free the b_wininfo list for buffer "buf". */ @@ -996,14 +1037,7 @@ clear_wininfo(buf_T *buf) { wip = buf->b_wininfo; buf->b_wininfo = wip->wi_next; - if (wip->wi_optset) - { - clear_winopt(&wip->wi_opt); -#ifdef FEAT_FOLDING - deleteFoldRecurse(&wip->wi_folds); -#endif - } - vim_free(wip); + free_wininfo(wip); } } @@ -1018,10 +1052,12 @@ goto_buffer( int count) { bufref_T old_curbuf; + int save_sea = swap_exists_action; set_bufref(&old_curbuf, curbuf); - swap_exists_action = SEA_DIALOG; + if (swap_exists_action == SEA_NONE) + swap_exists_action = SEA_DIALOG; (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO, start, dir, count, eap->forceit); if (swap_exists_action == SEA_QUIT && *eap->cmd == 's') @@ -1029,19 +1065,19 @@ goto_buffer( #if defined(FEAT_EVAL) cleanup_T cs; - /* Reset the error/interrupt/exception state here so that - * aborting() returns FALSE when closing a window. */ + // Reset the error/interrupt/exception state here so that + // aborting() returns FALSE when closing a window. enter_cleanup(&cs); #endif - /* Quitting means closing the split window, nothing else. */ + // Quitting means closing the split window, nothing else. win_close(curwin, TRUE); - swap_exists_action = SEA_NONE; + swap_exists_action = save_sea; swap_exists_did_quit = TRUE; #if defined(FEAT_EVAL) - /* Restore the error/interrupt/exception state if not discarded by a - * new aborting error, interrupt, or uncaught exception. */ + // Restore the error/interrupt/exception state if not discarded by a + // new aborting error, interrupt, or uncaught exception. leave_cleanup(&cs); #endif } @@ -1067,20 +1103,25 @@ handle_swap_exists(bufref_T *old_curbuf) if (swap_exists_action == SEA_QUIT) { #if defined(FEAT_EVAL) - /* Reset the error/interrupt/exception state here so that - * aborting() returns FALSE when closing a buffer. */ + // Reset the error/interrupt/exception state here so that + // aborting() returns FALSE when closing a buffer. enter_cleanup(&cs); #endif - /* User selected Quit at ATTENTION prompt. Go back to previous - * buffer. If that buffer is gone or the same as the current one, - * open a new, empty buffer. */ - swap_exists_action = SEA_NONE; /* don't want it again */ + // User selected Quit at ATTENTION prompt. Go back to previous + // buffer. If that buffer is gone or the same as the current one, + // open a new, empty buffer. + swap_exists_action = SEA_NONE; // don't want it again swap_exists_did_quit = TRUE; - close_buffer(curwin, curbuf, DOBUF_UNLOAD, FALSE); + close_buffer(curwin, curbuf, DOBUF_UNLOAD, FALSE, FALSE); if (old_curbuf == NULL || !bufref_valid(old_curbuf) || old_curbuf->br_buf == curbuf) + { + // Block autocommands here because curwin->w_buffer is NULL. + block_autocmds(); buf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED); + unblock_autocmds(); + } else buf = old_curbuf->br_buf; if (buf != NULL) @@ -1098,154 +1139,38 @@ handle_swap_exists(bufref_T *old_curbuf) check_colorcolumn(curwin); #endif } - /* If "old_curbuf" is NULL we are in big trouble here... */ + // If "old_curbuf" is NULL we are in big trouble here... #if defined(FEAT_EVAL) - /* Restore the error/interrupt/exception state if not discarded by a - * new aborting error, interrupt, or uncaught exception. */ + // Restore the error/interrupt/exception state if not discarded by a + // new aborting error, interrupt, or uncaught exception. leave_cleanup(&cs); #endif } else if (swap_exists_action == SEA_RECOVER) { #if defined(FEAT_EVAL) - /* Reset the error/interrupt/exception state here so that - * aborting() returns FALSE when closing a buffer. */ + // Reset the error/interrupt/exception state here so that + // aborting() returns FALSE when closing a buffer. enter_cleanup(&cs); #endif - /* User selected Recover at ATTENTION prompt. */ + // User selected Recover at ATTENTION prompt. msg_scroll = TRUE; ml_recover(FALSE); - msg_puts("\n"); /* don't overwrite the last message */ + msg_puts("\n"); // don't overwrite the last message cmdline_row = msg_row; do_modelines(0); #if defined(FEAT_EVAL) - /* Restore the error/interrupt/exception state if not discarded by a - * new aborting error, interrupt, or uncaught exception. */ + // Restore the error/interrupt/exception state if not discarded by a + // new aborting error, interrupt, or uncaught exception. leave_cleanup(&cs); #endif } swap_exists_action = SEA_NONE; } -/* - * do_bufdel() - delete or unload buffer(s) - * - * addr_count == 0: ":bdel" - delete current buffer - * addr_count == 1: ":N bdel" or ":bdel N [N ..]" - first delete - * buffer "end_bnr", then any other arguments. - * addr_count == 2: ":N,N bdel" - delete buffers in range - * - * command can be DOBUF_UNLOAD (":bunload"), DOBUF_WIPE (":bwipeout") or - * DOBUF_DEL (":bdel") - * - * Returns error message or NULL - */ - char * -do_bufdel( - int command, - char_u *arg, /* pointer to extra arguments */ - int addr_count, - int start_bnr, /* first buffer number in a range */ - int end_bnr, /* buffer nr or last buffer nr in a range */ - int forceit) -{ - int do_current = 0; /* delete current buffer? */ - int deleted = 0; /* number of buffers deleted */ - char *errormsg = NULL; /* return value */ - int bnr; /* buffer number */ - char_u *p; - - if (addr_count == 0) - { - (void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit); - } - else - { - if (addr_count == 2) - { - if (*arg) /* both range and argument is not allowed */ - return _(e_trailing); - bnr = start_bnr; - } - else /* addr_count == 1 */ - bnr = end_bnr; - - for ( ;!got_int; ui_breakcheck()) - { - /* - * delete the current buffer last, otherwise when the - * current buffer is deleted, the next buffer becomes - * the current one and will be loaded, which may then - * also be deleted, etc. - */ - if (bnr == curbuf->b_fnum) - do_current = bnr; - else if (do_buffer(command, DOBUF_FIRST, FORWARD, (int)bnr, - forceit) == OK) - ++deleted; - - /* - * find next buffer number to delete/unload - */ - if (addr_count == 2) - { - if (++bnr > end_bnr) - break; - } - else /* addr_count == 1 */ - { - arg = skipwhite(arg); - if (*arg == NUL) - break; - if (!VIM_ISDIGIT(*arg)) - { - p = skiptowhite_esc(arg); - bnr = buflist_findpat(arg, p, - command == DOBUF_WIPE || command == DOBUF_WIPE_REUSE, - FALSE, FALSE); - if (bnr < 0) /* failed */ - break; - arg = p; - } - else - bnr = getdigits(&arg); - } - } - if (!got_int && do_current && do_buffer(command, DOBUF_FIRST, - FORWARD, do_current, forceit) == OK) - ++deleted; - - if (deleted == 0) - { - if (command == DOBUF_UNLOAD) - STRCPY(IObuff, _("E515: No buffers were unloaded")); - else if (command == DOBUF_DEL) - STRCPY(IObuff, _("E516: No buffers were deleted")); - else - STRCPY(IObuff, _("E517: No buffers were wiped out")); - errormsg = (char *)IObuff; - } - else if (deleted >= p_report) - { - if (command == DOBUF_UNLOAD) - smsg(NGETTEXT("%d buffer unloaded", - "%d buffers unloaded", deleted), deleted); - else if (command == DOBUF_DEL) - smsg(NGETTEXT("%d buffer deleted", - "%d buffers deleted", deleted), deleted); - else - smsg(NGETTEXT("%d buffer wiped out", - "%d buffers wiped out", deleted), deleted); - } - } - - - return errormsg; -} - /* * Make the current buffer empty. * Used when it is wiped out and it's the last buffer. @@ -1262,26 +1187,24 @@ empty_curbuf( if (action == DOBUF_UNLOAD) { - emsg(_("E90: Cannot unload last buffer")); + emsg(_(e_cannot_unload_last_buffer)); return FAIL; } set_bufref(&bufref, buf); if (close_others) - /* Close any other windows on this buffer, then make it empty. */ + // Close any other windows on this buffer, then make it empty. close_windows(buf, TRUE); setpcmark(); retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, forceit ? ECMD_FORCEIT : 0, curwin); - /* - * do_ecmd() may create a new buffer, then we have to delete - * the old one. But do_ecmd() may have done that already, check - * if the buffer still exists. - */ + // do_ecmd() may create a new buffer, then we have to delete + // the old one. But do_ecmd() may have done that already, check + // if the buffer still exists. if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows == 0) - close_buffer(NULL, buf, action, FALSE); + close_buffer(NULL, buf, action, FALSE, FALSE); if (!close_others) need_fileinfo = FALSE; return retval; @@ -1304,13 +1227,13 @@ empty_curbuf( * * Return FAIL or OK. */ - int -do_buffer( + static int +do_buffer_ext( int action, int start, - int dir, /* FORWARD or BACKWARD */ - int count, /* buffer number or number of buffers */ - int forceit) /* TRUE for :...! */ + int dir, // FORWARD or BACKWARD + int count, // buffer number or number of buffers + int flags) // DOBUF_FORCEIT etc. { buf_T *buf; buf_T *bp; @@ -1323,7 +1246,7 @@ do_buffer( case DOBUF_LAST: buf = lastbuf; break; default: buf = curbuf; break; } - if (start == DOBUF_MOD) /* find next modified buffer */ + if (start == DOBUF_MOD) // find next modified buffer { while (count-- > 0) { @@ -1337,11 +1260,11 @@ do_buffer( } if (!bufIsChanged(buf)) { - emsg(_("E84: No modified buffer found")); + emsg(_(e_no_modified_buffer_found)); return FAIL; } } - else if (start == DOBUF_FIRST && count) /* find specified buffer number */ + else if (start == DOBUF_FIRST && count) // find specified buffer number { while (buf != NULL && buf->b_fnum != count) buf = buf->b_next; @@ -1351,8 +1274,8 @@ do_buffer( bp = NULL; while (count > 0 || (!unload && !buf->b_p_bl && bp != buf)) { - /* remember the buffer where we start, we come back there when all - * buffers are unlisted. */ + // remember the buffer where we start, we come back there when all + // buffers are unlisted. if (bp == NULL) bp = buf; if (dir == FORWARD) @@ -1367,42 +1290,50 @@ do_buffer( if (buf == NULL) buf = lastbuf; } - /* don't count unlisted buffers */ + // don't count unlisted buffers if (unload || buf->b_p_bl) { --count; - bp = NULL; /* use this buffer as new starting point */ + bp = NULL; // use this buffer as new starting point } if (bp == buf) { - /* back where we started, didn't find anything. */ - emsg(_("E85: There is no listed buffer")); + // back where we started, didn't find anything. + emsg(_(e_there_is_no_listed_buffer)); return FAIL; } } } - if (buf == NULL) /* could not find it */ + if (buf == NULL) // could not find it { if (start == DOBUF_FIRST) { - /* don't warn when deleting */ + // don't warn when deleting if (!unload) - semsg(_(e_nobufnr), count); + semsg(_(e_buffer_nr_does_not_exist), count); } else if (dir == FORWARD) - emsg(_("E87: Cannot go beyond last buffer")); + emsg(_(e_cannot_go_beyond_last_buffer)); else - emsg(_("E88: Cannot go before first buffer")); + emsg(_(e_cannot_go_before_first_buffer)); return FAIL; } +#ifdef FEAT_PROP_POPUP + if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) +# ifdef FEAT_TERMINAL + && !bt_terminal(buf) +#endif + ) + return OK; +#endif #ifdef FEAT_GUI need_mouse_correct = TRUE; #endif /* - * delete buffer buf from memory and/or the list + * delete buffer "buf" from memory and/or the list */ if (unload) { @@ -1414,55 +1345,51 @@ do_buffer( set_bufref(&bufref, buf); - /* When unloading or deleting a buffer that's already unloaded and - * unlisted: fail silently. */ + // When unloading or deleting a buffer that's already unloaded and + // unlisted: fail silently. if (action != DOBUF_WIPE && action != DOBUF_WIPE_REUSE && buf->b_ml.ml_mfp == NULL && !buf->b_p_bl) return FAIL; - if (!forceit && bufIsChanged(buf)) + if ((flags & DOBUF_FORCEIT) == 0 && bufIsChanged(buf)) { #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) - if ((p_confirm || cmdmod.confirm) && p_write) + if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write) { dialog_changed(buf, FALSE); if (!bufref_valid(&bufref)) - /* Autocommand deleted buffer, oops! It's not changed - * now. */ + // Autocommand deleted buffer, oops! It's not changed + // now. return FAIL; - /* If it's still changed fail silently, the dialog already - * mentioned why it fails. */ + // If it's still changed fail silently, the dialog already + // mentioned why it fails. if (bufIsChanged(buf)) return FAIL; } else #endif { - semsg(_("E89: No write since last change for buffer %d (add ! to override)"), + semsg(_(e_no_write_since_last_change_for_buffer_nr_add_bang_to_override), buf->b_fnum); return FAIL; } } - /* When closing the current buffer stop Visual mode. */ + // When closing the current buffer stop Visual mode. if (buf == curbuf && VIsual_active) end_visual_mode(); - /* - * If deleting the last (listed) buffer, make it empty. - * The last (listed) buffer cannot be unloaded. - */ + // If deleting the last (listed) buffer, make it empty. + // The last (listed) buffer cannot be unloaded. FOR_ALL_BUFFERS(bp) if (bp->b_p_bl && bp != buf) break; if (bp == NULL && buf == curbuf) - return empty_curbuf(TRUE, forceit, action); + return empty_curbuf(TRUE, (flags & DOBUF_FORCEIT), action); - /* - * If the deleted buffer is the current one, close the current window - * (unless it's the only window). Repeat this so long as we end up in - * a window with this buffer. - */ + // If the deleted buffer is the current one, close the current window + // (unless it's the only window). Repeat this so long as we end up in + // a window with this buffer. while (buf == curbuf && !(curwin->w_closing || curwin->w_buffer->b_locked > 0) && (!ONE_WINDOW || first_tabpage->tp_next != NULL)) @@ -1471,14 +1398,12 @@ do_buffer( break; } - /* - * If the buffer to be deleted is not the current one, delete it here. - */ + // If the buffer to be deleted is not the current one, delete it here. if (buf != curbuf) { close_windows(buf, FALSE); if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows <= 0) - close_buffer(NULL, buf, action, FALSE); + close_buffer(NULL, buf, action, FALSE, FALSE); return OK; } @@ -1492,11 +1417,10 @@ do_buffer( * then before the current buffer. * Finally use any buffer. */ - buf = NULL; /* selected buffer */ - bp = NULL; /* used when no loaded buffer found */ + buf = NULL; // selected buffer + bp = NULL; // used when no loaded buffer found if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf)) buf = au_new_curbuf.br_buf; -#ifdef FEAT_JUMPLIST else if (curwin->w_jumplistlen > 0) { int jumpidx; @@ -1511,30 +1435,35 @@ do_buffer( buf = buflist_findnr(curwin->w_jumplist[jumpidx].fmark.fnum); if (buf != NULL) { - if (buf == curbuf || !buf->b_p_bl) - buf = NULL; /* skip current and unlisted bufs */ + // Skip current and unlisted bufs. Also skip a quickfix + // buffer, it might be deleted soon. + if (buf == curbuf || !buf->b_p_bl +#if defined(FEAT_QUICKFIX) + || bt_quickfix(buf) +#endif + ) + buf = NULL; else if (buf->b_ml.ml_mfp == NULL) { - /* skip unloaded buf, but may keep it for later */ + // skip unloaded buf, but may keep it for later if (bp == NULL) bp = buf; buf = NULL; } } - if (buf != NULL) /* found a valid buffer: stop searching */ + if (buf != NULL) // found a valid buffer: stop searching break; - /* advance to older entry in jump list */ + // advance to older entry in jump list if (!jumpidx && curwin->w_jumplistidx == curwin->w_jumplistlen) break; if (--jumpidx < 0) jumpidx = curwin->w_jumplistlen - 1; - if (jumpidx == forward) /* List exhausted for sure */ + if (jumpidx == forward) // List exhausted for sure break; } } -#endif - if (buf == NULL) /* No previous buffer, Try 2'nd approach */ + if (buf == NULL) // No previous buffer, Try 2'nd approach { forward = TRUE; buf = curbuf->b_next; @@ -1542,18 +1471,22 @@ do_buffer( { if (buf == NULL) { - if (!forward) /* tried both directions */ + if (!forward) // tried both directions break; buf = curbuf->b_prev; forward = FALSE; continue; } - /* in non-help buffer, try to skip help buffers, and vv */ - if (buf->b_help == curbuf->b_help && buf->b_p_bl) + // in non-help buffer, try to skip help buffers, and vv + if (buf->b_help == curbuf->b_help && buf->b_p_bl +#if defined(FEAT_QUICKFIX) + && !bt_quickfix(buf) +#endif + ) { - if (buf->b_ml.ml_mfp != NULL) /* found loaded buffer */ + if (buf->b_ml.ml_mfp != NULL) // found loaded buffer break; - if (bp == NULL) /* remember unloaded buf for later */ + if (bp == NULL) // remember unloaded buf for later bp = buf; } if (forward) @@ -1562,65 +1495,71 @@ do_buffer( buf = buf->b_prev; } } - if (buf == NULL) /* No loaded buffer, use unloaded one */ + if (buf == NULL) // No loaded buffer, use unloaded one buf = bp; - if (buf == NULL) /* No loaded buffer, find listed one */ + if (buf == NULL) // No loaded buffer, find listed one { FOR_ALL_BUFFERS(buf) - if (buf->b_p_bl && buf != curbuf) + if (buf->b_p_bl && buf != curbuf +#if defined(FEAT_QUICKFIX) + && !bt_quickfix(buf) +#endif + ) break; } - if (buf == NULL) /* Still no buffer, just take one */ + if (buf == NULL) // Still no buffer, just take one { if (curbuf->b_next != NULL) buf = curbuf->b_next; else buf = curbuf->b_prev; +#if defined(FEAT_QUICKFIX) + if (bt_quickfix(buf)) + buf = NULL; +#endif } } if (buf == NULL) { - /* Autocommands must have wiped out all other buffers. Only option - * now is to make the current buffer empty. */ - return empty_curbuf(FALSE, forceit, action); + // Autocommands must have wiped out all other buffers. Only option + // now is to make the current buffer empty. + return empty_curbuf(FALSE, (flags & DOBUF_FORCEIT), action); } /* - * make buf current buffer + * make "buf" the current buffer */ - if (action == DOBUF_SPLIT) /* split window first */ + if (action == DOBUF_SPLIT) // split window first { - /* If 'switchbuf' contains "useopen": jump to first window containing - * "buf" if one exists */ + // If 'switchbuf' contains "useopen": jump to first window containing + // "buf" if one exists if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf)) return OK; - /* If 'switchbuf' contains "usetab": jump to first window in any tab - * page containing "buf" if one exists */ + // If 'switchbuf' contains "usetab": jump to first window in any tab + // page containing "buf" if one exists if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf)) return OK; if (win_split(0, 0) == FAIL) return FAIL; } - /* go to current buffer - nothing to do */ + // go to current buffer - nothing to do if (buf == curbuf) return OK; - /* - * Check if the current buffer may be abandoned. - */ - if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit)) + // Check if the current buffer may be abandoned. + if (action == DOBUF_GOTO && !can_abandon(curbuf, (flags & DOBUF_FORCEIT))) { #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) - if ((p_confirm || cmdmod.confirm) && p_write) + if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write) { bufref_T bufref; set_bufref(&bufref, buf); dialog_changed(curbuf, FALSE); if (!bufref_valid(&bufref)) - /* Autocommand deleted buffer, oops! */ + // Autocommand deleted buffer, oops! return FAIL; } if (bufIsChanged(curbuf)) @@ -1631,20 +1570,144 @@ do_buffer( } } - /* Go to the other buffer. */ + // Go to the other buffer. set_curbuf(buf, action); if (action == DOBUF_SPLIT) - RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ + RESET_BINDING(curwin); // reset 'scrollbind' and 'cursorbind' #if defined(FEAT_EVAL) - if (aborting()) /* autocmds may abort script processing */ + if (aborting()) // autocmds may abort script processing return FAIL; #endif return OK; } + int +do_buffer( + int action, + int start, + int dir, // FORWARD or BACKWARD + int count, // buffer number or number of buffers + int forceit) // TRUE when using ! +{ + return do_buffer_ext(action, start, dir, count, + forceit ? DOBUF_FORCEIT : 0); +} + +/* + * do_bufdel() - delete or unload buffer(s) + * + * addr_count == 0: ":bdel" - delete current buffer + * addr_count == 1: ":N bdel" or ":bdel N [N ..]" - first delete + * buffer "end_bnr", then any other arguments. + * addr_count == 2: ":N,N bdel" - delete buffers in range + * + * command can be DOBUF_UNLOAD (":bunload"), DOBUF_WIPE (":bwipeout") or + * DOBUF_DEL (":bdel") + * + * Returns error message or NULL + */ + char * +do_bufdel( + int command, + char_u *arg, // pointer to extra arguments + int addr_count, + int start_bnr, // first buffer number in a range + int end_bnr, // buffer nr or last buffer nr in a range + int forceit) +{ + int do_current = 0; // delete current buffer? + int deleted = 0; // number of buffers deleted + char *errormsg = NULL; // return value + int bnr; // buffer number + char_u *p; + + if (addr_count == 0) + { + (void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit); + } + else + { + if (addr_count == 2) + { + if (*arg) // both range and argument is not allowed + return ex_errmsg(e_trailing_characters_str, arg); + bnr = start_bnr; + } + else // addr_count == 1 + bnr = end_bnr; + + for ( ;!got_int; ui_breakcheck()) + { + // Delete the current buffer last, otherwise when the + // current buffer is deleted, the next buffer becomes + // the current one and will be loaded, which may then + // also be deleted, etc. + if (bnr == curbuf->b_fnum) + do_current = bnr; + else if (do_buffer_ext(command, DOBUF_FIRST, FORWARD, bnr, + DOBUF_NOPOPUP | (forceit ? DOBUF_FORCEIT : 0)) == OK) + ++deleted; + + // find next buffer number to delete/unload + if (addr_count == 2) + { + if (++bnr > end_bnr) + break; + } + else // addr_count == 1 + { + arg = skipwhite(arg); + if (*arg == NUL) + break; + if (!VIM_ISDIGIT(*arg)) + { + p = skiptowhite_esc(arg); + bnr = buflist_findpat(arg, p, + command == DOBUF_WIPE || command == DOBUF_WIPE_REUSE, + FALSE, FALSE); + if (bnr < 0) // failed + break; + arg = p; + } + else + bnr = getdigits(&arg); + } + } + if (!got_int && do_current && do_buffer(command, DOBUF_FIRST, + FORWARD, do_current, forceit) == OK) + ++deleted; + + if (deleted == 0) + { + if (command == DOBUF_UNLOAD) + STRCPY(IObuff, _(e_no_buffers_were_unloaded)); + else if (command == DOBUF_DEL) + STRCPY(IObuff, _(e_no_buffers_were_deleted)); + else + STRCPY(IObuff, _(e_no_buffers_were_wiped_out)); + errormsg = (char *)IObuff; + } + else if (deleted >= p_report) + { + if (command == DOBUF_UNLOAD) + smsg(NGETTEXT("%d buffer unloaded", + "%d buffers unloaded", deleted), deleted); + else if (command == DOBUF_DEL) + smsg(NGETTEXT("%d buffer deleted", + "%d buffers deleted", deleted), deleted); + else + smsg(NGETTEXT("%d buffer wiped out", + "%d buffers wiped out", deleted), deleted); + } + } + + + return errormsg; +} + /* * Set current buffer to "buf". Executes autocommands and closes current * buffer. "action" tells how to close the current buffer: @@ -1666,23 +1729,23 @@ set_curbuf(buf_T *buf, int action) #endif bufref_T newbufref; bufref_T prevbufref; + int valid; setpcmark(); - if (!cmdmod.keepalt) - curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */ - buflist_altfpos(curwin); /* remember curpos */ + if ((cmdmod.cmod_flags & CMOD_KEEPALT) == 0) + curwin->w_alt_fnum = curbuf->b_fnum; // remember alternate file + buflist_altfpos(curwin); // remember curpos - /* Don't restart Select mode after switching to another buffer. */ + // Don't restart Select mode after switching to another buffer. VIsual_reselect = FALSE; - /* close_windows() or apply_autocmds() may change curbuf and wipe out "buf" - */ + // close_windows() or apply_autocmds() may change curbuf and wipe out "buf" prevbuf = curbuf; set_bufref(&prevbufref, prevbuf); set_bufref(&newbufref, buf); - /* Autocommands may delete the curren buffer and/or the buffer we wan to go - * to. In those cases don't close the buffer. */ + // Autocommands may delete the current buffer and/or the buffer we want to + // go to. In those cases don't close the buffer. if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf) || (bufref_valid(&prevbufref) && bufref_valid(&newbufref) @@ -1704,27 +1767,39 @@ set_curbuf(buf_T *buf, int action) #endif { win_T *previouswin = curwin; - if (prevbuf == curbuf) + + // Do not sync when in Insert mode and the buffer is open in + // another window, might be a timer doing something in another + // window. + if (prevbuf == curbuf + && ((State & MODE_INSERT) == 0 || curbuf->b_nwindows <= 1)) u_sync(FALSE); close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf, unload ? action : (action == DOBUF_GOTO && !buf_hide(prevbuf) - && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE); + && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, + FALSE, FALSE); if (curwin != previouswin && win_valid(previouswin)) - /* autocommands changed curwin, Grr! */ + // autocommands changed curwin, Grr! curwin = previouswin; } } - /* An autocommand may have deleted "buf", already entered it (e.g., when - * it did ":bunload") or aborted the script processing. - * If curwin->w_buffer is null, enter_buffer() will make it valid again */ - if ((buf_valid(buf) && buf != curbuf + // An autocommand may have deleted "buf", already entered it (e.g., when + // it did ":bunload") or aborted the script processing. + // If curwin->w_buffer is null, enter_buffer() will make it valid again + valid = buf_valid(buf); + if ((valid && buf != curbuf #ifdef FEAT_EVAL && !aborting() #endif ) || curwin->w_buffer == NULL) { - enter_buffer(buf); + // If the buffer is not valid but curwin->w_buffer is NULL we must + // enter some buffer. Using the last one is hopefully OK. + if (!valid) + enter_buffer(lastbuf); + else + enter_buffer(buf); #ifdef FEAT_SYN_HL if (old_tw != curbuf->b_p_tw) check_colorcolumn(curwin); @@ -1765,25 +1840,25 @@ enter_buffer(buf_T *buf) curwin->w_s = &(curbuf->b_s); #endif - /* Cursor on first line by default. */ + // Cursor on first line by default. curwin->w_cursor.lnum = 1; curwin->w_cursor.col = 0; curwin->w_cursor.coladd = 0; curwin->w_set_curswant = TRUE; curwin->w_topline_was_set = FALSE; - /* mark cursor position as being invalid */ + // mark cursor position as being invalid curwin->w_valid = 0; buflist_setfpos(curbuf, curwin, curbuf->b_last_cursor.lnum, curbuf->b_last_cursor.col, TRUE); - /* Make sure the buffer is loaded. */ - if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */ + // Make sure the buffer is loaded. + if (curbuf->b_ml.ml_mfp == NULL) // need to load the file { - /* If there is no filetype, allow for detecting one. Esp. useful for - * ":ball" used in a autocommand. If there already is a filetype we - * might prefer to keep it. */ + // If there is no filetype, allow for detecting one. Esp. useful for + // ":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; @@ -1805,25 +1880,23 @@ enter_buffer(buf_T *buf) apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf); } - /* If autocommands did not change the cursor position, restore cursor lnum - * and possibly cursor col. */ + // If autocommands did not change the cursor position, restore cursor lnum + // and possibly cursor col. if (curwin->w_cursor.lnum == 1 && inindent(0)) buflist_getfpos(); - check_arg_idx(curwin); /* check for valid arg_idx */ -#ifdef FEAT_TITLE + check_arg_idx(curwin); // check for valid arg_idx maketitle(); -#endif - /* when autocmds didn't change it */ + // when autocmds didn't change it if (curwin->w_topline == 1 && !curwin->w_topline_was_set) - scroll_cursor_halfway(FALSE); /* redisplay at correct position */ + scroll_cursor_halfway(FALSE); // redisplay at correct position #ifdef FEAT_NETBEANS_INTG - /* Send fileOpened event because we've changed buffers. */ + // Send fileOpened event because we've changed buffers. netbeans_file_activated(curbuf); #endif - /* Change directories when the 'acd' option is set. */ + // Change directories when the 'acd' option is set. DO_AUTOCHDIR; #ifdef FEAT_KEYMAP @@ -1831,8 +1904,8 @@ enter_buffer(buf_T *buf) (void)keymap_init(); #endif #ifdef FEAT_SPELL - /* May need to set the spell language. Can only do this after the buffer - * has been properly setup. */ + // May need to set the spell language. Can only do this after the buffer + // has been properly setup. if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) (void)did_set_spelllang(curwin); #endif @@ -1854,7 +1927,10 @@ do_autochdir(void) if ((starting == 0 || test_autochdir) && curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname, "auto") == OK) + { shorten_fnames(TRUE); + last_chdir_reason = "autochdir"; + } } #endif @@ -1863,10 +1939,10 @@ no_write_message(void) { #ifdef FEAT_TERMINAL if (term_job_running(curbuf->b_term)) - emsg(_("E948: Job still running (add ! to end the job)")); + emsg(_(e_job_still_running_add_bang_to_end_the_job)); else #endif - emsg(_("E37: No write since last change (add ! to override)")); + emsg(_(e_no_write_since_last_change_add_bang_to_override)); } void @@ -1874,10 +1950,10 @@ no_write_message_nobang(buf_T *buf UNUSED) { #ifdef FEAT_TERMINAL if (term_job_running(buf->b_term)) - emsg(_("E948: Job still running")); + emsg(_(e_job_still_running)); else #endif - emsg(_("E37: No write since last change")); + emsg(_(e_no_write_since_last_change)); } /* @@ -1934,11 +2010,11 @@ buflist_new( fname_expand(curbuf, &ffname, &sfname); // will allocate ffname /* - * If file name already exists in the list, update the entry. + * If the file name already exists in the list, update the entry. */ #ifdef UNIX - /* On Unix we can use inode numbers when the file exists. Works better - * for hard links. */ + // On Unix we can use inode numbers when the file exists. Works better + // for hard links. if (sfname == NULL || mch_stat((char *)sfname, &st) < 0) st.st_dev = (dev_T)-1; #endif @@ -1952,11 +2028,12 @@ buflist_new( { vim_free(ffname); if (lnum != 0) - buflist_setfpos(buf, curwin, lnum, (colnr_T)0, FALSE); + buflist_setfpos(buf, (flags & BLN_NOCURWIN) ? NULL : curwin, + lnum, (colnr_T)0, FALSE); if ((flags & BLN_NOOPT) == 0) - /* copy the options now, if 'cpo' doesn't have 's' and not done - * already */ + // copy the options now, if 'cpo' doesn't have 's' and not done + // already buf_copy_options(buf, 0); if ((flags & BLN_LISTED) && !buf->b_p_bl) @@ -1987,22 +2064,18 @@ buflist_new( if ((flags & BLN_CURBUF) && curbuf_reusable()) { buf = curbuf; - /* It's like this buffer is deleted. Watch out for autocommands that - * change curbuf! If that happens, allocate a new buffer anyway. */ - if (curbuf->b_p_bl) - apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf); - if (buf == curbuf) - apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf); -#ifdef FEAT_EVAL - if (aborting()) /* autocmds may abort script processing */ + // It's like this buffer is deleted. Watch out for autocommands that + // change curbuf! If that happens, allocate a new buffer anyway. + buf_freeall(buf, BFA_WIPE | BFA_DEL); + if (buf != curbuf) // autocommands deleted the buffer! return NULL; -#endif - if (buf == curbuf) +#ifdef FEAT_EVAL + if (aborting()) // autocmds may abort script processing { - /* Make sure 'bufhidden' and 'buftype' are empty */ - clear_string_option(&buf->b_p_bh); - clear_string_option(&buf->b_p_bt); + vim_free(ffname); + return NULL; } +#endif } if (buf != curbuf || curbuf == NULL) { @@ -2013,8 +2086,8 @@ buflist_new( return NULL; } #ifdef FEAT_EVAL - /* init b: variables */ - buf->b_vars = dict_alloc(); + // init b: variables + buf->b_vars = dict_alloc_id(aid_newbuf_bvars); if (buf->b_vars == NULL) { vim_free(ffname); @@ -2050,37 +2123,27 @@ buflist_new( if (buf == curbuf) { - /* free all things allocated for this buffer */ - buf_freeall(buf, 0); - if (buf != curbuf) /* autocommands deleted the buffer! */ - return NULL; -#if defined(FEAT_EVAL) - if (aborting()) /* autocmds may abort script processing */ - return NULL; -#endif - free_buffer_stuff(buf, FALSE); /* delete local variables et al. */ + free_buffer_stuff(buf, FALSE); // delete local variables et al. - /* Init the options. */ + // Init the options. buf->b_p_initialized = FALSE; buf_copy_options(buf, BCO_ENTER); #ifdef FEAT_KEYMAP - /* need to reload lmaps and set b:keymap_name */ + // need to reload lmaps and set b:keymap_name curbuf->b_kmap_state |= KEYMAP_INIT; #endif } else { - /* - * put new buffer at the end of the buffer list - */ + // put the new buffer at the end of the buffer list buf->b_next = NULL; - if (firstbuf == NULL) /* buffer list is empty */ + if (firstbuf == NULL) // buffer list is empty { buf->b_prev = NULL; firstbuf = buf; } - else /* append new buffer at end of list */ + else // append new buffer at end of list { lastbuf->b_next = buf; buf->b_prev = lastbuf; @@ -2094,24 +2157,41 @@ buflist_new( // buffer number grows rapidly. --buf_reuse.ga_len; buf->b_fnum = ((int *)buf_reuse.ga_data)[buf_reuse.ga_len]; + + // Move buffer to the right place in the buffer list. + while (buf->b_prev != NULL && buf->b_fnum < buf->b_prev->b_fnum) + { + buf_T *prev = buf->b_prev; + + prev->b_next = buf->b_next; + if (prev->b_next != NULL) + prev->b_next->b_prev = prev; + buf->b_next = prev; + buf->b_prev = prev->b_prev; + if (buf->b_prev != NULL) + buf->b_prev->b_next = buf; + prev->b_prev = buf; + if (lastbuf == buf) + lastbuf = prev; + if (firstbuf == prev) + firstbuf = buf; + } } else buf->b_fnum = top_file_num++; - if (top_file_num < 0) /* wrap around (may cause duplicates) */ + if (top_file_num < 0) // wrap around (may cause duplicates) { emsg(_("W14: Warning: List of file names overflow")); - if (emsg_silent == 0) + if (emsg_silent == 0 && !in_assert_fails) { out_flush(); - ui_delay(3000L, TRUE); /* make sure it is noticed */ + ui_delay(3001L, TRUE); // make sure it is noticed } top_file_num = 1; } buf_hashtab_add(buf); - /* - * Always copy the options from the current buffer. - */ + // Always copy the options from the current buffer. buf_copy_options(buf, BCO_ALWAYS); } @@ -2139,16 +2219,16 @@ buflist_new( if (flags & BLN_DUMMY) buf->b_flags |= BF_DUMMY; buf_clear_file(buf); - clrallmarks(buf); /* clear marks */ - fmarks_check_names(buf); /* check file marks for this file */ - buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */ + clrallmarks(buf); // clear marks + fmarks_check_names(buf); // check file marks for this file + buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; // init 'buflisted' if (!(flags & BLN_DUMMY)) { bufref_T bufref; - /* Tricky: these autocommands may change the buffer list. They could - * also split the window with re-using the one empty buffer. This may - * result in unexpectedly losing the empty buffer. */ + // Tricky: these autocommands may change the buffer list. They could + // also split the window with re-using the one empty buffer. This may + // result in unexpectedly losing the empty buffer. set_bufref(&bufref, buf); if (apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, buf) && !bufref_valid(&bufref)) @@ -2160,7 +2240,7 @@ buflist_new( return NULL; } #ifdef FEAT_EVAL - if (aborting()) /* autocmds may abort script processing */ + if (aborting()) // autocmds may abort script processing return NULL; #endif } @@ -2192,7 +2272,7 @@ free_buf_options( clear_string_option(&buf->b_p_inex); # endif #endif -#if defined(FEAT_CINDENT) && defined(FEAT_EVAL) +#if defined(FEAT_EVAL) clear_string_option(&buf->b_p_inde); clear_string_option(&buf->b_p_indk); #endif @@ -2207,6 +2287,11 @@ free_buf_options( clear_string_option(&buf->b_p_fex); #endif #ifdef FEAT_CRYPT +# ifdef FEAT_SODIUM + if ((buf->b_p_key != NULL) && (*buf->b_p_key != NUL) && + (crypt_get_method_nr(buf) == CRYPT_M_SOD)) + crypt_sodium_munlock(buf->b_p_key, STRLEN(buf->b_p_key)); +# endif clear_string_option(&buf->b_p_key); #endif clear_string_option(&buf->b_p_kp); @@ -2218,8 +2303,7 @@ free_buf_options( clear_string_option(&buf->b_p_vsts); vim_free(buf->b_p_vsts_nopaste); buf->b_p_vsts_nopaste = NULL; - vim_free(buf->b_p_vsts_array); - buf->b_p_vsts_array = NULL; + VIM_CLEAR(buf->b_p_vsts_array); clear_string_option(&buf->b_p_vts); VIM_CLEAR(buf->b_p_vts_array); #endif @@ -2243,22 +2327,24 @@ free_buf_options( vim_regfree(buf->b_s.b_cap_prog); buf->b_s.b_cap_prog = NULL; clear_string_option(&buf->b_s.b_p_spl); + clear_string_option(&buf->b_s.b_p_spo); #endif #ifdef FEAT_SEARCHPATH clear_string_option(&buf->b_p_sua); #endif clear_string_option(&buf->b_p_ft); -#ifdef FEAT_CINDENT clear_string_option(&buf->b_p_cink); clear_string_option(&buf->b_p_cino); -#endif -#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) + clear_string_option(&buf->b_p_cinsd); clear_string_option(&buf->b_p_cinw); -#endif clear_string_option(&buf->b_p_cpt); #ifdef FEAT_COMPL_FUNC clear_string_option(&buf->b_p_cfu); + free_callback(&buf->b_cfu_cb); clear_string_option(&buf->b_p_ofu); + free_callback(&buf->b_ofu_cb); + clear_string_option(&buf->b_p_tsrfu); + free_callback(&buf->b_tsrfu_cb); #endif #ifdef FEAT_QUICKFIX clear_string_option(&buf->b_p_gp); @@ -2271,6 +2357,7 @@ free_buf_options( clear_string_option(&buf->b_p_tc); #ifdef FEAT_EVAL clear_string_option(&buf->b_p_tfu); + free_callback(&buf->b_tfu_cb); #endif clear_string_option(&buf->b_p_dict); clear_string_option(&buf->b_p_tsr); @@ -2279,9 +2366,7 @@ free_buf_options( #endif buf->b_p_ar = -1; buf->b_p_ul = NO_LOCAL_UNDOLEVEL; -#ifdef FEAT_LISP clear_string_option(&buf->b_p_lw); -#endif clear_string_option(&buf->b_p_bkc); clear_string_option(&buf->b_p_menc); } @@ -2312,25 +2397,20 @@ buflist_getfile( if (buf == NULL) { if ((options & GETF_ALT) && n == 0) - emsg(_(e_noalt)); + emsg(_(e_no_alternate_file)); else - semsg(_("E92: Buffer %d not found"), n); + semsg(_(e_buffer_nr_not_found), n); return FAIL; } - /* if alternate file is the current buffer, nothing to do */ + // if alternate file is the current buffer, nothing to do if (buf == curbuf) return OK; - if (text_locked()) - { - text_locked_msg(); - return FAIL; - } - if (curbuf_locked()) + if (text_or_buf_locked()) return FAIL; - /* altfpos may be changed by getfile(), get it now */ + // altfpos may be changed by getfile(), get it now if (lnum == 0) { fpos = buflist_findfpos(buf); @@ -2342,18 +2422,18 @@ buflist_getfile( if (options & GETF_SWITCH) { - /* If 'switchbuf' contains "useopen": jump to first window containing - * "buf" if one exists */ + // If 'switchbuf' contains "useopen": jump to first window containing + // "buf" if one exists if (swb_flags & SWB_USEOPEN) wp = buf_jump_open_win(buf); - /* If 'switchbuf' contains "usetab": jump to first window in any tab - * page containing "buf" if one exists */ + // If 'switchbuf' contains "usetab": jump to first window in any tab + // page containing "buf" if one exists if (wp == NULL && (swb_flags & SWB_USETAB)) wp = buf_jump_open_tab(buf); - /* If 'switchbuf' contains "split", "vsplit" or "newtab" and the - * current buffer isn't empty: open new tab or window */ + // If 'switchbuf' contains "split", "vsplit" or "newtab" and the + // current buffer isn't empty: open new tab or window if (wp == NULL && (swb_flags & (SWB_VSPLIT | SWB_SPLIT | SWB_NEWTAB)) && !BUFEMPTY()) { @@ -2372,7 +2452,7 @@ buflist_getfile( { --RedrawingDisabled; - /* cursor is at to BOL and w_cursor.lnum is checked due to getfile() */ + // cursor is at to BOL and w_cursor.lnum is checked due to getfile() if (!p_sol && col != 0) { curwin->w_cursor.col = col; @@ -2421,10 +2501,10 @@ buflist_findname_exp(char_u *fname) char_u *ffname; buf_T *buf = NULL; - /* First make the name into a full path name */ + // First make the name into a full path name ffname = FullName_save(fname, #ifdef UNIX - TRUE /* force expansion, get rid of symbolic links */ + TRUE // force expansion, get rid of symbolic links #else FALSE #endif @@ -2468,8 +2548,8 @@ buflist_findname_stat( #endif buf_T *buf; - /* Start at the last buffer, expect to find a match sooner. */ - for (buf = lastbuf; buf != NULL; buf = buf->b_prev) + // Start at the last buffer, expect to find a match sooner. + FOR_ALL_BUFS_FROM_LAST(buf) if ((buf->b_flags & BF_DUMMY) == 0 && !otherfile_buf(buf, ffname #ifdef UNIX , stp @@ -2487,10 +2567,10 @@ buflist_findname_stat( int buflist_findpat( char_u *pattern, - char_u *pattern_end, /* pointer to first char after pattern */ - int unlisted, /* find unlisted buffers */ - int diffmode UNUSED, /* find diff-mode buffers only */ - int curtab_only) /* find buffers in current tab only */ + char_u *pattern_end, // pointer to first char after pattern + int unlisted, // find unlisted buffers + int diffmode UNUSED, // find diff-mode buffers only + int curtab_only) // find buffers in current tab only { buf_T *buf; int match = -1; @@ -2501,12 +2581,15 @@ buflist_findpat( char_u *p; int toggledollar; - if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#')) + // "%" is current file, "%%" or "#" is alternate file + if ((pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#')) + || (in_vim9script() && pattern_end == pattern + 2 + && pattern[0] == '%' && pattern[1] == '%')) { - if (*pattern == '%') - match = curbuf->b_fnum; - else + if (*pattern == '#' || pattern_end == pattern + 2) match = curwin->w_alt_fnum; + else + match = curbuf->b_fnum; #ifdef FEAT_DIFF if (diffmode && !diff_mode_buf(buflist_findnr(match))) match = -1; @@ -2530,8 +2613,8 @@ buflist_findpat( patend = pat + STRLEN(pat) - 1; toggledollar = (patend > pat && *patend == '$'); - /* First try finding a listed buffer. If not found and "unlisted" - * is TRUE, try finding an unlisted buffer. */ + // First try finding a listed buffer. If not found and "unlisted" + // is TRUE, try finding an unlisted buffer. find_listed = TRUE; for (;;) { @@ -2539,20 +2622,22 @@ buflist_findpat( { regmatch_T regmatch; - /* may add '^' and '$' */ + // may add '^' and '$' if (toggledollar) - *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */ + *patend = (attempt < 2) ? NUL : '$'; // add/remove '$' p = pat; - if (*p == '^' && !(attempt & 1)) /* add/remove '^' */ + if (*p == '^' && !(attempt & 1)) // add/remove '^' ++p; - regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0); - if (regmatch.regprog == NULL) - { - vim_free(pat); - return -1; - } + regmatch.regprog = vim_regcomp(p, magic_isset() ? RE_MAGIC : 0); - for (buf = lastbuf; buf != NULL; buf = buf->b_prev) + FOR_ALL_BUFS_FROM_LAST(buf) + { + if (regmatch.regprog == NULL) + { + // invalid pattern, possibly after switching engine + vim_free(pat); + return -1; + } if (buf->b_p_bl == find_listed #ifdef FEAT_DIFF && (!diffmode || diff_mode_buf(buf)) @@ -2561,8 +2646,8 @@ buflist_findpat( { if (curtab_only) { - /* Ignore the match if the buffer is not open in - * the current tab. */ + // Ignore the match if the buffer is not open in + // the current tab. win_T *wp; FOR_ALL_WINDOWS(wp) @@ -2571,21 +2656,22 @@ buflist_findpat( if (wp == NULL) continue; } - if (match >= 0) /* already found a match */ + if (match >= 0) // already found a match { match = -2; break; } - match = buf->b_fnum; /* remember first match */ + match = buf->b_fnum; // remember first match } + } vim_regfree(regmatch.regprog); - if (match >= 0) /* found one match */ + if (match >= 0) // found one match break; } - /* Only search for unlisted buffers if there was no match with - * a listed buffer. */ + // Only search for unlisted buffers if there was no match with + // a listed buffer. if (!unlisted || !find_listed || match != -1) break; find_listed = FALSE; @@ -2595,9 +2681,9 @@ buflist_findpat( } if (match == -2) - semsg(_("E93: More than one match for %s"), pattern); + semsg(_(e_more_than_one_match_for_str), pattern); else if (match < 0) - semsg(_("E94: No matching buffer for %s"), pattern); + semsg(_(e_no_matching_buffer_for_str), pattern); return match; } @@ -2625,124 +2711,200 @@ ExpandBufnames( int round; char_u *p; int attempt; - char_u *patc; + char_u *patc = NULL; #ifdef FEAT_VIMINFO bufmatch_T *matches = NULL; #endif + int fuzzy; + fuzmatch_str_T *fuzmatch = NULL; - *num_file = 0; /* return values in case of FAIL */ + *num_file = 0; // return values in case of FAIL *file = NULL; - /* Make a copy of "pat" and change "^" to "\(^\|[\/]\)". */ - if (*pat == '^') +#ifdef FEAT_DIFF + if ((options & BUF_DIFF_FILTER) && !curwin->w_p_diff) + return FAIL; +#endif + + fuzzy = cmdline_fuzzy_complete(pat); + + // Make a copy of "pat" and change "^" to "\(^\|[\/]\)" (if doing regular + // expression matching) + if (!fuzzy) { - patc = alloc(STRLEN(pat) + 11); - if (patc == NULL) - return FAIL; - STRCPY(patc, "\\(^\\|[\\/]\\)"); - STRCPY(patc + 11, pat + 1); + if (*pat == '^') + { + patc = alloc(STRLEN(pat) + 11); + if (patc == NULL) + return FAIL; + STRCPY(patc, "\\(^\\|[\\/]\\)"); + STRCPY(patc + 11, pat + 1); + } + else + patc = pat; } - else - patc = pat; - /* - * attempt == 0: try match with '\<', match at start of word - * attempt == 1: try match without '\<', match anywhere - */ - for (attempt = 0; attempt <= 1; ++attempt) + // attempt == 0: try match with '\<', match at start of word + // attempt == 1: try match without '\<', match anywhere + for (attempt = 0; attempt <= (fuzzy ? 0 : 1); ++attempt) { regmatch_T regmatch; + int score = 0; - if (attempt > 0 && patc == pat) - break; /* there was no anchor, no need to try again */ - regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC); - if (regmatch.regprog == NULL) + if (!fuzzy) { - if (patc != pat) - vim_free(patc); - return FAIL; + if (attempt > 0 && patc == pat) + break; // there was no anchor, no need to try again + regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC); } - /* - * round == 1: Count the matches. - * round == 2: Build the array to keep the matches. - */ + // round == 1: Count the matches. + // round == 2: Build the array to keep the matches. for (round = 1; round <= 2; ++round) { count = 0; FOR_ALL_BUFFERS(buf) { - if (!buf->b_p_bl) /* skip unlisted buffers */ + if (!buf->b_p_bl) // skip unlisted buffers continue; - p = buflist_match(®match, buf, p_wic); - if (p != NULL) +#ifdef FEAT_DIFF + if (options & BUF_DIFF_FILTER) + // Skip buffers not suitable for + // :diffget or :diffput completion. + if (buf == curbuf || !diff_mode_buf(buf)) + continue; +#endif + + if (!fuzzy) { - if (round == 1) - ++count; - else + if (regmatch.regprog == NULL) + { + // invalid pattern, possibly after recompiling + if (patc != pat) + vim_free(patc); + return FAIL; + } + p = buflist_match(®match, buf, p_wic); + } + else + { + p = NULL; + // first try matching with the short file name + if ((score = fuzzy_match_str(buf->b_sfname, pat)) != 0) + p = buf->b_sfname; + if (p == NULL) { - if (options & WILD_HOME_REPLACE) - p = home_replace_save(buf, p); - else - p = vim_strsave(p); + // next try matching with the full path file name + if ((score = fuzzy_match_str(buf->b_ffname, pat)) != 0) + p = buf->b_ffname; + } + } + + if (p == NULL) + continue; + + if (round == 1) + { + ++count; + continue; + } + + if (options & WILD_HOME_REPLACE) + p = home_replace_save(buf, p); + else + p = vim_strsave(p); + + if (!fuzzy) + { #ifdef FEAT_VIMINFO - if (matches != NULL) - { - matches[count].buf = buf; - matches[count].match = p; - count++; - } - else -#endif - (*file)[count++] = p; + if (matches != NULL) + { + matches[count].buf = buf; + matches[count].match = p; + count++; } + else +#endif + (*file)[count++] = p; + } + else + { + fuzmatch[count].idx = count; + fuzmatch[count].str = p; + fuzmatch[count].score = score; + count++; } } - if (count == 0) /* no match found, break here */ + if (count == 0) // no match found, break here break; if (round == 1) { - *file = ALLOC_MULT(char_u *, count); - if (*file == NULL) + if (!fuzzy) { - vim_regfree(regmatch.regprog); - if (patc != pat) - vim_free(patc); - return FAIL; - } + *file = ALLOC_MULT(char_u *, count); + if (*file == NULL) + { + vim_regfree(regmatch.regprog); + if (patc != pat) + vim_free(patc); + return FAIL; + } #ifdef FEAT_VIMINFO - if (options & WILD_BUFLASTUSED) - matches = ALLOC_MULT(bufmatch_T, count); + if (options & WILD_BUFLASTUSED) + matches = ALLOC_MULT(bufmatch_T, count); #endif + } + else + { + fuzmatch = ALLOC_MULT(fuzmatch_str_T, count); + if (fuzmatch == NULL) + { + *num_file = 0; + *file = NULL; + return FAIL; + } + } } } - vim_regfree(regmatch.regprog); - if (count) /* match(es) found, break here */ - break; + + if (!fuzzy) + { + vim_regfree(regmatch.regprog); + if (count) // match(es) found, break here + break; + } } - if (patc != pat) + if (!fuzzy && patc != pat) vim_free(patc); #ifdef FEAT_VIMINFO - if (matches != NULL) + if (!fuzzy) { - int i; - if (count > 1) - qsort(matches, count, sizeof(bufmatch_T), buf_compare); - // if the current buffer is first in the list, place it at the end - if (matches[0].buf == curbuf) + if (matches != NULL) { - for (i = 1; i < count; i++) - (*file)[i-1] = matches[i].match; - (*file)[count-1] = matches[0].match; - } - else - { - for (i = 0; i < count; i++) - (*file)[i] = matches[i].match; + int i; + if (count > 1) + qsort(matches, count, sizeof(bufmatch_T), buf_compare); + // if the current buffer is first in the list, place it at the end + if (matches[0].buf == curbuf) + { + for (i = 1; i < count; i++) + (*file)[i-1] = matches[i].match; + (*file)[count-1] = matches[0].match; + } + else + { + for (i = 0; i < count; i++) + (*file)[i] = matches[i].match; + } + vim_free(matches); } - vim_free(matches); + } + else + { + if (fuzzymatches_to_strmatches(fuzmatch, file, count, FALSE) == FAIL) + return FAIL; } #endif @@ -2752,45 +2914,48 @@ ExpandBufnames( /* * Check for a match on the file name for buffer "buf" with regprog "prog". + * Note that rmp->regprog may become NULL when switching regexp engine. */ static char_u * buflist_match( regmatch_T *rmp, buf_T *buf, - int ignore_case) /* when TRUE ignore case, when FALSE use 'fic' */ + int ignore_case) // when TRUE ignore case, when FALSE use 'fic' { char_u *match; - /* First try the short file name, then the long file name. */ + // First try the short file name, then the long file name. match = fname_match(rmp, buf->b_sfname, ignore_case); - if (match == NULL) + if (match == NULL && rmp->regprog != NULL) match = fname_match(rmp, buf->b_ffname, ignore_case); return match; } /* - * Try matching the regexp in "prog" with file name "name". + * Try matching the regexp in "rmp->regprog" with file name "name". + * Note that rmp->regprog may become NULL when switching regexp engine. * Return "name" when there is a match, NULL when not. */ static char_u * fname_match( regmatch_T *rmp, char_u *name, - int ignore_case) /* when TRUE ignore case, when FALSE use 'fic' */ + int ignore_case) // when TRUE ignore case, when FALSE use 'fic' { char_u *match = NULL; char_u *p; - if (name != NULL) + // extra check for valid arguments + if (name != NULL && rmp->regprog != NULL) { - /* Ignore case when 'fileignorecase' or the argument is set. */ + // Ignore case when 'fileignorecase' or the argument is set. rmp->rm_ic = p_fic || ignore_case; if (vim_regexec(rmp, name, (colnr_T)0)) match = name; - else + else if (rmp->regprog != NULL) { - /* Replace $(HOME) with '~' and try matching again. */ + // Replace $(HOME) with '~' and try matching again. p = home_replace_save(NULL, name); if (p != NULL && vim_regexec(rmp, p, (colnr_T)0)) match = name; @@ -2831,7 +2996,7 @@ buflist_findnr(int nr) buflist_nr2name( int n, int fullname, - int helptail) /* for help buffers return tail only */ + int helptail) // for help buffers return tail only { buf_T *buf; @@ -2850,29 +3015,29 @@ buflist_nr2name( void buflist_setfpos( buf_T *buf, - win_T *win, + win_T *win, // may be NULL when using :badd linenr_T lnum, colnr_T col, int copy_options) { wininfo_T *wip; - for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next) + FOR_ALL_BUF_WININFO(buf, wip) if (wip->wi_win == win) break; if (wip == NULL) { - /* allocate a new entry */ + // allocate a new entry wip = ALLOC_CLEAR_ONE(wininfo_T); if (wip == NULL) return; wip->wi_win = win; - if (lnum == 0) /* set lnum even when it's 0 */ + if (lnum == 0) // set lnum even when it's 0 lnum = 1; } else { - /* remove the entry from the list */ + // remove the entry from the list if (wip->wi_prev) wip->wi_prev->wi_next = wip->wi_next; else @@ -2892,9 +3057,11 @@ buflist_setfpos( wip->wi_fpos.lnum = lnum; wip->wi_fpos.col = col; } - if (copy_options) + if (win != NULL) + wip->wi_changelistidx = win->w_changelistidx; + if (copy_options && win != NULL) { - /* Save the window-specific option values. */ + // Save the window-specific option values. copy_winopt(&win->w_onebuf_opt, &wip->wi_opt); #ifdef FEAT_FOLDING wip->wi_fold_manual = win->w_fold_manual; @@ -2903,14 +3070,12 @@ buflist_setfpos( wip->wi_optset = TRUE; } - /* insert the entry in front of the list */ + // insert the entry in front of the list wip->wi_next = buf->b_wininfo; buf->b_wininfo = wip; wip->wi_prev = NULL; if (wip->wi_next) wip->wi_next->wi_prev = wip; - - return; } #ifdef FEAT_DIFF @@ -2926,8 +3091,8 @@ wininfo_other_tab_diff(wininfo_T *wip) if (wip->wi_opt.wo_diff) { FOR_ALL_WINDOWS(wp) - /* return FALSE when it's a window in the current tab page, thus - * the buffer was in diff mode here */ + // return FALSE when it's a window in the current tab page, thus + // the buffer was in diff mode here if (wip->wi_win == wp) return FALSE; return TRUE; @@ -2939,6 +3104,7 @@ wininfo_other_tab_diff(wininfo_T *wip) /* * Find info for the current window in buffer "buf". * If not found, return the info for the most recently used window. + * When "need_options" is TRUE skip entries where wi_optset is FALSE. * When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in * another tab page. * Returns NULL when there isn't any info. @@ -2946,27 +3112,35 @@ wininfo_other_tab_diff(wininfo_T *wip) static wininfo_T * find_wininfo( buf_T *buf, + int need_options, int skip_diff_buffer UNUSED) { wininfo_T *wip; - for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next) + FOR_ALL_BUF_WININFO(buf, wip) if (wip->wi_win == curwin #ifdef FEAT_DIFF && (!skip_diff_buffer || !wininfo_other_tab_diff(wip)) #endif - ) + + && (!need_options || wip->wi_optset)) break; - /* If no wininfo for curwin, use the first in the list (that doesn't have - * 'diff' set and is in another tab page). */ + // If no wininfo for curwin, use the first in the list (that doesn't have + // 'diff' set and is in another tab page). + // If "need_options" is TRUE skip entries that don't have options set, + // unless the window is editing "buf", so we can copy from the window + // itself. if (wip == NULL) { #ifdef FEAT_DIFF if (skip_diff_buffer) { - for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next) - if (!wininfo_other_tab_diff(wip)) + FOR_ALL_BUF_WININFO(buf, wip) + if (!wininfo_other_tab_diff(wip) + && (!need_options || wip->wi_optset + || (wip->wi_win != NULL + && wip->wi_win->w_buffer == buf))) break; } else @@ -2992,12 +3166,12 @@ get_winopts(buf_T *buf) clearFolding(curwin); #endif - wip = find_wininfo(buf, TRUE); + wip = find_wininfo(buf, TRUE, TRUE); if (wip != NULL && wip->wi_win != NULL && wip->wi_win != curwin && wip->wi_win->w_buffer == buf) { - /* The buffer is currently displayed in the window: use the actual - * option values instead of the saved (possibly outdated) values. */ + // The buffer is currently displayed in the window: use the actual + // option values instead of the saved (possibly outdated) values. win_T *wp = wip->wi_win; copy_winopt(&wp->w_onebuf_opt, &curwin->w_onebuf_opt); @@ -3009,7 +3183,7 @@ get_winopts(buf_T *buf) } else if (wip != NULL && wip->wi_optset) { - /* the buffer was displayed in the current window earlier */ + // the buffer was displayed in the current window earlier copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt); #ifdef FEAT_FOLDING curwin->w_fold_manual = wip->wi_fold_manual; @@ -3019,9 +3193,11 @@ get_winopts(buf_T *buf) } else copy_winopt(&curwin->w_allbuf_opt, &curwin->w_onebuf_opt); + if (wip != NULL) + curwin->w_changelistidx = wip->wi_changelistidx; #ifdef FEAT_FOLDING - /* Set 'foldlevel' to 'foldlevelstart' if it's not negative. */ + // Set 'foldlevel' to 'foldlevelstart' if it's not negative. if (p_fdls >= 0) curwin->w_p_fdl = p_fdls; #endif @@ -3039,7 +3215,7 @@ buflist_findfpos(buf_T *buf) wininfo_T *wip; static pos_T no_position = {1, 0, 0}; - wip = find_wininfo(buf, FALSE); + wip = find_wininfo(buf, FALSE, FALSE); if (wip != NULL) return &(wip->wi_fpos); else @@ -3078,7 +3254,7 @@ buflist_list(exarg_T *eap) if (vim_strchr(eap->arg, 't')) { ga_init2(&buflist, sizeof(buf_T *), 50); - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) { if (ga_grow(&buflist, 1) == OK) ((buf_T **)buflist.ga_data)[buflist.ga_len++] = buf; @@ -3087,11 +3263,12 @@ buflist_list(exarg_T *eap) qsort(buflist.ga_data, (size_t)buflist.ga_len, sizeof(buf_T *), buf_compare); - p = buflist_data = (buf_T **)buflist.ga_data; - buf = *p; + buflist_data = (buf_T **)buflist.ga_data; + buf = *buflist_data; } + p = buflist_data; - for (; buf != NULL && !got_int; buf = buflist_data + for (; buf != NULL && !got_int; buf = buflist_data != NULL ? (++p < buflist_data + buflist.ga_len ? *p : NULL) : buf->b_next) #else @@ -3100,9 +3277,9 @@ buflist_list(exarg_T *eap) { #ifdef FEAT_TERMINAL job_running = term_job_running(buf->b_term); - job_none_open = job_running && term_none_open(buf->b_term); + job_none_open = term_none_open(buf->b_term); #endif - /* skip unlisted buffers, unless ! was used */ + // skip unlisted buffers, unless ! was used if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u')) || (vim_strchr(eap->arg, 'u') && buf->b_p_bl) || (vim_strchr(eap->arg, '+') @@ -3136,14 +3313,14 @@ buflist_list(exarg_T *eap) changed_char = (buf->b_flags & BF_READERR) ? 'x' : (bufIsChanged(buf) ? '+' : ' '); #ifdef FEAT_TERMINAL - if (term_job_running(buf->b_term)) + if (job_running) { - if (term_none_open(buf->b_term)) + if (job_none_open) ro_char = '?'; else ro_char = 'R'; - changed_char = ' '; /* bufIsChanged() returns TRUE to avoid - * closing, but it's not actually changed. */ + changed_char = ' '; // bufIsChanged() returns TRUE to avoid + // closing, but it's not actually changed. } else if (buf->b_term != NULL) ro_char = 'F'; @@ -3165,7 +3342,7 @@ buflist_list(exarg_T *eap) if (len > IOSIZE - 20) len = IOSIZE - 20; - /* put "line 999" in column 40 or after the file name */ + // put "line 999" in column 40 or after the file name i = 40 - vim_strsize(IObuff); do IObuff[len++] = ' '; @@ -3179,7 +3356,7 @@ buflist_list(exarg_T *eap) _("line %ld"), buf == curbuf ? curwin->w_cursor.lnum : (long)buflist_findlnum(buf)); msg_outtrans(IObuff); - out_flush(); /* output one line at a time */ + out_flush(); // output one line at a time ui_breakcheck(); } @@ -3225,7 +3402,7 @@ setfname( buf_T *buf, char_u *ffname_arg, char_u *sfname_arg, - int message) /* give message when buffer already exists */ + int message) // give message when buffer already exists { char_u *ffname = ffname_arg; char_u *sfname = sfname_arg; @@ -3236,7 +3413,7 @@ setfname( if (ffname == NULL || *ffname == NUL) { - /* Removing the name. */ + // Removing the name. if (buf->b_sfname != buf->b_ffname) VIM_CLEAR(buf->b_sfname); else @@ -3248,12 +3425,12 @@ setfname( } else { - fname_expand(buf, &ffname, &sfname); /* will allocate ffname */ - if (ffname == NULL) /* out of memory */ + fname_expand(buf, &ffname, &sfname); // will allocate ffname + if (ffname == NULL) // out of memory return FAIL; /* - * if the file name is already used in another buffer: + * If the file name is already used in another buffer: * - if the buffer is loaded, fail * - if the buffer is not loaded, delete it from the list */ @@ -3269,15 +3446,25 @@ setfname( #endif if (obuf != NULL && obuf != buf) { - if (obuf->b_ml.ml_mfp != NULL) /* it's loaded, fail */ + win_T *win; + tabpage_T *tab; + int in_use = FALSE; + + // during startup a window may use a buffer that is not loaded yet + FOR_ALL_TAB_WINDOWS(tab, win) + if (win->w_buffer == obuf) + in_use = TRUE; + + // it's loaded or used in a window, fail + if (obuf->b_ml.ml_mfp != NULL || in_use) { if (message) - emsg(_("E95: Buffer with this name already exists")); + emsg(_(e_buffer_with_this_name_already_exists)); vim_free(ffname); return FAIL; } - /* delete from the list */ - close_buffer(NULL, obuf, DOBUF_WIPE, FALSE); + // delete from the list + close_buffer(NULL, obuf, DOBUF_WIPE, FALSE, FALSE); } sfname = vim_strsave(sfname); if (ffname == NULL || sfname == NULL) @@ -3287,7 +3474,7 @@ setfname( return FAIL; } #ifdef USE_FNAME_CASE - fname_case(sfname, 0); /* set correct case for short file name */ + fname_case(sfname, 0); // set correct case for short file name #endif if (buf->b_sfname != buf->b_ffname) vim_free(buf->b_sfname); @@ -3330,8 +3517,8 @@ buf_set_name(int fnum, char_u *name) vim_free(buf->b_ffname); buf->b_ffname = vim_strsave(name); buf->b_sfname = NULL; - /* Allocate ffname and expand into full path. Also resolves .lnk - * files on Win32. */ + // Allocate ffname and expand into full path. Also resolves .lnk + // files on Win32. fname_expand(buf, &buf->b_ffname, &buf->b_sfname); buf->b_fname = buf->b_sfname; } @@ -3350,14 +3537,17 @@ buf_name_changed(buf_T *buf) if (buf->b_ml.ml_mfp != NULL) ml_setname(buf); - if (curwin->w_buffer == buf) - check_arg_idx(curwin); /* check file name for arg list */ -#ifdef FEAT_TITLE - maketitle(); /* set window title */ +#ifdef FEAT_TERMINAL + if (buf->b_term != NULL) + term_clear_status_text(buf->b_term); #endif - status_redraw_all(); /* status lines need to be redrawn */ - fmarks_check_names(buf); /* check named file marks */ - ml_timestamp(buf); /* reset timestamp */ + + if (curwin->w_buffer == buf) + check_arg_idx(curwin); // check file name for arg list + maketitle(); // set window title + status_redraw_all(); // status lines need to be redrawn + fmarks_check_names(buf); // check named file marks + ml_timestamp(buf); // reset timestamp } /* @@ -3374,9 +3564,9 @@ setaltfname( { buf_T *buf; - /* Create a buffer. 'buflisted' is not set if it's a new buffer */ + // Create a buffer. 'buflisted' is not set if it's a new buffer buf = buflist_new(ffname, sfname, lnum, 0); - if (buf != NULL && !cmdmod.keepalt) + if (buf != NULL && (cmdmod.cmod_flags & CMOD_KEEPALT) == 0) curwin->w_alt_fnum = buf->b_fnum; return buf; } @@ -3387,7 +3577,7 @@ setaltfname( */ char_u * getaltfname( - int errmsg) /* give error message */ + int errmsg) // give error message { char_u *fname; linenr_T dummy; @@ -3395,7 +3585,7 @@ getaltfname( if (buflist_name_nr(0, &fname, &dummy) == FAIL) { if (errmsg) - emsg(_(e_noalt)); + emsg(_(e_no_alternate_file)); return NULL; } return fname; @@ -3470,7 +3660,7 @@ otherfile_buf( #endif ) { - /* no name is different */ + // no name is different if (ffname == NULL || *ffname == NUL || buf->b_ffname == NULL) return TRUE; if (fnamecmp(ffname, buf->b_ffname) == 0) @@ -3479,22 +3669,22 @@ otherfile_buf( { stat_T st; - /* If no stat_T given, get it now */ + // If no stat_T given, get it now if (stp == NULL) { if (!buf->b_dev_valid || mch_stat((char *)ffname, &st) < 0) st.st_dev = (dev_T)-1; stp = &st; } - /* Use dev/ino to check if the files are the same, even when the names - * are different (possible with links). Still need to compare the - * name above, for when the file doesn't exist yet. - * Problem: The dev/ino changes when a file is deleted (and created - * again) and remains the same when renamed/moved. We don't want to - * mch_stat() each buffer each time, that would be too slow. Get the - * dev/ino again when they appear to match, but not when they appear - * to be different: Could skip a buffer when it's actually the same - * file. */ + // Use dev/ino to check if the files are the same, even when the names + // are different (possible with links). Still need to compare the + // name above, for when the file doesn't exist yet. + // Problem: The dev/ino changes when a file is deleted (and created + // again) and remains the same when renamed/moved. We don't want to + // mch_stat() each buffer each time, that would be too slow. Get the + // dev/ino again when they appear to match, but not when they appear + // to be different: Could skip a buffer when it's actually the same + // file. if (buf_same_ino(buf, stp)) { buf_setino(buf); @@ -3545,7 +3735,7 @@ buf_same_ino( */ void fileinfo( - int fullname, /* when non-zero print full path */ + int fullname, // when non-zero print full path int shorthelp, int dont_truncate) { @@ -3559,7 +3749,7 @@ fileinfo( if (buffer == NULL) return; - if (fullname > 1) /* 2 CTRL-G: include buffer number */ + if (fullname > 1) // 2 CTRL-G: include buffer number { vim_snprintf(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); p = buffer + STRLEN(buffer); @@ -3592,15 +3782,15 @@ fileinfo( #ifdef FEAT_QUICKFIX && !bt_dontwrite(curbuf) #endif - ? _("[New file]") : "", + ? new_file_message() : "", (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "", curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]") : _("[readonly]")) : "", (curbufIsChanged() || (curbuf->b_flags & BF_WRITE_MASK) || curbuf->b_p_ro) ? " " : ""); - /* With 32 bit longs and more than 21,474,836 lines multiplying by 100 - * causes an overflow, thus for large numbers divide instead. */ + // With 32 bit longs and more than 21,474,836 lines multiplying by 100 + // causes an overflow, thus for large numbers divide instead. if (curwin->w_cursor.lnum > 1000000L) n = (int)(((long)curwin->w_cursor.lnum) / ((long)curbuf->b_ml.ml_line_count / 100L)); @@ -3611,7 +3801,7 @@ fileinfo( vim_snprintf_add(buffer, IOSIZE, "%s", _(no_lines_msg)); #ifdef FEAT_CMDL_INFO else if (p_ru) - /* Current line and column are already on the screen -- webb */ + // Current line and column are already on the screen -- webb vim_snprintf_add(buffer, IOSIZE, NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--", curbuf->b_ml.ml_line_count), @@ -3635,8 +3825,8 @@ fileinfo( if (dont_truncate) { - /* Temporarily set msg_scroll to avoid the message being truncated. - * First call msg_start() to get the message in the right place. */ + // Temporarily set msg_scroll to avoid the message being truncated. + // First call msg_start() to get the message in the right place. msg_start(); n = msg_scroll; msg_scroll = TRUE; @@ -3645,13 +3835,13 @@ fileinfo( } else { - p = (char *)msg_trunc_attr(buffer, FALSE, 0); + p = msg_trunc_attr(buffer, FALSE, 0); if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) - /* Need to repeat the message after redrawing when: - * - When restart_edit is set (otherwise there will be a delay - * before redrawing). - * - When the screen was scrolled but there is no wait-return - * prompt. */ + // Need to repeat the message after redrawing when: + // - When restart_edit is set (otherwise there will be a delay + // before redrawing). + // - When the screen was scrolled but there is no wait-return + // prompt. set_keep_msg((char_u *)p, 0); } @@ -3671,7 +3861,6 @@ col_print( vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); } -#if defined(FEAT_TITLE) || defined(PROTO) static __thread char_u *lasttitle = NULL; static __thread char_u *lasticon = NULL; @@ -3692,7 +3881,7 @@ maketitle(void) if (!redrawing()) { - /* Postpone updating the title when 'lazyredraw' is set. */ + // Postpone updating the title when 'lazyredraw' is set. need_maketitle = TRUE; return; } @@ -3717,19 +3906,17 @@ maketitle(void) if (stl_syntax & STL_IN_TITLE) { int use_sandbox = FALSE; - int save_called_emsg = called_emsg; + int called_emsg_before = called_emsg; # ifdef FEAT_EVAL use_sandbox = was_set_insecurely((char_u *)"titlestring", 0); # endif - called_emsg = FALSE; build_stl_str_hl(curwin, title_str, sizeof(buf), p_titlestring, use_sandbox, 0, maxlen, NULL, NULL); - if (called_emsg) + if (called_emsg > called_emsg_before) set_string_option_direct((char_u *)"titlestring", -1, (char_u *)"", OPT_FREE, SID_ERROR); - called_emsg |= save_called_emsg; } else #endif @@ -3737,11 +3924,11 @@ maketitle(void) } else { - /* format: "fname + (path) (1 of 2) - VIM" */ + // format: "fname + (path) (1 of 2) - VIM" #define SPACE_FOR_FNAME (IOSIZE - 100) #define SPACE_FOR_DIR (IOSIZE - 20) -#define SPACE_FOR_ARGNR (IOSIZE - 10) /* at least room for " - VIM" */ +#define SPACE_FOR_ARGNR (IOSIZE - 10) // at least room for " - VIM" if (curbuf->b_fname == NULL) vim_strncpy(buf, (char_u *)_("[No Name]"), SPACE_FOR_FNAME); #ifdef FEAT_TERMINAL @@ -3780,31 +3967,31 @@ maketitle(void) #endif ) { - /* Get path of file, replace home dir with ~ */ + // Get path of file, replace home dir with ~ off = (int)STRLEN(buf); buf[off++] = ' '; buf[off++] = '('; home_replace(curbuf, curbuf->b_ffname, buf + off, SPACE_FOR_DIR - off, TRUE); #ifdef BACKSLASH_IN_FILENAME - /* avoid "c:/name" to be reduced to "c" */ + // avoid "c:/name" to be reduced to "c" if (isalpha(buf[off]) && buf[off + 1] == ':') off += 2; #endif - /* remove the file name */ + // remove the file name p = gettail_sep(buf + off); if (p == buf + off) { - /* must be a help buffer */ + // must be a help buffer vim_strncpy(buf + off, (char_u *)_("help"), (size_t)(SPACE_FOR_DIR - off - 1)); } else *p = NUL; - /* Translate unprintable chars and concatenate. Keep some - * room for the server name. When there is no room (very long - * file name) use (...). */ + // Translate unprintable chars and concatenate. Keep some + // room for the server name. When there is no room (very long + // file name) use (...). if (off < SPACE_FOR_DIR) { p = transstr(buf + off); @@ -3833,7 +4020,7 @@ maketitle(void) if (maxlen > 0) { - /* make it shorter by removing a bit in the middle */ + // make it shorter by removing a bit in the middle if (vim_strsize(buf) > maxlen) trunc_string(buf, buf, maxlen, IOSIZE); } @@ -3850,19 +4037,17 @@ maketitle(void) if (stl_syntax & STL_IN_ICON) { int use_sandbox = FALSE; - int save_called_emsg = called_emsg; + int called_emsg_before = called_emsg; # ifdef FEAT_EVAL use_sandbox = was_set_insecurely((char_u *)"iconstring", 0); # endif - called_emsg = FALSE; build_stl_str_hl(curwin, icon_str, sizeof(buf), p_iconstring, use_sandbox, 0, 0, NULL, NULL); - if (called_emsg) + if (called_emsg > called_emsg_before) set_string_option_direct((char_u *)"iconstring", -1, (char_u *)"", OPT_FREE, SID_ERROR); - called_emsg |= save_called_emsg; } else #endif @@ -3872,10 +4057,10 @@ maketitle(void) { if (buf_spname(curbuf) != NULL) p = buf_spname(curbuf); - else /* use file name only in icon */ + else // use file name only in icon p = gettail(curbuf->b_ffname); *icon_str = NUL; - /* Truncate name at 100 bytes. */ + // Truncate name at 100 bytes. len = (int)STRLEN(p); if (len > 100) { @@ -3948,9 +4133,34 @@ free_titles(void) } # endif -#endif /* FEAT_TITLE */ #if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO) + +/* + * Used for building in the status line. + */ +typedef struct +{ + char_u *stl_start; + int stl_minwid; + int stl_maxwid; + enum { + Normal, + Empty, + Group, + Middle, + Highlight, + TabPage, + Trunc + } stl_type; +} stl_item_T; + +static size_t stl_items_len = 20; // Initial value, grows as needed. +static stl_item_T *stl_items = NULL; +static int *stl_groupitem = NULL; +static stl_hlrec_T *stl_hltab = NULL; +static stl_hlrec_T *stl_tabtab = NULL; + /* * Build a string from the status line items in "fmt". * Return length of string in screen cells. @@ -3968,14 +4178,14 @@ free_titles(void) int build_stl_str_hl( win_T *wp, - char_u *out, /* buffer to write into != NameBuff */ - size_t outlen, /* length of out[] */ + char_u *out, // buffer to write into != NameBuff + size_t outlen, // length of out[] char_u *fmt, - int use_sandbox UNUSED, /* "fmt" was set insecurely, use sandbox */ + int use_sandbox UNUSED, // "fmt" was set insecurely, use sandbox int fillchar, int maxwidth, - struct stl_hlrec *hltab, /* return: HL attributes (can be NULL) */ - struct stl_hlrec *tabtab) /* return: tab page nrs (can be NULL) */ + stl_hlrec_T **hltab, // return: HL attributes (can be NULL) + stl_hlrec_T **tabtab) // return: tab page nrs (can be NULL) { linenr_T lnum; size_t len; @@ -3986,6 +4196,7 @@ build_stl_str_hl( #ifdef FEAT_EVAL win_T *save_curwin; buf_T *save_curbuf; + int save_VIsual_active; #endif int empty_line; colnr_T virtcol; @@ -4002,24 +4213,10 @@ build_stl_str_hl( int curitem; int group_end_userhl; int group_start_userhl; - int groupitem[STL_MAX_ITEM]; int groupdepth; - struct stl_item - { - char_u *start; - int minwid; - int maxwid; - enum - { - Normal, - Empty, - Group, - Middle, - Highlight, - TabPage, - Trunc - } type; - } item[STL_MAX_ITEM]; +#ifdef FEAT_EVAL + int evaldepth; +#endif int minwid; int maxwid; int zeropad; @@ -4029,9 +4226,21 @@ build_stl_str_hl( char_u buf_tmp[TMPLEN]; char_u win_tmp[TMPLEN]; char_u *usefmt = fmt; - struct stl_hlrec *sp; + stl_hlrec_T *sp; int save_must_redraw = must_redraw; int save_redr_type = curwin->w_redr_type; + int save_KeyTyped = KeyTyped; + + if (stl_items == NULL) + { + stl_items = ALLOC_MULT(stl_item_T, stl_items_len); + stl_groupitem = ALLOC_MULT(int, stl_items_len); + + // Allocate one more, because the last element is used to indicate the + // end of the list. + stl_hltab = ALLOC_MULT(stl_hlrec_T, stl_items_len + 1); + stl_tabtab = ALLOC_MULT(stl_hlrec_T, stl_items_len + 1); + } #ifdef FEAT_EVAL /* @@ -4046,7 +4255,7 @@ build_stl_str_hl( tv.vval.v_number = wp->w_id; set_var((char_u *)"g:statusline_winid", &tv, FALSE); - usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox); + usefmt = eval_to_string_safe(fmt + 2, use_sandbox, FALSE); if (usefmt == NULL) usefmt = fmt; @@ -4056,9 +4265,6 @@ build_stl_str_hl( if (fillchar == 0) fillchar = ' '; - /* Can't handle a multi-byte fill character yet. */ - else if (mb_char2len(fillchar) > 1) - fillchar = '-'; // The cursor in windows other than the current one isn't always // up-to-date, esp. because of autocommands and timers. @@ -4089,22 +4295,41 @@ build_stl_str_hl( byteval = (*mb_ptr2char)(p + wp->w_cursor.col); groupdepth = 0; +#ifdef FEAT_EVAL + evaldepth = 0; +#endif p = out; curitem = 0; prevchar_isflag = TRUE; prevchar_isitem = FALSE; for (s = usefmt; *s; ) { - if (curitem == STL_MAX_ITEM) + if (curitem == (int)stl_items_len) { - /* There are too many items. Add the error code to the statusline - * to give the user a hint about what went wrong. */ - if (p + 6 < out + outlen) - { - mch_memmove(p, " E541", (size_t)5); - p += 5; - } - break; + size_t new_len = stl_items_len * 3 / 2; + stl_item_T *new_items; + int *new_groupitem; + stl_hlrec_T *new_hlrec; + + new_items = vim_realloc(stl_items, sizeof(stl_item_T) * new_len); + if (new_items == NULL) + break; + stl_items = new_items; + new_groupitem = vim_realloc(stl_groupitem, sizeof(int) * new_len); + if (new_groupitem == NULL) + break; + stl_groupitem = new_groupitem; + new_hlrec = vim_realloc(stl_hltab, + sizeof(stl_hlrec_T) * (new_len + 1)); + if (new_hlrec == NULL) + break; + stl_hltab = new_hlrec; + new_hlrec = vim_realloc(stl_tabtab, + sizeof(stl_hlrec_T) * (new_len + 1)); + if (new_hlrec == NULL) + break; + stl_tabtab = new_hlrec; + stl_items_len = new_len; } if (*s != NUL && *s != '%') @@ -4122,7 +4347,7 @@ build_stl_str_hl( * Handle one '%' item. */ s++; - if (*s == NUL) /* ignore trailing % */ + if (*s == NUL) // ignore trailing % break; if (*s == '%') { @@ -4137,15 +4362,15 @@ build_stl_str_hl( s++; if (groupdepth > 0) continue; - item[curitem].type = Middle; - item[curitem++].start = p; + stl_items[curitem].stl_type = Middle; + stl_items[curitem++].stl_start = p; continue; } if (*s == STL_TRUNCMARK) { s++; - item[curitem].type = Trunc; - item[curitem++].start = p; + stl_items[curitem].stl_type = Trunc; + stl_items[curitem++].stl_start = p; continue; } if (*s == ')') @@ -4155,91 +4380,105 @@ build_stl_str_hl( continue; groupdepth--; - t = item[groupitem[groupdepth]].start; + t = stl_items[stl_groupitem[groupdepth]].stl_start; *p = NUL; l = vim_strsize(t); - if (curitem > groupitem[groupdepth] + 1 - && item[groupitem[groupdepth]].minwid == 0) + if (curitem > stl_groupitem[groupdepth] + 1 + && stl_items[stl_groupitem[groupdepth]].stl_minwid == 0) { - /* remove group if all items are empty and highlight group - * doesn't change */ + // remove group if all items are empty and highlight group + // doesn't change group_start_userhl = group_end_userhl = 0; - for (n = groupitem[groupdepth] - 1; n >= 0; n--) + for (n = stl_groupitem[groupdepth] - 1; n >= 0; n--) { - if (item[n].type == Highlight) + if (stl_items[n].stl_type == Highlight) { - group_start_userhl = group_end_userhl = item[n].minwid; + group_start_userhl = group_end_userhl = + stl_items[n].stl_minwid; break; } } - for (n = groupitem[groupdepth] + 1; n < curitem; n++) + for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++) { - if (item[n].type == Normal) + if (stl_items[n].stl_type == Normal) break; - if (item[n].type == Highlight) - group_end_userhl = item[n].minwid; + if (stl_items[n].stl_type == Highlight) + group_end_userhl = stl_items[n].stl_minwid; } if (n == curitem && group_start_userhl == group_end_userhl) { + // empty group p = t; l = 0; + for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++) + { + // do not use the highlighting from the removed group + if (stl_items[n].stl_type == Highlight) + stl_items[n].stl_type = Empty; + // adjust the start position of TabPage to the next + // item position + if (stl_items[n].stl_type == TabPage) + stl_items[n].stl_start = p; + } } } - if (l > item[groupitem[groupdepth]].maxwid) + if (l > stl_items[stl_groupitem[groupdepth]].stl_maxwid) { - /* truncate, remove n bytes of text at the start */ + // truncate, remove n bytes of text at the start if (has_mbyte) { - /* Find the first character that should be included. */ + // Find the first character that should be included. n = 0; - while (l >= item[groupitem[groupdepth]].maxwid) + while (l >= stl_items[stl_groupitem[groupdepth]].stl_maxwid) { l -= ptr2cells(t + n); n += (*mb_ptr2len)(t + n); } } else - n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1; + n = (long)(p - t) - stl_items[stl_groupitem[groupdepth]] + .stl_maxwid + 1; *t = '<'; mch_memmove(t + 1, t + n, (size_t)(p - (t + n))); p = p - n + 1; // Fill up space left over by half a double-wide char. - while (++l < item[groupitem[groupdepth]].minwid) - *p++ = fillchar; + while (++l < stl_items[stl_groupitem[groupdepth]].stl_minwid) + MB_CHAR2BYTES(fillchar, p); - /* correct the start of the items for the truncation */ - for (l = groupitem[groupdepth] + 1; l < curitem; l++) + // correct the start of the items for the truncation + for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++) { - item[l].start -= n; - if (item[l].start < t) - item[l].start = t; + // Minus one for the leading '<' added above. + stl_items[l].stl_start -= n - 1; + if (stl_items[l].stl_start < t) + stl_items[l].stl_start = t; } } - else if (abs(item[groupitem[groupdepth]].minwid) > l) + else if (abs(stl_items[stl_groupitem[groupdepth]].stl_minwid) > l) { - /* fill */ - n = item[groupitem[groupdepth]].minwid; + // fill + n = stl_items[stl_groupitem[groupdepth]].stl_minwid; if (n < 0) { - /* fill by appending characters */ + // fill by appending characters n = 0 - n; while (l++ < n && p + 1 < out + outlen) - *p++ = fillchar; + MB_CHAR2BYTES(fillchar, p); } else { - /* fill by inserting characters */ - mch_memmove(t + n - l, t, (size_t)(p - t)); - l = n - l; + // fill by inserting characters + l = (n - l) * MB_CHAR2LEN(fillchar); + mch_memmove(t + l, t, (size_t)(p - t)); if (p + l >= out + outlen) l = (long)((out + outlen) - p - 1); p += l; - for (n = groupitem[groupdepth] + 1; n < curitem; n++) - item[n].start += l; + for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++) + stl_items[n].stl_start += l; for ( ; l > 0; l--) - *t++ = fillchar; + MB_CHAR2BYTES(fillchar, t); } } continue; @@ -4261,14 +4500,14 @@ build_stl_str_hl( if (VIM_ISDIGIT(*s)) { minwid = (int)getdigits(&s); - if (minwid < 0) /* overflow */ + if (minwid < 0) // overflow minwid = 0; } if (*s == STL_USER_HL) { - item[curitem].type = Highlight; - item[curitem].start = p; - item[curitem].minwid = minwid > 9 ? 1 : minwid; + stl_items[curitem].stl_type = Highlight; + stl_items[curitem].stl_start = p; + stl_items[curitem].stl_minwid = minwid > 9 ? 1 : minwid; s++; curitem++; continue; @@ -4279,22 +4518,23 @@ build_stl_str_hl( { if (minwid == 0) { - /* %X ends the close label, go back to the previously - * define tab label nr. */ + // %X ends the close label, go back to the previously + // define tab label nr. for (n = curitem - 1; n >= 0; --n) - if (item[n].type == TabPage && item[n].minwid >= 0) + if (stl_items[n].stl_type == TabPage + && stl_items[n].stl_minwid >= 0) { - minwid = item[n].minwid; + minwid = stl_items[n].stl_minwid; break; } } else - /* close nrs are stored as negative values */ + // close nrs are stored as negative values minwid = - minwid; } - item[curitem].type = TabPage; - item[curitem].start = p; - item[curitem].minwid = minwid; + stl_items[curitem].stl_type = TabPage; + stl_items[curitem].stl_start = p; + stl_items[curitem].stl_minwid = minwid; s++; curitem++; continue; @@ -4305,22 +4545,31 @@ build_stl_str_hl( if (VIM_ISDIGIT(*s)) { maxwid = (int)getdigits(&s); - if (maxwid <= 0) /* overflow */ + if (maxwid <= 0) // overflow maxwid = 50; } } minwid = (minwid > 50 ? 50 : minwid) * l; if (*s == '(') { - groupitem[groupdepth++] = curitem; - item[curitem].type = Group; - item[curitem].start = p; - item[curitem].minwid = minwid; - item[curitem].maxwid = maxwid; + stl_groupitem[groupdepth++] = curitem; + stl_items[curitem].stl_type = Group; + stl_items[curitem].stl_start = p; + stl_items[curitem].stl_minwid = minwid; + stl_items[curitem].stl_maxwid = maxwid; s++; curitem++; continue; } +#ifdef FEAT_EVAL + // Denotes end of expanded %{} block + if (*s == '}' && evaldepth > 0) + { + s++; + evaldepth--; + continue; + } +#endif if (vim_strchr(STL_ALL, *s) == NULL) { s++; @@ -4328,7 +4577,7 @@ build_stl_str_hl( } opt = *s++; - /* OK - now for the real work */ + // OK - now for the real work base = 'D'; itemisflag = FALSE; fillable = TRUE; @@ -4339,7 +4588,7 @@ build_stl_str_hl( case STL_FILEPATH: case STL_FULLPATH: case STL_FILENAME: - fillable = FALSE; /* don't change ' ' to fillchar */ + fillable = FALSE; // don't change ' ' to fillchar if (buf_spname(wp->w_buffer) != NULL) vim_strncpy(NameBuff, buf_spname(wp->w_buffer), MAXPATHL - 1); else @@ -4355,17 +4604,28 @@ build_stl_str_hl( str = gettail(NameBuff); break; - case STL_VIM_EXPR: /* '{' */ + case STL_VIM_EXPR: // '{' + { +#ifdef FEAT_EVAL + char_u *block_start = s - 1; +#endif + int reevaluate = (*s == '%'); + + if (reevaluate) + s++; itemisflag = TRUE; t = p; - while (*s != '}' && *s != NUL && p + 1 < out + outlen) + while ((*s != '}' || (reevaluate && s[-1] != '%')) + && *s != NUL && p + 1 < out + outlen) *p++ = *s++; - if (*s != '}') /* missing '}' or out of space */ + if (*s != '}') // missing '}' or out of space break; s++; - *p = 0; + if (reevaluate) + p[-1] = 0; // remove the % at the end of %{% expr %} + else + *p = 0; p = t; - #ifdef FEAT_EVAL vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), "%d", curbuf->b_fnum); @@ -4375,13 +4635,18 @@ build_stl_str_hl( save_curbuf = curbuf; save_curwin = curwin; + save_VIsual_active = VIsual_active; curwin = wp; curbuf = wp->w_buffer; + // Visual mode is only valid in the current window. + if (curwin != save_curwin) + VIsual_active = FALSE; - str = eval_to_string_safe(p, &t, use_sandbox); + str = eval_to_string_safe(p, use_sandbox, FALSE); curwin = save_curwin; curbuf = save_curbuf; + VIsual_active = save_VIsual_active; do_unlet((char_u *)"g:actual_curbuf", TRUE); do_unlet((char_u *)"g:actual_curwin", TRUE); @@ -4394,9 +4659,42 @@ build_stl_str_hl( itemisflag = FALSE; } } + + // If the output of the expression needs to be evaluated + // replace the %{} block with the result of evaluation + if (reevaluate && str != NULL && *str != 0 + && strchr((const char *)str, '%') != NULL + && evaldepth < MAX_STL_EVAL_DEPTH) + { + size_t parsed_usefmt = (size_t)(block_start - usefmt); + size_t str_length = strlen((const char *)str); + size_t fmt_length = strlen((const char *)s); + size_t new_fmt_len = parsed_usefmt + + str_length + fmt_length + 3; + char_u *new_fmt = (char_u *)alloc(new_fmt_len * sizeof(char_u)); + char_u *new_fmt_p = new_fmt; + + new_fmt_p = (char_u *)memcpy(new_fmt_p, usefmt, parsed_usefmt) + + parsed_usefmt; + new_fmt_p = (char_u *)memcpy(new_fmt_p , str, str_length) + + str_length; + new_fmt_p = (char_u *)memcpy(new_fmt_p, "%}", 2) + 2; + new_fmt_p = (char_u *)memcpy(new_fmt_p , s, fmt_length) + + fmt_length; + *new_fmt_p = 0; + new_fmt_p = NULL; + + if (usefmt != fmt) + vim_free(usefmt); + VIM_CLEAR(str); + usefmt = new_fmt; + s = usefmt + parsed_usefmt; + evaldepth++; + continue; + } #endif break; - + } case STL_LINE: num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) ? 0L : (long)(wp->w_cursor.lnum); @@ -4407,25 +4705,17 @@ build_stl_str_hl( break; case STL_COLUMN: - num = !(State & INSERT) && empty_line - ? 0 : (int)wp->w_cursor.col + 1; + num = (State & MODE_INSERT) == 0 && empty_line + ? 0 : (int)wp->w_cursor.col + 1; break; case STL_VIRTCOL: case STL_VIRTCOL_ALT: - /* In list mode virtcol needs to be recomputed */ - virtcol = wp->w_virtcol; - if (wp->w_p_list && lcs_tab1 == NUL) - { - wp->w_p_list = FALSE; - getvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL); - wp->w_p_list = TRUE; - } - ++virtcol; - /* Don't display %V if it's the same as %c. */ + virtcol = wp->w_virtcol + 1; + // Don't display %V if it's the same as %c. if (opt == STL_VIRTCOL_ALT - && (virtcol == (colnr_T)(!(State & INSERT) && empty_line - ? 0 : (int)wp->w_cursor.col + 1))) + && (virtcol == (colnr_T)((State & MODE_INSERT) == 0 + && empty_line ? 0 : (int)wp->w_cursor.col + 1))) break; num = (long)virtcol; break; @@ -4466,19 +4756,19 @@ build_stl_str_hl( case STL_OFFSET_X: base = 'X'; - /* FALLTHROUGH */ + // FALLTHROUGH case STL_OFFSET: #ifdef FEAT_BYTEOFF l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL); - num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) || l < 0 ? - 0L : l + 1 + (!(State & INSERT) && empty_line ? - 0 : (int)wp->w_cursor.col); + num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) || l < 0 + ? 0L : l + 1 + ((State & MODE_INSERT) == 0 && empty_line + ? 0 : (int)wp->w_cursor.col); #endif break; case STL_BYTEVAL_X: base = 'X'; - /* FALLTHROUGH */ + // FALLTHROUGH case STL_BYTEVAL: num = byteval; if (num == NL) @@ -4564,9 +4854,9 @@ build_stl_str_hl( ++s; if (*s == '#') { - item[curitem].type = Highlight; - item[curitem].start = p; - item[curitem].minwid = -syn_namen2id(t, (int)(s - t)); + stl_items[curitem].stl_type = Highlight; + stl_items[curitem].stl_start = p; + stl_items[curitem].stl_minwid = -syn_namen2id(t, (int)(s - t)); curitem++; } if (*s != NUL) @@ -4574,8 +4864,8 @@ build_stl_str_hl( continue; } - item[curitem].start = p; - item[curitem].type = Normal; + stl_items[curitem].stl_start = p; + stl_items[curitem].stl_type = Normal; if (str != NULL && *str) { t = str; @@ -4608,27 +4898,28 @@ build_stl_str_hl( { for (; l < minwid && p + 1 < out + outlen; l++) { - /* Don't put a "-" in front of a digit. */ + // Don't put a "-" in front of a digit. if (l + 1 == minwid && fillchar == '-' && VIM_ISDIGIT(*t)) *p++ = ' '; else - *p++ = fillchar; + MB_CHAR2BYTES(fillchar, p); } minwid = 0; } else minwid *= -1; - while (*t && p + 1 < out + outlen) + for (; *t && p + 1 < out + outlen; t++) { - *p++ = *t++; - /* Change a space by fillchar, unless fillchar is '-' and a - * digit follows. */ - if (fillable && p[-1] == ' ' - && (!VIM_ISDIGIT(*t) || fillchar != '-')) - p[-1] = fillchar; + // Change a space by fillchar, unless fillchar is '-' and a + // digit follows. + if (fillable && *t == ' ' + && (!VIM_ISDIGIT(*(t + 1)) || fillchar != '-')) + MB_CHAR2BYTES(fillchar, p); + else + *p++ = *t; } for (; l < minwid && p + 1 < out + outlen; l++) - *p++ = fillchar; + MB_CHAR2BYTES(fillchar, p); } else if (num >= 0) { @@ -4636,7 +4927,7 @@ build_stl_str_hl( char_u nstr[20]; if (p + 20 >= out + outlen) - break; /* not sufficient space */ + break; // not sufficient space prevchar_isitem = TRUE; t = nstr; if (opt == STL_VIRTCOL_ALT) @@ -4674,13 +4965,13 @@ build_stl_str_hl( p += STRLEN(p); } else - item[curitem].type = Empty; + stl_items[curitem].stl_type = Empty; if (opt == STL_VIM_EXPR) vim_free(str); if (num >= 0 || (!itemisflag && str && *str)) - prevchar_isflag = FALSE; /* Item not NULL, but not a flag */ + prevchar_isflag = FALSE; // Item not NULL, but not a flag curitem++; } *p = NUL; @@ -4694,30 +4985,30 @@ build_stl_str_hl( width = vim_strsize(out); if (maxwidth > 0 && width > maxwidth) { - /* Result is too long, must truncate somewhere. */ + // Result is too long, must truncate somewhere. l = 0; if (itemcnt == 0) s = out; else { for ( ; l < itemcnt; l++) - if (item[l].type == Trunc) + if (stl_items[l].stl_type == Trunc) { - /* Truncate at %< item. */ - s = item[l].start; + // Truncate at %< item. + s = stl_items[l].stl_start; break; } if (l == itemcnt) { - /* No %< item, truncate first item. */ - s = item[0].start; + // No %< item, truncate first item. + s = stl_items[0].stl_start; l = 0; } } if (width - vim_strsize(s) >= maxwidth) { - /* Truncation mark is beyond max length */ + // Truncation mark is beyond max length if (has_mbyte) { s = out; @@ -4729,14 +5020,14 @@ build_stl_str_hl( break; s += (*mb_ptr2len)(s); } - /* Fill up for half a double-wide character. */ + // Fill up for half a double-wide character. while (++width < maxwidth) - *s++ = fillchar; + MB_CHAR2BYTES(fillchar, s); } else s = out + maxwidth - 1; for (l = 0; l < itemcnt; l++) - if (item[l].start > s) + if (stl_items[l].stl_start > s) break; itemcnt = l; *s++ = '>'; @@ -4759,53 +5050,55 @@ build_stl_str_hl( STRMOVE(s + 1, p); *s = '<'; - /* Fill up for half a double-wide character. */ + // Fill up for half a double-wide character. while (++width < maxwidth) { s = s + STRLEN(s); - *s++ = fillchar; + MB_CHAR2BYTES(fillchar, s); *s = NUL; } - --n; /* count the '<' */ + --n; // count the '<' for (; l < itemcnt; l++) { - if (item[l].start - n >= s) - item[l].start -= n; + if (stl_items[l].stl_start - n >= s) + stl_items[l].stl_start -= n; else - item[l].start = s; + stl_items[l].stl_start = s; } } width = maxwidth; } else if (width < maxwidth && STRLEN(out) + maxwidth - width + 1 < outlen) { - /* Apply STL_MIDDLE if any */ + // Apply STL_MIDDLE if any for (l = 0; l < itemcnt; l++) - if (item[l].type == Middle) + if (stl_items[l].stl_type == Middle) break; if (l < itemcnt) { - p = item[l].start + maxwidth - width; - STRMOVE(p, item[l].start); - for (s = item[l].start; s < p; s++) - *s = fillchar; + int middlelength = (maxwidth - width) * MB_CHAR2LEN(fillchar); + p = stl_items[l].stl_start + middlelength; + STRMOVE(p, stl_items[l].stl_start); + for (s = stl_items[l].stl_start; s < p;) + MB_CHAR2BYTES(fillchar, s); for (l++; l < itemcnt; l++) - item[l].start += maxwidth - width; + stl_items[l].stl_start += middlelength; width = maxwidth; } } - /* Store the info about highlighting. */ + // Store the info about highlighting. if (hltab != NULL) { - sp = hltab; + *hltab = stl_hltab; + sp = stl_hltab; for (l = 0; l < itemcnt; l++) { - if (item[l].type == Highlight) + if (stl_items[l].stl_type == Highlight) { - sp->start = item[l].start; - sp->userhl = item[l].minwid; + sp->start = stl_items[l].stl_start; + sp->userhl = stl_items[l].stl_minwid; sp++; } } @@ -4813,16 +5106,17 @@ build_stl_str_hl( sp->userhl = 0; } - /* Store the info about tab pages labels. */ + // Store the info about tab pages labels. if (tabtab != NULL) { - sp = tabtab; + *tabtab = stl_tabtab; + sp = stl_tabtab; for (l = 0; l < itemcnt; l++) { - if (item[l].type == TabPage) + if (stl_items[l].stl_type == TabPage) { - sp->start = item[l].start; - sp->userhl = item[l].minwid; + sp->start = stl_items[l].stl_start; + sp->userhl = stl_items[l].stl_minwid; sp++; } } @@ -4830,17 +5124,20 @@ build_stl_str_hl( sp->userhl = 0; } - /* When inside update_screen we do not want redrawing a stausline, ruler, - * title, etc. to trigger another redraw, it may cause an endless loop. */ + // When inside update_screen we do not want redrawing a statusline, ruler, + // title, etc. to trigger another redraw, it may cause an endless loop. if (updating_screen) { must_redraw = save_must_redraw; curwin->w_redr_type = save_redr_type; } + // A user function may reset KeyTyped, restore it. + KeyTyped = save_KeyTyped; + return width; } -#endif /* FEAT_STL_OPT */ +#endif // FEAT_STL_OPT #if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \ || defined(FEAT_GUI_TABLINE) || defined(PROTO) @@ -4854,18 +5151,18 @@ get_rel_pos( char_u *buf, int buflen) { - long above; /* number of lines above window */ - long below; /* number of lines below window */ + long above; // number of lines above window + long below; // number of lines below window - if (buflen < 3) /* need at least 3 chars for writing */ + if (buflen < 3) // need at least 3 chars for writing return; above = wp->w_topline - 1; #ifdef FEAT_DIFF above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill; if (wp->w_topline == 1 && wp->w_topfill >= 1) - above = 0; /* All buffer lines are displayed and there is an - * indication of filler lines, that can be considered - * seeing all lines. */ + above = 0; // All buffer lines are displayed and there is an + // indication of filler lines, that can be considered + // seeing all lines. #endif below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; if (below <= 0) @@ -4889,15 +5186,15 @@ append_arg_number( win_T *wp, char_u *buf, int buflen, - int add_file) /* Add "file" before the arg number */ + int add_file) // Add "file" before the arg number { char_u *p; - if (ARGCOUNT <= 1) /* nothing to do */ + if (ARGCOUNT <= 1) // nothing to do return FALSE; - p = buf + STRLEN(buf); /* go to the end of the buffer */ - if (p - buf + 35 >= buflen) /* getting too long */ + p = buf + STRLEN(buf); // go to the end of the buffer + if (p - buf + 35 >= buflen) // getting too long return FALSE; *p++ = ' '; *p++ = '('; @@ -4946,7 +5243,7 @@ fix_fname(char_u *fname) # ifdef USE_FNAME_CASE if (fname != NULL) - fname_case(fname, 0); /* set correct case for file name */ + fname_case(fname, 0); // set correct case for file name # endif return fname; @@ -4959,7 +5256,7 @@ fix_fname(char_u *fname) * When resolving a link both "*sfname" and "*ffname" will point to the same * allocated memory. * The "*ffname" and "*sfname" pointer values on call will not be freed. - * Note that the resulting "*ffname" pointer should be considered not allocaed. + * Note that the resulting "*ffname" pointer should be considered not allocated. */ void fname_expand( @@ -5002,15 +5299,15 @@ ex_buffer_all(exarg_T *eap) int p_ea_save; int open_wins = 0; int r; - int count; /* Maximum number of windows to open. */ - int all; /* When TRUE also load inactive buffers. */ - int had_tab = cmdmod.tab; + int count; // Maximum number of windows to open. + int all; // When TRUE also load inactive buffers. + int had_tab = cmdmod.cmod_tab; tabpage_T *tpnext; - if (eap->addr_count == 0) /* make as many windows as possible */ + if (eap->addr_count == 0) // make as many windows as possible count = 9999; else - count = eap->line2; /* make as many windows as specified */ + count = eap->line2; // make as many windows as specified if (eap->cmdidx == CMD_unhide || eap->cmdidx == CMD_sunhide) all = FALSE; else @@ -5035,24 +5332,28 @@ ex_buffer_all(exarg_T *eap) { wpnext = wp->w_next; if ((wp->w_buffer->b_nwindows > 1 - || ((cmdmod.split & WSP_VERT) - ? wp->w_height + wp->w_status_height < Rows - p_ch - - tabline_height() - : wp->w_width != Columns) - || (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW - && !(wp->w_closing || wp->w_buffer->b_locked > 0)) + || ((cmdmod.cmod_split & WSP_VERT) + ? wp->w_height + wp->w_status_height < Rows - p_ch + - tabline_height() + : wp->w_width != Columns) + || (had_tab > 0 && wp != firstwin)) + && !ONE_WINDOW + && !(wp->w_closing || wp->w_buffer->b_locked > 0) + && !win_unlisted(wp)) { - win_close(wp, FALSE); - wpnext = firstwin; /* just in case an autocommand does - something strange with windows */ - tpnext = first_tabpage; /* start all over... */ + if (win_close(wp, FALSE) == FAIL) + break; + // Just in case an autocommand does something strange with + // windows: start all over... + wpnext = firstwin; + tpnext = first_tabpage; open_wins = 0; } else ++open_wins; } - /* Without the ":tab" modifier only do the current tab page. */ + // Without the ":tab" modifier only do the current tab page. if (had_tab == 0 || tpnext == NULL) break; goto_tabpage_tp(tpnext, TRUE, TRUE); @@ -5063,31 +5364,31 @@ ex_buffer_all(exarg_T *eap) * open one. Otherwise move the window to the right position. * Watch out for autocommands that delete buffers or windows! */ - /* Don't execute Win/Buf Enter/Leave autocommands here. */ + // Don't execute Win/Buf Enter/Leave autocommands here. ++autocmd_no_enter; win_enter(lastwin, FALSE); ++autocmd_no_leave; for (buf = firstbuf; buf != NULL && open_wins < count; buf = buf->b_next) { - /* Check if this buffer needs a window */ + // Check if this buffer needs a window if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl) continue; if (had_tab != 0) { - /* With the ":tab" modifier don't move the window. */ + // With the ":tab" modifier don't move the window. if (buf->b_nwindows > 0) - wp = lastwin; /* buffer has a window, skip it */ + wp = lastwin; // buffer has a window, skip it else wp = NULL; } else { - /* Check if this buffer already has a window */ + // Check if this buffer already has a window FOR_ALL_WINDOWS(wp) if (wp->w_buffer == buf) break; - /* If the buffer already has a window, move it */ + // If the buffer already has a window, move it if (wp != NULL) win_move_after(wp, curwin); } @@ -5098,21 +5399,21 @@ ex_buffer_all(exarg_T *eap) set_bufref(&bufref, buf); - /* Split the window and put the buffer in it */ + // Split the window and put the buffer in it p_ea_save = p_ea; - p_ea = TRUE; /* use space from all windows */ + p_ea = TRUE; // use space from all windows split_ret = win_split(0, WSP_ROOM | WSP_BELOW); ++open_wins; p_ea = p_ea_save; if (split_ret == FAIL) continue; - /* Open the buffer in this window. */ + // Open the buffer in this window. swap_exists_action = SEA_DIALOG; set_curbuf(buf, DOBUF_GOTO); if (!bufref_valid(&bufref)) { - /* autocommands deleted the buffer!!! */ + // autocommands deleted the buffer!!! swap_exists_action = SEA_NONE; break; } @@ -5121,21 +5422,21 @@ ex_buffer_all(exarg_T *eap) #if defined(FEAT_EVAL) cleanup_T cs; - /* Reset the error/interrupt/exception state here so that - * aborting() returns FALSE when closing a window. */ + // Reset the error/interrupt/exception state here so that + // aborting() returns FALSE when closing a window. enter_cleanup(&cs); #endif - /* User selected Quit at ATTENTION prompt; close this window. */ + // User selected Quit at ATTENTION prompt; close this window. win_close(curwin, TRUE); --open_wins; swap_exists_action = SEA_NONE; swap_exists_did_quit = TRUE; #if defined(FEAT_EVAL) - /* Restore the error/interrupt/exception state if not - * discarded by a new aborting error, interrupt, or uncaught - * exception. */ + // Restore the error/interrupt/exception state if not + // discarded by a new aborting error, interrupt, or uncaught + // exception. leave_cleanup(&cs); #endif } @@ -5146,20 +5447,20 @@ ex_buffer_all(exarg_T *eap) ui_breakcheck(); if (got_int) { - (void)vgetc(); /* only break the file loading, not the rest */ + (void)vgetc(); // only break the file loading, not the rest break; } #ifdef FEAT_EVAL - /* Autocommands deleted the buffer or aborted script processing!!! */ + // Autocommands deleted the buffer or aborted script processing!!! if (aborting()) break; #endif - /* When ":tab" was used open a new tab for a new window repeatedly. */ + // When ":tab" was used open a new tab for a new window repeatedly. if (had_tab > 0 && tabpage_index(NULL) <= p_tpm) - cmdmod.tab = 9999; + cmdmod.cmod_tab = 9999; } --autocmd_no_enter; - win_enter(firstwin, FALSE); /* back to first window */ + win_enter(firstwin, FALSE); // back to first window --autocmd_no_leave; /* @@ -5171,7 +5472,7 @@ ex_buffer_all(exarg_T *eap) || autowrite(wp->w_buffer, FALSE) == OK); if (!win_valid(wp)) { - /* BufWrite Autocommands made the window invalid, start over */ + // BufWrite Autocommands made the window invalid, start over wp = lastwin; } else if (r) @@ -5211,25 +5512,25 @@ do_modelines(int flags) if (!curbuf->b_p_ml || (nmlines = (int)p_mls) == 0) return; - /* Disallow recursive entry here. Can happen when executing a modeline - * triggers an autocommand, which reloads modelines with a ":do". */ + // Disallow recursive entry here. Can happen when executing a modeline + // triggers an autocommand, which reloads modelines with a ":do". if (entered) return; ++entered; - for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count && lnum <= nmlines; + for (lnum = 1; curbuf->b_p_ml && lnum <= curbuf->b_ml.ml_line_count && lnum <= nmlines; ++lnum) if (chk_modeline(lnum, flags) == FAIL) nmlines = 0; - for (lnum = curbuf->b_ml.ml_line_count; lnum > 0 && lnum > nmlines + for (lnum = curbuf->b_ml.ml_line_count; curbuf->b_p_ml && lnum > 0 && lnum > nmlines && lnum > curbuf->b_ml.ml_line_count - nmlines; --lnum) if (chk_modeline(lnum, flags) == FAIL) nmlines = 0; --entered; } -#include "version.h" /* for version number */ +#include "version.h" // for version number /* * chk_modeline() - check a single line for a mode string @@ -5238,20 +5539,18 @@ do_modelines(int flags) static int chk_modeline( linenr_T lnum, - int flags) /* Same as for do_modelines(). */ + int flags) // Same as for do_modelines(). { char_u *s; char_u *e; - char_u *linecopy; /* local copy of any modeline found */ + char_u *linecopy; // local copy of any modeline found int prev; int vers; int end; int retval = OK; - char_u *save_sourcing_name; - linenr_T save_sourcing_lnum; -#ifdef FEAT_EVAL sctx_T save_current_sctx; -#endif + + ESTACK_CHECK_DECLARATION prev = -1; for (s = ml_get(lnum); *s != NUL; ++s) @@ -5261,7 +5560,7 @@ chk_modeline( if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0) || STRNCMP(s, "vi:", (size_t)3) == 0) break; - /* Accept both "vim" and "Vim". */ + // Accept both "vim" and "Vim". if ((s[0] == 'v' || s[0] == 'V') && s[1] == 'i' && s[2] == 'm') { if (s[3] == '<' || s[3] == '=' || s[3] == '>') @@ -5285,18 +5584,17 @@ chk_modeline( if (*s) { - do /* skip over "ex:", "vi:" or "vim:" */ + do // skip over "ex:", "vi:" or "vim:" ++s; while (s[-1] != ':'); - s = linecopy = vim_strsave(s); /* copy the line, it will change */ + s = linecopy = vim_strsave(s); // copy the line, it will change if (linecopy == NULL) return FAIL; - save_sourcing_lnum = sourcing_lnum; - save_sourcing_name = sourcing_name; - sourcing_lnum = lnum; /* prepare for emsg() */ - sourcing_name = (char_u *)"modelines"; + // prepare for emsg() + estack_push(ETYPE_MODELINE, (char_u *)"modelines", lnum); + ESTACK_CHECK_SETUP end = FALSE; while (end == FALSE) @@ -5325,41 +5623,40 @@ chk_modeline( if (STRNCMP(s, "set ", (size_t)4) == 0 || STRNCMP(s, "se ", (size_t)3) == 0) { - if (*e != ':') /* no terminating ':'? */ + if (*e != ':') // no terminating ':'? break; end = TRUE; s = vim_strchr(s, ' ') + 1; } - *e = NUL; /* truncate the set command */ + *e = NUL; // truncate the set command - if (*s != NUL) /* skip over an empty "::" */ + if (*s != NUL) // skip over an empty "::" { int secure_save = secure; -#ifdef FEAT_EVAL + save_current_sctx = current_sctx; + current_sctx.sc_version = 1; +#ifdef FEAT_EVAL current_sctx.sc_sid = SID_MODELINE; current_sctx.sc_seq = 0; - current_sctx.sc_lnum = 0; - current_sctx.sc_version = 1; + current_sctx.sc_lnum = lnum; #endif + // Make sure no risky things are executed as a side effect. secure = 1; retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags); secure = secure_save; -#ifdef FEAT_EVAL current_sctx = save_current_sctx; -#endif - if (retval == FAIL) /* stop if error found */ + if (retval == FAIL) // stop if error found break; } - s = e + 1; /* advance to next part */ + s = e + 1; // advance to next part } - sourcing_lnum = save_sourcing_lnum; - sourcing_name = save_sourcing_name; - + ESTACK_CHECK_NOW + estack_pop(); vim_free(linecopy); } return retval; @@ -5414,6 +5711,7 @@ bt_prompt(buf_T *buf) return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r'; } +#if defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Return TRUE if "buf" is a buffer for a popup window. */ @@ -5423,6 +5721,7 @@ bt_popup(buf_T *buf) return buf != NULL && buf->b_p_bt != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o'; } +#endif /* * Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt" @@ -5437,6 +5736,7 @@ bt_nofilename(buf_T *buf) || buf->b_p_bt[0] == 'p'); } +#if defined(FEAT_QUICKFIX) || defined(PROTO) /* * Return TRUE if "buf" has 'buftype' set to "nofile". */ @@ -5445,6 +5745,7 @@ bt_nofile(buf_T *buf) { return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f'; } +#endif /* * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt" @@ -5454,8 +5755,8 @@ bt_nofile(buf_T *buf) bt_dontwrite(buf_T *buf) { return buf != NULL && (buf->b_p_bt[0] == 'n' - || buf->b_p_bt[0] == 't' - || buf->b_p_bt[0] == 'p'); + || buf->b_p_bt[0] == 't' + || buf->b_p_bt[0] == 'p'); } #if defined(FEAT_QUICKFIX) || defined(PROTO) @@ -5464,7 +5765,7 @@ bt_dontwrite_msg(buf_T *buf) { if (bt_dontwrite(buf)) { - emsg(_("E382: Cannot write, 'buftype' option is set")); + emsg(_(e_cannot_write_buftype_option_is_set)); return TRUE; } return FALSE; @@ -5478,15 +5779,15 @@ bt_dontwrite_msg(buf_T *buf) int buf_hide(buf_T *buf) { - /* 'bufhidden' overrules 'hidden' and ":hide", check it first */ + // 'bufhidden' overrules 'hidden' and ":hide", check it first switch (buf->b_p_bh[0]) { - case 'u': /* "unload" */ - case 'w': /* "wipe" */ - case 'd': return FALSE; /* "delete" */ - case 'h': return TRUE; /* "hide" */ + case 'u': // "unload" + case 'w': // "wipe" + case 'd': return FALSE; // "delete" + case 'h': return TRUE; // "hide" } - return (p_hid || cmdmod.hide); + return (p_hid || (cmdmod.cmod_flags & CMOD_HIDE)); } /* @@ -5510,8 +5811,8 @@ buf_spname(buf_T *buf) } #endif - /* There is no _file_ when 'buftype' is "nofile", b_sfname - * contains the name as specified by the user. */ + // There is no _file_ when 'buftype' is "nofile", b_sfname + // contains the name as specified by the user. if (bt_nofilename(buf)) { #ifdef FEAT_TERMINAL @@ -5524,7 +5825,7 @@ buf_spname(buf_T *buf) if (bt_prompt(buf)) return (char_u *)_("[Prompt]"); #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP if (bt_popup(buf)) return (char_u *)_("[Popup]"); #endif @@ -5532,10 +5833,21 @@ buf_spname(buf_T *buf) } if (buf->b_fname == NULL) - return (char_u *)_("[No Name]"); + return buf_get_fname(buf); return NULL; } +/* + * Get "buf->b_fname", use "[No Name]" if it is NULL. + */ + char_u * +buf_get_fname(buf_T *buf) +{ + if (buf->b_fname == NULL) + return (char_u *)_("[No Name]"); + return buf->b_fname; +} + /* * Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed. */ @@ -5565,19 +5877,19 @@ buf_contents_changed(buf_T *buf) aco_save_T aco; exarg_T ea; - /* Allocate a buffer without putting it in the buffer list. */ + // Allocate a buffer without putting it in the buffer list. newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY); if (newbuf == NULL) return TRUE; - /* Force the 'fileencoding' and 'fileformat' to be equal. */ + // Force the 'fileencoding' and 'fileformat' to be equal. if (prep_exarg(&ea, buf) == FAIL) { wipe_buffer(newbuf, FALSE); return TRUE; } - /* set curwin/curbuf to buf and save a few things */ + // set curwin/curbuf to buf and save a few things aucmd_prepbuf(&aco, newbuf); if (ml_open(curbuf) == OK @@ -5585,7 +5897,7 @@ buf_contents_changed(buf_T *buf) (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, &ea, READ_NEW | READ_DUMMY) == OK) { - /* compare the two files line by line */ + // compare the two files line by line if (buf->b_ml.ml_line_count == curbuf->b_ml.ml_line_count) { differ = FALSE; @@ -5599,10 +5911,10 @@ buf_contents_changed(buf_T *buf) } vim_free(ea.cmd); - /* restore curwin/curbuf and a few other things */ + // restore curwin/curbuf and a few other things aucmd_restbuf(&aco); - if (curbuf != newbuf) /* safety check */ + if (curbuf != newbuf) // safety check wipe_buffer(newbuf, FALSE); return differ; @@ -5616,15 +5928,15 @@ buf_contents_changed(buf_T *buf) void wipe_buffer( buf_T *buf, - int aucmd UNUSED) /* When TRUE trigger autocommands. */ + int aucmd) // When TRUE trigger autocommands. { if (buf->b_fnum == top_file_num - 1) --top_file_num; - if (!aucmd) /* Don't trigger BufDelete autocommands here. */ + if (!aucmd) // Don't trigger BufDelete autocommands here. block_autocmds(); - close_buffer(NULL, buf, DOBUF_WIPE, FALSE); + close_buffer(NULL, buf, DOBUF_WIPE, FALSE, TRUE); if (!aucmd) unblock_autocmds(); diff --git a/src/bufwrite.c b/src/bufwrite.c index 13091a336e473..8db4266265071 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -30,6 +30,7 @@ struct bw_info int bw_flags; // FIO_ flags #ifdef FEAT_CRYPT buf_T *bw_buffer; // buffer being written + int bw_finish; // finish encrypting #endif char_u bw_rest[CONV_RESTLEN]; // not converted bytes int bw_restlen; // nr of bytes in bw_rest[] @@ -38,7 +39,7 @@ struct bw_info size_t bw_conv_buflen; // size of bw_conv_buf int bw_conv_error; // set for conversion error linenr_T bw_conv_error_lnum; // first line with error or zero - linenr_T bw_start_lnum; // line number at start of buffer + linenr_T bw_start_lnum; // line number at start of buffer #ifdef USE_ICONV iconv_t bw_iconv_fd; // descriptor for iconv() or -1 #endif @@ -493,14 +494,16 @@ buf_write_bytes(struct bw_info *ip) if (crypt_works_inplace(ip->bw_buffer->b_cryptstate)) { # endif - crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len); + crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len, + ip->bw_finish); # ifdef CRYPT_NOT_INPLACE } else { char_u *outbuf; - len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf); + len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf, + ip->bw_finish); if (len == 0) return OK; // Crypt layer is buffering, will flush later. wlen = write_eintr(ip->bw_fd, outbuf, len); @@ -524,7 +527,7 @@ buf_write_bytes(struct bw_info *ip) check_mtime(buf_T *buf, stat_T *st) { if (buf->b_mtime_read != 0 - && time_differs((long)st->st_mtime, buf->b_mtime_read)) + && time_differs(st, buf->b_mtime_read, buf->b_mtime_read_ns)) { msg_scroll = TRUE; // don't overwrite messages here msg_silent = 0; // must give this prompt @@ -598,6 +601,12 @@ set_file_time( } #endif // UNIX + char * +new_file_message(void) +{ + return shortmess(SHM_NEW) ? _("[New]") : _("[New File]"); +} + /* * buf_write() - write to file "fname" lines "start" through "end" * @@ -658,7 +667,6 @@ buf_write( int prev_got_int = got_int; int checking_conversion; int file_readonly = FALSE; // overwritten file is read-only - static char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')"; #if defined(UNIX) // XXX fix me sometime? int made_writable = FALSE; // 'w' bit has been set #endif @@ -683,6 +691,8 @@ buf_write( context_sha256_T sha_ctx; #endif unsigned int bkc = get_bkc_value(buf); + pos_T orig_start = buf->b_op_start; + pos_T orig_end = buf->b_op_end; if (fname == NULL || *fname == NUL) // safety check return FAIL; @@ -690,7 +700,7 @@ buf_write( { // This can happen during startup when there is a stray "w" in the // vimrc file. - emsg(_(e_emptybuf)); + emsg(_(e_empty_buffer)); return FAIL; } @@ -702,7 +712,7 @@ buf_write( // Avoid a crash for a long name. if (STRLEN(fname) >= MAXPATHL) { - emsg(_(e_longname)); + emsg(_(e_name_too_long)); return FAIL; } @@ -716,6 +726,7 @@ buf_write( #endif #ifdef FEAT_CRYPT write_info.bw_buffer = buf; + write_info.bw_finish = FALSE; #endif // After writing a file changedtick changes but we don't want to display @@ -875,10 +886,17 @@ buf_write( #endif ) { + if (buf != NULL && (cmdmod.cmod_flags & CMOD_LOCKMARKS)) + { + // restore the original '[ and '] positions + buf->b_op_start = orig_start; + buf->b_op_end = orig_end; + } + --no_wait_return; msg_scroll = msg_save; if (nofile_err) - emsg(_("E676: No matching autocommands for acwrite buffer")); + emsg(_(e_no_matching_autocommands_for_acwrite_buffer)); if (nofile_err #ifdef FEAT_EVAL @@ -913,7 +931,7 @@ buf_write( #ifdef FEAT_EVAL if (!aborting()) #endif - emsg(_("E203: Autocommands deleted or unloaded buffer to be written")); + emsg(_(e_autocommands_deleted_or_unloaded_buffer_to_be_written)); return FAIL; } @@ -934,7 +952,7 @@ buf_write( { --no_wait_return; msg_scroll = msg_save; - emsg(_("E204: Autocommand changed number of lines in unexpected way")); + emsg(_(e_autocommands_changed_number_of_lines_in_unexpected_way)); return FAIL; } } @@ -952,6 +970,13 @@ buf_write( fname = buf->b_sfname; } + if (cmdmod.cmod_flags & CMOD_LOCKMARKS) + { + // restore the original '[ and '] positions + buf->b_op_start = orig_start; + buf->b_op_end = orig_end; + } + #ifdef FEAT_NETBEANS_INTG if (netbeans_active() && isNetbeansBuffer(buf)) { @@ -969,7 +994,7 @@ buf_write( else { errnum = (char_u *)"E656: "; - errmsg = (char_u *)_("NetBeans disallows writes of unmodified buffers"); + errmsg = (char_u *)_(e_netbeans_disallows_writes_of_unmodified_buffers); buffer = NULL; goto fail; } @@ -977,7 +1002,7 @@ buf_write( else { errnum = (char_u *)"E657: "; - errmsg = (char_u *)_("Partial writes disallowed for NetBeans buffers"); + errmsg = (char_u *)_(e_partial_writes_disallowed_for_netbeans_buffers); buffer = NULL; goto fail; } @@ -1024,13 +1049,13 @@ buf_write( if (S_ISDIR(st_old.st_mode)) { errnum = (char_u *)"E502: "; - errmsg = (char_u *)_("is a directory"); + errmsg = (char_u *)_(e_is_a_directory); goto fail; } if (mch_nodetype(fname) != NODE_WRITABLE) { errnum = (char_u *)"E503: "; - errmsg = (char_u *)_("is not a file or writable device"); + errmsg = (char_u *)_(e_is_not_file_or_writable_device); goto fail; } // It's a device of some kind (or a fifo) which we can write to @@ -1046,7 +1071,7 @@ buf_write( if (c == NODE_OTHER) { errnum = (char_u *)"E503: "; - errmsg = (char_u *)_("is not a file or writable device"); + errmsg = (char_u *)_(e_is_not_file_or_writable_device); goto fail; } if (c == NODE_WRITABLE) @@ -1057,7 +1082,7 @@ buf_write( if (!p_odev) { errnum = (char_u *)"E796: "; - errmsg = (char_u *)_("writing to device disabled with 'opendevice' option"); + errmsg = (char_u *)_(e_writing_to_device_disabled_with_opendevice_option); goto fail; } # endif @@ -1073,7 +1098,7 @@ buf_write( else if (mch_isdir(fname)) { errnum = (char_u *)"E502: "; - errmsg = (char_u *)_("is a directory"); + errmsg = (char_u *)_(e_is_a_directory); goto fail; } if (overwriting) @@ -1092,12 +1117,12 @@ buf_write( if (vim_strchr(p_cpo, CPO_FWRITE) != NULL) { errnum = (char_u *)"E504: "; - errmsg = (char_u *)_(err_readonly); + errmsg = (char_u *)_(e_is_read_only_cannot_override_W_in_cpoptions); } else { errnum = (char_u *)"E505: "; - errmsg = (char_u *)_("is read-only (add ! to override)"); + errmsg = (char_u *)_(e_is_read_only_add_bang_to_override); } goto fail; } @@ -1451,21 +1476,21 @@ buf_write( { if (buf_write_bytes(&write_info) == FAIL) { - errmsg = (char_u *)_("E506: Can't write to backup file (add ! to override)"); + errmsg = (char_u *)_(e_canot_write_to_backup_file_add_bang_to_override); break; } ui_breakcheck(); if (got_int) { - errmsg = (char_u *)_(e_interr); + errmsg = (char_u *)_(e_interrupted); break; } } if (close(bfd) < 0 && errmsg == NULL) - errmsg = (char_u *)_("E507: Close error for backup file (add ! to override)"); + errmsg = (char_u *)_(e_close_error_for_backup_file_add_bang_to_write_anyway); if (write_info.bw_len < 0) - errmsg = (char_u *)_("E508: Can't read file for backup (add ! to override)"); + errmsg = (char_u *)_(e_cant_read_file_for_backup_add_bang_to_write_anyway); #ifdef UNIX set_file_time(backup, st_old.st_atime, st_old.st_mtime); #endif @@ -1474,6 +1499,9 @@ buf_write( #endif #if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(fname, backup); +#endif +#ifdef MSWIN + (void)mch_copy_file_attribute(fname, backup); #endif break; } @@ -1484,7 +1512,7 @@ buf_write( vim_free(copybuf); if (backup == NULL && errmsg == NULL) - errmsg = (char_u *)_("E509: Cannot create backup file (add ! to override)"); + errmsg = (char_u *)_(e_cannot_create_backup_file_add_bang_to_write_anyway); // ignore errors when forceit is TRUE if ((some_error || errmsg != NULL) && !forceit) { @@ -1507,7 +1535,7 @@ buf_write( if (file_readonly && vim_strchr(p_cpo, CPO_FWRITE) != NULL) { errnum = (char_u *)"E504: "; - errmsg = (char_u *)_(err_readonly); + errmsg = (char_u *)_(e_is_read_only_cannot_override_W_in_cpoptions); goto fail; } @@ -1579,7 +1607,7 @@ buf_write( } if (backup == NULL && !forceit) { - errmsg = (char_u *)_("E510: Can't make backup file (add ! to override)"); + errmsg = (char_u *)_(e_cant_make_backup_file_add_bang_to_write_anyway); goto fail; } } @@ -1601,9 +1629,7 @@ buf_write( if (forceit && overwriting && vim_strchr(p_cpo, CPO_KEEPRO) == NULL) { buf->b_p_ro = FALSE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif status_redraw_all(); // redraw status lines later } @@ -1623,7 +1649,7 @@ buf_write( ml_preserve(buf, FALSE); if (got_int) { - errmsg = (char_u *)_(e_interr); + errmsg = (char_u *)_(e_interrupted); goto restore_backup; } } @@ -1719,7 +1745,7 @@ buf_write( wfname = vim_tempname('w', FALSE); if (wfname == NULL) // Can't write without a tempfile! { - errmsg = (char_u *)_("E214: Can't find temp file for writing"); + errmsg = (char_u *)_(e_cant_find_temp_file_for_writing); goto restore_backup; } } @@ -1737,7 +1763,7 @@ buf_write( { if (!forceit) { - errmsg = (char_u *)_("E213: Cannot convert (add ! to write without conversion)"); + errmsg = (char_u *)_(e_cannot_convert_add_bang_to_write_without_conversion); goto restore_backup; } notconverted = TRUE; @@ -1794,11 +1820,12 @@ buf_write( || (mch_lstat((char *)fname, &st) == 0 && (st.st_dev != st_old.st_dev || st.st_ino != st_old.st_ino))) - errmsg = (char_u *)_("E166: Can't open linked file for writing"); + errmsg = + (char_u *)_(e_cant_open_linked_file_for_writing); else #endif { - errmsg = (char_u *)_("E212: Can't open file for writing"); + errmsg = (char_u *)_(e_cant_open_file_for_writing); if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL && perm >= 0) { @@ -1875,7 +1902,7 @@ buf_write( && st.st_ino != st_old.st_ino) { close(fd); - errmsg = (char_u *)_("E949: File changed while writing"); + errmsg = (char_u *)_(e_file_changed_while_writing); goto fail; } } @@ -1887,12 +1914,7 @@ buf_write( #if defined(MSWIN) if (backup != NULL && overwriting && !append) - { - if (backup_copy) - (void)mch_copy_file_attribute(wfname, backup); - else - (void)mch_copy_file_attribute(backup, wfname); - } + (void)mch_copy_file_attribute(backup, wfname); if (!overwriting && !append) { @@ -1962,8 +1984,25 @@ buf_write( && overwriting && !append && !filtering +# ifdef CRYPT_NOT_INPLACE + // writing undo file requires + // crypt_encode_inplace() + && (buf->b_cryptstate == NULL + || crypt_works_inplace(buf->b_cryptstate)) +# endif && reset_changed && !checking_conversion); +# ifdef CRYPT_NOT_INPLACE + // remove undo file if encrypting it is not possible + if (buf->b_p_udf + && overwriting + && !append + && !filtering + && !checking_conversion + && buf->b_cryptstate != NULL + && !crypt_works_inplace(buf->b_cryptstate)) + u_undofile_reset_and_delete(buf); +# endif if (write_undo_file) // Prepare for computing the hash value of the text. sha256_start(&sha_ctx); @@ -1995,6 +2034,13 @@ buf_write( ++s; if (++len != bufsize) continue; +#ifdef FEAT_CRYPT + if (write_info.bw_fd > 0 && lnum == end + && (write_info.bw_flags & FIO_ENCRYPTED) + && *buf->b_p_key != NUL && !filtering + && *ptr == NUL) + write_info.bw_finish = TRUE; + #endif if (buf_write_bytes(&write_info) == FAIL) { end = 0; // write error: break loop @@ -2009,7 +2055,7 @@ buf_write( if (end == 0 || (lnum == end && (write_bin || !buf->b_p_fixeol) - && (lnum == buf->b_no_eol_lnum + && ((write_bin && lnum == buf->b_no_eol_lnum) || (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol)))) { @@ -2064,6 +2110,10 @@ buf_write( // structures end with a newline (carriage return) character, and // if they don't it adds one. // With other RMS structures it works perfect without this fix. +# ifndef MIN +// Older DECC compiler for VAX doesn't define MIN() +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +# endif if (buf->b_fab_rfm == FAB$C_VFC || ((buf->b_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0)) { @@ -2094,6 +2144,12 @@ buf_write( if (len > 0 && end > 0) { write_info.bw_len = len; +#ifdef FEAT_CRYPT + if (write_info.bw_fd > 0 && lnum >= end + && (write_info.bw_flags & FIO_ENCRYPTED) + && *buf->b_p_key != NUL && !filtering) + write_info.bw_finish = TRUE; + #endif if (buf_write_bytes(&write_info) == FAIL) end = 0; // write error nchars += len; @@ -2112,7 +2168,7 @@ buf_write( if (!checking_conversion) { #if defined(UNIX) && defined(HAVE_FSYNC) - // On many journalling file systems there is a bug that causes both the + // On many journaling file systems there is a bug that causes both the // original and the backup file to be lost when halting the system // right after writing the file. That's because only the meta-data is // journalled. Syncing the file slows down the system, but assures it @@ -2122,7 +2178,7 @@ buf_write( // If the 'fsync' option is FALSE, don't fsync(). Useful for laptops. if (p_fs && vim_fsync(fd) != 0 && !device) { - errmsg = (char_u *)_(e_fsync); + errmsg = (char_u *)_(e_fsync_failed); end = 0; } #endif @@ -2172,7 +2228,7 @@ buf_write( #endif if (close(fd) != 0) { - errmsg = (char_u *)_("E512: Close failed"); + errmsg = (char_u *)_(e_close_failed); end = 0; } @@ -2229,19 +2285,19 @@ buf_write( if (write_info.bw_conv_error) { if (write_info.bw_conv_error_lnum == 0) - errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)"); + errmsg = (char_u *)_(e_write_error_conversion_failed_make_fenc_empty_to_override); else { errmsg_allocated = TRUE; errmsg = alloc(300); - vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"), + vim_snprintf((char *)errmsg, 300, _(e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override), (long)write_info.bw_conv_error_lnum); } } else if (got_int) - errmsg = (char_u *)_(e_interr); + errmsg = (char_u *)_(e_interrupted); else - errmsg = (char_u *)_("E514: write error (file system full?)"); + errmsg = (char_u *)_(e_write_error_file_system_full); } // If we have a backup file, try to put it in place of the new file, @@ -2259,7 +2315,7 @@ buf_write( // know we got the message. if (got_int) { - msg(_(e_interr)); + msg(_(e_interrupted)); out_flush(); } if ((fd = mch_open((char *)backup, O_RDONLY | O_EXTRA, 0)) >= 0) @@ -2327,7 +2383,7 @@ buf_write( } else if (newfile) { - STRCAT(IObuff, shortmess(SHM_NEW) ? _("[New]") : _("[New File]")); + STRCAT(IObuff, new_file_message()); c = TRUE; } if (no_eol) @@ -2364,8 +2420,8 @@ buf_write( && (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL)) { unchanged(buf, TRUE, FALSE); - // b:changedtick is may be incremented in unchanged() but that - // should not trigger a TextChanged event. + // b:changedtick may be incremented in unchanged() but that should not + // trigger a TextChanged event. if (buf->b_last_changedtick + 1 == CHANGEDTICK(buf)) buf->b_last_changedtick = CHANGEDTICK(buf); u_unchanged(buf); @@ -2397,7 +2453,7 @@ buf_write( // If the original file does not exist yet // the current backup file becomes the original file if (org == NULL) - emsg(_("E205: Patchmode: can't save original file")); + emsg(_(e_patchmode_cant_save_original_file)); else if (mch_stat(org, &st) < 0) { vim_rename(backup, (char_u *)org); @@ -2417,7 +2473,7 @@ buf_write( || (empty_fd = mch_open(org, O_CREAT | O_EXTRA | O_EXCL | O_NOFOLLOW, perm < 0 ? 0666 : (perm & 0777))) < 0) - emsg(_("E206: patchmode: can't touch empty original file")); + emsg(_(e_patchmode_cant_touch_empty_original_file)); else close(empty_fd); } @@ -2432,7 +2488,7 @@ buf_write( // conversion error. if (!p_bk && backup != NULL && !write_info.bw_conv_error && mch_remove(backup) != 0) - emsg(_("E207: Can't delete backup file")); + emsg(_(e_cant_delete_backup_file)); goto nofail; @@ -2500,6 +2556,7 @@ buf_write( { buf_store_time(buf, &st_old, fname); buf->b_mtime_read = buf->b_mtime; + buf->b_mtime_read_ns = buf->b_mtime_ns; } } } @@ -2553,6 +2610,12 @@ buf_write( #endif } +#ifdef FEAT_VIMINFO + // Make sure marks will be written out to the viminfo file later, even when + // the file is new. + curbuf->b_marks_read = TRUE; +#endif + got_int |= prev_got_int; return retval; diff --git a/src/change.c b/src/change.c index 40cb184fb1ccb..4ea383b8669b2 100644 --- a/src/change.c +++ b/src/change.c @@ -58,7 +58,7 @@ change_warning(int col) ) { out_flush(); - ui_delay(1000L, TRUE); // give the user time to think about it + ui_delay(1002L, TRUE); // give the user time to think about it } curbuf->b_did_warn = TRUE; redraw_cmdline = FALSE; // don't redraw and erase the message @@ -115,10 +115,10 @@ changed(void) // Wait two seconds, to make sure the user reads this unexpected // message. Since we could be anywhere, call wait_return() now, // and don't let the emsg() set msg_scroll. - if (need_wait_return && emsg_silent == 0) + if (need_wait_return && emsg_silent == 0 && !in_assert_fails) { out_flush(); - ui_delay(2000L, TRUE); + ui_delay(2002L, TRUE); wait_return(TRUE); msg_scroll = save_msg_scroll; } @@ -146,9 +146,7 @@ changed_internal(void) ml_setflags(curbuf); check_status(curbuf); redraw_tabline = TRUE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif } #ifdef FEAT_EVAL @@ -157,9 +155,8 @@ static __thread long next_listener_id = 0; /* * Check if the change at "lnum" is above or overlaps with an existing * change. If above then flush changes and invoke listeners. - * Returns TRUE if the change was merged. */ - static int + static void check_recorded_changes( buf_T *buf, linenr_T lnum, @@ -172,8 +169,7 @@ check_recorded_changes( linenr_T prev_lnum; linenr_T prev_lnume; - for (li = buf->b_recorded_changes->lv_first; li != NULL; - li = li->li_next) + FOR_ALL_LIST_ITEMS(buf->b_recorded_changes, li) { prev_lnum = (linenr_T)dict_get_number( li->li_tv.vval.v_dict, (char_u *)"lnum"); @@ -188,7 +184,6 @@ check_recorded_changes( } } } - return FALSE; } /* @@ -209,8 +204,7 @@ may_record_change( // If the new change is going to change the line numbers in already listed // changes, then flush. - if (check_recorded_changes(curbuf, lnum, lnume, xtra)) - return; + check_recorded_changes(curbuf, lnum, lnume, xtra); if (curbuf->b_recorded_changes == NULL) { @@ -242,6 +236,9 @@ f_listener_add(typval_T *argvars, typval_T *rettv) listener_T *lnr; buf_T *buf = curbuf; + if (in_vim9script() && check_for_opt_buffer_arg(argvars, 1) == FAIL) + return; + callback = get_callback(&argvars[0]); if (callback.cb_name == NULL) return; @@ -279,6 +276,9 @@ f_listener_flush(typval_T *argvars, typval_T *rettv UNUSED) { buf_T *buf = curbuf; + if (in_vim9script() && check_for_opt_buffer_arg(argvars, 0) == FAIL) + return; + if (argvars[0].v_type != VAR_UNKNOWN) { buf = get_buf_arg(&argvars[0]); @@ -288,6 +288,18 @@ f_listener_flush(typval_T *argvars, typval_T *rettv UNUSED) invoke_listeners(buf); } + + static void +remove_listener(buf_T *buf, listener_T *lnr, listener_T *prev) +{ + if (prev != NULL) + prev->lr_next = lnr->lr_next; + else + buf->b_listener = lnr->lr_next; + free_callback(&lnr->lr_callback); + vim_free(lnr); +} + /* * listener_remove() function */ @@ -297,9 +309,13 @@ f_listener_remove(typval_T *argvars, typval_T *rettv) listener_T *lnr; listener_T *next; listener_T *prev; - int id = tv_get_number(argvars); + int id; buf_T *buf; + if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) + return; + + id = tv_get_number(argvars); FOR_ALL_BUFFERS(buf) { prev = NULL; @@ -308,12 +324,13 @@ f_listener_remove(typval_T *argvars, typval_T *rettv) next = lnr->lr_next; if (lnr->lr_id == id) { - if (prev != NULL) - prev->lr_next = lnr->lr_next; - else - buf->b_listener = lnr->lr_next; - free_callback(&lnr->lr_callback); - vim_free(lnr); + if (textlock > 0) + { + // in invoke_listeners(), clear ID and delete later + lnr->lr_id = 0; + return; + } + remove_listener(buf, lnr, prev); rettv->vval.v_number = 1; return; } @@ -353,6 +370,7 @@ invoke_listeners(buf_T *buf) #if !TARGET_OS_IPHONE static int recursive = FALSE; #endif + listener_T *next; if (buf->b_recorded_changes == NULL // nothing changed || buf->b_listener == NULL // no listeners @@ -367,8 +385,7 @@ invoke_listeners(buf_T *buf) argv[0].v_type = VAR_NUMBER; argv[0].vval.v_number = buf->b_fnum; // a:bufnr - - for (li = buf->b_recorded_changes->lv_first; li != NULL; li = li->li_next) + FOR_ALL_LIST_ITEMS(buf->b_recorded_changes, li) { varnumber_T lnum; @@ -397,6 +414,18 @@ invoke_listeners(buf_T *buf) clear_tv(&rettv); } + // If f_listener_remove() was called may have to remove a listener now. + for (lnr = buf->b_listener; lnr != NULL; lnr = next) + { + listener_T *prev = NULL; + + next = lnr->lr_next; + if (lnr->lr_id == 0) + remove_listener(buf, lnr, prev); + else + prev = lnr; + } + --textlock; list_unref(buf->b_recorded_changes); buf->b_recorded_changes = NULL; @@ -442,11 +471,9 @@ changed_common( win_T *wp; tabpage_T *tp; int i; -#ifdef FEAT_JUMPLIST int cols; pos_T *p; int add; -#endif // mark the buffer as modified changed(); @@ -460,12 +487,11 @@ changed_common( #endif // set the '. mark - if (!cmdmod.keepjumps) + if ((cmdmod.cmod_flags & CMOD_KEEPJUMPS) == 0) { curbuf->b_last_change.lnum = lnum; curbuf->b_last_change.col = col; -#ifdef FEAT_JUMPLIST // Create a new entry if a new undo-able change was started or we // don't have an entry yet. if (curbuf->b_new_change || curbuf->b_changelistlen == 0) @@ -525,13 +551,18 @@ changed_common( // The current window is always after the last change, so that "g," // takes you back to it. curwin->w_changelistidx = curbuf->b_changelistlen; -#endif } + if (VIsual_active) + check_visual_pos(); + FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp->w_buffer == curbuf) { +#ifdef FEAT_FOLDING + linenr_T last = lnume + xtra - 1; // last line after the change +#endif // Mark this window to be redrawn later. if (wp->w_redr_type < VALID) wp->w_redr_type = VALID; @@ -541,7 +572,7 @@ changed_common( #ifdef FEAT_FOLDING // Update the folds for this window. Can't postpone this, because // a following operator might work on the whole fold: ">>dd". - foldUpdate(wp, lnum, lnume + xtra - 1); + foldUpdate(wp, lnum, last); // The change may cause lines above or below the change to become // included in a fold. Set lnum/lnume to the first/last line that @@ -551,8 +582,8 @@ changed_common( i = hasFoldingWin(wp, lnum, &lnum, NULL, FALSE, NULL); if (wp->w_cursor.lnum == lnum) wp->w_cline_folded = i; - i = hasFoldingWin(wp, lnume, NULL, &lnume, FALSE, NULL); - if (wp->w_cursor.lnum == lnume) + i = hasFoldingWin(wp, last, NULL, &last, FALSE, NULL); + if (wp->w_cursor.lnum == last) wp->w_cline_folded = i; // If the changed line is in a range of previously folded lines, @@ -570,9 +601,12 @@ changed_common( changed_cline_bef_curs_win(wp); if (wp->w_botline >= lnum) { - // Assume that botline doesn't change (inserted lines make - // other lines scroll down below botline). - approximate_botline_win(wp); + if (xtra < 0) + invalidate_botline_win(wp); + else + // Assume that botline doesn't change (inserted lines make + // other lines scroll down below botline). + approximate_botline_win(wp); } // Check if any w_lines[] entries have become invalid. @@ -614,9 +648,13 @@ changed_common( if (hasAnyFolding(wp)) set_topline(wp, wp->w_topline); #endif - // Relative numbering may require updating more. - if (wp->w_p_rnu) - redraw_win_later(wp, SOME_VALID); + // If lines have been added or removed, relative numbering always + // requires a redraw. + if (wp->w_p_rnu && xtra != 0) + { + wp->w_last_cursor_lnum_rnu = 0; + redraw_win_later(wp, VALID); + } #ifdef FEAT_SYN_HL // Cursor line highlighting probably need to be updated with // "VALID" if it's below the change. @@ -630,6 +668,10 @@ changed_common( } #endif } +#ifdef FEAT_SEARCH_EXTRA + if (wp == curwin && xtra != 0 && search_hl_has_cursor_lnum >= lnum) + search_hl_has_cursor_lnum += xtra; +#endif } // Call update_screen() later, which checks out what needs to be redrawn, @@ -700,10 +742,10 @@ changed_bytes(linenr_T lnum, colnr_T col) * Like changed_bytes() but also adjust text properties for "added" bytes. * When "added" is negative text was deleted. */ - static void + void inserted_bytes(linenr_T lnum, colnr_T col, int added UNUSED) { -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP if (curbuf->b_has_textprop && added != 0) adjust_prop_columns(lnum, col, added, 0); #endif @@ -765,7 +807,7 @@ deleted_lines_mark(linenr_T lnum, long count) /* * Marks the area to be redrawn after a change. */ - static void + void changed_lines_buf( buf_T *buf, linenr_T lnum, // first line with change @@ -860,9 +902,7 @@ unchanged(buf_T *buf, int ff, int always_inc_changedtick) save_file_ff(buf); check_status(buf); redraw_tabline = TRUE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif ++CHANGEDTICK(buf); } else if (always_inc_changedtick) @@ -872,6 +912,57 @@ unchanged(buf_T *buf, int ff, int always_inc_changedtick) #endif } +/* + * Save the current values of 'fileformat' and 'fileencoding', so that we know + * the file must be considered changed when the value is different. + */ + void +save_file_ff(buf_T *buf) +{ + buf->b_start_ffc = *buf->b_p_ff; + buf->b_start_eol = buf->b_p_eol; + buf->b_start_bomb = buf->b_p_bomb; + + // Only use free/alloc when necessary, they take time. + if (buf->b_start_fenc == NULL + || STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0) + { + vim_free(buf->b_start_fenc); + buf->b_start_fenc = vim_strsave(buf->b_p_fenc); + } +} + +/* + * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value + * from when editing started (save_file_ff() called). + * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was + * changed and 'binary' is not set. + * Also when 'endofline' was changed and 'fixeol' is not set. + * When "ignore_empty" is true don't consider a new, empty buffer to be + * changed. + */ + int +file_ff_differs(buf_T *buf, int ignore_empty) +{ + // In a buffer that was never loaded the options are not valid. + if (buf->b_flags & BF_NEVERLOADED) + return FALSE; + if (ignore_empty + && (buf->b_flags & BF_NEW) + && buf->b_ml.ml_line_count == 1 + && *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL) + return FALSE; + if (buf->b_start_ffc != *buf->b_p_ff) + return TRUE; + if ((buf->b_p_bin || !buf->b_p_fixeol) && buf->b_start_eol != buf->b_p_eol) + return TRUE; + if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb) + return TRUE; + if (buf->b_start_fenc == NULL) + return (*buf->b_p_fenc != NUL); + return (STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0); +} + /* * Insert string "p" at the cursor position. Stops at a NUL byte. * Handles Replace mode and multi-byte characters. @@ -909,7 +1000,7 @@ ins_bytes_len(char_u *p, int len) /* * Insert or replace a single character at the cursor position. - * When in REPLACE or VREPLACE mode, replace any existing character. + * When in MODE_REPLACE or MODE_VREPLACE state, replace any existing character. * Caller must have prepared for undo. * For multi-byte characters we get the whole character, the caller must * convert bytes to a character. @@ -1036,11 +1127,16 @@ ins_char_bytes(char_u *buf, int charlen) ml_replace(lnum, newp, FALSE); // mark the buffer as changed and prepare for displaying - inserted_bytes(lnum, col, newlen - oldlen); + changed_bytes(lnum, col); +#ifdef FEAT_PROP_POPUP + if (curbuf->b_has_textprop && newlen != oldlen) + adjust_prop_columns(lnum, col, newlen - oldlen, + State & REPLACE_FLAG ? APC_SUBSTITUTE : 0); +#endif // If we're in Insert or Replace mode and 'showmatch' is set, then briefly // show the match for right parens and braces. - if (p_sm && (State & INSERT) + if (p_sm && (State & MODE_INSERT) && msg_silent == 0 && !ins_compl_active()) { @@ -1172,7 +1268,7 @@ del_bytes( // If "count" is negative the caller must be doing something wrong. if (count < 1) { - siemsg("E950: Invalid count for del_bytes(): %ld", count); + siemsg(e_invalid_count_for_del_bytes_nr, count); return FAIL; } @@ -1207,7 +1303,7 @@ del_bytes( // fixpos is TRUE, we don't want to end up positioned at the NUL, // unless "restart_edit" is set or 'virtualedit' contains "onemore". if (col > 0 && fixpos && restart_edit == 0 - && (ve_flags & VE_ONEMORE) == 0) + && (get_ve_flags() & VE_ONEMORE) == 0) { --curwin->w_cursor.col; curwin->w_cursor.coladd = 0; @@ -1243,7 +1339,7 @@ del_bytes( mch_memmove(newp + col, oldp + col + count, (size_t)movelen); if (alloc_newp) ml_replace(lnum, newp, FALSE); -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP else { // Also move any following text properties. @@ -1255,7 +1351,7 @@ del_bytes( #endif // mark the buffer as changed and prepare for displaying - inserted_bytes(lnum, curwin->w_cursor.col, -count); + inserted_bytes(lnum, col, -count); return OK; } @@ -1263,10 +1359,10 @@ del_bytes( /* * open_line: Add a new line below or above the current line. * - * For VREPLACE mode, we only add a new line when we get to the end of the - * file, otherwise we just start replacing the next line. + * For MODE_VREPLACE state, we only add a new line when we get to the end of + * the file, otherwise we just start replacing the next line. * - * Caller must take care of undo. Since VREPLACE may affect any number of + * Caller must take care of undo. Since MODE_VREPLACE may affect any number of * lines however, it may call u_save_cursor() again when starting to change a * new line. * "flags": OPENLINE_DELSPACES delete spaces after cursor @@ -1277,6 +1373,8 @@ del_bytes( * * "second_line_indent": indent for after ^^D in Insert mode or if flag * OPENLINE_COM_LIST + * "did_do_comment" is set to TRUE when intentionally putting the comment + * leader in fromt of the new line. * * Return OK for success, FAIL for failure */ @@ -1284,13 +1382,15 @@ del_bytes( open_line( int dir, // FORWARD or BACKWARD int flags, - int second_line_indent) + int second_line_indent, + int *did_do_comment UNUSED) { char_u *saved_line; // copy of the original line char_u *next_line = NULL; // copy of the next line char_u *p_extra = NULL; // what goes to next line int less_cols = 0; // less columns for mark in new line - int less_cols_off = 0; // columns to skip for mark adjust + int less_cols_off = 0; // columns to skip for mark and + // textprop adjustment pos_T old_cursor; // old cursor position int newcol = 0; // new cursor column int newindent = 0; // auto-indent of the new line @@ -1299,38 +1399,29 @@ open_line( int retval = FAIL; // return value int extra_len = 0; // length of p_extra string int lead_len; // length of comment leader + int comment_start = 0; // start index of the comment leader char_u *lead_flags; // position in 'comments' for comment leader char_u *leader = NULL; // copy of comment leader char_u *allocated = NULL; // allocated memory char_u *p; int saved_char = NUL; // init for GCC pos_T *pos; -#ifdef FEAT_SMARTINDENT - int do_si = (!p_paste && curbuf->b_p_si -# ifdef FEAT_CINDENT - && !curbuf->b_p_cin -# endif -# ifdef FEAT_EVAL - && *curbuf->b_p_inde == NUL -# endif - ); + int do_cindent; + int do_si = may_do_si(); int no_si = FALSE; // reset did_si afterwards int first_char = NUL; // init for GCC -#endif -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) int vreplace_mode; -#endif int did_append; // appended a new line int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting // make a copy of the current line so we can mess with it saved_line = vim_strsave(ml_get_curline()); - if (saved_line == NULL) /* out of memory! */ + if (saved_line == NULL) // out of memory! return FALSE; if (State & VREPLACE_FLAG) { - // With VREPLACE we make a copy of the next line, which we will be + // With MODE_VREPLACE we make a copy of the next line, which we will be // starting to replace. First make the new line empty and let vim play // with the indenting and comment leader to its heart's content. Then // we grab what it ended up putting on the new line, put back the @@ -1344,11 +1435,11 @@ open_line( if (next_line == NULL) // out of memory! goto theend; - // In VREPLACE mode, a NL replaces the rest of the line, and starts - // replacing the next line, so push all of the characters left on the - // line onto the replace stack. We'll push any other characters that - // might be replaced at the start of the next line (due to autoindent - // etc) a bit later. + // In MODE_VREPLACE state, a NL replaces the rest of the line, and + // starts replacing the next line, so push all of the characters left + // on the line onto the replace stack. We'll push any other characters + // that might be replaced at the start of the next line (due to + // autoindent etc) a bit later. replace_push(NUL); // Call twice because BS over NL expects it replace_push(NUL); p = saved_line + curwin->w_cursor.col; @@ -1362,25 +1453,21 @@ open_line( saved_line[curwin->w_cursor.col] = NUL; } - if ((State & INSERT) && !(State & VREPLACE_FLAG)) + if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0) { p_extra = saved_line + curwin->w_cursor.col; -#ifdef FEAT_SMARTINDENT if (do_si) // need first char after new line break { p = skipwhite(p_extra); first_char = *p; } -#endif extra_len = (int)STRLEN(p_extra); saved_char = *p_extra; *p_extra = NUL; } u_clearline(); // cannot do "U" command when adding lines -#ifdef FEAT_SMARTINDENT did_si = FALSE; -#endif ai_col = 0; // If we just did an auto-indent, then we didn't type anything on @@ -1391,11 +1478,7 @@ open_line( // If 'autoindent' and/or 'smartindent' is set, try to figure out what // indent to use for the new line. - if (curbuf->b_p_ai -#ifdef FEAT_SMARTINDENT - || do_si -#endif - ) + if (curbuf->b_p_ai || do_si) { // count white space on current line #ifdef FEAT_VARTABS @@ -1407,7 +1490,6 @@ open_line( if (newindent == 0 && !(flags & OPENLINE_COM_LIST)) newindent = second_line_indent; // for ^^D command in insert mode -#ifdef FEAT_SMARTINDENT // Do smart indenting. // In insert/replace mode (only when dir == FORWARD) // we may move some text to the next line. If it starts with '{' @@ -1548,17 +1630,46 @@ open_line( } if (do_si) can_si = TRUE; -#endif // FEAT_SMARTINDENT did_ai = TRUE; } + // May do indenting after opening a new line. + do_cindent = !p_paste && (curbuf->b_p_cin +#ifdef FEAT_EVAL + || *curbuf->b_p_inde != NUL +#endif + ) + && in_cinkeys(dir == FORWARD + ? KEY_OPEN_FORW + : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum)); + // Find out if the current line starts with a comment leader. // This may then be inserted in front of the new line. end_comment_pending = NUL; if (flags & OPENLINE_DO_COM) + { lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD, TRUE); + if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD + && (!has_format_option(FO_NO_OPEN_COMS) + || (flags & OPENLINE_FORMAT))) + { + // Check for a line comment after code. + comment_start = check_linecomment(saved_line); + if (comment_start != MAXCOL) + { + lead_len = get_leader_len(saved_line + comment_start, + &lead_flags, FALSE, TRUE); + if (lead_len != 0) + { + lead_len += comment_start; + if (did_do_comment != NULL) + *did_do_comment = TRUE; + } + } + } + } else lead_len = 0; if (lead_len > 0) @@ -1600,7 +1711,7 @@ open_line( } // Isolate the strings of the middle and end leader. - while (*p && p[-1] != ':') /* find end of middle flags */ + while (*p && p[-1] != ':') // find end of middle flags { if (*p == COM_BLANK) require_blank = TRUE; @@ -1720,8 +1831,15 @@ open_line( lead_len = 0; else { + int li; + vim_strncpy(leader, saved_line, lead_len); + // TODO: handle multi-byte and double width chars + for (li = 0; li < comment_start; ++li) + if (!VIM_ISWHITE(leader[li])) + leader[li] = ' '; + // Replace leader with lead_repl, right or left adjusted if (lead_repl != NULL) { @@ -1856,11 +1974,7 @@ open_line( } // Recompute the indent, it may have changed. - if (curbuf->b_p_ai -#ifdef FEAT_SMARTINDENT - || do_si -#endif - ) + if (curbuf->b_p_ai || do_si) #ifdef FEAT_VARTABS newindent = get_indent_str_vtab(leader, curbuf->b_p_ts, curbuf->b_p_vts_array, FALSE); @@ -1907,11 +2021,7 @@ open_line( // if a new indent will be set below, remove the indent that // is in the comment leader - if (newindent -#ifdef FEAT_SMARTINDENT - || did_si -#endif - ) + if (newindent || did_si) { while (lead_len && VIM_ISWHITE(*leader)) { @@ -1922,9 +2032,7 @@ open_line( } } -#ifdef FEAT_SMARTINDENT did_si = can_si = FALSE; -#endif } else if (comment_end != NULL) { @@ -1933,11 +2041,7 @@ open_line( // indent to align with the line containing the start of the // comment. if (comment_end[0] == '*' && comment_end[1] == '/' && - (curbuf->b_p_ai -#ifdef FEAT_SMARTINDENT - || do_si -#endif - )) + (curbuf->b_p_ai || do_si)) { old_cursor = curwin->w_cursor; curwin->w_cursor.col = (colnr_T)(comment_end - saved_line); @@ -1951,7 +2055,7 @@ open_line( } } - // (State == INSERT || State == REPLACE), only when dir == FORWARD + // (State == MODE_INSERT || State == MODE_REPLACE), only when dir == FORWARD if (p_extra != NULL) { *p_extra = saved_char; // restore char that NUL replaced @@ -1959,10 +2063,11 @@ open_line( // When 'ai' set or "flags" has OPENLINE_DELSPACES, skip to the first // non-blank. // - // When in REPLACE mode, put the deleted blanks on the replace stack, - // preceded by a NUL, so they can be put back when a BS is entered. + // When in MODE_REPLACE state, put the deleted blanks on the replace + // stack, preceded by a NUL, so they can be put back when a BS is + // entered. if (REPLACE_NORMAL(State)) - replace_push(NUL); /* end of extra blanks */ + replace_push(NUL); // end of extra blanks if (curbuf->b_p_ai || (flags & OPENLINE_DELSPACES)) { while ((*p_extra == ' ' || *p_extra == '\t') @@ -2029,22 +2134,22 @@ open_line( ) mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); did_append = TRUE; -#ifdef FEAT_TEXT_PROP - if ((State & INSERT) && !(State & VREPLACE_FLAG)) - // properties after the split move to the next line +#ifdef FEAT_PROP_POPUP + if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0) + // Properties after the split move to the next line. adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum, - curwin->w_cursor.col + 1, 0); + curwin->w_cursor.col + 1, 0); #endif } else { - // In VREPLACE mode we are starting to replace the next line. + // In MODE_VREPLACE state we are starting to replace the next line. curwin->w_cursor.lnum++; if (curwin->w_cursor.lnum >= Insstart.lnum + vr_lines_changed) { // In case we NL to a new line, BS to the previous one, and NL // again, we don't want to save the new line for undo twice. - (void)u_save_cursor(); /* errors are ignored! */ + (void)u_save_cursor(); // errors are ignored! vr_lines_changed++; } ml_replace(curwin->w_cursor.lnum, p_extra, TRUE); @@ -2053,14 +2158,9 @@ open_line( did_append = FALSE; } - if (newindent -#ifdef FEAT_SMARTINDENT - || did_si -#endif - ) + if (newindent || did_si) { ++curwin->w_cursor.lnum; -#ifdef FEAT_SMARTINDENT if (did_si) { int sw = (int)get_sw_value(curbuf); @@ -2069,7 +2169,6 @@ open_line( newindent -= newindent % sw; newindent += sw; } -#endif // Copy the indent if (curbuf->b_p_ci) { @@ -2086,20 +2185,18 @@ open_line( ai_col = curwin->w_cursor.col; - // In REPLACE mode, for each character in the new indent, there must - // be a NUL on the replace stack, for when it is deleted with BS + // In MODE_REPLACE state, for each character in the new indent, there + // must be a NUL on the replace stack, for when it is deleted with BS if (REPLACE_NORMAL(State)) for (n = 0; n < (int)curwin->w_cursor.col; ++n) replace_push(NUL); newcol += curwin->w_cursor.col; -#ifdef FEAT_SMARTINDENT if (no_si) did_si = FALSE; -#endif } - // In REPLACE mode, for each character in the extra leader, there must be - // a NUL on the replace stack, for when it is deleted with BS. + // In MODE_REPLACE state, for each character in the extra leader, there + // must be a NUL on the replace stack, for when it is deleted with BS. if (REPLACE_NORMAL(State)) while (lead_len-- > 0) replace_push(NUL); @@ -2108,7 +2205,7 @@ open_line( if (dir == FORWARD) { - if (trunc_line || (State & INSERT)) + if (trunc_line || (State & MODE_INSERT)) { // truncate current line at cursor saved_line[curwin->w_cursor.col] = NUL; @@ -2128,6 +2225,12 @@ open_line( mark_col_adjust(curwin->w_cursor.lnum, curwin->w_cursor.col + less_cols_off, 1L, (long)-less_cols, 0); +#ifdef FEAT_PROP_POPUP + // Keep into account the deleted blanks on the new line. + if (curbuf->b_has_textprop && less_cols_off != 0) + adjust_prop_columns(curwin->w_cursor.lnum + 1, 0, + -less_cols_off, 0); +#endif } else changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); @@ -2143,19 +2246,17 @@ open_line( curwin->w_cursor.col = newcol; curwin->w_cursor.coladd = 0; -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) - // In VREPLACE mode, we are handling the replace stack ourselves, so stop - // fixthisline() from doing it (via change_indent()) by telling it we're in - // normal INSERT mode. + // In MODE_VREPLACE state, we are handling the replace stack ourselves, so + // stop fixthisline() from doing it (via change_indent()) by telling it + // we're in normal MODE_INSERT state. if (State & VREPLACE_FLAG) { vreplace_mode = State; // So we know to put things right later - State = INSERT; + State = MODE_INSERT; } else vreplace_mode = 0; -#endif -#ifdef FEAT_LISP + // May do lisp indenting. if (!p_paste && leader == NULL @@ -2165,31 +2266,20 @@ open_line( fixthisline(get_lisp_indent); ai_col = (colnr_T)getwhitecols_curline(); } -#endif -#ifdef FEAT_CINDENT + // May do indenting after opening a new line. - if (!p_paste - && (curbuf->b_p_cin -# ifdef FEAT_EVAL - || *curbuf->b_p_inde != NUL -# endif - ) - && in_cinkeys(dir == FORWARD - ? KEY_OPEN_FORW - : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum))) + if (do_cindent) { do_c_expr_indent(); ai_col = (colnr_T)getwhitecols_curline(); } -#endif -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) + if (vreplace_mode != 0) State = vreplace_mode; -#endif - // Finally, VREPLACE gets the stuff on the new line, then puts back the - // original line, and inserts the new stuff char by char, pushing old stuff - // onto the replace stack (via ins_char()). + // Finally, MODE_VREPLACE gets the stuff on the new line, then puts back + // the original line, and inserts the new stuff char by char, pushing old + // stuff onto the replace stack (via ins_char()). if (State & VREPLACE_FLAG) { // Put new line in p_extra @@ -2230,11 +2320,15 @@ truncate_line(int fixpos) char_u *newp; linenr_T lnum = curwin->w_cursor.lnum; colnr_T col = curwin->w_cursor.col; + char_u *old_line; + int deleted; + old_line = ml_get(lnum); if (col == 0) newp = vim_strsave((char_u *)""); else - newp = vim_strnsave(ml_get(lnum), col); + newp = vim_strnsave(old_line, col); + deleted = (int)STRLEN(old_line) - col; if (newp == NULL) return FAIL; @@ -2242,7 +2336,7 @@ truncate_line(int fixpos) ml_replace(lnum, newp, FALSE); // mark the buffer as changed and prepare for displaying - changed_bytes(lnum, curwin->w_cursor.col); + inserted_bytes(lnum, curwin->w_cursor.col, -deleted); // If "fixpos" is TRUE we don't want to end up positioned at the NUL. if (fixpos && curwin->w_cursor.col > 0) @@ -2273,7 +2367,7 @@ del_lines(long nlines, int undo) if (curbuf->b_ml.ml_flags & ML_EMPTY) // nothing to delete break; - ml_delete(first, TRUE); + ml_delete_flags(first, ML_DEL_MESSAGE); ++n; // If we delete the last line in the file, stop diff --git a/src/channel.c b/src/channel.c index 2a72a23db0e37..998bf6ce17a98 100644 --- a/src/channel.c +++ b/src/channel.c @@ -10,19 +10,26 @@ * Implements communication through a socket or any file handle. */ +#ifdef WIN32 +// Must include winsock2.h before windows.h since it conflicts with winsock.h +// (included in windows.h). +# include +# include +#endif + #include "vim.h" #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) -/* TRUE when netbeans is running with a GUI. */ +// TRUE when netbeans is running with a GUI. #ifdef FEAT_GUI # define CH_HAS_GUI (gui.in_use || gui.starting) #endif -/* Note: when making changes here also adjust configure.ac. */ +// Note: when making changes here also adjust configure.ac. #ifdef MSWIN -/* WinSock API is separated from C API, thus we can't use read(), write(), - * errno... */ +// WinSock API is separated from C API, thus we can't use read(), write(), +// errno... # define SOCK_ERRNO errno = WSAGetLastError() # undef ECONNREFUSED # define ECONNREFUSED WSAECONNREFUSED @@ -37,11 +44,18 @@ # define sock_write(sd, buf, len) send((SOCKET)sd, buf, len, 0) # define sock_read(sd, buf, len) recv((SOCKET)sd, buf, len, 0) # define sock_close(sd) closesocket((SOCKET)sd) +// Support for Unix-domain sockets was added in Windows SDK 17061. +# define UNIX_PATH_MAX 108 +typedef struct sockaddr_un { + ADDRESS_FAMILY sun_family; + char sun_path[UNIX_PATH_MAX]; +} SOCKADDR_UN, *PSOCKADDR_UN; #else # include # include - +# include # include +# include # ifdef HAVE_LIBGEN_H # include # endif @@ -59,13 +73,13 @@ static ch_mode_T channel_get_mode(channel_T *channel, ch_part_T part); static int channel_get_timeout(channel_T *channel, ch_part_T part); static ch_part_T channel_part_send(channel_T *channel); static ch_part_T channel_part_read(channel_T *channel); -static void free_job_options(jobopt_T *opt); -/* Whether a redraw is needed for appending a line to a buffer. */ -static __thread int channel_need_redraw = FALSE; -/* Whether we are inside channel_parse_messages() or another situation where it - * is safe to invoke callbacks. */ +#define FOR_ALL_CHANNELS(ch) \ + for ((ch) = first_channel; (ch) != NULL; (ch) = (ch)->ch_next) + +// Whether we are inside channel_parse_messages() or another situation where it +// is safe to invoke callbacks. static __thread int safe_to_invoke_callback = 0; static __thread char *part_names[] = {"sock", "out", "err", "in"}; @@ -129,8 +143,9 @@ fd_close(sock_T fd) } #endif -/* Log file opened with ch_logfile(). */ +// Log file opened with ch_logfile(). static __thread FILE *log_fd = NULL; +static __thread char_u *log_name = NULL; #ifdef FEAT_RELTIME static __thread proftime_T log_start; #endif @@ -138,31 +153,42 @@ static __thread proftime_T log_start; void ch_logfile(char_u *fname, char_u *opt) { - FILE *file = NULL; + FILE *file = NULL; + char *mode = "a"; if (log_fd != NULL) { if (*fname != NUL) - ch_log(NULL, "closing, opening %s", fname); + ch_log(NULL, "closing this logfile, opening %s", fname); else - ch_log(NULL, "closing"); + ch_log(NULL, "closing logfile %s", log_name); fclose(log_fd); } + // The "a" flag overrules the "w" flag. + if (vim_strchr(opt, 'a') == NULL && vim_strchr(opt, 'w') != NULL) + mode = "w"; + ch_log_output = vim_strchr(opt, 'o') != NULL ? LOG_ALWAYS : FALSE; + if (*fname != NUL) { - file = fopen((char *)fname, *opt == 'w' ? "w" : "a"); + file = fopen((char *)fname, mode); if (file == NULL) { - semsg(_(e_notopen), fname); + semsg(_(e_cant_open_file_str), fname); return; } + vim_free(log_name); + log_name = vim_strsave(fname); } log_fd = file; if (log_fd != NULL) { - fprintf(log_fd, "==== start log session ====\n"); + fprintf(log_fd, "==== start log session %s ====\n", + get_ctime(time(NULL), FALSE)); + // flush now, if fork/exec follows it could be written twice + fflush(log_fd); #ifdef FEAT_RELTIME profile_start(&log_start); #endif @@ -220,11 +246,7 @@ ch_log(channel_T *ch, const char *fmt, ...) #endif static void -ch_error(channel_T *ch, const char *fmt, ...) -#ifdef USE_PRINTF_FORMAT_ATTRIBUTE - __attribute__((format(printf, 2, 3))) -#endif - ; +ch_error(channel_T *ch, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3); static void ch_error(channel_T *ch, const char *fmt, ...) @@ -269,7 +291,7 @@ strerror_win32(int eno) 0, NULL); if (msgbuf != NULL) - /* chomp \r or \n */ + // chomp \r or \n for (ptr = (char_u *)msgbuf; *ptr; ptr++) switch (*ptr) { @@ -345,27 +367,27 @@ has_any_channel(void) * Return TRUE if "channel" has a callback and the associated job wasn't * killed. */ - static int + int channel_still_useful(channel_T *channel) { int has_sock_msg; int has_out_msg; int has_err_msg; - /* If the job was killed the channel is not expected to work anymore. */ + // If the job was killed the channel is not expected to work anymore. if (channel->ch_job_killed && channel->ch_job == NULL) return FALSE; - /* If there is a close callback it may still need to be invoked. */ + // If there is a close callback it may still need to be invoked. if (channel->ch_close_cb.cb_name != NULL) return TRUE; - /* If reading from or a buffer it's still useful. */ + // If reading from or a buffer it's still useful. if (channel->ch_part[PART_IN].ch_bufref.br_buf != NULL) return TRUE; - /* If there is no callback then nobody can get readahead. If the fd is - * closed and there is no readahead then the callback won't be called. */ + // If there is no callback then nobody can get readahead. If the fd is + // closed and there is no readahead then the callback won't be called. has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD || channel->ch_part[PART_SOCK].ch_head.rq_next != NULL || channel->ch_part[PART_SOCK].ch_json_head.jq_next != NULL; @@ -388,7 +410,7 @@ channel_still_useful(channel_T *channel) /* * Return TRUE if "channel" is closeable (i.e. all readable fds are closed). */ - static int + int channel_can_close(channel_T *channel) { return channel->ch_to_be_closed == 0; @@ -396,6 +418,7 @@ channel_can_close(channel_T *channel) /* * Close a channel and free all its resources. + * The "channel" pointer remains valid. */ static void channel_free_contents(channel_T *channel) @@ -405,6 +428,9 @@ channel_free_contents(channel_T *channel) ch_log(channel, "Freeing channel"); } +/* + * Unlink "channel" from the list of channels and free it. + */ static void channel_free_channel(channel_T *channel) { @@ -468,16 +494,16 @@ free_unused_channels_contents(int copyID, int mask) int did_free = FALSE; channel_T *ch; - /* This is invoked from the garbage collector, which only runs at a safe - * point. */ + // This is invoked from the garbage collector, which only runs at a safe + // point. ++safe_to_invoke_callback; - for (ch = first_channel; ch != NULL; ch = ch->ch_next) + FOR_ALL_CHANNELS(ch) if (!channel_still_useful(ch) && (ch->ch_copyID & mask) != (copyID & mask)) { - /* Free the channel and ordinary items it contains, but don't - * recurse into Lists, Dictionaries etc. */ + // Free the channel and ordinary items it contains, but don't + // recurse into Lists, Dictionaries etc. channel_free_contents(ch); did_free = TRUE; } @@ -497,10 +523,8 @@ free_unused_channels(int copyID, int mask) ch_next = ch->ch_next; if (!channel_still_useful(ch) && (ch->ch_copyID & mask) != (copyID & mask)) - { - /* Free the channel struct itself. */ + // Free the channel struct itself. channel_free_channel(ch); - } } } @@ -518,8 +542,7 @@ channel_fd2channel(sock_T fd, ch_part_T *partp) ch_part_T part; if (fd != INVALID_FD) - for (channel = first_channel; channel != NULL; - channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) { for (part = PART_SOCK; part < PART_IN; ++part) if (channel->ch_part[part].ch_fd == fd) @@ -566,8 +589,8 @@ messageFromServerGtk3(GIOChannel *unused1 UNUSED, gpointer clientData) { channel_read_fd(GPOINTER_TO_INT(clientData)); - return TRUE; /* Return FALSE instead in case the event source is to - * be removed after this function returns. */ + return TRUE; // Return FALSE instead in case the event source is to + // be removed after this function returns. } # else static void @@ -586,13 +609,13 @@ channel_gui_register_one(channel_T *channel, ch_part_T part UNUSED) if (!CH_HAS_GUI) return; - /* gets stuck in handling events for a not connected channel */ + // gets stuck in handling events for a not connected channel if (channel->ch_keep_open) return; # ifdef FEAT_GUI_X11 - /* Tell notifier we are interested in being called when there is input on - * the editor connection socket. */ + // Tell notifier we are interested in being called when there is input on + // the editor connection socket. if (channel->ch_part[part].ch_inputHandler == (XtInputId)NULL) { ch_log(channel, "Registering part %s with fd %d", @@ -607,8 +630,8 @@ channel_gui_register_one(channel_T *channel, ch_part_T part UNUSED) } # else # ifdef FEAT_GUI_GTK - /* Tell gdk we are interested in being called when there is input on the - * editor connection socket. */ + // Tell gdk we are interested in being called when there is input on the + // editor connection socket. if (channel->ch_part[part].ch_inputHandler == 0) { ch_log(channel, "Registering part %s with fd %d", @@ -660,7 +683,7 @@ channel_gui_register_all(void) { channel_T *channel; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) channel_gui_register(channel); } @@ -701,95 +724,41 @@ channel_gui_unregister(channel_T *channel) #endif // FEAT_GUI -static __thread char *e_cannot_connect = N_("E902: Cannot connect to port"); - /* - * Open a socket channel to "hostname":"port". - * "waittime" is the time in msec to wait for the connection. - * When negative wait forever. - * Returns the channel for success. - * Returns NULL for failure. + * For Unix we need to call connect() again after connect() failed. + * On Win32 one time is sufficient. */ - channel_T * -channel_open( - char *hostname, - int port_in, - int waittime, - void (*nb_close_cb)(void)) + static int +channel_connect( + channel_T *channel, + const struct sockaddr *server_addr, + int server_addrlen, + int *waittime) { - int sd = -1; - struct sockaddr_in server; - struct hostent *host; -#ifdef MSWIN - u_short port = port_in; - u_long val = 1; -#else - int port = port_in; -#endif - channel_T *channel; - int ret; - + int sd = -1; #ifdef MSWIN - channel_init_winsock(); + u_long val = 1; #endif - channel = add_channel(); - if (channel == NULL) - { - ch_error(NULL, "Cannot allocate channel."); - return NULL; - } - - /* Get the server internet address and put into addr structure */ - /* fill in the socket address structure and connect to server */ - vim_memset((char *)&server, 0, sizeof(server)); - server.sin_family = AF_INET; - server.sin_port = htons(port); - if ((host = gethostbyname(hostname)) == NULL) - { - ch_error(channel, "in gethostbyname() in channel_open()"); - PERROR(_("E901: gethostbyname() in channel_open()")); - channel_free(channel); - return NULL; - } - { - char *p; - - /* When using host->h_addr_list[0] directly ubsan warns for it to not - * be aligned. First copy the pointer to avoid that. */ - memcpy(&p, &host->h_addr_list[0], sizeof(p)); - memcpy((char *)&server.sin_addr, p, host->h_length); - } - - /* On Mac and Solaris a zero timeout almost never works. At least wait - * one millisecond. Let's do it for all systems, because we don't know why - * this is needed. */ - if (waittime == 0) - waittime = 1; - - /* - * For Unix we need to call connect() again after connect() failed. - * On Win32 one time is sufficient. - */ while (TRUE) { long elapsed_msec = 0; int waitnow; + int ret; if (sd >= 0) sock_close(sd); - sd = socket(AF_INET, SOCK_STREAM, 0); + sd = socket(server_addr->sa_family, SOCK_STREAM, 0); if (sd == -1) { - ch_error(channel, "in socket() in channel_open()."); - PERROR(_("E898: socket() in channel_open()")); - channel_free(channel); - return NULL; + ch_error(channel, "in socket() in channel_connect()."); + PERROR(_(e_socket_in_channel_connect)); + return -1; } - if (waittime >= 0) + if (*waittime >= 0) { - /* Make connect() non-blocking. */ + // Make connect() non-blocking. if ( #ifdef MSWIN ioctlsocket(sd, FIONBIO, &val) < 0 @@ -800,23 +769,22 @@ channel_open( { SOCK_ERRNO; ch_error(channel, - "channel_open: Connect failed with errno %d", errno); + "channel_connect: Connect failed with errno %d", errno); sock_close(sd); - channel_free(channel); - return NULL; + return -1; } } - /* Try connecting to the server. */ - ch_log(channel, "Connecting to %s port %d", hostname, port); - ret = connect(sd, (struct sockaddr *)&server, sizeof(server)); + // Try connecting to the server. + ch_log(channel, "Connecting..."); + ret = connect(sd, server_addr, server_addrlen); if (ret == 0) - /* The connection could be established. */ + // The connection could be established. break; SOCK_ERRNO; - if (waittime < 0 || (errno != EWOULDBLOCK + if (*waittime < 0 || (errno != EWOULDBLOCK && errno != ECONNREFUSED #ifdef EINPROGRESS && errno != EINPROGRESS @@ -824,22 +792,24 @@ channel_open( )) { ch_error(channel, - "channel_open: Connect failed with errno %d", errno); - PERROR(_(e_cannot_connect)); + "channel_connect: Connect failed with errno %d", errno); + PERROR(_(e_cannot_connect_to_port)); sock_close(sd); - channel_free(channel); - return NULL; + return -1; + } + else if (errno == ECONNREFUSED) + { + ch_error(channel, "channel_connect: Connection refused"); + sock_close(sd); + return -1; } - /* Limit the waittime to 50 msec. If it doesn't work within this - * time we close the socket and try creating it again. */ - waitnow = waittime > 50 ? 50 : waittime; + // Limit the waittime to 50 msec. If it doesn't work within this + // time we close the socket and try creating it again. + waitnow = *waittime > 50 ? 50 : *waittime; - /* If connect() didn't finish then try using select() to wait for the - * connection to be made. For Win32 always use select() to wait. */ -#ifndef MSWIN - if (errno != ECONNREFUSED) -#endif + // If connect() didn't finish then try using select() to wait for the + // connection to be made. For Win32 always use select() to wait. { struct timeval tv; fd_set rfds; @@ -861,39 +831,38 @@ channel_open( gettimeofday(&start_tv, NULL); #endif ch_log(channel, - "Waiting for connection (waiting %d msec)...", waitnow); - ret = select((int)sd + 1, &rfds, &wfds, NULL, &tv); + "Waiting for connection (waiting %d msec)...", waitnow); + ret = select(sd + 1, &rfds, &wfds, NULL, &tv); if (ret < 0) { SOCK_ERRNO; ch_error(channel, - "channel_open: Connect failed with errno %d", errno); - PERROR(_(e_cannot_connect)); + "channel_connect: Connect failed with errno %d", errno); + PERROR(_(e_cannot_connect_to_port)); sock_close(sd); - channel_free(channel); - return NULL; + return -1; } #ifdef MSWIN - /* On Win32: select() is expected to work and wait for up to - * "waitnow" msec for the socket to be open. */ + // On Win32: select() is expected to work and wait for up to + // "waitnow" msec for the socket to be open. if (FD_ISSET(sd, &wfds)) break; elapsed_msec = waitnow; - if (waittime > 1 && elapsed_msec < waittime) + if (*waittime > 1 && elapsed_msec < *waittime) { - waittime -= elapsed_msec; + *waittime -= elapsed_msec; continue; } #else - /* On Linux-like systems: See socket(7) for the behavior - * After putting the socket in non-blocking mode, connect() will - * return EINPROGRESS, select() will not wait (as if writing is - * possible), need to use getsockopt() to check if the socket is - * actually able to connect. - * We detect a failure to connect when either read and write fds - * are set. Use getsockopt() to find out what kind of failure. */ + // On Linux-like systems: See socket(7) for the behavior + // After putting the socket in non-blocking mode, connect() will + // return EINPROGRESS, select() will not wait (as if writing is + // possible), need to use getsockopt() to check if the socket is + // actually able to connect. + // We detect a failure to connect when either read and write fds + // are set. Use getsockopt() to find out what kind of failure. if (FD_ISSET(sd, &rfds) || FD_ISSET(sd, &wfds)) { ret = getsockopt(sd, @@ -907,61 +876,63 @@ channel_open( )) { ch_error(channel, - "channel_open: Connect failed with errno %d", + "channel_connect: Connect failed with errno %d", so_error); - PERROR(_(e_cannot_connect)); + PERROR(_(e_cannot_connect_to_port)); + sock_close(sd); + return -1; + } + else if (errno == ECONNREFUSED) + { + ch_error(channel, "channel_connect: Connection refused"); sock_close(sd); - channel_free(channel); - return NULL; + return -1; } } if (FD_ISSET(sd, &wfds) && so_error == 0) - /* Did not detect an error, connection is established. */ + // Did not detect an error, connection is established. break; gettimeofday(&end_tv, NULL); elapsed_msec = (end_tv.tv_sec - start_tv.tv_sec) * 1000 - + (end_tv.tv_usec - start_tv.tv_usec) / 1000; + + (end_tv.tv_usec - start_tv.tv_usec) / 1000; #endif } #ifndef MSWIN - if (waittime > 1 && elapsed_msec < waittime) + if (*waittime > 1 && elapsed_msec < *waittime) { - /* The port isn't ready but we also didn't get an error. - * This happens when the server didn't open the socket - * yet. Select() may return early, wait until the remaining - * "waitnow" and try again. */ + // The port isn't ready but we also didn't get an error. + // This happens when the server didn't open the socket + // yet. Select() may return early, wait until the remaining + // "waitnow" and try again. waitnow -= elapsed_msec; - waittime -= elapsed_msec; + *waittime -= elapsed_msec; if (waitnow > 0) { - mch_delay((long)waitnow, TRUE); + mch_delay((long)waitnow, MCH_DELAY_IGNOREINPUT); ui_breakcheck(); - waittime -= waitnow; + *waittime -= waitnow; } if (!got_int) { - if (waittime <= 0) - /* give it one more try */ - waittime = 1; + if (*waittime <= 0) + // give it one more try + *waittime = 1; continue; } - /* we were interrupted, behave as if timed out */ + // we were interrupted, behave as if timed out } #endif - /* We timed out. */ + // We timed out. ch_error(channel, "Connection timed out"); sock_close(sd); - channel_free(channel); - return NULL; + return -1; } - ch_log(channel, "Connection made"); - - if (waittime >= 0) + if (*waittime >= 0) { #ifdef MSWIN val = 0; @@ -971,10 +942,61 @@ channel_open( #endif } + return sd; +} + +/* + * Open a socket channel to the UNIX socket at "path". + * Returns the channel for success. + * Returns NULL for failure. + */ + static channel_T * +channel_open_unix( + const char *path, + void (*nb_close_cb)(void)) +{ + channel_T *channel = NULL; + int sd = -1; + size_t path_len = STRLEN(path); + struct sockaddr_un server; + size_t server_len; + int waittime = -1; + + if (*path == NUL || path_len >= sizeof(server.sun_path)) + { + semsg(_(e_invalid_argument_str), path); + return NULL; + } + + channel = add_channel(); + if (channel == NULL) + { + ch_error(NULL, "Cannot allocate channel."); + return NULL; + } + + CLEAR_FIELD(server); + server.sun_family = AF_UNIX; + STRNCPY(server.sun_path, path, sizeof(server.sun_path) - 1); + + ch_log(channel, "Trying to connect to %s", path); + + server_len = offsetof(struct sockaddr_un, sun_path) + path_len + 1; + sd = channel_connect(channel, (struct sockaddr *)&server, (int)server_len, + &waittime); + + if (sd < 0) + { + channel_free(channel); + return NULL; + } + + ch_log(channel, "Connection made"); + channel->CH_SOCK_FD = (sock_T)sd; channel->ch_nb_close_cb = nb_close_cb; - channel->ch_hostname = (char *)vim_strsave((char_u *)hostname); - channel->ch_port = port_in; + channel->ch_hostname = (char *)vim_strsave((char_u *)path); + channel->ch_port = 0; channel->ch_to_be_closed |= (1U << PART_SOCK); #ifdef FEAT_GUI @@ -985,24 +1007,165 @@ channel_open( } /* - * Copy callback from "src" to "dest", incrementing the refcounts. + * Open a socket channel to "hostname":"port". + * "waittime" is the time in msec to wait for the connection. + * When negative wait forever. + * Returns the channel for success. + * Returns NULL for failure. */ - static void -copy_callback(callback_T *dest, callback_T *src) + channel_T * +channel_open( + const char *hostname, + int port, + int waittime, + void (*nb_close_cb)(void)) { - dest->cb_partial = src->cb_partial; - if (dest->cb_partial != NULL) + int sd = -1; + channel_T *channel = NULL; +#ifdef FEAT_IPV6 + int err; + struct addrinfo hints; + struct addrinfo *res = NULL; + struct addrinfo *addr = NULL; +#else + struct sockaddr_in server; + struct hostent *host = NULL; +#endif + +#ifdef MSWIN + channel_init_winsock(); +#endif + + channel = add_channel(); + if (channel == NULL) { - dest->cb_name = src->cb_name; - dest->cb_free_name = FALSE; - ++dest->cb_partial->pt_refcount; + ch_error(NULL, "Cannot allocate channel."); + return NULL; } - else + + // Get the server internet address and put into addr structure fill in the + // socket address structure and connect to server. +#ifdef FEAT_IPV6 + CLEAR_FIELD(hints); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; +# if defined(AI_ADDRCONFIG) && defined(AI_V4MAPPED) + hints.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED; +# endif + // Set port number manually in order to prevent name resolution services + // from being invoked in the environment where AI_NUMERICSERV is not + // defined. + if ((err = getaddrinfo(hostname, NULL, &hints, &res)) != 0) + { + ch_error(channel, "in getaddrinfo() in channel_open()"); + semsg(_(e_getaddrinfo_in_channel_open_str), gai_strerror(err)); + channel_free(channel); + return NULL; + } + + for (addr = res; addr != NULL; addr = addr->ai_next) + { + const char *dst = hostname; +# ifdef HAVE_INET_NTOP + const void *src = NULL; + char buf[NUMBUFLEN]; +# endif + + if (addr->ai_family == AF_INET6) + { + struct sockaddr_in6 *sai = (struct sockaddr_in6 *)addr->ai_addr; + + sai->sin6_port = htons(port); +# ifdef HAVE_INET_NTOP + src = &sai->sin6_addr; +# endif + } + else if (addr->ai_family == AF_INET) + { + struct sockaddr_in *sai = (struct sockaddr_in *)addr->ai_addr; + + sai->sin_port = htons(port); +# ifdef HAVE_INET_NTOP + src = &sai->sin_addr; +#endif + } +# ifdef HAVE_INET_NTOP + if (src != NULL) + { + dst = inet_ntop(addr->ai_family, src, buf, sizeof(buf)); + if (dst == NULL) + dst = hostname; + else if (STRCMP(hostname, dst) != 0) + ch_log(channel, "Resolved %s to %s", hostname, dst); + } +# endif + + ch_log(channel, "Trying to connect to %s port %d", dst, port); + + // On Mac and Solaris a zero timeout almost never works. At least wait + // one millisecond. Let's do it for all systems, because we don't know + // why this is needed. + if (waittime == 0) + waittime = 1; + + sd = channel_connect(channel, addr->ai_addr, (int)addr->ai_addrlen, + &waittime); + if (sd >= 0) + break; + } + + freeaddrinfo(res); +#else + CLEAR_FIELD(server); + server.sin_family = AF_INET; + server.sin_port = htons(port); + if ((host = gethostbyname(hostname)) == NULL) + { + ch_error(channel, "in gethostbyname() in channel_open()"); + PERROR(_(e_gethostbyname_in_channel_open)); + channel_free(channel); + return NULL; + } + { + char *p; + + // When using host->h_addr_list[0] directly ubsan warns for it to not + // be aligned. First copy the pointer to avoid that. + memcpy(&p, &host->h_addr_list[0], sizeof(p)); + memcpy((char *)&server.sin_addr, p, host->h_length); + } + + ch_log(channel, "Trying to connect to %s port %d", hostname, port); + + // On Mac and Solaris a zero timeout almost never works. At least wait one + // millisecond. Let's do it for all systems, because we don't know why + // this is needed. + if (waittime == 0) + waittime = 1; + + sd = channel_connect(channel, (struct sockaddr *)&server, sizeof(server), + &waittime); +#endif + + if (sd < 0) { - dest->cb_name = vim_strsave(src->cb_name); - dest->cb_free_name = TRUE; - func_ref(src->cb_name); + channel_free(channel); + return NULL; } + + ch_log(channel, "Connection made"); + + channel->CH_SOCK_FD = (sock_T)sd; + channel->ch_nb_close_cb = nb_close_cb; + channel->ch_hostname = (char *)vim_strsave((char_u *)hostname); + channel->ch_port = port; + channel->ch_to_be_closed |= (1U << PART_SOCK); + +#ifdef FEAT_GUI + channel_gui_register_one(channel, PART_SOCK); +#endif + + return channel; } static void @@ -1027,8 +1190,9 @@ prepare_buffer(buf_T *buf) buf_copy_options(buf, BCO_ENTER); curbuf = buf; #ifdef FEAT_QUICKFIX - set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); - set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); + set_option_value_give_err((char_u *)"bt", + 0L, (char_u *)"nofile", OPT_LOCAL); + set_option_value_give_err((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); #endif if (curbuf->b_ml.ml_mfp == NULL) ml_open(curbuf); @@ -1115,14 +1279,15 @@ channel_set_options(channel_T *channel, jobopt_T *opt) { buf_T *buf; - /* writing output to a buffer. Default mode is NL. */ + // writing output to a buffer. Default mode is NL. if (!(opt->jo_set & JO_OUT_MODE)) - channel->ch_part[PART_OUT].ch_mode = MODE_NL; + channel->ch_part[PART_OUT].ch_mode = CH_MODE_NL; if (opt->jo_set & JO_OUT_BUF) { buf = buflist_findnr(opt->jo_io_buf[PART_OUT]); if (buf == NULL) - semsg(_(e_nobufnr), (long)opt->jo_io_buf[PART_OUT]); + semsg(_(e_buffer_nr_does_not_exist), + (long)opt->jo_io_buf[PART_OUT]); } else { @@ -1140,7 +1305,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt) if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable) { - emsg(_(e_modifiable)); + emsg(_(e_cannot_make_changes_modifiable_is_off)); } else { @@ -1160,16 +1325,17 @@ channel_set_options(channel_T *channel, jobopt_T *opt) { buf_T *buf; - /* writing err to a buffer. Default mode is NL. */ + // writing err to a buffer. Default mode is NL. if (!(opt->jo_set & JO_ERR_MODE)) - channel->ch_part[PART_ERR].ch_mode = MODE_NL; + channel->ch_part[PART_ERR].ch_mode = CH_MODE_NL; if (opt->jo_io[PART_ERR] == JIO_OUT) buf = channel->ch_part[PART_OUT].ch_bufref.br_buf; else if (opt->jo_set & JO_ERR_BUF) { buf = buflist_findnr(opt->jo_io_buf[PART_ERR]); if (buf == NULL) - semsg(_(e_nobufnr), (long)opt->jo_io_buf[PART_ERR]); + semsg(_(e_buffer_nr_does_not_exist), + (long)opt->jo_io_buf[PART_ERR]); } else { @@ -1186,7 +1352,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt) !opt->jo_modifiable[PART_ERR]; if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable) { - emsg(_(e_modifiable)); + emsg(_(e_cannot_make_changes_modifiable_is_off)); } else { @@ -1214,48 +1380,94 @@ channel_open_func(typval_T *argvars) char_u *address; char_u *p; char *rest; - int port; + int port = 0; + int is_ipv6 = FALSE; + int is_unix = FALSE; jobopt_T opt; channel_T *channel = NULL; + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL)) + return NULL; + address = tv_get_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN && (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); return NULL; } - /* parse address */ - p = vim_strchr(address, ':'); - if (p == NULL) + if (*address == NUL) { - semsg(_(e_invarg2), address); + semsg(_(e_invalid_argument_str), address); return NULL; } - *p++ = NUL; - port = strtol((char *)p, &rest, 10); - if (*address == NUL || port <= 0 || *rest != NUL) + + if (!STRNCMP(address, "unix:", 5)) { - p[-1] = ':'; - semsg(_(e_invarg2), address); - return NULL; + is_unix = TRUE; + address += 5; + } + else if (*address == '[') + { + // ipv6 address + is_ipv6 = TRUE; + p = vim_strchr(address + 1, ']'); + if (p == NULL || *++p != ':') + { + semsg(_(e_invalid_argument_str), address); + return NULL; + } + } + else + { + // ipv4 address + p = vim_strchr(address, ':'); + if (p == NULL) + { + semsg(_(e_invalid_argument_str), address); + return NULL; + } + } + + if (!is_unix) + { + port = strtol((char *)(p + 1), &rest, 10); + if (port <= 0 || port >= 65536 || *rest != NUL) + { + semsg(_(e_invalid_argument_str), address); + return NULL; + } + if (is_ipv6) + { + // strip '[' and ']' + ++address; + *(p - 1) = NUL; + } + else + *p = NUL; } - /* parse options */ + // parse options clear_job_options(&opt); - opt.jo_mode = MODE_JSON; + opt.jo_mode = CH_MODE_JSON; opt.jo_timeout = 2000; if (get_job_options(&argvars[1], &opt, - JO_MODE_ALL + JO_CB_ALL + JO_WAITTIME + JO_TIMEOUT_ALL, 0) == FAIL) + JO_MODE_ALL + JO_CB_ALL + JO_TIMEOUT_ALL + + (is_unix? 0 : JO_WAITTIME), 0) == FAIL) goto theend; if (opt.jo_timeout < 0) { - emsg(_(e_invarg)); + emsg(_(e_invalid_argument)); goto theend; } - channel = channel_open((char *)address, port, opt.jo_waittime, NULL); + if (is_unix) + channel = channel_open_unix((char *)address, NULL); + else + channel = channel_open((char *)address, port, opt.jo_waittime, NULL); if (channel != NULL) { opt.jo_set = JO_ALL; @@ -1266,7 +1478,7 @@ channel_open_func(typval_T *argvars) return channel; } - static void + void ch_close_part(channel_T *channel, ch_part_T part) { sock_T *fd = &channel->ch_part[part].ch_fd; @@ -1277,8 +1489,8 @@ ch_close_part(channel_T *channel, ch_part_T part) sock_close(*fd); else { - /* When using a pty the same FD is set on multiple parts, only - * close it when the last reference is closed. */ + // When using a pty the same FD is set on multiple parts, only + // close it when the last reference is closed. if ((part == PART_IN || channel->CH_IN_FD != *fd) && (part == PART_OUT || channel->CH_OUT_FD != *fd) && (part == PART_ERR || channel->CH_ERR_FD != *fd)) @@ -1292,7 +1504,7 @@ ch_close_part(channel_T *channel, ch_part_T part) } *fd = INVALID_FD; - /* channel is closed, may want to end the job if it was the last */ + // channel is closed, may want to end the job if it was the last channel->ch_to_be_closed &= ~(1U << part); } } @@ -1305,8 +1517,8 @@ channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err) ch_close_part(channel, PART_IN); channel->CH_IN_FD = in; # if defined(UNIX) - /* Do not end the job when all output channels are closed, wait until - * the job ended. */ + // Do not end the job when all output channels are closed, wait until + // the job ended. if (mch_isatty(in)) channel->ch_to_be_closed |= (1U << PART_IN); # endif @@ -1359,8 +1571,8 @@ channel_set_job(channel_T *channel, job_T *job, jobopt_T *options) { if (options->jo_in_top == 0 && !(options->jo_set & JO_IN_BOT)) { - /* Special mode: send last-but-one line when appending a line - * to the buffer. */ + // Special mode: send last-but-one line when appending a line + // to the buffer. in_part->ch_bufref.br_buf->b_write_to_channel = TRUE; in_part->ch_buf_append = TRUE; in_part->ch_buf_top = @@ -1413,7 +1625,7 @@ write_buf_line(buf_T *buf, linenr_T lnum, channel_T *channel) char_u *p; int i; - /* Need to make a copy to be able to append a NL. */ + // Need to make a copy to be able to append a NL. if ((p = alloc(len + 2)) == NULL) return; memcpy((char *)p, (char *)line, len); @@ -1443,15 +1655,15 @@ can_write_buf_line(channel_T *channel) chanpart_T *in_part = &channel->ch_part[PART_IN]; if (in_part->ch_fd == INVALID_FD) - return FALSE; /* pipe was closed */ + return FALSE; // pipe was closed - /* for testing: block every other attempt to write */ + // for testing: block every other attempt to write if (in_part->ch_block_write == 1) in_part->ch_block_write = -1; else if (in_part->ch_block_write == -1) in_part->ch_block_write = 1; - /* TODO: Win32 implementation, probably using WaitForMultipleObjects() */ + // TODO: Win32 implementation, probably using WaitForMultipleObjects() #ifndef MSWIN { # if defined(HAVE_SELECT) @@ -1505,7 +1717,7 @@ can_write_buf_line(channel_T *channel) /* * Write any buffer lines to the input channel. */ - static void + void channel_write_in(channel_T *channel) { chanpart_T *in_part = &channel->ch_part[PART_IN]; @@ -1514,10 +1726,10 @@ channel_write_in(channel_T *channel) int written = 0; if (buf == NULL || in_part->ch_buf_append) - return; /* no buffer or using appending */ + return; // no buffer or using appending if (!bufref_valid(&in_part->ch_bufref) || buf->b_ml.ml_mfp == NULL) { - /* buffer was wiped out or unloaded */ + // buffer was wiped out or unloaded ch_log(channel, "input buffer has been wiped out"); in_part->ch_bufref.br_buf = NULL; return; @@ -1541,16 +1753,16 @@ channel_write_in(channel_T *channel) if (lnum > buf->b_ml.ml_line_count || lnum > in_part->ch_buf_bot) { #if defined(FEAT_TERMINAL) - /* Send CTRL-D or "eof_chars" to close stdin on MS-Windows. */ + // Send CTRL-D or "eof_chars" to close stdin on MS-Windows. if (channel->ch_job != NULL) term_send_eof(channel); #endif - /* Writing is done, no longer need the buffer. */ + // Writing is done, no longer need the buffer. in_part->ch_bufref.br_buf = NULL; ch_log(channel, "Finished writing all lines to channel"); - /* Close the pipe/socket, so that the other side gets EOF. */ + // Close the pipe/socket, so that the other side gets EOF. ch_close_part(channel, PART_IN); } else @@ -1567,7 +1779,7 @@ channel_buffer_free(buf_T *buf) channel_T *channel; ch_part_T part; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) for (part = PART_SOCK; part < PART_COUNT; ++part) { chanpart_T *ch_part = &channel->ch_part[part]; @@ -1608,7 +1820,7 @@ channel_write_any_lines(void) { channel_T *channel; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) channel_write_input(channel); } @@ -1621,9 +1833,9 @@ channel_write_new_lines(buf_T *buf) channel_T *channel; int found_one = FALSE; - /* There could be more than one channel for the buffer, loop over all of - * them. */ - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + // There could be more than one channel for the buffer, loop over all of + // them. + FOR_ALL_CHANNELS(channel) { chanpart_T *in_part = &channel->ch_part[PART_IN]; linenr_T lnum; @@ -1632,7 +1844,7 @@ channel_write_new_lines(buf_T *buf) if (in_part->ch_bufref.br_buf == buf && in_part->ch_buf_append) { if (in_part->ch_fd == INVALID_FD) - continue; /* pipe was closed */ + continue; // pipe was closed found_one = TRUE; for (lnum = in_part->ch_buf_bot; lnum < buf->b_ml.ml_line_count; ++lnum) @@ -1723,7 +1935,7 @@ channel_get(channel_T *channel, ch_part_T part, int *outlen) return NULL; if (outlen != NULL) *outlen += node->rq_buflen; - /* dispose of the node but keep the buffer */ + // dispose of the node but keep the buffer p = node->rq_buffer; head->rq_next = node->rq_next; if (node->rq_next == NULL) @@ -1791,7 +2003,7 @@ channel_get_all(channel_T *channel, ch_part_T part, int *outlen) && p[3] == ';') { // '\a' becomes a NL - while (p < res + (len - 1) && *p != '\a') + while (p < res + (len - 1) && *p != '\a') ++p; // BEL is zero width characters, suppress display mistake // ConPTY (after 10.0.18317) requires advance checking @@ -1824,28 +2036,32 @@ channel_consume(channel_T *channel, ch_part_T part, int len) /* * Collapses the first and second buffer for "channel"/"part". - * Returns FAIL if that is not possible. + * Returns FAIL if nothing was done. * When "want_nl" is TRUE collapse more buffers until a NL is found. + * When the channel part mode is "lsp", collapse all the buffers as the http + * header and the JSON content can be present in multiple buffers. */ int channel_collapse(channel_T *channel, ch_part_T part, int want_nl) { - readq_T *head = &channel->ch_part[part].ch_head; - readq_T *node = head->rq_next; - readq_T *last_node; - readq_T *n; - char_u *newbuf; - char_u *p; - long_u len; + ch_mode_T mode = channel->ch_part[part].ch_mode; + readq_T *head = &channel->ch_part[part].ch_head; + readq_T *node = head->rq_next; + readq_T *last_node; + readq_T *n; + char_u *newbuf; + char_u *p; + long_u len; if (node == NULL || node->rq_next == NULL) return FAIL; last_node = node->rq_next; len = node->rq_buflen + last_node->rq_buflen; - if (want_nl) + if (want_nl || mode == CH_MODE_LSP) while (last_node->rq_next != NULL - && channel_first_nl(last_node) == NULL) + && (mode == CH_MODE_LSP + || channel_first_nl(last_node) == NULL)) { last_node = last_node->rq_next; len += last_node->rq_buflen; @@ -1853,7 +2069,7 @@ channel_collapse(channel_T *channel, ch_part_T part, int want_nl) p = newbuf = alloc(len + 1); if (newbuf == NULL) - return FAIL; /* out of memory */ + return FAIL; // out of memory mch_memmove(p, node->rq_buffer, node->rq_buflen); p += node->rq_buflen; vim_free(node->rq_buffer); @@ -1868,7 +2084,7 @@ channel_collapse(channel_T *channel, ch_part_T part, int want_nl) *p = NUL; node->rq_buflen = (long_u)(p - newbuf); - /* dispose of the collapsed nodes and their buffers */ + // dispose of the collapsed nodes and their buffers for (n = node->rq_next; n != last_node; ) { n = n->rq_next; @@ -1899,19 +2115,19 @@ channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len, node = ALLOC_ONE(readq_T); if (node == NULL) - return FAIL; /* out of memory */ - /* A NUL is added at the end, because netbeans code expects that. - * Otherwise a NUL may appear inside the text. */ + return FAIL; // out of memory + // A NUL is added at the end, because netbeans code expects that. + // Otherwise a NUL may appear inside the text. node->rq_buffer = alloc(len + 1); if (node->rq_buffer == NULL) { vim_free(node); - return FAIL; /* out of memory */ + return FAIL; // out of memory } - if (channel->ch_part[part].ch_mode == MODE_NL) + if (channel->ch_part[part].ch_mode == CH_MODE_NL) { - /* Drop any CR before a NL. */ + // Drop any CR before a NL. p = node->rq_buffer; for (i = 0; i < len; ++i) if (buf[i] != CAR || i + 1 >= len || buf[i + 1] != NL) @@ -1979,7 +2195,7 @@ channel_fill(js_read_T *reader) keeplen = reader->js_end - reader->js_buf; if (keeplen > 0) { - /* Prepend unused text. */ + // Prepend unused text. addlen = (int)STRLEN(next); p = alloc(keeplen + addlen + 1); if (p == NULL) @@ -1999,43 +2215,132 @@ channel_fill(js_read_T *reader) } /* - * Use the read buffer of "channel"/"part" and parse a JSON message that is - * complete. The messages are added to the queue. - * Return TRUE if there is more to read. + * Process the HTTP header in a Language Server Protocol (LSP) message. + * + * The message format is described in the LSP specification: + * https://microsoft.github.io/language-server-protocol/specification + * + * It has the following two fields: + * + * Content-Length: ... + * Content-Type: application/vscode-jsonrpc; charset=utf-8 + * + * Each field ends with "\r\n". The header ends with an additional "\r\n". + * + * Returns OK if a valid header is received and FAIL if some fields in the + * header are not correct. Returns MAYBE if a partial header is received and + * need to wait for more data to arrive. */ static int -channel_parse_json(channel_T *channel, ch_part_T part) +channel_process_lsp_http_hdr(js_read_T *reader) { - js_read_T reader; - typval_T listtv; - jsonq_T *item; - chanpart_T *chanpart = &channel->ch_part[part]; - jsonq_T *head = &chanpart->ch_json_head; - int status; - int ret; + char_u *line_start; + char_u *p; + int_u hdr_len; + int payload_len = -1; + int_u jsbuf_len; - if (channel_peek(channel, part) == NULL) - return FALSE; + // We find the end once, to avoid calling strlen() many times. + jsbuf_len = (int_u)STRLEN(reader->js_buf); + reader->js_end = reader->js_buf + jsbuf_len; - reader.js_buf = channel_get(channel, part, NULL); - reader.js_used = 0; - reader.js_fill = channel_fill; + p = reader->js_buf; + + // Process each line in the header till an empty line is read (header + // separator). + while (TRUE) + { + line_start = p; + while (*p != NUL && *p != '\n') + p++; + if (*p == NUL) // partial header + return MAYBE; + p++; + + // process the content length field (if present) + if ((p - line_start > 16) + && STRNICMP(line_start, "Content-Length: ", 16) == 0) + { + errno = 0; + payload_len = strtol((char *)line_start + 16, NULL, 10); + if (errno == ERANGE || payload_len < 0) + // invalid length, discard the payload + return FAIL; + } + + if ((p - line_start) == 2 && line_start[0] == '\r' && + line_start[1] == '\n') + // reached the empty line + break; + } + + if (payload_len == -1) + // Content-Length field is not present in the header + return FAIL; + + hdr_len = p - reader->js_buf; + + // if the entire payload is not received, wait for more data to arrive + if (jsbuf_len < hdr_len + payload_len) + return MAYBE; + + reader->js_used += hdr_len; + // recalculate the end based on the length read from the header. + reader->js_end = reader->js_buf + hdr_len + payload_len; + + return OK; +} + +/* + * Use the read buffer of "channel"/"part" and parse a JSON message that is + * complete. The messages are added to the queue. + * Return TRUE if there is more to read. + */ + static int +channel_parse_json(channel_T *channel, ch_part_T part) +{ + js_read_T reader; + typval_T listtv; + jsonq_T *item; + chanpart_T *chanpart = &channel->ch_part[part]; + jsonq_T *head = &chanpart->ch_json_head; + int status = OK; + int ret; + + if (channel_peek(channel, part) == NULL) + return FALSE; + + reader.js_buf = channel_get(channel, part, NULL); + reader.js_used = 0; + reader.js_fill = channel_fill; reader.js_cookie = channel; reader.js_cookie_arg = part; - /* When a message is incomplete we wait for a short while for more to - * arrive. After the delay drop the input, otherwise a truncated string - * or list will make us hang. - * Do not generate error messages, they will be written in a channel log. */ - ++emsg_silent; - status = json_decode(&reader, &listtv, - chanpart->ch_mode == MODE_JS ? JSON_JS : 0); - --emsg_silent; + if (chanpart->ch_mode == CH_MODE_LSP) + status = channel_process_lsp_http_hdr(&reader); + + // When a message is incomplete we wait for a short while for more to + // arrive. After the delay drop the input, otherwise a truncated string + // or list will make us hang. + // Do not generate error messages, they will be written in a channel log. if (status == OK) { - /* Only accept the response when it is a list with at least two - * items. */ - if (listtv.v_type != VAR_LIST || listtv.vval.v_list->lv_len < 2) + ++emsg_silent; + status = json_decode(&reader, &listtv, + chanpart->ch_mode == CH_MODE_JS ? JSON_JS : 0); + --emsg_silent; + } + if (status == OK) + { + // Only accept the response when it is a list with at least two + // items. + if (chanpart->ch_mode == CH_MODE_LSP && listtv.v_type != VAR_DICT) + { + ch_error(channel, "Did not receive a LSP dict, discarding"); + clear_tv(&listtv); + } + else if (chanpart->ch_mode != CH_MODE_LSP + && (listtv.v_type != VAR_LIST || listtv.vval.v_list->lv_len < 2)) { if (listtv.v_type != VAR_LIST) ch_error(channel, "Did not receive a list, discarding"); @@ -2081,8 +2386,8 @@ channel_parse_json(channel_T *channel, ch_part_T part) if (chanpart->ch_wait_len < buflen) { - /* First time encountering incomplete message or after receiving - * more (but still incomplete): set a deadline of 100 msec. */ + // First time encountering incomplete message or after receiving + // more (but still incomplete): set a deadline of 100 msec. ch_log(channel, "Incomplete message (%d bytes) - wait 100 msec for more", (int)buflen); @@ -2137,7 +2442,7 @@ channel_parse_json(channel_T *channel, ch_part_T part) } else if (reader.js_buf[reader.js_used] != NUL) { - /* Put the unread part back into the channel. */ + // Put the unread part back into the channel. channel_save(channel, part, reader.js_buf + reader.js_used, (int)(reader.js_end - reader.js_buf) - reader.js_used, TRUE, NULL); @@ -2193,7 +2498,7 @@ channel_add_block_id(chanpart_T *chanpart, int id) garray_T *gap = &chanpart->ch_block_ids; if (gap->ga_growsize == 0) - ga_init2(gap, (int)sizeof(int), 10); + ga_init2(gap, sizeof(int), 10); if (ga_grow(gap, 1) == OK) { ((int *)gap->ga_data)[gap->ga_len] = id; @@ -2262,8 +2567,38 @@ channel_get_json( while (item != NULL) { - list_T *l = item->jq_value->vval.v_list; - typval_T *tv = &l->lv_first->li_tv; + list_T *l; + typval_T *tv; + + if (channel->ch_part[part].ch_mode != CH_MODE_LSP) + { + l = item->jq_value->vval.v_list; + CHECK_LIST_MATERIALIZE(l); + tv = &l->lv_first->li_tv; + } + else + { + dict_T *d; + dictitem_T *di; + + // LSP message payload is a JSON-RPC dict. + // For RPC requests and responses, the 'id' item will be present. + // For notifications, it will not be present. + if (id > 0) + { + if (item->jq_value->v_type != VAR_DICT) + goto nextitem; + d = item->jq_value->vval.v_dict; + if (d == NULL) + goto nextitem; + di = dict_find(d, (char_u *)"id", -1); + if (di == NULL) + goto nextitem; + tv = &di->di_tv; + } + else + tv = item->jq_value; + } if ((without_callback || !item->jq_no_callback) && ((id > 0 && tv->v_type == VAR_NUMBER && tv->vval.v_number == id) @@ -2279,6 +2614,7 @@ channel_get_json( remove_json_node(head, item); return OK; } +nextitem: item = item->jq_next; } return FAIL; @@ -2296,10 +2632,10 @@ channel_push_json(channel_T *channel, ch_part_T part, typval_T *rettv) jsonq_T *newitem; if (head->jq_prev != NULL && head->jq_prev->jq_no_callback) - /* last item was pushed back, append to the end */ + // last item was pushed back, append to the end item = NULL; else while (item != NULL && item->jq_no_callback) - /* append after the last item that was pushed back */ + // append after the last item that was pushed back item = item->jq_next; newitem = ALLOC_ONE(jsonq_T); @@ -2319,7 +2655,7 @@ channel_push_json(channel_T *channel, ch_part_T part, typval_T *rettv) *newitem->jq_value = *rettv; if (item == NULL) { - /* append to the end */ + // append to the end newitem->jq_prev = head->jq_prev; head->jq_prev = newitem; newitem->jq_next = NULL; @@ -2330,7 +2666,7 @@ channel_push_json(channel_T *channel, ch_part_T part, typval_T *rettv) } else { - /* append after "item" */ + // append after "item" newitem->jq_prev = item; newitem->jq_next = item->jq_next; item->jq_next = newitem; @@ -2355,13 +2691,14 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) { char_u *cmd = argv[0].vval.v_string; char_u *arg; - int options = channel->ch_part[part].ch_mode == MODE_JS ? JSON_JS : 0; + int options = channel->ch_part[part].ch_mode == CH_MODE_JS + ? JSON_JS : 0; if (argv[1].v_type != VAR_STRING) { ch_error(channel, "received command with non-string argument"); if (p_verbose > 2) - emsg(_("E903: received command with non-string argument")); + emsg(_(e_received_command_with_non_string_argument)); return; } arg = argv[1].vval.v_string; @@ -2370,27 +2707,30 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) if (STRCMP(cmd, "ex") == 0) { - int save_called_emsg = called_emsg; + int called_emsg_before = called_emsg; + char_u *p = arg; + int do_emsg_silent; - called_emsg = FALSE; ch_log(channel, "Executing ex command '%s'", (char *)arg); - ++emsg_silent; + do_emsg_silent = !checkforcmd(&p, "echoerr", 5); + if (do_emsg_silent) + ++emsg_silent; do_cmdline_cmd(arg); - --emsg_silent; - if (called_emsg) + if (do_emsg_silent) + --emsg_silent; + if (called_emsg > called_emsg_before) ch_log(channel, "Ex command error: '%s'", (char *)get_vim_var_str(VV_ERRMSG)); - called_emsg = save_called_emsg; } else if (STRCMP(cmd, "normal") == 0) { exarg_T ea; ch_log(channel, "Executing normal command '%s'", (char *)arg); - vim_memset(&ea, 0, sizeof(ea)); + CLEAR_FIELD(ea); ea.arg = arg; ea.addr_count = 0; - ea.forceit = TRUE; /* no mapping */ + ea.forceit = TRUE; // no mapping ex_normal(&ea); } else if (STRCMP(cmd, "redraw") == 0) @@ -2398,7 +2738,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) exarg_T ea; ch_log(channel, "redraw"); - vim_memset(&ea, 0, sizeof(ea)); + CLEAR_FIELD(ea); ea.forceit = *arg != NUL; ex_redraw(&ea); showruler(FALSE); @@ -2415,13 +2755,13 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) { ch_error(channel, "last argument for expr/call must be a number"); if (p_verbose > 2) - emsg(_("E904: last argument for expr/call must be a number")); + emsg(_(e_last_argument_for_expr_call_must_be_number)); } else if (is_call && argv[2].v_type != VAR_LIST) { ch_error(channel, "third argument for call must be a list"); if (p_verbose > 2) - emsg(_("E904: third argument for call must be a list")); + emsg(_(e_third_argument_for_call_must_be_list)); } else { @@ -2430,8 +2770,9 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) typval_T err_tv; char_u *json = NULL; - /* Don't pollute the display with errors. */ - ++emsg_skip; + // Don't pollute the display with errors. + // Do generate the errors so that try/catch works. + ++emsg_silent; if (!is_call) { ch_log(channel, "Evaluating expression '%s'", (char *)arg); @@ -2452,8 +2793,8 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) json = json_encode_nr_expr(id, tv, options | JSON_NL); if (tv == NULL || (json != NULL && *json == NUL)) { - /* If evaluation failed or the result can't be encoded - * then return the string "ERROR". */ + // If evaluation failed or the result can't be encoded + // then return the string "ERROR". vim_free(json); err_tv.v_type = VAR_STRING; err_tv.vval.v_string = (char_u *)"ERROR"; @@ -2467,7 +2808,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) vim_free(json); } } - --emsg_skip; + --emsg_silent; if (tv == &res_tv) clear_tv(tv); else @@ -2477,7 +2818,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv) else if (p_verbose > 2) { ch_error(channel, "Received unknown command: %s", (char *)cmd); - semsg(_("E905: received unknown command: %s"), cmd); + semsg(_(e_received_unknown_command_str), cmd); } } @@ -2494,8 +2835,8 @@ invoke_one_time_callback( { ch_log(channel, "Invoking one-time callback %s", (char *)item->cq_callback.cb_name); - /* Remove the item from the list first, if the callback - * invokes ch_close() the list will be cleared. */ + // Remove the item from the list first, if the callback + // invokes ch_close() the list will be cleared. remove_cb_node(cbhead, item); invoke_callback(channel, &item->cq_callback, argv); free_callback(&item->cq_callback); @@ -2505,9 +2846,7 @@ invoke_one_time_callback( static void append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part) { - bufref_T save_curbuf = {NULL, 0, 0}; - win_T *save_curwin = NULL; - tabpage_T *save_curtab = NULL; + aco_save_T aco; linenr_T lnum = buffer->b_ml.ml_line_count; int save_write_to = buffer->b_write_to_channel; chanpart_T *ch_part = &channel->ch_part[part]; @@ -2524,29 +2863,30 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part) return; } - /* If the buffer is also used as input insert above the last - * line. Don't write these lines. */ + // If the buffer is also used as input insert above the last + // line. Don't write these lines. if (save_write_to) { --lnum; buffer->b_write_to_channel = FALSE; } - /* Append to the buffer */ - ch_log(channel, "appending line %d to buffer", (int)lnum + 1 - empty); + // Append to the buffer + ch_log(channel, "appending line %d to buffer %s", + (int)lnum + 1 - empty, buffer->b_fname); buffer->b_p_ma = TRUE; - /* Save curbuf/curwin/curtab and make "buffer" the current buffer. */ - switch_to_win_for_buf(buffer, &save_curwin, &save_curtab, &save_curbuf); + // set curbuf to be our buf, temporarily + aucmd_prepbuf(&aco, buffer); u_sync(TRUE); - /* ignore undo failure, undo is not very useful here */ + // ignore undo failure, undo is not very useful here vim_ignored = u_save(lnum - empty, lnum + 1); if (empty) { - /* The buffer is empty, replace the first (dummy) line. */ + // The buffer is empty, replace the first (dummy) line. ml_replace(lnum, msg, TRUE); lnum = 0; } @@ -2554,8 +2894,8 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part) ml_append(lnum, msg, 0, FALSE); appended_lines_mark(lnum, 1L); - /* Restore curbuf/curwin/curtab */ - restore_win_for_buf(save_curwin, save_curtab, &save_curbuf); + // reset notion of buffer + aucmd_restbuf(&aco); if (ch_part->ch_nomodifiable) buffer->b_p_ma = FALSE; @@ -2579,9 +2919,10 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part) // down. If the topline is outdated update it now. if (move_cursor || wp->w_topline > buffer->b_ml.ml_line_count) { + win_T *save_curwin = curwin; + if (move_cursor) ++wp->w_cursor.lnum; - save_curwin = curwin; curwin = wp; curbuf = curwin->w_buffer; scroll_cursor_bot(0, FALSE); @@ -2598,10 +2939,10 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part) { channel_T *ch; - /* Find channels reading from this buffer and adjust their - * next-to-read line number. */ + // Find channels reading from this buffer and adjust their + // next-to-read line number. buffer->b_write_to_channel = TRUE; - for (ch = first_channel; ch != NULL; ch = ch->ch_next) + FOR_ALL_CHANNELS(ch) { chanpart_T *in_part = &ch->ch_part[PART_IN]; @@ -2623,6 +2964,18 @@ drop_messages(channel_T *channel, ch_part_T part) } } +/* + * Return TRUE if for "channel" / "part" ch_json_head should be used. + */ + static int +channel_use_json_head(channel_T *channel, ch_part_T part) +{ + ch_mode_T ch_mode = channel->ch_part[part].ch_mode; + + return ch_mode == CH_MODE_JSON || ch_mode == CH_MODE_JS + || ch_mode == CH_MODE_LSP; +} + /* * Invoke a callback for "channel"/"part" if needed. * This does not redraw but sets channel_need_redraw when redraw is needed. @@ -2642,12 +2995,13 @@ may_invoke_callback(channel_T *channel, ch_part_T part) callback_T *callback = NULL; buf_T *buffer = NULL; char_u *p; + int called_otc; // one time callbackup if (channel->ch_nb_close_cb != NULL) - /* this channel is handled elsewhere (netbeans) */ + // this channel is handled elsewhere (netbeans) return FALSE; - /* Use a message-specific callback, part callback or channel callback */ + // Use a message-specific callback, part callback or channel callback for (cbitem = cbhead->cq_next; cbitem != NULL; cbitem = cbitem->cq_next) if (cbitem->cq_seq_nr == 0) break; @@ -2662,75 +3016,99 @@ may_invoke_callback(channel_T *channel, ch_part_T part) if (buffer != NULL && (!bufref_valid(&ch_part->ch_bufref) || buffer->b_ml.ml_mfp == NULL)) { - /* buffer was wiped out or unloaded */ + // buffer was wiped out or unloaded ch_log(channel, "%s buffer has been wiped out", part_names[part]); ch_part->ch_bufref.br_buf = NULL; buffer = NULL; } - if (ch_mode == MODE_JSON || ch_mode == MODE_JS) + if (channel_use_json_head(channel, part)) { listitem_T *item; int argc = 0; - /* Get any json message in the queue. */ + // Get any json message in the queue. if (channel_get_json(channel, part, -1, FALSE, &listtv) == FAIL) { - /* Parse readahead, return when there is still no message. */ + if (ch_mode == CH_MODE_LSP) + // In the "lsp" mode, the http header and the json payload may + // be received in multiple messages. So concatenate all the + // received messages. + (void)channel_collapse(channel, part, FALSE); + + // Parse readahead, return when there is still no message. channel_parse_json(channel, part); if (channel_get_json(channel, part, -1, FALSE, &listtv) == FAIL) return FALSE; } - for (item = listtv->vval.v_list->lv_first; - item != NULL && argc < CH_JSON_MAX_ARGS; - item = item->li_next) - argv[argc++] = item->li_tv; - while (argc < CH_JSON_MAX_ARGS) - argv[argc++].v_type = VAR_UNKNOWN; - - if (argv[0].v_type == VAR_STRING) + if (ch_mode == CH_MODE_LSP) { - /* ["cmd", arg] or ["cmd", arg, arg] or ["cmd", arg, arg, arg] */ - channel_exe_cmd(channel, part, argv); - free_tv(listtv); - return TRUE; - } + dict_T *d = listtv->vval.v_dict; + dictitem_T *di; + + seq_nr = 0; + if (d != NULL) + { + di = dict_find(d, (char_u *)"id", -1); + if (di != NULL && di->di_tv.v_type == VAR_NUMBER) + seq_nr = di->di_tv.vval.v_number; + } - if (argv[0].v_type != VAR_NUMBER) + argv[1] = *listtv; + } + else { - ch_error(channel, - "Dropping message with invalid sequence number type"); - free_tv(listtv); - return FALSE; + for (item = listtv->vval.v_list->lv_first; + item != NULL && argc < CH_JSON_MAX_ARGS; + item = item->li_next) + argv[argc++] = item->li_tv; + while (argc < CH_JSON_MAX_ARGS) + argv[argc++].v_type = VAR_UNKNOWN; + + if (argv[0].v_type == VAR_STRING) + { + // ["cmd", arg] or ["cmd", arg, arg] or ["cmd", arg, arg, arg] + channel_exe_cmd(channel, part, argv); + free_tv(listtv); + return TRUE; + } + + if (argv[0].v_type != VAR_NUMBER) + { + ch_error(channel, + "Dropping message with invalid sequence number type"); + free_tv(listtv); + return FALSE; + } + seq_nr = argv[0].vval.v_number; } - seq_nr = argv[0].vval.v_number; } else if (channel_peek(channel, part) == NULL) { - /* nothing to read on RAW or NL channel */ + // nothing to read on RAW or NL channel return FALSE; } else { - /* If there is no callback or buffer drop the message. */ + // If there is no callback or buffer drop the message. if (callback == NULL && buffer == NULL) { - /* If there is a close callback it may use ch_read() to get the - * messages. */ + // If there is a close callback it may use ch_read() to get the + // messages. if (channel->ch_close_cb.cb_name == NULL && !channel->ch_drop_never) drop_messages(channel, part); return FALSE; } - if (ch_mode == MODE_NL) + if (ch_mode == CH_MODE_NL) { char_u *nl = NULL; char_u *buf; readq_T *node; - /* See if we have a message ending in NL in the first buffer. If - * not try to concatenate the first and the second buffer. */ + // See if we have a message ending in NL in the first buffer. If + // not try to concatenate the first and the second buffer. while (TRUE) { node = channel_peek(channel, part); @@ -2741,7 +3119,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part) { if (ch_part->ch_fd == INVALID_FD && node->rq_buflen > 0) break; - return FALSE; /* incomplete message */ + return FALSE; // incomplete message } } buf = node->rq_buffer; @@ -2765,45 +3143,56 @@ may_invoke_callback(channel_T *channel, ch_part_T part) } else { - /* Copy the message into allocated memory (excluding the NL) - * and remove it from the buffer (including the NL). */ - msg = vim_strnsave(buf, (int)(nl - buf)); + // Copy the message into allocated memory (excluding the NL) + // and remove it from the buffer (including the NL). + msg = vim_strnsave(buf, nl - buf); channel_consume(channel, part, (int)(nl - buf) + 1); } } else { - /* For a raw channel we don't know where the message ends, just - * get everything we have. - * Convert NUL to NL, the internal representation. */ + // For a raw channel we don't know where the message ends, just + // get everything we have. + // Convert NUL to NL, the internal representation. msg = channel_get_all(channel, part, NULL); } if (msg == NULL) - return FALSE; /* out of memory (and avoids Coverity warning) */ + return FALSE; // out of memory (and avoids Coverity warning) argv[1].v_type = VAR_STRING; argv[1].vval.v_string = msg; } + called_otc = FALSE; if (seq_nr > 0) { - int done = FALSE; - - /* JSON or JS mode: invoke the one-time callback with the matching nr */ + // JSON or JS or LSP mode: invoke the one-time callback with the + // matching nr for (cbitem = cbhead->cq_next; cbitem != NULL; cbitem = cbitem->cq_next) if (cbitem->cq_seq_nr == seq_nr) { invoke_one_time_callback(channel, cbhead, cbitem, argv); - done = TRUE; + called_otc = TRUE; break; } - if (!done) + } + + if (seq_nr > 0 && (ch_mode != CH_MODE_LSP || called_otc)) + { + if (!called_otc) { + // If the 'drop' channel attribute is set to 'never' or if + // ch_evalexpr() is waiting for this response message, then don't + // drop this message. if (channel->ch_drop_never) { - /* message must be read with ch_read() */ + // message must be read with ch_read() channel_push_json(channel, part, listtv); + + // Change the type to avoid the value being freed. + listtv->v_type = VAR_NUMBER; + free_tv(listtv); listtv = NULL; } else @@ -2816,7 +3205,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part) if (buffer != NULL) { if (msg == NULL) - /* JSON or JS mode: re-encode the message. */ + // JSON or JS mode: re-encode the message. msg = json_encode(listtv, ch_mode); if (msg != NULL) { @@ -2835,7 +3224,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part) invoke_one_time_callback(channel, cbhead, cbitem, argv); else { - /* invoke the channel callback */ + // invoke the channel callback ch_log(channel, "Invoking channel callback %s", (char *)callback->cb_name); invoke_callback(channel, callback, argv); @@ -2879,14 +3268,13 @@ channel_is_open(channel_T *channel) } /* - * Return TRUE if "channel" has JSON or other typeahead. + * Return a pointer indicating the readahead. Can only be compared between + * calls. Returns NULL if there is no readahead. */ - static int -channel_has_readahead(channel_T *channel, ch_part_T part) + static void * +channel_readahead_pointer(channel_T *channel, ch_part_T part) { - ch_mode_T ch_mode = channel->ch_part[part].ch_mode; - - if (ch_mode == MODE_JSON || ch_mode == MODE_JS) + if (channel_use_json_head(channel, part)) { jsonq_T *head = &channel->ch_part[part].ch_json_head; @@ -2895,16 +3283,25 @@ channel_has_readahead(channel_T *channel, ch_part_T part) // process. channel_parse_json(channel, part); - return head->jq_next != NULL; + return head->jq_next; } - return channel_peek(channel, part) != NULL; + return channel_peek(channel, part); +} + +/* + * Return TRUE if "channel" has JSON or other typeahead. + */ + static int +channel_has_readahead(channel_T *channel, ch_part_T part) +{ + return channel_readahead_pointer(channel, part) != NULL; } /* * Return a string indicating the status of the channel. * If "req_part" is not negative check that part. */ - char * + static char * channel_status(channel_T *channel, int req_part) { ch_part_T part; @@ -2947,7 +3344,7 @@ channel_status(channel_T *channel, int req_part) channel_part_info(channel_T *channel, dict_T *dict, char *name, ch_part_T part) { chanpart_T *chanpart = &channel->ch_part[part]; - char namebuf[20]; /* longest is "sock_timeout" */ + char namebuf[20]; // longest is "sock_timeout" size_t tail; char *status; char *s = ""; @@ -2968,10 +3365,11 @@ channel_part_info(channel_T *channel, dict_T *dict, char *name, ch_part_T part) STRCPY(namebuf + tail, "mode"); switch (chanpart->ch_mode) { - case MODE_NL: s = "NL"; break; - case MODE_RAW: s = "RAW"; break; - case MODE_JSON: s = "JSON"; break; - case MODE_JS: s = "JS"; break; + case CH_MODE_NL: s = "NL"; break; + case CH_MODE_RAW: s = "RAW"; break; + case CH_MODE_JSON: s = "JSON"; break; + case CH_MODE_JS: s = "JS"; break; + case CH_MODE_LSP: s = "LSP"; break; } dict_add_string(dict, namebuf, (char_u *)s); @@ -3000,8 +3398,14 @@ channel_info(channel_T *channel, dict_T *dict) if (channel->ch_hostname != NULL) { - dict_add_string(dict, "hostname", (char_u *)channel->ch_hostname); - dict_add_number(dict, "port", channel->ch_port); + if (channel->ch_port) + { + dict_add_string(dict, "hostname", (char_u *)channel->ch_hostname); + dict_add_number(dict, "port", channel->ch_port); + } + else + // Unix-domain socket. + dict_add_string(dict, "path", (char_u *)channel->ch_hostname); channel_part_info(channel, dict, "sock", PART_SOCK); } else @@ -3035,7 +3439,11 @@ channel_close(channel_T *channel, int invoke_close_cb) { ch_part_T part; - /* Invoke callbacks and flush buffers before the close callback. */ +#ifdef FEAT_TERMINAL + // let the terminal know it is closing to avoid getting stuck + term_channel_closing(channel); +#endif + // Invoke callbacks and flush buffers before the close callback. if (channel->ch_close_cb.cb_name != NULL) ch_log(channel, "Invoking callbacks and flushing buffers before closing"); @@ -3044,8 +3452,8 @@ channel_close(channel_T *channel, int invoke_close_cb) if (channel->ch_close_cb.cb_name != NULL || channel->ch_part[part].ch_bufref.br_buf != NULL) { - /* Increment the refcount to avoid the channel being freed - * halfway. */ + // Increment the refcount to avoid the channel being freed + // halfway. ++channel->ch_refcount; if (channel->ch_close_cb.cb_name == NULL) ch_log(channel, "flushing %s buffers before closing", @@ -3061,8 +3469,8 @@ channel_close(channel_T *channel, int invoke_close_cb) typval_T argv[1]; typval_T rettv; - /* Increment the refcount to avoid the channel being freed - * halfway. */ + // Increment the refcount to avoid the channel being freed + // halfway. ++channel->ch_refcount; ch_log(channel, "Invoking close callback %s", (char *)channel->ch_close_cb.cb_name); @@ -3072,17 +3480,17 @@ channel_close(channel_T *channel, int invoke_close_cb) clear_tv(&rettv); channel_need_redraw = TRUE; - /* the callback is only called once */ + // the callback is only called once free_callback(&channel->ch_close_cb); if (channel_need_redraw) { channel_need_redraw = FALSE; - redraw_after_callback(TRUE); + redraw_after_callback(TRUE, FALSE); } if (!channel->ch_drop_never) - /* any remaining messages are useless now */ + // any remaining messages are useless now for (part = PART_SOCK; part < PART_IN; ++part) drop_messages(channel, part); @@ -3177,7 +3585,7 @@ channel_free_all(void) channel_T *channel; ch_log(NULL, "channel_free_all()"); - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) channel_clear(channel); #if TARGET_OS_IPHONE first_channel = NULL; @@ -3187,10 +3595,10 @@ channel_free_all(void) #endif -/* Sent when the netbeans channel is found closed when reading. */ +// Sent when the netbeans channel is found closed when reading. #define DETACH_MSG_RAW "DETACH\n" -/* Buffer size for reading incoming messages. */ +// Buffer size for reading incoming messages. #define MAXMSGSIZE 4096 #if defined(HAVE_SELECT) @@ -3203,7 +3611,7 @@ channel_fill_wfds(int maxfd_arg, fd_set *wfds) int maxfd = maxfd_arg; channel_T *ch; - for (ch = first_channel; ch != NULL; ch = ch->ch_next) + FOR_ALL_CHANNELS(ch) { chanpart_T *in_part = &ch->ch_part[PART_IN]; @@ -3228,7 +3636,7 @@ channel_fill_poll_write(int nfd_in, struct pollfd *fds) int nfd = nfd_in; channel_T *ch; - for (ch = first_channel; ch != NULL; ch = ch->ch_next) + FOR_ALL_CHANNELS(ch) { chanpart_T *in_part = &ch->ch_part[PART_IN]; @@ -3274,7 +3682,7 @@ channel_wait(channel_T *channel, sock_T fd, int timeout) DWORD deadline = GetTickCount() + timeout; int delay = 1; - /* reading from a pipe, not a socket */ + // reading from a pipe, not a socket while (TRUE) { int r = PeekNamedPipe((HANDLE)fd, NULL, 0, NULL, &nread, NULL); @@ -3290,14 +3698,14 @@ channel_wait(channel_T *channel, sock_T fd, int timeout) else if (r == 0) return CW_ERROR; - /* perhaps write some buffer lines */ + // perhaps write some buffer lines channel_write_any_lines(); sleep_time = deadline - GetTickCount(); if (sleep_time <= 0) break; - /* Wait for a little while. Very short at first, up to 10 msec - * after looping a few times. */ + // Wait for a little while. Very short at first, up to 10 msec + // after looping a few times. if (sleep_time > delay) sleep_time = delay; Sleep(sleep_time); @@ -3323,8 +3731,8 @@ channel_wait(channel_T *channel, sock_T fd, int timeout) FD_ZERO(&rfds); FD_SET((int)fd, &rfds); - /* Write lines to a pipe when a pipe can be written to. Need to - * set this every time, some buffers may be done. */ + // Write lines to a pipe when a pipe can be written to. Need to + // set this every time, some buffers may be done. maxfd = (int)fd + 1; FD_ZERO(&wfds); maxfd = channel_fill_wfds(maxfd, &wfds); @@ -3374,30 +3782,29 @@ ch_close_part_on_error( char msg[] = "%s(): Read %s from ch_part[%d], closing"; if (is_err) - /* Do not call emsg(), most likely the other end just exited. */ + // Do not call emsg(), most likely the other end just exited. ch_error(channel, msg, func, "error", part); else ch_log(channel, msg, func, "EOF", part); - /* Queue a "DETACH" netbeans message in the command queue in order to - * terminate the netbeans session later. Do not end the session here - * directly as we may be running in the context of a call to - * netbeans_parse_messages(): - * netbeans_parse_messages - * -> autocmd triggered while processing the netbeans cmd - * -> ui_breakcheck - * -> gui event loop or select loop - * -> channel_read() - * Only send "DETACH" for a netbeans channel. - */ + // Queue a "DETACH" netbeans message in the command queue in order to + // terminate the netbeans session later. Do not end the session here + // directly as we may be running in the context of a call to + // netbeans_parse_messages(): + // netbeans_parse_messages + // -> autocmd triggered while processing the netbeans cmd + // -> ui_breakcheck + // -> gui event loop or select loop + // -> channel_read() + // Only send "DETACH" for a netbeans channel. if (channel->ch_nb_close_cb != NULL) channel_save(channel, PART_SOCK, (char_u *)DETACH_MSG_RAW, (int)STRLEN(DETACH_MSG_RAW), FALSE, "PUT "); - /* When reading is not possible close this part of the channel. Don't - * close the channel yet, there may be something to read on another part. - * When stdout and stderr use the same FD we get the error only on one of - * them, also close the other. */ + // When reading is not possible close this part of the channel. Don't + // close the channel yet, there may be something to read on another part. + // When stdout and stderr use the same FD we get the error only on one of + // them, also close the other. if (part == PART_OUT || part == PART_ERR) { ch_part_T other = part == PART_OUT ? PART_ERR : PART_OUT; @@ -3408,7 +3815,7 @@ ch_close_part_on_error( ch_close_part(channel, part); #ifdef FEAT_GUI - /* Stop listening to GUI events right away. */ + // Stop listening to GUI events right away. channel_gui_unregister_one(channel, part); #endif } @@ -3445,17 +3852,17 @@ channel_read(channel_T *channel, ch_part_T part, char *func) } use_socket = fd == channel->CH_SOCK_FD; - /* Allocate a buffer to read into. */ + // Allocate a buffer to read into. if (buf == NULL) { buf = alloc(MAXMSGSIZE); if (buf == NULL) - return; /* out of memory! */ + return; // out of memory! } - /* Keep on reading for as long as there is something to read. - * Use select() or poll() to avoid blocking on a message that is exactly - * MAXMSGSIZE long. */ + // Keep on reading for as long as there is something to read. + // Use select() or poll() to avoid blocking on a message that is exactly + // MAXMSGSIZE long. for (;;) { if (channel_wait(channel, fd, 0) != CW_READY) @@ -3465,16 +3872,16 @@ channel_read(channel_T *channel, ch_part_T part, char *func) else len = fd_read(fd, (char *)buf, MAXMSGSIZE); if (len <= 0) - break; /* error or nothing more to read */ + break; // error or nothing more to read - /* Store the read message in the queue. */ + // Store the read message in the queue. channel_save(channel, part, buf, len, FALSE, "RECV "); readlen += len; if (len < MAXMSGSIZE) - break; /* did read everything that's available */ + break; // did read everything that's available } - /* Reading a disconnection (readlen == 0), or an error. */ + // Reading a disconnection (readlen == 0), or an error. if (readlen <= 0) { if (!channel->ch_keep_open) @@ -3482,7 +3889,7 @@ channel_read(channel_T *channel, ch_part_T part, char *func) } #if defined(CH_HAS_GUI) && defined(FEAT_GUI_GTK) else if (CH_HAS_GUI && gtk_main_level() > 0) - /* signal the main loop that there is something to read */ + // signal the main loop that there is something to read gtk_main_quit(); #endif } @@ -3507,26 +3914,26 @@ channel_read_block( readq_T *node; ch_log(channel, "Blocking %s read, timeout: %d msec", - mode == MODE_RAW ? "RAW" : "NL", timeout); + mode == CH_MODE_RAW ? "RAW" : "NL", timeout); while (TRUE) { node = channel_peek(channel, part); if (node != NULL) { - if (mode == MODE_RAW || (mode == MODE_NL + if (mode == CH_MODE_RAW || (mode == CH_MODE_NL && channel_first_nl(node) != NULL)) - /* got a complete message */ + // got a complete message break; - if (channel_collapse(channel, part, mode == MODE_NL) == OK) + if (channel_collapse(channel, part, mode == CH_MODE_NL) == OK) continue; - /* If not blocking or nothing more is coming then return what we - * have. */ + // If not blocking or nothing more is coming then return what we + // have. if (raw || fd == INVALID_FD) break; } - /* Wait for up to the channel timeout. */ + // Wait for up to the channel timeout. if (fd == INVALID_FD) return NULL; if (channel_wait(channel, fd, timeout) != CW_READY) @@ -3537,8 +3944,8 @@ channel_read_block( channel_read(channel, part, "channel_read_block"); } - /* We have a complete message now. */ - if (mode == MODE_RAW || outlen != NULL) + // We have a complete message now. + if (mode == CH_MODE_RAW || outlen != NULL) { msg = channel_get_all(channel, part, outlen); } @@ -3549,27 +3956,27 @@ channel_read_block( buf = node->rq_buffer; nl = channel_first_nl(node); - /* Convert NUL to NL, the internal representation. */ + // Convert NUL to NL, the internal representation. for (p = buf; (nl == NULL || p < nl) && p < buf + node->rq_buflen; ++p) if (*p == NUL) *p = NL; if (nl == NULL) { - /* must be a closed channel with missing NL */ + // must be a closed channel with missing NL msg = channel_get(channel, part, NULL); } else if (nl + 1 == buf + node->rq_buflen) { - /* get the whole buffer */ + // get the whole buffer msg = channel_get(channel, part, NULL); *nl = NUL; } else { - /* Copy the message into allocated memory and remove it from the - * buffer. */ - msg = vim_strnsave(buf, (int)(nl - buf)); + // Copy the message into allocated memory and remove it from the + // buffer. + msg = vim_strnsave(buf, nl - buf); channel_consume(channel, part, (int)(nl - buf) + 1); } } @@ -3609,6 +4016,7 @@ channel_read_json_block( sock_T fd; int timeout; chanpart_T *chanpart = &channel->ch_part[part]; + ch_mode_T mode = channel->ch_part[part].ch_mode; int retval = FAIL; ch_log(channel, "Blocking read JSON for id %d", id); @@ -3619,6 +4027,12 @@ channel_read_json_block( for (;;) { + if (mode == CH_MODE_LSP) + // In the "lsp" mode, the http header and the json payload may be + // received in multiple messages. So concatenate all the received + // messages. + (void)channel_collapse(channel, part, FALSE); + more = channel_parse_json(channel, part); // search for message "id" @@ -3631,13 +4045,23 @@ channel_read_json_block( if (!more) { - /* Handle any other messages in the queue. If done some more - * messages may have arrived. */ + void *prev_readahead_ptr = channel_readahead_pointer(channel, part); + void *readahead_ptr; + + // Handle any other messages in the queue. If done some more + // messages may have arrived. if (channel_parse_messages()) continue; - /* Wait for up to the timeout. If there was an incomplete message - * use the deadline for that. */ + // channel_parse_messages() may fill the queue with new data to + // process. Only loop when the readahead changed, otherwise we + // would busy-loop. + readahead_ptr = channel_readahead_pointer(channel, part); + if (readahead_ptr != NULL && readahead_ptr != prev_readahead_ptr) + continue; + + // Wait for up to the timeout. If there was an incomplete message + // use the deadline for that. timeout = timeout_arg; if (chanpart->ch_wait_len > 0) { @@ -3657,8 +4081,8 @@ channel_read_json_block( #endif if (timeout < 0) { - /* Something went wrong, channel_parse_json() didn't - * discard message. Cancel waiting. */ + // Something went wrong, channel_parse_json() didn't + // discard message. Cancel waiting. chanpart->ch_wait_len = 0; timeout = timeout_arg; } @@ -3711,7 +4135,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part) } else { - semsg(_(e_invarg2), tv_get_string(tv)); + semsg(_(e_invalid_argument_str), tv_get_string(tv)); return NULL; } if (channel != NULL && reading) @@ -3721,7 +4145,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part) if (check_open && (channel == NULL || (!channel_is_open(channel) && !(reading && has_readahead)))) { - emsg(_("E906: not an open channel")); + emsg(_(e_not_an_open_channel)); return NULL; } return channel; @@ -3741,10 +4165,15 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob) int id = -1; typval_T *listtv = NULL; - /* return an empty string by default */ + // return an empty string by default rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; + if (in_vim9script() + && (check_for_chan_or_job_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL)) + return; + clear_job_options(&opt); if (get_job_options(&argvars[1], &opt, JO_TIMEOUT + JO_PART + JO_ID, 0) == FAIL) @@ -3785,7 +4214,7 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob) vim_free(p); } } - else if (raw || mode == MODE_RAW || mode == MODE_NL) + else if (raw || mode == CH_MODE_RAW || mode == CH_MODE_NL) rettv->vval.v_string = channel_read_block(channel, part, timeout, raw, NULL); else @@ -3810,7 +4239,7 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob) free_job_options(&opt); } -# if defined(MSWIN) || defined(FEAT_GUI) || defined(PROTO) +#if defined(MSWIN) || defined(__HAIKU__) || defined(FEAT_GUI) || defined(PROTO) /* * Check the channels for anything that is ready to be read. * The data is put in the read queue. @@ -3823,12 +4252,12 @@ channel_handle_events(int only_keep_open) ch_part_T part; sock_T fd; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) { if (only_keep_open && !channel->ch_keep_open) continue; - /* check the socket and pipes */ + // check the socket and pipes for (part = PART_SOCK; part < PART_IN; ++part) { fd = channel->ch_part[part].ch_fd; @@ -3843,9 +4272,23 @@ channel_handle_events(int only_keep_open) "channel_handle_events"); } } + +# ifdef __HAIKU__ + // Workaround for Haiku: Since select/poll cannot detect EOF from tty, + // should close fds when the job has finished if 'channel' connects to + // the pty. + if (channel->ch_job != NULL) + { + job_T *job = channel->ch_job; + + if (job->jv_tty_out != NULL && job->jv_status == JOB_FINISHED) + for (part = PART_SOCK; part < PART_COUNT; ++part) + ch_close_part(channel, part); + } +# endif } } -# endif +#endif # if defined(FEAT_GUI) || defined(PROTO) /* @@ -3856,7 +4299,7 @@ channel_any_keep_open() { channel_T *channel; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) if (channel->ch_keep_open) return TRUE; return FALSE; @@ -3910,7 +4353,7 @@ channel_send( if (!channel->ch_error && fun != NULL) { ch_error(channel, "%s(): write while not connected", fun); - semsg(_("E630: %s(): write while not connected"), fun); + semsg(_(e_str_write_while_not_connected), fun); } channel->ch_error = TRUE; return FAIL; @@ -3937,7 +4380,7 @@ channel_send( if (wq->wq_next != NULL) { - /* first write what was queued */ + // first write what was queued buf = wq->wq_next->wq_ga.ga_data; len = wq->wq_next->wq_ga.ga_len; did_use_queue = TRUE; @@ -3945,7 +4388,7 @@ channel_send( else { if (len_arg == 0) - /* nothing to write, called from channel_select_check() */ + // nothing to write, called from channel_select_check() return OK; buf = buf_arg; len = len_arg; @@ -3969,7 +4412,7 @@ channel_send( || errno == EAGAIN #endif )) - res = 0; /* nothing got written */ + res = 0; // nothing got written if (res >= 0 && ch_part->ch_nonblocking) { @@ -3979,10 +4422,10 @@ channel_send( ch_log(channel, "Sent %d bytes now", res); if (res == len) { - /* Wrote all the buf[len] bytes. */ + // Wrote all the buf[len] bytes. if (entry != NULL) { - /* Remove the entry from the write queue. */ + // Remove the entry from the write queue. remove_from_writeque(wq, entry); continue; } @@ -3991,12 +4434,12 @@ channel_send( } else { - /* Wrote only buf[res] bytes, can't write more now. */ + // Wrote only buf[res] bytes, can't write more now. if (entry != NULL) { if (res > 0) { - /* Remove the bytes that were written. */ + // Remove the bytes that were written. mch_memmove(entry->wq_ga.ga_data, (char *)entry->wq_ga.ga_data + res, len - res); @@ -4012,14 +4455,14 @@ channel_send( } ch_log(channel, "Adding %d bytes to the write queue", len); - /* Append the not written bytes of the argument to the write - * buffer. Limit entries to 4000 bytes. */ + // Append the not written bytes of the argument to the write + // buffer. Limit entries to 4000 bytes. if (wq->wq_prev != NULL && wq->wq_prev->wq_ga.ga_len + len < 4000) { writeq_T *last = wq->wq_prev; - /* append to the last entry */ + // append to the last entry if (len > 0 && ga_grow(&last->wq_ga, len) == OK) { mch_memmove((char *)last->wq_ga.ga_data @@ -4056,7 +4499,7 @@ channel_send( if (!channel->ch_error && fun != NULL) { ch_error(channel, "%s(): write failed", fun); - semsg(_("E631: %s(): write failed"), fun); + semsg(_(e_str_write_failed), fun); } channel->ch_error = TRUE; return FAIL; @@ -4097,14 +4540,14 @@ send_common( if (get_job_options(&argvars[2], opt, JO_CALLBACK + JO_TIMEOUT, 0) == FAIL) return NULL; - /* Set the callback. An empty callback means no callback and not reading - * the response. With "ch_evalexpr()" and "ch_evalraw()" a callback is not - * allowed. */ + // Set the callback. An empty callback means no callback and not reading + // the response. With "ch_evalexpr()" and "ch_evalraw()" a callback is not + // allowed. if (opt->jo_callback.cb_name != NULL && *opt->jo_callback.cb_name != NUL) { if (eval) { - semsg(_("E917: Cannot use a callback with %s()"), fun); + semsg(_(e_cannot_use_callback_with_str), fun); return NULL; } channel_set_req_callback(channel, *part_read, &opt->jo_callback, id); @@ -4131,26 +4574,84 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval) ch_part_T part_read; jobopt_T opt; int timeout; + int callback_present = FALSE; - /* return an empty string by default */ + // return an empty string by default rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; + if (in_vim9script() + && (check_for_chan_or_job_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 2) == FAIL)) + return; + channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0); if (channel == NULL) return; part_send = channel_part_send(channel); ch_mode = channel_get_mode(channel, part_send); - if (ch_mode == MODE_RAW || ch_mode == MODE_NL) + if (ch_mode == CH_MODE_RAW || ch_mode == CH_MODE_NL) { - emsg(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel")); + emsg(_(e_cannot_use_evalexpr_sendexpr_with_raw_or_nl_channel)); return; } - id = ++channel->ch_last_msg_id; - text = json_encode_nr_expr(id, &argvars[1], - (ch_mode == MODE_JS ? JSON_JS : 0) | JSON_NL); + if (ch_mode == CH_MODE_LSP) + { + dict_T *d; + dictitem_T *di; + + // return an empty dict by default + if (rettv_dict_alloc(rettv) == FAIL) + return; + + if (argvars[1].v_type != VAR_DICT) + { + semsg(_(e_dict_required_for_argument_nr), 2); + return; + } + d = argvars[1].vval.v_dict; + di = dict_find(d, (char_u *)"id", -1); + if (di != NULL && di->di_tv.v_type != VAR_NUMBER) + { + // only number type is supported for the 'id' item + semsg(_(e_invalid_value_for_argument_str), "id"); + return; + } + + if (argvars[2].v_type == VAR_DICT) + if (dict_has_key(argvars[2].vval.v_dict, "callback")) + callback_present = TRUE; + + if (eval || callback_present) + { + // When evaluating an expression or sending an expression with a + // callback, always assign a generated ID + id = ++channel->ch_last_msg_id; + if (di == NULL) + dict_add_number(d, "id", id); + else + di->di_tv.vval.v_number = id; + } + else + { + // When sending an expression, if the message has an 'id' item, + // then use it. + id = 0; + if (di != NULL) + id = di->di_tv.vval.v_number; + } + if (!dict_has_key(d, "jsonrpc")) + dict_add_string(d, "jsonrpc", (char_u *)"2.0"); + text = json_encode_lsp_msg(&argvars[1]); + } + else + { + id = ++channel->ch_last_msg_id; + text = json_encode_nr_expr(id, &argvars[1], + (ch_mode == CH_MODE_JS ? JSON_JS : 0) | JSON_NL); + } if (text == NULL) return; @@ -4166,16 +4667,34 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval) if (channel_read_json_block(channel, part_read, timeout, id, &listtv) == OK) { - list_T *list = listtv->vval.v_list; + if (ch_mode == CH_MODE_LSP) + { + *rettv = *listtv; + // Change the type to avoid the value being freed. + listtv->v_type = VAR_NUMBER; + free_tv(listtv); + } + else + { + list_T *list = listtv->vval.v_list; - /* Move the item from the list and then change the type to - * avoid the value being freed. */ - *rettv = list->lv_last->li_tv; - list->lv_last->li_tv.v_type = VAR_NUMBER; - free_tv(listtv); + // Move the item from the list and then change the type to + // avoid the value being freed. + *rettv = list->lv_u.mat.lv_last->li_tv; + list->lv_u.mat.lv_last->li_tv.v_type = VAR_NUMBER; + free_tv(listtv); + } } } free_job_options(&opt); + if (ch_mode == CH_MODE_LSP && !eval && callback_present) + { + // if ch_sendexpr() is used to send a LSP message and a callback + // function is specified, then return the generated identifier for the + // message. The user can use this to cancel the request (if needed). + if (rettv->vval.v_dict != NULL) + dict_add_number(rettv->vval.v_dict, "id", id); + } } /* @@ -4192,10 +4711,16 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval) jobopt_T opt; int timeout; - /* return an empty string by default */ + // return an empty string by default rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; + if (in_vim9script() + && (check_for_chan_or_job_arg(argvars, 0) == FAIL + || check_for_string_or_blob_arg(argvars, 1) == FAIL + || check_for_opt_dict_arg(argvars, 2) == FAIL)) + return; + if (argvars[1].v_type == VAR_BLOB) { text = argvars[1].vval.v_blob->bv_ga.ga_data; @@ -4220,7 +4745,7 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval) free_job_options(&opt); } -#define KEEP_OPEN_TIME 20 /* msec */ +#define KEEP_OPEN_TIME 20 // msec #if (defined(UNIX) && !defined(HAVE_SELECT)) || defined(PROTO) /* @@ -4236,7 +4761,7 @@ channel_poll_setup(int nfd_in, void *fds_in, int *towait) struct pollfd *fds = fds_in; ch_part_T part; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) { for (part = PART_SOCK; part < PART_IN; ++part) { @@ -4246,9 +4771,9 @@ channel_poll_setup(int nfd_in, void *fds_in, int *towait) { if (channel->ch_keep_open) { - /* For unknown reason poll() returns immediately for a - * keep-open channel. Instead of adding it to the fds add - * a short timeout and check, like polling. */ + // For unknown reason poll() returns immediately for a + // keep-open channel. Instead of adding it to the fds add + // a short timeout and check, like polling. if (*towait < 0 || *towait > KEEP_OPEN_TIME) *towait = KEEP_OPEN_TIME; } @@ -4283,7 +4808,7 @@ channel_poll_check(int ret_in, void *fds_in) int idx; chanpart_T *in_part; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) { for (part = PART_SOCK; part < PART_IN; ++part) { @@ -4297,7 +4822,7 @@ channel_poll_check(int ret_in, void *fds_in) else if (channel->ch_part[part].ch_fd != INVALID_FD && channel->ch_keep_open) { - /* polling a keep-open channel */ + // polling a keep-open channel channel_read(channel, part, "channel_poll_check_keep_open"); } } @@ -4313,7 +4838,7 @@ channel_poll_check(int ret_in, void *fds_in) return ret; } -#endif /* UNIX && !HAVE_SELECT */ +#endif // UNIX && !HAVE_SELECT #if (!defined(MSWIN) && defined(HAVE_SELECT)) || defined(PROTO) @@ -4334,7 +4859,7 @@ channel_select_setup( fd_set *wfds = wfds_in; ch_part_T part; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) { for (part = PART_SOCK; part < PART_IN; ++part) { @@ -4344,9 +4869,9 @@ channel_select_setup( { if (channel->ch_keep_open) { - /* For unknown reason select() returns immediately for a - * keep-open channel. Instead of adding it to the rfds add - * a short timeout and check, like polling. */ + // For unknown reason select() returns immediately for a + // keep-open channel. Instead of adding it to the rfds add + // a short timeout and check, like polling. if (*tvp == NULL || tv->tv_sec > 0 || tv->tv_usec > KEEP_OPEN_TIME * 1000) { @@ -4383,7 +4908,7 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in) ch_part_T part; chanpart_T *in_part; - for (channel = first_channel; channel != NULL; channel = channel->ch_next) + FOR_ALL_CHANNELS(channel) { for (part = PART_SOCK; part < PART_IN; ++part) { @@ -4397,7 +4922,7 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in) } else if (fd != INVALID_FD && channel->ch_keep_open) { - /* polling a keep-open channel */ + // polling a keep-open channel channel_read(channel, part, "channel_select_check_keep_open"); } } @@ -4411,6 +4936,20 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in) channel_write_input(channel); --ret; } + +# ifdef __HAIKU__ + // Workaround for Haiku: Since select/poll cannot detect EOF from tty, + // should close fds when the job has finished if 'channel' connects to + // the pty. + if (channel->ch_job != NULL) + { + job_T *job = channel->ch_job; + + if (job->jv_tty_out != NULL && job->jv_status == JOB_FINISHED) + for (part = PART_SOCK; part < PART_COUNT; ++part) + ch_close_part(channel, part); + } +# endif } return ret; @@ -4430,16 +4969,22 @@ channel_parse_messages(void) int ret = FALSE; int r; ch_part_T part = PART_SOCK; + static int recursive = 0; #ifdef ELAPSED_FUNC elapsed_T start_tv; - - ELAPSED_INIT(start_tv); #endif + // The code below may invoke callbacks, which might call us back. + // In a recursive call channels will not be closed. + ++recursive; ++safe_to_invoke_callback; - /* Only do this message when another message was given, otherwise we get - * lots of them. */ +#ifdef ELAPSED_FUNC + ELAPSED_INIT(start_tv); +#endif + + // Only do this message when another message was given, otherwise we get + // lots of them. if ((did_repeated_msg & REPEATED_MSG_LOOKING) == 0) { ch_log(NULL, "looking for messages on channels"); @@ -4448,53 +4993,56 @@ channel_parse_messages(void) } while (channel != NULL) { - if (channel_can_close(channel)) - { - channel->ch_to_be_closed = (1U << PART_COUNT); - channel_close_now(channel); - // channel may have been freed, start over - channel = first_channel; - continue; - } - if (channel->ch_to_be_freed || channel->ch_killing) + if (recursive == 1) { - if (channel->ch_killing) + if (channel_can_close(channel)) + { + channel->ch_to_be_closed = (1U << PART_COUNT); + channel_close_now(channel); + // channel may have been freed, start over + channel = first_channel; + continue; + } + if (channel->ch_to_be_freed || channel->ch_killing) { channel_free_contents(channel); - channel->ch_job->jv_channel = NULL; + if (channel->ch_job != NULL) + channel->ch_job->jv_channel = NULL; + + // free the channel and then start over + channel_free_channel(channel); + channel = first_channel; + continue; + } + if (channel->ch_refcount == 0 && !channel_still_useful(channel)) + { + // channel is no longer useful, free it + channel_free(channel); + channel = first_channel; + part = PART_SOCK; + continue; } - channel_free(channel); - // channel has been freed, start over - channel = first_channel; - continue; - } - if (channel->ch_refcount == 0 && !channel_still_useful(channel)) - { - // channel is no longer useful, free it - channel_free(channel); - channel = first_channel; - part = PART_SOCK; - continue; } + if (channel->ch_part[part].ch_fd != INVALID_FD || channel_has_readahead(channel, part)) { - /* Increase the refcount, in case the handler causes the channel - * to be unreferenced or closed. */ + // Increase the refcount, in case the handler causes the channel + // to be unreferenced or closed. ++channel->ch_refcount; r = may_invoke_callback(channel, part); if (r == OK) ret = TRUE; if (channel_unref(channel) || (r == OK #ifdef ELAPSED_FUNC - /* Limit the time we loop here to 100 msec, otherwise - * Vim becomes unresponsive when the callback takes - * more than a bit of time. */ + // Limit the time we loop here to 100 msec, otherwise + // Vim becomes unresponsive when the callback takes + // more than a bit of time. && ELAPSED_FUNC(start_tv) < 100L #endif )) { - /* channel was freed or something was done, start over */ + // channel was freed or something was done, start over channel = first_channel; part = PART_SOCK; continue; @@ -4512,10 +5060,11 @@ channel_parse_messages(void) if (channel_need_redraw) { channel_need_redraw = FALSE; - redraw_after_callback(TRUE); + redraw_after_callback(TRUE, FALSE); } --safe_to_invoke_callback; + --recursive; return ret; } @@ -4590,13 +5139,13 @@ channel_part_read(channel_T *channel) /* * Return the mode of "channel"/"part" - * If "channel" is invalid returns MODE_JSON. + * If "channel" is invalid returns CH_MODE_JSON. */ static ch_mode_T channel_get_mode(channel_T *channel, ch_part_T part) { if (channel == NULL) - return MODE_JSON; + return CH_MODE_JSON; return channel->ch_part[part].ch_mode; } @@ -4609,1633 +5158,76 @@ channel_get_timeout(channel_T *channel, ch_part_T part) return channel->ch_part[part].ch_timeout; } - static int -handle_mode(typval_T *item, jobopt_T *opt, ch_mode_T *modep, int jo) -{ - char_u *val = tv_get_string(item); - - opt->jo_set |= jo; - if (STRCMP(val, "nl") == 0) - *modep = MODE_NL; - else if (STRCMP(val, "raw") == 0) - *modep = MODE_RAW; - else if (STRCMP(val, "js") == 0) - *modep = MODE_JS; - else if (STRCMP(val, "json") == 0) - *modep = MODE_JSON; - else - { - semsg(_(e_invarg2), val); - return FAIL; - } - return OK; -} - - static int -handle_io(typval_T *item, ch_part_T part, jobopt_T *opt) -{ - char_u *val = tv_get_string(item); - - opt->jo_set |= JO_OUT_IO << (part - PART_OUT); - if (STRCMP(val, "null") == 0) - opt->jo_io[part] = JIO_NULL; - else if (STRCMP(val, "pipe") == 0) - opt->jo_io[part] = JIO_PIPE; - else if (STRCMP(val, "file") == 0) - opt->jo_io[part] = JIO_FILE; - else if (STRCMP(val, "buffer") == 0) - opt->jo_io[part] = JIO_BUFFER; - else if (STRCMP(val, "out") == 0 && part == PART_ERR) - opt->jo_io[part] = JIO_OUT; - else - { - semsg(_(e_invarg2), val); - return FAIL; - } - return OK; -} - /* - * Clear a jobopt_T before using it. + * "ch_canread()" function */ void -clear_job_options(jobopt_T *opt) +f_ch_canread(typval_T *argvars, typval_T *rettv) { - vim_memset(opt, 0, sizeof(jobopt_T)); + channel_T *channel; + + rettv->vval.v_number = 0; + if (in_vim9script() && check_for_chan_or_job_arg(argvars, 0) == FAIL) + return; + + channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); + if (channel != NULL) + rettv->vval.v_number = channel_has_readahead(channel, PART_SOCK) + || channel_has_readahead(channel, PART_OUT) + || channel_has_readahead(channel, PART_ERR); } /* - * Free any members of a jobopt_T. + * "ch_close()" function */ - static void -free_job_options(jobopt_T *opt) -{ - if (opt->jo_callback.cb_partial != NULL) - partial_unref(opt->jo_callback.cb_partial); - else if (opt->jo_callback.cb_name != NULL) - func_unref(opt->jo_callback.cb_name); - if (opt->jo_out_cb.cb_partial != NULL) - partial_unref(opt->jo_out_cb.cb_partial); - else if (opt->jo_out_cb.cb_name != NULL) - func_unref(opt->jo_out_cb.cb_name); - if (opt->jo_err_cb.cb_partial != NULL) - partial_unref(opt->jo_err_cb.cb_partial); - else if (opt->jo_err_cb.cb_name != NULL) - func_unref(opt->jo_err_cb.cb_name); - if (opt->jo_close_cb.cb_partial != NULL) - partial_unref(opt->jo_close_cb.cb_partial); - else if (opt->jo_close_cb.cb_name != NULL) - func_unref(opt->jo_close_cb.cb_name); - if (opt->jo_exit_cb.cb_partial != NULL) - partial_unref(opt->jo_exit_cb.cb_partial); - else if (opt->jo_exit_cb.cb_name != NULL) - func_unref(opt->jo_exit_cb.cb_name); - if (opt->jo_env != NULL) - dict_unref(opt->jo_env); + void +f_ch_close(typval_T *argvars, typval_T *rettv UNUSED) +{ + channel_T *channel; + + if (in_vim9script() && check_for_chan_or_job_arg(argvars, 0) == FAIL) + return; + + channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0); + if (channel != NULL) + { + channel_close(channel, FALSE); + channel_clear(channel); + } } /* - * Get the PART_ number from the first character of an option name. + * "ch_close()" function */ - static int -part_from_char(int c) + void +f_ch_close_in(typval_T *argvars, typval_T *rettv UNUSED) { - return c == 'i' ? PART_IN : c == 'o' ? PART_OUT: PART_ERR; + channel_T *channel; + + if (in_vim9script() && check_for_chan_or_job_arg(argvars, 0) == FAIL) + return; + + channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0); + if (channel != NULL) + channel_close_in(channel); } /* - * Get the option entries from the dict in "tv", parse them and put the result - * in "opt". - * Only accept JO_ options in "supported" and JO2_ options in "supported2". - * If an option value is invalid return FAIL. + * "ch_getbufnr()" function */ - int -get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) + void +f_ch_getbufnr(typval_T *argvars, typval_T *rettv) { - typval_T *item; - char_u *val; - dict_T *dict; - int todo; - hashitem_T *hi; - ch_part_T part; + channel_T *channel; - if (tv->v_type == VAR_UNKNOWN) - return OK; - if (tv->v_type != VAR_DICT) - { - emsg(_(e_dictreq)); - return FAIL; - } - dict = tv->vval.v_dict; - if (dict == NULL) - return OK; - - todo = (int)dict->dv_hashtab.ht_used; - for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) - if (!HASHITEM_EMPTY(hi)) - { - item = &dict_lookup(hi)->di_tv; - - if (STRCMP(hi->hi_key, "mode") == 0) - { - if (!(supported & JO_MODE)) - break; - if (handle_mode(item, opt, &opt->jo_mode, JO_MODE) == FAIL) - return FAIL; - } - else if (STRCMP(hi->hi_key, "in_mode") == 0) - { - if (!(supported & JO_IN_MODE)) - break; - if (handle_mode(item, opt, &opt->jo_in_mode, JO_IN_MODE) - == FAIL) - return FAIL; - } - else if (STRCMP(hi->hi_key, "out_mode") == 0) - { - if (!(supported & JO_OUT_MODE)) - break; - if (handle_mode(item, opt, &opt->jo_out_mode, JO_OUT_MODE) - == FAIL) - return FAIL; - } - else if (STRCMP(hi->hi_key, "err_mode") == 0) - { - if (!(supported & JO_ERR_MODE)) - break; - if (handle_mode(item, opt, &opt->jo_err_mode, JO_ERR_MODE) - == FAIL) - return FAIL; - } - else if (STRCMP(hi->hi_key, "noblock") == 0) - { - if (!(supported & JO_MODE)) - break; - opt->jo_noblock = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "in_io") == 0 - || STRCMP(hi->hi_key, "out_io") == 0 - || STRCMP(hi->hi_key, "err_io") == 0) - { - if (!(supported & JO_OUT_IO)) - break; - if (handle_io(item, part_from_char(*hi->hi_key), opt) == FAIL) - return FAIL; - } - else if (STRCMP(hi->hi_key, "in_name") == 0 - || STRCMP(hi->hi_key, "out_name") == 0 - || STRCMP(hi->hi_key, "err_name") == 0) - { - part = part_from_char(*hi->hi_key); - - if (!(supported & JO_OUT_IO)) - break; - opt->jo_set |= JO_OUT_NAME << (part - PART_OUT); - opt->jo_io_name[part] = - tv_get_string_buf_chk(item, opt->jo_io_name_buf[part]); - } - else if (STRCMP(hi->hi_key, "pty") == 0) - { - if (!(supported & JO_MODE)) - break; - opt->jo_pty = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "in_buf") == 0 - || STRCMP(hi->hi_key, "out_buf") == 0 - || STRCMP(hi->hi_key, "err_buf") == 0) - { - part = part_from_char(*hi->hi_key); - - if (!(supported & JO_OUT_IO)) - break; - opt->jo_set |= JO_OUT_BUF << (part - PART_OUT); - opt->jo_io_buf[part] = tv_get_number(item); - if (opt->jo_io_buf[part] <= 0) - { - semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); - return FAIL; - } - if (buflist_findnr(opt->jo_io_buf[part]) == NULL) - { - semsg(_(e_nobufnr), (long)opt->jo_io_buf[part]); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "out_modifiable") == 0 - || STRCMP(hi->hi_key, "err_modifiable") == 0) - { - part = part_from_char(*hi->hi_key); - - if (!(supported & JO_OUT_IO)) - break; - opt->jo_set |= JO_OUT_MODIFIABLE << (part - PART_OUT); - opt->jo_modifiable[part] = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "out_msg") == 0 - || STRCMP(hi->hi_key, "err_msg") == 0) - { - part = part_from_char(*hi->hi_key); - - if (!(supported & JO_OUT_IO)) - break; - opt->jo_set2 |= JO2_OUT_MSG << (part - PART_OUT); - opt->jo_message[part] = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "in_top") == 0 - || STRCMP(hi->hi_key, "in_bot") == 0) - { - linenr_T *lp; - - if (!(supported & JO_OUT_IO)) - break; - if (hi->hi_key[3] == 't') - { - lp = &opt->jo_in_top; - opt->jo_set |= JO_IN_TOP; - } - else - { - lp = &opt->jo_in_bot; - opt->jo_set |= JO_IN_BOT; - } - *lp = tv_get_number(item); - if (*lp < 0) - { - semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "channel") == 0) - { - if (!(supported & JO_OUT_IO)) - break; - opt->jo_set |= JO_CHANNEL; - if (item->v_type != VAR_CHANNEL) - { - semsg(_(e_invargval), "channel"); - return FAIL; - } - opt->jo_channel = item->vval.v_channel; - } - else if (STRCMP(hi->hi_key, "callback") == 0) - { - if (!(supported & JO_CALLBACK)) - break; - opt->jo_set |= JO_CALLBACK; - opt->jo_callback = get_callback(item); - if (opt->jo_callback.cb_name == NULL) - { - semsg(_(e_invargval), "callback"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "out_cb") == 0) - { - if (!(supported & JO_OUT_CALLBACK)) - break; - opt->jo_set |= JO_OUT_CALLBACK; - opt->jo_out_cb = get_callback(item); - if (opt->jo_out_cb.cb_name == NULL) - { - semsg(_(e_invargval), "out_cb"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "err_cb") == 0) - { - if (!(supported & JO_ERR_CALLBACK)) - break; - opt->jo_set |= JO_ERR_CALLBACK; - opt->jo_err_cb = get_callback(item); - if (opt->jo_err_cb.cb_name == NULL) - { - semsg(_(e_invargval), "err_cb"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "close_cb") == 0) - { - if (!(supported & JO_CLOSE_CALLBACK)) - break; - opt->jo_set |= JO_CLOSE_CALLBACK; - opt->jo_close_cb = get_callback(item); - if (opt->jo_close_cb.cb_name == NULL) - { - semsg(_(e_invargval), "close_cb"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "drop") == 0) - { - int never = FALSE; - val = tv_get_string(item); - - if (STRCMP(val, "never") == 0) - never = TRUE; - else if (STRCMP(val, "auto") != 0) - { - semsg(_(e_invargNval), "drop", val); - return FAIL; - } - opt->jo_drop_never = never; - } - else if (STRCMP(hi->hi_key, "exit_cb") == 0) - { - if (!(supported & JO_EXIT_CB)) - break; - opt->jo_set |= JO_EXIT_CB; - opt->jo_exit_cb = get_callback(item); - if (opt->jo_exit_cb.cb_name == NULL) - { - semsg(_(e_invargval), "exit_cb"); - return FAIL; - } - } -#ifdef FEAT_TERMINAL - else if (STRCMP(hi->hi_key, "term_name") == 0) - { - if (!(supported2 & JO2_TERM_NAME)) - break; - opt->jo_set2 |= JO2_TERM_NAME; - opt->jo_term_name = tv_get_string_chk(item); - if (opt->jo_term_name == NULL) - { - semsg(_(e_invargval), "term_name"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "term_finish") == 0) - { - if (!(supported2 & JO2_TERM_FINISH)) - break; - val = tv_get_string(item); - if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0) - { - semsg(_(e_invargNval), "term_finish", val); - return FAIL; - } - opt->jo_set2 |= JO2_TERM_FINISH; - opt->jo_term_finish = *val; - } - else if (STRCMP(hi->hi_key, "term_opencmd") == 0) - { - char_u *p; - - if (!(supported2 & JO2_TERM_OPENCMD)) - break; - opt->jo_set2 |= JO2_TERM_OPENCMD; - p = opt->jo_term_opencmd = tv_get_string_chk(item); - if (p != NULL) - { - /* Must have %d and no other %. */ - p = vim_strchr(p, '%'); - if (p != NULL && (p[1] != 'd' - || vim_strchr(p + 2, '%') != NULL)) - p = NULL; - } - if (p == NULL) - { - semsg(_(e_invargval), "term_opencmd"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "eof_chars") == 0) - { - char_u *p; - - if (!(supported2 & JO2_EOF_CHARS)) - break; - opt->jo_set2 |= JO2_EOF_CHARS; - p = opt->jo_eof_chars = tv_get_string_chk(item); - if (p == NULL) - { - semsg(_(e_invargval), "eof_chars"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "term_rows") == 0) - { - if (!(supported2 & JO2_TERM_ROWS)) - break; - opt->jo_set2 |= JO2_TERM_ROWS; - opt->jo_term_rows = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "term_cols") == 0) - { - if (!(supported2 & JO2_TERM_COLS)) - break; - opt->jo_set2 |= JO2_TERM_COLS; - opt->jo_term_cols = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "vertical") == 0) - { - if (!(supported2 & JO2_VERTICAL)) - break; - opt->jo_set2 |= JO2_VERTICAL; - opt->jo_vertical = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "curwin") == 0) - { - if (!(supported2 & JO2_CURWIN)) - break; - opt->jo_set2 |= JO2_CURWIN; - opt->jo_curwin = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "bufnr") == 0) - { - int nr; - - if (!(supported2 & JO2_CURWIN)) - break; - opt->jo_set2 |= JO2_BUFNR; - nr = tv_get_number(item); - if (nr <= 0) - { - semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); - return FAIL; - } - opt->jo_bufnr_buf = buflist_findnr(nr); - if (opt->jo_bufnr_buf == NULL) - { - semsg(_(e_nobufnr), (long)nr); - return FAIL; - } - if (opt->jo_bufnr_buf->b_nwindows == 0 - || opt->jo_bufnr_buf->b_term == NULL) - { - semsg(_(e_invarg2), "bufnr"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "hidden") == 0) - { - if (!(supported2 & JO2_HIDDEN)) - break; - opt->jo_set2 |= JO2_HIDDEN; - opt->jo_hidden = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "norestore") == 0) - { - if (!(supported2 & JO2_NORESTORE)) - break; - opt->jo_set2 |= JO2_NORESTORE; - opt->jo_term_norestore = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "term_kill") == 0) - { - if (!(supported2 & JO2_TERM_KILL)) - break; - opt->jo_set2 |= JO2_TERM_KILL; - opt->jo_term_kill = tv_get_string_chk(item); - } - else if (STRCMP(hi->hi_key, "tty_type") == 0) - { - char_u *p; - - if (!(supported2 & JO2_TTY_TYPE)) - break; - opt->jo_set2 |= JO2_TTY_TYPE; - p = tv_get_string_chk(item); - if (p == NULL) - { - semsg(_(e_invargval), "tty_type"); - return FAIL; - } - // Allow empty string, "winpty", "conpty". - if (!(*p == NUL || STRCMP(p, "winpty") == 0 - || STRCMP(p, "conpty") == 0)) - { - semsg(_(e_invargval), "tty_type"); - return FAIL; - } - opt->jo_tty_type = p[0]; - } -# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) - else if (STRCMP(hi->hi_key, "ansi_colors") == 0) - { - int n = 0; - listitem_T *li; - long_u rgb[16]; - - if (!(supported2 & JO2_ANSI_COLORS)) - break; - - if (item == NULL || item->v_type != VAR_LIST - || item->vval.v_list == NULL) - { - semsg(_(e_invargval), "ansi_colors"); - return FAIL; - } - - li = item->vval.v_list->lv_first; - for (; li != NULL && n < 16; li = li->li_next, n++) - { - char_u *color_name; - guicolor_T guicolor; - - color_name = tv_get_string_chk(&li->li_tv); - if (color_name == NULL) - return FAIL; - - guicolor = GUI_GET_COLOR(color_name); - if (guicolor == INVALCOLOR) - return FAIL; - - rgb[n] = GUI_MCH_GET_RGB(guicolor); - } - - if (n != 16 || li != NULL) - { - semsg(_(e_invargval), "ansi_colors"); - return FAIL; - } - - opt->jo_set2 |= JO2_ANSI_COLORS; - memcpy(opt->jo_ansi_colors, rgb, sizeof(rgb)); - } -# endif - else if (STRCMP(hi->hi_key, "term_api") == 0) - { - if (!(supported2 & JO2_TERM_API)) - break; - opt->jo_set2 |= JO2_TERM_API; - opt->jo_term_api = tv_get_string_buf_chk(item, - opt->jo_term_api_buf); - } -#endif - else if (STRCMP(hi->hi_key, "env") == 0) - { - if (!(supported2 & JO2_ENV)) - break; - if (item->v_type != VAR_DICT) - { - semsg(_(e_invargval), "env"); - return FAIL; - } - opt->jo_set2 |= JO2_ENV; - opt->jo_env = item->vval.v_dict; - if (opt->jo_env != NULL) - ++opt->jo_env->dv_refcount; - } - else if (STRCMP(hi->hi_key, "cwd") == 0) - { - if (!(supported2 & JO2_CWD)) - break; - opt->jo_cwd = tv_get_string_buf_chk(item, opt->jo_cwd_buf); - if (opt->jo_cwd == NULL || !mch_isdir(opt->jo_cwd) -#ifndef MSWIN // Win32 directories don't have the concept of "executable" - || mch_access((char *)opt->jo_cwd, X_OK) != 0 -#endif - ) - { - semsg(_(e_invargval), "cwd"); - return FAIL; - } - opt->jo_set2 |= JO2_CWD; - } - else if (STRCMP(hi->hi_key, "waittime") == 0) - { - if (!(supported & JO_WAITTIME)) - break; - opt->jo_set |= JO_WAITTIME; - opt->jo_waittime = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "timeout") == 0) - { - if (!(supported & JO_TIMEOUT)) - break; - opt->jo_set |= JO_TIMEOUT; - opt->jo_timeout = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "out_timeout") == 0) - { - if (!(supported & JO_OUT_TIMEOUT)) - break; - opt->jo_set |= JO_OUT_TIMEOUT; - opt->jo_out_timeout = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "err_timeout") == 0) - { - if (!(supported & JO_ERR_TIMEOUT)) - break; - opt->jo_set |= JO_ERR_TIMEOUT; - opt->jo_err_timeout = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "part") == 0) - { - if (!(supported & JO_PART)) - break; - opt->jo_set |= JO_PART; - val = tv_get_string(item); - if (STRCMP(val, "err") == 0) - opt->jo_part = PART_ERR; - else if (STRCMP(val, "out") == 0) - opt->jo_part = PART_OUT; - else - { - semsg(_(e_invargNval), "part", val); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "id") == 0) - { - if (!(supported & JO_ID)) - break; - opt->jo_set |= JO_ID; - opt->jo_id = tv_get_number(item); - } - else if (STRCMP(hi->hi_key, "stoponexit") == 0) - { - if (!(supported & JO_STOPONEXIT)) - break; - opt->jo_set |= JO_STOPONEXIT; - opt->jo_stoponexit = tv_get_string_buf_chk(item, - opt->jo_soe_buf); - if (opt->jo_stoponexit == NULL) - { - semsg(_(e_invargval), "stoponexit"); - return FAIL; - } - } - else if (STRCMP(hi->hi_key, "block_write") == 0) - { - if (!(supported & JO_BLOCK_WRITE)) - break; - opt->jo_set |= JO_BLOCK_WRITE; - opt->jo_block_write = tv_get_number(item); - } - else - break; - --todo; - } - if (todo > 0) - { - semsg(_(e_invarg2), hi->hi_key); - return FAIL; - } - - return OK; -} - -static __thread job_T *first_job = NULL; - - static void -job_free_contents(job_T *job) -{ - int i; - - ch_log(job->jv_channel, "Freeing job"); - if (job->jv_channel != NULL) - { - /* The link from the channel to the job doesn't count as a reference, - * thus don't decrement the refcount of the job. The reference from - * the job to the channel does count the reference, decrement it and - * NULL the reference. We don't set ch_job_killed, unreferencing the - * job doesn't mean it stops running. */ - job->jv_channel->ch_job = NULL; - channel_unref(job->jv_channel); - } - mch_clear_job(job); - - vim_free(job->jv_tty_in); - vim_free(job->jv_tty_out); - vim_free(job->jv_stoponexit); -#ifdef UNIX - vim_free(job->jv_termsig); -#endif -#ifdef MSWIN - vim_free(job->jv_tty_type); -#endif - free_callback(&job->jv_exit_cb); - if (job->jv_argv != NULL) - { - for (i = 0; job->jv_argv[i] != NULL; i++) - vim_free(job->jv_argv[i]); - vim_free(job->jv_argv); - } -} - -/* - * Remove "job" from the list of jobs. - */ - static void -job_unlink(job_T *job) -{ - if (job->jv_next != NULL) - job->jv_next->jv_prev = job->jv_prev; - if (job->jv_prev == NULL) - first_job = job->jv_next; - else - job->jv_prev->jv_next = job->jv_next; -} - - static void -job_free_job(job_T *job) -{ - job_unlink(job); - vim_free(job); -} - - static void -job_free(job_T *job) -{ - if (!in_free_unref_items) - { - job_free_contents(job); - job_free_job(job); - } -} - -static __thread job_T *jobs_to_free = NULL; - -/* - * Put "job" in a list to be freed later, when it's no longer referenced. - */ - static void -job_free_later(job_T *job) -{ - job_unlink(job); - job->jv_next = jobs_to_free; - jobs_to_free = job; -} - - static void -free_jobs_to_free_later(void) -{ - job_T *job; - - while (jobs_to_free != NULL) - { - job = jobs_to_free; - jobs_to_free = job->jv_next; - job_free_contents(job); - vim_free(job); - } -} - -#if defined(EXITFREE) || defined(PROTO) - void -job_free_all(void) -{ - while (first_job != NULL) - job_free(first_job); - free_jobs_to_free_later(); - -# ifdef FEAT_TERMINAL - free_unused_terminals(); -# endif -#if TARGET_OS_IPHONE - // probably not required - jobs_to_free = NULL; - first_job = NULL; -#endif -} -#endif - -/* - * Return TRUE if we need to check if the process of "job" has ended. - */ - static int -job_need_end_check(job_T *job) -{ - return job->jv_status == JOB_STARTED - && (job->jv_stoponexit != NULL || job->jv_exit_cb.cb_name != NULL); -} - -/* - * Return TRUE if the channel of "job" is still useful. - */ - static int -job_channel_still_useful(job_T *job) -{ - return job->jv_channel != NULL && channel_still_useful(job->jv_channel); -} - -/* - * Return TRUE if the channel of "job" is closeable. - */ - static int -job_channel_can_close(job_T *job) -{ - return job->jv_channel != NULL && channel_can_close(job->jv_channel); -} - -/* - * Return TRUE if the job should not be freed yet. Do not free the job when - * it has not ended yet and there is a "stoponexit" flag, an exit callback - * or when the associated channel will do something with the job output. - */ - static int -job_still_useful(job_T *job) -{ - return job_need_end_check(job) || job_channel_still_useful(job); -} - -#if defined(GUI_MAY_FORK) || defined(GUI_MAY_SPAWN) || defined(PROTO) -/* - * Return TRUE when there is any running job that we care about. - */ - int -job_any_running() -{ - job_T *job; - - for (job = first_job; job != NULL; job = job->jv_next) - if (job_still_useful(job)) - { - ch_log(NULL, "GUI not forking because a job is running"); - return TRUE; - } - return FALSE; -} -#endif - -#if !defined(USE_ARGV) || defined(PROTO) -/* - * Escape one argument for an external command. - * Returns the escaped string in allocated memory. NULL when out of memory. - */ - static char_u * -win32_escape_arg(char_u *arg) -{ - int slen, dlen; - int escaping = 0; - int i; - char_u *s, *d; - char_u *escaped_arg; - int has_spaces = FALSE; - - /* First count the number of extra bytes required. */ - slen = (int)STRLEN(arg); - dlen = slen; - for (s = arg; *s != NUL; MB_PTR_ADV(s)) - { - if (*s == '"' || *s == '\\') - ++dlen; - if (*s == ' ' || *s == '\t') - has_spaces = TRUE; - } - - if (has_spaces) - dlen += 2; - - if (dlen == slen) - return vim_strsave(arg); - - /* Allocate memory for the result and fill it. */ - escaped_arg = alloc(dlen + 1); - if (escaped_arg == NULL) - return NULL; - memset(escaped_arg, 0, dlen+1); - - d = escaped_arg; - - if (has_spaces) - *d++ = '"'; - - for (s = arg; *s != NUL;) - { - switch (*s) - { - case '"': - for (i = 0; i < escaping; i++) - *d++ = '\\'; - escaping = 0; - *d++ = '\\'; - *d++ = *s++; - break; - case '\\': - escaping++; - *d++ = *s++; - break; - default: - escaping = 0; - MB_COPY_CHAR(s, d); - break; - } - } - - /* add terminating quote and finish with a NUL */ - if (has_spaces) - { - for (i = 0; i < escaping; i++) - *d++ = '\\'; - *d++ = '"'; - } - *d = NUL; - - return escaped_arg; -} - -/* - * Build a command line from a list, taking care of escaping. - * The result is put in gap->ga_data. - * Returns FAIL when out of memory. - */ - int -win32_build_cmd(list_T *l, garray_T *gap) -{ - listitem_T *li; - char_u *s; - - for (li = l->lv_first; li != NULL; li = li->li_next) - { - s = tv_get_string_chk(&li->li_tv); - if (s == NULL) - return FAIL; - s = win32_escape_arg(s); - if (s == NULL) - return FAIL; - ga_concat(gap, s); - vim_free(s); - if (li->li_next != NULL) - ga_append(gap, ' '); - } - return OK; -} -#endif - -/* - * NOTE: Must call job_cleanup() only once right after the status of "job" - * changed to JOB_ENDED (i.e. after job_status() returned "dead" first or - * mch_detect_ended_job() returned non-NULL). - * If the job is no longer used it will be removed from the list of jobs, and - * deleted a bit later. - */ - void -job_cleanup(job_T *job) -{ - if (job->jv_status != JOB_ENDED) - return; - - /* Ready to cleanup the job. */ - job->jv_status = JOB_FINISHED; - - /* When only channel-in is kept open, close explicitly. */ - if (job->jv_channel != NULL) - ch_close_part(job->jv_channel, PART_IN); - - if (job->jv_exit_cb.cb_name != NULL) - { - typval_T argv[3]; - typval_T rettv; - - /* Invoke the exit callback. Make sure the refcount is > 0. */ - ch_log(job->jv_channel, "Invoking exit callback %s", - job->jv_exit_cb.cb_name); - ++job->jv_refcount; - argv[0].v_type = VAR_JOB; - argv[0].vval.v_job = job; - argv[1].v_type = VAR_NUMBER; - argv[1].vval.v_number = job->jv_exitval; - call_callback(&job->jv_exit_cb, -1, &rettv, 2, argv); - clear_tv(&rettv); - --job->jv_refcount; - channel_need_redraw = TRUE; - } - - if (job->jv_channel != NULL && job->jv_channel->ch_anonymous_pipe) - job->jv_channel->ch_killing = TRUE; - - // Do not free the job in case the close callback of the associated channel - // isn't invoked yet and may get information by job_info(). - if (job->jv_refcount == 0 && !job_channel_still_useful(job)) - // The job was already unreferenced and the associated channel was - // detached, now that it ended it can be freed. However, a caller might - // still use it, thus free it a bit later. - job_free_later(job); -} - -/* - * Mark references in jobs that are still useful. - */ - int -set_ref_in_job(int copyID) -{ - int abort = FALSE; - job_T *job; - typval_T tv; - - for (job = first_job; !abort && job != NULL; job = job->jv_next) - if (job_still_useful(job)) - { - tv.v_type = VAR_JOB; - tv.vval.v_job = job; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); - } - return abort; -} - -/* - * Dereference "job". Note that after this "job" may have been freed. - */ - void -job_unref(job_T *job) -{ - if (job != NULL && --job->jv_refcount <= 0) - { - /* Do not free the job if there is a channel where the close callback - * may get the job info. */ - if (!job_channel_still_useful(job)) - { - /* Do not free the job when it has not ended yet and there is a - * "stoponexit" flag or an exit callback. */ - if (!job_need_end_check(job)) - { - job_free(job); - } - else if (job->jv_channel != NULL) - { - /* Do remove the link to the channel, otherwise it hangs - * around until Vim exits. See job_free() for refcount. */ - ch_log(job->jv_channel, "detaching channel from job"); - job->jv_channel->ch_job = NULL; - channel_unref(job->jv_channel); - job->jv_channel = NULL; - } - } - } -} - - int -free_unused_jobs_contents(int copyID, int mask) -{ - int did_free = FALSE; - job_T *job; - - for (job = first_job; job != NULL; job = job->jv_next) - if ((job->jv_copyID & mask) != (copyID & mask) - && !job_still_useful(job)) - { - /* Free the channel and ordinary items it contains, but don't - * recurse into Lists, Dictionaries etc. */ - job_free_contents(job); - did_free = TRUE; - } - return did_free; -} - - void -free_unused_jobs(int copyID, int mask) -{ - job_T *job; - job_T *job_next; - - for (job = first_job; job != NULL; job = job_next) - { - job_next = job->jv_next; - if ((job->jv_copyID & mask) != (copyID & mask) - && !job_still_useful(job)) - { - /* Free the job struct itself. */ - job_free_job(job); - } - } -} - -/* - * Allocate a job. Sets the refcount to one and sets options default. - */ - job_T * -job_alloc(void) -{ - job_T *job; - - job = ALLOC_CLEAR_ONE(job_T); - if (job != NULL) - { - job->jv_refcount = 1; - job->jv_stoponexit = vim_strsave((char_u *)"term"); - - if (first_job != NULL) - { - first_job->jv_prev = job; - job->jv_next = first_job; - } - first_job = job; - } - return job; -} - - void -job_set_options(job_T *job, jobopt_T *opt) -{ - if (opt->jo_set & JO_STOPONEXIT) - { - vim_free(job->jv_stoponexit); - if (opt->jo_stoponexit == NULL || *opt->jo_stoponexit == NUL) - job->jv_stoponexit = NULL; - else - job->jv_stoponexit = vim_strsave(opt->jo_stoponexit); - } - if (opt->jo_set & JO_EXIT_CB) - { - free_callback(&job->jv_exit_cb); - if (opt->jo_exit_cb.cb_name == NULL || *opt->jo_exit_cb.cb_name == NUL) - { - job->jv_exit_cb.cb_name = NULL; - job->jv_exit_cb.cb_partial = NULL; - } - else - copy_callback(&job->jv_exit_cb, &opt->jo_exit_cb); - } -} - -/* - * Called when Vim is exiting: kill all jobs that have the "stoponexit" flag. - */ - void -job_stop_on_exit(void) -{ - job_T *job; - - for (job = first_job; job != NULL; job = job->jv_next) - if (job->jv_status == JOB_STARTED && job->jv_stoponexit != NULL) - mch_signal_job(job, job->jv_stoponexit); -} - -/* - * Return TRUE when there is any job that has an exit callback and might exit, - * which means job_check_ended() should be called more often. - */ - int -has_pending_job(void) -{ - job_T *job; - - for (job = first_job; job != NULL; job = job->jv_next) - /* Only should check if the channel has been closed, if the channel is - * open the job won't exit. */ - if ((job->jv_status == JOB_STARTED && !job_channel_still_useful(job)) - || (job->jv_status == JOB_FINISHED - && job_channel_can_close(job))) - return TRUE; - return FALSE; -} - -#define MAX_CHECK_ENDED 8 - -/* - * Called once in a while: check if any jobs that seem useful have ended. - * Returns TRUE if a job did end. - */ - int -job_check_ended(void) -{ - int i; - int did_end = FALSE; - - // be quick if there are no jobs to check - if (first_job == NULL) - return did_end; - - for (i = 0; i < MAX_CHECK_ENDED; ++i) - { - // NOTE: mch_detect_ended_job() must only return a job of which the - // status was just set to JOB_ENDED. - job_T *job = mch_detect_ended_job(first_job); - - if (job == NULL) - break; - did_end = TRUE; - job_cleanup(job); // may add "job" to jobs_to_free - } - - // Actually free jobs that were cleaned up. - free_jobs_to_free_later(); - - if (channel_need_redraw) - { - channel_need_redraw = FALSE; - redraw_after_callback(TRUE); - } - return did_end; -} - -/* - * Create a job and return it. Implements job_start(). - * "argv_arg" is only for Unix. - * When "argv_arg" is NULL then "argvars" is used. - * The returned job has a refcount of one. - * Returns NULL when out of memory. - */ - job_T * -job_start( - typval_T *argvars, - char **argv_arg UNUSED, - jobopt_T *opt_arg, - int is_terminal UNUSED) -{ - job_T *job; - char_u *cmd = NULL; - char **argv = NULL; - int argc = 0; -#if defined(UNIX) -# define USE_ARGV - int i; -#else - garray_T ga; -#endif - jobopt_T opt; - ch_part_T part; - - job = job_alloc(); - if (job == NULL) - return NULL; - - job->jv_status = JOB_FAILED; -#ifndef USE_ARGV - ga_init2(&ga, (int)sizeof(char*), 20); -#endif - - if (opt_arg != NULL) - opt = *opt_arg; - else - { - /* Default mode is NL. */ - clear_job_options(&opt); - opt.jo_mode = MODE_NL; - if (get_job_options(&argvars[1], &opt, - JO_MODE_ALL + JO_CB_ALL + JO_TIMEOUT_ALL + JO_STOPONEXIT - + JO_EXIT_CB + JO_OUT_IO + JO_BLOCK_WRITE, - JO2_ENV + JO2_CWD) == FAIL) - goto theend; - } - - /* Check that when io is "file" that there is a file name. */ - for (part = PART_OUT; part < PART_COUNT; ++part) - if ((opt.jo_set & (JO_OUT_IO << (part - PART_OUT))) - && opt.jo_io[part] == JIO_FILE - && (!(opt.jo_set & (JO_OUT_NAME << (part - PART_OUT))) - || *opt.jo_io_name[part] == NUL)) - { - emsg(_("E920: _io file requires _name to be set")); - goto theend; - } - - if ((opt.jo_set & JO_IN_IO) && opt.jo_io[PART_IN] == JIO_BUFFER) - { - buf_T *buf = NULL; - - /* check that we can find the buffer before starting the job */ - if (opt.jo_set & JO_IN_BUF) - { - buf = buflist_findnr(opt.jo_io_buf[PART_IN]); - if (buf == NULL) - semsg(_(e_nobufnr), (long)opt.jo_io_buf[PART_IN]); - } - else if (!(opt.jo_set & JO_IN_NAME)) - { - emsg(_("E915: in_io buffer requires in_buf or in_name to be set")); - } - else - buf = buflist_find_by_name(opt.jo_io_name[PART_IN], FALSE); - if (buf == NULL) - goto theend; - if (buf->b_ml.ml_mfp == NULL) - { - char_u numbuf[NUMBUFLEN]; - char_u *s; - - if (opt.jo_set & JO_IN_BUF) - { - sprintf((char *)numbuf, "%d", opt.jo_io_buf[PART_IN]); - s = numbuf; - } - else - s = opt.jo_io_name[PART_IN]; - semsg(_("E918: buffer must be loaded: %s"), s); - goto theend; - } - job->jv_in_buf = buf; - } - - job_set_options(job, &opt); - -#ifdef USE_ARGV - if (argv_arg != NULL) - { - /* Make a copy of argv_arg for job->jv_argv. */ - for (i = 0; argv_arg[i] != NULL; i++) - argc++; - argv = ALLOC_MULT(char *, argc + 1); - if (argv == NULL) - goto theend; - for (i = 0; i < argc; i++) - argv[i] = (char *)vim_strsave((char_u *)argv_arg[i]); - argv[argc] = NULL; - } - else -#endif - if (argvars[0].v_type == VAR_STRING) - { - /* Command is a string. */ - cmd = argvars[0].vval.v_string; - if (cmd == NULL || *cmd == NUL) - { - emsg(_(e_invarg)); - goto theend; - } - - if (build_argv_from_string(cmd, &argv, &argc) == FAIL) - goto theend; - } - else if (argvars[0].v_type != VAR_LIST - || argvars[0].vval.v_list == NULL - || argvars[0].vval.v_list->lv_len < 1) - { - emsg(_(e_invarg)); - goto theend; - } - else - { - list_T *l = argvars[0].vval.v_list; - - if (build_argv_from_list(l, &argv, &argc) == FAIL) - goto theend; -#ifndef USE_ARGV - if (win32_build_cmd(l, &ga) == FAIL) - goto theend; - cmd = ga.ga_data; -#endif - } - - /* Save the command used to start the job. */ - job->jv_argv = argv; - -#ifdef USE_ARGV - if (ch_log_active()) - { - garray_T ga; - - ga_init2(&ga, (int)sizeof(char), 200); - for (i = 0; i < argc; ++i) - { - if (i > 0) - ga_concat(&ga, (char_u *)" "); - ga_concat(&ga, (char_u *)argv[i]); - } - ga_append(&ga, NUL); - ch_log(NULL, "Starting job: %s", (char *)ga.ga_data); - ga_clear(&ga); - } - mch_job_start(argv, job, &opt, is_terminal); -#else - ch_log(NULL, "Starting job: %s", (char *)cmd); - mch_job_start((char *)cmd, job, &opt); -#endif - - /* If the channel is reading from a buffer, write lines now. */ - if (job->jv_channel != NULL) - channel_write_in(job->jv_channel); - -theend: -#ifndef USE_ARGV - vim_free(ga.ga_data); -#endif - if (argv != job->jv_argv) - vim_free(argv); - free_job_options(&opt); - return job; -} - -/* - * Get the status of "job" and invoke the exit callback when needed. - * The returned string is not allocated. - */ - char * -job_status(job_T *job) -{ - char *result; - - if (job->jv_status >= JOB_ENDED) - /* No need to check, dead is dead. */ - result = "dead"; - else if (job->jv_status == JOB_FAILED) - result = "fail"; - else - { - result = mch_job_status(job); - if (job->jv_status == JOB_ENDED) - job_cleanup(job); - } - return result; -} - -/* - * Send a signal to "job". Implements job_stop(). - * When "type" is not NULL use this for the type. - * Otherwise use argvars[1] for the type. - */ - int -job_stop(job_T *job, typval_T *argvars, char *type) -{ - char_u *arg; - - if (type != NULL) - arg = (char_u *)type; - else if (argvars[1].v_type == VAR_UNKNOWN) - arg = (char_u *)""; - else - { - arg = tv_get_string_chk(&argvars[1]); - if (arg == NULL) - { - emsg(_(e_invarg)); - return 0; - } - } - if (job->jv_status == JOB_FAILED) - { - ch_log(job->jv_channel, "Job failed to start, job_stop() skipped"); - return 0; - } - if (job->jv_status == JOB_ENDED) - { - ch_log(job->jv_channel, "Job has already ended, job_stop() skipped"); - return 0; - } - ch_log(job->jv_channel, "Stopping job with '%s'", (char *)arg); - if (mch_signal_job(job, arg) == FAIL) - return 0; - - /* Assume that only "kill" will kill the job. */ - if (job->jv_channel != NULL && STRCMP(arg, "kill") == 0) - job->jv_channel->ch_job_killed = TRUE; - - /* We don't try freeing the job, obviously the caller still has a - * reference to it. */ - return 1; -} - - void -invoke_prompt_callback(void) -{ - typval_T rettv; - typval_T argv[2]; - char_u *text; - char_u *prompt; - linenr_T lnum = curbuf->b_ml.ml_line_count; - - // Add a new line for the prompt before invoking the callback, so that - // text can always be inserted above the last line. - ml_append(lnum, (char_u *)"", 0, FALSE); - curwin->w_cursor.lnum = lnum + 1; - curwin->w_cursor.col = 0; - - if (curbuf->b_prompt_callback.cb_name == NULL - || *curbuf->b_prompt_callback.cb_name == NUL) - return; - text = ml_get(lnum); - prompt = prompt_text(); - if (STRLEN(text) >= STRLEN(prompt)) - text += STRLEN(prompt); - argv[0].v_type = VAR_STRING; - argv[0].vval.v_string = vim_strsave(text); - argv[1].v_type = VAR_UNKNOWN; - - call_callback(&curbuf->b_prompt_callback, -1, &rettv, 1, argv); - clear_tv(&argv[0]); - clear_tv(&rettv); -} - -/* - * Return TRUE when the interrupt callback was invoked. - */ - int -invoke_prompt_interrupt(void) -{ - typval_T rettv; - typval_T argv[1]; - - if (curbuf->b_prompt_interrupt.cb_name == NULL - || *curbuf->b_prompt_interrupt.cb_name == NUL) - return FALSE; - argv[0].v_type = VAR_UNKNOWN; - - got_int = FALSE; // don't skip executing commands - call_callback(&curbuf->b_prompt_interrupt, -1, &rettv, 0, argv); - clear_tv(&rettv); - return TRUE; -} - -/* - * "prompt_setcallback({buffer}, {callback})" function - */ - void -f_prompt_setcallback(typval_T *argvars, typval_T *rettv UNUSED) -{ - buf_T *buf; - callback_T callback; - - if (check_secure()) - return; - buf = tv_get_buf(&argvars[0], FALSE); - if (buf == NULL) - return; - - callback = get_callback(&argvars[1]); - if (callback.cb_name == NULL) - return; - - free_callback(&buf->b_prompt_callback); - set_callback(&buf->b_prompt_callback, &callback); -} - -/* - * "prompt_setinterrupt({buffer}, {callback})" function - */ - void -f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv UNUSED) -{ - buf_T *buf; - callback_T callback; - - if (check_secure()) - return; - buf = tv_get_buf(&argvars[0], FALSE); - if (buf == NULL) - return; - - callback = get_callback(&argvars[1]); - if (callback.cb_name == NULL) - return; - - free_callback(&buf->b_prompt_interrupt); - set_callback(&buf->b_prompt_interrupt, &callback); -} - -/* - * "prompt_setprompt({buffer}, {text})" function - */ - void -f_prompt_setprompt(typval_T *argvars, typval_T *rettv UNUSED) -{ - buf_T *buf; - char_u *text; + rettv->vval.v_number = -1; - if (check_secure()) - return; - buf = tv_get_buf(&argvars[0], FALSE); - if (buf == NULL) + if (in_vim9script() + && (check_for_chan_or_job_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL)) return; - text = tv_get_string(&argvars[1]); - vim_free(buf->b_prompt_text); - buf->b_prompt_text = vim_strsave(text); -} - -/* - * "ch_canread()" function - */ - void -f_ch_canread(typval_T *argvars, typval_T *rettv) -{ - channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); - - rettv->vval.v_number = 0; - if (channel != NULL) - rettv->vval.v_number = channel_has_readahead(channel, PART_SOCK) - || channel_has_readahead(channel, PART_OUT) - || channel_has_readahead(channel, PART_ERR); -} - -/* - * "ch_close()" function - */ - void -f_ch_close(typval_T *argvars, typval_T *rettv UNUSED) -{ - channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0); - - if (channel != NULL) - { - channel_close(channel, FALSE); - channel_clear(channel); - } -} - -/* - * "ch_close()" function - */ - void -f_ch_close_in(typval_T *argvars, typval_T *rettv UNUSED) -{ - channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0); - - if (channel != NULL) - channel_close_in(channel); -} - -/* - * "ch_getbufnr()" function - */ - void -f_ch_getbufnr(typval_T *argvars, typval_T *rettv) -{ - channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); - - rettv->vval.v_number = -1; + channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); if (channel != NULL) { char_u *what = tv_get_string(&argvars[1]); @@ -6261,8 +5253,12 @@ f_ch_getbufnr(typval_T *argvars, typval_T *rettv) void f_ch_getjob(typval_T *argvars, typval_T *rettv) { - channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); + channel_T *channel; + if (in_vim9script() && check_for_chan_or_job_arg(argvars, 0) == FAIL) + return; + + channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); if (channel != NULL) { rettv->v_type = VAR_JOB; @@ -6278,9 +5274,13 @@ f_ch_getjob(typval_T *argvars, typval_T *rettv) void f_ch_info(typval_T *argvars, typval_T *rettv UNUSED) { - channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); + channel_T *channel; - if (channel != NULL && rettv_dict_alloc(rettv) != FAIL) + if (in_vim9script() && check_for_chan_or_job_arg(argvars, 0) == FAIL) + return; + + channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); + if (channel != NULL && rettv_dict_alloc(rettv) == OK) channel_info(channel, rettv->vval.v_dict); } @@ -6290,9 +5290,15 @@ f_ch_info(typval_T *argvars, typval_T *rettv UNUSED) void f_ch_log(typval_T *argvars, typval_T *rettv UNUSED) { - char_u *msg = tv_get_string(&argvars[0]); + char_u *msg; channel_T *channel = NULL; + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_chan_or_job_arg(argvars, 1) == FAIL)) + return; + + msg = tv_get_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0); @@ -6309,9 +5315,15 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED) char_u *opt = (char_u *)""; char_u buf[NUMBUFLEN]; - /* Don't open a file in restricted mode. */ + // Don't open a file in restricted mode. if (check_restricted() || check_secure()) return; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_string_arg(argvars, 1) == FAIL)) + return; + fname = tv_get_string(&argvars[0]); if (argvars[1].v_type == VAR_STRING) opt = tv_get_string_buf(&argvars[1], buf); @@ -6402,6 +5414,11 @@ f_ch_setoptions(typval_T *argvars, typval_T *rettv UNUSED) channel_T *channel; jobopt_T opt; + if (in_vim9script() + && (check_for_chan_or_job_arg(argvars, 0) == FAIL + || check_for_dict_arg(argvars, 1) == FAIL)) + return; + channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); if (channel == NULL) return; @@ -6422,10 +5439,15 @@ f_ch_status(typval_T *argvars, typval_T *rettv) jobopt_T opt; int part = -1; - /* return an empty string by default */ + // return an empty string by default rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; + if (in_vim9script() + && (check_for_chan_or_job_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL)) + return; + channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0); if (argvars[1].v_type != VAR_UNKNOWN) @@ -6440,185 +5462,21 @@ f_ch_status(typval_T *argvars, typval_T *rettv) } /* - * Get the job from the argument. - * Returns NULL if the job is invalid. - */ - static job_T * -get_job_arg(typval_T *tv) -{ - job_T *job; - - if (tv->v_type != VAR_JOB) - { - semsg(_(e_invarg2), tv_get_string(tv)); - return NULL; - } - job = tv->vval.v_job; - - if (job == NULL) - emsg(_("E916: not a valid job")); - return job; -} - -/* - * "job_getchannel()" function - */ - void -f_job_getchannel(typval_T *argvars, typval_T *rettv) -{ - job_T *job = get_job_arg(&argvars[0]); - - if (job != NULL) - { - rettv->v_type = VAR_CHANNEL; - rettv->vval.v_channel = job->jv_channel; - if (job->jv_channel != NULL) - ++job->jv_channel->ch_refcount; - } -} - -/* - * Implementation of job_info(). - */ - static void -job_info(job_T *job, dict_T *dict) -{ - dictitem_T *item; - varnumber_T nr; - list_T *l; - int i; - - dict_add_string(dict, "status", (char_u *)job_status(job)); - - item = dictitem_alloc((char_u *)"channel"); - if (item == NULL) - return; - item->di_tv.v_type = VAR_CHANNEL; - item->di_tv.vval.v_channel = job->jv_channel; - if (job->jv_channel != NULL) - ++job->jv_channel->ch_refcount; - if (dict_add(dict, item) == FAIL) - dictitem_free(item); - -#ifdef UNIX - nr = job->jv_pid; -#else - nr = job->jv_proc_info.dwProcessId; -#endif - dict_add_number(dict, "process", nr); - dict_add_string(dict, "tty_in", job->jv_tty_in); - dict_add_string(dict, "tty_out", job->jv_tty_out); - - dict_add_number(dict, "exitval", job->jv_exitval); - dict_add_string(dict, "exit_cb", job->jv_exit_cb.cb_name); - dict_add_string(dict, "stoponexit", job->jv_stoponexit); -#ifdef UNIX - dict_add_string(dict, "termsig", job->jv_termsig); -#endif -#ifdef MSWIN - dict_add_string(dict, "tty_type", job->jv_tty_type); -#endif - - l = list_alloc(); - if (l != NULL) - { - dict_add_list(dict, "cmd", l); - if (job->jv_argv != NULL) - for (i = 0; job->jv_argv[i] != NULL; i++) - list_append_string(l, (char_u *)job->jv_argv[i], -1); - } -} - -/* - * Implementation of job_info() to return info for all jobs. - */ - static void -job_info_all(list_T *l) -{ - job_T *job; - typval_T tv; - - for (job = first_job; job != NULL; job = job->jv_next) - { - tv.v_type = VAR_JOB; - tv.vval.v_job = job; - - if (list_append_tv(l, &tv) != OK) - return; - } -} - -/* - * "job_info()" function - */ - void -f_job_info(typval_T *argvars, typval_T *rettv) -{ - if (argvars[0].v_type != VAR_UNKNOWN) - { - job_T *job = get_job_arg(&argvars[0]); - - if (job != NULL && rettv_dict_alloc(rettv) != FAIL) - job_info(job, rettv->vval.v_dict); - } - else if (rettv_list_alloc(rettv) == OK) - job_info_all(rettv->vval.v_list); -} - -/* - * "job_setoptions()" function - */ - void -f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED) -{ - job_T *job = get_job_arg(&argvars[0]); - jobopt_T opt; - - if (job == NULL) - return; - clear_job_options(&opt); - if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB, 0) == OK) - job_set_options(job, &opt); - free_job_options(&opt); -} - -/* - * "job_start()" function - */ - void -f_job_start(typval_T *argvars, typval_T *rettv) -{ - rettv->v_type = VAR_JOB; - if (check_restricted() || check_secure()) - return; - rettv->vval.v_job = job_start(argvars, NULL, NULL, FALSE); -} - -/* - * "job_status()" function - */ - void -f_job_status(typval_T *argvars, typval_T *rettv) -{ - job_T *job = get_job_arg(&argvars[0]); - - if (job != NULL) - { - rettv->v_type = VAR_STRING; - rettv->vval.v_string = vim_strsave((char_u *)job_status(job)); - } -} - -/* - * "job_stop()" function + * Get a string with information about the channel in "varp" in "buf". + * "buf" must be at least NUMBUFLEN long. */ - void -f_job_stop(typval_T *argvars, typval_T *rettv) + char_u * +channel_to_string_buf(typval_T *varp, char_u *buf) { - job_T *job = get_job_arg(&argvars[0]); + channel_T *channel = varp->vval.v_channel; + char *status = channel_status(channel, -1); - if (job != NULL) - rettv->vval.v_number = job_stop(job, argvars, NULL); + if (channel == NULL) + vim_snprintf((char *)buf, NUMBUFLEN, "channel %s", status); + else + vim_snprintf((char *)buf, NUMBUFLEN, + "channel %d %s", channel->ch_id, status); + return buf; } -#endif /* FEAT_JOB_CHANNEL */ +#endif // FEAT_JOB_CHANNEL diff --git a/src/charset.c b/src/charset.c index ddaf364f5e9f7..04638db2c6a88 100644 --- a/src/charset.c +++ b/src/charset.c @@ -10,7 +10,7 @@ #include "vim.h" #if defined(HAVE_WCHAR_H) -# include /* for towupper() and towlower() */ +# include // for towupper() and towlower() #endif static int win_nolbr_chartabsize(win_T *wp, char_u *s, colnr_T col, int *headp); @@ -18,22 +18,22 @@ static unsigned nr2hex(unsigned c); static __thread int chartab_initialized = FALSE; -/* b_chartab[] is an array of 32 bytes, each bit representing one of the - * characters 0-255. */ +// b_chartab[] is an array of 32 bytes, each bit representing one of the +// characters 0-255. #define SET_CHARTAB(buf, c) (buf)->b_chartab[(unsigned)(c) >> 3] |= (1 << ((c) & 0x7)) #define RESET_CHARTAB(buf, c) (buf)->b_chartab[(unsigned)(c) >> 3] &= ~(1 << ((c) & 0x7)) #define GET_CHARTAB(buf, c) ((buf)->b_chartab[(unsigned)(c) >> 3] & (1 << ((c) & 0x7))) -/* table used below, see init_chartab() for an explanation */ +// table used below, see init_chartab() for an explanation static __thread char_u g_chartab[256]; /* * Flags for g_chartab[]. */ -#define CT_CELL_MASK 0x07 /* mask: nr of display cells (1, 2 or 4) */ -#define CT_PRINT_CHAR 0x10 /* flag: set for printable chars */ -#define CT_ID_CHAR 0x20 /* flag: set for ID chars */ -#define CT_FNAME_CHAR 0x40 /* flag: set for file name chars */ +#define CT_CELL_MASK 0x07 // mask: nr of display cells (1, 2 or 4) +#define CT_PRINT_CHAR 0x10 // flag: set for printable chars +#define CT_ID_CHAR 0x20 // flag: set for ID chars +#define CT_FNAME_CHAR 0x40 // flag: set for file name chars static int in_win_border(win_T *wp, colnr_T vcol); @@ -72,7 +72,7 @@ init_chartab(void) int buf_init_chartab( buf_T *buf, - int global) /* FALSE: only set buf->b_chartab[] */ + int global) // FALSE: only set buf->b_chartab[] { int c; int c2; @@ -87,36 +87,29 @@ buf_init_chartab( * Set the default size for printable characters: * From to '~' is 1 (printable), others are 2 (not printable). * This also inits all 'isident' and 'isfname' flags to FALSE. - * - * EBCDIC: all chars below ' ' are not printable, all others are - * printable. */ c = 0; while (c < ' ') g_chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2; -#ifdef EBCDIC - while (c < 255) -#else while (c <= '~') -#endif g_chartab[c++] = 1 + CT_PRINT_CHAR; while (c < 256) { - /* UTF-8: bytes 0xa0 - 0xff are printable (latin1) */ + // UTF-8: bytes 0xa0 - 0xff are printable (latin1) if (enc_utf8 && c >= 0xa0) g_chartab[c++] = CT_PRINT_CHAR + 1; - /* euc-jp characters starting with 0x8e are single width */ + // euc-jp characters starting with 0x8e are single width else if (enc_dbcs == DBCS_JPNU && c == 0x8e) g_chartab[c++] = CT_PRINT_CHAR + 1; - /* other double-byte chars can be printable AND double-width */ + // other double-byte chars can be printable AND double-width else if (enc_dbcs != 0 && MB_BYTE2LEN(c) == 2) g_chartab[c++] = CT_PRINT_CHAR + 2; else - /* the rest is unprintable by default */ + // the rest is unprintable by default g_chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2; } - /* Assume that every multi-byte char is a filename character. */ + // Assume that every multi-byte char is a filename character. for (c = 1; c < 256; ++c) if ((enc_dbcs != 0 && MB_BYTE2LEN(c) > 1) || (enc_dbcs == DBCS_JPNU && c == 0x8e) @@ -127,37 +120,34 @@ buf_init_chartab( /* * Init word char flags all to FALSE */ - vim_memset(buf->b_chartab, 0, (size_t)32); + CLEAR_FIELD(buf->b_chartab); if (enc_dbcs != 0) for (c = 0; c < 256; ++c) { - /* double-byte characters are probably word characters */ + // double-byte characters are probably word characters if (MB_BYTE2LEN(c) == 2) SET_CHARTAB(buf, c); } -#ifdef FEAT_LISP /* * In lisp mode the '-' character is included in keywords. */ if (buf->b_p_lisp) SET_CHARTAB(buf, '-'); -#endif - /* Walk through the 'isident', 'iskeyword', 'isfname' and 'isprint' - * options Each option is a list of characters, character numbers or - * ranges, separated by commas, e.g.: "200-210,x,#-178,-" - */ + // Walk through the 'isident', 'iskeyword', 'isfname' and 'isprint' + // options Each option is a list of characters, character numbers or + // ranges, separated by commas, e.g.: "200-210,x,#-178,-" for (i = global ? 0 : 3; i <= 3; ++i) { if (i == 0) - p = p_isi; /* first round: 'isident' */ + p = p_isi; // first round: 'isident' else if (i == 1) - p = p_isp; /* second round: 'isprint' */ + p = p_isp; // second round: 'isprint' else if (i == 2) - p = p_isf; /* third round: 'isfname' */ - else /* i == 3 */ - p = buf->b_p_isk; /* fourth round: 'iskeyword' */ + p = p_isf; // third round: 'isfname' + else // i == 3 + p = buf->b_p_isk; // fourth round: 'iskeyword' while (*p) { @@ -170,8 +160,7 @@ buf_init_chartab( } if (VIM_ISDIGIT(*p)) c = getdigits(&p); - else - if (has_mbyte) + else if (has_mbyte) c = mb_ptr2char_adv(&p); else c = *p++; @@ -181,8 +170,7 @@ buf_init_chartab( ++p; if (VIM_ISDIGIT(*p)) c2 = getdigits(&p); - else - if (has_mbyte) + else if (has_mbyte) c2 = mb_ptr2char_adv(&p); else c2 = *p++; @@ -191,7 +179,7 @@ buf_init_chartab( || !(*p == NUL || *p == ',')) return FAIL; - if (c2 == -1) /* not a range */ + if (c2 == -1) // not a range { /* * A single '@' (not "@-@"): @@ -210,24 +198,21 @@ buf_init_chartab( } while (c <= c2) { - /* Use the MB_ functions here, because isalpha() doesn't - * work properly when 'encoding' is "latin1" and the locale is - * "C". */ + // Use the MB_ functions here, because isalpha() doesn't + // work properly when 'encoding' is "latin1" and the locale is + // "C". if (!do_isalpha || MB_ISLOWER(c) || MB_ISUPPER(c)) { - if (i == 0) /* (re)set ID flag */ + if (i == 0) // (re)set ID flag { if (tilde) g_chartab[c] &= ~CT_ID_CHAR; else g_chartab[c] |= CT_ID_CHAR; } - else if (i == 1) /* (re)set printable */ + else if (i == 1) // (re)set printable { - if ((c < ' ' -#ifndef EBCDIC - || c > '~' -#endif + if ((c < ' ' || c > '~' // For double-byte we keep the cell width, so // that we can detect it from the first byte. ) && !(enc_dbcs && MB_BYTE2LEN(c) == 2)) @@ -245,14 +230,14 @@ buf_init_chartab( } } } - else if (i == 2) /* (re)set fname flag */ + else if (i == 2) // (re)set fname flag { if (tilde) g_chartab[c] &= ~CT_FNAME_CHAR; else g_chartab[c] |= CT_FNAME_CHAR; } - else /* i == 3 */ /* (re)set keyword flag */ + else // i == 3 (re)set keyword flag { if (tilde) RESET_CHARTAB(buf, c); @@ -266,7 +251,7 @@ buf_init_chartab( c = *p; p = skip_to_option_part(p); if (c == ',' && *p == NUL) - /* Trailing comma is not allowed. */ + // Trailing comma is not allowed. return FAIL; } } @@ -284,16 +269,16 @@ trans_characters( char_u *buf, int bufsize) { - int len; /* length of string needing translation */ - int room; /* room in buffer after string */ - char_u *trs; /* translated character */ - int trs_len; /* length of trs[] */ + int len; // length of string needing translation + int room; // room in buffer after string + char_u *trs; // translated character + int trs_len; // length of trs[] len = (int)STRLEN(buf); room = bufsize - len; while (*buf != 0) { - /* Assume a multi-byte character doesn't need translation. */ + // Assume a multi-byte character doesn't need translation. if (has_mbyte && (trs_len = (*mb_ptr2len)(buf)) > 1) len -= trs_len; else @@ -328,8 +313,8 @@ transstr(char_u *s) if (has_mbyte) { - /* Compute the length of the result, taking account of unprintable - * multi-byte characters. */ + // Compute the length of the result, taking account of unprintable + // multi-byte characters. len = 0; p = s; while (*p != NUL) @@ -352,7 +337,7 @@ transstr(char_u *s) if (l > 0) len += l; else - len += 4; /* illegal byte sequence */ + len += 4; // illegal byte sequence } } res = alloc(len + 1); @@ -369,7 +354,7 @@ transstr(char_u *s) { c = (*mb_ptr2char)(p); if (vim_isprintc(c)) - STRNCAT(res, p, l); /* append printable multi-byte char */ + STRNCAT(res, p, l); // append printable multi-byte char else transchar_hex(res + STRLEN(res), c); p += l; @@ -399,11 +384,11 @@ str_foldcase( int len = orglen; #define GA_CHAR(i) ((char_u *)ga.ga_data)[i] -#define GA_PTR(i) ((char_u *)ga.ga_data + i) +#define GA_PTR(i) ((char_u *)ga.ga_data + (i)) #define STR_CHAR(i) (buf == NULL ? GA_CHAR(i) : buf[i]) -#define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + i) +#define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + (i)) - /* Copy "str" into "buf" or allocated memory, unmodified. */ + // Copy "str" into "buf" or allocated memory, unmodified. if (buf == NULL) { ga_init2(&ga, 1, 10); @@ -414,7 +399,7 @@ str_foldcase( } else { - if (len >= buflen) /* Ugly! */ + if (len >= buflen) // Ugly! len = buflen - 1; mch_memmove(buf, str, (size_t)len); } @@ -423,7 +408,7 @@ str_foldcase( else buf[len] = NUL; - /* Make each character lower case. */ + // Make each character lower case. i = 0; while (STR_CHAR(i) != NUL) { @@ -435,15 +420,15 @@ str_foldcase( int olen = utf_ptr2len(STR_PTR(i)); int lc = utf_tolower(c); - /* Only replace the character when it is not an invalid - * sequence (ASCII character or more than one byte) and - * utf_tolower() doesn't return the original character. */ + // Only replace the character when it is not an invalid + // sequence (ASCII character or more than one byte) and + // utf_tolower() doesn't return the original character. if ((c < 0x80 || olen > 1) && c != lc) { int nlen = utf_char2len(lc); - /* If the byte length changes need to shift the following - * characters forward or backward. */ + // If the byte length changes need to shift the following + // characters forward or backward. if (olen != nlen) { if (nlen > olen) @@ -452,7 +437,7 @@ str_foldcase( ? ga_grow(&ga, nlen - olen + 1) == FAIL : len + nlen - olen >= buflen) { - /* out of memory, keep old char */ + // out of memory, keep old char lc = c; nlen = olen; } @@ -474,7 +459,7 @@ str_foldcase( (void)utf_char2bytes(lc, STR_PTR(i)); } } - /* skip to next multi-byte char */ + // skip to next multi-byte char i += (*mb_ptr2len)(STR_PTR(i)); } else @@ -500,37 +485,38 @@ str_foldcase( * Also doesn't work for the first byte of a multi-byte, "c" must be a * character! */ -static __thread char_u transchar_buf[7]; +static __thread char_u transchar_charbuf[7]; char_u * transchar(int c) +{ + return transchar_buf(curbuf, c); +} + + char_u * +transchar_buf(buf_T *buf, int c) { int i; i = 0; - if (IS_SPECIAL(c)) /* special key code, display as ~@ char */ + if (IS_SPECIAL(c)) // special key code, display as ~@ char { - transchar_buf[0] = '~'; - transchar_buf[1] = '@'; + transchar_charbuf[0] = '~'; + transchar_charbuf[1] = '@'; i = 2; c = K_SECOND(c); } - if ((!chartab_initialized && ( -#ifdef EBCDIC - (c >= 64 && c < 255) -#else - (c >= ' ' && c <= '~') -#endif - )) || (c < 256 && vim_isprintc_strict(c))) + if ((!chartab_initialized && ((c >= ' ' && c <= '~'))) + || (c < 256 && vim_isprintc_strict(c))) { - /* printable character */ - transchar_buf[i] = c; - transchar_buf[i + 1] = NUL; + // printable character + transchar_charbuf[i] = c; + transchar_charbuf[i + 1] = NUL; } else - transchar_nonprint(transchar_buf + i, c); - return transchar_buf; + transchar_nonprint(buf, transchar_charbuf + i, c); + return transchar_charbuf; } /* @@ -542,79 +528,49 @@ transchar_byte(int c) { if (enc_utf8 && c >= 0x80) { - transchar_nonprint(transchar_buf, c); - return transchar_buf; + transchar_nonprint(curbuf, transchar_charbuf, c); + return transchar_charbuf; } return transchar(c); } /* * Convert non-printable character to two or more printable characters in - * "buf[]". "buf" needs to be able to hold five bytes. + * "buf[]". "charbuf" needs to be able to hold five bytes. * Does NOT work for multi-byte characters, c must be <= 255. */ void -transchar_nonprint(char_u *buf, int c) +transchar_nonprint(buf_T *buf, char_u *charbuf, int c) { if (c == NL) - c = NUL; /* we use newline in place of a NUL */ - else if (c == CAR && get_fileformat(curbuf) == EOL_MAC) - c = NL; /* we use CR in place of NL in this case */ + c = NUL; // we use newline in place of a NUL + else if (c == CAR && get_fileformat(buf) == EOL_MAC) + c = NL; // we use CR in place of NL in this case - if (dy_flags & DY_UHEX) /* 'display' has "uhex" */ - transchar_hex(buf, c); + if (dy_flags & DY_UHEX) // 'display' has "uhex" + transchar_hex(charbuf, c); -#ifdef EBCDIC - /* For EBCDIC only the characters 0-63 and 255 are not printable */ - else if (CtrlChar(c) != 0 || c == DEL) -#else - else if (c <= 0x7f) /* 0x00 - 0x1f and 0x7f */ -#endif + else if (c <= 0x7f) // 0x00 - 0x1f and 0x7f { - buf[0] = '^'; -#ifdef EBCDIC - if (c == DEL) - buf[1] = '?'; /* DEL displayed as ^? */ - else - buf[1] = CtrlChar(c); -#else - buf[1] = c ^ 0x40; /* DEL displayed as ^? */ -#endif - - buf[2] = NUL; + charbuf[0] = '^'; + charbuf[1] = c ^ 0x40; // DEL displayed as ^? + charbuf[2] = NUL; } - else if (enc_utf8 && c >= 0x80) + else if (enc_utf8) { - transchar_hex(buf, c); + transchar_hex(charbuf, c); } -#ifndef EBCDIC - else if (c >= ' ' + 0x80 && c <= '~' + 0x80) /* 0xa0 - 0xfe */ + else if (c >= ' ' + 0x80 && c <= '~' + 0x80) // 0xa0 - 0xfe { - buf[0] = '|'; - buf[1] = c - 0x80; - buf[2] = NUL; + charbuf[0] = '|'; + charbuf[1] = c - 0x80; + charbuf[2] = NUL; } -#else - else if (c < 64) + else // 0x80 - 0x9f and 0xff { - buf[0] = '~'; - buf[1] = MetaChar(c); - buf[2] = NUL; - } -#endif - else /* 0x80 - 0x9f and 0xff */ - { - /* - * TODO: EBCDIC I don't know what to do with this chars, so I display - * them as '~?' for now - */ - buf[0] = '~'; -#ifdef EBCDIC - buf[1] = '?'; /* 0xff displayed as ~? */ -#else - buf[1] = (c - 0x80) ^ 0x40; /* 0xff displayed as ~? */ -#endif - buf[2] = NUL; + charbuf[0] = '~'; + charbuf[1] = (c - 0x80) ^ 0x40; // 0xff displayed as ~? + charbuf[2] = NUL; } } @@ -676,11 +632,11 @@ char2cells(int c) return char2cells(K_SECOND(c)) + 2; if (c >= 0x80) { - /* UTF-8: above 0x80 need to check the value */ + // UTF-8: above 0x80 need to check the value if (enc_utf8) return utf_char2cells(c); - /* DBCS: double-byte means double-width, except for euc-jp with first - * byte 0x8e */ + // DBCS: double-byte means double-width, except for euc-jp with first + // byte 0x8e if (enc_dbcs != 0 && c >= 0x100) { if (enc_dbcs == DBCS_JPNU && ((unsigned)c >> 8) == 0x8e) @@ -698,10 +654,10 @@ char2cells(int c) int ptr2cells(char_u *p) { - /* For UTF-8 we need to look at more bytes if the first byte is >= 0x80. */ + // For UTF-8 we need to look at more bytes if the first byte is >= 0x80. if (enc_utf8 && *p >= 0x80) return utf_ptr2cells(p); - /* For DBCS we can tell the cell count from the first byte. */ + // For DBCS we can tell the cell count from the first byte. return (g_chartab[*p] & CT_CELL_MASK); } @@ -748,7 +704,7 @@ vim_strnsize(char_u *s, int len) #ifdef FEAT_VARTABS # define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \ - if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \ + if (*(p) == TAB && (!(wp)->w_p_list || (wp)->w_lcs_chars.tab1)) \ { \ return tabstop_padding(col, (buf)->b_p_ts, (buf)->b_p_vts_array); \ } \ @@ -756,7 +712,7 @@ vim_strnsize(char_u *s, int len) return ptr2cells(p); #else # define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \ - if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \ + if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \ { \ int ts; \ ts = (buf)->b_p_ts; \ @@ -797,7 +753,7 @@ linetabsize(char_u *s) linetabsize_col(int startcol, char_u *s) { colnr_T col = startcol; - char_u *line = s; /* pointer to start of line, for breakindent */ + char_u *line = s; // pointer to start of line, for breakindent while (*s != NUL) col += lbr_chartabsize_adv(line, &s, col); @@ -829,6 +785,16 @@ vim_isIDc(int c) return (c > 0 && c < 0x100 && (g_chartab[c] & CT_ID_CHAR)); } +/* + * Like vim_isIDc() but not using the 'isident' option: letters, numbers and + * underscore. + */ + int +vim_isNormalIDc(int c) +{ + return ASCII_ISALNUM(c) || c == '_'; +} + /* * return TRUE if 'c' is a keyword character: Letters and characters from * 'iskeyword' option for the current buffer. @@ -931,12 +897,13 @@ vim_isprintc_strict(int c) */ int lbr_chartabsize( - char_u *line UNUSED, /* start of the line */ + char_u *line UNUSED, // start of the line unsigned char *s, colnr_T col) { #ifdef FEAT_LINEBREAK - if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri) + if (!curwin->w_p_lbr && *get_showbreak_value(curwin) == NUL + && !curwin->w_p_bri) { #endif if (curwin->w_p_wrap) @@ -953,7 +920,7 @@ lbr_chartabsize( */ int lbr_chartabsize_adv( - char_u *line, /* start of the line */ + char_u *line, // start of the line char_u **s, colnr_T col) { @@ -974,7 +941,7 @@ lbr_chartabsize_adv( int win_lbr_chartabsize( win_T *wp, - char_u *line UNUSED, /* start of the line */ + char_u *line UNUSED, // start of the line char_u *s, colnr_T col, int *headp UNUSED) @@ -983,7 +950,7 @@ win_lbr_chartabsize( int c; int size; colnr_T col2; - colnr_T col_adj = 0; /* col + screen size of tab */ + colnr_T col_adj = 0; // col + screen size of tab colnr_T colmax; int added; int mb_added = 0; @@ -991,11 +958,12 @@ win_lbr_chartabsize( char_u *ps; int tab_corr = (*s == TAB); int n; + char_u *sbr; /* * No 'linebreak', 'showbreak' and 'breakindent': return quickly. */ - if (!wp->w_p_lbr && !wp->w_p_bri && *p_sbr == NUL) + if (!wp->w_p_lbr && !wp->w_p_bri && *get_showbreak_value(wp) == NUL) #endif { if (wp->w_p_wrap) @@ -1049,7 +1017,7 @@ win_lbr_chartabsize( break; col2 += win_chartabsize(wp, s, col2); - if (col2 >= colmax) /* doesn't fit */ + if (col2 >= colmax) // doesn't fit { size = colmax - col + col_adj; break; @@ -1059,7 +1027,7 @@ win_lbr_chartabsize( else if (has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1 && wp->w_p_wrap && in_win_border(wp, col)) { - ++size; /* Count the ">" in the last column. */ + ++size; // Count the ">" in the last column. mb_added = 1; } @@ -1067,9 +1035,11 @@ win_lbr_chartabsize( * May have to add something for 'breakindent' and/or 'showbreak' * string at start of line. * Set *headp to the size of what we add. + * Do not use 'showbreak' at the NUL after the text. */ added = 0; - if ((*p_sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0) + sbr = c == NUL ? empty_option : get_showbreak_value(wp); + if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0) { colnr_T sbrlen = 0; int numberwidth = win_col_off(wp); @@ -1082,9 +1052,9 @@ win_lbr_chartabsize( numberextra = wp->w_width - (numberextra - win_col_off2(wp)); if (col >= numberextra && numberextra > 0) col %= numberextra; - if (*p_sbr != NUL) + if (*sbr != NUL) { - sbrlen = (colnr_T)MB_CHARLEN(p_sbr); + sbrlen = (colnr_T)MB_CHARLEN(sbr); if (col >= sbrlen) col -= sbrlen; } @@ -1098,7 +1068,7 @@ win_lbr_chartabsize( if (col == 0 || col + size + sbrlen > (colnr_T)wp->w_width) { added = 0; - if (*p_sbr != NUL) + if (*sbr != NUL) { if (size + sbrlen + numberwidth > (colnr_T)wp->w_width) { @@ -1109,13 +1079,13 @@ win_lbr_chartabsize( if (width <= 0) width = (colnr_T)1; - added += ((size - prev_width) / width) * vim_strsize(p_sbr); + added += ((size - prev_width) / width) * vim_strsize(sbr); if ((size - prev_width) % width) // wrapped, add another length of 'sbr' - added += vim_strsize(p_sbr); + added += vim_strsize(sbr); } else - added += vim_strsize(p_sbr); + added += vim_strsize(sbr); } if (wp->w_p_bri) added += get_breakindent_win(wp, line); @@ -1145,7 +1115,7 @@ win_nolbr_chartabsize( { int n; - if (*s == TAB && (!wp->w_p_list || lcs_tab1)) + if (*s == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1)) { # ifdef FEAT_VARTABS return tabstop_padding(col, wp->w_buffer->b_p_ts, @@ -1156,8 +1126,8 @@ win_nolbr_chartabsize( # endif } n = ptr2cells(s); - /* Add one cell for a double-width character in the last column of the - * window, displayed with a ">". */ + // Add one cell for a double-width character in the last column of the + // window, displayed with a ">". if (n == 2 && MB_BYTE2LEN(*s) > 1 && in_win_border(wp, col)) { if (headp != NULL) @@ -1174,10 +1144,10 @@ win_nolbr_chartabsize( static int in_win_border(win_T *wp, colnr_T vcol) { - int width1; /* width of first line (after line number) */ - int width2; /* width of further lines */ + int width1; // width of first line (after line number) + int width2; // width of further lines - if (wp->w_width == 0) /* there is no border */ + if (wp->w_width == 0) // there is no border return FALSE; width1 = wp->w_width - win_col_off(wp); if ((int)vcol < width1 - 1) @@ -1207,9 +1177,9 @@ getvcol( colnr_T *end) { colnr_T vcol; - char_u *ptr; /* points to current char */ - char_u *posptr; /* points to char at pos->col */ - char_u *line; /* start of the line */ + char_u *ptr; // points to current char + char_u *posptr; // points to char at pos->col + char_u *line; // start of the line int incr; int head; #ifdef FEAT_VARTABS @@ -1221,16 +1191,21 @@ getvcol( vcol = 0; line = ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); if (pos->col == MAXCOL) - posptr = NULL; /* continue until the NUL */ + posptr = NULL; // continue until the NUL else { - /* Special check for an empty line, which can happen on exit, when - * ml_get_buf() always returns an empty string. */ - if (*ptr == NUL) - pos->col = 0; + colnr_T i; + + // In a few cases the position can be beyond the end of the line. + for (i = 0; i < pos->col; ++i) + if (ptr[i] == NUL) + { + pos->col = i; + break; + } posptr = ptr + pos->col; if (has_mbyte) - /* always start on the first byte */ + // always start on the first byte posptr -= (*mb_head_off)(line, posptr); } @@ -1240,9 +1215,9 @@ getvcol( * use a simple loop. * Also use this when 'list' is set but tabs take their normal size. */ - if ((!wp->w_p_list || lcs_tab1 != NUL) + if ((!wp->w_p_list || wp->w_lcs_chars.tab1 != NUL) #ifdef FEAT_LINEBREAK - && !wp->w_p_lbr && *p_sbr == NUL && !wp->w_p_bri + && !wp->w_p_lbr && *get_showbreak_value(wp) == NUL && !wp->w_p_bri #endif ) { @@ -1250,13 +1225,13 @@ getvcol( { head = 0; c = *ptr; - /* make sure we don't go past the end of the line */ + // make sure we don't go past the end of the line if (c == NUL) { - incr = 1; /* NUL at end of line only takes one column */ + incr = 1; // NUL at end of line only takes one column break; } - /* A tab gets expanded, depending on the current column */ + // A tab gets expanded, depending on the current column if (c == TAB) #ifdef FEAT_VARTABS incr = tabstop_padding(vcol, ts, vts); @@ -1267,16 +1242,16 @@ getvcol( { if (has_mbyte) { - /* For utf-8, if the byte is >= 0x80, need to look at - * further bytes to find the cell width. */ + // For utf-8, if the byte is >= 0x80, need to look at + // further bytes to find the cell width. if (enc_utf8 && c >= 0x80) incr = utf_ptr2cells(ptr); else incr = g_chartab[c] & CT_CELL_MASK; - /* If a double-cell char doesn't fit at the end of a line - * it wraps to the next line, it's like this char is three - * cells wide. */ + // If a double-cell char doesn't fit at the end of a line + // it wraps to the next line, it's like this char is three + // cells wide. if (incr == 2 && wp->w_p_wrap && MB_BYTE2LEN(*ptr) > 1 && in_win_border(wp, vcol)) { @@ -1288,7 +1263,7 @@ getvcol( incr = g_chartab[c] & CT_CELL_MASK; } - if (posptr != NULL && ptr >= posptr) /* character at pos->col */ + if (posptr != NULL && ptr >= posptr) // character at pos->col break; vcol += incr; @@ -1299,17 +1274,17 @@ getvcol( { for (;;) { - /* A tab gets expanded, depending on the current column */ + // A tab gets expanded, depending on the current column head = 0; incr = win_lbr_chartabsize(wp, line, ptr, vcol, &head); - /* make sure we don't go past the end of the line */ + // make sure we don't go past the end of the line if (*ptr == NUL) { - incr = 1; /* NUL at end of line only takes one column */ + incr = 1; // NUL at end of line only takes one column break; } - if (posptr != NULL && ptr >= posptr) /* character at pos->col */ + if (posptr != NULL && ptr >= posptr) // character at pos->col break; vcol += incr; @@ -1323,15 +1298,15 @@ getvcol( if (cursor != NULL) { if (*ptr == TAB - && (State & NORMAL) + && (State & MODE_NORMAL) && !wp->w_p_list && !virtual_active() && !(VIsual_active && (*p_sel == 'e' || LTOREQ_POS(*pos, VIsual))) ) - *cursor = vcol + incr - 1; /* cursor at end */ + *cursor = vcol + incr - 1; // cursor at end else - *cursor = vcol + head; /* cursor at start */ + *cursor = vcol + head; // cursor at start } } @@ -1371,12 +1346,12 @@ getvvcol( if (virtual_active()) { - /* For virtual mode, only want one value */ + // For virtual mode, only want one value getvcol(wp, pos, &col, NULL, NULL); coladd = pos->coladd; endadd = 0; - /* Cannot put the cursor on part of a wide character. */ + // Cannot put the cursor on part of a wide character. ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); if (pos->col < (colnr_T)STRLEN(ptr)) { @@ -1385,7 +1360,7 @@ getvvcol( if (c != TAB && vim_isprintc(c)) { endadd = (colnr_T)(char2cells(c) - 1); - if (coladd > endadd) /* past end of line */ + if (coladd > endadd) // past end of line endadd = 0; else coladd = 0; @@ -1443,18 +1418,33 @@ getvcols( } /* - * skipwhite: skip over ' ' and '\t'. + * Skip over ' ' and '\t'. */ char_u * skipwhite(char_u *q) { char_u *p = q; - while (VIM_ISWHITE(*p)) /* skip to next non-white */ + while (VIM_ISWHITE(*p)) ++p; return p; } +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * skip over ' ', '\t' and '\n'. + */ + char_u * +skipwhite_and_nl(char_u *q) +{ + char_u *p = q; + + while (VIM_ISWHITE(*p) || *p == NL) + ++p; + return p; +} +#endif + /* * getwhitecols: return the number of whitespace * columns (bytes) at the start of a given line @@ -1479,7 +1469,7 @@ skipdigits(char_u *q) { char_u *p = q; - while (VIM_ISDIGIT(*p)) /* skip to next non-digit */ + while (VIM_ISDIGIT(*p)) // skip to next non-digit ++p; return p; } @@ -1493,7 +1483,7 @@ skipbin(char_u *q) { char_u *p = q; - while (vim_isbdigit(*p)) /* skip to next non-digit */ + while (vim_isbdigit(*p)) // skip to next non-digit ++p; return p; } @@ -1506,7 +1496,7 @@ skiphex(char_u *q) { char_u *p = q; - while (vim_isxdigit(*p)) /* skip to next non-digit */ + while (vim_isxdigit(*p)) // skip to next non-digit ++p; return p; } @@ -1520,7 +1510,7 @@ skiptobin(char_u *q) { char_u *p = q; - while (*p != NUL && !vim_isbdigit(*p)) /* skip to next digit */ + while (*p != NUL && !vim_isbdigit(*p)) // skip to next digit ++p; return p; } @@ -1533,7 +1523,7 @@ skiptodigit(char_u *q) { char_u *p = q; - while (*p != NUL && !VIM_ISDIGIT(*p)) /* skip to next digit */ + while (*p != NUL && !VIM_ISDIGIT(*p)) // skip to next digit ++p; return p; } @@ -1546,7 +1536,7 @@ skiptohex(char_u *q) { char_u *p = q; - while (*p != NUL && !vim_isxdigit(*p)) /* skip to next digit */ + while (*p != NUL && !vim_isxdigit(*p)) // skip to next digit ++p; return p; } @@ -1586,6 +1576,12 @@ vim_isbdigit(int c) return (c == '0' || c == '1'); } + static int +vim_isodigit(int c) +{ + return (c >= '0' && c <= '7'); +} + /* * Vim's own character class functions. These exist because many library * islower()/toupper() etc. do not work properly: they crash when used with @@ -1614,7 +1610,7 @@ vim_islower(int c) if (has_mbyte) return iswlower(c); #endif - /* islower() can't handle these chars and may crash */ + // islower() can't handle these chars and may crash return FALSE; } if (enc_latin1like) @@ -1638,7 +1634,7 @@ vim_isupper(int c) if (has_mbyte) return iswupper(c); #endif - /* islower() can't handle these chars and may crash */ + // islower() can't handle these chars and may crash return FALSE; } if (enc_latin1like) @@ -1647,6 +1643,12 @@ vim_isupper(int c) return isupper(c); } + int +vim_isalpha(int c) +{ + return vim_islower(c) || vim_isupper(c); +} + int vim_toupper(int c) { @@ -1662,7 +1664,7 @@ vim_toupper(int c) if (has_mbyte) return towupper(c); #endif - /* toupper() can't handle these chars and may crash */ + // toupper() can't handle these chars and may crash return c; } if (enc_latin1like) @@ -1688,7 +1690,7 @@ vim_tolower(int c) if (has_mbyte) return towlower(c); #endif - /* tolower() can't handle these chars and may crash */ + // tolower() can't handle these chars and may crash return c; } if (enc_latin1like) @@ -1726,7 +1728,7 @@ skiptowhite_esc(char_u *p) } /* - * Getdigits: Get a number from a string and skip over it. + * Get a number from a string and skip over it. * Note: the argument is a pointer to a char_u pointer! */ long @@ -1737,9 +1739,41 @@ getdigits(char_u **pp) p = *pp; retval = atol((char *)p); - if (*p == '-') /* skip negative sign */ + if (*p == '-') // skip negative sign + ++p; + p = skipdigits(p); // skip to next non-digit + *pp = p; + return retval; +} + +/* + * Like getdigits() but allow for embedded single quotes. + */ + long +getdigits_quoted(char_u **pp) +{ + char_u *p = *pp; + long retval = 0; + + if (*p == '-') + ++p; + while (VIM_ISDIGIT(*p)) + { + if (retval >= LONG_MAX / 10 - 10) + retval = LONG_MAX; + else + retval = retval * 10 - '0' + *p; ++p; - p = skipdigits(p); /* skip to next non-digit */ + if (in_vim9script() && *p == '\'' && VIM_ISDIGIT(p[1])) + ++p; + } + if (**pp == '-') + { + if (retval == LONG_MAX) + retval = LONG_MIN; + else + retval = -retval; + } *pp = p; return retval; } @@ -1762,6 +1796,8 @@ vim_isblankline(char_u *lbuf) * If "prep" is not NULL, returns a flag to indicate the type of the number: * 0 decimal * '0' octal + * 'O' octal + * 'o' octal * 'B' bin * 'b' bin * 'X' hex @@ -1781,8 +1817,8 @@ vim_isblankline(char_u *lbuf) vim_str2nr( char_u *start, int *prep, // return: type of number 0 = decimal, 'x' - // or 'X' is hex, '0' = octal, 'b' or 'B' - // is bin + // or 'X' is hex, '0', 'o' or 'O' is octal, + // 'b' or 'B' is bin int *len, // return: detected length of number int what, // what numbers to recognize varnumber_T *nptr, // return: signed result @@ -1805,7 +1841,7 @@ vim_str2nr( ++ptr; } - /* Recognize hex, octal, and bin. */ + // Recognize hex, octal, and bin. if (ptr[0] == '0' && ptr[1] != '8' && ptr[1] != '9' && (maxlen == 0 || maxlen > 1)) { @@ -1813,28 +1849,33 @@ vim_str2nr( if ((what & STR2NR_HEX) && (pre == 'X' || pre == 'x') && vim_isxdigit(ptr[2]) && (maxlen == 0 || maxlen > 2)) - /* hexadecimal */ + // hexadecimal ptr += 2; else if ((what & STR2NR_BIN) && (pre == 'B' || pre == 'b') && vim_isbdigit(ptr[2]) && (maxlen == 0 || maxlen > 2)) - /* binary */ + // binary + ptr += 2; + else if ((what & STR2NR_OOCT) + && (pre == 'O' || pre == 'o') && vim_isodigit(ptr[2]) + && (maxlen == 0 || maxlen > 2)) + // octal with prefix "0o" ptr += 2; else { - /* decimal or octal, default is decimal */ + // decimal or octal, default is decimal pre = 0; if (what & STR2NR_OCT) { - /* Don't interpret "0", "08" or "0129" as octal. */ + // Don't interpret "0", "08" or "0129" as octal. for (n = 1; n != maxlen && VIM_ISDIGIT(ptr[n]); ++n) { if (ptr[n] > '7') { - pre = 0; /* can't be octal */ + pre = 0; // can't be octal break; } - pre = '0'; /* assume octal */ + pre = '0'; // assume octal } } } @@ -1845,12 +1886,12 @@ vim_str2nr( if (pre == 'B' || pre == 'b' || ((what & STR2NR_BIN) && (what & STR2NR_FORCE))) { - /* bin */ + // bin if (pre != 0) - n += 2; /* skip over "0b" */ + n += 2; // skip over "0b" while ('0' <= *ptr && *ptr <= '1') { - /* avoid ubsan error for overflow */ + // avoid ubsan error for overflow if (un <= UVARNUM_MAX / 2) un = 2 * un + (uvarnumber_T)(*ptr - '0'); else @@ -1867,12 +1908,15 @@ vim_str2nr( } } } - else if (pre == '0' || ((what & STR2NR_OCT) && (what & STR2NR_FORCE))) + else if (pre == 'O' || pre == 'o' || + pre == '0' || ((what & STR2NR_OCT) && (what & STR2NR_FORCE))) { - /* octal */ + // octal + if (pre != 0 && pre != '0') + n += 2; // skip over "0o" while ('0' <= *ptr && *ptr <= '7') { - /* avoid ubsan error for overflow */ + // avoid ubsan error for overflow if (un <= UVARNUM_MAX / 8) un = 8 * un + (uvarnumber_T)(*ptr - '0'); else @@ -1891,12 +1935,12 @@ vim_str2nr( } else if (pre != 0 || ((what & STR2NR_HEX) && (what & STR2NR_FORCE))) { - /* hex */ + // hex if (pre != 0) - n += 2; /* skip over "0x" */ + n += 2; // skip over "0x" while (vim_isxdigit(*ptr)) { - /* avoid ubsan error for overflow */ + // avoid ubsan error for overflow if (un <= UVARNUM_MAX / 16) un = 16 * un + (uvarnumber_T)hex2nr(*ptr); else @@ -1914,12 +1958,12 @@ vim_str2nr( } else { - /* decimal */ + // decimal while (VIM_ISDIGIT(*ptr)) { uvarnumber_T digit = (uvarnumber_T)(*ptr - '0'); - /* avoid ubsan error for overflow */ + // avoid ubsan error for overflow if (un < UVARNUM_MAX / 10 || (un == UVARNUM_MAX / 10 && digit <= UVARNUM_MAX % 10)) un = 10 * un + digit; @@ -1937,7 +1981,7 @@ vim_str2nr( } } - // Check for an alpha-numeric character immediately following, that is + // Check for an alphanumeric character immediately following, that is // most likely a typo. if (strict && n - 1 != maxlen && ASCII_ISALNUM(*ptr)) return; @@ -1948,9 +1992,9 @@ vim_str2nr( *len = (int)(ptr - start); if (nptr != NULL) { - if (negative) /* account for leading '-' for decimal numbers */ + if (negative) // account for leading '-' for decimal numbers { - /* avoid ubsan error for overflow */ + // avoid ubsan error for overflow if (un > VARNUM_MAX) *nptr = VARNUM_MIN; else @@ -1958,6 +2002,7 @@ vim_str2nr( } else { + // prevent a larg unsigned number to become negative if (un > VARNUM_MAX) un = VARNUM_MAX; *nptr = (varnumber_T)un; @@ -1981,7 +2026,6 @@ hex2nr(int c) return c - '0'; } -#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO) /* * Convert two hex characters to a byte. * Return -1 if one of the characters is not hex. @@ -1993,7 +2037,6 @@ hexhex2nr(char_u *p) return -1; return (hex2nr(p[0]) << 4) + hex2nr(p[1]); } -#endif /* * Return TRUE if "str" starts with a backslash that should be removed. @@ -2052,59 +2095,3 @@ backslash_halve_save(char_u *p) backslash_halve(res); return res; } - -#if (defined(EBCDIC) && defined(FEAT_POSTSCRIPT)) || defined(PROTO) -/* - * Table for EBCDIC to ASCII conversion unashamedly taken from xxd.c! - * The first 64 entries have been added to map control characters defined in - * ascii.h - */ -static __thread char_u ebcdic2ascii_tab[256] = -{ - 0000, 0001, 0002, 0003, 0004, 0011, 0006, 0177, - 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, - 0020, 0021, 0022, 0023, 0024, 0012, 0010, 0027, - 0030, 0031, 0032, 0033, 0033, 0035, 0036, 0037, - 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, - 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, - 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, - 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, - 0040, 0240, 0241, 0242, 0243, 0244, 0245, 0246, - 0247, 0250, 0325, 0056, 0074, 0050, 0053, 0174, - 0046, 0251, 0252, 0253, 0254, 0255, 0256, 0257, - 0260, 0261, 0041, 0044, 0052, 0051, 0073, 0176, - 0055, 0057, 0262, 0263, 0264, 0265, 0266, 0267, - 0270, 0271, 0313, 0054, 0045, 0137, 0076, 0077, - 0272, 0273, 0274, 0275, 0276, 0277, 0300, 0301, - 0302, 0140, 0072, 0043, 0100, 0047, 0075, 0042, - 0303, 0141, 0142, 0143, 0144, 0145, 0146, 0147, - 0150, 0151, 0304, 0305, 0306, 0307, 0310, 0311, - 0312, 0152, 0153, 0154, 0155, 0156, 0157, 0160, - 0161, 0162, 0136, 0314, 0315, 0316, 0317, 0320, - 0321, 0345, 0163, 0164, 0165, 0166, 0167, 0170, - 0171, 0172, 0322, 0323, 0324, 0133, 0326, 0327, - 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337, - 0340, 0341, 0342, 0343, 0344, 0135, 0346, 0347, - 0173, 0101, 0102, 0103, 0104, 0105, 0106, 0107, - 0110, 0111, 0350, 0351, 0352, 0353, 0354, 0355, - 0175, 0112, 0113, 0114, 0115, 0116, 0117, 0120, - 0121, 0122, 0356, 0357, 0360, 0361, 0362, 0363, - 0134, 0237, 0123, 0124, 0125, 0126, 0127, 0130, - 0131, 0132, 0364, 0365, 0366, 0367, 0370, 0371, - 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, - 0070, 0071, 0372, 0373, 0374, 0375, 0376, 0377 -}; - -/* - * Convert a buffer worth of characters from EBCDIC to ASCII. Only useful if - * wanting 7-bit ASCII characters out the other end. - */ - void -ebcdic2ascii(char_u *buffer, int len) -{ - int i; - - for (i = 0; i < len; i++) - buffer[i] = ebcdic2ascii_tab[buffer[i]]; -} -#endif diff --git a/src/cindent.c b/src/cindent.c index 6fd4faf3994e5..8905f0bdeefab 100644 --- a/src/cindent.c +++ b/src/cindent.c @@ -32,7 +32,6 @@ #define LOOKFOR_JS_KEY 11 #define LOOKFOR_COMMA 12 -#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) /* * Return TRUE if the string "line" starts with a word from 'cinwords'. */ @@ -64,9 +63,6 @@ cin_is_cinword(char_u *line) } return retval; } -#endif - -#if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL) /* * Skip to the end of a "string" and a 'c' character. @@ -82,16 +78,16 @@ skip_string(char_u *p) { if (p[0] == '\'') // 'c' or '\n' or '\000' { - if (!p[1]) // ' at end of line + if (p[1] == NUL) // ' at end of line break; i = 2; - if (p[1] == '\\') // '\n' or '\000' + if (p[1] == '\\' && p[2] != NUL) // '\n' or '\000' { ++i; while (vim_isdigit(p[i - 1])) // '\000' ++i; } - if (p[i] == '\'') // check for trailing ' + if (p[i - 1] != NUL && p[i] == '\'') // check for trailing ' { p += i; continue; @@ -137,6 +133,19 @@ skip_string(char_u *p) return p; } +/* + * Return TRUE if "line[col]" is inside a C string. + */ + int +is_pos_in_string(char_u *line, colnr_T col) +{ + char_u *p; + + for (p = line; *p && (colnr_T)(p - line) < col; ++p) + p = skip_string(p); + return !((colnr_T)(p - line) <= col); +} + /* * Find the start of a comment, not knowing if we are in a comment right now. * Search starts at w_cursor.lnum and goes backwards. @@ -152,8 +161,6 @@ ind_find_start_comment(void) // XXX find_start_comment(int ind_maxcomment) // XXX { pos_T *pos; - char_u *line; - char_u *p; int cur_maxcomment = ind_maxcomment; for (;;) @@ -164,10 +171,7 @@ find_start_comment(int ind_maxcomment) // XXX // Check if the comment start we found is inside a string. // If it is then restrict the search to below this line and try again. - line = ml_get(pos->lnum); - for (p = line; *p && (colnr_T)(p - line) < pos->col; ++p) - p = skip_string(p); - if ((colnr_T)(p - line) <= pos->col) + if (!is_pos_in_string(ml_get(pos->lnum), pos->col)) break; cur_maxcomment = curwin->w_cursor.lnum - pos->lnum - 1; if (cur_maxcomment <= 0) @@ -188,8 +192,6 @@ find_start_comment(int ind_maxcomment) // XXX find_start_rawstring(int ind_maxcomment) // XXX { pos_T *pos; - char_u *line; - char_u *p; int cur_maxcomment = ind_maxcomment; for (;;) @@ -200,10 +202,7 @@ find_start_rawstring(int ind_maxcomment) // XXX // Check if the raw string start we found is inside a string. // If it is then restrict the search to below this line and try again. - line = ml_get(pos->lnum); - for (p = line; *p && (colnr_T)(p - line) < pos->col; ++p) - p = skip_string(p); - if ((colnr_T)(p - line) <= pos->col) + if (!is_pos_in_string(ml_get(pos->lnum), pos->col)) break; cur_maxcomment = curwin->w_cursor.lnum - pos->lnum - 1; if (cur_maxcomment <= 0) @@ -257,9 +256,7 @@ ind_find_start_CORS(linenr_T *is_raw) // XXX } return comment_pos; } -#endif // FEAT_CINDENT || FEAT_SYN_HL -#if defined(FEAT_CINDENT) || defined(PROTO) /* * Return TRUE if C-indenting is on. @@ -268,9 +265,9 @@ ind_find_start_CORS(linenr_T *is_raw) // XXX cindent_on(void) { return (!p_paste && (curbuf->b_p_cin -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL || *curbuf->b_p_inde != NUL -# endif +#endif )); } @@ -428,23 +425,40 @@ cin_islabel_skip(char_u **s) } /* - * Recognize a "public/private/protected" scope declaration label. + * Recognize a scope declaration label from the 'cinscopedecls' option. */ static int -cin_isscopedecl(char_u *s) +cin_isscopedecl(char_u *p) { - int i; - - s = cin_skipcomment(s); - if (STRNCMP(s, "public", 6) == 0) - i = 6; - else if (STRNCMP(s, "protected", 9) == 0) - i = 9; - else if (STRNCMP(s, "private", 7) == 0) - i = 7; - else + size_t cinsd_len; + char_u *cinsd_buf; + char_u *cinsd; + size_t len; + char_u *skip; + char_u *s = cin_skipcomment(p); + int found = FALSE; + + cinsd_len = STRLEN(curbuf->b_p_cinsd) + 1; + cinsd_buf = alloc(cinsd_len); + if (cinsd_buf == NULL) return FALSE; - return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':'); + + for (cinsd = curbuf->b_p_cinsd; *cinsd; ) + { + len = copy_option_part(&cinsd, cinsd_buf, (int)cinsd_len, ","); + if (STRNCMP(s, cinsd_buf, len) == 0) + { + skip = cin_skipcomment(s + len); + if (*skip == ':' && skip[1] != ':') + { + found = TRUE; + break; + } + } + } + + vim_free(cinsd_buf); + return found; } /* @@ -593,6 +607,8 @@ cin_iscase( for (s += 4; *s; ++s) { s = cin_skipcomment(s); + if (*s == NUL) + break; if (*s == ':') { if (s[1] == ':') // skip over "::" for C++ @@ -727,7 +743,7 @@ cin_isinit(void) { int i, l; - for (i = 0; i < (int)(sizeof(skip) / sizeof(char *)); ++i) + for (i = 0; i < (int)ARRAY_LENGTH(skip); ++i) { l = (int)strlen(skip[i]); if (cin_starts_with(s, skip[i])) @@ -764,6 +780,10 @@ cin_is_cpp_namespace(char_u *s) int has_name_start = FALSE; s = cin_skipcomment(s); + + if (STRNCMP(s, "inline", 6) == 0 && (s[6] == NUL || !vim_iswordc(s[6]))) + s = cin_skipcomment(skipwhite(s + 6)); + if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9]))) { p = cin_skipcomment(skipwhite(s + 9)); @@ -1233,7 +1253,7 @@ cin_isfuncdecl( if (*s == ')' && cin_nocode(s + 1)) { // ')' at the end: may have found a match - // Check for he previous line not to end in a backslash: + // Check for the previous line not to end in a backslash: // #if defined(x) && {backslash} // defined(y) lnum = first_lnum - 1; @@ -1644,20 +1664,21 @@ get_baseclass_amount(int col) * Ignore a '{' that is in a comment, makes indenting the next three lines * work. */ -/* foo() */ -/* { */ -/* } */ +// foo() +// { +// } + #if TARGET_OS_IPHONE static __thread pos_T pos_copy_brace; #endif static pos_T * find_start_brace(void) // XXX { - pos_T cursor_save; - pos_T *trypos; - pos_T *pos; + pos_T cursor_save; + pos_T *trypos; + pos_T *pos; #if !TARGET_OS_IPHONE - static pos_T pos_copy; + static pos_T pos_copy; #endif cursor_save = curwin->w_cursor; @@ -1677,7 +1698,7 @@ find_start_brace(void) // XXX && (pos = ind_find_start_CORS(NULL)) == NULL) // XXX break; if (pos != NULL) - curwin->w_cursor.lnum = pos->lnum; + curwin->w_cursor = *pos; } curwin->w_cursor = cursor_save; return trypos; @@ -1803,15 +1824,15 @@ parse_cino(buf_T *buf) // should be located. buf->b_ind_continuation = sw; - // Spaces from the indent of the line with an unclosed parentheses. + // Spaces from the indent of the line with an unclosed parenthesis. buf->b_ind_unclosed = sw * 2; - // Spaces from the indent of the line with an unclosed parentheses, which + // Spaces from the indent of the line with an unclosed parenthesis, which // itself is also unclosed. buf->b_ind_unclosed2 = sw; // Suppress ignoring spaces from the indent of a line starting with an - // unclosed parentheses. + // unclosed parenthesis. buf->b_ind_unclosed_noignore = 0; // If the opening paren is the last nonwhite character on the line, and @@ -1820,14 +1841,14 @@ parse_cino(buf_T *buf) buf->b_ind_unclosed_wrapped = 0; // Suppress ignoring white space when lining up with the character after - // an unclosed parentheses. + // an unclosed parenthesis. buf->b_ind_unclosed_whiteok = 0; - // Indent a closing parentheses under the line start of the matching - // opening parentheses. + // Indent a closing parenthesis under the line start of the matching + // opening parenthesis. buf->b_ind_matching_paren = 0; - // Indent a closing parentheses under the previous line. + // Indent a closing parenthesis under the previous line. buf->b_ind_paren_prev = 0; // Extra indent for comments. @@ -1868,6 +1889,9 @@ parse_cino(buf_T *buf) // Handle C++ extern "C" or "C++" buf->b_ind_cpp_extern_c = 0; + // Handle C #pragma directives + buf->b_ind_pragma = 0; + for (p = buf->b_p_cino; *p; ) { l = p++; @@ -1943,6 +1967,7 @@ parse_cino(buf_T *buf) case 'N': buf->b_ind_cpp_namespace = n; break; case 'k': buf->b_ind_if_for_while = n; break; case 'E': buf->b_ind_cpp_extern_c = n; break; + case 'P': buf->b_ind_pragma = n; break; } if (*p == ',') ++p; @@ -2109,7 +2134,7 @@ get_c_indent(void) // inserting new stuff. // For unknown reasons the cursor might be past the end of the line, thus // check for that. - if ((State & INSERT) + if ((State & MODE_INSERT) && curwin->w_cursor.col < (colnr_T)STRLEN(linecopy) && linecopy[curwin->w_cursor.col] == ')') linecopy[curwin->w_cursor.col] = NUL; @@ -2139,11 +2164,16 @@ get_c_indent(void) goto laterend; } - // #defines and so on always go at the left when included in 'cinkeys'. + // #defines and so on go at the left when included in 'cinkeys', + // excluding pragmas when customized in 'cinoptions' if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', TRUE))) { - amount = curbuf->b_ind_hash_comment; - goto theend; + char_u *directive = skipwhite(theline + 1); + if (curbuf->b_ind_pragma == 0 || STRNCMP(directive, "pragma", 6) != 0) + { + amount = curbuf->b_ind_hash_comment; + goto theend; + } } // Is it a non-case label? Then that goes at the left margin too unless: @@ -2158,13 +2188,30 @@ get_c_indent(void) // If we're inside a "//" comment and there is a "//" comment in a // previous line, lineup with that one. - if (cin_islinecomment(theline) - && (trypos = find_line_comment()) != NULL) // XXX + if (cin_islinecomment(theline)) { - // find how indented the line beginning the comment is - getvcol(curwin, trypos, &col, NULL, NULL); - amount = col; - goto theend; + pos_T linecomment_pos; + + trypos = find_line_comment(); // XXX + if (trypos == NULL && curwin->w_cursor.lnum > 1) + { + // There may be a statement before the comment, search from the end + // of the line for a comment start. + linecomment_pos.col = + check_linecomment(ml_get(curwin->w_cursor.lnum - 1)); + if (linecomment_pos.col != MAXCOL) + { + trypos = &linecomment_pos; + trypos->lnum = curwin->w_cursor.lnum - 1; + } + } + if (trypos != NULL) + { + // find how indented the line beginning the comment is + getvcol(curwin, trypos, &col, NULL, NULL); + amount = col; + goto theend; + } } // If we're inside a comment and not looking at the start of the @@ -2750,7 +2797,7 @@ get_c_indent(void) if (curwin->w_cursor.lnum <= ourscope) { // We reached end of scope: - // If looking for a enum or structure initialization + // If looking for an enum or structure initialization // go further back: // If it is an initializer (enum xxx or xxx =), then // don't add ind_continuation, otherwise it is a variable @@ -2810,7 +2857,7 @@ get_c_indent(void) if (terminated == ',') break; - // if it es a enum declaration or an assignment, + // if it is an enum declaration or an assignment, // we are done. if (terminated != ';' && cin_isinit()) break; @@ -3108,7 +3155,7 @@ get_c_indent(void) // 123, // sizeof // here - // Otherwise check whether it is a enumeration or structure + // Otherwise check whether it is an enumeration or structure // initialisation (not indented) or a variable declaration // (indented). terminated = cin_isterminated(l, FALSE, TRUE); @@ -3936,13 +3983,7 @@ in_cinkeys( try_match_word = FALSE; // does it look like a control character? - if (*look == '^' -#ifdef EBCDIC - && (Ctrl_chr(look[1]) != 0) -#else - && look[1] >= '?' && look[1] <= '_' -#endif - ) + if (*look == '^' && look[1] >= '?' && look[1] <= '_') { if (try_match && keytyped == Ctrl_chr(look[1])) return TRUE; @@ -4130,7 +4171,6 @@ do_c_expr_indent(void) # endif fixthisline(get_c_indent); } -#endif #if defined(FEAT_EVAL) || defined(PROTO) /* @@ -4139,10 +4179,12 @@ do_c_expr_indent(void) void f_cindent(typval_T *argvars UNUSED, typval_T *rettv) { -# ifdef FEAT_CINDENT pos_T pos; linenr_T lnum; + if (in_vim9script() && check_for_lnum_arg(argvars, 0) == FAIL) + return; + pos = curwin->w_cursor; lnum = tv_get_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) @@ -4152,7 +4194,6 @@ f_cindent(typval_T *argvars UNUSED, typval_T *rettv) curwin->w_cursor = pos; } else -# endif rettv->vval.v_number = -1; } #endif diff --git a/src/clientserver.c b/src/clientserver.c new file mode 100644 index 0000000000000..bb2108d7d4ebd --- /dev/null +++ b/src/clientserver.c @@ -0,0 +1,1045 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * clientserver.c: functions for Client Server functionality + */ + +#include "vim.h" + +#if defined(FEAT_CLIENTSERVER) || defined(PROTO) + +static void cmdsrv_main(int *argc, char **argv, char_u *serverName_arg, char_u **serverStr); +static char_u *serverMakeName(char_u *arg, char *cmd); + +/* + * Replace termcodes such as and insert as key presses if there is room. + */ + void +server_to_input_buf(char_u *str) +{ + char_u *ptr = NULL; + char_u *cpo_save = p_cpo; + + // Set 'cpoptions' the way we want it. + // B set - backslashes are *not* treated specially + // k set - keycodes are *not* reverse-engineered + // < unset - sequences *are* interpreted + // The last but one parameter of replace_termcodes() is TRUE so that the + // sequence is recognised - needed for a real backslash. + p_cpo = (char_u *)"Bk"; + str = replace_termcodes(str, &ptr, REPTERM_DO_LT, NULL); + p_cpo = cpo_save; + + if (*ptr != NUL) // trailing CTRL-V results in nothing + { + /* + * Add the string to the input stream. + * Can't use add_to_input_buf() here, we now have K_SPECIAL bytes. + * + * First clear typed characters from the typeahead buffer, there could + * be half a mapping there. Then append to the existing string, so + * that multiple commands from a client are concatenated. + */ + if (typebuf.tb_maplen < typebuf.tb_len) + del_typebuf(typebuf.tb_len - typebuf.tb_maplen, typebuf.tb_maplen); + (void)ins_typebuf(str, REMAP_NONE, typebuf.tb_len, TRUE, FALSE); + + // Let input_available() know we inserted text in the typeahead + // buffer. + typebuf_was_filled = TRUE; + } + vim_free(ptr); +} + +/* + * Evaluate an expression that the client sent to a string. + */ + char_u * +eval_client_expr_to_string(char_u *expr) +{ + char_u *res; + int save_dbl = debug_break_level; + int save_ro = redir_off; + funccal_entry_T funccal_entry; + int did_save_funccal = FALSE; + + // Evaluate the expression at the toplevel, don't use variables local to + // the calling function. Except when in debug mode. + if (!debug_mode) + { + save_funccal(&funccal_entry); + did_save_funccal = TRUE; + } + + // Disable debugging, otherwise Vim hangs, waiting for "cont" to be + // typed. + debug_break_level = -1; + redir_off = 0; + // Do not display error message, otherwise Vim hangs, waiting for "cont" + // to be typed. Do generate errors so that try/catch works. + ++emsg_silent; + + res = eval_to_string(expr, TRUE); + + debug_break_level = save_dbl; + redir_off = save_ro; + --emsg_silent; + if (emsg_silent < 0) + emsg_silent = 0; + if (did_save_funccal) + restore_funccal(); + + // A client can tell us to redraw, but not to display the cursor, so do + // that here. + setcursor(); + out_flush_cursor(FALSE, FALSE); + + return res; +} + +/* + * Evaluate a command or expression sent to ourselves. + */ + int +sendToLocalVim(char_u *cmd, int asExpr, char_u **result) +{ + if (asExpr) + { + char_u *ret; + + ret = eval_client_expr_to_string(cmd); + if (result != NULL) + { + if (ret == NULL) + { + char *err = _(e_invalid_expression_received); + size_t len = STRLEN(cmd) + STRLEN(err) + 5; + char_u *msg; + + msg = alloc(len); + if (msg != NULL) + vim_snprintf((char *)msg, len, "%s: \"%s\"", err, cmd); + *result = msg; + } + else + *result = ret; + } + else + vim_free(ret); + return ret == NULL ? -1 : 0; + } + server_to_input_buf(cmd); + return 0; +} + +/* + * If conversion is needed, convert "data" from "client_enc" to 'encoding' and + * return an allocated string. Otherwise return "data". + * "*tofree" is set to the result when it needs to be freed later. + */ + char_u * +serverConvert( + char_u *client_enc UNUSED, + char_u *data, + char_u **tofree) +{ + char_u *res = data; + + *tofree = NULL; + if (client_enc != NULL && p_enc != NULL) + { + vimconv_T vimconv; + + vimconv.vc_type = CONV_NONE; + if (convert_setup(&vimconv, client_enc, p_enc) != FAIL + && vimconv.vc_type != CONV_NONE) + { + res = string_convert(&vimconv, data, NULL); + if (res == NULL) + res = data; + else + *tofree = res; + } + convert_setup(&vimconv, NULL, NULL); + } + return res; +} +#endif + +#if (defined(FEAT_CLIENTSERVER) && !defined(NO_VIM_MAIN)) || defined(PROTO) + +/* + * Common code for the X command server and the Win32 command server. + */ + +static char_u *build_drop_cmd(int filec, char **filev, int tabs, int sendReply); + +/* + * Do the client-server stuff, unless "--servername ''" was used. + */ + void +exec_on_server(mparm_T *parmp) +{ + if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL) + { +# ifdef MSWIN + // Initialise the client/server messaging infrastructure. + serverInitMessaging(); +# endif + + /* + * When a command server argument was found, execute it. This may + * exit Vim when it was successful. Otherwise it's executed further + * on. Remember the encoding used here in "serverStrEnc". + */ + if (parmp->serverArg) + { + cmdsrv_main(&parmp->argc, parmp->argv, + parmp->serverName_arg, &parmp->serverStr); + parmp->serverStrEnc = vim_strsave(p_enc); + } + + // If we're still running, get the name to register ourselves. + // On Win32 can register right now, for X11 need to setup the + // clipboard first, it's further down. + parmp->servername = serverMakeName(parmp->serverName_arg, + parmp->argv[0]); +# ifdef MSWIN + if (parmp->servername != NULL) + { + serverSetName(parmp->servername); + vim_free(parmp->servername); + } +# endif + } +} + +/* + * Prepare for running as a Vim server. + */ + void +prepare_server(mparm_T *parmp) +{ +# if defined(FEAT_X11) + /* + * Register for remote command execution with :serversend and --remote + * unless there was a -X or a --servername '' on the command line. + * Only register nongui-vim's with an explicit --servername argument, + * or when compiling with autoservername. + * When running as root --servername is also required. + */ + if (X_DISPLAY != NULL && parmp->servername != NULL && ( +# if defined(FEAT_AUTOSERVERNAME) || defined(FEAT_GUI) + ( +# if defined(FEAT_AUTOSERVERNAME) + 1 +# else + gui.in_use +# endif +# ifdef UNIX + && getuid() != ROOT_UID +# endif + ) || +# endif + parmp->serverName_arg != NULL)) + { + (void)serverRegisterName(X_DISPLAY, parmp->servername); + vim_free(parmp->servername); + TIME_MSG("register server name"); + } + else + serverDelayedStartName = parmp->servername; +# endif + + /* + * Execute command ourselves if we're here because the send failed (or + * else we would have exited above). + */ + if (parmp->serverStr != NULL) + { + char_u *p; + + server_to_input_buf(serverConvert(parmp->serverStrEnc, + parmp->serverStr, &p)); + vim_free(p); + } +} + + static void +cmdsrv_main( + int *argc, + char **argv, + char_u *serverName_arg, + char_u **serverStr) +{ + char_u *res; + int i; + char_u *sname; + int ret; + int didone = FALSE; + int exiterr = 0; + char **newArgV = argv + 1; + int newArgC = 1, + Argc = *argc; + int argtype; +#define ARGTYPE_OTHER 0 +#define ARGTYPE_EDIT 1 +#define ARGTYPE_EDIT_WAIT 2 +#define ARGTYPE_SEND 3 + int silent = FALSE; + int tabs = FALSE; +# ifndef FEAT_X11 + HWND srv; +# else + Window srv; + + setup_term_clip(); +# endif + + sname = serverMakeName(serverName_arg, argv[0]); + if (sname == NULL) + return; + + /* + * Execute the command server related arguments and remove them + * from the argc/argv array; We may have to return into main() + */ + for (i = 1; i < Argc; i++) + { + res = NULL; + if (STRCMP(argv[i], "--") == 0) // end of option arguments + { + for (; i < *argc; i++) + { + *newArgV++ = argv[i]; + newArgC++; + } + break; + } + + if (STRICMP(argv[i], "--remote-send") == 0) + argtype = ARGTYPE_SEND; + else if (STRNICMP(argv[i], "--remote", 8) == 0) + { + char *p = argv[i] + 8; + + argtype = ARGTYPE_EDIT; + while (*p != NUL) + { + if (STRNICMP(p, "-wait", 5) == 0) + { + argtype = ARGTYPE_EDIT_WAIT; + p += 5; + } + else if (STRNICMP(p, "-silent", 7) == 0) + { + silent = TRUE; + p += 7; + } + else if (STRNICMP(p, "-tab", 4) == 0) + { + tabs = TRUE; + p += 4; + } + else + { + argtype = ARGTYPE_OTHER; + break; + } + } + } + else + argtype = ARGTYPE_OTHER; + + if (argtype != ARGTYPE_OTHER) + { + if (i == *argc - 1) + mainerr_arg_missing((char_u *)argv[i]); + if (argtype == ARGTYPE_SEND) + { + *serverStr = (char_u *)argv[i + 1]; + i++; + } + else + { + *serverStr = build_drop_cmd(*argc - i - 1, argv + i + 1, + tabs, argtype == ARGTYPE_EDIT_WAIT); + if (*serverStr == NULL) + { + // Probably out of memory, exit. + didone = TRUE; + exiterr = 1; + break; + } + Argc = i; + } +# ifdef FEAT_X11 + if (xterm_dpy == NULL) + { + mch_errmsg(_("No display")); + ret = -1; + } + else + ret = serverSendToVim(xterm_dpy, sname, *serverStr, + NULL, &srv, 0, 0, 0, silent); +# else + // Win32 always works? + ret = serverSendToVim(sname, *serverStr, NULL, &srv, 0, 0, silent); +# endif + if (ret < 0) + { + if (argtype == ARGTYPE_SEND) + { + // Failed to send, abort. + mch_errmsg(_(": Send failed.\n")); + didone = TRUE; + exiterr = 1; + } + else if (!silent) + // Let vim start normally. + mch_errmsg(_(": Send failed. Trying to execute locally\n")); + break; + } + +# ifdef FEAT_GUI_MSWIN + // Guess that when the server name starts with "g" it's a GUI + // server, which we can bring to the foreground here. + // Foreground() in the server doesn't work very well. + if (argtype != ARGTYPE_SEND && TOUPPER_ASC(*sname) == 'G') + SetForegroundWindow(srv); +# endif + + /* + * For --remote-wait: Wait until the server did edit each + * file. Also detect that the server no longer runs. + */ + if (argtype == ARGTYPE_EDIT_WAIT) + { + int numFiles = *argc - i - 1; + int j; + char_u *done = alloc(numFiles); + char_u *p; +# ifdef FEAT_GUI_MSWIN + NOTIFYICONDATA ni; + int count = 0; + extern HWND message_window; +# endif + + if (numFiles > 0 && argv[i + 1][0] == '+') + // Skip "+cmd" argument, don't wait for it to be edited. + --numFiles; + +# ifdef FEAT_GUI_MSWIN + ni.cbSize = sizeof(ni); + ni.hWnd = message_window; + ni.uID = 0; + ni.uFlags = NIF_ICON|NIF_TIP; + ni.hIcon = LoadIcon((HINSTANCE)GetModuleHandle(0), "IDR_VIM"); + sprintf(ni.szTip, _("%d of %d edited"), count, numFiles); + Shell_NotifyIcon(NIM_ADD, &ni); +# endif + + // Wait for all files to unload in remote + vim_memset(done, 0, numFiles); + while (memchr(done, 0, numFiles) != NULL) + { +# ifdef MSWIN + p = serverGetReply(srv, NULL, TRUE, TRUE, 0); + if (p == NULL) + break; +# else + if (serverReadReply(xterm_dpy, srv, &p, TRUE, -1) < 0) + break; +# endif + j = atoi((char *)p); + if (j >= 0 && j < numFiles) + { +# ifdef FEAT_GUI_MSWIN + ++count; + sprintf(ni.szTip, _("%d of %d edited"), + count, numFiles); + Shell_NotifyIcon(NIM_MODIFY, &ni); +# endif + done[j] = 1; + } + } +# ifdef FEAT_GUI_MSWIN + Shell_NotifyIcon(NIM_DELETE, &ni); +# endif + vim_free(done); + } + } + else if (STRICMP(argv[i], "--remote-expr") == 0) + { + if (i == *argc - 1) + mainerr_arg_missing((char_u *)argv[i]); +# ifdef MSWIN + // Win32 always works? + if (serverSendToVim(sname, (char_u *)argv[i + 1], + &res, NULL, 1, 0, FALSE) < 0) +# else + if (xterm_dpy == NULL) + mch_errmsg(_("No display: Send expression failed.\n")); + else if (serverSendToVim(xterm_dpy, sname, (char_u *)argv[i + 1], + &res, NULL, 1, 0, 1, FALSE) < 0) +# endif + { + if (res != NULL && *res != NUL) + { + // Output error from remote + mch_errmsg((char *)res); + VIM_CLEAR(res); + } + mch_errmsg(_(": Send expression failed.\n")); + } + } + else if (STRICMP(argv[i], "--serverlist") == 0) + { +# ifdef MSWIN + // Win32 always works? + res = serverGetVimNames(); +# else + if (xterm_dpy != NULL) + res = serverGetVimNames(xterm_dpy); +# endif + if (did_emsg) + mch_errmsg("\n"); + } + else if (STRICMP(argv[i], "--servername") == 0) + { + // Already processed. Take it out of the command line + i++; + continue; + } + else + { + *newArgV++ = argv[i]; + newArgC++; + continue; + } + didone = TRUE; + if (res != NULL && *res != NUL) + { + mch_msg((char *)res); + if (res[STRLEN(res) - 1] != '\n') + mch_msg("\n"); + } + vim_free(res); + } + + if (didone) + { + display_errors(); // display any collected messages + exit(exiterr); // Mission accomplished - get out + } + + // Return back into main() + *argc = newArgC; + vim_free(sname); +} + +/* + * Build a ":drop" command to send to a Vim server. + */ + static char_u * +build_drop_cmd( + int filec, + char **filev, + int tabs, // Use ":tab drop" instead of ":drop". + int sendReply) +{ + garray_T ga; + int i; + char_u *inicmd = NULL; + char_u *p; + char_u *cdp; + char_u *cwd; + + if (filec > 0 && filev[0][0] == '+') + { + inicmd = (char_u *)filev[0] + 1; + filev++; + filec--; + } + // Check if we have at least one argument. + if (filec <= 0) + mainerr_arg_missing((char_u *)filev[-1]); + + // Temporarily cd to the current directory to handle relative file names. + cwd = alloc(MAXPATHL); + if (cwd == NULL) + return NULL; + if (mch_dirname(cwd, MAXPATHL) != OK) + { + vim_free(cwd); + return NULL; + } + cdp = vim_strsave_escaped_ext(cwd, +#ifdef BACKSLASH_IN_FILENAME + (char_u *)"", // rem_backslash() will tell what chars to escape +#else + PATH_ESC_CHARS, +#endif + '\\', TRUE); + vim_free(cwd); + if (cdp == NULL) + return NULL; + ga_init2(&ga, 1, 100); + ga_concat(&ga, (char_u *)":cd "); + ga_concat(&ga, cdp); + + // Call inputsave() so that a prompt for an encryption key works. + ga_concat(&ga, (char_u *) + ":if exists('*inputsave')|call inputsave()|endif|"); + if (tabs) + ga_concat(&ga, (char_u *)"tab "); + ga_concat(&ga, (char_u *)"drop"); + for (i = 0; i < filec; i++) + { + // On Unix the shell has already expanded the wildcards, don't want to + // do it again in the Vim server. On MS-Windows only escape + // non-wildcard characters. + p = vim_strsave_escaped((char_u *)filev[i], +#ifdef UNIX + PATH_ESC_CHARS +#else + (char_u *)" \t%#" +#endif + ); + if (p == NULL) + { + vim_free(ga.ga_data); + return NULL; + } + ga_concat(&ga, (char_u *)" "); + ga_concat(&ga, p); + vim_free(p); + } + ga_concat(&ga, (char_u *) + "|if exists('*inputrestore')|call inputrestore()|endif"); + + // The :drop commands goes to Insert mode when 'insertmode' is set, use + // CTRL-\ CTRL-N again. + ga_concat(&ga, (char_u *)""); + + // Switch back to the correct current directory (prior to temporary path + // switch) unless 'autochdir' is set, in which case it will already be + // correct after the :drop command. With line breaks and spaces: + // if !exists('+acd') || !&acd + // if haslocaldir() + // cd - + // lcd - + // elseif getcwd() ==# 'current path' + // cd - + // endif + // endif + ga_concat(&ga, (char_u *)":if !exists('+acd')||!&acd|if haslocaldir()|"); + ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd() ==# '"); + ga_concat(&ga, cdp); + ga_concat(&ga, (char_u *)"'|cd -|endif|endif"); + vim_free(cdp); + + if (sendReply) + ga_concat(&ga, (char_u *)":call SetupRemoteReplies()"); + ga_concat(&ga, (char_u *)":"); + if (inicmd != NULL) + { + // Can't use after "inicmd", because a "startinsert" would cause + // the following commands to be inserted as text. Use a "|", + // hopefully "inicmd" does allow this... + ga_concat(&ga, inicmd); + ga_concat(&ga, (char_u *)"|"); + } + // Bring the window to the foreground, goto Insert mode when 'im' set and + // clear command line. + ga_concat(&ga, (char_u *)"cal foreground()|if &im|star|en|redr|f"); + ga_append(&ga, NUL); + return ga.ga_data; +} + +/* + * Make our basic server name: use the specified "arg" if given, otherwise use + * the tail of the command "cmd" we were started with. + * Return the name in allocated memory. This doesn't include a serial number. + */ + static char_u * +serverMakeName(char_u *arg, char *cmd) +{ + char_u *p; + + if (arg != NULL && *arg != NUL) + p = vim_strsave_up(arg); + else + { + p = vim_strsave_up(gettail((char_u *)cmd)); + // Remove .exe or .bat from the name. + if (p != NULL && vim_strchr(p, '.') != NULL) + *vim_strchr(p, '.') = NUL; + } + return p; +} +#endif // FEAT_CLIENTSERVER + +#if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) + static void +make_connection(void) +{ + if (X_DISPLAY == NULL +# ifdef FEAT_GUI + && !gui.in_use +# endif + ) + { + x_force_connect = TRUE; + setup_term_clip(); + x_force_connect = FALSE; + } +} + + static int +check_connection(void) +{ + make_connection(); + if (X_DISPLAY == NULL) + { + emsg(_(e_no_connection_to_x_server)); + return FAIL; + } + return OK; +} +#endif + +#ifdef FEAT_CLIENTSERVER + static void +remote_common(typval_T *argvars, typval_T *rettv, int expr) +{ + char_u *server_name; + char_u *keys; + char_u *r = NULL; + char_u buf[NUMBUFLEN]; + int timeout = 0; +# ifdef MSWIN + HWND w; +# else + Window w; +# endif + + if (check_restricted() || check_secure()) + return; + +# ifdef FEAT_X11 + if (check_connection() == FAIL) + return; +# endif + if (argvars[2].v_type != VAR_UNKNOWN + && argvars[3].v_type != VAR_UNKNOWN) + timeout = tv_get_number(&argvars[3]); + + server_name = tv_get_string_chk(&argvars[0]); + if (server_name == NULL) + return; // type error; errmsg already given + keys = tv_get_string_buf(&argvars[1], buf); +# ifdef MSWIN + if (serverSendToVim(server_name, keys, &r, &w, expr, timeout, TRUE) < 0) +# else + if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, timeout, + 0, TRUE) < 0) +# endif + { + if (r != NULL) + { + emsg((char *)r); // sending worked but evaluation failed + vim_free(r); + } + else + semsg(_(e_unable_to_send_to_str), server_name); + return; + } + + rettv->vval.v_string = r; + + if (argvars[2].v_type != VAR_UNKNOWN) + { + dictitem_T v; + char_u str[30]; + char_u *idvar; + + idvar = tv_get_string_chk(&argvars[2]); + if (idvar != NULL && *idvar != NUL) + { + sprintf((char *)str, PRINTF_HEX_LONG_U, (long_u)w); + v.di_tv.v_type = VAR_STRING; + v.di_tv.vval.v_string = vim_strsave(str); + set_var(idvar, &v.di_tv, FALSE); + vim_free(v.di_tv.vval.v_string); + } + } +} +#endif + +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * "remote_expr()" function + */ + void +f_remote_expr(typval_T *argvars UNUSED, typval_T *rettv) +{ + rettv->v_type = VAR_STRING; + rettv->vval.v_string = NULL; + +#ifdef FEAT_CLIENTSERVER + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL + || check_for_opt_string_arg(argvars, 2) == FAIL + || (argvars[2].v_type != VAR_UNKNOWN + && check_for_opt_number_arg(argvars, 3) == FAIL))) + return; + + remote_common(argvars, rettv, TRUE); +#endif +} + +/* + * "remote_foreground()" function + */ + void +f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ +#ifdef FEAT_CLIENTSERVER + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + +# ifdef MSWIN + // On Win32 it's done in this application. + { + char_u *server_name = tv_get_string_chk(&argvars[0]); + + if (server_name != NULL) + serverForeground(server_name); + } +# else + // Send a foreground() expression to the server. + argvars[1].v_type = VAR_STRING; + argvars[1].vval.v_string = vim_strsave((char_u *)"foreground()"); + argvars[2].v_type = VAR_UNKNOWN; + rettv->v_type = VAR_STRING; + rettv->vval.v_string = NULL; + remote_common(argvars, rettv, TRUE); + vim_free(argvars[1].vval.v_string); +# endif +#endif +} + + void +f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv) +{ +#ifdef FEAT_CLIENTSERVER + dictitem_T v; + char_u *s = NULL; +# ifdef MSWIN + long_u n = 0; +# endif + char_u *serverid; + + rettv->vval.v_number = -1; + if (check_restricted() || check_secure()) + return; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_string_arg(argvars, 1) == FAIL)) + return; + + serverid = tv_get_string_chk(&argvars[0]); + if (serverid == NULL) + return; // type error; errmsg already given +# ifdef MSWIN + sscanf((const char *)serverid, SCANF_HEX_LONG_U, &n); + if (n == 0) + rettv->vval.v_number = -1; + else + { + s = serverGetReply((HWND)n, FALSE, FALSE, FALSE, 0); + rettv->vval.v_number = (s != NULL); + } +# else + if (check_connection() == FAIL) + return; + + rettv->vval.v_number = serverPeekReply(X_DISPLAY, + serverStrToWin(serverid), &s); +# endif + + if (argvars[1].v_type != VAR_UNKNOWN && rettv->vval.v_number > 0) + { + char_u *retvar; + + v.di_tv.v_type = VAR_STRING; + v.di_tv.vval.v_string = vim_strsave(s); + retvar = tv_get_string_chk(&argvars[1]); + if (retvar != NULL) + set_var(retvar, &v.di_tv, FALSE); + vim_free(v.di_tv.vval.v_string); + } +#else + rettv->vval.v_number = -1; +#endif +} + + void +f_remote_read(typval_T *argvars UNUSED, typval_T *rettv) +{ + char_u *r = NULL; + +#ifdef FEAT_CLIENTSERVER + char_u *serverid; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_number_arg(argvars, 1) == FAIL)) + return; + + serverid = tv_get_string_chk(&argvars[0]); + if (serverid != NULL && !check_restricted() && !check_secure()) + { + int timeout = 0; +# ifdef MSWIN + // The server's HWND is encoded in the 'id' parameter + long_u n = 0; +# endif + + if (argvars[1].v_type != VAR_UNKNOWN) + timeout = tv_get_number(&argvars[1]); + +# ifdef MSWIN + sscanf((char *)serverid, SCANF_HEX_LONG_U, &n); + if (n != 0) + r = serverGetReply((HWND)n, FALSE, TRUE, TRUE, timeout); + if (r == NULL) +# else + if (check_connection() == FAIL + || serverReadReply(X_DISPLAY, serverStrToWin(serverid), + &r, FALSE, timeout) < 0) +# endif + emsg(_(e_unable_to_read_server_reply)); + } +#endif + rettv->v_type = VAR_STRING; + rettv->vval.v_string = r; +} + +/* + * "remote_send()" function + */ + void +f_remote_send(typval_T *argvars UNUSED, typval_T *rettv) +{ + rettv->v_type = VAR_STRING; + rettv->vval.v_string = NULL; + +#ifdef FEAT_CLIENTSERVER + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL + || check_for_opt_string_arg(argvars, 2) == FAIL)) + return; + + remote_common(argvars, rettv, FALSE); +#endif +} + +/* + * "remote_startserver()" function + */ + void +f_remote_startserver(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ +#ifdef FEAT_CLIENTSERVER + char_u *server; + + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + + server = tv_get_string_chk(&argvars[0]); + if (server == NULL) + return; // type error; errmsg already given + if (serverName != NULL) + emsg(_(e_already_started_server)); + else + { +# ifdef FEAT_X11 + if (check_connection() == OK) + serverRegisterName(X_DISPLAY, server); +# else + serverSetName(server); +# endif + } +#else + emsg(_(e_clientserver_feature_not_available)); +#endif +} + + void +f_server2client(typval_T *argvars UNUSED, typval_T *rettv) +{ +#ifdef FEAT_CLIENTSERVER + char_u buf[NUMBUFLEN]; + char_u *server; + char_u *reply; + + rettv->vval.v_number = -1; + if (check_restricted() || check_secure()) + return; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL)) + return; + + server = tv_get_string_chk(&argvars[0]); + reply = tv_get_string_buf_chk(&argvars[1], buf); + if (server == NULL || reply == NULL) + return; + +# ifdef FEAT_X11 + if (check_connection() == FAIL) + return; +# endif + + if (serverSendReply(server, reply) < 0) + { + emsg(_(e_unable_to_send_to_client)); + return; + } + rettv->vval.v_number = 0; +#else + rettv->vval.v_number = -1; +#endif +} + + void +f_serverlist(typval_T *argvars UNUSED, typval_T *rettv) +{ + char_u *r = NULL; + +#ifdef FEAT_CLIENTSERVER +# ifdef MSWIN + r = serverGetVimNames(); +# else + make_connection(); + if (X_DISPLAY != NULL) + r = serverGetVimNames(X_DISPLAY); +# endif +#endif + rettv->v_type = VAR_STRING; + rettv->vval.v_string = r; +} +#endif diff --git a/src/clipboard.c b/src/clipboard.c new file mode 100644 index 0000000000000..c77b66cd9da7a --- /dev/null +++ b/src/clipboard.c @@ -0,0 +1,2227 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * clipboard.c: Functions to handle the clipboard + */ + +#include "vim.h" + +#ifdef FEAT_CYGWIN_WIN32_CLIPBOARD +# define WIN32_LEAN_AND_MEAN +# include +# include "winclip.pro" +#endif + +// Functions for copying and pasting text between applications. +// This is always included in a GUI version, but may also be included when the +// clipboard and mouse is available to a terminal version such as xterm. +// Note: there are some more functions in ops.c that handle selection stuff. +// +// Also note that the majority of functions here deal with the X 'primary' +// (visible - for Visual mode use) selection, and only that. There are no +// versions of these for the 'clipboard' selection, as Visual mode has no use +// for them. + +#if defined(FEAT_CLIPBOARD) || defined(PROTO) + +/* + * Selection stuff using Visual mode, for cutting and pasting text to other + * windows. + */ + +/* + * Call this to initialise the clipboard. Pass it FALSE if the clipboard code + * is included, but the clipboard can not be used, or TRUE if the clipboard can + * be used. Eg unix may call this with FALSE, then call it again with TRUE if + * the GUI starts. + */ + void +clip_init(int can_use) +{ + Clipboard_T *cb; + + cb = &clip_star; + for (;;) + { + cb->available = can_use; + cb->owned = FALSE; + cb->start.lnum = 0; + cb->start.col = 0; + cb->end.lnum = 0; + cb->end.col = 0; + cb->state = SELECT_CLEARED; + + if (cb == &clip_plus) + break; + cb = &clip_plus; + } +} + +/* + * Check whether the VIsual area has changed, and if so try to become the owner + * of the selection, and free any old converted selection we may still have + * lying around. If the VIsual mode has ended, make a copy of what was + * selected so we can still give it to others. Will probably have to make sure + * this is called whenever VIsual mode is ended. + */ + void +clip_update_selection(Clipboard_T *clip) +{ + pos_T start, end; + + // If visual mode is only due to a redo command ("."), then ignore it + if (!redo_VIsual_busy && VIsual_active && (State & MODE_NORMAL)) + { + if (LT_POS(VIsual, curwin->w_cursor)) + { + start = VIsual; + end = curwin->w_cursor; + if (has_mbyte) + end.col += (*mb_ptr2len)(ml_get_cursor()) - 1; + } + else + { + start = curwin->w_cursor; + end = VIsual; + } + if (!EQUAL_POS(clip->start, start) + || !EQUAL_POS(clip->end, end) + || clip->vmode != VIsual_mode) + { + clip_clear_selection(clip); + clip->start = start; + clip->end = end; + clip->vmode = VIsual_mode; + clip_free_selection(clip); + clip_own_selection(clip); + clip_gen_set_selection(clip); + } + } +} + + static int +clip_gen_own_selection(Clipboard_T *cbd) +{ +#ifdef FEAT_XCLIPBOARD +# ifdef FEAT_GUI + if (gui.in_use) + return clip_mch_own_selection(cbd); + else +# endif + return clip_xterm_own_selection(cbd); +#else + return clip_mch_own_selection(cbd); +#endif +} + + void +clip_own_selection(Clipboard_T *cbd) +{ + /* + * Also want to check somehow that we are reading from the keyboard rather + * than a mapping etc. + */ +#ifdef FEAT_X11 + // Always own the selection, we might have lost it without being + // notified, e.g. during a ":sh" command. + if (cbd->available) + { + int was_owned = cbd->owned; + + cbd->owned = (clip_gen_own_selection(cbd) == OK); + if (!was_owned && (cbd == &clip_star || cbd == &clip_plus)) + { + // May have to show a different kind of highlighting for the + // selected area. There is no specific redraw command for this, + // just redraw all windows on the current buffer. + if (cbd->owned + && (get_real_state() == MODE_VISUAL + || get_real_state() == MODE_SELECT) + && (cbd == &clip_star ? clip_isautosel_star() + : clip_isautosel_plus()) + && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)) + redraw_curbuf_later(INVERTED_ALL); + } + } +#else + // Only own the clipboard when we didn't own it yet. + if (!cbd->owned && cbd->available) + cbd->owned = (clip_gen_own_selection(cbd) == OK); +#endif +} + + static void +clip_gen_lose_selection(Clipboard_T *cbd) +{ +#ifdef FEAT_XCLIPBOARD +# ifdef FEAT_GUI + if (gui.in_use) + clip_mch_lose_selection(cbd); + else +# endif + clip_xterm_lose_selection(cbd); +#else + clip_mch_lose_selection(cbd); +#endif +} + + void +clip_lose_selection(Clipboard_T *cbd) +{ +#ifdef FEAT_X11 + int was_owned = cbd->owned; +#endif + int visual_selection = FALSE; + + if (cbd == &clip_star || cbd == &clip_plus) + visual_selection = TRUE; + + clip_free_selection(cbd); + cbd->owned = FALSE; + if (visual_selection) + clip_clear_selection(cbd); + clip_gen_lose_selection(cbd); +#ifdef FEAT_X11 + if (visual_selection) + { + // May have to show a different kind of highlighting for the selected + // area. There is no specific redraw command for this, just redraw all + // windows on the current buffer. + if (was_owned + && (get_real_state() == MODE_VISUAL + || get_real_state() == MODE_SELECT) + && (cbd == &clip_star ? + clip_isautosel_star() : clip_isautosel_plus()) + && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) + && !exiting) + { + update_curbuf(INVERTED_ALL); + setcursor(); + cursor_on(); + out_flush_cursor(TRUE, FALSE); + } + } +#endif +} + + static void +clip_copy_selection(Clipboard_T *clip) +{ + if (VIsual_active && (State & MODE_NORMAL) && clip->available) + { + clip_update_selection(clip); + clip_free_selection(clip); + clip_own_selection(clip); + if (clip->owned) + clip_get_selection(clip); + clip_gen_set_selection(clip); + } +} + +/* + * Save and restore clip_unnamed before doing possibly many changes. This + * prevents accessing the clipboard very often which might slow down Vim + * considerably. + */ +static __thread int global_change_count = 0; // if set, inside a start_global_changes +static __thread int clipboard_needs_update = FALSE; // clipboard needs to be updated +static __thread int clip_did_set_selection = TRUE; + +/* + * Save clip_unnamed and reset it. + */ + void +start_global_changes(void) +{ + if (++global_change_count > 1) + return; + clip_unnamed_saved = clip_unnamed; + clipboard_needs_update = FALSE; + + if (clip_did_set_selection) + { + clip_unnamed = 0; + clip_did_set_selection = FALSE; + } +} + +/* + * Return TRUE if setting the clipboard was postponed, it already contains the + * right text. + */ + static int +is_clipboard_needs_update() +{ + return clipboard_needs_update; +} + +/* + * Restore clip_unnamed and set the selection when needed. + */ + void +end_global_changes(void) +{ + if (--global_change_count > 0) + // recursive + return; + if (!clip_did_set_selection) + { + clip_did_set_selection = TRUE; + clip_unnamed = clip_unnamed_saved; + clip_unnamed_saved = 0; + if (clipboard_needs_update) + { + // only store something in the clipboard, + // if we have yanked anything to it + if (clip_unnamed & CLIP_UNNAMED) + { + clip_own_selection(&clip_star); + clip_gen_set_selection(&clip_star); + } + if (clip_unnamed & CLIP_UNNAMED_PLUS) + { + clip_own_selection(&clip_plus); + clip_gen_set_selection(&clip_plus); + } + } + } + clipboard_needs_update = FALSE; +} + +/* + * Called when Visual mode is ended: update the selection. + */ + void +clip_auto_select(void) +{ + if (clip_isautosel_star()) + clip_copy_selection(&clip_star); + if (clip_isautosel_plus()) + clip_copy_selection(&clip_plus); +} + +/* + * Return TRUE if automatic selection of Visual area is desired for the * + * register. + */ + int +clip_isautosel_star(void) +{ + return ( +#ifdef FEAT_GUI + gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) : +#endif + clip_autoselect_star); +} + +/* + * Return TRUE if automatic selection of Visual area is desired for the + + * register. + */ + int +clip_isautosel_plus(void) +{ + return ( +#ifdef FEAT_GUI + gui.in_use ? (vim_strchr(p_go, GO_ASELPLUS) != NULL) : +#endif + clip_autoselect_plus); +} + + +/* + * Stuff for general mouse selection, without using Visual mode. + */ + +/* + * Compare two screen positions ala strcmp() + */ + static int +clip_compare_pos( + int row1, + int col1, + int row2, + int col2) +{ + if (row1 > row2) return(1); + if (row1 < row2) return(-1); + if (col1 > col2) return(1); + if (col1 < col2) return(-1); + return(0); +} + +// "how" flags for clip_invert_area() +#define CLIP_CLEAR 1 +#define CLIP_SET 2 +#define CLIP_TOGGLE 3 + +/* + * Invert or un-invert a rectangle of the screen. + * "invert" is true if the result is inverted. + */ + static void +clip_invert_rectangle( + Clipboard_T *cbd UNUSED, + int row_arg, + int col_arg, + int height_arg, + int width_arg, + int invert) +{ + int row = row_arg; + int col = col_arg; + int height = height_arg; + int width = width_arg; + +#ifdef FEAT_PROP_POPUP + // this goes on top of all popup windows + screen_zindex = CLIP_ZINDEX; + + if (col < cbd->min_col) + { + width -= cbd->min_col - col; + col = cbd->min_col; + } + if (width > cbd->max_col - col) + width = cbd->max_col - col; + if (row < cbd->min_row) + { + height -= cbd->min_row - row; + row = cbd->min_row; + } + if (height > cbd->max_row - row + 1) + height = cbd->max_row - row + 1; +#endif +#ifdef FEAT_GUI + if (gui.in_use) + gui_mch_invert_rectangle(row, col, height, width); + else +#endif + screen_draw_rectangle(row, col, height, width, invert); +#ifdef FEAT_PROP_POPUP + screen_zindex = 0; +#endif +} + +/* + * Invert a region of the display between a starting and ending row and column + * Values for "how": + * CLIP_CLEAR: undo inversion + * CLIP_SET: set inversion + * CLIP_TOGGLE: set inversion if pos1 < pos2, undo inversion otherwise. + * 0: invert (GUI only). + */ + static void +clip_invert_area( + Clipboard_T *cbd, + int row1, + int col1, + int row2, + int col2, + int how) +{ + int invert = FALSE; + int max_col; + +#ifdef FEAT_PROP_POPUP + max_col = cbd->max_col - 1; +#else + max_col = Columns - 1; +#endif + + if (how == CLIP_SET) + invert = TRUE; + + // Swap the from and to positions so the from is always before + if (clip_compare_pos(row1, col1, row2, col2) > 0) + { + int tmp_row, tmp_col; + + tmp_row = row1; + tmp_col = col1; + row1 = row2; + col1 = col2; + row2 = tmp_row; + col2 = tmp_col; + } + else if (how == CLIP_TOGGLE) + invert = TRUE; + + // If all on the same line, do it the easy way + if (row1 == row2) + { + clip_invert_rectangle(cbd, row1, col1, 1, col2 - col1, invert); + } + else + { + // Handle a piece of the first line + if (col1 > 0) + { + clip_invert_rectangle(cbd, row1, col1, 1, + (int)Columns - col1, invert); + row1++; + } + + // Handle a piece of the last line + if (col2 < max_col) + { + clip_invert_rectangle(cbd, row2, 0, 1, col2, invert); + row2--; + } + + // Handle the rectangle that's left + if (row2 >= row1) + clip_invert_rectangle(cbd, row1, 0, row2 - row1 + 1, + (int)Columns, invert); + } +} + +/* + * Start, continue or end a modeless selection. Used when editing the + * command-line, in the cmdline window and when the mouse is in a popup window. + */ + void +clip_modeless(int button, int is_click, int is_drag) +{ + int repeat; + + repeat = ((clip_star.mode == SELECT_MODE_CHAR + || clip_star.mode == SELECT_MODE_LINE) + && (mod_mask & MOD_MASK_2CLICK)) + || (clip_star.mode == SELECT_MODE_WORD + && (mod_mask & MOD_MASK_3CLICK)); + if (is_click && button == MOUSE_RIGHT) + { + // Right mouse button: If there was no selection, start one. + // Otherwise extend the existing selection. + if (clip_star.state == SELECT_CLEARED) + clip_start_selection(mouse_col, mouse_row, FALSE); + clip_process_selection(button, mouse_col, mouse_row, repeat); + } + else if (is_click) + clip_start_selection(mouse_col, mouse_row, repeat); + else if (is_drag) + { + // Don't try extending a selection if there isn't one. Happens when + // button-down is in the cmdline and them moving mouse upwards. + if (clip_star.state != SELECT_CLEARED) + clip_process_selection(button, mouse_col, mouse_row, repeat); + } + else // release + clip_process_selection(MOUSE_RELEASE, mouse_col, mouse_row, FALSE); +} + +/* + * Update the currently selected region by adding and/or subtracting from the + * beginning or end and inverting the changed area(s). + */ + static void +clip_update_modeless_selection( + Clipboard_T *cb, + int row1, + int col1, + int row2, + int col2) +{ + // See if we changed at the beginning of the selection + if (row1 != cb->start.lnum || col1 != (int)cb->start.col) + { + clip_invert_area(cb, row1, col1, (int)cb->start.lnum, cb->start.col, + CLIP_TOGGLE); + cb->start.lnum = row1; + cb->start.col = col1; + } + + // See if we changed at the end of the selection + if (row2 != cb->end.lnum || col2 != (int)cb->end.col) + { + clip_invert_area(cb, (int)cb->end.lnum, cb->end.col, row2, col2, + CLIP_TOGGLE); + cb->end.lnum = row2; + cb->end.col = col2; + } +} + +/* + * Find the starting and ending positions of the word at the given row and + * column. Only white-separated words are recognized here. + */ +#define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c)) + + static void +clip_get_word_boundaries(Clipboard_T *cb, int row, int col) +{ + int start_class; + int temp_col; + char_u *p; + int mboff; + + if (row >= screen_Rows || col >= screen_Columns || ScreenLines == NULL) + return; + + p = ScreenLines + LineOffset[row]; + // Correct for starting in the right half of a double-wide char + if (enc_dbcs != 0) + col -= dbcs_screen_head_off(p, p + col); + else if (enc_utf8 && p[col] == 0) + --col; + start_class = CHAR_CLASS(p[col]); + + temp_col = col; + for ( ; temp_col > 0; temp_col--) + if (enc_dbcs != 0 + && (mboff = dbcs_screen_head_off(p, p + temp_col - 1)) > 0) + temp_col -= mboff; + else if (CHAR_CLASS(p[temp_col - 1]) != start_class + && !(enc_utf8 && p[temp_col - 1] == 0)) + break; + cb->word_start_col = temp_col; + + temp_col = col; + for ( ; temp_col < screen_Columns; temp_col++) + if (enc_dbcs != 0 && dbcs_ptr2cells(p + temp_col) == 2) + ++temp_col; + else if (CHAR_CLASS(p[temp_col]) != start_class + && !(enc_utf8 && p[temp_col] == 0)) + break; + cb->word_end_col = temp_col; +} + +/* + * Find the column position for the last non-whitespace character on the given + * line at or before start_col. + */ + static int +clip_get_line_end(Clipboard_T *cbd UNUSED, int row) +{ + int i; + + if (row >= screen_Rows || ScreenLines == NULL) + return 0; + for (i = +#ifdef FEAT_PROP_POPUP + cbd->max_col; +#else + screen_Columns; +#endif + i > 0; i--) + if (ScreenLines[LineOffset[row] + i - 1] != ' ') + break; + return i; +} + +/* + * Start the selection + */ + void +clip_start_selection(int col, int row, int repeated_click) +{ + Clipboard_T *cb = &clip_star; +#ifdef FEAT_PROP_POPUP + win_T *wp; + int row_cp = row; + int col_cp = col; + + wp = mouse_find_win(&row_cp, &col_cp, FIND_POPUP); + if (wp != NULL && WIN_IS_POPUP(wp) + && popup_is_in_scrollbar(wp, row_cp, col_cp)) + // click or double click in scrollbar does not start a selection + return; +#endif + + if (cb->state == SELECT_DONE) + clip_clear_selection(cb); + + row = check_row(row); + col = check_col(col); + col = mb_fix_col(col, row); + + cb->start.lnum = row; + cb->start.col = col; + cb->end = cb->start; + cb->origin_row = (short_u)cb->start.lnum; + cb->state = SELECT_IN_PROGRESS; +#ifdef FEAT_PROP_POPUP + if (wp != NULL && WIN_IS_POPUP(wp)) + { + // Click in a popup window restricts selection to that window, + // excluding the border. + cb->min_col = wp->w_wincol + wp->w_popup_border[3]; + cb->max_col = wp->w_wincol + popup_width(wp) + - wp->w_popup_border[1] - wp->w_has_scrollbar; + if (cb->max_col > screen_Columns) + cb->max_col = screen_Columns; + cb->min_row = wp->w_winrow + wp->w_popup_border[0]; + cb->max_row = wp->w_winrow + popup_height(wp) - 1 + - wp->w_popup_border[2]; + } + else + { + cb->min_col = 0; + cb->max_col = screen_Columns; + cb->min_row = 0; + cb->max_row = screen_Rows; + } +#endif + + if (repeated_click) + { + if (++cb->mode > SELECT_MODE_LINE) + cb->mode = SELECT_MODE_CHAR; + } + else + cb->mode = SELECT_MODE_CHAR; + +#ifdef FEAT_GUI + // clear the cursor until the selection is made + if (gui.in_use) + gui_undraw_cursor(); +#endif + + switch (cb->mode) + { + case SELECT_MODE_CHAR: + cb->origin_start_col = cb->start.col; + cb->word_end_col = clip_get_line_end(cb, (int)cb->start.lnum); + break; + + case SELECT_MODE_WORD: + clip_get_word_boundaries(cb, (int)cb->start.lnum, cb->start.col); + cb->origin_start_col = cb->word_start_col; + cb->origin_end_col = cb->word_end_col; + + clip_invert_area(cb, (int)cb->start.lnum, cb->word_start_col, + (int)cb->end.lnum, cb->word_end_col, CLIP_SET); + cb->start.col = cb->word_start_col; + cb->end.col = cb->word_end_col; + break; + + case SELECT_MODE_LINE: + clip_invert_area(cb, (int)cb->start.lnum, 0, (int)cb->start.lnum, + (int)Columns, CLIP_SET); + cb->start.col = 0; + cb->end.col = Columns; + break; + } + + cb->prev = cb->start; + +#ifdef DEBUG_SELECTION + printf("Selection started at (%ld,%d)\n", cb->start.lnum, cb->start.col); +#endif +} + +/* + * Continue processing the selection + */ + void +clip_process_selection( + int button, + int col, + int row, + int_u repeated_click) +{ + Clipboard_T *cb = &clip_star; + int diff; + int slen = 1; // cursor shape width + + if (button == MOUSE_RELEASE) + { + if (cb->state != SELECT_IN_PROGRESS) + return; + + // Check to make sure we have something selected + if (cb->start.lnum == cb->end.lnum && cb->start.col == cb->end.col) + { +#ifdef FEAT_GUI + if (gui.in_use) + gui_update_cursor(FALSE, FALSE); +#endif + cb->state = SELECT_CLEARED; + return; + } + +#ifdef DEBUG_SELECTION + printf("Selection ended: (%ld,%d) to (%ld,%d)\n", cb->start.lnum, + cb->start.col, cb->end.lnum, cb->end.col); +#endif + if (clip_isautosel_star() + || ( +#ifdef FEAT_GUI + gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) : +#endif + clip_autoselectml)) + clip_copy_modeless_selection(FALSE); +#ifdef FEAT_GUI + if (gui.in_use) + gui_update_cursor(FALSE, FALSE); +#endif + + cb->state = SELECT_DONE; + return; + } + + row = check_row(row); + col = check_col(col); + col = mb_fix_col(col, row); + + if (col == (int)cb->prev.col && row == cb->prev.lnum && !repeated_click) + return; + + /* + * When extending the selection with the right mouse button, swap the + * start and end if the position is before half the selection + */ + if (cb->state == SELECT_DONE && button == MOUSE_RIGHT) + { + /* + * If the click is before the start, or the click is inside the + * selection and the start is the closest side, set the origin to the + * end of the selection. + */ + if (clip_compare_pos(row, col, (int)cb->start.lnum, cb->start.col) < 0 + || (clip_compare_pos(row, col, + (int)cb->end.lnum, cb->end.col) < 0 + && (((cb->start.lnum == cb->end.lnum + && cb->end.col - col > col - cb->start.col)) + || ((diff = (cb->end.lnum - row) - + (row - cb->start.lnum)) > 0 + || (diff == 0 && col < (int)(cb->start.col + + cb->end.col) / 2))))) + { + cb->origin_row = (short_u)cb->end.lnum; + cb->origin_start_col = cb->end.col - 1; + cb->origin_end_col = cb->end.col; + } + else + { + cb->origin_row = (short_u)cb->start.lnum; + cb->origin_start_col = cb->start.col; + cb->origin_end_col = cb->start.col; + } + if (cb->mode == SELECT_MODE_WORD && !repeated_click) + cb->mode = SELECT_MODE_CHAR; + } + + // set state, for when using the right mouse button + cb->state = SELECT_IN_PROGRESS; + +#ifdef DEBUG_SELECTION + printf("Selection extending to (%d,%d)\n", row, col); +#endif + + if (repeated_click && ++cb->mode > SELECT_MODE_LINE) + cb->mode = SELECT_MODE_CHAR; + + switch (cb->mode) + { + case SELECT_MODE_CHAR: + // If we're on a different line, find where the line ends + if (row != cb->prev.lnum) + cb->word_end_col = clip_get_line_end(cb, row); + + // See if we are before or after the origin of the selection + if (clip_compare_pos(row, col, cb->origin_row, + cb->origin_start_col) >= 0) + { + if (col >= (int)cb->word_end_col) + clip_update_modeless_selection(cb, cb->origin_row, + cb->origin_start_col, row, (int)Columns); + else + { + if (has_mbyte && mb_lefthalve(row, col)) + slen = 2; + clip_update_modeless_selection(cb, cb->origin_row, + cb->origin_start_col, row, col + slen); + } + } + else + { + if (has_mbyte + && mb_lefthalve(cb->origin_row, cb->origin_start_col)) + slen = 2; + if (col >= (int)cb->word_end_col) + clip_update_modeless_selection(cb, row, cb->word_end_col, + cb->origin_row, cb->origin_start_col + slen); + else + clip_update_modeless_selection(cb, row, col, + cb->origin_row, cb->origin_start_col + slen); + } + break; + + case SELECT_MODE_WORD: + // If we are still within the same word, do nothing + if (row == cb->prev.lnum && col >= (int)cb->word_start_col + && col < (int)cb->word_end_col && !repeated_click) + return; + + // Get new word boundaries + clip_get_word_boundaries(cb, row, col); + + // Handle being after the origin point of selection + if (clip_compare_pos(row, col, cb->origin_row, + cb->origin_start_col) >= 0) + clip_update_modeless_selection(cb, cb->origin_row, + cb->origin_start_col, row, cb->word_end_col); + else + clip_update_modeless_selection(cb, row, cb->word_start_col, + cb->origin_row, cb->origin_end_col); + break; + + case SELECT_MODE_LINE: + if (row == cb->prev.lnum && !repeated_click) + return; + + if (clip_compare_pos(row, col, cb->origin_row, + cb->origin_start_col) >= 0) + clip_update_modeless_selection(cb, cb->origin_row, 0, row, + (int)Columns); + else + clip_update_modeless_selection(cb, row, 0, cb->origin_row, + (int)Columns); + break; + } + + cb->prev.lnum = row; + cb->prev.col = col; + +#ifdef DEBUG_SELECTION + printf("Selection is: (%ld,%d) to (%ld,%d)\n", cb->start.lnum, + cb->start.col, cb->end.lnum, cb->end.col); +#endif +} + +# if defined(FEAT_GUI) || defined(PROTO) +/* + * Redraw part of the selection if character at "row,col" is inside of it. + * Only used for the GUI. + */ + void +clip_may_redraw_selection(int row, int col, int len) +{ + int start = col; + int end = col + len; + + if (clip_star.state != SELECT_CLEARED + && row >= clip_star.start.lnum + && row <= clip_star.end.lnum) + { + if (row == clip_star.start.lnum && start < (int)clip_star.start.col) + start = clip_star.start.col; + if (row == clip_star.end.lnum && end > (int)clip_star.end.col) + end = clip_star.end.col; + if (end > start) + clip_invert_area(&clip_star, row, start, row, end, 0); + } +} +# endif + +/* + * Called from outside to clear selected region from the display + */ + void +clip_clear_selection(Clipboard_T *cbd) +{ + + if (cbd->state == SELECT_CLEARED) + return; + + clip_invert_area(cbd, (int)cbd->start.lnum, cbd->start.col, + (int)cbd->end.lnum, cbd->end.col, CLIP_CLEAR); + cbd->state = SELECT_CLEARED; +} + +/* + * Clear the selection if any lines from "row1" to "row2" are inside of it. + */ + void +clip_may_clear_selection(int row1, int row2) +{ + if (clip_star.state == SELECT_DONE + && row2 >= clip_star.start.lnum + && row1 <= clip_star.end.lnum) + clip_clear_selection(&clip_star); +} + +/* + * Called before the screen is scrolled up or down. Adjusts the line numbers + * of the selection. Call with big number when clearing the screen. + */ + void +clip_scroll_selection( + int rows) // negative for scroll down +{ + int lnum; + + if (clip_star.state == SELECT_CLEARED) + return; + + lnum = clip_star.start.lnum - rows; + if (lnum <= 0) + clip_star.start.lnum = 0; + else if (lnum >= screen_Rows) // scrolled off of the screen + clip_star.state = SELECT_CLEARED; + else + clip_star.start.lnum = lnum; + + lnum = clip_star.end.lnum - rows; + if (lnum < 0) // scrolled off of the screen + clip_star.state = SELECT_CLEARED; + else if (lnum >= screen_Rows) + clip_star.end.lnum = screen_Rows - 1; + else + clip_star.end.lnum = lnum; +} + +/* + * Copy the currently selected area into the '*' register so it will be + * available for pasting. + * When "both" is TRUE also copy to the '+' register. + */ + void +clip_copy_modeless_selection(int both UNUSED) +{ + char_u *buffer; + char_u *bufp; + int row; + int start_col; + int end_col; + int line_end_col; + int add_newline_flag = FALSE; + int len; + char_u *p; + int row1 = clip_star.start.lnum; + int col1 = clip_star.start.col; + int row2 = clip_star.end.lnum; + int col2 = clip_star.end.col; + + // Can't use ScreenLines unless initialized + if (ScreenLines == NULL) + return; + + /* + * Make sure row1 <= row2, and if row1 == row2 that col1 <= col2. + */ + if (row1 > row2) + { + row = row1; row1 = row2; row2 = row; + row = col1; col1 = col2; col2 = row; + } + else if (row1 == row2 && col1 > col2) + { + row = col1; col1 = col2; col2 = row; + } +#ifdef FEAT_PROP_POPUP + if (col1 < clip_star.min_col) + col1 = clip_star.min_col; + if (col2 > clip_star.max_col) + col2 = clip_star.max_col; + if (row1 > clip_star.max_row || row2 < clip_star.min_row) + return; + if (row1 < clip_star.min_row) + row1 = clip_star.min_row; + if (row2 > clip_star.max_row) + row2 = clip_star.max_row; +#endif + // correct starting point for being on right half of double-wide char + p = ScreenLines + LineOffset[row1]; + if (enc_dbcs != 0) + col1 -= (*mb_head_off)(p, p + col1); + else if (enc_utf8 && p[col1] == 0) + --col1; + + // Create a temporary buffer for storing the text + len = (row2 - row1 + 1) * Columns + 1; + if (enc_dbcs != 0) + len *= 2; // max. 2 bytes per display cell + else if (enc_utf8) + len *= MB_MAXBYTES; + buffer = alloc(len); + if (buffer == NULL) // out of memory + return; + + // Process each row in the selection + for (bufp = buffer, row = row1; row <= row2; row++) + { + if (row == row1) + start_col = col1; + else +#ifdef FEAT_PROP_POPUP + start_col = clip_star.min_col; +#else + start_col = 0; +#endif + + if (row == row2) + end_col = col2; + else +#ifdef FEAT_PROP_POPUP + end_col = clip_star.max_col; +#else + end_col = Columns; +#endif + + line_end_col = clip_get_line_end(&clip_star, row); + + // See if we need to nuke some trailing whitespace + if (end_col >= +#ifdef FEAT_PROP_POPUP + clip_star.max_col +#else + Columns +#endif + && (row < row2 || end_col > line_end_col)) + { + // Get rid of trailing whitespace + end_col = line_end_col; + if (end_col < start_col) + end_col = start_col; + + // If the last line extended to the end, add an extra newline + if (row == row2) + add_newline_flag = TRUE; + } + + // If after the first row, we need to always add a newline + if (row > row1 && !LineWraps[row - 1]) + *bufp++ = NL; + + // Safetey check for in case resizing went wrong + if (row < screen_Rows && end_col <= screen_Columns) + { + if (enc_dbcs != 0) + { + int i; + + p = ScreenLines + LineOffset[row]; + for (i = start_col; i < end_col; ++i) + if (enc_dbcs == DBCS_JPNU && p[i] == 0x8e) + { + // single-width double-byte char + *bufp++ = 0x8e; + *bufp++ = ScreenLines2[LineOffset[row] + i]; + } + else + { + *bufp++ = p[i]; + if (MB_BYTE2LEN(p[i]) == 2) + *bufp++ = p[++i]; + } + } + else if (enc_utf8) + { + int off; + int i; + int ci; + + off = LineOffset[row]; + for (i = start_col; i < end_col; ++i) + { + // The base character is either in ScreenLinesUC[] or + // ScreenLines[]. + if (ScreenLinesUC[off + i] == 0) + *bufp++ = ScreenLines[off + i]; + else + { + bufp += utf_char2bytes(ScreenLinesUC[off + i], bufp); + for (ci = 0; ci < Screen_mco; ++ci) + { + // Add a composing character. + if (ScreenLinesC[ci][off + i] == 0) + break; + bufp += utf_char2bytes(ScreenLinesC[ci][off + i], + bufp); + } + } + // Skip right half of double-wide character. + if (ScreenLines[off + i + 1] == 0) + ++i; + } + } + else + { + STRNCPY(bufp, ScreenLines + LineOffset[row] + start_col, + end_col - start_col); + bufp += end_col - start_col; + } + } + } + + // Add a newline at the end if the selection ended there + if (add_newline_flag) + *bufp++ = NL; + + // First cleanup any old selection and become the owner. + clip_free_selection(&clip_star); + clip_own_selection(&clip_star); + + // Yank the text into the '*' register. + clip_yank_selection(MCHAR, buffer, (long)(bufp - buffer), &clip_star); + + // Make the register contents available to the outside world. + clip_gen_set_selection(&clip_star); + +#ifdef FEAT_X11 + if (both) + { + // Do the same for the '+' register. + clip_free_selection(&clip_plus); + clip_own_selection(&clip_plus); + clip_yank_selection(MCHAR, buffer, (long)(bufp - buffer), &clip_plus); + clip_gen_set_selection(&clip_plus); + } +#endif + vim_free(buffer); +} + + void +clip_gen_set_selection(Clipboard_T *cbd) +{ + if (!clip_did_set_selection) + { + // Updating postponed, so that accessing the system clipboard won't + // hang Vim when accessing it many times (e.g. on a :g command). + if ((cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS)) + || (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED))) + { + clipboard_needs_update = TRUE; + return; + } + } +#ifdef FEAT_XCLIPBOARD +# ifdef FEAT_GUI + if (gui.in_use) + clip_mch_set_selection(cbd); + else +# endif + clip_xterm_set_selection(cbd); +#else + clip_mch_set_selection(cbd); +#endif +} + + static void +clip_gen_request_selection(Clipboard_T *cbd) +{ +#ifdef FEAT_XCLIPBOARD +# ifdef FEAT_GUI + if (gui.in_use) + clip_mch_request_selection(cbd); + else +# endif + clip_xterm_request_selection(cbd); +#else + clip_mch_request_selection(cbd); +#endif +} + +#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \ + || defined(PROTO) + static int +clip_x11_owner_exists(Clipboard_T *cbd) +{ + return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None; +} +#endif + +#if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO) + int +clip_gen_owner_exists(Clipboard_T *cbd UNUSED) +{ +#ifdef FEAT_XCLIPBOARD +# ifdef FEAT_GUI_GTK + if (gui.in_use) + return clip_gtk_owner_exists(cbd); + else +# endif + return clip_x11_owner_exists(cbd); +#else + return TRUE; +#endif +} +#endif + +/* + * Extract the items in the 'clipboard' option and set global values. + * Return an error message or NULL for success. + */ + char * +check_clipboard_option(void) +{ + int new_unnamed = 0; + int new_autoselect_star = FALSE; + int new_autoselect_plus = FALSE; + int new_autoselectml = FALSE; + int new_html = FALSE; + regprog_T *new_exclude_prog = NULL; + char *errmsg = NULL; + char_u *p; + + for (p = p_cb; *p != NUL; ) + { + if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL)) + { + new_unnamed |= CLIP_UNNAMED; + p += 7; + } + else if (STRNCMP(p, "unnamedplus", 11) == 0 + && (p[11] == ',' || p[11] == NUL)) + { + new_unnamed |= CLIP_UNNAMED_PLUS; + p += 11; + } + else if (STRNCMP(p, "autoselect", 10) == 0 + && (p[10] == ',' || p[10] == NUL)) + { + new_autoselect_star = TRUE; + p += 10; + } + else if (STRNCMP(p, "autoselectplus", 14) == 0 + && (p[14] == ',' || p[14] == NUL)) + { + new_autoselect_plus = TRUE; + p += 14; + } + else if (STRNCMP(p, "autoselectml", 12) == 0 + && (p[12] == ',' || p[12] == NUL)) + { + new_autoselectml = TRUE; + p += 12; + } + else if (STRNCMP(p, "html", 4) == 0 && (p[4] == ',' || p[4] == NUL)) + { + new_html = TRUE; + p += 4; + } + else if (STRNCMP(p, "exclude:", 8) == 0 && new_exclude_prog == NULL) + { + p += 8; + new_exclude_prog = vim_regcomp(p, RE_MAGIC); + if (new_exclude_prog == NULL) + errmsg = e_invalid_argument; + break; + } + else + { + errmsg = e_invalid_argument; + break; + } + if (*p == ',') + ++p; + } + if (errmsg == NULL) + { + if (global_busy) + // clip_unnamed will be reset to clip_unnamed_saved + // at end_global_changes + clip_unnamed_saved = new_unnamed; + else + clip_unnamed = new_unnamed; + clip_autoselect_star = new_autoselect_star; + clip_autoselect_plus = new_autoselect_plus; + clip_autoselectml = new_autoselectml; + clip_html = new_html; + vim_regfree(clip_exclude_prog); + clip_exclude_prog = new_exclude_prog; +#ifdef FEAT_GUI_GTK + if (gui.in_use) + { + gui_gtk_set_selection_targets(); + gui_gtk_set_dnd_targets(); + } +#endif + } + else + vim_regfree(new_exclude_prog); + + return errmsg; +} + +/* + * Stuff for the X clipboard. Shared between VMS and Unix. + */ + +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) || defined(PROTO) +# include +# include + +/* + * Open the application context (if it hasn't been opened yet). + * Used for Motif GUI and the xterm clipboard. + */ + void +open_app_context(void) +{ + if (app_context == NULL) + { + XtToolkitInitialize(); + app_context = XtCreateApplicationContext(); + } +} + +static __thread Atom vim_atom; // Vim's own special selection format +static __thread Atom vimenc_atom; // Vim's extended selection format +static __thread Atom utf8_atom; +static __thread Atom compound_text_atom; +static __thread Atom text_atom; +static __thread Atom targets_atom; +static __thread Atom timestamp_atom; // Used to get a timestamp + + void +x11_setup_atoms(Display *dpy) +{ + vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False); + vimenc_atom = XInternAtom(dpy, VIMENC_ATOM_NAME,False); + utf8_atom = XInternAtom(dpy, "UTF8_STRING", False); + compound_text_atom = XInternAtom(dpy, "COMPOUND_TEXT", False); + text_atom = XInternAtom(dpy, "TEXT", False); + targets_atom = XInternAtom(dpy, "TARGETS", False); + clip_star.sel_atom = XA_PRIMARY; + clip_plus.sel_atom = XInternAtom(dpy, "CLIPBOARD", False); + timestamp_atom = XInternAtom(dpy, "TIMESTAMP", False); +} + +/* + * X Selection stuff, for cutting and pasting text to other windows. + */ + + static Boolean +clip_x11_convert_selection_cb( + Widget w UNUSED, + Atom *sel_atom, + Atom *target, + Atom *type, + XtPointer *value, + long_u *length, + int *format) +{ + static char_u *save_result = NULL; + static long_u save_length = 0; + char_u *string; + int motion_type; + Clipboard_T *cbd; + int i; + + if (*sel_atom == clip_plus.sel_atom) + cbd = &clip_plus; + else + cbd = &clip_star; + + if (!cbd->owned) + return False; // Shouldn't ever happen + + // requestor wants to know what target types we support + if (*target == targets_atom) + { + static Atom array[7]; + + *value = (XtPointer)array; + i = 0; + array[i++] = targets_atom; + array[i++] = vimenc_atom; + array[i++] = vim_atom; + if (enc_utf8) + array[i++] = utf8_atom; + array[i++] = XA_STRING; + array[i++] = text_atom; + array[i++] = compound_text_atom; + + *type = XA_ATOM; + // This used to be: *format = sizeof(Atom) * 8; but that caused + // crashes on 64 bit machines. (Peter Derr) + *format = 32; + *length = i; + return True; + } + + if ( *target != XA_STRING + && *target != vimenc_atom + && (*target != utf8_atom || !enc_utf8) + && *target != vim_atom + && *target != text_atom + && *target != compound_text_atom) + return False; + + clip_get_selection(cbd); + motion_type = clip_convert_selection(&string, length, cbd); + if (motion_type < 0) + return False; + + // For our own format, the first byte contains the motion type + if (*target == vim_atom) + (*length)++; + + // Our own format with encoding: motion 'encoding' NUL text + if (*target == vimenc_atom) + *length += STRLEN(p_enc) + 2; + + if (save_length < *length || save_length / 2 >= *length) + *value = XtRealloc((char *)save_result, (Cardinal)*length + 1); + else + *value = save_result; + if (*value == NULL) + { + vim_free(string); + return False; + } + save_result = (char_u *)*value; + save_length = *length; + + if (*target == XA_STRING || (*target == utf8_atom && enc_utf8)) + { + mch_memmove(save_result, string, (size_t)(*length)); + *type = *target; + } + else if (*target == compound_text_atom || *target == text_atom) + { + XTextProperty text_prop; + char *string_nt = (char *)save_result; + int conv_result; + + // create NUL terminated string which XmbTextListToTextProperty wants + mch_memmove(string_nt, string, (size_t)*length); + string_nt[*length] = NUL; + conv_result = XmbTextListToTextProperty(X_DISPLAY, &string_nt, + 1, XCompoundTextStyle, &text_prop); + if (conv_result != Success) + { + vim_free(string); + return False; + } + *value = (XtPointer)(text_prop.value); // from plain text + *length = text_prop.nitems; + *type = compound_text_atom; + XtFree((char *)save_result); + save_result = (char_u *)*value; + save_length = *length; + } + else if (*target == vimenc_atom) + { + int l = STRLEN(p_enc); + + save_result[0] = motion_type; + STRCPY(save_result + 1, p_enc); + mch_memmove(save_result + l + 2, string, (size_t)(*length - l - 2)); + *type = vimenc_atom; + } + else + { + save_result[0] = motion_type; + mch_memmove(save_result + 1, string, (size_t)(*length - 1)); + *type = vim_atom; + } + *format = 8; // 8 bits per char + vim_free(string); + return True; +} + + static void +clip_x11_lose_ownership_cb(Widget w UNUSED, Atom *sel_atom) +{ + if (*sel_atom == clip_plus.sel_atom) + clip_lose_selection(&clip_plus); + else + clip_lose_selection(&clip_star); +} + + static void +clip_x11_notify_cb(Widget w UNUSED, Atom *sel_atom UNUSED, Atom *target UNUSED) +{ + // To prevent automatically freeing the selection value. +} + +/* + * Property callback to get a timestamp for XtOwnSelection. + */ +# if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) || defined(PROTO) + static void +clip_x11_timestamp_cb( + Widget w, + XtPointer n UNUSED, + XEvent *event, + Boolean *cont UNUSED) +{ + Atom actual_type; + int format; + unsigned long nitems, bytes_after; + unsigned char *prop=NULL; + XPropertyEvent *xproperty=&event->xproperty; + + // Must be a property notify, state can't be Delete (True), has to be + // one of the supported selection types. + if (event->type != PropertyNotify || xproperty->state + || (xproperty->atom != clip_star.sel_atom + && xproperty->atom != clip_plus.sel_atom)) + return; + + if (XGetWindowProperty(xproperty->display, xproperty->window, + xproperty->atom, 0, 0, False, timestamp_atom, &actual_type, &format, + &nitems, &bytes_after, &prop)) + return; + + if (prop) + XFree(prop); + + // Make sure the property type is "TIMESTAMP" and it's 32 bits. + if (actual_type != timestamp_atom || format != 32) + return; + + // Get the selection, using the event timestamp. + if (XtOwnSelection(w, xproperty->atom, xproperty->time, + clip_x11_convert_selection_cb, clip_x11_lose_ownership_cb, + clip_x11_notify_cb) == OK) + { + // Set the "owned" flag now, there may have been a call to + // lose_ownership_cb in between. + if (xproperty->atom == clip_plus.sel_atom) + clip_plus.owned = TRUE; + else + clip_star.owned = TRUE; + } +} + + void +x11_setup_selection(Widget w) +{ + XtAddEventHandler(w, PropertyChangeMask, False, + /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); +} +# endif + + static void +clip_x11_request_selection_cb( + Widget w UNUSED, + XtPointer success, + Atom *sel_atom, + Atom *type, + XtPointer value, + long_u *length, + int *format) +{ + int motion_type = MAUTO; + long_u len; + char_u *p; + char **text_list = NULL; + Clipboard_T *cbd; + char_u *tmpbuf = NULL; + + if (*sel_atom == clip_plus.sel_atom) + cbd = &clip_plus; + else + cbd = &clip_star; + + if (value == NULL || *length == 0) + { + clip_free_selection(cbd); // nothing received, clear register + *(int *)success = FALSE; + return; + } + p = (char_u *)value; + len = *length; + if (*type == vim_atom) + { + motion_type = *p++; + len--; + } + + else if (*type == vimenc_atom) + { + char_u *enc; + vimconv_T conv; + int convlen; + + motion_type = *p++; + --len; + + enc = p; + p += STRLEN(p) + 1; + len -= p - enc; + + // If the encoding of the text is different from 'encoding', attempt + // converting it. + conv.vc_type = CONV_NONE; + convert_setup(&conv, enc, p_enc); + if (conv.vc_type != CONV_NONE) + { + convlen = len; // Need to use an int here. + tmpbuf = string_convert(&conv, p, &convlen); + len = convlen; + if (tmpbuf != NULL) + p = tmpbuf; + convert_setup(&conv, NULL, NULL); + } + } + + else if (*type == compound_text_atom + || *type == utf8_atom + || (enc_dbcs != 0 && *type == text_atom)) + { + XTextProperty text_prop; + int n_text = 0; + int status; + + text_prop.value = (unsigned char *)value; + text_prop.encoding = *type; + text_prop.format = *format; + text_prop.nitems = len; +#if defined(X_HAVE_UTF8_STRING) + if (*type == utf8_atom) + status = Xutf8TextPropertyToTextList(X_DISPLAY, &text_prop, + &text_list, &n_text); + else +#endif + status = XmbTextPropertyToTextList(X_DISPLAY, &text_prop, + &text_list, &n_text); + if (status != Success || n_text < 1) + { + *(int *)success = FALSE; + return; + } + p = (char_u *)text_list[0]; + len = STRLEN(p); + } + clip_yank_selection(motion_type, p, (long)len, cbd); + + if (text_list != NULL) + XFreeStringList(text_list); + vim_free(tmpbuf); + XtFree((char *)value); + *(int *)success = TRUE; +} + + void +clip_x11_request_selection( + Widget myShell, + Display *dpy, + Clipboard_T *cbd) +{ + XEvent event; + Atom type; + static int success; + int i; + time_t start_time; + int timed_out = FALSE; + + for (i = 0; i < 6; i++) + { + switch (i) + { + case 0: type = vimenc_atom; break; + case 1: type = vim_atom; break; + case 2: type = utf8_atom; break; + case 3: type = compound_text_atom; break; + case 4: type = text_atom; break; + default: type = XA_STRING; + } + if (type == utf8_atom +# if defined(X_HAVE_UTF8_STRING) + && !enc_utf8 +# endif + ) + // Only request utf-8 when 'encoding' is utf8 and + // Xutf8TextPropertyToTextList is available. + continue; + success = MAYBE; + XtGetSelectionValue(myShell, cbd->sel_atom, type, + clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime); + + // Make sure the request for the selection goes out before waiting for + // a response. + XFlush(dpy); + + /* + * Wait for result of selection request, otherwise if we type more + * characters, then they will appear before the one that requested the + * paste! Don't worry, we will catch up with any other events later. + */ + start_time = time(NULL); + while (success == MAYBE) + { + if (XCheckTypedEvent(dpy, PropertyNotify, &event) + || XCheckTypedEvent(dpy, SelectionNotify, &event) + || XCheckTypedEvent(dpy, SelectionRequest, &event)) + { + // This is where clip_x11_request_selection_cb() should be + // called. It may actually happen a bit later, so we loop + // until "success" changes. + // We may get a SelectionRequest here and if we don't handle + // it we hang. KDE klipper does this, for example. + // We need to handle a PropertyNotify for large selections. + XtDispatchEvent(&event); + continue; + } + + // Time out after 2 to 3 seconds to avoid that we hang when the + // other process doesn't respond. Note that the SelectionNotify + // event may still come later when the selection owner comes back + // to life and the text gets inserted unexpectedly. Don't know + // why that happens or how to avoid that :-(. + if (time(NULL) > start_time + 2) + { + timed_out = TRUE; + break; + } + + // Do we need this? Probably not. + XSync(dpy, False); + + // Wait for 1 msec to avoid that we eat up all CPU time. + ui_delay(1L, TRUE); + } + + if (success == TRUE) + return; + + // don't do a retry with another type after timing out, otherwise we + // hang for 15 seconds. + if (timed_out) + break; + } + + // Final fallback position - use the X CUT_BUFFER0 store + yank_cut_buffer0(dpy, cbd); +} + + void +clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd) +{ + XtDisownSelection(myShell, cbd->sel_atom, + XtLastTimestampProcessed(XtDisplay(myShell))); +} + + int +clip_x11_own_selection(Widget myShell, Clipboard_T *cbd) +{ + // When using the GUI we have proper timestamps, use the one of the last + // event. When in the console we don't get events (the terminal gets + // them), Get the time by a zero-length append, clip_x11_timestamp_cb will + // be called with the current timestamp. +#ifdef FEAT_GUI + if (gui.in_use) + { + if (XtOwnSelection(myShell, cbd->sel_atom, + XtLastTimestampProcessed(XtDisplay(myShell)), + clip_x11_convert_selection_cb, clip_x11_lose_ownership_cb, + clip_x11_notify_cb) == False) + return FAIL; + } + else +#endif + { + if (!XChangeProperty(XtDisplay(myShell), XtWindow(myShell), + cbd->sel_atom, timestamp_atom, 32, PropModeAppend, NULL, 0)) + return FAIL; + } + // Flush is required in a terminal as nothing else is doing it. + XFlush(XtDisplay(myShell)); + return OK; +} + +/* + * Send the current selection to the clipboard. Do nothing for X because we + * will fill in the selection only when requested by another app. + */ + void +clip_x11_set_selection(Clipboard_T *cbd UNUSED) +{ +} + +#endif + +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \ + || defined(FEAT_GUI_GTK) || defined(PROTO) +/* + * Get the contents of the X CUT_BUFFER0 and put it in "cbd". + */ + void +yank_cut_buffer0(Display *dpy, Clipboard_T *cbd) +{ + int nbytes = 0; + char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); + + if (nbytes > 0) + { + int done = FALSE; + + // CUT_BUFFER0 is supposed to be always latin1. Convert to 'enc' when + // using a multi-byte encoding. Conversion between two 8-bit + // character sets usually fails and the text might actually be in + // 'enc' anyway. + if (has_mbyte) + { + char_u *conv_buf; + vimconv_T vc; + + vc.vc_type = CONV_NONE; + if (convert_setup(&vc, (char_u *)"latin1", p_enc) == OK) + { + conv_buf = string_convert(&vc, buffer, &nbytes); + if (conv_buf != NULL) + { + clip_yank_selection(MCHAR, conv_buf, (long)nbytes, cbd); + vim_free(conv_buf); + done = TRUE; + } + convert_setup(&vc, NULL, NULL); + } + } + if (!done) // use the text without conversion + clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); + XFree((void *)buffer); + if (p_verbose > 0) + { + verbose_enter(); + verb_msg(_("Used CUT_BUFFER0 instead of empty selection")); + verbose_leave(); + } + } +} +#endif + +/* + * SELECTION / PRIMARY ('*') + * + * Text selection stuff that uses the GUI selection register '*'. When using a + * GUI this may be text from another window, otherwise it is the last text we + * had highlighted with VIsual mode. With mouse support, clicking the middle + * button performs the paste, otherwise you will need to do <"*p>. " + * If not under X, it is synonymous with the clipboard register '+'. + * + * X CLIPBOARD ('+') + * + * Text selection stuff that uses the GUI clipboard register '+'. + * Under X, this matches the standard cut/paste buffer CLIPBOARD selection. + * It will be used for unnamed cut/pasting is 'clipboard' contains "unnamed", + * otherwise you will need to do <"+p>. " + * If not under X, it is synonymous with the selection register '*'. + */ + +/* + * Routine to export any final X selection we had to the environment + * so that the text is still available after Vim has exited. X selections + * only exist while the owning application exists, so we write to the + * permanent (while X runs) store CUT_BUFFER0. + * Dump the CLIPBOARD selection if we own it (it's logically the more + * 'permanent' of the two), otherwise the PRIMARY one. + * For now, use a hard-coded sanity limit of 1Mb of data. + */ +#if (defined(FEAT_X11) && defined(FEAT_CLIPBOARD)) || defined(PROTO) + void +x11_export_final_selection(void) +{ + Display *dpy; + char_u *str = NULL; + long_u len = 0; + int motion_type = -1; + +# ifdef FEAT_GUI + if (gui.in_use) + dpy = X_DISPLAY; + else +# endif +# ifdef FEAT_XCLIPBOARD + dpy = xterm_dpy; +# else + return; +# endif + + // Get selection to export + if (clip_plus.owned) + motion_type = clip_convert_selection(&str, &len, &clip_plus); + else if (clip_star.owned) + motion_type = clip_convert_selection(&str, &len, &clip_star); + + // Check it's OK + if (dpy != NULL && str != NULL && motion_type >= 0 + && len < 1024*1024 && len > 0) + { + int ok = TRUE; + + // The CUT_BUFFER0 is supposed to always contain latin1. Convert from + // 'enc' when it is a multi-byte encoding. When 'enc' is an 8-bit + // encoding conversion usually doesn't work, so keep the text as-is. + if (has_mbyte) + { + vimconv_T vc; + + vc.vc_type = CONV_NONE; + if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) + { + int intlen = len; + char_u *conv_str; + + vc.vc_fail = TRUE; + conv_str = string_convert(&vc, str, &intlen); + len = intlen; + if (conv_str != NULL) + { + vim_free(str); + str = conv_str; + } + else + { + ok = FALSE; + } + convert_setup(&vc, NULL, NULL); + } + else + { + ok = FALSE; + } + } + + // Do not store the string if conversion failed. Better to use any + // other selection than garbled text. + if (ok) + { + XStoreBuffer(dpy, (char *)str, (int)len, 0); + XFlush(dpy); + } + } + + vim_free(str); +} +#endif + + void +clip_free_selection(Clipboard_T *cbd) +{ + yankreg_T *y_ptr = get_y_current(); + + if (cbd == &clip_plus) + set_y_current(get_y_register(PLUS_REGISTER)); + else + set_y_current(get_y_register(STAR_REGISTER)); + free_yank_all(); + get_y_current()->y_size = 0; + set_y_current(y_ptr); +} + +/* + * Get the selected text and put it in register '*' or '+'. + */ + void +clip_get_selection(Clipboard_T *cbd) +{ + yankreg_T *old_y_previous, *old_y_current; + pos_T old_cursor; + pos_T old_visual; + int old_visual_mode; + colnr_T old_curswant; + int old_set_curswant; + pos_T old_op_start, old_op_end; + oparg_T oa; + cmdarg_T ca; + + if (cbd->owned) + { + if ((cbd == &clip_plus + && get_y_register(PLUS_REGISTER)->y_array != NULL) + || (cbd == &clip_star + && get_y_register(STAR_REGISTER)->y_array != NULL)) + return; + + // Avoid triggering autocmds such as TextYankPost. + block_autocmds(); + + // Get the text between clip_star.start & clip_star.end + old_y_previous = get_y_previous(); + old_y_current = get_y_current(); + old_cursor = curwin->w_cursor; + old_curswant = curwin->w_curswant; + old_set_curswant = curwin->w_set_curswant; + old_op_start = curbuf->b_op_start; + old_op_end = curbuf->b_op_end; + old_visual = VIsual; + old_visual_mode = VIsual_mode; + clear_oparg(&oa); + oa.regname = (cbd == &clip_plus ? '+' : '*'); + oa.op_type = OP_YANK; + CLEAR_FIELD(ca); + ca.oap = &oa; + ca.cmdchar = 'y'; + ca.count1 = 1; + ca.retval = CA_NO_ADJ_OP_END; + do_pending_operator(&ca, 0, TRUE); + + // restore things + set_y_previous(old_y_previous); + set_y_current(old_y_current); + curwin->w_cursor = old_cursor; + changed_cline_bef_curs(); // need to update w_virtcol et al + curwin->w_curswant = old_curswant; + curwin->w_set_curswant = old_set_curswant; + curbuf->b_op_start = old_op_start; + curbuf->b_op_end = old_op_end; + VIsual = old_visual; + VIsual_mode = old_visual_mode; + + unblock_autocmds(); + } + else if (!is_clipboard_needs_update()) + { + clip_free_selection(cbd); + + // Try to get selected text from another window + clip_gen_request_selection(cbd); + } +} + +/* + * Convert from the GUI selection string into the '*'/'+' register. + */ + void +clip_yank_selection( + int type, + char_u *str, + long len, + Clipboard_T *cbd) +{ + yankreg_T *y_ptr; + + if (cbd == &clip_plus) + y_ptr = get_y_register(PLUS_REGISTER); + else + y_ptr = get_y_register(STAR_REGISTER); + + clip_free_selection(cbd); + + str_to_reg(y_ptr, type, str, len, -1, FALSE); +} + +/* + * Convert the '*'/'+' register into a GUI selection string returned in *str + * with length *len. + * Returns the motion type, or -1 for failure. + */ + int +clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd) +{ + char_u *p; + int lnum; + int i, j; + int_u eolsize; + yankreg_T *y_ptr; + + if (cbd == &clip_plus) + y_ptr = get_y_register(PLUS_REGISTER); + else + y_ptr = get_y_register(STAR_REGISTER); + +# ifdef USE_CRNL + eolsize = 2; +# else + eolsize = 1; +# endif + + *str = NULL; + *len = 0; + if (y_ptr->y_array == NULL) + return -1; + + for (i = 0; i < y_ptr->y_size; i++) + *len += (long_u)STRLEN(y_ptr->y_array[i]) + eolsize; + + // Don't want newline character at end of last line if we're in MCHAR mode. + if (y_ptr->y_type == MCHAR && *len >= eolsize) + *len -= eolsize; + + p = *str = alloc(*len + 1); // add one to avoid zero + if (p == NULL) + return -1; + lnum = 0; + for (i = 0, j = 0; i < (int)*len; i++, j++) + { + if (y_ptr->y_array[lnum][j] == '\n') + p[i] = NUL; + else if (y_ptr->y_array[lnum][j] == NUL) + { +# ifdef USE_CRNL + p[i++] = '\r'; +# endif + p[i] = '\n'; + lnum++; + j = -1; + } + else + p[i] = y_ptr->y_array[lnum][j]; + } + return y_ptr->y_type; +} + +/* + * When "regname" is a clipboard register, obtain the selection. If it's not + * available return zero, otherwise return "regname". + */ + int +may_get_selection(int regname) +{ + if (regname == '*') + { + if (!clip_star.available) + regname = 0; + else + clip_get_selection(&clip_star); + } + else if (regname == '+') + { + if (!clip_plus.available) + regname = 0; + else + clip_get_selection(&clip_plus); + } + return regname; +} + +/* + * If we have written to a clipboard register, send the text to the clipboard. + */ + void +may_set_selection(void) +{ + if ((get_y_current() == get_y_register(STAR_REGISTER)) + && clip_star.available) + { + clip_own_selection(&clip_star); + clip_gen_set_selection(&clip_star); + } + else if ((get_y_current() == get_y_register(PLUS_REGISTER)) + && clip_plus.available) + { + clip_own_selection(&clip_plus); + clip_gen_set_selection(&clip_plus); + } +} + +/* + * Adjust the register name pointed to with "rp" for the clipboard being + * used always and the clipboard being available. + */ + void +adjust_clip_reg(int *rp) +{ + // If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', + // use '*' or '+' reg, respectively. "unnamedplus" prevails. + if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0)) + { + if (clip_unnamed != 0) + *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) + ? '+' : '*'; + else + *rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS) + && clip_plus.available) ? '+' : '*'; + } + if (!clip_star.available && *rp == '*') + *rp = 0; + if (!clip_plus.available && *rp == '+') + *rp = 0; +} + +#endif // FEAT_CLIPBOARD diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 5aee48cc1dbaa..8d666aded5dc4 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -15,15 +15,69 @@ static __thread int cmd_showtail; // Only show path tail in lists ? -static void set_expand_context(expand_T *xp); -static int ExpandFromContext(expand_T *xp, char_u *, int *, char_u ***, int); +static int ExpandGeneric(char_u *pat, expand_T *xp, regmatch_T *regmatch, + char_u ***matches, int *numMatches, + char_u *((*func)(expand_T *, int)), int escaped); +static int ExpandFromContext(expand_T *xp, char_u *, char_u ***, int *, int); static int expand_showtail(expand_T *xp); -static int expand_shellcmd(char_u *filepat, int *num_file, char_u ***file, int flagsarg); +static int expand_shellcmd(char_u *filepat, char_u ***matches, int *numMatches, int flagsarg); #if defined(FEAT_EVAL) -static int ExpandUserDefined(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file); -static int ExpandUserList(expand_T *xp, int *num_file, char_u ***file); +static int ExpandUserDefined(char_u *pat, expand_T *xp, regmatch_T *regmatch, char_u ***matches, int *numMatches); +static int ExpandUserList(expand_T *xp, char_u ***matches, int *numMatches); #endif +#ifdef FEAT_WILDMENU +// "compl_match_array" points the currently displayed list of entries in the +// popup menu. It is NULL when there is no popup menu. +static pumitem_T *compl_match_array = NULL; +static int compl_match_arraysize; +// First column in cmdline of the matched item for completion. +static int compl_startcol; +static int compl_selected; +#endif + +#define SHOW_FILE_TEXT(m) (showtail ? sm_gettail(matches[m]) : matches[m]) + +/* + * Returns TRUE if fuzzy completion is supported for a given cmdline completion + * context. + */ + static int +cmdline_fuzzy_completion_supported(expand_T *xp) +{ + return (vim_strchr(p_wop, WOP_FUZZY) != NULL + && xp->xp_context != EXPAND_BOOL_SETTINGS + && xp->xp_context != EXPAND_COLORS + && xp->xp_context != EXPAND_COMPILER + && xp->xp_context != EXPAND_DIRECTORIES + && xp->xp_context != EXPAND_FILES + && xp->xp_context != EXPAND_FILES_IN_PATH + && xp->xp_context != EXPAND_FILETYPE + && xp->xp_context != EXPAND_HELP + && xp->xp_context != EXPAND_OLD_SETTING + && xp->xp_context != EXPAND_OWNSYNTAX + && xp->xp_context != EXPAND_PACKADD + && xp->xp_context != EXPAND_SHELLCMD + && xp->xp_context != EXPAND_TAGS + && xp->xp_context != EXPAND_TAGS_LISTFILES + && xp->xp_context != EXPAND_USER_LIST); +} + +/* + * Returns TRUE if fuzzy completion for cmdline completion is enabled and + * 'fuzzystr' is not empty. If search pattern is empty, then don't use fuzzy + * matching. + */ + int +cmdline_fuzzy_complete(char_u *fuzzystr) +{ + return vim_strchr(p_wop, WOP_FUZZY) != NULL && *fuzzystr != NUL; +} + +/* + * sort function for the completion matches. + * functions should be sorted to the end. + */ static int sort_func_compare(const void *s1, const void *s2) { @@ -35,6 +89,9 @@ sort_func_compare(const void *s1, const void *s2) return STRCMP(p1, p2); } +/* + * Escape special characters in the cmdline completion matches. + */ static void ExpandEscape( expand_T *xp, @@ -45,6 +102,8 @@ ExpandEscape( { int i; char_u *p; + int vse_what = xp->xp_context == EXPAND_BUFFERS + ? VSE_BUFFER : VSE_NONE; // May change home directory back to "~" if (options & WILD_HOME_REPLACE) @@ -81,9 +140,10 @@ ExpandEscape( } } #ifdef BACKSLASH_IN_FILENAME - p = vim_strsave_fnameescape(files[i], FALSE); + p = vim_strsave_fnameescape(files[i], vse_what); #else - p = vim_strsave_fnameescape(files[i], xp->xp_shell); + p = vim_strsave_fnameescape(files[i], + xp->xp_shell ? VSE_SHELL : vse_what); #endif if (p != NULL) { @@ -163,16 +223,22 @@ nextwild( i = (int)(xp->xp_pattern - ccline->cmdbuff); xp->xp_pattern_len = ccline->cmdpos - i; - if (type == WILD_NEXT || type == WILD_PREV) + if (type == WILD_NEXT || type == WILD_PREV + || type == WILD_PAGEUP || type == WILD_PAGEDOWN) { // Get next/previous match for a previous expanded pattern. p2 = ExpandOne(xp, NULL, NULL, 0, type); } else { + if (cmdline_fuzzy_completion_supported(xp)) + // If fuzzy matching, don't modify the search string + p1 = vim_strsave(xp->xp_pattern); + else + p1 = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); + // Translate string into pattern and expand it. - if ((p1 = addstar(xp->xp_pattern, xp->xp_pattern_len, - xp->xp_context)) == NULL) + if (p1 == NULL) p2 = NULL; else { @@ -239,8 +305,332 @@ nextwild( return OK; } +#if defined(FEAT_WILDMENU) || defined(PROTO) + +/* + * Create and display a cmdline completion popup menu with items from + * 'matches'. + */ + static int +cmdline_pum_create( + cmdline_info_T *ccline, + expand_T *xp, + char_u **matches, + int numMatches, + int showtail) +{ + int i; + int columns; + + // Add all the completion matches + compl_match_arraysize = numMatches; + compl_match_array = ALLOC_MULT(pumitem_T, compl_match_arraysize); + for (i = 0; i < numMatches; i++) + { + compl_match_array[i].pum_text = SHOW_FILE_TEXT(i); + compl_match_array[i].pum_info = NULL; + compl_match_array[i].pum_extra = NULL; + compl_match_array[i].pum_kind = NULL; + } + + // Compute the popup menu starting column + compl_startcol = vim_strsize(ccline->cmdbuff) + 1; + columns = vim_strsize(xp->xp_pattern); + if (showtail) + { + columns += vim_strsize(sm_gettail(matches[0])); + columns -= vim_strsize(matches[0]); + } + if (columns >= compl_startcol) + compl_startcol = 0; + else + compl_startcol -= columns; + + // no default selection + compl_selected = -1; + + cmdline_pum_display(); + + return EXPAND_OK; +} + +/* + * Display the cmdline completion matches in a popup menu + */ +void cmdline_pum_display(void) +{ + pum_display(compl_match_array, compl_match_arraysize, compl_selected); +} + +/* + * Returns TRUE if the cmdline completion popup menu is being displayed. + */ +int cmdline_pum_active(void) +{ + return p_wmnu && pum_visible() && compl_match_array != NULL; +} + +/* + * Remove the cmdline completion popup menu (if present), free the list of + * items and refresh the screen. + */ +void cmdline_pum_remove(void) +{ + int save_p_lz = p_lz; + int save_KeyTyped = KeyTyped; + + pum_undisplay(); + VIM_CLEAR(compl_match_array); + p_lz = FALSE; // avoid the popup menu hanging around + update_screen(0); + p_lz = save_p_lz; + redrawcmd(); + + // When a function is called (e.g. for 'foldtext') KeyTyped might be reset + // as a side effect. + KeyTyped = save_KeyTyped; +} + +void cmdline_pum_cleanup(cmdline_info_T *cclp) +{ + cmdline_pum_remove(); + wildmenu_cleanup(cclp); +} + +/* + * Returns the starting column number to use for the cmdline completion popup + * menu. + */ +int cmdline_compl_startcol(void) +{ + return compl_startcol; +} +#endif + +/* + * Get the next or prev cmdline completion match. The index of the match is set + * in "p_findex" + */ + static char_u * +get_next_or_prev_match( + int mode, + expand_T *xp, + int *p_findex, + char_u *orig_save) +{ + int findex = *p_findex; + int ht; + + if (xp->xp_numfiles <= 0) + return NULL; + + if (mode == WILD_PREV) + { + if (findex == -1) + findex = xp->xp_numfiles; + --findex; + } + else if (mode == WILD_NEXT) + ++findex; + else if (mode == WILD_PAGEUP) + { + if (findex == 0) + // at the first entry, don't select any entries + findex = -1; + else if (findex == -1) + // no entry is selected. select the last entry + findex = xp->xp_numfiles - 1; + else + { + // go up by the pum height + ht = pum_get_height(); + if (ht > 3) + ht -= 2; + findex -= ht; + if (findex < 0) + // few entries left, select the first entry + findex = 0; + } + } + else // mode == WILD_PAGEDOWN + { + if (findex == xp->xp_numfiles - 1) + // at the last entry, don't select any entries + findex = -1; + else if (findex == -1) + // no entry is selected. select the first entry + findex = 0; + else + { + // go down by the pum height + ht = pum_get_height(); + if (ht > 3) + ht -= 2; + findex += ht; + if (findex >= xp->xp_numfiles) + // few entries left, select the last entry + findex = xp->xp_numfiles - 1; + } + } + + // When wrapping around, return the original string, set findex to -1. + if (findex < 0) + { + if (orig_save == NULL) + findex = xp->xp_numfiles - 1; + else + findex = -1; + } + if (findex >= xp->xp_numfiles) + { + if (orig_save == NULL) + findex = 0; + else + findex = -1; + } +#ifdef FEAT_WILDMENU + if (compl_match_array) + { + compl_selected = findex; + cmdline_pum_display(); + } + else if (p_wmnu) + win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files, + findex, cmd_showtail); +#endif + *p_findex = findex; + + if (findex == -1) + return vim_strsave(orig_save); + + return vim_strsave(xp->xp_files[findex]); +} + +/* + * Start the command-line expansion and get the matches. + */ + static char_u * +ExpandOne_start(int mode, expand_T *xp, char_u *str, int options) +{ + int non_suf_match; // number without matching suffix + int i; + char_u *ss = NULL; + + // Do the expansion. + if (ExpandFromContext(xp, str, &xp->xp_files, &xp->xp_numfiles, + options) == FAIL) + { +#ifdef FNAME_ILLEGAL + // Illegal file name has been silently skipped. But when there + // are wildcards, the real problem is that there was no match, + // causing the pattern to be added, which has illegal characters. + if (!(options & WILD_SILENT) && (options & WILD_LIST_NOTFOUND)) + semsg(_(e_no_match_str_2), str); +#endif + } + else if (xp->xp_numfiles == 0) + { + if (!(options & WILD_SILENT)) + semsg(_(e_no_match_str_2), str); + } + else + { + // Escape the matches for use on the command line. + ExpandEscape(xp, str, xp->xp_numfiles, xp->xp_files, options); + + // Check for matching suffixes in file names. + if (mode != WILD_ALL && mode != WILD_ALL_KEEP && mode != WILD_LONGEST) + { + if (xp->xp_numfiles) + non_suf_match = xp->xp_numfiles; + else + non_suf_match = 1; + if ((xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_DIRECTORIES) + && xp->xp_numfiles > 1) + { + // More than one match; check suffix. + // The files will have been sorted on matching suffix in + // expand_wildcards, only need to check the first two. + non_suf_match = 0; + for (i = 0; i < 2; ++i) + if (match_suffix(xp->xp_files[i])) + ++non_suf_match; + } + if (non_suf_match != 1) + { + // Can we ever get here unless it's while expanding + // interactively? If not, we can get rid of this all + // together. Don't really want to wait for this message + // (and possibly have to hit return to continue!). + if (!(options & WILD_SILENT)) + emsg(_(e_too_many_file_names)); + else if (!(options & WILD_NO_BEEP)) + beep_flush(); + } + if (!(non_suf_match != 1 && mode == WILD_EXPAND_FREE)) + ss = vim_strsave(xp->xp_files[0]); + } + } + + return ss; +} + +/* + * Return the longest common part in the list of cmdline completion matches. + */ + static char_u * +find_longest_match(expand_T *xp, int options) +{ + long_u len; + int mb_len = 1; + int c0, ci; + int i; + char_u *ss; + + for (len = 0; xp->xp_files[0][len]; len += mb_len) + { + if (has_mbyte) + { + mb_len = (*mb_ptr2len)(&xp->xp_files[0][len]); + c0 =(* mb_ptr2char)(&xp->xp_files[0][len]); + } + else + c0 = xp->xp_files[0][len]; + for (i = 1; i < xp->xp_numfiles; ++i) + { + if (has_mbyte) + ci =(* mb_ptr2char)(&xp->xp_files[i][len]); + else + ci = xp->xp_files[i][len]; + if (p_fic && (xp->xp_context == EXPAND_DIRECTORIES + || xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_SHELLCMD + || xp->xp_context == EXPAND_BUFFERS)) + { + if (MB_TOLOWER(c0) != MB_TOLOWER(ci)) + break; + } + else if (c0 != ci) + break; + } + if (i < xp->xp_numfiles) + { + if (!(options & WILD_NO_BEEP)) + vim_beep(BO_WILD); + break; + } + } + + ss = alloc(len + 1); + if (ss) + vim_strncpy(ss, xp->xp_files[0], (size_t)len); + + return ss; +} + /* - * Do wildcard expansion on the string 'str'. + * Do wildcard expansion on the string "str". * Chars that should not be expanded must be preceded with a backslash. * Return a pointer to allocated memory containing the new string. * Return NULL for failure. @@ -260,6 +650,10 @@ nextwild( * mode = WILD_ALL: return all matches concatenated * mode = WILD_LONGEST: return longest matched part * mode = WILD_ALL_KEEP: get all matches, keep matches + * mode = WILD_APPLY: apply the item selected in the cmdline completion + * popup menu and close the menu. + * mode = WILD_CANCEL: cancel and close the cmdline completion popup and + * use the original text. * * options = WILD_LIST_NOTFOUND: list entries without a match * options = WILD_HOME_REPLACE: do home_replace() for buffer names @@ -270,6 +664,7 @@ nextwild( * options = WILD_SILENT: don't print warning messages * options = WILD_ESCAPE: put backslash before special chars * options = WILD_ICASE: ignore case for files + * options = WILD_ALLLINKS; keep broken links * * The variables xp->xp_context and xp->xp_backslash must have been set! */ @@ -293,50 +688,17 @@ ExpandOne( int orig_saved = FALSE; int i; long_u len; - int non_suf_match; // number without matching suffix // first handle the case of using an old match - if (mode == WILD_NEXT || mode == WILD_PREV) - { - if (xp->xp_numfiles > 0) - { - if (mode == WILD_PREV) - { - if (findex == -1) - findex = xp->xp_numfiles; - --findex; - } - else // mode == WILD_NEXT - ++findex; + if (mode == WILD_NEXT || mode == WILD_PREV + || mode == WILD_PAGEUP || mode == WILD_PAGEDOWN) + return get_next_or_prev_match(mode, xp, &findex, orig_save); - // When wrapping around, return the original string, set findex to - // -1. - if (findex < 0) - { - if (orig_save == NULL) - findex = xp->xp_numfiles - 1; - else - findex = -1; - } - if (findex >= xp->xp_numfiles) - { - if (orig_save == NULL) - findex = 0; - else - findex = -1; - } -#ifdef FEAT_WILDMENU - if (p_wmnu) - win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files, - findex, cmd_showtail); -#endif - if (findex == -1) - return vim_strsave(orig_save); - return vim_strsave(xp->xp_files[findex]); - } - else - return NULL; - } + if (mode == WILD_CANCEL) + ss = vim_strsave(orig_save ? orig_save : (char_u *)""); + else if (mode == WILD_APPLY) + ss = vim_strsave(findex == -1 ? (orig_save ? + orig_save : (char_u *)"") : xp->xp_files[findex]); // free old names if (xp->xp_numfiles != -1 && mode != WILD_ALL && mode != WILD_LONGEST) @@ -350,114 +712,19 @@ ExpandOne( if (mode == WILD_FREE) // only release file name return NULL; - if (xp->xp_numfiles == -1) + if (xp->xp_numfiles == -1 && mode != WILD_APPLY && mode != WILD_CANCEL) { vim_free(orig_save); orig_save = orig; orig_saved = TRUE; - // Do the expansion. - if (ExpandFromContext(xp, str, &xp->xp_numfiles, &xp->xp_files, - options) == FAIL) - { -#ifdef FNAME_ILLEGAL - // Illegal file name has been silently skipped. But when there - // are wildcards, the real problem is that there was no match, - // causing the pattern to be added, which has illegal characters. - if (!(options & WILD_SILENT) && (options & WILD_LIST_NOTFOUND)) - semsg(_(e_nomatch2), str); -#endif - } - else if (xp->xp_numfiles == 0) - { - if (!(options & WILD_SILENT)) - semsg(_(e_nomatch2), str); - } - else - { - // Escape the matches for use on the command line. - ExpandEscape(xp, str, xp->xp_numfiles, xp->xp_files, options); - - // Check for matching suffixes in file names. - if (mode != WILD_ALL && mode != WILD_ALL_KEEP - && mode != WILD_LONGEST) - { - if (xp->xp_numfiles) - non_suf_match = xp->xp_numfiles; - else - non_suf_match = 1; - if ((xp->xp_context == EXPAND_FILES - || xp->xp_context == EXPAND_DIRECTORIES) - && xp->xp_numfiles > 1) - { - // More than one match; check suffix. - // The files will have been sorted on matching suffix in - // expand_wildcards, only need to check the first two. - non_suf_match = 0; - for (i = 0; i < 2; ++i) - if (match_suffix(xp->xp_files[i])) - ++non_suf_match; - } - if (non_suf_match != 1) - { - // Can we ever get here unless it's while expanding - // interactively? If not, we can get rid of this all - // together. Don't really want to wait for this message - // (and possibly have to hit return to continue!). - if (!(options & WILD_SILENT)) - emsg(_(e_toomany)); - else if (!(options & WILD_NO_BEEP)) - beep_flush(); - } - if (!(non_suf_match != 1 && mode == WILD_EXPAND_FREE)) - ss = vim_strsave(xp->xp_files[0]); - } - } + ss = ExpandOne_start(mode, xp, str, options); } // Find longest common part if (mode == WILD_LONGEST && xp->xp_numfiles > 0) { - int mb_len = 1; - int c0, ci; - - for (len = 0; xp->xp_files[0][len]; len += mb_len) - { - if (has_mbyte) - { - mb_len = (*mb_ptr2len)(&xp->xp_files[0][len]); - c0 =(* mb_ptr2char)(&xp->xp_files[0][len]); - } - else - c0 = xp->xp_files[0][len]; - for (i = 1; i < xp->xp_numfiles; ++i) - { - if (has_mbyte) - ci =(* mb_ptr2char)(&xp->xp_files[i][len]); - else - ci = xp->xp_files[i][len]; - if (p_fic && (xp->xp_context == EXPAND_DIRECTORIES - || xp->xp_context == EXPAND_FILES - || xp->xp_context == EXPAND_SHELLCMD - || xp->xp_context == EXPAND_BUFFERS)) - { - if (MB_TOLOWER(c0) != MB_TOLOWER(ci)) - break; - } - else if (c0 != ci) - break; - } - if (i < xp->xp_numfiles) - { - if (!(options & WILD_NO_BEEP)) - vim_beep(BO_WILD); - break; - } - } - - ss = alloc(len + 1); - if (ss) - vim_strncpy(ss, xp->xp_files[0], (size_t)len); + ss = find_longest_match(xp, options); findex = -1; // next p_wc gets first one } @@ -496,18 +763,9 @@ ExpandOne( void ExpandInit(expand_T *xp) { - xp->xp_pattern = NULL; - xp->xp_pattern_len = 0; + CLEAR_POINTER(xp); xp->xp_backslash = XP_BS_NONE; -#ifndef BACKSLASH_IN_FILENAME - xp->xp_shell = FALSE; -#endif xp->xp_numfiles = -1; - xp->xp_files = NULL; -#if defined(FEAT_EVAL) - xp->xp_arg = NULL; -#endif - xp->xp_line = NULL; } /* @@ -524,42 +782,136 @@ ExpandCleanup(expand_T *xp) } /* - * Show all matches for completion on the command line. - * Returns EXPAND_NOTHING when the character that triggered expansion should - * be inserted like a normal character. + * Display one line of completion matches. Multiple matches are displayed in + * each line (used by wildmode=list and CTRL-D) + * matches - list of completion match names + * numMatches - number of completion matches in "matches" + * lines - number of output lines + * linenr - line number of matches to display + * maxlen - maximum number of characters in each line + * showtail - display only the tail of the full path of a file name + * dir_attr - highlight attribute to use for directory names */ - int -showmatches(expand_T *xp, int wildmenu UNUSED) + static void +showmatches_oneline( + expand_T *xp, + char_u **matches, + int numMatches, + int lines, + int linenr, + int maxlen, + int showtail, + int dir_attr) { - cmdline_info_T *ccline = get_cmdline_info(); -#define L_SHOWFILE(m) (showtail ? sm_gettail(files_found[m]) : files_found[m]) - int num_files; - char_u **files_found; - int i, j, k; - int maxlen; - int lines; - int columns; - char_u *p; + int i, j; + int isdir; int lastlen; - int attr; - int showtail; - - if (xp->xp_numfiles == -1) - { - set_expand_context(xp); - i = expand_cmdline(xp, ccline->cmdbuff, ccline->cmdpos, - &num_files, &files_found); - showtail = expand_showtail(xp); - if (i != EXPAND_OK) - return i; + char_u *p; - } - else + lastlen = 999; + for (j = linenr; j < numMatches; j += lines) { - num_files = xp->xp_numfiles; - files_found = xp->xp_files; - showtail = cmd_showtail; - } + if (xp->xp_context == EXPAND_TAGS_LISTFILES) + { + msg_outtrans_attr(matches[j], HL_ATTR(HLF_D)); + p = matches[j] + STRLEN(matches[j]) + 1; + msg_advance(maxlen + 1); + msg_puts((char *)p); + msg_advance(maxlen + 3); + msg_outtrans_long_attr(p + 2, HL_ATTR(HLF_D)); + break; + } + for (i = maxlen - lastlen; --i >= 0; ) + msg_putchar(' '); + if (xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_SHELLCMD + || xp->xp_context == EXPAND_BUFFERS) + { + // highlight directories + if (xp->xp_numfiles != -1) + { + char_u *halved_slash; + char_u *exp_path; + char_u *path; + + // Expansion was done before and special characters + // were escaped, need to halve backslashes. Also + // $HOME has been replaced with ~/. + exp_path = expand_env_save_opt(matches[j], TRUE); + path = exp_path != NULL ? exp_path : matches[j]; + halved_slash = backslash_halve_save(path); + isdir = mch_isdir(halved_slash != NULL ? halved_slash + : matches[j]); + vim_free(exp_path); + if (halved_slash != path) + vim_free(halved_slash); + } + else + // Expansion was done here, file names are literal. + isdir = mch_isdir(matches[j]); + if (showtail) + p = SHOW_FILE_TEXT(j); + else + { + home_replace(NULL, matches[j], NameBuff, MAXPATHL, + TRUE); + p = NameBuff; + } + } + else + { + isdir = FALSE; + p = SHOW_FILE_TEXT(j); + } + lastlen = msg_outtrans_attr(p, isdir ? dir_attr : 0); + } + if (msg_col > 0) // when not wrapped around + { + msg_clr_eos(); + msg_putchar('\n'); + } + out_flush(); // show one line at a time +} + +/* + * Show all matches for completion on the command line. + * Returns EXPAND_NOTHING when the character that triggered expansion should + * be inserted like a normal character. + */ + int +showmatches(expand_T *xp, int wildmenu UNUSED) +{ + cmdline_info_T *ccline = get_cmdline_info(); + int numMatches; + char_u **matches; + int i, j; + int maxlen; + int lines; + int columns; + int attr; + int showtail; + + if (xp->xp_numfiles == -1) + { + set_expand_context(xp); + i = expand_cmdline(xp, ccline->cmdbuff, ccline->cmdpos, + &numMatches, &matches); + showtail = expand_showtail(xp); + if (i != EXPAND_OK) + return i; + } + else + { + numMatches = xp->xp_numfiles; + matches = xp->xp_files; + showtail = cmd_showtail; + } + +#ifdef FEAT_WILDMENU + if (wildmenu && vim_strchr(p_wop, WOP_PUM) != NULL) + // cmdline completion popup menu (with wildoptions=pum) + return cmdline_pum_create(ccline, xp, matches, numMatches, showtail); +#endif #ifdef FEAT_WILDMENU if (!wildmenu) @@ -580,29 +932,29 @@ showmatches(expand_T *xp, int wildmenu UNUSED) got_int = FALSE; // only int. the completion, not the cmd line #ifdef FEAT_WILDMENU else if (wildmenu) - win_redr_status_matches(xp, num_files, files_found, -1, showtail); + win_redr_status_matches(xp, numMatches, matches, -1, showtail); #endif else { // find the length of the longest file name maxlen = 0; - for (i = 0; i < num_files; ++i) + for (i = 0; i < numMatches; ++i) { if (!showtail && (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_SHELLCMD || xp->xp_context == EXPAND_BUFFERS)) { - home_replace(NULL, files_found[i], NameBuff, MAXPATHL, TRUE); + home_replace(NULL, matches[i], NameBuff, MAXPATHL, TRUE); j = vim_strsize(NameBuff); } else - j = vim_strsize(L_SHOWFILE(i)); + j = vim_strsize(SHOW_FILE_TEXT(i)); if (j > maxlen) maxlen = j; } if (xp->xp_context == EXPAND_TAGS_LISTFILES) - lines = num_files; + lines = numMatches; else { // compute the number of columns and lines for the listing @@ -610,7 +962,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED) columns = ((int)Columns + 2) / maxlen; if (columns < 1) columns = 1; - lines = (num_files + columns - 1) / columns; + lines = (numMatches + columns - 1) / columns; } attr = HL_ATTR(HLF_D); // find out highlighting for directories @@ -626,69 +978,8 @@ showmatches(expand_T *xp, int wildmenu UNUSED) // list the files line by line for (i = 0; i < lines; ++i) { - lastlen = 999; - for (k = i; k < num_files; k += lines) - { - if (xp->xp_context == EXPAND_TAGS_LISTFILES) - { - msg_outtrans_attr(files_found[k], HL_ATTR(HLF_D)); - p = files_found[k] + STRLEN(files_found[k]) + 1; - msg_advance(maxlen + 1); - msg_puts((char *)p); - msg_advance(maxlen + 3); - msg_outtrans_long_attr(p + 2, HL_ATTR(HLF_D)); - break; - } - for (j = maxlen - lastlen; --j >= 0; ) - msg_putchar(' '); - if (xp->xp_context == EXPAND_FILES - || xp->xp_context == EXPAND_SHELLCMD - || xp->xp_context == EXPAND_BUFFERS) - { - // highlight directories - if (xp->xp_numfiles != -1) - { - char_u *halved_slash; - char_u *exp_path; - char_u *path; - - // Expansion was done before and special characters - // were escaped, need to halve backslashes. Also - // $HOME has been replaced with ~/. - exp_path = expand_env_save_opt(files_found[k], TRUE); - path = exp_path != NULL ? exp_path : files_found[k]; - halved_slash = backslash_halve_save(path); - j = mch_isdir(halved_slash != NULL ? halved_slash - : files_found[k]); - vim_free(exp_path); - if (halved_slash != path) - vim_free(halved_slash); - } - else - // Expansion was done here, file names are literal. - j = mch_isdir(files_found[k]); - if (showtail) - p = L_SHOWFILE(k); - else - { - home_replace(NULL, files_found[k], NameBuff, MAXPATHL, - TRUE); - p = NameBuff; - } - } - else - { - j = FALSE; - p = L_SHOWFILE(k); - } - lastlen = msg_outtrans_attr(p, j ? attr : 0); - } - if (msg_col > 0) // when not wrapped around - { - msg_clr_eos(); - msg_putchar('\n'); - } - out_flush(); // show one line at a time + showmatches_oneline(xp, matches, numMatches, lines, i, + maxlen, showtail, attr); if (got_int) { got_int = FALSE; @@ -702,7 +993,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED) } if (xp->xp_numfiles == -1) - FreeWild(num_files, files_found); + FreeWild(numMatches, matches); return EXPAND_OK; } @@ -944,7 +1235,7 @@ addstar( * EXPAND_ENV_VARS Complete environment variable names * EXPAND_USER Complete user names */ - static void + void set_expand_context(expand_T *xp) { cmdline_info_T *ccline = get_cmdline_info(); @@ -964,66 +1255,29 @@ set_expand_context(expand_T *xp) } /* - * This is all pretty much copied from do_one_cmd(), with all the extra stuff - * we don't need/want deleted. Maybe this could be done better if we didn't - * repeat all this stuff. The only problem is that they may not stay - * perfectly compatible with each other, but then the command line syntax - * probably won't change that much -- webb. + * Sets the index of a built-in or user defined command 'cmd' in eap->cmdidx. + * For user defined commands, the completion context is set in 'xp' and the + * completion flags in 'complp'. + * + * Returns a pointer to the text after the command or NULL for failure. */ static char_u * -set_one_cmd_context( - expand_T *xp, - char_u *buff) // buffer for command string +set_cmd_index(char_u *cmd, exarg_T *eap, expand_T *xp, int *complp) { - char_u *p; - char_u *cmd, *arg; - int len = 0; - exarg_T ea; - int compl = EXPAND_NOTHING; - int delim; - int forceit = FALSE; - int usefilter = FALSE; // filter instead of file name - - ExpandInit(xp); - xp->xp_pattern = buff; - xp->xp_context = EXPAND_COMMANDS; // Default until we get past command - ea.argt = 0; - - // 1. skip comment lines and leading space, colons or bars - for (cmd = buff; vim_strchr((char_u *)" \t:|", *cmd) != NULL; cmd++) - ; - xp->xp_pattern = cmd; - - if (*cmd == NUL) - return NULL; - if (*cmd == '"') // ignore comment lines - { - xp->xp_context = EXPAND_NOTHING; - return NULL; - } - - // 3. Skip over the range to find the command. - cmd = skip_range(cmd, &xp->xp_context); - xp->xp_pattern = cmd; - if (*cmd == NUL) - return NULL; - if (*cmd == '"') - { - xp->xp_context = EXPAND_NOTHING; - return NULL; - } - - if (*cmd == '|' || *cmd == '\n') - return cmd + 1; // There's another command + char_u *p = NULL; + int len = 0; + int fuzzy = cmdline_fuzzy_complete(cmd); // Isolate the command and search for it in the command table. // Exceptions: - // - the 'k' command can directly be followed by any character, but - // do accept "keepmarks", "keepalt" and "keepjumps". + // - the 'k' command can directly be followed by any character, but do + // accept "keepmarks", "keepalt" and "keepjumps". As fuzzy matching can + // find matches anywhere in the command name, do this only for command + // expansion based on regular expression and not for fuzzy matching. // - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r' - if (*cmd == 'k' && cmd[1] != 'e') + if (!fuzzy && (*cmd == 'k' && cmd[1] != 'e')) { - ea.cmdidx = CMD_k; + eap->cmdidx = CMD_k; p = cmd + 1; } else @@ -1031,8 +1285,9 @@ set_one_cmd_context( p = cmd; while (ASCII_ISALPHA(*p) || *p == '*') // Allow * wild card ++p; - // a user command may contain digits - if (ASCII_ISUPPER(cmd[0])) + // A user command may contain digits. + // Include "9" for "vim9*" commands; "vim9cmd" and "vim9script". + if (ASCII_ISUPPER(cmd[0]) || STRNCMP("vim9", cmd, 4) == 0) while (ASCII_ISALNUM(*p) || *p == '*') ++p; // for python 3.x: ":py3*" commands completion @@ -1053,268 +1308,456 @@ set_one_cmd_context( return NULL; } - ea.cmdidx = excmd_get_cmdidx(cmd, len); + eap->cmdidx = excmd_get_cmdidx(cmd, len); - if (cmd[0] >= 'A' && cmd[0] <= 'Z') + // User defined commands support alphanumeric characters. + // Also when doing fuzzy expansion, support alphanumeric characters. + if ((cmd[0] >= 'A' && cmd[0] <= 'Z') || (fuzzy && *p != NUL)) while (ASCII_ISALNUM(*p) || *p == '*') // Allow * wild card ++p; } - // If the cursor is touching the command, and it ends in an alpha-numeric + // If the cursor is touching the command, and it ends in an alphanumeric // character, complete the command name. if (*p == NUL && ASCII_ISALNUM(p[-1])) return NULL; - if (ea.cmdidx == CMD_SIZE) + if (eap->cmdidx == CMD_SIZE) { if (*cmd == 's' && vim_strchr((char_u *)"cgriI", cmd[1]) != NULL) { - ea.cmdidx = CMD_substitute; + eap->cmdidx = CMD_substitute; p = cmd + 1; } else if (cmd[0] >= 'A' && cmd[0] <= 'Z') { - ea.cmd = cmd; - p = find_ucmd(&ea, p, NULL, xp, &compl); + eap->cmd = cmd; + p = find_ucmd(eap, p, NULL, xp, complp); if (p == NULL) - ea.cmdidx = CMD_SIZE; // ambiguous user command + eap->cmdidx = CMD_SIZE; // ambiguous user command } } - if (ea.cmdidx == CMD_SIZE) + if (eap->cmdidx == CMD_SIZE) { // Not still touching the command and it was an illegal one xp->xp_context = EXPAND_UNSUCCESSFUL; return NULL; } - xp->xp_context = EXPAND_NOTHING; // Default now that we're past command + return p; +} - if (*p == '!') // forced commands - { - forceit = TRUE; - ++p; +/* + * Set the completion context for a command argument with wild card characters. + */ + static void +set_context_for_wildcard_arg( + exarg_T *eap, + char_u *arg, + int usefilter, + expand_T *xp, + int *complp) +{ + char_u *p; + int c; + int in_quote = FALSE; + char_u *bow = NULL; // Beginning of word + int len = 0; + + // Allow spaces within back-quotes to count as part of the argument + // being expanded. + xp->xp_pattern = skipwhite(arg); + p = xp->xp_pattern; + while (*p != NUL) + { + if (has_mbyte) + c = mb_ptr2char(p); + else + c = *p; + if (c == '\\' && p[1] != NUL) + ++p; + else if (c == '`') + { + if (!in_quote) + { + xp->xp_pattern = p; + bow = p + 1; + } + in_quote = !in_quote; + } + // An argument can contain just about everything, except + // characters that end the command and white space. + else if (c == '|' || c == '\n' || c == '"' || (VIM_ISWHITE(c) +#ifdef SPACE_IN_FILENAME + && (!(eap->argt & EX_NOSPC) || usefilter) +#endif + )) + { + len = 0; // avoid getting stuck when space is in 'isfname' + while (*p != NUL) + { + if (has_mbyte) + c = mb_ptr2char(p); + else + c = *p; + if (c == '`' || vim_isfilec_or_wc(c)) + break; + if (has_mbyte) + len = (*mb_ptr2len)(p); + else + len = 1; + MB_PTR_ADV(p); + } + if (in_quote) + bow = p; + else + xp->xp_pattern = p; + p -= len; + } + MB_PTR_ADV(p); } - // 6. parse arguments - if (!IS_USER_CMDIDX(ea.cmdidx)) - ea.argt = excmd_get_argt(ea.cmdidx); + // If we are still inside the quotes, and we passed a space, just + // expand from there. + if (bow != NULL && in_quote) + xp->xp_pattern = bow; + xp->xp_context = EXPAND_FILES; - arg = skipwhite(p); + // For a shell command more chars need to be escaped. + if (usefilter || eap->cmdidx == CMD_bang || eap->cmdidx == CMD_terminal) + { +#ifndef BACKSLASH_IN_FILENAME + xp->xp_shell = TRUE; +#endif + // When still after the command name expand executables. + if (xp->xp_pattern == skipwhite(arg)) + xp->xp_context = EXPAND_SHELLCMD; + } - if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) + // Check for environment variable. + if (*xp->xp_pattern == '$') { - if (*arg == '>') // append + for (p = xp->xp_pattern + 1; *p != NUL; ++p) + if (!vim_isIDc(*p)) + break; + if (*p == NUL) { - if (*++arg == '>') - ++arg; - arg = skipwhite(arg); + xp->xp_context = EXPAND_ENV_VARS; + ++xp->xp_pattern; + // Avoid that the assignment uses EXPAND_FILES again. + if (*complp != EXPAND_USER_DEFINED && *complp != EXPAND_USER_LIST) + *complp = EXPAND_ENV_VARS; } - else if (*arg == '!' && ea.cmdidx == CMD_write) // :w !filter + } + // Check for user names. + if (*xp->xp_pattern == '~') + { + for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p) + ; + // Complete ~user only if it partially matches a user name. + // A full match ~user will be replaced by user's home + // directory i.e. something like ~user -> /home/user/ + if (*p == NUL && p > xp->xp_pattern + 1 + && match_user(xp->xp_pattern + 1) >= 1) { - ++arg; - usefilter = TRUE; + xp->xp_context = EXPAND_USER; + ++xp->xp_pattern; } } +} - if (ea.cmdidx == CMD_read) +/* + * Set the completion context for the :filter command. Returns a pointer to the + * next command after the :filter command. + */ + static char_u * +set_context_in_filter_cmd(expand_T *xp, char_u *arg) +{ + if (*arg != NUL) + arg = skip_vimgrep_pat(arg, NULL, NULL); + if (arg == NULL || *arg == NUL) { - usefilter = forceit; // :r! filter if forced - if (*arg == '!') // :r !filter + xp->xp_context = EXPAND_NOTHING; + return NULL; + } + return skipwhite(arg); +} + +#ifdef FEAT_SEARCH_EXTRA +/* + * Set the completion context for the :match command. Returns a pointer to the + * next command after the :match command. + */ + static char_u * +set_context_in_match_cmd(expand_T *xp, char_u *arg) +{ + if (*arg == NUL || !ends_excmd(*arg)) + { + // also complete "None" + set_context_in_echohl_cmd(xp, arg); + arg = skipwhite(skiptowhite(arg)); + if (*arg != NUL) { - ++arg; - usefilter = TRUE; + xp->xp_context = EXPAND_NOTHING; + arg = skip_regexp(arg + 1, *arg, magic_isset()); } } + return find_nextcmd(arg); +} +#endif - if (ea.cmdidx == CMD_lshift || ea.cmdidx == CMD_rshift) +/* + * Returns a pointer to the next command after a :global or a :v command. + * Returns NULL if there is no next command. + */ + static char_u * +find_cmd_after_global_cmd(char_u *arg) +{ + int delim; + + delim = *arg; // get the delimiter + if (delim) + ++arg; // skip delimiter if there is one + + while (arg[0] != NUL && arg[0] != delim) { - while (*arg == *cmd) // allow any number of '>' or '<' + if (arg[0] == '\\' && arg[1] != NUL) ++arg; - arg = skipwhite(arg); + ++arg; } + if (arg[0] != NUL) + return arg + 1; - // Does command allow "+command"? - if ((ea.argt & EX_CMDARG) && !usefilter && *arg == '+') - { - // Check if we're in the +command - p = arg + 1; - arg = skip_cmd_arg(arg, FALSE); - - // Still touching the command after '+'? - if (*arg == NUL) - return p; + return NULL; +} - // Skip space(s) after +command to get to the real argument - arg = skipwhite(arg); - } +/* + * Returns a pointer to the next command after a :substitute or a :& command. + * Returns NULL if there is no next command. + */ + static char_u * +find_cmd_after_substitute_cmd(char_u *arg) +{ + int delim; - // Check for '|' to separate commands and '"' to start comments. - // Don't do this for ":read !cmd" and ":write !cmd". - if ((ea.argt & EX_TRLBAR) && !usefilter) + delim = *arg; + if (delim) { - p = arg; - // ":redir @" is not the start of a comment - if (ea.cmdidx == CMD_redir && p[0] == '@' && p[1] == '"') - p += 2; - while (*p) + // skip "from" part + ++arg; + arg = skip_regexp(arg, delim, magic_isset()); + + if (arg[0] != NUL && arg[0] == delim) { - if (*p == Ctrl_V) - { - if (p[1] != NUL) - ++p; - } - else if ( (*p == '"' && !(ea.argt & EX_NOTRLCOM)) - || *p == '|' || *p == '\n') + // skip "to" part + ++arg; + while (arg[0] != NUL && arg[0] != delim) { - if (*(p - 1) != '\\') - { - if (*p == '|' || *p == '\n') - return p + 1; - return NULL; // It's a comment - } + if (arg[0] == '\\' && arg[1] != NUL) + ++arg; + ++arg; } - MB_PTR_ADV(p); + if (arg[0] != NUL) // skip delimiter + ++arg; } } + while (arg[0] && vim_strchr((char_u *)"|\"#", arg[0]) == NULL) + ++arg; + if (arg[0] != NUL) + return arg; - if (!(ea.argt & EX_EXTRA) && *arg != NUL - && vim_strchr((char_u *)"|\"", *arg) == NULL) - // no arguments allowed but there is something - return NULL; - - // Find start of last argument (argument just before cursor): - p = buff; - xp->xp_pattern = p; - len = (int)STRLEN(buff); - while (*p && p < buff + len) + return NULL; +} + +/* + * Returns a pointer to the next command after a :isearch/:dsearch/:ilist + * :dlist/:ijump/:psearch/:djump/:isplit/:dsplit command. + * Returns NULL if there is no next command. + */ + static char_u * +find_cmd_after_isearch_cmd(expand_T *xp, char_u *arg) +{ + arg = skipwhite(skipdigits(arg)); // skip count + if (*arg == '/') // Match regexp, not just whole words { - if (*p == ' ' || *p == TAB) - { - // argument starts after a space - xp->xp_pattern = ++p; - } - else + for (++arg; *arg && *arg != '/'; arg++) + if (*arg == '\\' && arg[1] != NUL) + arg++; + if (*arg) { - if (*p == '\\' && *(p + 1) != NUL) - ++p; // skip over escaped character - MB_PTR_ADV(p); + arg = skipwhite(arg + 1); + + // Check for trailing illegal characters + if (*arg == NUL || vim_strchr((char_u *)"|\"\n", *arg) == NULL) + xp->xp_context = EXPAND_NOTHING; + else + return arg; } } - if (ea.argt & EX_XFILE) + return NULL; +} + +#ifdef FEAT_EVAL +/* + * Set the completion context for the :unlet command. Always returns NULL. + */ + static char_u * +set_context_in_unlet_cmd(expand_T *xp, char_u *arg) +{ + while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL) + arg = xp->xp_pattern + 1; + + xp->xp_context = EXPAND_USER_VARS; + xp->xp_pattern = arg; + + if (*xp->xp_pattern == '$') { - int c; - int in_quote = FALSE; - char_u *bow = NULL; // Beginning of word + xp->xp_context = EXPAND_ENV_VARS; + ++xp->xp_pattern; + } - // Allow spaces within back-quotes to count as part of the argument - // being expanded. - xp->xp_pattern = skipwhite(arg); - p = xp->xp_pattern; - while (*p != NUL) - { - if (has_mbyte) - c = mb_ptr2char(p); - else - c = *p; - if (c == '\\' && p[1] != NUL) - ++p; - else if (c == '`') - { - if (!in_quote) - { - xp->xp_pattern = p; - bow = p + 1; - } - in_quote = !in_quote; - } - // An argument can contain just about everything, except - // characters that end the command and white space. - else if (c == '|' || c == '\n' || c == '"' || (VIM_ISWHITE(c) -#ifdef SPACE_IN_FILENAME - && (!(ea.argt & EX_NOSPC) || usefilter) + return NULL; +} #endif - )) - { - len = 0; // avoid getting stuck when space is in 'isfname' - while (*p != NUL) - { - if (has_mbyte) - c = mb_ptr2char(p); - else - c = *p; - if (c == '`' || vim_isfilec_or_wc(c)) - break; - if (has_mbyte) - len = (*mb_ptr2len)(p); - else - len = 1; - MB_PTR_ADV(p); - } - if (in_quote) - bow = p; - else - xp->xp_pattern = p; - p -= len; - } - MB_PTR_ADV(p); - } - // If we are still inside the quotes, and we passed a space, just - // expand from there. - if (bow != NULL && in_quote) - xp->xp_pattern = bow; - xp->xp_context = EXPAND_FILES; +#if defined(HAVE_LOCALE_H) || defined(X_LOCALE) +/* + * Set the completion context for the :language command. Always returns NULL. + */ + static char_u * +set_context_in_lang_cmd(expand_T *xp, char_u *arg) +{ + char_u *p; - // For a shell command more chars need to be escaped. - if (usefilter || ea.cmdidx == CMD_bang || ea.cmdidx == CMD_terminal) + p = skiptowhite(arg); + if (*p == NUL) + { + xp->xp_context = EXPAND_LANGUAGE; + xp->xp_pattern = arg; + } + else + { + if ( STRNCMP(arg, "messages", p - arg) == 0 + || STRNCMP(arg, "ctype", p - arg) == 0 + || STRNCMP(arg, "time", p - arg) == 0 + || STRNCMP(arg, "collate", p - arg) == 0) { -#ifndef BACKSLASH_IN_FILENAME - xp->xp_shell = TRUE; -#endif - // When still after the command name expand executables. - if (xp->xp_pattern == skipwhite(arg)) - xp->xp_context = EXPAND_SHELLCMD; + xp->xp_context = EXPAND_LOCALES; + xp->xp_pattern = skipwhite(p); } + else + xp->xp_context = EXPAND_NOTHING; + } - // Check for environment variable - if (*xp->xp_pattern == '$' -#if defined(MSWIN) - || *xp->xp_pattern == '%' + return NULL; +} #endif - ) - { - for (p = xp->xp_pattern + 1; *p != NUL; ++p) - if (!vim_isIDc(*p)) - break; - if (*p == NUL) - { - xp->xp_context = EXPAND_ENV_VARS; - ++xp->xp_pattern; - // Avoid that the assignment uses EXPAND_FILES again. - if (compl != EXPAND_USER_DEFINED && compl != EXPAND_USER_LIST) - compl = EXPAND_ENV_VARS; - } - } - // Check for user names - if (*xp->xp_pattern == '~') + +#ifdef FEAT_EVAL +static enum +{ + EXP_BREAKPT_ADD, // expand ":breakadd" sub-commands + EXP_BREAKPT_DEL, // expand ":breakdel" sub-commands + EXP_PROFDEL // expand ":profdel" sub-commands +} breakpt_expand_what; + +/* + * Set the completion context for the :breakadd command. Always returns NULL. + */ + static char_u * +set_context_in_breakadd_cmd(expand_T *xp, char_u *arg, cmdidx_T cmdidx) +{ + char_u *p; + char_u *subcmd_start; + + xp->xp_context = EXPAND_BREAKPOINT; + xp->xp_pattern = arg; + + if (cmdidx == CMD_breakadd) + breakpt_expand_what = EXP_BREAKPT_ADD; + else if (cmdidx == CMD_breakdel) + breakpt_expand_what = EXP_BREAKPT_DEL; + else + breakpt_expand_what = EXP_PROFDEL; + + p = skipwhite(arg); + if (*p == NUL) + return NULL; + subcmd_start = p; + + if (STRNCMP("file ", p, 5) == 0 || STRNCMP("func ", p, 5) == 0) + { + // :breakadd file [lnum] + // :breakadd func [lnum] + p += 4; + p = skipwhite(p); + + // skip line number (if specified) + if (VIM_ISDIGIT(*p)) { - for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p) - ; - // Complete ~user only if it partially matches a user name. - // A full match ~user will be replaced by user's home - // directory i.e. something like ~user -> /home/user/ - if (*p == NUL && p > xp->xp_pattern + 1 - && match_user(xp->xp_pattern + 1) >= 1) + p = skipdigits(p); + if (*p != ' ') { - xp->xp_context = EXPAND_USER; - ++xp->xp_pattern; + xp->xp_context = EXPAND_NOTHING; + return NULL; } + p = skipwhite(p); } + if (STRNCMP("file", subcmd_start, 4) == 0) + xp->xp_context = EXPAND_FILES; + else + xp->xp_context = EXPAND_USER_FUNC; + xp->xp_pattern = p; + } + else if (STRNCMP("expr ", p, 5) == 0) + { + // :breakadd expr + xp->xp_context = EXPAND_EXPRESSION; + xp->xp_pattern = skipwhite(p + 5); } - // 6. Switch on command name. - switch (ea.cmdidx) + return NULL; +} + + static char_u * +set_context_in_scriptnames_cmd(expand_T *xp, char_u *arg) +{ + char_u *p; + + xp->xp_context = EXPAND_NOTHING; + xp->xp_pattern = NULL; + + p = skipwhite(arg); + if (VIM_ISDIGIT(*p)) + return NULL; + + xp->xp_context = EXPAND_SCRIPTNAMES; + xp->xp_pattern = p; + + return NULL; +} +#endif + +/* + * Set the completion context in 'xp' for command 'cmd' with index 'cmdidx'. + * The argument to the command is 'arg' and the argument flags is 'argt'. + * For user-defined commands and for environment variables, 'compl' has the + * completion type. + * Returns a pointer to the next command. Returns NULL if there is no next + * command. + */ + static char_u * +set_context_by_cmdname( + char_u *cmd, + cmdidx_T cmdidx, + expand_T *xp, + char_u *arg, + long argt, + int compl, + int forceit) +{ + switch (cmdidx) { case CMD_find: case CMD_sfind: @@ -1370,32 +1813,16 @@ set_one_cmd_context( case CMD_verbose: case CMD_vertical: case CMD_windo: + case CMD_vim9cmd: + case CMD_legacy: return arg; case CMD_filter: - if (*arg != NUL) - arg = skip_vimgrep_pat(arg, NULL, NULL); - if (arg == NULL || *arg == NUL) - { - xp->xp_context = EXPAND_NOTHING; - return NULL; - } - return skipwhite(arg); + return set_context_in_filter_cmd(xp, arg); #ifdef FEAT_SEARCH_EXTRA case CMD_match: - if (*arg == NUL || !ends_excmd(*arg)) - { - // also complete "None" - set_context_in_echohl_cmd(xp, arg); - arg = skipwhite(skiptowhite(arg)); - if (*arg != NUL) - { - xp->xp_context = EXPAND_NOTHING; - arg = skip_regexp(arg + 1, *arg, p_magic, NULL); - } - } - return find_nextcmd(arg); + return set_context_in_match_cmd(xp, arg); #endif // All completion for the +cmdline_compl feature goes here. @@ -1410,42 +1837,10 @@ set_one_cmd_context( case CMD_global: case CMD_vglobal: - delim = *arg; // get the delimiter - if (delim) - ++arg; // skip delimiter if there is one - - while (arg[0] != NUL && arg[0] != delim) - { - if (arg[0] == '\\' && arg[1] != NUL) - ++arg; - ++arg; - } - if (arg[0] != NUL) - return arg + 1; - break; + return find_cmd_after_global_cmd(arg); case CMD_and: case CMD_substitute: - delim = *arg; - if (delim) - { - // skip "from" part - ++arg; - arg = skip_regexp(arg, delim, p_magic, NULL); - } - // skip "to" part - while (arg[0] != NUL && arg[0] != delim) - { - if (arg[0] == '\\' && arg[1] != NUL) - ++arg; - ++arg; - } - if (arg[0] != NUL) // skip delimiter - ++arg; - while (arg[0] && vim_strchr((char_u *)"|\"#", arg[0]) == NULL) - ++arg; - if (arg[0] != NUL) - return arg; - break; + return find_cmd_after_substitute_cmd(arg); case CMD_isearch: case CMD_dsearch: case CMD_ilist: @@ -1455,25 +1850,7 @@ set_one_cmd_context( case CMD_djump: case CMD_isplit: case CMD_dsplit: - arg = skipwhite(skipdigits(arg)); // skip count - if (*arg == '/') // Match regexp, not just whole words - { - for (++arg; *arg && *arg != '/'; arg++) - if (*arg == '\\' && arg[1] != NUL) - arg++; - if (*arg) - { - arg = skipwhite(arg + 1); - - // Check for trailing illegal characters - if (*arg && vim_strchr((char_u *)"|\"\n", *arg) == NULL) - xp->xp_context = EXPAND_NOTHING; - else - return arg; - } - } - break; - + return find_cmd_after_isearch_cmd(xp, arg); case CMD_autocmd: return set_context_in_autocmd(xp, arg, FALSE); case CMD_doautocmd: @@ -1498,7 +1875,7 @@ set_one_cmd_context( case CMD_tjump: case CMD_stjump: case CMD_ptjump: - if (*p_wop != NUL) + if (vim_strchr(p_wop, WOP_TAGFILE) != NULL) xp->xp_context = EXPAND_TAGS_LISTFILES; else xp->xp_context = EXPAND_TAGS; @@ -1514,7 +1891,10 @@ set_one_cmd_context( break; #endif #ifdef FEAT_EVAL + case CMD_final: + case CMD_const: case CMD_let: + case CMD_var: case CMD_if: case CMD_elseif: case CMD_while: @@ -1532,29 +1912,19 @@ set_one_cmd_context( case CMD_lexpr: case CMD_laddexpr: case CMD_lgetexpr: - set_context_for_expression(xp, arg, ea.cmdidx); + set_context_for_expression(xp, arg, cmdidx); break; case CMD_unlet: - while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL) - arg = xp->xp_pattern + 1; - - xp->xp_context = EXPAND_USER_VARS; - xp->xp_pattern = arg; - - if (*xp->xp_pattern == '$') - { - xp->xp_context = EXPAND_ENV_VARS; - ++xp->xp_pattern; - } - - break; - + return set_context_in_unlet_cmd(xp, arg); case CMD_function: case CMD_delfunction: xp->xp_context = EXPAND_USER_FUNC; xp->xp_pattern = arg; break; + case CMD_disassemble: + set_context_in_disassemble_cmd(xp, arg); + break; case CMD_echohl: set_context_in_echohl_cmd(xp, arg); @@ -1567,7 +1937,7 @@ set_one_cmd_context( case CMD_cscope: case CMD_lcscope: case CMD_scscope: - set_context_in_cscope_cmd(xp, arg, ea.cmdidx); + set_context_in_cscope_cmd(xp, arg, cmdidx); break; #endif #ifdef FEAT_SIGNS @@ -1587,39 +1957,19 @@ set_one_cmd_context( xp->xp_context = EXPAND_BUFFERS; xp->xp_pattern = arg; break; - +#ifdef FEAT_DIFF + case CMD_diffget: + case CMD_diffput: + // If current buffer is in diff mode, complete buffer names + // which are in diff mode, and different than current buffer. + xp->xp_context = EXPAND_DIFF_BUFFERS; + xp->xp_pattern = arg; + break; +#endif case CMD_USER: case CMD_USER_BUF: - if (compl != EXPAND_NOTHING) - { - // EX_XFILE: file names are handled above - if (!(ea.argt & EX_XFILE)) - { -#ifdef FEAT_MENU - if (compl == EXPAND_MENUS) - return set_context_in_menu_cmd(xp, cmd, arg, forceit); -#endif - if (compl == EXPAND_COMMANDS) - return arg; - if (compl == EXPAND_MAPPINGS) - return set_context_in_map_cmd(xp, (char_u *)"map", - arg, forceit, FALSE, FALSE, CMD_map); - // Find start of last argument. - p = arg; - while (*p) - { - if (*p == ' ') - // argument starts after a space - arg = p + 1; - else if (*p == '\\' && *(p + 1) != NUL) - ++p; // skip over escaped character - MB_PTR_ADV(p); - } - xp->xp_pattern = arg; - } - xp->xp_context = compl; - } - break; + return set_context_in_user_cmdarg(cmd, arg, argt, compl, xp, + forceit); case CMD_map: case CMD_noremap: case CMD_nmap: case CMD_nnoremap: @@ -1632,7 +1982,7 @@ set_one_cmd_context( case CMD_tmap: case CMD_tnoremap: case CMD_xmap: case CMD_xnoremap: return set_context_in_map_cmd(xp, cmd, arg, forceit, - FALSE, FALSE, ea.cmdidx); + FALSE, FALSE, cmdidx); case CMD_unmap: case CMD_nunmap: case CMD_vunmap: @@ -1644,7 +1994,7 @@ set_one_cmd_context( case CMD_tunmap: case CMD_xunmap: return set_context_in_map_cmd(xp, cmd, arg, forceit, - FALSE, TRUE, ea.cmdidx); + FALSE, TRUE, cmdidx); case CMD_mapclear: case CMD_nmapclear: case CMD_vmapclear: @@ -1663,12 +2013,12 @@ set_one_cmd_context( case CMD_cabbrev: case CMD_cnoreabbrev: case CMD_iabbrev: case CMD_inoreabbrev: return set_context_in_map_cmd(xp, cmd, arg, forceit, - TRUE, FALSE, ea.cmdidx); + TRUE, FALSE, cmdidx); case CMD_unabbreviate: case CMD_cunabbrev: case CMD_iunabbrev: return set_context_in_map_cmd(xp, cmd, arg, forceit, - TRUE, TRUE, ea.cmdidx); + TRUE, TRUE, cmdidx); #ifdef FEAT_MENU case CMD_menu: case CMD_noremenu: case CMD_unmenu: case CMD_amenu: case CMD_anoremenu: case CMD_aunmenu: @@ -1710,25 +2060,7 @@ set_one_cmd_context( #if defined(HAVE_LOCALE_H) || defined(X_LOCALE) case CMD_language: - p = skiptowhite(arg); - if (*p == NUL) - { - xp->xp_context = EXPAND_LANGUAGE; - xp->xp_pattern = arg; - } - else - { - if ( STRNCMP(arg, "messages", p - arg) == 0 - || STRNCMP(arg, "ctype", p - arg) == 0 - || STRNCMP(arg, "time", p - arg) == 0) - { - xp->xp_context = EXPAND_LOCALES; - xp->xp_pattern = skipwhite(p); - } - else - xp->xp_context = EXPAND_NOTHING; - } - break; + return set_context_in_lang_cmd(xp, arg); #endif #if defined(FEAT_PROFILE) case CMD_profile: @@ -1763,42 +2095,245 @@ set_one_cmd_context( xp->xp_pattern = arg; break; +#ifdef FEAT_EVAL + case CMD_breakadd: + case CMD_profdel: + case CMD_breakdel: + return set_context_in_breakadd_cmd(xp, arg, cmdidx); + + case CMD_scriptnames: + return set_context_in_scriptnames_cmd(xp, arg); +#endif + default: break; } return NULL; } - void -set_cmd_context( +/* + * This is all pretty much copied from do_one_cmd(), with all the extra stuff + * we don't need/want deleted. Maybe this could be done better if we didn't + * repeat all this stuff. The only problem is that they may not stay + * perfectly compatible with each other, but then the command line syntax + * probably won't change that much -- webb. + */ + static char_u * +set_one_cmd_context( expand_T *xp, - char_u *str, // start of command line - int len, // length of command line (excl. NUL) - int col, // position of cursor - int use_ccline UNUSED) // use ccline for info + char_u *buff) // buffer for command string { -#ifdef FEAT_EVAL - cmdline_info_T *ccline = get_cmdline_info(); -#endif - int old_char = NUL; - char_u *nextcomm; + char_u *p; + char_u *cmd, *arg; + int len = 0; + exarg_T ea; + int compl = EXPAND_NOTHING; + int forceit = FALSE; + int usefilter = FALSE; // filter instead of file name - // Avoid a UMR warning from Purify, only save the character if it has been - // written before. - if (col < len) - old_char = str[col]; - str[col] = NUL; - nextcomm = str; + ExpandInit(xp); + xp->xp_pattern = buff; + xp->xp_line = buff; + xp->xp_context = EXPAND_COMMANDS; // Default until we get past command + ea.argt = 0; -#ifdef FEAT_EVAL - if (use_ccline && ccline->cmdfirstc == '=') + // 1. skip comment lines and leading space, colons or bars + for (cmd = buff; vim_strchr((char_u *)" \t:|", *cmd) != NULL; cmd++) + ; + xp->xp_pattern = cmd; + + if (*cmd == NUL) + return NULL; + if (*cmd == '"') // ignore comment lines { - // pass CMD_SIZE because there is no real command - set_context_for_expression(xp, str, CMD_SIZE); + xp->xp_context = EXPAND_NOTHING; + return NULL; } - else if (use_ccline && ccline->input_fn) + + // 3. Skip over the range to find the command. + cmd = skip_range(cmd, TRUE, &xp->xp_context); + xp->xp_pattern = cmd; + if (*cmd == NUL) + return NULL; + if (*cmd == '"') { - xp->xp_context = ccline->xp_context; + xp->xp_context = EXPAND_NOTHING; + return NULL; + } + + if (*cmd == '|' || *cmd == '\n') + return cmd + 1; // There's another command + + // Get the command index. + p = set_cmd_index(cmd, &ea, xp, &compl); + if (p == NULL) + return NULL; + + xp->xp_context = EXPAND_NOTHING; // Default now that we're past command + + if (*p == '!') // forced commands + { + forceit = TRUE; + ++p; + } + + // 6. parse arguments + if (!IS_USER_CMDIDX(ea.cmdidx)) + ea.argt = excmd_get_argt(ea.cmdidx); + + arg = skipwhite(p); + + // Skip over ++argopt argument + if ((ea.argt & EX_ARGOPT) && *arg != NUL && STRNCMP(arg, "++", 2) == 0) + { + p = arg; + while (*p && !vim_isspace(*p)) + MB_PTR_ADV(p); + arg = skipwhite(p); + } + + if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) + { + if (*arg == '>') // append + { + if (*++arg == '>') + ++arg; + arg = skipwhite(arg); + } + else if (*arg == '!' && ea.cmdidx == CMD_write) // :w !filter + { + ++arg; + usefilter = TRUE; + } + } + + if (ea.cmdidx == CMD_read) + { + usefilter = forceit; // :r! filter if forced + if (*arg == '!') // :r !filter + { + ++arg; + usefilter = TRUE; + } + } + + if (ea.cmdidx == CMD_lshift || ea.cmdidx == CMD_rshift) + { + while (*arg == *cmd) // allow any number of '>' or '<' + ++arg; + arg = skipwhite(arg); + } + + // Does command allow "+command"? + if ((ea.argt & EX_CMDARG) && !usefilter && *arg == '+') + { + // Check if we're in the +command + p = arg + 1; + arg = skip_cmd_arg(arg, FALSE); + + // Still touching the command after '+'? + if (*arg == NUL) + return p; + + // Skip space(s) after +command to get to the real argument + arg = skipwhite(arg); + } + + + // Check for '|' to separate commands and '"' to start comments. + // Don't do this for ":read !cmd" and ":write !cmd". + if ((ea.argt & EX_TRLBAR) && !usefilter) + { + p = arg; + // ":redir @" is not the start of a comment + if (ea.cmdidx == CMD_redir && p[0] == '@' && p[1] == '"') + p += 2; + while (*p) + { + if (*p == Ctrl_V) + { + if (p[1] != NUL) + ++p; + } + else if ( (*p == '"' && !(ea.argt & EX_NOTRLCOM)) + || *p == '|' || *p == '\n') + { + if (*(p - 1) != '\\') + { + if (*p == '|' || *p == '\n') + return p + 1; + return NULL; // It's a comment + } + } + MB_PTR_ADV(p); + } + } + + if (!(ea.argt & EX_EXTRA) && *arg != NUL + && vim_strchr((char_u *)"|\"", *arg) == NULL) + // no arguments allowed but there is something + return NULL; + + // Find start of last argument (argument just before cursor): + p = buff; + xp->xp_pattern = p; + len = (int)STRLEN(buff); + while (*p && p < buff + len) + { + if (*p == ' ' || *p == TAB) + { + // argument starts after a space + xp->xp_pattern = ++p; + } + else + { + if (*p == '\\' && *(p + 1) != NUL) + ++p; // skip over escaped character + MB_PTR_ADV(p); + } + } + + if (ea.argt & EX_XFILE) + set_context_for_wildcard_arg(&ea, arg, usefilter, xp, &compl); + + // 6. Switch on command name. + return set_context_by_cmdname(cmd, ea.cmdidx, xp, arg, ea.argt, compl, + forceit); +} + +/* + * Set the completion context in 'xp' for command 'str' + */ + void +set_cmd_context( + expand_T *xp, + char_u *str, // start of command line + int len, // length of command line (excl. NUL) + int col, // position of cursor + int use_ccline UNUSED) // use ccline for info +{ +#ifdef FEAT_EVAL + cmdline_info_T *ccline = get_cmdline_info(); +#endif + int old_char = NUL; + char_u *nextcomm; + + // Avoid a UMR warning from Purify, only save the character if it has been + // written before. + if (col < len) + old_char = str[col]; + str[col] = NUL; + nextcomm = str; + +#ifdef FEAT_EVAL + if (use_ccline && ccline->cmdfirstc == '=') + { + // pass CMD_SIZE because there is no real command + set_context_for_expression(xp, str, CMD_SIZE); + } + else if (use_ccline && ccline->input_fn) + { + xp->xp_context = ccline->xp_context; xp->xp_pattern = ccline->cmdbuff; xp->xp_arg = ccline->xp_arg; } @@ -1850,15 +2385,21 @@ expand_cmdline( // add star to file name, or convert to regexp if not exp. files. xp->xp_pattern_len = (int)(str + col - xp->xp_pattern); - file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); - if (file_str == NULL) - return EXPAND_UNSUCCESSFUL; + if (cmdline_fuzzy_completion_supported(xp)) + // If fuzzy matching, don't modify the search string + file_str = vim_strsave(xp->xp_pattern); + else + { + file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); + if (file_str == NULL) + return EXPAND_UNSUCCESSFUL; + } if (p_wic) options += WILD_ICASE; // find all files that match the description - if (ExpandFromContext(xp, file_str, matchcount, matches, options) == FAIL) + if (ExpandFromContext(xp, file_str, matches, matchcount, options) == FAIL) { *matchcount = 0; *matches = NULL; @@ -1868,61 +2409,77 @@ expand_cmdline( return EXPAND_OK; } -#ifdef FEAT_MULTI_LANG /* - * Cleanup matches for help tags: - * Remove "@ab" if the top of 'helplang' is "ab" and the language of the first - * tag matches it. Otherwise remove "@en" if "en" is the only language. + * Expand file or directory names. */ - static void -cleanup_help_tags(int num_file, char_u **file) + static int +expand_files_and_dirs( + expand_T *xp, + char_u *pat, + char_u ***matches, + int *numMatches, + int flags, + int options) { - int i, j; - int len; - char_u buf[4]; - char_u *p = buf; + int free_pat = FALSE; + int i; + int ret; - if (p_hlg[0] != NUL && (p_hlg[0] != 'e' || p_hlg[1] != 'n')) + // for ":set path=" and ":set tags=" halve backslashes for escaped + // space + if (xp->xp_backslash != XP_BS_NONE) { - *p++ = '@'; - *p++ = p_hlg[0]; - *p++ = p_hlg[1]; + free_pat = TRUE; + pat = vim_strsave(pat); + for (i = 0; pat[i]; ++i) + if (pat[i] == '\\') + { + if (xp->xp_backslash == XP_BS_THREE + && pat[i + 1] == '\\' + && pat[i + 2] == '\\' + && pat[i + 3] == ' ') + STRMOVE(pat + i, pat + i + 3); + if (xp->xp_backslash == XP_BS_ONE + && pat[i + 1] == ' ') + STRMOVE(pat + i, pat + i + 1); + } } - *p = NUL; - for (i = 0; i < num_file; ++i) + if (xp->xp_context == EXPAND_FILES) + flags |= EW_FILE; + else if (xp->xp_context == EXPAND_FILES_IN_PATH) + flags |= (EW_FILE | EW_PATH); + else + flags = (flags | EW_DIR) & ~EW_FILE; + if (options & WILD_ICASE) + flags |= EW_ICASE; + + // Expand wildcards, supporting %:h and the like. + ret = expand_wildcards_eval(&pat, numMatches, matches, flags); + if (free_pat) + vim_free(pat); +#ifdef BACKSLASH_IN_FILENAME + if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) { - len = (int)STRLEN(file[i]) - 3; - if (len <= 0) - continue; - if (STRCMP(file[i] + len, "@en") == 0) - { - // Sorting on priority means the same item in another language may - // be anywhere. Search all items for a match up to the "@en". - for (j = 0; j < num_file; ++j) - if (j != i && (int)STRLEN(file[j]) == len + 3 - && STRNCMP(file[i], file[j], len + 1) == 0) - break; - if (j == num_file) - // item only exists with @en, remove it - file[i][len] = NUL; - } - } + int j; - if (*buf != NUL) - for (i = 0; i < num_file; ++i) + for (j = 0; j < *numMatches; ++j) { - len = (int)STRLEN(file[i]) - 3; - if (len <= 0) - continue; - if (STRCMP(file[i] + len, buf) == 0) + char_u *ptr = (*matches)[j]; + + while (*ptr != NUL) { - // remove the default language - file[i][len] = NUL; + if (p_csl[0] == 's' && *ptr == '\\') + *ptr = '/'; + else if (p_csl[0] == 'b' && *ptr == '/') + *ptr = '\\'; + ptr += (*mb_ptr2len)(ptr); } } -} + } #endif + return ret; +} /* * Function given to ExpandGeneric() to obtain the possible arguments of the @@ -1938,6 +2495,56 @@ get_behave_arg(expand_T *xp UNUSED, int idx) return NULL; } +# ifdef FEAT_EVAL +/* + * Function given to ExpandGeneric() to obtain the possible arguments of the + * ":breakadd {expr, file, func, here}" command. + * ":breakdel {func, file, here}" command. + */ + static char_u * +get_breakadd_arg(expand_T *xp UNUSED, int idx) +{ + char *opts[] = {"expr", "file", "func", "here"}; + + if (idx >=0 && idx <= 3) + { + // breakadd {expr, file, func, here} + if (breakpt_expand_what == EXP_BREAKPT_ADD) + return (char_u *)opts[idx]; + else if (breakpt_expand_what == EXP_BREAKPT_DEL) + { + // breakdel {func, file, here} + if (idx <= 2) + return (char_u *)opts[idx + 1]; + } + else + { + // profdel {func, file} + if (idx <= 1) + return (char_u *)opts[idx + 1]; + } + } + return NULL; +} + +/* + * Function given to ExpandGeneric() to obtain the possible arguments for the + * ":scriptnames" command. + */ + static char_u * +get_scriptnames_arg(expand_T *xp UNUSED, int idx) +{ + scriptitem_T *si; + + if (!SCRIPT_ID_VALID(idx + 1)) + return NULL; + + si = SCRIPT_ITEM(idx + 1); + home_replace(NULL, si->sn_name, NameBuff, MAXPATHL, TRUE); + return NameBuff; +} +#endif + /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":messages {clear}" command. @@ -1959,7 +2566,7 @@ get_mapclear_arg(expand_T *xp UNUSED, int idx) } /* - * Do the expansion based on xp->xp_context and "pat". + * Do the expansion based on xp->xp_context and 'rmp'. */ #if TARGET_OS_IPHONE static __thread struct expgen @@ -1984,6 +2591,7 @@ static __thread struct expgen {EXPAND_USER_VARS, get_user_var_name, FALSE, TRUE}, {EXPAND_FUNCTIONS, get_function_name, FALSE, TRUE}, {EXPAND_USER_FUNC, get_user_func_name, FALSE, TRUE}, + {EXPAND_DISASSEMBLE, get_disassemble_argument, FALSE, TRUE}, {EXPAND_EXPRESSION, get_expr_name, FALSE, TRUE}, # endif # ifdef FEAT_MENU @@ -1997,8 +2605,8 @@ static __thread struct expgen {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE}, # endif {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE}, - {EXPAND_EVENTS, get_event_name, TRUE, TRUE}, - {EXPAND_AUGROUP, get_augroup_name, TRUE, TRUE}, + {EXPAND_EVENTS, get_event_name, TRUE, FALSE}, + {EXPAND_AUGROUP, get_augroup_name, TRUE, FALSE}, # ifdef FEAT_CSCOPE {EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE}, # endif @@ -2015,18 +2623,107 @@ static __thread struct expgen {EXPAND_ENV_VARS, get_env_name, TRUE, TRUE}, {EXPAND_USER, get_users, TRUE, FALSE}, {EXPAND_ARGLIST, get_arglist_name, TRUE, FALSE}, +#ifdef FEAT_EVAL + {EXPAND_BREAKPOINT, get_breakadd_arg, TRUE, TRUE}, + {EXPAND_SCRIPTNAMES, get_scriptnames_arg, TRUE, FALSE}, +#endif }; #endif static int -ExpandFromContext( - expand_T *xp, - char_u *pat, - int *num_file, - char_u ***file, - int options) // WILD_ flags +ExpandOther( + char_u *pat, + expand_T *xp, + regmatch_T *rmp, + char_u ***matches, + int *numMatches) +{ +#if !TARGET_OS_IPHONE + static struct expgen + { + int context; + char_u *((*func)(expand_T *, int)); + int ic; + int escaped; + } tab[] = + { + {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, + {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, + {EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE}, + {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE}, + {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, + {EXPAND_USER_COMMANDS, get_user_commands, FALSE, TRUE}, + {EXPAND_USER_ADDR_TYPE, get_user_cmd_addr_type, FALSE, TRUE}, + {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE, TRUE}, + {EXPAND_USER_NARGS, get_user_cmd_nargs, FALSE, TRUE}, + {EXPAND_USER_COMPLETE, get_user_cmd_complete, FALSE, TRUE}, +#ifdef FEAT_EVAL + {EXPAND_USER_VARS, get_user_var_name, FALSE, TRUE}, + {EXPAND_FUNCTIONS, get_function_name, FALSE, TRUE}, + {EXPAND_USER_FUNC, get_user_func_name, FALSE, TRUE}, + {EXPAND_DISASSEMBLE, get_disassemble_argument, FALSE, TRUE}, + {EXPAND_EXPRESSION, get_expr_name, FALSE, TRUE}, +#endif +#ifdef FEAT_MENU + {EXPAND_MENUS, get_menu_name, FALSE, TRUE}, + {EXPAND_MENUNAMES, get_menu_names, FALSE, TRUE}, +#endif +#ifdef FEAT_SYN_HL + {EXPAND_SYNTAX, get_syntax_name, TRUE, TRUE}, +#endif +#ifdef FEAT_PROFILE + {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE}, +#endif + {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE}, + {EXPAND_EVENTS, get_event_name, TRUE, FALSE}, + {EXPAND_AUGROUP, get_augroup_name, TRUE, FALSE}, +#ifdef FEAT_CSCOPE + {EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE}, +#endif +#ifdef FEAT_SIGNS + {EXPAND_SIGN, get_sign_name, TRUE, TRUE}, +#endif +#ifdef FEAT_PROFILE + {EXPAND_PROFILE, get_profile_name, TRUE, TRUE}, +#endif +#if defined(HAVE_LOCALE_H) || defined(X_LOCALE) + {EXPAND_LANGUAGE, get_lang_arg, TRUE, FALSE}, + {EXPAND_LOCALES, get_locales, TRUE, FALSE}, +#endif + {EXPAND_ENV_VARS, get_env_name, TRUE, TRUE}, + {EXPAND_USER, get_users, TRUE, FALSE}, + {EXPAND_ARGLIST, get_arglist_name, TRUE, FALSE}, +#ifdef FEAT_EVAL + {EXPAND_BREAKPOINT, get_breakadd_arg, TRUE, TRUE}, + {EXPAND_SCRIPTNAMES, get_scriptnames_arg, TRUE, FALSE}, +#endif + }; +#endif // TARGET_OS_IPHONE + int i; + int ret = FAIL; + + // Find a context in the table and call the ExpandGeneric() with the + // right function to do the expansion. + for (i = 0; i < (int)ARRAY_LENGTH(tab); ++i) + { + if (xp->xp_context == tab[i].context) + { + if (tab[i].ic) + rmp->rm_ic = TRUE; + ret = ExpandGeneric(pat, xp, rmp, matches, numMatches, + tab[i].func, tab[i].escaped); + break; + } + } + + return ret; +} + +/* + * Map wild expand options to flags for expand_wildcards() + */ + static int +map_wildopts_to_ewflags(int options) { - regmatch_T regmatch; - int ret; int flags; flags = EW_DIR; // include directories @@ -2043,81 +2740,46 @@ ExpandFromContext( if (options & WILD_ALLLINKS) flags |= EW_ALLLINKS; - if (xp->xp_context == EXPAND_FILES - || xp->xp_context == EXPAND_DIRECTORIES - || xp->xp_context == EXPAND_FILES_IN_PATH) - { - // Expand file or directory names. - int free_pat = FALSE; - int i; - - // for ":set path=" and ":set tags=" halve backslashes for escaped - // space - if (xp->xp_backslash != XP_BS_NONE) - { - free_pat = TRUE; - pat = vim_strsave(pat); - for (i = 0; pat[i]; ++i) - if (pat[i] == '\\') - { - if (xp->xp_backslash == XP_BS_THREE - && pat[i + 1] == '\\' - && pat[i + 2] == '\\' - && pat[i + 3] == ' ') - STRMOVE(pat + i, pat + i + 3); - if (xp->xp_backslash == XP_BS_ONE - && pat[i + 1] == ' ') - STRMOVE(pat + i, pat + i + 1); - } - } + return flags; +} - if (xp->xp_context == EXPAND_FILES) - flags |= EW_FILE; - else if (xp->xp_context == EXPAND_FILES_IN_PATH) - flags |= (EW_FILE | EW_PATH); - else - flags = (flags | EW_DIR) & ~EW_FILE; - if (options & WILD_ICASE) - flags |= EW_ICASE; - - // Expand wildcards, supporting %:h and the like. - ret = expand_wildcards_eval(&pat, num_file, file, flags); - if (free_pat) - vim_free(pat); -#ifdef BACKSLASH_IN_FILENAME - if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) - { - int i; +/* + * Do the expansion based on xp->xp_context and "pat". + */ + static int +ExpandFromContext( + expand_T *xp, + char_u *pat, + char_u ***matches, + int *numMatches, + int options) // WILD_ flags +{ + regmatch_T regmatch; + int ret; + int flags; + char_u *tofree = NULL; + int fuzzy = cmdline_fuzzy_complete(pat) + && cmdline_fuzzy_completion_supported(xp); - for (i = 0; i < *num_file; ++i) - { - char_u *ptr = (*file)[i]; + flags = map_wildopts_to_ewflags(options); - while (*ptr != NUL) - { - if (p_csl[0] == 's' && *ptr == '\\') - *ptr = '/'; - else if (p_csl[0] == 'b' && *ptr == '/') - *ptr = '\\'; - ptr += (*mb_ptr2len)(ptr); - } - } - } -#endif - return ret; - } + if (xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_DIRECTORIES + || xp->xp_context == EXPAND_FILES_IN_PATH) + return expand_files_and_dirs(xp, pat, matches, numMatches, flags, + options); - *file = (char_u **)""; - *num_file = 0; + *matches = (char_u **)""; + *numMatches = 0; if (xp->xp_context == EXPAND_HELP) { // With an empty argument we would get all the help tags, which is // very slow. Get matches for "help" instead. if (find_help_tags(*pat == NUL ? (char_u *)"help" : pat, - num_file, file, FALSE) == OK) + numMatches, matches, FALSE) == OK) { #ifdef FEAT_MULTI_LANG - cleanup_help_tags(*num_file, *file); + cleanup_help_tags(*numMatches, *matches); #endif return OK; } @@ -2125,133 +2787,88 @@ ExpandFromContext( } if (xp->xp_context == EXPAND_SHELLCMD) - return expand_shellcmd(pat, num_file, file, flags); + return expand_shellcmd(pat, matches, numMatches, flags); if (xp->xp_context == EXPAND_OLD_SETTING) - return ExpandOldSetting(num_file, file); + return ExpandOldSetting(numMatches, matches); if (xp->xp_context == EXPAND_BUFFERS) - return ExpandBufnames(pat, num_file, file, options); + return ExpandBufnames(pat, numMatches, matches, options); +#ifdef FEAT_DIFF + if (xp->xp_context == EXPAND_DIFF_BUFFERS) + return ExpandBufnames(pat, numMatches, matches, + options | BUF_DIFF_FILTER); +#endif if (xp->xp_context == EXPAND_TAGS || xp->xp_context == EXPAND_TAGS_LISTFILES) - return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file); + return expand_tags(xp->xp_context == EXPAND_TAGS, pat, numMatches, + matches); if (xp->xp_context == EXPAND_COLORS) { char *directories[] = {"colors", NULL}; - return ExpandRTDir(pat, DIP_START + DIP_OPT, num_file, file, + return ExpandRTDir(pat, DIP_START + DIP_OPT, numMatches, matches, directories); } if (xp->xp_context == EXPAND_COMPILER) { char *directories[] = {"compiler", NULL}; - return ExpandRTDir(pat, 0, num_file, file, directories); + return ExpandRTDir(pat, 0, numMatches, matches, directories); } if (xp->xp_context == EXPAND_OWNSYNTAX) { char *directories[] = {"syntax", NULL}; - return ExpandRTDir(pat, 0, num_file, file, directories); + return ExpandRTDir(pat, 0, numMatches, matches, directories); } if (xp->xp_context == EXPAND_FILETYPE) { char *directories[] = {"syntax", "indent", "ftplugin", NULL}; - return ExpandRTDir(pat, 0, num_file, file, directories); + return ExpandRTDir(pat, 0, numMatches, matches, directories); } # if defined(FEAT_EVAL) if (xp->xp_context == EXPAND_USER_LIST) - return ExpandUserList(xp, num_file, file); + return ExpandUserList(xp, matches, numMatches); # endif if (xp->xp_context == EXPAND_PACKADD) - return ExpandPackAddDir(pat, num_file, file); + return ExpandPackAddDir(pat, numMatches, matches); - regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0); - if (regmatch.regprog == NULL) - return FAIL; + // When expanding a function name starting with s:, match the nr_ + // prefix. + if ((xp->xp_context == EXPAND_USER_FUNC + || xp->xp_context == EXPAND_DISASSEMBLE) + && STRNCMP(pat, "^s:", 3) == 0) + { + int len = (int)STRLEN(pat) + 20; - // set ignore-case according to p_ic, p_scs and pat - regmatch.rm_ic = ignorecase(pat); + tofree = alloc(len); + if (tofree == NULL) + return FAIL; + vim_snprintf((char *)tofree, len, "^\\d\\+_%s", pat + 3); + pat = tofree; + } + + if (!fuzzy) + { + regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0); + if (regmatch.regprog == NULL) + return FAIL; + + // set ignore-case according to p_ic, p_scs and pat + regmatch.rm_ic = ignorecase(pat); + } if (xp->xp_context == EXPAND_SETTINGS || xp->xp_context == EXPAND_BOOL_SETTINGS) - ret = ExpandSettings(xp, ®match, num_file, file); + ret = ExpandSettings(xp, ®match, pat, numMatches, matches, fuzzy); else if (xp->xp_context == EXPAND_MAPPINGS) - ret = ExpandMappings(®match, num_file, file); + ret = ExpandMappings(pat, ®match, numMatches, matches); # if defined(FEAT_EVAL) else if (xp->xp_context == EXPAND_USER_DEFINED) - ret = ExpandUserDefined(xp, ®match, num_file, file); + ret = ExpandUserDefined(pat, xp, ®match, matches, numMatches); # endif else - { -#if !TARGET_OS_IPHONE - static struct expgen - { - int context; - char_u *((*func)(expand_T *, int)); - int ic; - int escaped; - } tab[] = - { - {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, - {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, - {EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE}, - {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE}, - {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, - {EXPAND_USER_COMMANDS, get_user_commands, FALSE, TRUE}, - {EXPAND_USER_ADDR_TYPE, get_user_cmd_addr_type, FALSE, TRUE}, - {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE, TRUE}, - {EXPAND_USER_NARGS, get_user_cmd_nargs, FALSE, TRUE}, - {EXPAND_USER_COMPLETE, get_user_cmd_complete, FALSE, TRUE}, -# ifdef FEAT_EVAL - {EXPAND_USER_VARS, get_user_var_name, FALSE, TRUE}, - {EXPAND_FUNCTIONS, get_function_name, FALSE, TRUE}, - {EXPAND_USER_FUNC, get_user_func_name, FALSE, TRUE}, - {EXPAND_EXPRESSION, get_expr_name, FALSE, TRUE}, -# endif -# ifdef FEAT_MENU - {EXPAND_MENUS, get_menu_name, FALSE, TRUE}, - {EXPAND_MENUNAMES, get_menu_names, FALSE, TRUE}, -# endif -# ifdef FEAT_SYN_HL - {EXPAND_SYNTAX, get_syntax_name, TRUE, TRUE}, -# endif -# ifdef FEAT_PROFILE - {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE}, -# endif - {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE}, - {EXPAND_EVENTS, get_event_name, TRUE, TRUE}, - {EXPAND_AUGROUP, get_augroup_name, TRUE, TRUE}, -# ifdef FEAT_CSCOPE - {EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE}, -# endif -# ifdef FEAT_SIGNS - {EXPAND_SIGN, get_sign_name, TRUE, TRUE}, -# endif -# ifdef FEAT_PROFILE - {EXPAND_PROFILE, get_profile_name, TRUE, TRUE}, -# endif -# if defined(HAVE_LOCALE_H) || defined(X_LOCALE) - {EXPAND_LANGUAGE, get_lang_arg, TRUE, FALSE}, - {EXPAND_LOCALES, get_locales, TRUE, FALSE}, -# endif - {EXPAND_ENV_VARS, get_env_name, TRUE, TRUE}, - {EXPAND_USER, get_users, TRUE, FALSE}, - {EXPAND_ARGLIST, get_arglist_name, TRUE, FALSE}, - }; -#endif // TARGET_OS_IPHONE - int i; + ret = ExpandOther(pat, xp, ®match, matches, numMatches); - // Find a context in the table and call the ExpandGeneric() with the - // right function to do the expansion. - ret = FAIL; - for (i = 0; i < (int)(sizeof(tab) / sizeof(struct expgen)); ++i) - if (xp->xp_context == tab[i].context) - { - if (tab[i].ic) - regmatch.rm_ic = TRUE; - ret = ExpandGeneric(xp, ®match, num_file, file, - tab[i].func, tab[i].escaped); - break; - } - } - - vim_regfree(regmatch.regprog); + if (!fuzzy) + vim_regfree(regmatch.regprog); + vim_free(tofree); return ret; } @@ -2263,84 +2880,149 @@ ExpandFromContext( * obtain strings, one by one. The strings are matched against a regexp * program. Matching strings are copied into an array, which is returned. * + * If 'fuzzy' is TRUE, then fuzzy matching is used. Otherwise, regex matching + * is used. + * * Returns OK when no problems encountered, FAIL for error (out of memory). */ - int + static int ExpandGeneric( + char_u *pat, expand_T *xp, regmatch_T *regmatch, - int *num_file, - char_u ***file, + char_u ***matches, + int *numMatches, char_u *((*func)(expand_T *, int)), // returns a string from the list int escaped) { int i; - int count = 0; - int round; + garray_T ga; char_u *str; + fuzmatch_str_T *fuzmatch = NULL; + int score = 0; + int fuzzy; + int match; + int sort_matches = FALSE; + int funcsort = FALSE; + + fuzzy = cmdline_fuzzy_complete(pat); + *matches = NULL; + *numMatches = 0; + + if (!fuzzy) + ga_init2(&ga, sizeof(char *), 30); + else + ga_init2(&ga, sizeof(fuzmatch_str_T), 30); - // do this loop twice: - // round == 0: count the number of matching names - // round == 1: copy the matching names into allocated memory - for (round = 0; round <= 1; ++round) + for (i = 0; ; ++i) { - for (i = 0; ; ++i) - { - str = (*func)(xp, i); - if (str == NULL) // end of list - break; - if (*str == NUL) // skip empty strings - continue; + str = (*func)(xp, i); + if (str == NULL) // end of list + break; + if (*str == NUL) // skip empty strings + continue; - if (vim_regexec(regmatch, str, (colnr_T)0)) + if (xp->xp_pattern[0] != NUL) + { + if (!fuzzy) + match = vim_regexec(regmatch, str, (colnr_T)0); + else { - if (round) - { - if (escaped) - str = vim_strsave_escaped(str, (char_u *)" \t\\."); - else - str = vim_strsave(str); - (*file)[count] = str; -# ifdef FEAT_MENU - if (func == get_menu_names && str != NULL) - { - // test for separator added by get_menu_names() - str += STRLEN(str) - 1; - if (*str == '\001') - *str = '.'; - } -# endif - } - ++count; + score = fuzzy_match_str(str, pat); + match = (score != 0); } } - if (round == 0) + else + match = TRUE; + + if (!match) + continue; + + if (escaped) + str = vim_strsave_escaped(str, (char_u *)" \t\\."); + else + str = vim_strsave(str); + if (str == NULL) { - if (count == 0) - return OK; - *num_file = count; - *file = ALLOC_MULT(char_u *, count); - if (*file == NULL) + if (!fuzzy) { - *file = (char_u **)""; + ga_clear_strings(&ga); return FAIL; } - count = 0; + fuzmatch_str_free(ga.ga_data, ga.ga_len); + return FAIL; + } + + if (ga_grow(&ga, 1) == FAIL) + { + vim_free(str); + break; + } + + if (fuzzy) + { + fuzmatch = &((fuzmatch_str_T *)ga.ga_data)[ga.ga_len]; + fuzmatch->idx = ga.ga_len; + fuzmatch->str = str; + fuzmatch->score = score; + } + else + ((char_u **)ga.ga_data)[ga.ga_len] = str; + +# ifdef FEAT_MENU + if (func == get_menu_names) + { + // test for separator added by get_menu_names() + str += STRLEN(str) - 1; + if (*str == '\001') + *str = '.'; } +# endif + + ++ga.ga_len; } - // Sort the results. Keep menu's in the specified order. - if (xp->xp_context != EXPAND_MENUNAMES && xp->xp_context != EXPAND_MENUS) + if (ga.ga_len == 0) + return OK; + + // sort the matches when using regular expression matching and sorting + // applies to the completion context. Menus and scriptnames should be kept + // in the specified order. + if (!fuzzy && xp->xp_context != EXPAND_MENUNAMES + && xp->xp_context != EXPAND_MENUS + && xp->xp_context != EXPAND_SCRIPTNAMES) + sort_matches = TRUE; + + // functions should be sorted to the end. + if (xp->xp_context == EXPAND_EXPRESSION + || xp->xp_context == EXPAND_FUNCTIONS + || xp->xp_context == EXPAND_USER_FUNC + || xp->xp_context == EXPAND_DISASSEMBLE) + funcsort = TRUE; + + // Sort the matches. + if (sort_matches) { - if (xp->xp_context == EXPAND_EXPRESSION - || xp->xp_context == EXPAND_FUNCTIONS - || xp->xp_context == EXPAND_USER_FUNC) + if (funcsort) // functions should be sorted to the end. - qsort((void *)*file, (size_t)*num_file, sizeof(char_u *), + qsort((void *)ga.ga_data, (size_t)ga.ga_len, sizeof(char_u *), sort_func_compare); else - sort_strings(*file, *num_file); + sort_strings((char_u **)ga.ga_data, ga.ga_len); + } + + if (!fuzzy) + { + *matches = ga.ga_data; + *numMatches = ga.ga_len; + } + else + { + if (fuzzymatches_to_strmatches(ga.ga_data, matches, ga.ga_len, + funcsort) == FAIL) + return FAIL; + *numMatches = ga.ga_len; } #if defined(FEAT_SYN_HL) @@ -2352,6 +3034,64 @@ ExpandGeneric( return OK; } +/* + * Expand shell command matches in one directory of $PATH. + */ + static void +expand_shellcmd_onedir( + char_u *buf, + char_u *s, + size_t l, + char_u *pat, + char_u ***matches, + int *numMatches, + int flags, + hashtab_T *ht, + garray_T *gap) +{ + int ret; + int i; + hash_T hash; + hashitem_T *hi; + + vim_strncpy(buf, s, l); + add_pathsep(buf); + l = STRLEN(buf); + vim_strncpy(buf + l, pat, MAXPATHL - 1 - l); + + // Expand matches in one directory of $PATH. + ret = expand_wildcards(1, &buf, numMatches, matches, flags); + if (ret == OK) + { + if (ga_grow(gap, *numMatches) == FAIL) + FreeWild(*numMatches, *matches); + else + { + for (i = 0; i < *numMatches; ++i) + { + char_u *name = (*matches)[i]; + + if (STRLEN(name) > l) + { + // Check if this name was already found. + hash = hash_hash(name + l); + hi = hash_lookup(ht, name + l, hash); + if (HASHITEM_EMPTY(hi)) + { + // Remove the path that was prepended. + STRMOVE(name, name + l); + ((char_u **)gap->ga_data)[gap->ga_len++] = name; + hash_add_item(ht, hi, name, hash); + name = NULL; + } + } + vim_free(name); + } + vim_free(*matches); + } + } +} + /* * Complete a shell command. * Returns FAIL or OK; @@ -2359,8 +3099,8 @@ ExpandGeneric( static int expand_shellcmd( char_u *filepat, // pattern to match with command names - int *num_file, // return: number of matches - char_u ***file, // return: array with matches + char_u ***matches, // return: array with matches + int *numMatches, // return: number of matches int flagsarg) // EW_ flags { char_u *pat; @@ -2368,22 +3108,25 @@ expand_shellcmd( char_u *path = NULL; int mustfree = FALSE; garray_T ga; - char_u *buf = alloc(MAXPATHL); + char_u *buf; size_t l; char_u *s, *e; int flags = flagsarg; - int ret; int did_curdir = FALSE; hashtab_T found_ht; - hashitem_T *hi; - hash_T hash; + buf = alloc(MAXPATHL); if (buf == NULL) return FAIL; - // for ":set path=" and ":set tags=" halve backslashes for escaped - // space + // for ":set path=" and ":set tags=" halve backslashes for escaped space pat = vim_strsave(filepat); + if (pat == NULL) + { + vim_free(buf); + return FAIL; + } + for (i = 0; pat[i]; ++i) if (pat[i] == '\\' && pat[i + 1] == ' ') STRMOVE(pat + i, pat + i + 1); @@ -2405,7 +3148,7 @@ expand_shellcmd( // Go over all directories in $PATH. Expand matches in that directory and // collect them in "ga". When "." is not in $PATH also expand for the // current directory, to find "subdir/cmd". - ga_init2(&ga, (int)sizeof(char *), 10); + ga_init2(&ga, sizeof(char *), 10); hash_init(&found_ht); for (s = path; ; s = e) { @@ -2437,47 +3180,15 @@ expand_shellcmd( l = e - s; if (l > MAXPATHL - 5) break; - vim_strncpy(buf, s, l); - add_pathsep(buf); - l = STRLEN(buf); - vim_strncpy(buf + l, pat, MAXPATHL - 1 - l); - // Expand matches in one directory of $PATH. - ret = expand_wildcards(1, &buf, num_file, file, flags); - if (ret == OK) - { - if (ga_grow(&ga, *num_file) == FAIL) - FreeWild(*num_file, *file); - else - { - for (i = 0; i < *num_file; ++i) - { - char_u *name = (*file)[i]; + expand_shellcmd_onedir(buf, s, l, pat, matches, numMatches, flags, + &found_ht, &ga); - if (STRLEN(name) > l) - { - // Check if this name was already found. - hash = hash_hash(name + l); - hi = hash_lookup(&found_ht, name + l, hash); - if (HASHITEM_EMPTY(hi)) - { - // Remove the path that was prepended. - STRMOVE(name, name + l); - ((char_u **)ga.ga_data)[ga.ga_len++] = name; - hash_add_item(&found_ht, hi, name, hash); - name = NULL; - } - } - vim_free(name); - } - vim_free(*file); - } - } if (*e != NUL) ++e; } - *file = ga.ga_data; - *num_file = ga.ga_len; + *matches = ga.ga_data; + *numMatches = ga.ga_len; vim_free(buf); vim_free(pat); @@ -2490,14 +3201,12 @@ expand_shellcmd( # if defined(FEAT_EVAL) /* * Call "user_expand_func()" to invoke a user defined Vim script function and - * return the result (either a string or a List). + * return the result (either a string, a List or NULL). */ static void * call_user_expand_func( void *(*user_expand_func)(char_u *, int, typval_T *), - expand_T *xp, - int *num_file, - char_u ***file) + expand_T *xp) { cmdline_info_T *ccline = get_cmdline_info(); int keep = 0; @@ -2508,8 +3217,6 @@ call_user_expand_func( if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL) return NULL; - *num_file = 0; - *file = NULL; if (ccline->cmdbuff != NULL) { @@ -2540,27 +3247,39 @@ call_user_expand_func( } /* - * Expand names with a function defined by the user. + * Expand names with a function defined by the user (EXPAND_USER_DEFINED and + * EXPAND_USER_LIST). */ static int ExpandUserDefined( + char_u *pat, expand_T *xp, regmatch_T *regmatch, - int *num_file, - char_u ***file) + char_u ***matches, + int *numMatches) { char_u *retstr; char_u *s; char_u *e; int keep; garray_T ga; - int skip; + int fuzzy; + int match; + int score = 0; - retstr = call_user_expand_func(call_func_retstr, xp, num_file, file); + fuzzy = cmdline_fuzzy_complete(pat); + *matches = NULL; + *numMatches = 0; + + retstr = call_user_expand_func(call_func_retstr, xp); if (retstr == NULL) return FAIL; - ga_init2(&ga, (int)sizeof(char *), 3); + if (!fuzzy) + ga_init2(&ga, sizeof(char *), 3); + else + ga_init2(&ga, sizeof(fuzmatch_str_T), 3); + for (s = retstr; *s != NUL; s = e) { e = vim_strchr(s, '\n'); @@ -2569,14 +3288,35 @@ ExpandUserDefined( keep = *e; *e = NUL; - skip = xp->xp_pattern[0] && vim_regexec(regmatch, s, (colnr_T)0) == 0; + if (xp->xp_pattern[0] != NUL) + { + if (!fuzzy) + match = vim_regexec(regmatch, s, (colnr_T)0); + else + { + score = fuzzy_match_str(s, pat); + match = (score != 0); + } + } + else + match = TRUE; // match everything + *e = keep; - if (!skip) + if (match) { if (ga_grow(&ga, 1) == FAIL) break; - ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, (int)(e - s)); + if (!fuzzy) + ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, e - s); + else + { + fuzmatch_str_T *fuzmatch = + &((fuzmatch_str_T *)ga.ga_data)[ga.ga_len]; + fuzmatch->idx = ga.ga_len; + fuzmatch->str = vim_strnsave(s, e - s); + fuzmatch->score = score; + } ++ga.ga_len; } @@ -2584,8 +3324,22 @@ ExpandUserDefined( ++e; } vim_free(retstr); - *file = ga.ga_data; - *num_file = ga.ga_len; + + if (ga.ga_len == 0) + return OK; + + if (!fuzzy) + { + *matches = ga.ga_data; + *numMatches = ga.ga_len; + } + else + { + if (fuzzymatches_to_strmatches(ga.ga_data, matches, ga.ga_len, + FALSE) == FAIL) + return FAIL; + *numMatches = ga.ga_len; + } return OK; } @@ -2595,20 +3349,22 @@ ExpandUserDefined( static int ExpandUserList( expand_T *xp, - int *num_file, - char_u ***file) + char_u ***matches, + int *numMatches) { list_T *retlist; listitem_T *li; garray_T ga; - retlist = call_user_expand_func(call_func_retlist, xp, num_file, file); + *matches = NULL; + *numMatches = 0; + retlist = call_user_expand_func(call_func_retlist, xp); if (retlist == NULL) return FAIL; - ga_init2(&ga, (int)sizeof(char *), 3); + ga_init2(&ga, sizeof(char *), 3); // Loop over the items in the list. - for (li = retlist->lv_first; li != NULL; li = li->li_next) + FOR_ALL_LIST_ITEMS(retlist, li) { if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL) continue; // Skip non-string items and empty strings @@ -2622,8 +3378,8 @@ ExpandUserList( } list_unref(retlist); - *file = ga.ga_data; - *num_file = ga.ga_len; + *matches = ga.ga_data; + *numMatches = ga.ga_len; return OK; } # endif @@ -2668,28 +3424,318 @@ globpath( add_pathsep(buf); # endif STRCAT(buf, file); - if (ExpandFromContext(&xpc, buf, &num_p, &p, + if (ExpandFromContext(&xpc, buf, &p, &num_p, WILD_SILENT|expand_options) != FAIL && num_p > 0) { ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options); if (ga_grow(ga, num_p) == OK) - { + // take over the pointers and put them in "ga" for (i = 0; i < num_p; ++i) { - ((char_u **)ga->ga_data)[ga->ga_len] = - vim_strnsave(p[i], (int)STRLEN(p[i])); + ((char_u **)ga->ga_data)[ga->ga_len] = p[i]; ++ga->ga_len; } + vim_free(p); + } + } + } + + vim_free(buf); +} + +#ifdef FEAT_WILDMENU + +/* + * Translate some keys pressed when 'wildmenu' is used. + */ + int +wildmenu_translate_key( + cmdline_info_T *cclp, + int key, + expand_T *xp, + int did_wild_list) +{ + int c = key; + +#ifdef FEAT_WILDMENU + if (cmdline_pum_active()) + { + // When the popup menu is used for cmdline completion: + // Up : go to the previous item in the menu + // Down : go to the next item in the menu + // Left : go to the parent directory + // Right: list the files in the selected directory + switch (c) + { + case K_UP: c = K_LEFT; break; + case K_DOWN: c = K_RIGHT; break; + case K_LEFT: c = K_UP; break; + case K_RIGHT: c = K_DOWN; break; + default: break; + } + } +#endif + + if (did_wild_list) + { + if (c == K_LEFT) + c = Ctrl_P; + else if (c == K_RIGHT) + c = Ctrl_N; + } + + // Hitting CR after "emenu Name.": complete submenu + if (xp->xp_context == EXPAND_MENUNAMES + && cclp->cmdpos > 1 + && cclp->cmdbuff[cclp->cmdpos - 1] == '.' + && cclp->cmdbuff[cclp->cmdpos - 2] != '\\' + && (c == '\n' || c == '\r' || c == K_KENTER)) + c = K_DOWN; + + return c; +} + +/* + * Delete characters on the command line, from "from" to the current + * position. + */ + static void +cmdline_del(cmdline_info_T *cclp, int from) +{ + mch_memmove(cclp->cmdbuff + from, cclp->cmdbuff + cclp->cmdpos, + (size_t)(cclp->cmdlen - cclp->cmdpos + 1)); + cclp->cmdlen -= cclp->cmdpos - from; + cclp->cmdpos = from; +} + +/* + * Handle a key pressed when the wild menu for the menu names + * (EXPAND_MENUNAMES) is displayed. + */ + static int +wildmenu_process_key_menunames(cmdline_info_T *cclp, int key, expand_T *xp) +{ + int i; + int j; + + // Hitting after "emenu Name.": complete submenu + if (key == K_DOWN && cclp->cmdpos > 0 + && cclp->cmdbuff[cclp->cmdpos - 1] == '.') + { + key = p_wc; + KeyTyped = TRUE; // in case the key was mapped + } + else if (key == K_UP) + { + // Hitting : Remove one submenu name in front of the + // cursor + int found = FALSE; + + j = (int)(xp->xp_pattern - cclp->cmdbuff); + i = 0; + while (--j > 0) + { + // check for start of menu name + if (cclp->cmdbuff[j] == ' ' + && cclp->cmdbuff[j - 1] != '\\') + { + i = j + 1; + break; + } + // check for start of submenu name + if (cclp->cmdbuff[j] == '.' + && cclp->cmdbuff[j - 1] != '\\') + { + if (found) + { + i = j + 1; + break; } + else + found = TRUE; + } + } + if (i > 0) + cmdline_del(cclp, i); + key = p_wc; + KeyTyped = TRUE; // in case the key was mapped + xp->xp_context = EXPAND_NOTHING; + } + + return key; +} - FreeWild(num_p, p); +/* + * Handle a key pressed when the wild menu for file names (EXPAND_FILES) or + * directory names (EXPAND_DIRECTORIES) or shell command names + * (EXPAND_SHELLCMD) is displayed. + */ + static int +wildmenu_process_key_filenames(cmdline_info_T *cclp, int key, expand_T *xp) +{ + int i; + int j; + char_u upseg[5]; + + upseg[0] = PATHSEP; + upseg[1] = '.'; + upseg[2] = '.'; + upseg[3] = PATHSEP; + upseg[4] = NUL; + + if (key == K_DOWN + && cclp->cmdpos > 0 + && cclp->cmdbuff[cclp->cmdpos - 1] == PATHSEP + && (cclp->cmdpos < 3 + || cclp->cmdbuff[cclp->cmdpos - 2] != '.' + || cclp->cmdbuff[cclp->cmdpos - 3] != '.')) + { + // go down a directory + key = p_wc; + KeyTyped = TRUE; // in case the key was mapped + } + else if (STRNCMP(xp->xp_pattern, upseg + 1, 3) == 0 && key == K_DOWN) + { + // If in a direct ancestor, strip off one ../ to go down + int found = FALSE; + + j = cclp->cmdpos; + i = (int)(xp->xp_pattern - cclp->cmdbuff); + while (--j > i) + { + if (has_mbyte) + j -= (*mb_head_off)(cclp->cmdbuff, cclp->cmdbuff + j); + if (vim_ispathsep(cclp->cmdbuff[j])) + { + found = TRUE; + break; } } + if (found + && cclp->cmdbuff[j - 1] == '.' + && cclp->cmdbuff[j - 2] == '.' + && (vim_ispathsep(cclp->cmdbuff[j - 3]) || j == i + 2)) + { + cmdline_del(cclp, j - 2); + key = p_wc; + KeyTyped = TRUE; // in case the key was mapped + } } + else if (key == K_UP) + { + // go up a directory + int found = FALSE; - vim_free(buf); + j = cclp->cmdpos - 1; + i = (int)(xp->xp_pattern - cclp->cmdbuff); + while (--j > i) + { + if (has_mbyte) + j -= (*mb_head_off)(cclp->cmdbuff, cclp->cmdbuff + j); + if (vim_ispathsep(cclp->cmdbuff[j]) +# ifdef BACKSLASH_IN_FILENAME + && vim_strchr((char_u *)" *?[{`$%#", + cclp->cmdbuff[j + 1]) == NULL +# endif + ) + { + if (found) + { + i = j + 1; + break; + } + else + found = TRUE; + } + } + + if (!found) + j = i; + else if (STRNCMP(cclp->cmdbuff + j, upseg, 4) == 0) + j += 4; + else if (STRNCMP(cclp->cmdbuff + j, upseg + 1, 3) == 0 + && j == i) + j += 3; + else + j = 0; + if (j > 0) + { + // TODO this is only for DOS/UNIX systems - need to put in + // machine-specific stuff here and in upseg init + cmdline_del(cclp, j); + put_on_cmdline(upseg + 1, 3, FALSE); + } + else if (cclp->cmdpos > i) + cmdline_del(cclp, i); + + // Now complete in the new directory. Set KeyTyped in case the + // Up key came from a mapping. + key = p_wc; + KeyTyped = TRUE; + } + + return key; +} + +/* + * Handle a key pressed when the wild menu is displayed + */ + int +wildmenu_process_key(cmdline_info_T *cclp, int key, expand_T *xp) +{ + if (xp->xp_context == EXPAND_MENUNAMES) + return wildmenu_process_key_menunames(cclp, key, xp); + else if ((xp->xp_context == EXPAND_FILES + || xp->xp_context == EXPAND_DIRECTORIES + || xp->xp_context == EXPAND_SHELLCMD)) + return wildmenu_process_key_filenames(cclp, key, xp); + + return key; +} + +/* + * Free expanded names when finished walking through the matches + */ + void +wildmenu_cleanup(cmdline_info_T *cclp) +{ + int skt = KeyTyped; + int old_RedrawingDisabled = RedrawingDisabled; + + if (!p_wmnu || wild_menu_showing == 0) + return; + + if (cclp->input_fn) + RedrawingDisabled = 0; + + if (wild_menu_showing == WM_SCROLLED) + { + // Entered command line, move it up + cmdline_row--; + redrawcmd(); + } + else if (save_p_ls != -1) + { + // restore 'laststatus' and 'winminheight' + p_ls = save_p_ls; + p_wmh = save_p_wmh; + last_status(FALSE); + update_screen(VALID); // redraw the screen NOW + redrawcmd(); + save_p_ls = -1; + } + else + { + win_redraw_last_status(topframe); + redraw_statuslines(); + } + KeyTyped = skt; + wild_menu_showing = 0; + if (cclp->input_fn) + RedrawingDisabled = old_RedrawingDisabled; } +#endif #if defined(FEAT_EVAL) || defined(PROTO) /* @@ -2699,13 +3745,28 @@ globpath( f_getcompletion(typval_T *argvars, typval_T *rettv) { char_u *pat; + char_u *type; expand_T xpc; int filtered = FALSE; int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH - | WILD_NO_BEEP; + | WILD_NO_BEEP | WILD_HOME_REPLACE; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL + || check_for_opt_bool_arg(argvars, 2) == FAIL)) + return; + + pat = tv_get_string(&argvars[0]); + if (argvars[1].v_type != VAR_STRING) + { + semsg(_(e_invalid_argument_str), "type must be a string"); + return; + } + type = tv_get_string(&argvars[1]); if (argvars[2].v_type != VAR_UNKNOWN) - filtered = tv_get_number_chk(&argvars[2], NULL); + filtered = tv_get_bool_chk(&argvars[2], NULL); if (p_wic) options |= WILD_ICASE; @@ -2715,42 +3776,54 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) options |= WILD_KEEP_ALL; ExpandInit(&xpc); - xpc.xp_pattern = tv_get_string(&argvars[0]); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - xpc.xp_context = cmdcomplete_str_to_type(tv_get_string(&argvars[1])); - if (xpc.xp_context == EXPAND_NOTHING) + if (STRCMP(type, "cmdline") == 0) { - if (argvars[1].v_type == VAR_STRING) - semsg(_(e_invarg2), argvars[1].vval.v_string); - else - emsg(_(e_invarg)); - return; + set_one_cmd_context(&xpc, pat); + xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); + xpc.xp_col = (int)STRLEN(pat); } - -# if defined(FEAT_MENU) - if (xpc.xp_context == EXPAND_MENUS) + else { - set_context_in_menu_cmd(&xpc, (char_u *)"menu", xpc.xp_pattern, FALSE); + xpc.xp_pattern = pat; xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } + + xpc.xp_context = cmdcomplete_str_to_type(type); + if (xpc.xp_context == EXPAND_NOTHING) + { + semsg(_(e_invalid_argument_str), type); + return; + } + +# if defined(FEAT_MENU) + if (xpc.xp_context == EXPAND_MENUS) + { + set_context_in_menu_cmd(&xpc, (char_u *)"menu", xpc.xp_pattern, FALSE); + xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); + } # endif # ifdef FEAT_CSCOPE - if (xpc.xp_context == EXPAND_CSCOPE) - { - set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } + if (xpc.xp_context == EXPAND_CSCOPE) + { + set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope); + xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); + } # endif # ifdef FEAT_SIGNS - if (xpc.xp_context == EXPAND_SIGN) - { - set_context_in_sign_cmd(&xpc, xpc.xp_pattern); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } + if (xpc.xp_context == EXPAND_SIGN) + { + set_context_in_sign_cmd(&xpc, xpc.xp_pattern); + xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); + } # endif + } + + if (cmdline_fuzzy_completion_supported(&xpc)) + // when fuzzy matching, don't modify the search string + pat = vim_strsave(xpc.xp_pattern); + else + pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); - pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); - if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL)) + if (rettv_list_alloc(rettv) == OK && pat != NULL) { int i; diff --git a/src/cmdhist.c b/src/cmdhist.c index d9ecdb3e5b45a..1e6e989ee87b1 100644 --- a/src/cmdhist.c +++ b/src/cmdhist.c @@ -37,11 +37,13 @@ get_histentry(int hist_type) return history[hist_type]; } +#if defined(FEAT_VIMINFO) || defined(PROTO) void set_histentry(int hist_type, histentry_T *entry) { history[hist_type] = entry; } +#endif int * get_hisidx(int hist_type) @@ -49,11 +51,13 @@ get_hisidx(int hist_type) return &hisidx[hist_type]; } +#if defined(FEAT_VIMINFO) || defined(PROTO) int * get_hisnum(int hist_type) { return &hisnum[hist_type]; } +#endif /* * Translate a history character to the associated type number. @@ -103,7 +107,7 @@ get_history_arg(expand_T *xp UNUSED, int idx) #endif char *short_names = ":=@>?/"; int short_names_count = (int)STRLEN(short_names); - int history_name_count = sizeof(history_names) / sizeof(char *) - 1; + int history_name_count = ARRAY_LENGTH(history_names) - 1; if (idx < short_names_count) { @@ -309,7 +313,7 @@ add_to_history( if (hislen == 0) // no history return; - if (cmdmod.keeppatterns && histype == HIST_SEARCH) + if ((cmdmod.cmod_flags & CMOD_KEEPPATTERNS) && histype == HIST_SEARCH) return; // Searches inside the same mapping overwrite each other, so that only @@ -394,7 +398,7 @@ calc_hist_idx(int histype, int num) i += hislen; wrapped = TRUE; } - if (hist[i].hisnum == num && hist[i].hisstr != NULL) + if (i >= 0 && hist[i].hisnum == num && hist[i].hisstr != NULL) return i; } else if (-num <= hislen) @@ -550,6 +554,12 @@ f_histadd(typval_T *argvars UNUSED, typval_T *rettv) rettv->vval.v_number = FALSE; if (check_secure()) return; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL)) + return; + str = tv_get_string_chk(&argvars[0]); // NULL on type error histype = str != NULL ? get_histtype(str) : -1; if (histype >= 0) @@ -575,6 +585,11 @@ f_histdel(typval_T *argvars UNUSED, typval_T *rettv UNUSED) char_u buf[NUMBUFLEN]; char_u *str; + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_string_or_number_arg(argvars, 1) == FAIL)) + return; + str = tv_get_string_chk(&argvars[0]); // NULL on type error if (str == NULL) n = 0; @@ -602,6 +617,11 @@ f_histget(typval_T *argvars UNUSED, typval_T *rettv) int idx; char_u *str; + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_number_arg(argvars, 1) == FAIL)) + return; + str = tv_get_string_chk(&argvars[0]); // NULL on type error if (str == NULL) rettv->vval.v_string = NULL; @@ -625,9 +645,12 @@ f_histget(typval_T *argvars UNUSED, typval_T *rettv) f_histnr(typval_T *argvars UNUSED, typval_T *rettv) { int i; + char_u *histname; - char_u *histname = tv_get_string_chk(&argvars[0]); + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + histname = tv_get_string_chk(&argvars[0]); i = histname == NULL ? HIST_CMD - 1 : get_histtype(histname); if (i >= HIST_CMD && i < HIST_COUNT) i = get_history_idx(i); @@ -710,7 +733,7 @@ ex_history(exarg_T *eap) else { *end = i; - emsg(_(e_trailing)); + semsg(_(e_trailing_characters_str), arg); return; } } @@ -722,7 +745,7 @@ ex_history(exarg_T *eap) end = arg; if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL) { - emsg(_(e_trailing)); + semsg(_(e_trailing_characters_str), end); return; } diff --git a/src/config.h.in b/src/config.h.in index f9ae0bbf3d51f..5f0d6aef2ac6e 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -27,9 +27,15 @@ /* Define when termcap.h defines outfuntype */ #undef HAVE_OUTFUNTYPE +/* Define when del_curterm() is available */ +#undef HAVE_DEL_CURTERM + /* Define when __DATE__ " " __TIME__ can be used */ #undef HAVE_DATE_TIME +/* Defined from $SOURCE_DATE_EPOCH, used as the build date */ +#undef BUILD_DATE + /* Define when __attribute__((unused)) can be used */ #undef HAVE_ATTRIBUTE_UNUSED @@ -126,18 +132,6 @@ #undef PTYRANGE0 #undef PTYRANGE1 -/* Define mode for pty */ -#undef PTYMODE - -/* Define group for pty */ -#undef PTYGROUP - -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE - -/* Define as the command at the end of signal handlers ("" or "return 0;"). */ -#undef SIGRETURN - /* Define if struct sigcontext is present */ #undef HAVE_SIGCONTEXT @@ -147,6 +141,9 @@ /* Define if stat() ignores a trailing slash */ #undef STAT_IGNORES_SLASH +/* Define to nanoseconds field of struct stat */ +#undef ST_MTIM_NSEC + /* Define if tgetstr() has a second argument that is (char *) */ #undef TGETSTR_CHAR_P @@ -174,6 +171,7 @@ #undef HAVE_GETTIMEOFDAY #undef HAVE_GETWD #undef HAVE_ICONV +#undef HAVE_INET_NTOP #undef HAVE_LOCALTIME_R #undef HAVE_LSTAT #undef HAVE_MEMSET @@ -200,19 +198,23 @@ #undef HAVE_SIGVEC #undef HAVE_SMACK #undef HAVE_STRCASECMP +#undef HAVE_STRCOLL #undef HAVE_STRERROR #undef HAVE_STRFTIME #undef HAVE_STRICMP #undef HAVE_STRNCASECMP #undef HAVE_STRNICMP #undef HAVE_STRPBRK +#undef HAVE_STRPTIME #undef HAVE_STRTOL #undef HAVE_CANBERRA +#undef HAVE_SODIUM #undef HAVE_ST_BLKSIZE #undef HAVE_SYSCONF #undef HAVE_SYSCTL #undef HAVE_SYSINFO #undef HAVE_SYSINFO_MEM_UNIT +#undef HAVE_SYSINFO_UPTIME #undef HAVE_TGETENT #undef HAVE_TOWLOWER #undef HAVE_TOWUPPER @@ -223,6 +225,7 @@ #undef HAVE_UTIME #undef HAVE_BIND_TEXTDOMAIN_CODESET #undef HAVE_MBLEN +#undef HAVE_TIMER_CREATE /* Define, if needed, for accessing large files. */ #undef _LARGE_FILES @@ -407,9 +410,6 @@ /* Define if you want to include XIM support. */ #undef FEAT_XIM -/* Define if you want to include Hangul input support. */ -#undef FEAT_HANGULIN - /* Define if you use GTK and want GNOME support. */ #undef FEAT_GUI_GNOME @@ -440,6 +440,9 @@ /* Define if we have shl_load() */ #undef HAVE_SHL_LOAD +/* Define if we can use IPv6 networking. */ +#undef FEAT_IPV6 + /* Define if you want to include NetBeans integration. */ #undef FEAT_NETBEANS_INTG @@ -488,5 +491,17 @@ /* Define if we have isnan() */ #undef HAVE_ISNAN +/* Define if we have dirfd() */ +#undef HAVE_DIRFD + +/* Define if we have flock() */ +#undef HAVE_FLOCK + /* Define to inline symbol or empty */ #undef inline + +/* Define if _SC_SIGSTKSZ is available via sysconf() */ +#undef HAVE_SYSCONF_SIGSTKSZ + +/* Define if you want to load libgpm dynamically */ +#undef DYNAMIC_GPM diff --git a/src/config.mk.in b/src/config.mk.in index 6aa842935b72e..4eb692839be5d 100644 --- a/src/config.mk.in +++ b/src/config.mk.in @@ -37,10 +37,13 @@ X_PRE_LIBS = @X_PRE_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIB@ +XDIFF_OBJS_USED = @XDIFF_OBJS_USED@ + LUA_LIBS = @LUA_LIBS@ LUA_SRC = @LUA_SRC@ LUA_OBJ = @LUA_OBJ@ LUA_CFLAGS = @LUA_CFLAGS@ +LUA_CFLAGS_EXTRA = @LUA_CFLAGS_EXTRA@ LUA_PRO = @LUA_PRO@ MZSCHEME_LIBS = @MZSCHEME_LIBS@ @@ -60,15 +63,18 @@ PERL_SRC = @PERL_SRC@ PERL_OBJ = @PERL_OBJ@ PERL_PRO = @PERL_PRO@ PERL_CFLAGS = @PERL_CFLAGS@ +PERL_CFLAGS_EXTRA = @PERL_CFLAGS_EXTRA@ PYTHON_SRC = @PYTHON_SRC@ PYTHON_OBJ = @PYTHON_OBJ@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ +PYTHON_CFLAGS_EXTRA = @PYTHON_CFLAGS_EXTRA@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON3_SRC = @PYTHON3_SRC@ PYTHON3_OBJ = @PYTHON3_OBJ@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ +PYTHON3_CFLAGS_EXTRA = @PYTHON3_CFLAGS_EXTRA@ PYTHON3_LIBS = @PYTHON3_LIBS@ TCL = @vi_cv_path_tcl@ @@ -76,11 +82,9 @@ TCL_SRC = @TCL_SRC@ TCL_OBJ = @TCL_OBJ@ TCL_PRO = @TCL_PRO@ TCL_CFLAGS = @TCL_CFLAGS@ +TCL_CFLAGS_EXTRA = @TCL_CFLAGS_EXTRA@ TCL_LIBS = @TCL_LIBS@ -HANGULIN_SRC = @HANGULIN_SRC@ -HANGULIN_OBJ = @HANGULIN_OBJ@ - NETBEANS_SRC = @NETBEANS_SRC@ NETBEANS_OBJ = @NETBEANS_OBJ@ CHANNEL_SRC = @CHANNEL_SRC@ @@ -94,6 +98,7 @@ RUBY_SRC = @RUBY_SRC@ RUBY_OBJ = @RUBY_OBJ@ RUBY_PRO = @RUBY_PRO@ RUBY_CFLAGS = @RUBY_CFLAGS@ +RUBY_CFLAGS_EXTRA = @RUBY_CFLAGS_EXTRA@ RUBY_LIBS = @RUBY_LIBS@ AWK = @AWK@ @@ -172,6 +177,10 @@ MAKEMO = @MAKEMO@ MSGFMT = @MSGFMT@ MSGFMT_DESKTOP = @MSGFMT_DESKTOP@ +### set if $SOURCE_DATE_EPOCH was set when running configure +BUILD_DATE_MSG = @BUILD_DATE_MSG@ + + # Make sure that "make first" will run "make all" once configure has done its # work. This is needed when using the Makefile in the top directory. first: all diff --git a/src/configure.ac b/src/configure.ac index b59914b62e8dd..98e1e2ed04eb7 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1,10 +1,11 @@ dnl configure.ac: autoconf script for Vim -dnl Process this file with autoconf 2.12 or 2.13 to produce "configure". -dnl Should also work with autoconf 2.54 and later. +dnl Process this file with autoconf 2.69 to produce "configure". +dnl This should also work with other versions of autoconf, but 2.70 and later +dnl generate lots of hard to fix "obsolete" warnings. AC_INIT(vim.h) -AC_CONFIG_HEADER(auto/config.h:config.h.in) +AC_CONFIG_HEADERS(auto/config.h:config.h.in) dnl Being able to run configure means the system is Unix (compatible). AC_DEFINE(UNIX) @@ -41,10 +42,10 @@ if test x"$ac_cv_prog_cc_c99" != xno; then AC_MSG_CHECKING([if the compiler supports trailing commas]) trailing_commas=no - AC_TRY_COMPILE([], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ enum { one, - };], + };])], [AC_MSG_RESULT(yes); trailing_commas=yes], [AC_MSG_RESULT(no)]) if test "$trailing_commas" = no; then @@ -53,8 +54,8 @@ if test x"$ac_cv_prog_cc_c99" != xno; then AC_MSG_CHECKING([if the compiler supports C++ comments]) slash_comments=no - AC_TRY_COMPILE([], - [// C++ comments?], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], + [// C++ comments?])], [AC_MSG_RESULT(yes); slash_comments=yes], [AC_MSG_RESULT(no)]) if test "$slash_comments" = no; then @@ -62,12 +63,24 @@ if test x"$ac_cv_prog_cc_c99" != xno; then fi fi +dnl If $SOURCE_DATE_EPOCH is present in the environment, use that as the +dnl "compiled" timestamp in :version's output. Attempt to get the formatted +dnl date using GNU date syntax, BSD date syntax, and finally falling back to +dnl just using the current time. +if test -n "$SOURCE_DATE_EPOCH"; then + DATE_FMT="%b %d %Y %H:%M:%S" + BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u "+$DATE_FMT") + AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"]) + BUILD_DATE_MSG=-"echo -e '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nNOTE: build date/time is fixed: $BUILD_DATE\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='" + AC_SUBST(BUILD_DATE_MSG) +fi + dnl Check for the flag that fails if stuff are missing. AC_MSG_CHECKING(--enable-fail-if-missing argument) AC_ARG_ENABLE(fail_if_missing, [ --enable-fail-if-missing Fail if dependencies on additional features - specified on the command line are missing.], + specified on the command line are missing.], [fail_if_missing="yes"], [fail_if_missing="no"]) AC_MSG_RESULT($fail_if_missing) @@ -78,7 +91,7 @@ with_x_arg="$with_x" dnl Set default value for CFLAGS if none is defined or it's empty if test -z "$CFLAGS"; then CFLAGS="-O" - test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" + test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations" fi if test "$GCC" = yes; then dnl method that should work for nearly all versions @@ -115,8 +128,9 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then dnl change the constant 500002075 below appropriately. To get the dnl integer corresponding to a version number, refer to the dnl definition of CLANG_VERSION above. + dnl Clang 11 reports "11", assume Clang 10 and later work like this. AC_MSG_CHECKING(if clang supports -fno-strength-reduce) - if test "$CLANG_VERSION" -ge 500002075 ; then + if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then AC_MSG_RESULT(no) CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'` else @@ -140,24 +154,48 @@ dnl But gcc 3.1 changed the meaning! See near the end. test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM) if test -f ./toolcheck; then - AC_CHECKING(for buggy tools) - sh ./toolcheck 1>&AC_FD_MSG + AC_MSG_CHECKING(for buggy tools) + sh ./toolcheck 1>&AS_MESSAGE_FD fi OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" -dnl Check for BeOS, which needs an extra source file -AC_MSG_CHECKING(for BeOS) -case `uname` in - BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o - BEOS=yes; AC_MSG_RESULT(yes);; - *) BEOS=no; AC_MSG_RESULT(no);; +dnl When cross-compiling set $vim_cv_uname_output, $vim_cv_uname_r_output and +dnl $vim_cv_uname_m_output to the desired value for the target system +AC_MSG_CHECKING(uname) +if test "x$vim_cv_uname_output" = "x" ; then + vim_cv_uname_output=`(uname) 2>/dev/null` + AC_MSG_RESULT($vim_cv_uname_output) +else + AC_MSG_RESULT([$vim_cv_uname_output (cached)]) +fi + +AC_MSG_CHECKING(uname -r) +if test "x$vim_cv_uname_r_output" = "x" ; then + vim_cv_uname_r_output=`(uname -r) 2>/dev/null` + AC_MSG_RESULT($vim_cv_uname_r_output) +else + AC_MSG_RESULT([$vim_cv_uname_r_output (cached)]) +fi + +AC_MSG_CHECKING(uname -m) +if test "x$vim_cv_uname_m_output" = "x" ; then + vim_cv_uname_m_output=`(uname -m) 2>/dev/null` + AC_MSG_RESULT($vim_cv_uname_m_output) +else + AC_MSG_RESULT([$vim_cv_uname_m_output (cached)]) +fi + +AC_MSG_CHECKING(for Haiku) +case $vim_cv_uname_output in + Haiku) HAIKU=yes; AC_MSG_RESULT(yes);; + *) HAIKU=no; AC_MSG_RESULT(no);; esac dnl If QNX is found, assume we don't want to use Xphoton dnl unless it was specifically asked for (--with-x) AC_MSG_CHECKING(for QNX) -case `uname` in +case $vim_cv_uname_output in QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o test -z "$with_x" && with_x=no QNX=yes; AC_MSG_RESULT(yes);; @@ -168,7 +206,7 @@ dnl Check for Darwin and MacOS X dnl We do a check for MacOS X in the very beginning because there dnl are a lot of other things we need to change besides GUI stuff AC_MSG_CHECKING([for Darwin (Mac OS X)]) -if test "`(uname) 2>/dev/null`" = Darwin; then +if test "$vim_cv_uname_output" = Darwin; then AC_MSG_RESULT(yes) MACOS_X=yes CPPFLAGS="$CPPFLAGS -DMACOS_X" @@ -199,7 +237,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), AC_MSG_RESULT(not present)) - + if test "x$DEVELOPER_DIR" = "x"; then AC_PATH_PROG(XCODE_SELECT, xcode-select) if test "x$XCODE_SELECT" != "x"; then @@ -223,7 +261,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" - AC_TRY_LINK([ ], [ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM([ ], [ ])], AC_MSG_RESULT(found, will make universal binary), AC_MSG_RESULT(not found) @@ -231,7 +269,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_CHECKING(if Intel architecture is supported) CPPFLAGS="$CPPFLAGS -arch i386" LDFLAGS="$save_ldflags -arch i386" - AC_TRY_LINK([ ], [ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM([ ], [ ])], AC_MSG_RESULT(yes); MACARCH="intel", AC_MSG_RESULT(no, using PowerPC) MACARCH="ppc" @@ -249,19 +287,17 @@ if test "`(uname) 2>/dev/null`" = Darwin; then MACOS_X_DARWIN=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" + dnl os_macosx.m implements timer_create() and friends + AC_DEFINE(HAVE_TIMER_CREATE) dnl TODO: use -arch i386 on Intel machines dnl Removed -no-cpp-precomp, only for very old compilers. CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN" - dnl If Carbon is found, assume we don't want X11 - dnl unless it was specifically asked for (--with-x) - dnl or Motif, Athena or GTK GUI is used. - AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) - if test "x$CARBON" = "xyes"; then - if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then - with_x=no - fi - fi + dnl Assume we don't want X11 unless it was specifically asked for + dnl (--with-x) or Motif or GTK GUI is used. + if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then + with_x=no + fi fi dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double @@ -362,14 +398,14 @@ AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix AC_MSG_CHECKING(if character set is EBCDIC) -AC_TRY_COMPILE([ ], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ /* TryCompile function for CharSet. Treat any failure as ASCII for compatibility with existing art. Use compile-time rather than run-time tests for cross-compiler tolerance. */ #if '0'!=240 make an error "Character set is not EBCDIC" -#endif ], +#endif ])], [ # TryCompile action if true cf_cv_ebcdic=yes ], [ # TryCompile action if false @@ -388,7 +424,7 @@ AC_SUBST(line_break) if test "$cf_cv_ebcdic" = "yes"; then dnl If we have EBCDIC we most likely have z/OS Unix, let's test it! AC_MSG_CHECKING(for z/OS Unix) -case `uname` in +case $vim_cv_uname_output in OS/390) zOSUnix="yes"; dnl If using cc the environment variable _CC_CCMODE must be dnl set to "1", so that some compiler extensions are enabled. @@ -431,9 +467,9 @@ fi dnl Set QUOTESED. Needs additional backslashes on zOS if test "$zOSUnix" = "yes"; then - QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" + QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/' -e 's/ */ /g'" else - QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" + QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/' -e 's/ */ /g'" fi AC_SUBST(QUOTESED) @@ -507,6 +543,12 @@ esac AC_SUBST(dovimdiff) AC_SUBST(dogvimdiff) +if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + has_eval=no +else + has_eval=yes +fi + AC_MSG_CHECKING(--with-compiledby argument) AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message], compiledby="$withval"; AC_MSG_RESULT($withval), @@ -534,6 +576,16 @@ else AC_MSG_RESULT(yes) fi +AC_MSG_CHECKING([diff feature]) +if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + AC_MSG_RESULT([disabled in $features version]) +else + AC_MSG_RESULT(enabled) + AC_DEFINE(FEAT_DIFF) + XDIFF_OBJS_USED="\$(XDIFF_OBJS)" + AC_SUBST(XDIFF_OBJS_USED) +fi + dnl Check for Lua feature. AC_MSG_CHECKING(--enable-luainterp argument) AC_ARG_ENABLE(luainterp, @@ -542,7 +594,7 @@ AC_ARG_ENABLE(luainterp, AC_MSG_RESULT($enable_luainterp) if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_ERROR([cannot use Lua with tiny or small features]) fi @@ -619,7 +671,26 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then LUA_INC=/lua$vi_cv_version_lua else AC_MSG_RESULT(no) - vi_cv_path_lua_pfx= + + # Detect moonjit: + # https://groups.google.com/forum/#!topic/vim_use/O0vek60WuTk + lua_suf=/moonjit-2.3 + inc_path="$vi_cv_path_lua_pfx/include" + for dir in "$inc_path"/moonjit-[[0-9]]* ; do + if test -d "$dir" ; then + lua_suf=`basename "$dir"` + lua_suf="/$lua_suf" + break + fi + done + AC_MSG_CHECKING(if lua.h can be found in $inc_path$lua_suf) + if test -f "$inc_path$lua_suf/lua.h"; then + AC_MSG_RESULT(yes) + LUA_INC=$lua_suf + else + AC_MSG_RESULT(no) + vi_cv_path_lua_pfx= + fi fi fi fi @@ -652,7 +723,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane]) libs_save=$LIBS LIBS="$LIBS $LUA_LIBS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); lua_ok="yes", AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="") LIBS=$libs_save @@ -716,7 +787,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then fi if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ - test "`(uname -m) 2>/dev/null`" = "x86_64"; then + test "$vim_cv_uname_m_output" = "x86_64"; then dnl OSX/x64 requires these flags. See http://luajit.org/install.html LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" fi @@ -729,6 +800,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then AC_SUBST(LUA_PRO) AC_SUBST(LUA_LIBS) AC_SUBST(LUA_CFLAGS) + AC_SUBST(LUA_CFLAGS_EXTRA) fi @@ -855,6 +927,9 @@ if test "$enable_mzschemeinterp" = "yes"; then MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket3m.a"; then MZSCHEME_LIBS="${path}/libracket3m.a" + if test -f "${path}/librktio.a"; then + MZSCHEME_LIBS="${MZSCHEME_LIBS} ${path}/librktio.a" + fi MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libracket.a"; then MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a" @@ -881,8 +956,8 @@ if test "$enable_mzschemeinterp" = "yes"; then dnl Make Vim remember the path to the library. For when it's not in dnl $LD_LIBRARY_PATH. MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}" - elif test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + elif test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}" fi fi @@ -973,7 +1048,7 @@ if test "$enable_mzschemeinterp" = "yes"; then libs_save=$LIBS CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" LIBS="$LIBS $MZSCHEME_LIBS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); mzs_ok=yes, AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no) CFLAGS=$cflags_save @@ -1006,7 +1081,7 @@ AC_ARG_ENABLE(perlinterp, [enable_perlinterp="no"]) AC_MSG_RESULT($enable_perlinterp) if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_ERROR([cannot use Perl with tiny or small features]) fi AC_SUBST(vi_cv_path_perl) @@ -1077,7 +1152,7 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then LIBS="$LIBS $perllibs" perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` LDFLAGS="$perlldflags $LDFLAGS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); perl_ok=yes, AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no) CFLAGS=$cflags_save @@ -1146,6 +1221,7 @@ AC_SUBST(PERL_SRC) AC_SUBST(PERL_OBJ) AC_SUBST(PERL_PRO) AC_SUBST(PERL_CFLAGS) +AC_SUBST(PERL_CFLAGS_EXTRA) AC_SUBST(PERL_LIBS) AC_MSG_CHECKING(--enable-pythoninterp argument) @@ -1154,7 +1230,7 @@ AC_ARG_ENABLE(pythoninterp, [enable_pythoninterp="no"]) AC_MSG_RESULT($enable_pythoninterp) if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_ERROR([cannot use Python with tiny or small features]) fi @@ -1320,13 +1396,13 @@ eof threadsafe_flag= thread_lib= dnl if test "x$MACOS_X" != "xyes"; then - if test "`(uname) 2>/dev/null`" != Darwin; then + if test "$vim_cv_uname_output" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" - if test "`(uname) 2>/dev/null`" = FreeBSD; then + if test "$vim_cv_uname_output" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi - if test "`(uname) 2>/dev/null`" = SunOS; then + if test "$vim_cv_uname_output" = SunOS; then threadsafe_flag="-pthreads" fi fi @@ -1335,7 +1411,7 @@ eof cflags_save=$CFLAGS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", AC_MSG_RESULT(no); LIBS=$libs_save_old ) @@ -1351,7 +1427,7 @@ eof libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON_CFLAGS" LIBS="$LIBS $PYTHON_LIBS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); python_ok=yes, AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no) CFLAGS=$cflags_save @@ -1378,6 +1454,7 @@ fi AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_CFLAGS) +AC_SUBST(PYTHON_CFLAGS_EXTRA) AC_SUBST(PYTHON_SRC) AC_SUBST(PYTHON_OBJ) @@ -1388,7 +1465,7 @@ AC_ARG_ENABLE(python3interp, [enable_python3interp="no"]) AC_MSG_RESULT($enable_python3interp) if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_ERROR([cannot use Python with tiny or small features]) fi @@ -1407,7 +1484,7 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; dnl -- get its version number AC_CACHE_CHECK(Python version,vi_cv_var_python3_version, [[vi_cv_var_python3_version=` - ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` + ${vi_cv_path_python3} -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'` ]]) dnl -- it must be at least version 3 @@ -1424,41 +1501,44 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; if ${vi_cv_path_python3} -c \ "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" then - vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ + vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ "import sys; print(sys.abiflags)"` fi ]) - + dnl -- find where python3 thinks it was installed AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, [ vi_cv_path_python3_pfx=` ${vi_cv_path_python3} -c \ "import sys; print(sys.prefix)"` ]) - + dnl -- and where it thinks it runs AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, [ vi_cv_path_python3_epfx=` ${vi_cv_path_python3} -c \ "import sys; print(sys.exec_prefix)"` ]) - + dnl -- python3's internal library path - + AC_CACHE_VAL(vi_cv_path_python3path, [ vi_cv_path_python3path=` unset PYTHONPATH; ${vi_cv_path_python3} -c \ "import sys, string; print(':'.join(sys.path))"` ]) - + dnl -- where the Python implementation library archives are - + AC_ARG_WITH(python3-config-dir, [ --with-python3-config-dir=PATH Python's config directory (deprecated)], [ vi_cv_path_python3_conf="${withval}"; have_python3_config_dir=1 ] ) - + AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, [ vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" - d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + d=`${vi_cv_path_python3} -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null` + if test "x$d" = "x"; then + d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` + fi if test -d "$d" && test -f "$d/config.c"; then vi_cv_path_python3_conf="$d" else @@ -1472,13 +1552,13 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; done fi ]) - + PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" - + if test "X$PYTHON3_CONFDIR" = "X"; then AC_MSG_RESULT([can't find it!]) else - + dnl -- we need to examine Python's config/Makefile too dnl see what the interpreter is built from AC_CACHE_VAL(vi_cv_path_python3_plibs, @@ -1523,7 +1603,7 @@ eof fi PYTHON3_SRC="if_python3.c" PYTHON3_OBJ="objects/if_python3.o" - + dnl On FreeBSD linking with "-pthread" is required to use threads. dnl _THREAD_SAFE must be used for compiling then. dnl The "-pthread" is added to $LIBS, so that the following check for @@ -1535,13 +1615,13 @@ eof threadsafe_flag= thread_lib= dnl if test "x$MACOS_X" != "xyes"; then - if test "`(uname) 2>/dev/null`" != Darwin; then + if test "$vim_cv_uname_output" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" - if test "`(uname) 2>/dev/null`" = FreeBSD; then + if test "$vim_cv_uname_output" = FreeBSD; then threadsafe_flag="-D_THREAD_SAFE" thread_lib="-pthread" fi - if test "`(uname) 2>/dev/null`" = SunOS; then + if test "$vim_cv_uname_output" = SunOS; then threadsafe_flag="-pthreads" fi fi @@ -1550,7 +1630,7 @@ eof cflags_save=$CFLAGS CFLAGS="$CFLAGS $threadsafe_flag" LIBS="$LIBS $thread_lib" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag", AC_MSG_RESULT(no); LIBS=$libs_save_old ) @@ -1558,7 +1638,7 @@ eof else AC_MSG_RESULT(no) fi - + dnl check that compiling a simple program still works with the flags dnl added for Python. AC_MSG_CHECKING([if compile and link flags for Python 3 are sane]) @@ -1566,7 +1646,7 @@ eof libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON3_CFLAGS" LIBS="$LIBS $PYTHON3_LIBS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); python3_ok=yes, AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) CFLAGS=$cflags_save @@ -1592,11 +1672,12 @@ fi AC_SUBST(PYTHON3_LIBS) AC_SUBST(PYTHON3_CFLAGS) +AC_SUBST(PYTHON3_CFLAGS_EXTRA) AC_SUBST(PYTHON3_SRC) AC_SUBST(PYTHON3_OBJ) dnl if python2.x and python3.x are enabled one can only link in code -dnl with dlopen(), dlsym(), dlclose() +dnl with dlopen(), dlsym(), dlclose() if test "$python_ok" = yes && test "$python3_ok" = yes; then AC_DEFINE(DYNAMIC_PYTHON) AC_DEFINE(DYNAMIC_PYTHON3) @@ -1614,7 +1695,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then * Only the first python version used will be switched on. */ - int no_rtl_global_needed_for(char *python_instsoname, char *prefix) + static int no_rtl_global_needed_for(char *python_instsoname, char *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); @@ -1633,7 +1714,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then return !needed; } - int main(int argc, char** argv) + int main() { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) @@ -1660,7 +1741,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then * Only the first python version used will be switched on. */ - int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) + static int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) { int needed = 0; void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); @@ -1679,7 +1760,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then return !needed; } - int main(int argc, char** argv) + int main() { int not_needed = 0; if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) @@ -1713,7 +1794,7 @@ elif test "$python_ok" = yes; then libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE" LIBS="$LIBS $PYTHON_LIBS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); fpie_ok=yes, AC_MSG_RESULT(no); fpie_ok=no) CFLAGS=$cflags_save @@ -1735,7 +1816,7 @@ elif test "$python3_ok" = yes; then libs_save=$LIBS CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE" LIBS="$LIBS $PYTHON3_LIBS" - AC_TRY_LINK(,[ ], + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])], AC_MSG_RESULT(yes); fpie_ok=yes, AC_MSG_RESULT(no); fpie_ok=no) CFLAGS=$cflags_save @@ -1791,8 +1872,10 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then if test "x$MACOS_X" != "xyes"; then tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" else + dnl For all macOS, use the value from TCL in case use of, say, homebrew dnl For Mac OS X 10.3, use the OS-provided framework location - tclinc="/System/Library/Frameworks/Tcl.framework/Headers" + dnl For Mac OS X 10.14, the OS-provided framework location doesn't contain the headers, so also check the Xcode SDK + tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /System/Library/Frameworks/Tcl.framework/Headers `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework/Versions/Current/Headers" fi TCL_INC= for try in $tclinc; do @@ -1812,8 +1895,11 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then tclcnf=`echo $tclinc | sed s/include/lib/g` tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" else + dnl For all macOS, use the value from TCL in case use of, say, homebrew dnl For Mac OS X 10.3, use the OS-provided framework location - tclcnf="/System/Library/Frameworks/Tcl.framework" + dnl For Mac OS X 10.14, the OS-provided framework location doesn't contain the headers, so also check the Xcode SDK + tclcnf=`echo $tclinc | sed s/include/lib/g` + tclcnf="$tclcnf /System/Library/Frameworks/Tcl.framework `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework" fi for try in $tclcnf; do if test -f "$try/tclConfig.sh"; then @@ -1843,8 +1929,8 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then if test -f "$try/lib$trylib" ; then AC_MSG_RESULT($try/lib$trylib) TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm" - if test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + if test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then TCL_LIBS="$TCL_LIBS -R $try" fi break 3 @@ -1883,6 +1969,7 @@ AC_SUBST(TCL_SRC) AC_SUBST(TCL_OBJ) AC_SUBST(TCL_PRO) AC_SUBST(TCL_CFLAGS) +AC_SUBST(TCL_CFLAGS_EXTRA) AC_SUBST(TCL_LIBS) AC_MSG_CHECKING(--enable-rubyinterp argument) @@ -1891,7 +1978,7 @@ AC_ARG_ENABLE(rubyinterp, [enable_rubyinterp="no"]) AC_MSG_RESULT($enable_rubyinterp) if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_ERROR([cannot use Ruby with tiny or small features]) fi @@ -1932,8 +2019,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` - if test -f "$rubylibdir/$librubya"; then - librubyarg="$librubyarg" + if test -f "$rubylibdir/$librubya" || expr "$librubyarg" : "-lruby"; then RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then dnl required on Mac OS 10.3 where libruby.a doesn't exist @@ -1966,9 +2052,12 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` fi AC_DEFINE(DYNAMIC_RUBY) - RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" + RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" RUBY_LIBS= fi + if test "X$CLANG_VERSION" != "X" -a "$rubyversion" -ge 30; then + RUBY_CFLAGS="$RUBY_CFLAGS -fdeclspec" + fi else AC_MSG_RESULT(not found; disabling Ruby) fi @@ -1985,6 +2074,7 @@ AC_SUBST(RUBY_SRC) AC_SUBST(RUBY_OBJ) AC_SUBST(RUBY_PRO) AC_SUBST(RUBY_CFLAGS) +AC_SUBST(RUBY_CFLAGS_EXTRA) AC_SUBST(RUBY_LIBS) AC_MSG_CHECKING(--enable-cscope argument) @@ -2001,7 +2091,7 @@ AC_ARG_ENABLE(netbeans, [ --disable-netbeans Disable NetBeans integration support.], , [enable_netbeans="yes"]) if test "$enable_netbeans" = "yes"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_RESULT([cannot use NetBeans with tiny or small features]) enable_netbeans="no" else @@ -2016,7 +2106,7 @@ AC_ARG_ENABLE(channel, [ --disable-channel Disable process communication support.], , [enable_channel="yes"]) if test "$enable_channel" = "yes"; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_RESULT([cannot use channels with tiny or small features]) enable_channel="no" else @@ -2032,11 +2122,51 @@ else fi if test "$enable_channel" = "yes"; then - dnl On Solaris we need the socket and nsl library. - AC_CHECK_LIB(socket, socket) - AC_CHECK_LIB(nsl, gethostbyname) - AC_MSG_CHECKING(whether compiling with process communication is possible) - AC_TRY_LINK([ + dnl On Solaris we need the socket library, or on Haiku the network library. + if test "x$HAIKU" = "xyes"; then + AC_CHECK_LIB(network, socket) + else + AC_CHECK_LIB(socket, socket) + fi + + AC_CACHE_CHECK([whether compiling with IPv6 networking is possible], [vim_cv_ipv6_networking], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* Check bitfields */ + struct nbbuf { + unsigned int initDone:1; + unsigned short signmaplen; + }; + ], [ + /* Check creating a socket. */ + struct sockaddr_in server; + struct addrinfo *res; + (void)socket(AF_INET, SOCK_STREAM, 0); + (void)htons(100); + (void)getaddrinfo("microsoft.com", NULL, NULL, &res); + if (errno == ECONNREFUSED) + (void)connect(1, (struct sockaddr *)&server, sizeof(server)); + (void)freeaddrinfo(res); + ])], + [vim_cv_ipv6_networking="yes"], + [vim_cv_ipv6_networking="no"])]) + + if test "x$vim_cv_ipv6_networking" = "xyes"; then + AC_DEFINE(FEAT_IPV6) + AC_CHECK_FUNCS(inet_ntop) + else + dnl On Solaris we need the nsl library. + AC_CHECK_LIB(nsl, gethostbyname) + AC_CACHE_CHECK([whether compiling with IPv4 networking is possible], [vim_cv_ipv4_networking], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include #include #include @@ -2059,9 +2189,10 @@ if test "$enable_channel" = "yes"; then (void)gethostbyname("microsoft.com"); if (errno == ECONNREFUSED) (void)connect(1, (struct sockaddr *)&server, sizeof(server)); - ], - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no); enable_netbeans="no"; enable_channel="no") + ])], + [vim_cv_ipv4_networking="yes"], + [vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no"])]) + fi fi if test "$enable_netbeans" = "yes"; then AC_DEFINE(FEAT_NETBEANS_INTG) @@ -2072,9 +2203,9 @@ if test "$enable_netbeans" = "yes"; then fi if test "$enable_channel" = "yes"; then AC_DEFINE(FEAT_JOB_CHANNEL) - CHANNEL_SRC="channel.c" + CHANNEL_SRC="job.c channel.c" AC_SUBST(CHANNEL_SRC) - CHANNEL_OBJ="objects/channel.o" + CHANNEL_OBJ="objects/job.o objects/channel.o" AC_SUBST(CHANNEL_OBJ) fi @@ -2083,7 +2214,7 @@ AC_ARG_ENABLE(terminal, [ --enable-terminal Enable terminal emulation support.], , [enable_terminal="auto"]) if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then + if test "$has_eval" = "no"; then AC_MSG_RESULT([cannot use terminal emulator with tiny or small features]) enable_terminal="no" else @@ -2161,12 +2292,6 @@ dnl Farsi language support has been removed, ignore --disable-farsi AC_ARG_ENABLE(farsi, [ --disable-farsi Deprecated.],,) -AC_MSG_CHECKING(--enable-hangulinput argument) -AC_ARG_ENABLE(hangulinput, - [ --enable-hangulinput Include Hangul input support.], , - [enable_hangulinput="no"]) -AC_MSG_RESULT($enable_hangulinput) - AC_MSG_CHECKING(--enable-xim argument) AC_ARG_ENABLE(xim, [ --enable-xim Include XIM input support.], @@ -2201,14 +2326,14 @@ else fi dnl On my HPUX system the X include dir is found, but the lib dir not. - dnl This is a desparate try to fix this. + dnl This is a desperate try to fix this. if test -d "$x_includes" && test ! -d "$x_libraries"; then x_libraries=`echo "$x_includes" | sed s/include/lib/` AC_MSG_RESULT(Corrected X libraries to $x_libraries) X_LIBS="$X_LIBS -L$x_libraries" - if test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + if test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then X_LIBS="$X_LIBS -R $x_libraries" fi fi @@ -2233,8 +2358,8 @@ else AC_MSG_CHECKING(if X11 header files can be found) cflags_save=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" - AC_TRY_COMPILE([#include -#include ], , + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include +#include ], )], AC_MSG_RESULT(yes), AC_MSG_RESULT(no); no_x=yes) CFLAGS=$cflags_save @@ -2275,10 +2400,10 @@ else else CFLAGS="$CFLAGS $X_CFLAGS" fi - AC_TRY_COMPILE([#include ], , + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], )], AC_MSG_RESULT(no), CFLAGS="$CFLAGS -Wno-implicit-int" - AC_TRY_COMPILE([#include ], , + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], )], AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int", AC_MSG_RESULT(test failed) ) @@ -2289,18 +2414,18 @@ else AC_MSG_CHECKING(size of wchar_t is 2 bytes) AC_CACHE_VAL(ac_cv_small_wchar_t, - [AC_TRY_RUN([ + [AC_RUN_IFELSE([AC_LANG_SOURCE([ #include #if STDC_HEADERS # include # include #endif - main() + int main() { if (sizeof(wchar_t) <= 2) exit(1); exit(0); - }], + }])], ac_cv_small_wchar_t="no", ac_cv_small_wchar_t="yes", AC_MSG_ERROR(failed to compile test program))]) @@ -2317,11 +2442,11 @@ if test "x$with_x" = xno -a "x$with_x_arg" = xyes; then AC_MSG_ERROR([could not configure X]) fi -test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no +test "x$with_x" = xno -a "x$HAIKU" != "xyes" -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no AC_MSG_CHECKING(--enable-gui argument) AC_ARG_ENABLE(gui, - [ --enable-gui[=OPTS] X11 GUI. [default=auto] [OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto") + [ --enable-gui[=OPTS] X11 GUI. [default=auto] [OPTS=auto/no/gtk2/gnome2/gtk3/motif/haiku/photon/carbon]], , enable_gui="auto") dnl Canonicalize the --enable-gui= argument so that it can be easily compared. dnl Do not use character classes for portability with old tools. @@ -2333,13 +2458,22 @@ SKIP_GTK2=YES SKIP_GTK3=YES SKIP_GNOME=YES SKIP_MOTIF=YES -SKIP_ATHENA=YES -SKIP_NEXTAW=YES SKIP_PHOTON=YES -SKIP_CARBON=YES +SKIP_HAIKU=YES GUITYPE=NONE -if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then +if test "x$HAIKU" = "xyes"; then + SKIP_HAIKU= + case "$enable_gui_canon" in + no) AC_MSG_RESULT(no GUI support) + SKIP_HAIKU=YES ;; + yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; + auto) AC_MSG_RESULT(auto - automatic GUI support) ;; + haiku) AC_MSG_RESULT(Haiku GUI support) ;; + *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) + SKIP_HAIKU=YES ;; + esac +elif test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then SKIP_PHOTON= case "$enable_gui_canon" in no) AC_MSG_RESULT(no GUI support) @@ -2352,19 +2486,13 @@ if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then esac elif test "x$MACOS_X" = "xyes" -a "x$with_x" = "xno" ; then - SKIP_CARBON= case "$enable_gui_canon" in - no) AC_MSG_RESULT(no GUI support) - SKIP_CARBON=YES ;; + no) AC_MSG_RESULT(no GUI support) ;; yes|"") AC_MSG_RESULT(yes - automatic GUI support) gui_auto=yes ;; - auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support) - SKIP_CARBON=YES ;; - carbon) AC_MSG_RESULT(Carbon GUI support) ;; - *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) - SKIP_CARBON=YES ;; + auto) AC_MSG_RESULT(auto - disable GUI support for Mac OS) ;; + *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;; esac - else case "$enable_gui_canon" in @@ -2372,11 +2500,9 @@ else yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support) gui_auto=yes SKIP_GTK2= + SKIP_GTK3= SKIP_GNOME= - SKIP_MOTIF= - SKIP_ATHENA= - SKIP_NEXTAW= - SKIP_CARBON=;; + SKIP_MOTIF=;; gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support) SKIP_GTK2=;; gnome2) AC_MSG_RESULT(GNOME 2.x GUI support) @@ -2386,10 +2512,6 @@ else SKIP_GTK3=;; motif) AC_MSG_RESULT(Motif GUI support) SKIP_MOTIF=;; - athena) AC_MSG_RESULT(Athena GUI support) - SKIP_ATHENA=;; - nextaw) AC_MSG_RESULT(neXtaw GUI support) - SKIP_NEXTAW=;; *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;; esac @@ -2441,73 +2563,6 @@ if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then fi fi -if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then - AC_MSG_CHECKING(whether or not to look for Athena) - AC_ARG_ENABLE(athena-check, - [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]], - , enable_athena_check="yes") - AC_MSG_RESULT($enable_athena_check) - if test "x$enable_athena_check" = "xno"; then - SKIP_ATHENA=YES - fi -fi - -if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then - AC_MSG_CHECKING(whether or not to look for neXtaw) - AC_ARG_ENABLE(nextaw-check, - [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]], - , enable_nextaw_check="yes") - AC_MSG_RESULT($enable_nextaw_check); - if test "x$enable_nextaw_check" = "xno"; then - SKIP_NEXTAW=YES - fi -fi - -if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then - AC_MSG_CHECKING(whether or not to look for Carbon) - AC_ARG_ENABLE(carbon-check, - [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]], - , enable_carbon_check="yes") - AC_MSG_RESULT($enable_carbon_check); - if test "x$enable_carbon_check" = "xno"; then - SKIP_CARBON=YES - fi -fi - - -if test "x$MACOS_X" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then - AC_MSG_CHECKING(for Carbon GUI) - dnl already did the check, just give the message - AC_MSG_RESULT(yes); - GUITYPE=CARBONGUI - if test "$VIMNAME" = "vim"; then - VIMNAME=Vim - fi - - if test "x$MACARCH" = "xboth"; then - CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" - else - CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" - fi - - dnl Default install directory is not /usr/local - if test x$prefix = xNONE; then - prefix=/Applications - fi - - dnl Sorry for the hard coded default - datadir='${prefix}/Vim.app/Contents/Resources' - - dnl skip everything else - SKIP_GTK2=YES; - SKIP_GNOME=YES; - SKIP_MOTIF=YES; - SKIP_ATHENA=YES; - SKIP_NEXTAW=YES; - SKIP_PHOTON=YES; - SKIP_CARBON=YES -fi - dnl define an autoconf function to check for a specified version of GTK, and dnl try to compile/link a GTK program. dnl @@ -2554,6 +2609,9 @@ AC_DEFUN(AM_PATH_GTK, sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` } else + dnl Put some text before the "no" to hint at installing the gtk-dev + dnl packages. + AC_MSG_CHECKING(for GTK -dev package) no_gtk=yes fi @@ -2568,7 +2626,7 @@ AC_DEFUN(AM_PATH_GTK, dnl Now check if the installed GTK is sufficiently new. dnl rm -f conf.gtktest - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([ #include #include #if STDC_HEADERS @@ -2600,7 +2658,7 @@ if ((gtk_major_version > major) || } return 1; } -],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) +])],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" } @@ -2682,7 +2740,7 @@ AC_DEFUN([GNOME_INIT_HOOK], dnl On FreeBSD we need -pthread but pkg-config doesn't include it. dnl This might not be the right way but it works for me... AC_MSG_CHECKING(for FreeBSD) - if test "`(uname) 2>/dev/null`" = FreeBSD; then + if test "$vim_cv_uname_output" = FreeBSD; then AC_MSG_RESULT(yes, adding -pthread) GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" GNOME_LIBS="$GNOME_LIBS -pthread" @@ -2726,17 +2784,21 @@ if test -z "$SKIP_GTK2"; then if test "x$PKG_CONFIG" != "xno"; then dnl First try finding version 2.2.0 or later. The 2.0.x series has dnl problems (bold fonts, --remote doesn't work). + dnl Disable checking for GTK3 here, otherwise it's found when GTK2 is not + dnl found. + save_skip_gtk3=$SKIP_GTK3 + SKIP_GTK3=YES AM_PATH_GTK(2.2.0, [GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" GUI_INC_LOC="$GTK_CFLAGS"], ) if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK3=YES - SKIP_ATHENA=YES - SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK AC_SUBST(GTK_LIBNAME) + else + SKIP_GTK3=$save_skip_gtk3 fi fi if test "x$GUITYPE" = "xGTK"; then @@ -2772,6 +2834,8 @@ if test -z "$SKIP_GTK3"; then fi if test "x$PKG_CONFIG" != "xno"; then + save_skip_gtk2=$SKIP_GTK2 + SKIP_GTK2=YES AM_PATH_GTK(3.0.0, [GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" @@ -2779,12 +2843,12 @@ if test -z "$SKIP_GTK3"; then if test "x$GTK_CFLAGS" != "x"; then SKIP_GTK2=YES SKIP_GNOME=YES - SKIP_ATHENA=YES - SKIP_NEXTAW=YES SKIP_MOTIF=YES GUITYPE=GTK AC_SUBST(GTK_LIBNAME) AC_DEFINE(USE_GTK3) + else + SKIP_GTK2=$save_skip_gtk2 fi fi fi @@ -2904,11 +2968,12 @@ if test -z "$SKIP_MOTIF"; then dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The dnl linker will figure out which one to use, we only check if one exists. + dnl Cygwin uses the .dll.a extension. AC_MSG_CHECKING(for location of Motif GUI libs) gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" GUI_LIB_LOC= for try in $gui_libs; do - for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do + for libtry in "$try"/libXm.a "$try"/libXm.dll.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do if test -f "$libtry"; then GUI_LIB_LOC=$try fi @@ -2924,8 +2989,8 @@ if test -z "$SKIP_MOTIF"; then else if test -n "$GUI_LIB_LOC"; then AC_MSG_RESULT($GUI_LIB_LOC) - if test "`(uname) 2>/dev/null`" = SunOS && - uname -r | grep '^5' >/dev/null; then + if test "$vim_cv_uname_output" = SunOS && + echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC" fi fi @@ -2939,49 +3004,11 @@ if test -z "$SKIP_MOTIF"; then fi if test -z "$SKIP_MOTIF"; then - SKIP_ATHENA=YES - SKIP_NEXTAW=YES GUITYPE=MOTIF AC_SUBST(MOTIF_LIBNAME) fi -dnl Check if the Athena files can be found - -GUI_X_LIBS= - -if test -z "$SKIP_ATHENA"; then - AC_MSG_CHECKING(if Athena header files can be found) - cflags_save=$CFLAGS - CFLAGS="$CFLAGS $X_CFLAGS" - AC_TRY_COMPILE([ -#include -#include ], , - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no); SKIP_ATHENA=YES ) - CFLAGS=$cflags_save -fi - -if test -z "$SKIP_ATHENA"; then - GUITYPE=ATHENA -fi - -if test -z "$SKIP_NEXTAW"; then - AC_MSG_CHECKING(if neXtaw header files can be found) - cflags_save=$CFLAGS - CFLAGS="$CFLAGS $X_CFLAGS" - AC_TRY_COMPILE([ -#include -#include ], , - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no); SKIP_NEXTAW=YES ) - CFLAGS=$cflags_save -fi - -if test -z "$SKIP_NEXTAW"; then - GUITYPE=NEXTAW -fi - -if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then +if test -z "$SKIP_MOTIF"; then dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty dnl Avoid adding it when it twice if test -n "$GUI_INC_LOC"; then @@ -3043,7 +3070,7 @@ if test "$enable_xsmp" = "yes"; then fi -if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then +if test -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" @@ -3058,45 +3085,42 @@ if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_ fi CPPFLAGS=$cppflags_save - dnl automatically enable XIM when hangul input isn't enabled - if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \ - -a "x$GUITYPE" != "xNONE" ; then + dnl automatically enable XIM in the GUI + if test "$enable_xim" = "auto" -a "x$GUITYPE" != "xNONE" ; then AC_MSG_RESULT(X GUI selected; xim has been enabled) enable_xim="yes" fi fi -if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then +if test -z "$SKIP_MOTIF"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h AC_MSG_CHECKING([for X11/Xmu/Editres.h]) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include ], - [int i; i = 0;], + [int i; i = 0;])], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_X11_XMU_EDITRES_H), AC_MSG_RESULT(no)) CPPFLAGS=$cppflags_save fi -dnl Only use the Xm directory when compiling Motif, don't use it for Athena +dnl Only use the Xm directory when compiling Motif. if test -z "$SKIP_MOTIF"; then cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" if test "$zOSUnix" = "yes"; then - xmheader="Xm/Xm.h" + AC_CHECK_HEADERS(Xm/Xm.h) else - xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h - Xm/UnhighlightT.h Xm/Notebook.h" - fi - AC_CHECK_HEADERS($xmheader) + AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h Xm/UnhighlightT.h Xm/Notebook.h) + fi if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then dnl Solaris uses XpmAttributes_21, very annoying. AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h]) - AC_TRY_COMPILE([#include ], [XpmAttributes_21 attr;], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [XpmAttributes_21 attr;])], AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21), AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) ) @@ -3119,6 +3143,11 @@ if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then enable_fontset="no" fi +dnl There is no test for the Haiku GUI, if it's selected it's used +if test -z "$SKIP_HAIKU"; then + GUITYPE=HAIKUGUI +fi + if test -z "$SKIP_PHOTON"; then GUITYPE=PHOTONGUI fi @@ -3164,7 +3193,7 @@ fi dnl Check for Cygwin, which needs an extra source file if not using X11 AC_MSG_CHECKING(for CYGWIN or MSYS environment) -case `uname` in +case $vim_cv_uname_output in CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes) AC_MSG_CHECKING(for CYGWIN clipboard support) if test "x$with_x" = "xno" ; then @@ -3178,20 +3207,6 @@ case `uname` in *) CYGWIN=no; AC_MSG_RESULT(no);; esac -dnl Only really enable hangul input when GUI and XFONTSET are available -if test "$enable_hangulinput" = "yes"; then - if test "x$GUITYPE" = "xNONE"; then - AC_MSG_RESULT(no GUI selected; hangul input has been disabled) - enable_hangulinput=no - else - AC_DEFINE(FEAT_HANGULIN) - HANGULIN_SRC=hangulin.c - AC_SUBST(HANGULIN_SRC) - HANGULIN_OBJ=objects/hangulin.o - AC_SUBST(HANGULIN_OBJ) - fi -fi - dnl Checks for libraries and include files. AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken], @@ -3203,7 +3218,7 @@ AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken], # include # include #endif -main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } +int main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } ]])],[ vim_cv_toupper_broken=yes ],[ @@ -3217,12 +3232,12 @@ if test "x$vim_cv_toupper_broken" = "xyes" ; then fi AC_MSG_CHECKING(whether __DATE__ and __TIME__ work) -AC_TRY_COMPILE([#include ], [printf("(" __DATE__ " " __TIME__ ")");], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [printf("(" __DATE__ " " __TIME__ ")");])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME), AC_MSG_RESULT(no)) AC_MSG_CHECKING(whether __attribute__((unused)) is allowed) -AC_TRY_COMPILE([#include ], [int x __attribute__((unused));], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [int x __attribute__((unused));])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED), AC_MSG_RESULT(no)) @@ -3239,8 +3254,8 @@ dnl If sys/wait.h is not found it might still exist but not be POSIX dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT) if test $ac_cv_header_sys_wait_h = no; then AC_MSG_CHECKING([for sys/wait.h that defines union wait]) - AC_TRY_COMPILE([#include ], - [union wait xx, yy; xx = yy], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [union wait xx, yy; xx = yy])], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SYS_WAIT_H) AC_DEFINE(HAVE_UNION_WAIT), @@ -3273,10 +3288,10 @@ AC_CHECK_HEADERS(sys/sysctl.h, [], [], dnl pthread_np.h may exist but can only be used after including pthread.h AC_MSG_CHECKING([for pthread_np.h]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include ], - [int i; i = 0;], + [int i; i = 0;])], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PTHREAD_NP_H), AC_MSG_RESULT(no)) @@ -3291,7 +3306,7 @@ dnl Check if strings.h and string.h can both be included when defined. AC_MSG_CHECKING([if strings.h can be included after string.h]) cppflags_save=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO) # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */ /* but don't do it on AIX 5.1 (Uribarri) */ @@ -3305,7 +3320,7 @@ AC_TRY_COMPILE([ #if defined(HAVE_STRINGS_H) # include #endif - ], [int i; i = 0;], + ], [int i; i = 0;])], AC_MSG_RESULT(yes), AC_DEFINE(NO_STRINGS_WITH_STRING_H) AC_MSG_RESULT(no)) @@ -3378,7 +3393,7 @@ fi dnl BSDI uses ss_base while others use ss_sp for the stack pointer. AC_MSG_CHECKING(whether stack_t has an ss_base field) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #if STDC_HEADERS # include @@ -3386,7 +3401,7 @@ AC_TRY_COMPILE([ #endif #include #include "confdefs.h" - ], [stack_t sigstk; sigstk.ss_base = 0; ], + ], [stack_t sigstk; sigstk.ss_base = 0; ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE), AC_MSG_RESULT(no)) @@ -3397,7 +3412,7 @@ if test -n "$with_tlib"; then AC_MSG_RESULT($with_tlib) LIBS="$LIBS -l$with_tlib" AC_MSG_CHECKING(for linking with $with_tlib library) - AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED)) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED)) dnl Need to check for tgetent() below. olibs="$LIBS" else @@ -3409,7 +3424,7 @@ else dnl Older versions of ncurses have bugs, get a new one! dnl Digital Unix (OSF1) should use curses (Ronald Schild). dnl On SCO Openserver should prefer termlib (Roger Cornelius). - case "`uname -s 2>/dev/null`" in + case "$vim_cv_uname_output" in OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";; *) tlibs="tinfo ncurses termlib termcap curses";; esac @@ -3419,7 +3434,7 @@ else dnl It's possible that a library is found but it doesn't work dnl e.g., shared library that cannot be found dnl compile and run a test program to be sure - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([ #ifdef HAVE_TERMCAP_H # include #endif @@ -3427,7 +3442,7 @@ else # include # include #endif -main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }], +int main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }])], res="OK", res="FAIL", res="FAIL") if test "$res" = "OK"; then break @@ -3443,11 +3458,12 @@ fi if test "x$olibs" = "x$LIBS"; then AC_MSG_CHECKING([for tgetent()]) - AC_TRY_LINK([], - [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");], + AC_LINK_IFELSE([AC_LANG_PROGRAM([int tgetent(char *, const char *);], + [[char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");]])], AC_MSG_RESULT(yes), AC_MSG_ERROR([NOT FOUND! You need to install a terminal library; for example ncurses. + On Linux that would be the libncurses-dev package. Or specify the name of the library with --with-tlib.])) fi @@ -3465,7 +3481,7 @@ AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo], # include # include #endif -main() +int main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } ]])],[ vim_cv_terminfo=no @@ -3491,7 +3507,7 @@ AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgetent # include # include #endif -main() +int main() {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } ]])],[ vim_cv_tgetent=zero @@ -3507,58 +3523,68 @@ if test "x$vim_cv_tgetent" = "xzero" ; then fi AC_MSG_CHECKING(whether termcap.h contains ospeed) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_TERMCAP_H # include #endif - ], [ospeed = 20000], + ], [ospeed = 20000])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED), [AC_MSG_RESULT(no) AC_MSG_CHECKING(whether ospeed can be extern) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_TERMCAP_H # include #endif extern short ospeed; - ], [ospeed = 20000], + ], [ospeed = 20000])], AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN), AC_MSG_RESULT(no))] ) AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC]) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_TERMCAP_H # include #endif - ], [if (UP == 0 && BC == 0) PC = 1], + ], [if (UP == 0 && BC == 0) PC = 1])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC), [AC_MSG_RESULT(no) AC_MSG_CHECKING([whether UP, BC and PC can be extern]) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_TERMCAP_H # include #endif extern char *UP, *BC, PC; - ], [if (UP == 0 && BC == 0) PC = 1], + ], [if (UP == 0 && BC == 0) PC = 1])], AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN), AC_MSG_RESULT(no))] ) AC_MSG_CHECKING(whether tputs() uses outfuntype) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_TERMCAP_H # include #endif - ], [extern int xx(); tputs("test", 1, (outfuntype)xx)], + ], [extern int xx(); tputs("test", 1, (outfuntype)xx)])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE), AC_MSG_RESULT(no)) +AC_MSG_CHECKING([whether del_curterm() can be used]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#ifdef HAVE_TERMCAP_H +# include +#endif +#include + ], [if (cur_term) del_curterm(cur_term);])], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DEL_CURTERM), + AC_MSG_RESULT(no)) + dnl On some SCO machines sys/select redefines struct timeval AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include -#include ], , +#include ], )], AC_MSG_RESULT(yes) AC_DEFINE(SYS_SELECT_WITH_SYS_TIME), AC_MSG_RESULT(no)) @@ -3576,7 +3602,15 @@ fi AC_MSG_CHECKING(for SVR4 ptys) if test -c /dev/ptmx ; then - AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +// These should be in stdlib.h, but it depends on _XOPEN_SOURCE. +char *ptsname(int); +int unlockpt(int); +int grantpt(int); + ], [ + ptsname(0); + grantpt(0); + unlockpt(0);])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS), AC_MSG_RESULT(no)) else @@ -3610,98 +3644,18 @@ else AC_MSG_RESULT([don't know]) fi -dnl **** pty mode/group handling **** -dnl -dnl support provided by Luke Mewburn , 931222 -rm -f conftest_grp -AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group], - [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include "confdefs.h" -#include -#if STDC_HEADERS -# include -# include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -main() -{ - struct stat sb; - char *x,*ttyname(); - int om, m; - FILE *fp; - - if (!(x = ttyname(0))) exit(1); - if (stat(x, &sb)) exit(1); - om = sb.st_mode; - if (om & 002) exit(0); - m = system("mesg y"); - if (m == -1 || m == 127) exit(1); - if (stat(x, &sb)) exit(1); - m = sb.st_mode; - if (chmod(x, om)) exit(1); - if (m & 002) exit(0); - if (sb.st_gid == getgid()) exit(1); - if (!(fp=fopen("conftest_grp", "w"))) - exit(1); - fprintf(fp, "%d\n", sb.st_gid); - fclose(fp); - exit(0); -} - ]])],[ - if test -f conftest_grp; then - vim_cv_tty_group=`cat conftest_grp` - if test "x$vim_cv_tty_mode" = "x" ; then - vim_cv_tty_mode=0620 - fi - AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) - else - vim_cv_tty_group=world - AC_MSG_RESULT([ptys are world accessible]) - fi - ],[ - vim_cv_tty_group=world - AC_MSG_RESULT([can't determine - assume ptys are world accessible]) - ],[ - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') - ]) - ]) -rm -f conftest_grp - -if test "x$vim_cv_tty_group" != "xworld" ; then - AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) - if test "x$vim_cv_tty_mode" = "x" ; then - AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)]) - else - AC_DEFINE(PTYMODE, 0620) - fi -fi - dnl Checks for library functions. =================================== -AC_TYPE_SIGNAL - -dnl find out what to use at the end of a signal function -if test $ac_cv_type_signal = void; then - AC_DEFINE(SIGRETURN, [return]) -else - AC_DEFINE(SIGRETURN, [return 0]) -fi - dnl check if struct sigcontext is defined (used for SGI only) AC_MSG_CHECKING(for struct sigcontext) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include test_sig() { struct sigcontext *scont; scont = (struct sigcontext *)0; return 1; -} ], , +} ], )], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SIGCONTEXT), AC_MSG_RESULT(no)) @@ -3716,7 +3670,7 @@ AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken], #include #endif char *dagger[] = { "IFS=pwd", 0 }; -main() +int main() { char buffer[500]; extern char **environ; @@ -3743,9 +3697,9 @@ AC_CHECK_FUNCS(fchdir fchown fchmod fsync getcwd getpseudotty \ getpwent getpwnam getpwuid getrlimit gettimeofday localtime_r lstat \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ - sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ - strnicmp strpbrk strtol tgetent towlower towupper iswupper tzset \ - usleep utime utimes mblen ftruncate unsetenv posix_openpt) + sigprocmask sigvec strcasecmp strcoll strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strptime strtol tgetent towlower towupper iswupper \ + tzset usleep utime utimes mblen ftruncate unsetenv posix_openpt) AC_FUNC_SELECT_ARGTYPES AC_FUNC_FSEEKO @@ -3767,7 +3721,12 @@ if test "$enable_canberra" = "maybe"; then enable_canberra="no" fi else - AC_MSG_RESULT($enable_canberra) + if test "$enable_canberra" = "yes" -a "$has_eval" = "no"; then + AC_MSG_RESULT([cannot use sound with tiny or small features]) + enable_canberra="no" + else + AC_MSG_RESULT($enable_canberra) + fi fi if test "$enable_canberra" = "yes"; then if test "x$PKG_CONFIG" != "xno"; then @@ -3781,31 +3740,105 @@ if test "$enable_canberra" = "yes"; then AC_MSG_CHECKING(for libcanberra) ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $canberra_cflags" + if `echo "$CFLAGS" | grep -v "$canberra_cflags" 2>/dev/null`; then + CFLAGS="$CFLAGS $canberra_cflags" + fi LIBS="$LIBS $canberra_lib" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ # include ], [ ca_context *hello; - ca_context_create(&hello);], + ca_context_create(&hello);])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CANBERRA), - AC_MSG_RESULT(no); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS") + AC_MSG_RESULT(no; try installing libcanberra-dev); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS") fi +AC_MSG_CHECKING(--enable-libsodium argument) +AC_ARG_ENABLE(libsodium, + [ --disable-libsodium Do not use libsodium.], + , [enable_libsodium="maybe"]) + +if test "$enable_libsodium" = "maybe"; then + if test "$features" = "big" -o "$features" = "huge"; then + AC_MSG_RESULT(Defaulting to yes) + enable_libsodium="yes" + else + AC_MSG_RESULT(Defaulting to no) + enable_libsodium="no" + fi +else + AC_MSG_RESULT($enable_libsodium) +fi +if test "$enable_libsodium" = "yes"; then + if test "x$PKG_CONFIG" != "xno"; then + libsodium_lib=`$PKG_CONFIG --libs libsodium 2>/dev/null` + libsodium_cflags=`$PKG_CONFIG --cflags libsodium 2>/dev/null` + fi + if test "x$libsodium_lib" = "x"; then + libsodium_lib=-lsodium + libsodium_cflags= + fi + AC_MSG_CHECKING(for libsodium) + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $libsodium_cflags" + LIBS="$LIBS $libsodium_lib" + AC_LINK_IFELSE([AC_LANG_PROGRAM([ + # include + ], [ + printf("%d", sodium_init()); ])], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SODIUM), + AC_MSG_RESULT(no; try installing libsodium-dev); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS") +fi dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible AC_MSG_CHECKING(for st_blksize) -AC_TRY_COMPILE( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include #include ], [ struct stat st; int n; stat("/", &st); - n = (int)st.st_blksize;], + n = (int)st.st_blksize;])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE), AC_MSG_RESULT(no)) +dnl Check for timer_create. It probably requires the 'rt' library. +AC_MSG_CHECKING([for timer_create]) +save_LIBS="$LIBS" +LIBS="$LIBS -lrt" +AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include +#include +static void set_flag(union sigval sv) {} +], [ + struct timespec ts; + struct sigevent action = {0}; + timer_t timer_id; + + action.sigev_notify = SIGEV_THREAD; + action.sigev_notify_function = set_flag; + timer_create(CLOCK_REALTIME, &action, &timer_id); + ])], + AC_MSG_RESULT(yes; with -lrt); AC_DEFINE(HAVE_TIMER_CREATE), + LIBS="$save_LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include +#include +static void set_flag(union sigval sv) {} + ], [ + struct timespec ts; + struct sigevent action = {0}; + timer_t timer_id; + + action.sigev_notify = SIGEV_THREAD; + action.sigev_notify_function = set_flag; + timer_create(CLOCK_REALTIME, &action, &timer_id); + ])], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMER_CREATE), + AC_MSG_RESULT(no))) + AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ @@ -3816,7 +3849,7 @@ AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_s #endif #include #include -main() {struct stat st; exit(stat("configure/", &st) != 0); } +int main() {struct stat st; exit(stat("configure/", &st) != 0); } ]])],[ vim_cv_stat_ignores_slash=yes ],[ @@ -3829,7 +3862,32 @@ main() {struct stat st; exit(stat("configure/", &st) != 0); } if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then AC_DEFINE(STAT_IGNORES_SLASH) fi - + +dnl nanoseconds field of struct stat +AC_CACHE_CHECK([for nanoseconds field of struct stat], + ac_cv_struct_st_mtim_nsec, + [ac_save_CPPFLAGS="$CPPFLAGS" + ac_cv_struct_st_mtim_nsec=no + # st_mtim.tv_nsec -- the usual case + # st_mtim._tv_nsec -- Solaris 2.6, if + # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 + # && !defined __EXTENSIONS__) + # st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2 + # st_mtime_n -- AIX 5.2 and above + # st_mtimespec.tv_nsec -- Darwin (Mac OSX) + for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do + CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include +#include ], [struct stat s; s.ST_MTIM_NSEC;])], + [ac_cv_struct_st_mtim_nsec=$ac_val; break]) + done + CPPFLAGS="$ac_save_CPPFLAGS" +]) +if test $ac_cv_struct_st_mtim_nsec != no; then + AC_DEFINE_UNQUOTED([ST_MTIM_NSEC], [$ac_cv_struct_st_mtim_nsec], + [Define if struct stat contains a nanoseconds field]) +fi + dnl Link with iconv for charset translation, if not found without library. dnl check for iconv() requires including iconv.h dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it @@ -3837,28 +3895,28 @@ dnl has been installed. AC_MSG_CHECKING(for iconv_open()) save_LIBS="$LIBS" LIBS="$LIBS -liconv" -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_ICONV_H # include #endif - ], [iconv_open("fr", "to");], + ], [iconv_open("fr", "to");])], AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV), LIBS="$save_LIBS" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_ICONV_H # include #endif - ], [iconv_open("fr", "to");], + ], [iconv_open("fr", "to");])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV), AC_MSG_RESULT(no))) AC_MSG_CHECKING(for nl_langinfo(CODESET)) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_LANGINFO_H # include #endif -], [char *cs = nl_langinfo(CODESET);], +], [char *cs = nl_langinfo(CODESET);])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET), AC_MSG_RESULT(no)) @@ -3866,7 +3924,7 @@ dnl Need various functions for floating point support. Only enable dnl floating point when they are all present. AC_CHECK_LIB(m, strtod) AC_MSG_CHECKING([for strtod() and other floating point functions]) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_MATH_H # include #endif @@ -3885,13 +3943,13 @@ AC_TRY_LINK([ d = sin(1.11); d = cos(1.11); d = atan(1.11); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS), AC_MSG_RESULT(no)) dnl isinf() and isnan() need to include header files and may need -lm. AC_MSG_CHECKING([for isinf()]) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_MATH_H # include #endif @@ -3899,12 +3957,12 @@ AC_TRY_LINK([ # include # include #endif -], [int r = isinf(1.11); ], +], [int r = isinf(1.11); ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF), AC_MSG_RESULT(no)) AC_MSG_CHECKING([for isnan()]) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_MATH_H # include #endif @@ -3912,7 +3970,7 @@ AC_TRY_LINK([ # include # include #endif -], [int r = isnan(1.11); ], +], [int r = isnan(1.11); ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN), AC_MSG_RESULT(no)) @@ -3930,29 +3988,29 @@ if test "$enable_acl" = "yes"; then AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),) AC_MSG_CHECKING(for POSIX ACL support) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include #ifdef HAVE_SYS_ACL_H # include #endif acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS); acl_set_file("foo", ACL_TYPE_ACCESS, acl); - acl_free(acl);], + acl_free(acl);])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL), AC_MSG_RESULT(no)) AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)], AC_MSG_CHECKING(for Solaris ACL support) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #ifdef HAVE_SYS_ACL_H # include #endif], [acl("foo", GETACLCNT, 0, NULL); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL), AC_MSG_RESULT(no))) AC_MSG_CHECKING(for AIX ACL support) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #if STDC_HEADERS # include # include @@ -3971,7 +4029,7 @@ int aclsize; struct acl *aclent;], [aclsize = sizeof(struct acl); aclent = (void *)malloc(aclsize); statacl("foo", STX_NORMAL, aclent, aclsize); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL), AC_MSG_RESULT(no)) else @@ -3985,29 +4043,29 @@ if test "x$GTK_CFLAGS" != "x"; then ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" - AC_TRY_LINK( + AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include ], - [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ], + [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL), AC_MSG_RESULT(no)) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi -AC_MSG_CHECKING(--disable-gpm argument) +AC_MSG_CHECKING(--enable-gpm argument) AC_ARG_ENABLE(gpm, - [ --disable-gpm Don't use gpm (Linux mouse daemon).], , + [ --enable-gpm=OPTS Use gpm (Linux mouse daemon). default=yes OPTS=yes/no/dynamic], , [enable_gpm="yes"]) -if test "$enable_gpm" = "yes"; then - AC_MSG_RESULT(no) +if test "$enable_gpm" = "yes" -o "$enable_gpm" = "dynamic"; then + AC_MSG_RESULT($enable_gpm) dnl Checking if gpm support can be compiled AC_CACHE_CHECK([for gpm], vi_cv_have_gpm, [olibs="$LIBS" ; LIBS="-lgpm"] - AC_TRY_LINK( + AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include #include ], - [Gpm_GetLibVersion(NULL);], + [Gpm_GetLibVersion(NULL);])], dnl Configure defines HAVE_GPM, if it is defined feature.h defines dnl FEAT_MOUSE_GPM if mouse support is included [vi_cv_have_gpm=yes], @@ -4015,11 +4073,15 @@ if test "$enable_gpm" = "yes"; then [LIBS="$olibs"] ) if test $vi_cv_have_gpm = yes; then - LIBS="$LIBS -lgpm" + if test "$enable_gpm" = "yes"; then + LIBS="$LIBS -lgpm" + else + AC_DEFINE(DYNAMIC_GPM) + fi AC_DEFINE(HAVE_GPM) fi else - AC_MSG_RESULT(yes) + AC_MSG_RESULT(no) fi AC_MSG_CHECKING(--disable-sysmouse argument) @@ -4033,7 +4095,7 @@ if test "$enable_sysmouse" = "yes"; then dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h dnl defines FEAT_SYSMOUSE if mouse support is included AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse, - AC_TRY_LINK( + AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include #include #include ], @@ -4041,7 +4103,7 @@ if test "$enable_sysmouse" = "yes"; then mouse.operation = MOUSE_MODE; mouse.operation = MOUSE_SHOW; mouse.u.mode.mode = 0; - mouse.u.mode.signal = SIGUSR2;], + mouse.u.mode.signal = SIGUSR2;])], [vi_cv_have_sysmouse=yes], [vi_cv_have_sysmouse=no]) ) @@ -4054,39 +4116,55 @@ fi dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known AC_MSG_CHECKING(for FD_CLOEXEC) -AC_TRY_COMPILE( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#if HAVE_FCNTL_H # include #endif], -[ int flag = FD_CLOEXEC;], +[ int flag = FD_CLOEXEC;])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC), AC_MSG_RESULT(not usable)) dnl rename needs to be checked separately to work on Nextstep with cc AC_MSG_CHECKING(for rename) -AC_TRY_LINK([#include ], [rename("this", "that")], +AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [rename("this", "that")])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME), AC_MSG_RESULT(no)) +dnl check for dirfd() +AC_MSG_CHECKING(for dirfd) +AC_LINK_IFELSE([AC_LANG_PROGRAM( +[#include +#include ], +[DIR * dir=opendir("dirname"); dirfd(dir);])], +AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DIRFD), AC_MSG_RESULT(not usable)) + +dnl check for flock() +AC_MSG_CHECKING(for flock) +AC_LINK_IFELSE([AC_LANG_PROGRAM( +[#include ], +[flock(10, LOCK_SH);])], +AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOCK), AC_MSG_RESULT(not usable)) + dnl sysctl() may exist but not the arguments we use AC_MSG_CHECKING(for sysctl) -AC_TRY_COMPILE( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include #include ], -[ int mib[2], r; +[[ int mib[2], r; size_t len; mib[0] = CTL_HW; mib[1] = HW_USERMEM; len = sizeof(r); (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0); - ], + ]])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), AC_MSG_RESULT(not usable)) -dnl sysinfo() may exist but not be Linux compatible +dnl sysinfo() may exist but not be Linux compatible. +dnl On some FreeBSD systems it may depend on libsysinfo, try to link AC_MSG_CHECKING(for sysinfo) -AC_TRY_COMPILE( +AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include #include ], [ struct sysinfo sinfo; @@ -4094,31 +4172,54 @@ AC_TRY_COMPILE( (void)sysinfo(&sinfo); t = sinfo.totalram; - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO), AC_MSG_RESULT(not usable)) dnl struct sysinfo may have the mem_unit field or not AC_MSG_CHECKING(for sysinfo.mem_unit) -AC_TRY_COMPILE( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include #include ], [ struct sysinfo sinfo; sinfo.mem_unit = 1; - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), AC_MSG_RESULT(no)) +dnl struct sysinfo may have the uptime field or not +AC_MSG_CHECKING(for sysinfo.uptime) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[#include +#include ], +[ struct sysinfo sinfo; + long ut; + + (void)sysinfo(&sinfo); + ut = sinfo.uptime; + ])], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_UPTIME), + AC_MSG_RESULT(no)) + dnl sysconf() may exist but not support what we want to use AC_MSG_CHECKING(for sysconf) -AC_TRY_COMPILE( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include ], [ (void)sysconf(_SC_PAGESIZE); (void)sysconf(_SC_PHYS_PAGES); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF), AC_MSG_RESULT(not usable)) +dnl check if we have _SC_SIGSTKSZ via sysconf() +AC_MSG_CHECKING(for _SC_SIGSTKSZ via sysconf()) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[#include ], +[ (void)sysconf(_SC_SIGSTKSZ); + ])], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF_SIGSTKSZ), + AC_MSG_RESULT(not usable)) + AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([time_t]) @@ -4130,19 +4231,19 @@ AC_DEFINE_UNQUOTED(VIM_SIZEOF_LONG, [$ac_cv_sizeof_long]) dnl Make sure that uint32_t is really 32 bits unsigned. AC_MSG_CHECKING([uint32_t is 32 bits]) -AC_TRY_RUN([ +AC_RUN_IFELSE([AC_LANG_SOURCE([ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif -main() { +int main() { uint32_t nr1 = (uint32_t)-1; uint32_t nr2 = (uint32_t)0xffffffffUL; - if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); - exit(0); -}], + if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) return 1; + return 0; +}])], AC_MSG_RESULT(ok), AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]), AC_MSG_WARN([cannot check uint32_t when cross-compiling.])) @@ -4159,7 +4260,7 @@ dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. # include # include #endif -main() { +int main() { char buf[10]; strcpy(buf, "abcdefghi"); mch_memmove(buf, buf + 2, 3); @@ -4231,13 +4332,13 @@ if test "x$with_x" = "xyes"; then CFLAGS="$CFLAGS $X_CFLAGS" AC_MSG_CHECKING(whether X_LOCALE needed) - AC_TRY_COMPILE([#include ],, - AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ],)], + AC_LINK_IFELSE([AC_LANG_CALL([],[_Xsetlocale])], [AC_MSG_RESULT(yes) AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)), AC_MSG_RESULT(no)) AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used) - AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes) + AC_LINK_IFELSE([AC_LANG_CALL([],[Xutf8SetWMProperties])], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no)) CFLAGS=$cflags_save @@ -4256,21 +4357,21 @@ dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'. dnl -i+m to test for older Exuberant ctags AC_MSG_CHECKING(how to create tags) test -f tags && mv tags tags.save -if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then - TAGPRG="ctags -I INIT+ --fields=+S" -elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then - TAGPRG="exctags -I INIT+ --fields=+S" -elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then - TAGPRG="exuberant-ctags -I INIT+ --fields=+S" +if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1; then + TAGPRG="ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" +elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1; then + TAGPRG="exctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" +elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1; then + TAGPRG="exuberant-ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" else TAGPRG="ctags" - (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags" - (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c" - (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags" - (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t" - (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts" - (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs" - (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m" + (eval etags /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="etags" + (eval etags -c /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="etags -c" + (eval ctags /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="ctags" + (eval ctags -t /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="ctags -t" + (eval ctags -ts /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="ctags -ts" + (eval ctags -tvs /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="ctags -tvs" + (eval ctags -i+m /dev/null) < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&1 && TAGPRG="ctags -i+m" fi test -f tags.save && mv tags.save tags AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG) @@ -4278,7 +4379,7 @@ AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG) dnl Check how we can run man with a section number AC_MSG_CHECKING(how to run man with a section nr) MANDEF="man" -(eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s" +(eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AS_MESSAGE_LOG_FD && MANDEF="man -s" AC_MSG_RESULT($MANDEF) if test "$MANDEF" = "man -s"; then AC_DEFINE(USEMAN_S) @@ -4308,14 +4409,14 @@ if test "$enable_nls" = "yes"; then if test -n "$MSGFMT"; then olibs=$LIBS LIBS="" - AC_TRY_LINK( + AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include ], - [gettext("Test");], + [gettext("Test");])], AC_MSG_RESULT([gettext() works]); have_gettext="yes"; LIBS=$olibs, LIBS="-lintl" - AC_TRY_LINK( + AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include ], - [gettext("Test");], + [gettext("Test");])], AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes"; LIBS="$olibs -lintl", AC_MSG_RESULT([gettext() doesn't work]); @@ -4331,10 +4432,10 @@ if test "$enable_nls" = "yes"; then AC_CHECK_FUNCS(bind_textdomain_codeset) dnl _nl_msg_cat_cntr is required for GNU gettext AC_MSG_CHECKING([for _nl_msg_cat_cntr]) - AC_TRY_LINK( + AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include extern int _nl_msg_cat_cntr;], - [++_nl_msg_cat_cntr;], + [++_nl_msg_cat_cntr;])], AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR), AC_MSG_RESULT([no])) AC_MSG_CHECKING([if msgfmt supports --desktop]) @@ -4365,20 +4466,20 @@ AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)]) if test x${DLL} = xdlfcn.h; then AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ]) AC_MSG_CHECKING([for dlopen()]) - AC_TRY_LINK(,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ extern void* dlopen(); dlopen(); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), AC_MSG_RESULT(no); AC_MSG_CHECKING([for dlopen() in -ldl]) olibs=$LIBS LIBS="$LIBS -ldl" - AC_TRY_LINK(,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ extern void* dlopen(); dlopen(); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), AC_MSG_RESULT(no); @@ -4386,20 +4487,20 @@ if test x${DLL} = xdlfcn.h; then dnl ReliantUNIX has dlopen() in libc but everything else in libdl dnl ick :-) AC_MSG_CHECKING([for dlsym()]) - AC_TRY_LINK(,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ extern void* dlsym(); dlsym(); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), AC_MSG_RESULT(no); AC_MSG_CHECKING([for dlsym() in -ldl]) olibs=$LIBS LIBS="$LIBS -ldl" - AC_TRY_LINK(,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ extern void* dlsym(); dlsym(); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), AC_MSG_RESULT(no); @@ -4407,20 +4508,20 @@ if test x${DLL} = xdlfcn.h; then elif test x${DLL} = xdl.h; then AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ]) AC_MSG_CHECKING([for shl_load()]) - AC_TRY_LINK(,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ extern void* shl_load(); shl_load(); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), AC_MSG_RESULT(no); AC_MSG_CHECKING([for shl_load() in -ldld]) olibs=$LIBS LIBS="$LIBS -ldld" - AC_TRY_LINK(,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ extern void* shl_load(); shl_load(); - ], + ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), AC_MSG_RESULT(no); @@ -4438,10 +4539,7 @@ fi if test "$MACOS_X" = "yes"; then AC_MSG_CHECKING([whether we need macOS frameworks]) - if test "$GUITYPE" = "CARBONGUI"; then - AC_MSG_RESULT([yes, we need Carbon]) - LIBS="$LIBS -framework Carbon" - elif test "$MACOS_X_DARWIN" = "yes"; then + if test "$MACOS_X_DARWIN" = "yes"; then if test "$features" = "tiny"; then dnl Since no FEAT_CLIPBOARD, no longer need for os_macosx.m. OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` @@ -4456,8 +4554,11 @@ if test "$MACOS_X" = "yes"; then AC_MSG_RESULT([no]) fi fi -if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then - LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + +dnl On some systems REENTRANT needs to be defined. It should not hurt to use +dnl it everywhere. +if `echo "$CFLAGS" | grep -v D_REENTRANT >/dev/null`; then + CFLAGS="$CFLAGS -D_REENTRANT" fi dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to @@ -4468,7 +4569,7 @@ dnl the number before the version number. DEPEND_CFLAGS_FILTER= if test "$GCC" = yes; then AC_MSG_CHECKING(for GCC 3 or later) - gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'` + gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]][[0-9]]*\)\..*$/\1/g'` if test "$gccmajor" -gt "2"; then DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" AC_MSG_RESULT(yes) @@ -4481,7 +4582,8 @@ if test "$GCC" = yes; then dnl And undefine it first to avoid a warning. AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) if test "$gccmajor" -gt "3"; then - CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + CFLAGS=`echo "$CFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/-D_FORTIFY_SOURCE=.,//g' -e 's/ *-Wp,-D_FORTIFY_SOURCE=. / /g' -e 's/,-D_FORTIFY_SOURCE=. //g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'` AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -4503,6 +4605,10 @@ else AC_MSG_RESULT(no) fi +dnl $LDFLAGS is passed to glibtool in libvterm, it doesn't like a space +dnl between "-L" and the path that follows. +LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-L /-L/g'` + dnl link.sh tries to avoid overlinking in a hackish way. dnl At least GNU ld supports --as-needed which provides the same functionality dnl at linker level. Let's use it. @@ -4510,7 +4616,9 @@ AC_MSG_CHECKING(linker --as-needed support) LINK_AS_NEEDED= # Check if linker supports --as-needed and --no-as-needed options if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then - LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` + if ! echo "$LDFLAGS" | grep -q -- '-Wl,[[^[:space:]]]*--as-needed'; then + LDFLAGS="$LDFLAGS -Wl,--as-needed" + fi LINK_AS_NEEDED=yes fi if test "$LINK_AS_NEEDED" = yes; then @@ -4526,6 +4634,7 @@ if test "$zOSUnix" = "yes"; then fi dnl write output files -AC_OUTPUT(auto/config.mk:config.mk.in) +AC_CONFIG_FILES(auto/config.mk:config.mk.in) +AC_OUTPUT dnl vim: set sw=2 tw=78 fo+=l: diff --git a/src/create_nvcmdidxs.c b/src/create_nvcmdidxs.c new file mode 100644 index 0000000000000..1d084f5657e61 --- /dev/null +++ b/src/create_nvcmdidxs.c @@ -0,0 +1,38 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar et al. + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * create_nvcmdidxs.c: helper program for `make nvcmdidxs` + * + * This outputs the list of command characters from the nv_cmds table in + * decimal form, one per line. + */ + +#include "vim.h" + +// Declare nv_cmds[]. +#include "nv_cmds.h" + +#include + +int main(void) +{ + size_t i; + + for (i = 0; i < NV_CMDS_SIZE; i++) + { + int cmdchar = nv_cmds[i]; + + // Special keys are negative, use the negated value for sorting. + if (cmdchar < 0) + cmdchar = -cmdchar; + printf("%d\n", cmdchar); + } + return 0; +} diff --git a/src/create_nvcmdidxs.vim b/src/create_nvcmdidxs.vim new file mode 100644 index 0000000000000..13192761b367a --- /dev/null +++ b/src/create_nvcmdidxs.vim @@ -0,0 +1,60 @@ +" This script generates the table nv_cmd_idx[] which contains the index in +" nv_cmds[] table (normal.c) for each of the command character supported in +" normal/visual mode. +" This is used to speed up the command lookup in nv_cmds[]. +" +" Script should be run using "make nvcmdidxs", every time the nv_cmds[] table +" in src/nv_cmds.h changes. +" +" This is written in legacy Vim script so that it can be run by a slightly +" older Vim version. + +" Generate the table of normal/visual mode command characters and their +" corresponding index. +let cmd = 'create_nvcmdidxs' +if has('unix') + let cmd = './' .. cmd +endif +let nv_cmdtbl = systemlist(cmd)->map({i, ch -> {'idx': i, 'cmdchar': ch}}) + +" sort the table by the command character +call sort(nv_cmdtbl, {a, b -> a.cmdchar - b.cmdchar}) + +" Compute the highest index upto which the command character can be directly +" used as an index. +let nv_max_linear = 0 +for i in range(nv_cmdtbl->len()) + if i != nv_cmdtbl[i].cmdchar + let nv_max_linear = i - 1 + break + endif +endfor + +" Generate a header file with the table +let output =<< trim END + /* + * Automatically generated code by the create_nvcmdidxs.vim script. + * + * Table giving the index in nv_cmds[] to lookup based on + * the command character. + */ + + // nv_cmd_idx[] => nv_cmds[] index + static const unsigned short nv_cmd_idx[] = + { +END + +" Add each command character in comment and the corresponding index +let output += nv_cmdtbl->map({_, v -> + \ printf(' /* %5d */ %3d,', v.cmdchar, v.idx)}) + +let output += ['};', '', + \ '// The highest index for which', + \ '// nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char]'] + +let output += ['static const int nv_max_linear = ' .. nv_max_linear .. ';'] + +call writefile(output, "nv_cmdidxs.h") +quit + +" vim: shiftwidth=2 sts=2 expandtab diff --git a/src/crypt.c b/src/crypt.c index 7aea0c183d007..2a974ecafb4e2 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -30,53 +30,52 @@ */ typedef struct { - char *name; /* encryption name as used in 'cryptmethod' */ - char *magic; /* magic bytes stored in file header */ - int salt_len; /* length of salt, or 0 when not using salt */ - int seed_len; /* length of seed, or 0 when not using salt */ + char *name; // encryption name as used in 'cryptmethod' + char *magic; // magic bytes stored in file header + int salt_len; // length of salt, or 0 when not using salt + int seed_len; // length of seed, or 0 when not using seed #ifdef CRYPT_NOT_INPLACE - int works_inplace; /* encryption/decryption can be done in-place */ + int works_inplace; // encryption/decryption can be done in-place #endif - int whole_undofile; /* whole undo file is encrypted */ + int whole_undofile; // whole undo file is encrypted - /* Optional function pointer for a self-test. */ + // Optional function pointer for a self-test. int (* self_test_fn)(); // Function pointer for initializing encryption/decryption. int (* init_fn)(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); - /* Function pointers for encoding/decoding from one buffer into another. - * Optional, however, these or the _buffer ones should be configured. */ + // Function pointers for encoding/decoding from one buffer into another. + // Optional, however, these or the _buffer ones should be configured. void (*encode_fn)(cryptstate_T *state, char_u *from, size_t len, - char_u *to); + char_u *to, int last); void (*decode_fn)(cryptstate_T *state, char_u *from, size_t len, - char_u *to); + char_u *to, int last); - /* Function pointers for encoding and decoding, can buffer data if needed. - * Optional (however, these or the above should be configured). */ + // Function pointers for encoding and decoding, can buffer data if needed. + // Optional (however, these or the above should be configured). long (*encode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len, - char_u **newptr); + char_u **newptr, int last); long (*decode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len, - char_u **newptr); - - /* Function pointers for in-place encoding and decoding, used for - * crypt_*_inplace(). "from" and "to" arguments will be equal. - * These may be the same as decode_fn and encode_fn above, however an - * algorithm may implement them in a way that is not interchangeable with - * the crypt_(en|de)code() interface (for example because it wishes to add - * padding to files). - * This method is used for swap and undo files which have a rigid format. - */ + char_u **newptr, int last); + + // Function pointers for in-place encoding and decoding, used for + // crypt_*_inplace(). "from" and "to" arguments will be equal. + // These may be the same as decode_fn and encode_fn above, however an + // algorithm may implement them in a way that is not interchangeable with + // the crypt_(en|de)code() interface (for example because it wishes to add + // padding to files). + // This method is used for swap and undo files which have a rigid format. void (*encode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len, - char_u *p2); + char_u *p2, int last); void (*decode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len, - char_u *p2); + char_u *p2, int last); } cryptmethod_T; -/* index is method_nr of cryptstate_T, CRYPT_M_* */ +// index is method_nr of cryptstate_T, CRYPT_M_* static __thread cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { - /* PK_Zip; very weak */ + // PK_Zip; very weak { "zip", "VimCrypt~01!", @@ -93,7 +92,7 @@ static __thread cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { crypt_zip_encode, crypt_zip_decode, }, - /* Blowfish/CFB + SHA-256 custom key derivation; implementation issues. */ + // Blowfish/CFB + SHA-256 custom key derivation; implementation issues. { "blowfish", "VimCrypt~02!", @@ -110,7 +109,7 @@ static __thread cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { crypt_blowfish_encode, crypt_blowfish_decode, }, - /* Blowfish/CFB + SHA-256 custom key derivation; fixed. */ + // Blowfish/CFB + SHA-256 custom key derivation; fixed. { "blowfish2", "VimCrypt~03!", @@ -127,11 +126,179 @@ static __thread cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { crypt_blowfish_encode, crypt_blowfish_decode, }, - /* NOTE: when adding a new method, use some random bytes for the magic key, - * to avoid that a text file is recognized as encrypted. */ + // XChaCha20 using libsodium + { + "xchacha20", + "VimCrypt~04!", +#ifdef FEAT_SODIUM + crypto_pwhash_argon2id_SALTBYTES, // 16 +#else + 16, +#endif + 8, +#ifdef CRYPT_NOT_INPLACE + FALSE, +#endif + FALSE, + NULL, + crypt_sodium_init, + NULL, NULL, + crypt_sodium_buffer_encode, crypt_sodium_buffer_decode, + NULL, NULL, + }, + + // NOTE: when adding a new method, use some random bytes for the magic key, + // to avoid that a text file is recognized as encrypted. +}; + +#ifdef FEAT_SODIUM +typedef struct { + size_t count; + unsigned char key[crypto_box_SEEDBYTES]; + // 32, same as crypto_secretstream_xchacha20poly1305_KEYBYTES + crypto_secretstream_xchacha20poly1305_state + state; +} sodium_state_T; + + +# ifdef DYNAMIC_SODIUM +# ifdef MSWIN +# define SODIUM_PROC FARPROC +# define load_dll vimLoadLib +# define symbol_from_dll GetProcAddress +# define close_dll FreeLibrary +# define load_dll_error GetWin32Error +# else +# error Dynamic loading of libsodium is not supported for now. +//# define HINSTANCE void* +//# define SODIUM_PROC void* +//# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) +//# define symbol_from_dll dlsym +//# define close_dll dlclose +//# define load_dll_error dlerror +# endif + +# define sodium_init load_sodium +# define sodium_free dll_sodium_free +# define sodium_malloc dll_sodium_malloc +# define sodium_memzero dll_sodium_memzero +# define sodium_mlock dll_sodium_mlock +# define sodium_munlock dll_sodium_munlock +# define crypto_secretstream_xchacha20poly1305_init_push \ + dll_crypto_secretstream_xchacha20poly1305_init_push +# define crypto_secretstream_xchacha20poly1305_push \ + dll_crypto_secretstream_xchacha20poly1305_push +# define crypto_secretstream_xchacha20poly1305_init_pull \ + dll_crypto_secretstream_xchacha20poly1305_init_pull +# define crypto_secretstream_xchacha20poly1305_pull \ + dll_crypto_secretstream_xchacha20poly1305_pull +# define crypto_pwhash dll_crypto_pwhash +# define randombytes_buf dll_randombytes_buf + +static int (*dll_sodium_init)(void) = NULL; +static void (*dll_sodium_free)(void *) = NULL; +static void *(*dll_sodium_malloc)(const size_t) = NULL; +static void (*dll_sodium_memzero)(void * const, const size_t) = NULL; +static int (*dll_sodium_mlock)(void * const, const size_t) = NULL; +static int (*dll_sodium_munlock)(void * const, const size_t) = NULL; +static int (*dll_crypto_secretstream_xchacha20poly1305_init_push) + (crypto_secretstream_xchacha20poly1305_state *state, + unsigned char [], + const unsigned char []) = NULL; +static int (*dll_crypto_secretstream_xchacha20poly1305_push) + (crypto_secretstream_xchacha20poly1305_state *state, + unsigned char *c, unsigned long long *clen_p, + const unsigned char *m, unsigned long long mlen, + const unsigned char *ad, unsigned long long adlen, unsigned char tag) + = NULL; +static int (*dll_crypto_secretstream_xchacha20poly1305_init_pull) + (crypto_secretstream_xchacha20poly1305_state *state, + const unsigned char [], + const unsigned char []) = NULL; +static int (*dll_crypto_secretstream_xchacha20poly1305_pull) + (crypto_secretstream_xchacha20poly1305_state *state, + unsigned char *m, unsigned long long *mlen_p, unsigned char *tag_p, + const unsigned char *c, unsigned long long clen, + const unsigned char *ad, unsigned long long adlen) = NULL; +static int (*dll_crypto_pwhash)(unsigned char * const out, + unsigned long long outlen, + const char * const passwd, unsigned long long passwdlen, + const unsigned char * const salt, + unsigned long long opslimit, size_t memlimit, int alg) + = NULL; +static void (*dll_randombytes_buf)(void * const buf, const size_t size); + +static struct { + const char *name; + SODIUM_PROC *ptr; +} sodium_funcname_table[] = { + {"sodium_init", (SODIUM_PROC*)&dll_sodium_init}, + {"sodium_free", (SODIUM_PROC*)&dll_sodium_free}, + {"sodium_malloc", (SODIUM_PROC*)&dll_sodium_malloc}, + {"sodium_memzero", (SODIUM_PROC*)&dll_sodium_memzero}, + {"sodium_mlock", (SODIUM_PROC*)&dll_sodium_mlock}, + {"sodium_munlock", (SODIUM_PROC*)&dll_sodium_munlock}, + {"crypto_secretstream_xchacha20poly1305_init_push", (SODIUM_PROC*)&dll_crypto_secretstream_xchacha20poly1305_init_push}, + {"crypto_secretstream_xchacha20poly1305_push", (SODIUM_PROC*)&dll_crypto_secretstream_xchacha20poly1305_push}, + {"crypto_secretstream_xchacha20poly1305_init_pull", (SODIUM_PROC*)&dll_crypto_secretstream_xchacha20poly1305_init_pull}, + {"crypto_secretstream_xchacha20poly1305_pull", (SODIUM_PROC*)&dll_crypto_secretstream_xchacha20poly1305_pull}, + {"crypto_pwhash", (SODIUM_PROC*)&dll_crypto_pwhash}, + {"randombytes_buf", (SODIUM_PROC*)&dll_randombytes_buf}, + {NULL, NULL} }; -#define CRYPT_MAGIC_LEN 12 /* cannot change */ + static int +sodium_runtime_link_init(int verbose) +{ + static HINSTANCE hsodium = NULL; + const char *libname = DYNAMIC_SODIUM_DLL; + int i; + + if (hsodium != NULL) + return OK; + + hsodium = load_dll(libname); + if (hsodium == NULL) + { + if (verbose) + semsg(_(e_could_not_load_library_str_str), libname, load_dll_error()); + return FAIL; + } + + for (i = 0; sodium_funcname_table[i].ptr; ++i) + { + if ((*sodium_funcname_table[i].ptr = symbol_from_dll(hsodium, + sodium_funcname_table[i].name)) == NULL) + { + close_dll(hsodium); + hsodium = NULL; + if (verbose) + semsg(_(e_could_not_load_library_function_str), sodium_funcname_table[i].name); + return FAIL; + } + } + return OK; +} + + static int +load_sodium(void) +{ + if (sodium_runtime_link_init(TRUE) == FAIL) + return -1; + return dll_sodium_init(); +} +# endif + +# if defined(DYNAMIC_SODIUM) || defined(PROTO) + int +sodium_enabled(int verbose) +{ + return sodium_runtime_link_init(verbose) == OK; +} +# endif +#endif + +#define CRYPT_MAGIC_LEN 12 // cannot change static __thread char crypt_magic_head[] = "VimCrypt~"; /* @@ -170,7 +337,7 @@ crypt_method_nr_from_magic(char *ptr, int len) i = (int)STRLEN(crypt_magic_head); if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0) - emsg(_("E821: File is encrypted with unknown method")); + emsg(_(e_file_is_encrypted_with_unknown_method)); return -1; } @@ -206,7 +373,7 @@ crypt_whole_undofile(int method_nr) } /* - * Get crypt method specifc length of the file header in bytes. + * Get crypt method specific length of the file header in bytes. */ int crypt_get_header_len(int method_nr) @@ -216,6 +383,28 @@ crypt_get_header_len(int method_nr) + cryptmethods[method_nr].seed_len; } + +#if defined(FEAT_SODIUM) || defined(PROTO) +/* + * Get maximum crypt method specific length of the file header in bytes. + */ + int +crypt_get_max_header_len() +{ + int i; + int max = 0; + int temp = 0; + + for (i = 0; i < CRYPT_M_COUNT; ++i) + { + temp = crypt_get_header_len(i); + if (temp > max) + max = temp; + } + return max; +} +#endif + /* * Set the crypt method for buffer "buf" to "method_nr" using the int value as * returned by crypt_method_nr_from_name(). @@ -261,10 +450,10 @@ crypt_create( state->method_nr = method_nr; if (cryptmethods[method_nr].init_fn( - state, key, salt, salt_len, seed, seed_len) == FAIL) + state, key, salt, salt_len, seed, seed_len) == FAIL) { - vim_free(state); - return NULL; + vim_free(state); + return NULL; } return state; } @@ -363,12 +552,21 @@ crypt_create_for_writing( if (seed_len > 0) seed = *header + CRYPT_MAGIC_LEN + salt_len; - /* TODO: Should this be crypt method specific? (Probably not worth - * it). sha2_seed is pretty bad for large amounts of entropy, so make - * that into something which is suitable for anything. */ - sha2_seed(salt, salt_len, seed, seed_len); + // TODO: Should this be crypt method specific? (Probably not worth + // it). sha2_seed is pretty bad for large amounts of entropy, so make + // that into something which is suitable for anything. +#ifdef FEAT_SODIUM + if (sodium_init() >= 0) + { + if (salt_len > 0) + randombytes_buf(salt, salt_len); + if (seed_len > 0) + randombytes_buf(seed, seed_len); + } + else +#endif + sha2_seed(salt, salt_len, seed, seed_len); } - state = crypt_create(method_nr, key, salt, salt_len, seed, seed_len); if (state == NULL) VIM_CLEAR(*header); @@ -381,7 +579,17 @@ crypt_create_for_writing( void crypt_free_state(cryptstate_T *state) { - vim_free(state->method_state); +#ifdef FEAT_SODIUM + if (state->method_nr == CRYPT_M_SOD) + { + sodium_munlock(((sodium_state_T *)state->method_state)->key, + crypto_box_SEEDBYTES); + sodium_memzero(state->method_state, sizeof(sodium_state_T)); + sodium_free(state->method_state); + } + else +#endif + vim_free(state->method_state); vim_free(state); } @@ -396,21 +604,22 @@ crypt_encode_alloc( cryptstate_T *state, char_u *from, size_t len, - char_u **newptr) + char_u **newptr, + int last) { cryptmethod_T *method = &cryptmethods[state->method_nr]; if (method->encode_buffer_fn != NULL) - /* Has buffer function, pass through. */ - return method->encode_buffer_fn(state, from, len, newptr); + // Has buffer function, pass through. + return method->encode_buffer_fn(state, from, len, newptr, last); if (len == 0) - /* Not buffering, just return EOF. */ + // Not buffering, just return EOF. return (long)len; - *newptr = alloc(len); + *newptr = alloc(len + 50); if (*newptr == NULL) return -1; - method->encode_fn(state, from, len, *newptr); + method->encode_fn(state, from, len, *newptr, last); return (long)len; } @@ -424,22 +633,23 @@ crypt_decode_alloc( cryptstate_T *state, char_u *ptr, long len, - char_u **newptr) + char_u **newptr, + int last) { cryptmethod_T *method = &cryptmethods[state->method_nr]; if (method->decode_buffer_fn != NULL) - /* Has buffer function, pass through. */ - return method->decode_buffer_fn(state, ptr, len, newptr); + // Has buffer function, pass through. + return method->decode_buffer_fn(state, ptr, len, newptr, last); if (len == 0) - /* Not buffering, just return EOF. */ + // Not buffering, just return EOF. return len; *newptr = alloc(len); if (*newptr == NULL) return -1; - method->decode_fn(state, ptr, len, *newptr); + method->decode_fn(state, ptr, len, *newptr, last); return len; } #endif @@ -452,9 +662,10 @@ crypt_encode( cryptstate_T *state, char_u *from, size_t len, - char_u *to) + char_u *to, + int last) { - cryptmethods[state->method_nr].encode_fn(state, from, len, to); + cryptmethods[state->method_nr].encode_fn(state, from, len, to, last); } #if 0 // unused @@ -466,9 +677,10 @@ crypt_decode( cryptstate_T *state, char_u *from, size_t len, - char_u *to) + char_u *to, + int last) { - cryptmethods[state->method_nr].decode_fn(state, from, len, to); + cryptmethods[state->method_nr].decode_fn(state, from, len, to, last); } #endif @@ -479,9 +691,11 @@ crypt_decode( crypt_encode_inplace( cryptstate_T *state, char_u *buf, - size_t len) + size_t len, + int last) { - cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf); + cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, + buf, last); } /* @@ -491,9 +705,11 @@ crypt_encode_inplace( crypt_decode_inplace( cryptstate_T *state, char_u *buf, - size_t len) + size_t len, + int last) { - cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf); + cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, + buf, last); } /* @@ -526,6 +742,23 @@ crypt_check_method(int method) } } +#ifdef FEAT_SODIUM + static void +crypt_check_swapfile_curbuf(void) +{ + int method = crypt_get_method_nr(curbuf); + if (method == CRYPT_M_SOD) + { + // encryption uses padding and MAC, that does not work very well with + // swap and undo files, so disable them + mf_close_file(curbuf, TRUE); // remove the swap file + set_option_value_give_err((char_u *)"swf", 0, NULL, OPT_LOCAL); + msg_scroll = TRUE; + msg(_("Note: Encryption of swapfile not supported, disabling swap file")); + } +} +#endif + void crypt_check_current_method(void) { @@ -542,7 +775,7 @@ crypt_check_current_method(void) char_u * crypt_get_key( int store, - int twice) /* Ask for the key twice. */ + int twice) // Ask for the key twice. { char_u *p1, *p2 = NULL; int round; @@ -568,26 +801,32 @@ crypt_get_key( crypt_free_key(p1); crypt_free_key(p2); p2 = NULL; - round = -1; /* do it again */ + round = -1; // do it again continue; } if (store) { - set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL); + set_option_value_give_err((char_u *)"key", 0L, p1, OPT_LOCAL); crypt_free_key(p1); p1 = curbuf->b_p_key; +#ifdef FEAT_SODIUM + crypt_check_swapfile_curbuf(); +#endif } break; } p2 = p1; } - /* since the user typed this, no need to wait for return */ - if (msg_didout) - msg_putchar('\n'); - need_wait_return = FALSE; - msg_didout = FALSE; + // since the user typed this, no need to wait for return + if (crypt_get_method_nr(curbuf) != CRYPT_M_SOD) + { + if (msg_didout) + msg_putchar('\n'); + need_wait_return = FALSE; + msg_didout = FALSE; + } crypt_free_key(p2); return p1; @@ -611,4 +850,295 @@ crypt_append_msg( } } -#endif /* FEAT_CRYPT */ + int +crypt_sodium_init( + cryptstate_T *state UNUSED, + char_u *key UNUSED, + char_u *salt UNUSED, + int salt_len UNUSED, + char_u *seed UNUSED, + int seed_len UNUSED) +{ +# ifdef FEAT_SODIUM + // crypto_box_SEEDBYTES == crypto_secretstream_xchacha20poly1305_KEYBYTES + unsigned char dkey[crypto_box_SEEDBYTES]; // 32 + sodium_state_T *sd_state; + int retval = 0; + + if (sodium_init() < 0) + return FAIL; + + sd_state = (sodium_state_T *)sodium_malloc(sizeof(sodium_state_T)); + sodium_memzero(sd_state, sizeof(sodium_state_T)); + + // derive a key from the password + if (crypto_pwhash(dkey, sizeof(dkey), (const char *)key, STRLEN(key), salt, + crypto_pwhash_OPSLIMIT_INTERACTIVE, crypto_pwhash_MEMLIMIT_INTERACTIVE, + crypto_pwhash_ALG_DEFAULT) != 0) + { + // out of memory + sodium_free(sd_state); + return FAIL; + } + memcpy(sd_state->key, dkey, crypto_box_SEEDBYTES); + + retval += sodium_mlock(sd_state->key, crypto_box_SEEDBYTES); + retval += sodium_mlock(key, STRLEN(key)); + + if (retval < 0) + { + emsg(_(e_encryption_sodium_mlock_failed)); + sodium_free(sd_state); + return FAIL; + } + sd_state->count = 0; + state->method_state = sd_state; + + return OK; +# else + emsg(e_libsodium_not_built_in); + return FAIL; +# endif +} + +/* + * Encrypt "from[len]" into "to[len]". + * "from" and "to" can be equal to encrypt in place. + * Call needs to ensure that there is enough space in to (for the header) + */ +#if 0 // Currently unused + void +crypt_sodium_encode( + cryptstate_T *state UNUSED, + char_u *from UNUSED, + size_t len UNUSED, + char_u *to UNUSED, + int last UNUSED) +{ +# ifdef FEAT_SODIUM + // crypto_box_SEEDBYTES == crypto_secretstream_xchacha20poly1305_KEYBYTES + sodium_state_T *sod_st = state->method_state; + unsigned char tag = last + ? crypto_secretstream_xchacha20poly1305_TAG_FINAL : 0; + + if (sod_st->count == 0) + { + if (len <= crypto_secretstream_xchacha20poly1305_HEADERBYTES) + { + emsg(e_libsodium_cannot_encrypt_header); + return; + } + crypto_secretstream_xchacha20poly1305_init_push(&sod_st->state, + to, sod_st->key); + to += crypto_secretstream_xchacha20poly1305_HEADERBYTES; + } + + if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) + { + emsg(e_libsodium_cannot_encrypt_buffer); + return; + } + + crypto_secretstream_xchacha20poly1305_push(&sod_st->state, to, NULL, + from, len, NULL, 0, tag); + + sod_st->count++; +# endif +} +#endif + +/* + * Decrypt "from[len]" into "to[len]". + * "from" and "to" can be equal to encrypt in place. + */ +#if 0 // Currently unused + void +crypt_sodium_decode( + cryptstate_T *state UNUSED, + char_u *from UNUSED, + size_t len UNUSED, + char_u *to UNUSED, + int last UNUSED) +{ +# ifdef FEAT_SODIUM + // crypto_box_SEEDBYTES == crypto_secretstream_xchacha20poly1305_KEYBYTES + sodium_state_T *sod_st = state->method_state; + unsigned char tag; + unsigned long long buf_len; + char_u *p1 = from; + char_u *p2 = to; + char_u *buf_out; + + if (sod_st->count == 0 + && len <= crypto_secretstream_xchacha20poly1305_HEADERBYTES) + { + emsg(e_libsodium_cannot_decrypt_header); + return; + } + + buf_out = (char_u *)alloc(len); + + if (buf_out == NULL) + { + emsg(e_libsodium_cannot_allocate_buffer); + return; + } + if (sod_st->count == 0) + { + if (crypto_secretstream_xchacha20poly1305_init_pull( + &sod_st->state, from, sod_st->key) != 0) + { + emsg(e_libsodium_decryption_failed_header_incomplete); + goto fail; + } + + from += crypto_secretstream_xchacha20poly1305_HEADERBYTES; + len -= crypto_secretstream_xchacha20poly1305_HEADERBYTES; + + if (p1 == p2) + to += crypto_secretstream_xchacha20poly1305_HEADERBYTES; + } + + if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) + { + emsg(e_libsodium_cannot_decrypt_buffer); + goto fail; + } + if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, + buf_out, &buf_len, &tag, from, len, NULL, 0) != 0) + { + emsg(e_libsodium_decryption_failed); + goto fail; + } + sod_st->count++; + + if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) + { + emsg(e_libsodium_decryption_failed_premature); + goto fail; + } + if (p1 == p2) + mch_memmove(p2, buf_out, buf_len); + +fail: + vim_free(buf_out); +# endif +} +#endif + +/* + * Encrypt "from[len]" into "to[len]". + * "from" and "to" can be equal to encrypt in place. + */ + long +crypt_sodium_buffer_encode( + cryptstate_T *state UNUSED, + char_u *from UNUSED, + size_t len UNUSED, + char_u **buf_out UNUSED, + int last UNUSED) +{ +# ifdef FEAT_SODIUM + // crypto_box_SEEDBYTES == crypto_secretstream_xchacha20poly1305_KEYBYTES + unsigned long long out_len; + char_u *ptr; + unsigned char tag = last + ? crypto_secretstream_xchacha20poly1305_TAG_FINAL : 0; + int length; + sodium_state_T *sod_st = state->method_state; + int first = (sod_st->count == 0); + + length = (int)len + crypto_secretstream_xchacha20poly1305_ABYTES + + (first ? crypto_secretstream_xchacha20poly1305_HEADERBYTES : 0); + *buf_out = alloc_clear(length); + if (*buf_out == NULL) + { + emsg(e_libsodium_cannot_allocate_buffer); + return -1; + } + ptr = *buf_out; + + if (first) + { + crypto_secretstream_xchacha20poly1305_init_push(&sod_st->state, + ptr, sod_st->key); + ptr += crypto_secretstream_xchacha20poly1305_HEADERBYTES; + } + + crypto_secretstream_xchacha20poly1305_push(&sod_st->state, ptr, + &out_len, from, len, NULL, 0, tag); + + sod_st->count++; + return out_len + (first + ? crypto_secretstream_xchacha20poly1305_HEADERBYTES : 0); +# else + return -1; +# endif +} + +/* + * Decrypt "from[len]" into "to[len]". + * "from" and "to" can be equal to encrypt in place. + */ + long +crypt_sodium_buffer_decode( + cryptstate_T *state UNUSED, + char_u *from UNUSED, + size_t len UNUSED, + char_u **buf_out UNUSED, + int last UNUSED) +{ +# ifdef FEAT_SODIUM + // crypto_box_SEEDBYTES == crypto_secretstream_xchacha20poly1305_KEYBYTES + sodium_state_T *sod_st = state->method_state; + unsigned char tag; + unsigned long long out_len; + *buf_out = alloc_clear(len); + if (*buf_out == NULL) + { + emsg(e_libsodium_cannot_allocate_buffer); + return -1; + } + + if (sod_st->count == 0) + { + if (crypto_secretstream_xchacha20poly1305_init_pull(&sod_st->state, + from, sod_st->key) != 0) + { + emsg(e_libsodium_decryption_failed_header_incomplete); + return -1; + } + from += crypto_secretstream_xchacha20poly1305_HEADERBYTES; + len -= crypto_secretstream_xchacha20poly1305_HEADERBYTES; + sod_st->count++; + } + if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, + *buf_out, &out_len, &tag, from, len, NULL, 0) != 0) + { + emsg(e_libsodium_decryption_failed); + return -1; + } + + if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) + emsg(e_libsodium_decryption_failed_premature); + return (long) out_len; +# else + return -1; +# endif +} + +# if defined(FEAT_SODIUM) || defined(PROTO) + int +crypt_sodium_munlock(void *const addr, const size_t len) +{ + return sodium_munlock(addr, len); +} + + void +crypt_sodium_randombytes_buf(void *const buf, const size_t size) +{ + randombytes_buf(buf, size); +} +# endif + +#endif // FEAT_CRYPT diff --git a/src/crypt_zip.c b/src/crypt_zip.c index f0740a089ed0d..23f81cc7fd1b1 100644 --- a/src/crypt_zip.c +++ b/src/crypt_zip.c @@ -23,10 +23,10 @@ * problem since this code was originally created in Europe and India. */ -/* Need a type that should be 32 bits. 64 also works but wastes space. */ -typedef unsigned int u32_T; /* int is at least 32 bits */ +// Need a type that should be 32 bits. 64 also works but wastes space. +typedef unsigned int u32_T; // int is at least 32 bits -/* The state of encryption, referenced by cryptstate_T. */ +// The state of encryption, referenced by cryptstate_T. typedef struct { u32_T keys[3]; } zip_state_T; @@ -122,7 +122,8 @@ crypt_zip_encode( cryptstate_T *state, char_u *from, size_t len, - char_u *to) + char_u *to, + int last UNUSED) { zip_state_T *zs = state->method_state; size_t i; @@ -145,7 +146,8 @@ crypt_zip_decode( cryptstate_T *state, char_u *from, size_t len, - char_u *to) + char_u *to, + int last UNUSED) { zip_state_T *zs = state->method_state; size_t i; @@ -159,4 +161,4 @@ crypt_zip_decode( } } -#endif /* FEAT_CRYPT */ +#endif // FEAT_CRYPT diff --git a/src/debugger.c b/src/debugger.c index 684f4dea8feba..ddd9ba39184bc 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -22,7 +22,7 @@ static void do_showbacktrace(char_u *cmd); static __thread char_u *debug_oldval = NULL; // old and newval for debug expressions static __thread char_u *debug_newval = NULL; -static __thread int debug_expr = 0; // use debug_expr +static __thread int debug_expr = 0; // use debug_expr int has_watchexpr(void) @@ -54,6 +54,7 @@ do_debug(char_u *cmd) int n; char_u *cmdline = NULL; char_u *p; + char_u *sname; char *tail = NULL; #if !TARGET_OS_IPHONE static int last_cmd = 0; @@ -92,7 +93,7 @@ do_debug(char_u *cmd) emsg_silent = FALSE; // display error messages redir_off = TRUE; // don't redirect debug commands - State = NORMAL; + State = MODE_NORMAL; debug_mode = TRUE; if (!debug_did_msg) @@ -109,10 +110,12 @@ do_debug(char_u *cmd) vim_free(debug_newval); debug_newval = NULL; } - if (sourcing_name != NULL) - msg((char *)sourcing_name); - if (sourcing_lnum != 0) - smsg(_("line %ld: %s"), (long)sourcing_lnum, cmd); + sname = estack_sfile(ESTACK_NONE); + if (sname != NULL) + msg((char *)sname); + vim_free(sname); + if (SOURCING_LNUM != 0) + smsg(_("line %ld: %s"), SOURCING_LNUM, cmd); else smsg(_("cmd: %s"), cmd); @@ -142,7 +145,7 @@ do_debug(char_u *cmd) if (typeahead_saved) { - restore_typeahead(&typeaheadbuf); + restore_typeahead(&typeaheadbuf, TRUE); ignore_script = save_ignore_script; } ex_normal_busy = save_ex_normal_busy; @@ -220,7 +223,7 @@ do_debug(char_u *cmd) if (last_cmd != 0) { - // Execute debug command: decided where to break next and + // Execute debug command: decide where to break next and // return. switch (last_cmd) { @@ -305,14 +308,14 @@ do_debug(char_u *cmd) } static int -get_maxbacktrace_level(void) +get_maxbacktrace_level(char_u *sname) { char *p, *q; int maxbacktrace = 0; - if (sourcing_name != NULL) + if (sname != NULL) { - p = (char *)sourcing_name; + p = (char *)sname; while ((q = strstr(p, "..")) != NULL) { p = q + 2; @@ -346,27 +349,32 @@ do_checkbacktracelevel(void) } else { - int max = get_maxbacktrace_level(); + char_u *sname = estack_sfile(ESTACK_NONE); + int max = get_maxbacktrace_level(sname); if (debug_backtrace_level > max) { debug_backtrace_level = max; smsg(_("frame at highest level: %d"), max); } + vim_free(sname); } } static void do_showbacktrace(char_u *cmd) { + char_u *sname; char *cur; char *next; int i = 0; - int max = get_maxbacktrace_level(); + int max; - if (sourcing_name != NULL) + sname = estack_sfile(ESTACK_NONE); + max = get_maxbacktrace_level(sname); + if (sname != NULL) { - cur = (char *)sourcing_name; + cur = (char *)sname; while (!got_int) { next = strstr(cur, ".."); @@ -382,9 +390,11 @@ do_showbacktrace(char_u *cmd) *next = '.'; cur = next + 2; } + vim_free(sname); } - if (sourcing_lnum != 0) - smsg(_("line %ld: %s"), (long)sourcing_lnum, cmd); + + if (SOURCING_LNUM != 0) + smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd); else smsg(_("cmd: %s"), cmd); } @@ -435,7 +445,7 @@ dbg_check_breakpoint(exarg_T *eap) // replace K_SNR with "" if (debug_breakpoint_name[0] == K_SPECIAL && debug_breakpoint_name[1] == KS_EXTRA - && debug_breakpoint_name[2] == (int)KE_SNR) + && debug_breakpoint_name[2] == KE_SNR) p = (char_u *)""; else p = (char_u *)""; @@ -513,6 +523,7 @@ static __thread garray_T dbg_breakp = {0, 0, sizeof(struct debuggy), 4, NULL}; #define BREAKP(idx) (((struct debuggy *)dbg_breakp.ga_data)[idx]) #define DEBUGGY(gap, idx) (((struct debuggy *)gap->ga_data)[idx]) static __thread int last_breakp = 0; // nr of last defined breakpoint +static __thread int has_expr_breakpoint = FALSE; #ifdef FEAT_PROFILE // Profiling uses file and func names similar to breakpoints. @@ -524,6 +535,23 @@ static __thread garray_T prof_ga = {0, 0, sizeof(struct debuggy), 4, NULL}; static linenr_T debuggy_find(int file,char_u *fname, linenr_T after, garray_T *gap, int *fp); +/* + * Evaluate the "bp->dbg_name" expression and return the result. + * Disables error messages. + */ + static typval_T * +eval_expr_no_emsg(struct debuggy *bp) +{ + typval_T *tv; + + // Disable error messages, a bad expression would make Vim unusable. + ++emsg_off; + tv = eval_expr(bp->dbg_name, NULL); + --emsg_off; + + return tv; +} + /* * Parse the arguments of ":profile", ":breakadd" or ":breakdel" and put them * in the entry just after the last one in dbg_breakp. Note that "dbg_name" @@ -557,7 +585,7 @@ dbg_parsearg( { if (curbuf->b_ffname == NULL) { - emsg(_(e_noname)); + emsg(_(e_no_file_name)); return FAIL; } bp->dbg_type = DBG_FILE; @@ -571,7 +599,7 @@ dbg_parsearg( bp->dbg_type = DBG_EXPR; else { - semsg(_(e_invarg2), p); + semsg(_(e_invalid_argument_str), p); return FAIL; } p = skipwhite(p + 4); @@ -596,19 +624,19 @@ dbg_parsearg( || (here && *p != NUL) || (bp->dbg_type == DBG_FUNC && strstr((char *)p, "()") != NULL)) { - semsg(_(e_invarg2), arg); + semsg(_(e_invalid_argument_str), arg); return FAIL; } if (bp->dbg_type == DBG_FUNC) - bp->dbg_name = vim_strsave(p); + bp->dbg_name = vim_strsave(STRNCMP(p, "g:", 2) == 0 ? p + 2 : p); else if (here) bp->dbg_name = vim_strsave(curbuf->b_ffname); else if (bp->dbg_type == DBG_EXPR) { bp->dbg_name = vim_strsave(p); if (bp->dbg_name != NULL) - bp->dbg_val = eval_expr(bp->dbg_name, NULL); + bp->dbg_val = eval_expr_no_emsg(bp); } else { @@ -686,6 +714,8 @@ ex_breakadd(exarg_T *eap) // DBG_EXPR DEBUGGY(gap, gap->ga_len++).dbg_nr = ++last_breakp; ++debug_tick; + if (gap == &dbg_breakp) + has_expr_breakpoint = TRUE; } } } @@ -702,6 +732,29 @@ ex_debuggreedy(exarg_T *eap) debug_greedy = FALSE; } + static void +update_has_expr_breakpoint() +{ + int i; + + has_expr_breakpoint = FALSE; + for (i = 0; i < dbg_breakp.ga_len; ++i) + if (BREAKP(i).dbg_type == DBG_EXPR) + { + has_expr_breakpoint = TRUE; + break; + } +} + +/* + * Return TRUE if there is any expression breakpoint. + */ + int +debug_has_expr_breakpoint() +{ + return has_expr_breakpoint; +} + /* * ":breakdel" and ":profdel". */ @@ -767,7 +820,7 @@ ex_breakdel(exarg_T *eap) } if (todel < 0) - semsg(_("E161: Breakpoint not found: %s"), eap->arg); + semsg(_(e_breakpoint_not_found_str), eap->arg); else { while (gap->ga_len > 0) @@ -794,6 +847,8 @@ ex_breakdel(exarg_T *eap) // If all breakpoints were removed clear the array. if (gap->ga_len == 0) ga_clear(gap); + if (gap == &dbg_breakp) + update_has_expr_breakpoint(); } } @@ -859,7 +914,7 @@ has_profiling( */ static linenr_T debuggy_find( - int file, // TRUE for a file, FALSE for a function + int is_file, // TRUE for a file, FALSE for a function char_u *fname, // file or function name linenr_T after, // after this line number garray_T *gap, // either &dbg_breakp or &prof_ga @@ -868,20 +923,25 @@ debuggy_find( struct debuggy *bp; int i; linenr_T lnum = 0; - char_u *name = fname; + char_u *name = NULL; + char_u *short_name = fname; int prev_got_int; // Return quickly when there are no breakpoints. if (gap->ga_len == 0) return (linenr_T)0; - // Replace K_SNR in function name with "". - if (!file && fname[0] == K_SPECIAL) + // For a script-local function remove the prefix, so that + // "profile func Func" matches "Func" in any script. Otherwise it's very + // difficult to profile/debug a script-local function. It may match a + // function in the wrong script, but that is much better than not being + // able to profile/debug a function in a script with unknown ID. + // Also match a script-specific name. + if (!is_file && fname[0] == K_SPECIAL) { + short_name = vim_strchr(fname, '_') + 1; name = alloc(STRLEN(fname) + 3); - if (name == NULL) - name = fname; - else + if (name != NULL) { STRCPY(name, ""); STRCPY(name + 5, fname + 3); @@ -893,8 +953,8 @@ debuggy_find( // Skip entries that are not useful or are for a line that is beyond // an already found breakpoint. bp = &DEBUGGY(gap, i); - if (((bp->dbg_type == DBG_FILE) == file && - bp->dbg_type != DBG_EXPR && ( + if (((bp->dbg_type == DBG_FILE) == is_file + && bp->dbg_type != DBG_EXPR && ( #ifdef FEAT_PROFILE gap == &prof_ga || #endif @@ -905,7 +965,10 @@ debuggy_find( // while matching should abort it. prev_got_int = got_int; got_int = FALSE; - if (vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0)) + if ((name != NULL + && vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0)) + || vim_regexec_prog(&bp->dbg_prog, FALSE, + short_name, (colnr_T)0)) { lnum = bp->dbg_lnum; if (fp != NULL) @@ -919,33 +982,34 @@ debuggy_find( typval_T *tv; int line = FALSE; - prev_got_int = got_int; - got_int = FALSE; - - tv = eval_expr(bp->dbg_name, NULL); + tv = eval_expr_no_emsg(bp); if (tv != NULL) { if (bp->dbg_val == NULL) { - debug_oldval = typval_tostring(NULL); + debug_oldval = typval_tostring(NULL, TRUE); bp->dbg_val = tv; - debug_newval = typval_tostring(bp->dbg_val); + debug_newval = typval_tostring(bp->dbg_val, TRUE); line = TRUE; } else { - if (typval_compare(tv, bp->dbg_val, TYPE_EQUAL, - TRUE, FALSE) == OK + // Use "==" instead of "is" for strings, that is what we + // always have done. + exprtype_T type = tv->v_type == VAR_STRING + ? EXPR_EQUAL : EXPR_IS; + + if (typval_compare(tv, bp->dbg_val, type, FALSE) == OK && tv->vval.v_number == FALSE) { typval_T *v; line = TRUE; - debug_oldval = typval_tostring(bp->dbg_val); + debug_oldval = typval_tostring(bp->dbg_val, TRUE); // Need to evaluate again, typval_compare() overwrites // "tv". - v = eval_expr(bp->dbg_name, NULL); - debug_newval = typval_tostring(v); + v = eval_expr_no_emsg(bp); + debug_newval = typval_tostring(v, TRUE); free_tv(bp->dbg_val); bp->dbg_val = v; } @@ -954,8 +1018,8 @@ debuggy_find( } else if (bp->dbg_val != NULL) { - debug_oldval = typval_tostring(bp->dbg_val); - debug_newval = typval_tostring(NULL); + debug_oldval = typval_tostring(bp->dbg_val, TRUE); + debug_newval = typval_tostring(NULL, TRUE); free_tv(bp->dbg_val); bp->dbg_val = NULL; line = TRUE; @@ -966,8 +1030,6 @@ debuggy_find( lnum = after > 0 ? after : 1; break; } - - got_int |= prev_got_int; } #endif } diff --git a/src/dehqx.py b/src/dehqx.py deleted file mode 100644 index 00e8f9f34032d..0000000000000 --- a/src/dehqx.py +++ /dev/null @@ -1,45 +0,0 @@ -# Python script to get both the data and resource fork from a BinHex encoded -# file. -# Author: MURAOKA Taro -# Last Change: 2018 Mar 27 -# -# Copyright (C) 2003,12 MURAOKA Taro -# THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. - -import sys -import binhex - -input = sys.argv[1] -conv = binhex.HexBin(input) -info = conv.FInfo -out = conv.FName -out_data = out -out_rsrc = out + '.rsrcfork' - -# This uses the print statement on Python 2, print function on Python 3. -#print('out_rsrc=' + out_rsrc) -print('In file: ' + input) - -outfile = open(out_data, 'wb') -print(' Out data fork: ' + out_data) -while 1: - d = conv.read(128000) - if not d: break - outfile.write(d) -outfile.close() -conv.close_data() - -d = conv.read_rsrc(128000) -if d: - print(' Out rsrc fork: ' + out_rsrc) - outfile = open(out_rsrc, 'wb') - outfile.write(d) - while 1: - d = conv.read_rsrc(128000) - if not d: break - outfile.write(d) - outfile.close() - -conv.close() - -# vim:set ts=8 sts=4 sw=4 et: diff --git a/src/dict.c b/src/dict.c index 6cacc4f88349f..ba18cef94f8bb 100644 --- a/src/dict.c +++ b/src/dict.c @@ -15,13 +15,14 @@ #if defined(FEAT_EVAL) || defined(PROTO) -/* List head for garbage collection. Although there can be a reference loop - * from partial to dict to partial, we don't need to keep track of the partial, - * since it will get freed when the dict is unused and gets freed. */ -static __thread dict_T *first_dict = NULL; /* list of all dicts */ +// List head for garbage collection. Although there can be a reference loop +// from partial to dict to partial, we don't need to keep track of the partial, +// since it will get freed when the dict is unused and gets freed. +static __thread dict_T *first_dict = NULL; /* * Allocate an empty header for a dictionary. + * Caller should take care of the reference count. */ dict_T * dict_alloc(void) @@ -31,7 +32,7 @@ dict_alloc(void) d = ALLOC_CLEAR_ONE(dict_T); if (d != NULL) { - /* Add the dict to the list of dicts for garbage collection. */ + // Add the dict to the list of dicts for garbage collection. if (first_dict != NULL) first_dict->dv_used_prev = d; d->dv_used_next = first_dict; @@ -104,35 +105,47 @@ rettv_dict_set(typval_T *rettv, dict_T *d) */ void dict_free_contents(dict_T *d) +{ + hashtab_free_contents(&d->dv_hashtab); + free_type(d->dv_type); + d->dv_type = NULL; +} + +/* + * Clear hashtab "ht" and dict items it contains. + * If "ht" is not freed then you should call hash_init() next! + */ + void +hashtab_free_contents(hashtab_T *ht) { int todo; hashitem_T *hi; dictitem_T *di; - /* Lock the hashtab, we don't want it to resize while freeing items. */ - hash_lock(&d->dv_hashtab); - todo = (int)d->dv_hashtab.ht_used; - for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) + // Lock the hashtab, we don't want it to resize while freeing items. + hash_lock(ht); + todo = (int)ht->ht_used; + for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { - /* Remove the item before deleting it, just in case there is - * something recursive causing trouble. */ + // Remove the item before deleting it, just in case there is + // something recursive causing trouble. di = HI2DI(hi); - hash_remove(&d->dv_hashtab, hi); + hash_remove(ht, hi); dictitem_free(di); --todo; } } - /* The hashtab is still locked, it has to be re-initialized anyway */ - hash_clear(&d->dv_hashtab); + // The hashtab is still locked, it has to be re-initialized anyway. + hash_clear(ht); } static void dict_free_dict(dict_T *d) { - /* Remove the dict from the list of dicts for garbage collection. */ + // Remove the dict from the list of dicts for garbage collection. if (d->dv_used_prev == NULL) first_dict = d->dv_used_next; else @@ -176,9 +189,9 @@ dict_free_nonref(int copyID) for (dd = first_dict; dd != NULL; dd = dd->dv_used_next) if ((dd->dv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) { - /* Free the Dictionary and ordinary items it contains, but don't - * recurse into Lists and Dictionaries, they will be in the list - * of dicts or list of lists. */ + // Free the Dictionary and ordinary items it contains, but don't + // recurse into Lists and Dictionaries, they will be in the list + // of dicts or list of lists. dict_free_contents(dd); did_free = TRUE; } @@ -209,13 +222,15 @@ dict_free_items(int copyID) dictitem_alloc(char_u *key) { dictitem_T *di; + size_t len = STRLEN(key); - di = alloc(offsetof(dictitem_T, di_key) + STRLEN(key) + 1); + di = alloc(offsetof(dictitem_T, di_key) + len + 1); if (di != NULL) { - STRCPY(di->di_key, key); + mch_memmove(di->di_key, key, len + 1); di->di_flags = DI_FLAGS_ALLOC; di->di_tv.v_lock = 0; + di->di_tv.v_type = VAR_UNKNOWN; } return di; } @@ -227,11 +242,12 @@ dictitem_alloc(char_u *key) dictitem_copy(dictitem_T *org) { dictitem_T *di; + size_t len = STRLEN(org->di_key); - di = alloc(offsetof(dictitem_T, di_key) + STRLEN(org->di_key) + 1); + di = alloc(offsetof(dictitem_T, di_key) + len + 1); if (di != NULL) { - STRCPY(di->di_key, org->di_key); + mch_memmove(di->di_key, org->di_key, len + 1); di->di_flags = DI_FLAGS_ALLOC; copy_tv(&org->di_tv, &di->di_tv); } @@ -268,11 +284,11 @@ dictitem_free(dictitem_T *item) /* * Make a copy of dict "d". Shallow if "deep" is FALSE. * The refcount of the new dict is set to 1. - * See item_copy() for "copyID". + * See item_copy() for "top" and "copyID". * Returns NULL when out of memory. */ dict_T * -dict_copy(dict_T *orig, int deep, int copyID) +dict_copy(dict_T *orig, int deep, int top, int copyID) { dict_T *copy; dictitem_T *di; @@ -290,6 +306,11 @@ dict_copy(dict_T *orig, int deep, int copyID) orig->dv_copyID = copyID; orig->dv_copydict = copy; } + if (orig->dv_type == NULL || top || deep) + copy->dv_type = NULL; + else + copy->dv_type = alloc_type(orig->dv_type); + todo = (int)orig->dv_hashtab.ht_used; for (hi = orig->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi) { @@ -302,8 +323,8 @@ dict_copy(dict_T *orig, int deep, int copyID) break; if (deep) { - if (item_copy(&HI2DI(hi)->di_tv, &di->di_tv, deep, - copyID) == FAIL) + if (item_copy(&HI2DI(hi)->di_tv, &di->di_tv, + deep, FALSE, copyID) == FAIL) { vim_free(di); break; @@ -330,6 +351,21 @@ dict_copy(dict_T *orig, int deep, int copyID) return copy; } +/* + * Check for adding a function to g: or s:. + * If the name is wrong give an error message and return TRUE. + */ + int +dict_wrong_func_name(dict_T *d, typval_T *tv, char_u *name) +{ + return (d == get_globvar_dict() + || (in_vim9script() && SCRIPT_ID_VALID(current_sctx.sc_sid) + && d == &SCRIPT_ITEM(current_sctx.sc_sid)->sn_vars->sv_dict) + || &d->dv_hashtab == get_funccal_local_ht()) + && (tv->v_type == VAR_FUNC || tv->v_type == VAR_PARTIAL) + && var_wrong_func_name(name, TRUE); +} + /* * Add item "item" to Dictionary "d". * Returns FAIL when out of memory and when key already exists. @@ -337,6 +373,8 @@ dict_copy(dict_T *orig, int deep, int copyID) int dict_add(dict_T *d, dictitem_T *item) { + if (dict_wrong_func_name(d, &item->di_tv, item->di_key)) + return FAIL; return hash_add(&d->dv_hashtab, item->di_key); } @@ -345,14 +383,14 @@ dict_add(dict_T *d, dictitem_T *item) * Returns FAIL when out of memory and when key already exists. */ static int -dict_add_number_special(dict_T *d, char *key, varnumber_T nr, int special) +dict_add_number_special(dict_T *d, char *key, varnumber_T nr, vartype_T vartype) { dictitem_T *item; item = dictitem_alloc((char_u *)key); if (item == NULL) return FAIL; - item->di_tv.v_type = special ? VAR_SPECIAL : VAR_NUMBER; + item->di_tv.v_type = vartype; item->di_tv.vval.v_number = nr; if (dict_add(d, item) == FAIL) { @@ -369,7 +407,7 @@ dict_add_number_special(dict_T *d, char *key, varnumber_T nr, int special) int dict_add_number(dict_T *d, char *key, varnumber_T nr) { - return dict_add_number_special(d, key, nr, FALSE); + return dict_add_number_special(d, key, nr, VAR_NUMBER); } /* @@ -377,9 +415,9 @@ dict_add_number(dict_T *d, char *key, varnumber_T nr) * Returns FAIL when out of memory and when key already exists. */ int -dict_add_special(dict_T *d, char *key, varnumber_T nr) +dict_add_bool(dict_T *d, char *key, varnumber_T nr) { - return dict_add_number_special(d, key, nr, TRUE); + return dict_add_number_special(d, key, nr, VAR_BOOL); } /* @@ -447,6 +485,27 @@ dict_add_list(dict_T *d, char *key, list_T *list) return OK; } +/* + * Add a typval_T entry to dictionary "d". + * Returns FAIL when out of memory and when key already exists. + */ + int +dict_add_tv(dict_T *d, char *key, typval_T *tv) +{ + dictitem_T *item; + + item = dictitem_alloc((char_u *)key); + if (item == NULL) + return FAIL; + copy_tv(tv, &item->di_tv); + if (dict_add(d, item) == FAIL) + { + dictitem_free(item); + return FAIL; + } + return OK; +} + /* * Add a callback to dictionary "d". * Returns FAIL when out of memory and when key already exists. @@ -577,7 +636,7 @@ dict_find(dict_T *d, char_u *key, int len) } else { - /* Avoid a malloc/free by using buf[]. */ + // Avoid a malloc/free by using buf[]. vim_strncpy(buf, key, len); akey = buf; } @@ -589,6 +648,31 @@ dict_find(dict_T *d, char_u *key, int len) return HI2DI(hi); } +/* + * Returns TRUE if "key" is present in Dictionary "d". + */ + int +dict_has_key(dict_T *d, char *key) +{ + return dict_find(d, (char_u *)key, -1) != NULL; +} + +/* + * Get a typval_T item from a dictionary and copy it into "rettv". + * Returns FAIL if the entry doesn't exist or out of memory. + */ + int +dict_get_tv(dict_T *d, char_u *key, typval_T *rettv) +{ + dictitem_T *di; + + di = dict_find(d, key, -1); + if (di == NULL) + return FAIL; + copy_tv(&di->di_tv, rettv); + return OK; +} + /* * Get a string item from a dictionary. * When "save" is TRUE allocate memory for it. @@ -650,12 +734,27 @@ dict_get_number_check(dict_T *d, char_u *key) return 0; if (di->di_tv.v_type != VAR_NUMBER) { - semsg(_(e_invarg2), tv_get_string(&di->di_tv)); + semsg(_(e_invalid_argument_str), tv_get_string(&di->di_tv)); return 0; } return tv_get_number(&di->di_tv); } +/* + * Get a bool item (number or true/false) from a dictionary. + * Returns "def" if the entry doesn't exist. + */ + varnumber_T +dict_get_bool(dict_T *d, char_u *key, int def) +{ + dictitem_T *di; + + di = dict_find(d, key, -1); + if (di == NULL) + return def; + return tv_get_bool(&di->di_tv); +} + /* * Return an allocated string with the string representation of a Dictionary. * May return NULL. @@ -674,7 +773,7 @@ dict2string(typval_T *tv, int copyID, int restore_copyID) if ((d = tv->vval.v_dict) == NULL) return NULL; - ga_init2(&ga, (int)sizeof(char), 80); + ga_init2(&ga, sizeof(char), 80); ga_append(&ga, '{'); todo = (int)d->dv_hashtab.ht_used; @@ -718,57 +817,110 @@ dict2string(typval_T *tv, int copyID, int restore_copyID) return (char_u *)ga.ga_data; } +/* + * Advance over a literal key, including "-". If the first character is not a + * literal key character then "key" is returned. + */ + static char_u * +skip_literal_key(char_u *key) +{ + char_u *p; + + for (p = key; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p) + ; + return p; +} + /* * Get the key for #{key: val} into "tv" and advance "arg". * Return FAIL when there is no valid key. */ static int -get_literal_key(char_u **arg, typval_T *tv) +get_literal_key_tv(char_u **arg, typval_T *tv) { - char_u *p; + char_u *p = skip_literal_key(*arg); - if (!ASCII_ISALNUM(**arg) && **arg != '_' && **arg != '-') + if (p == *arg) return FAIL; - - for (p = *arg; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p) - ; tv->v_type = VAR_STRING; - tv->vval.v_string = vim_strnsave(*arg, (int)(p - *arg)); + tv->vval.v_string = vim_strnsave(*arg, p - *arg); - *arg = skipwhite(p); + *arg = p; return OK; } +/* + * Get a literal key for a Vim9 dict: + * {"name": value}, + * {'name': value}, + * {name: value} use "name" as a literal key + * Return the key in allocated memory or NULL in the case of an error. + * "arg" is advanced to just after the key. + */ + char_u * +get_literal_key(char_u **arg) +{ + char_u *key; + char_u *end; + typval_T rettv; + + if (**arg == '\'') + { + if (eval_lit_string(arg, &rettv, TRUE, FALSE) == FAIL) + return NULL; + key = rettv.vval.v_string; + } + else if (**arg == '"') + { + if (eval_string(arg, &rettv, TRUE, FALSE) == FAIL) + return NULL; + key = rettv.vval.v_string; + } + else + { + end = skip_literal_key(*arg); + if (end == *arg) + { + semsg(_(e_invalid_key_str), *arg); + return NULL; + } + key = vim_strnsave(*arg, end - *arg); + *arg = end; + } + return key; +} + /* * Allocate a variable for a Dictionary and fill it from "*arg". + * "*arg" points to the "{". * "literal" is TRUE for #{key: val} * Return OK or FAIL. Returns NOTDONE for {expr}. */ int -dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) +eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) { + int evaluate = evalarg == NULL ? FALSE + : evalarg->eval_flags & EVAL_EVALUATE; dict_T *d = NULL; typval_T tvkey; typval_T tv; char_u *key = NULL; dictitem_T *item; - char_u *start = skipwhite(*arg + 1); + char_u *curly_expr = skipwhite(*arg + 1); char_u buf[NUMBUFLEN]; - - /* - * First check if it's not a curly-braces thing: {expr}. - * Must do this without evaluating, otherwise a function may be called - * twice. Unfortunately this means we need to call eval1() twice for the - * first item. - * But {} is an empty Dictionary. - */ - if (*start != '}') - { - if (eval1(&start, &tv, FALSE) == FAIL) /* recursive! */ - return FAIL; - if (*start == '}') - return NOTDONE; - } + int vim9script = in_vim9script(); + int had_comma; + + // First check if it's not a curly-braces thing: {expr}. + // Must do this without evaluating, otherwise a function may be called + // twice. Unfortunately this means we need to call eval1() twice for the + // first item. + // But {} is an empty Dictionary. + if (!vim9script + && *curly_expr != '}' + && eval1(&curly_expr, &tv, NULL) == OK + && *skipwhite(curly_expr) == '}') + return NOTDONE; if (evaluate) { @@ -779,33 +931,81 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) tvkey.v_type = VAR_UNKNOWN; tv.v_type = VAR_UNKNOWN; - *arg = skipwhite(*arg + 1); + *arg = skipwhite_and_linebreak(*arg + 1, evalarg); while (**arg != '}' && **arg != NUL) { - if ((literal - ? get_literal_key(arg, &tvkey) - : eval1(arg, &tvkey, evaluate)) == FAIL) // recursive! - goto failret; + int has_bracket = vim9script && **arg == '['; + if (literal) + { + if (get_literal_key_tv(arg, &tvkey) == FAIL) + goto failret; + } + else if (vim9script && !has_bracket) + { + tvkey.vval.v_string = get_literal_key(arg); + if (tvkey.vval.v_string == NULL) + goto failret; + tvkey.v_type = VAR_STRING; + } + else + { + if (has_bracket) + *arg = skipwhite(*arg + 1); + if (eval1(arg, &tvkey, evalarg) == FAIL) // recursive! + goto failret; + if (has_bracket) + { + *arg = skipwhite(*arg); + if (**arg != ']') + { + emsg(_(e_missing_matching_bracket_after_dict_key)); + clear_tv(&tvkey); + return FAIL; + } + ++*arg; + } + } + + // the colon should come right after the key, but this wasn't checked + // previously, so only require it in Vim9 script. + if (!vim9script) + *arg = skipwhite(*arg); if (**arg != ':') { - semsg(_("E720: Missing colon in Dictionary: %s"), *arg); + if (*skipwhite(*arg) == ':') + semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg); + else + semsg(_(e_missing_colon_in_dictionary), *arg); clear_tv(&tvkey); goto failret; } if (evaluate) { +#ifdef FEAT_FLOAT + if (tvkey.v_type == VAR_FLOAT) + { + tvkey.vval.v_string = typval_tostring(&tvkey, TRUE); + tvkey.v_type = VAR_STRING; + } +#endif key = tv_get_string_buf_chk(&tvkey, buf); if (key == NULL) { - /* "key" is NULL when tv_get_string_buf_chk() gave an errmsg */ + // "key" is NULL when tv_get_string_buf_chk() gave an errmsg clear_tv(&tvkey); goto failret; } } + if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1])) + { + semsg(_(e_white_space_required_after_str_str), ":", *arg); + clear_tv(&tvkey); + goto failret; + } - *arg = skipwhite(*arg + 1); - if (eval1(arg, &tv, evaluate) == FAIL) /* recursive! */ + *arg = skipwhite_and_linebreak(*arg + 1, evalarg); + if (eval1(arg, &tv, evalarg) == FAIL) // recursive! { if (evaluate) clear_tv(&tvkey); @@ -816,7 +1016,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) item = dict_find(d, key, -1); if (item != NULL) { - semsg(_("E721: Duplicate key in Dictionary: \"%s\""), key); + semsg(_(e_duplicate_key_in_dicitonary), key); clear_tv(&tvkey); clear_tv(&tv); goto failret; @@ -832,26 +1032,46 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) } clear_tv(&tvkey); + // the comma should come right after the value, but this wasn't checked + // previously, so only require it in Vim9 script. + if (!vim9script) + *arg = skipwhite(*arg); + had_comma = **arg == ','; + if (had_comma) + { + if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1])) + { + semsg(_(e_white_space_required_after_str_str), ",", *arg); + goto failret; + } + *arg = skipwhite(*arg + 1); + } + + // the "}" can be on the next line + *arg = skipwhite_and_linebreak(*arg, evalarg); if (**arg == '}') break; - if (**arg != ',') + if (!had_comma) { - semsg(_("E722: Missing comma in Dictionary: %s"), *arg); + if (**arg == ',') + semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg); + else + semsg(_(e_missing_comma_in_dictionary), *arg); goto failret; } - *arg = skipwhite(*arg + 1); } if (**arg != '}') { - semsg(_("E723: Missing end of Dictionary '}': %s"), *arg); + if (evalarg != NULL) + semsg(_(e_missing_dict_end), *arg); failret: if (d != NULL) dict_free(d); return FAIL; } - *arg = skipwhite(*arg + 1); + *arg = *arg + 1; if (evaluate) rettv_dict_set(rettv, d); @@ -865,12 +1085,18 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) * Otherwise duplicate keys are ignored ("action" is "keep"). */ void -dict_extend(dict_T *d1, dict_T *d2, char_u *action) +dict_extend(dict_T *d1, dict_T *d2, char_u *action, char *func_name) { dictitem_T *di1; hashitem_T *hi2; int todo; char_u *arg_errmsg = (char_u *)N_("extend() argument"); + type_T *type; + + if (d1->dv_type != NULL && d1->dv_type->tt_member != NULL) + type = d1->dv_type->tt_member; + else + type = NULL; todo = (int)d2->dv_hashtab.ht_used; for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2) @@ -881,15 +1107,21 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action) di1 = dict_find(d1, hi2->hi_key, -1); if (d1->dv_scope != 0) { - /* Disallow replacing a builtin function in l: and g:. - * Check the key to be valid when adding to any scope. */ + // Disallow replacing a builtin function in l: and g:. + // Check the key to be valid when adding to any scope. if (d1->dv_scope == VAR_DEF_SCOPE && HI2DI(hi2)->di_tv.v_type == VAR_FUNC - && var_check_func_name(hi2->hi_key, di1 == NULL)) + && var_wrong_func_name(hi2->hi_key, di1 == NULL)) break; - if (!valid_varname(hi2->hi_key)) + if (!valid_varname(hi2->hi_key, -1, TRUE)) break; } + + if (type != NULL + && check_typval_arg_type(type, &HI2DI(hi2)->di_tv, + func_name, 0) == FAIL) + break; + if (di1 == NULL) { di1 = dictitem_copy(HI2DI(hi2)); @@ -898,14 +1130,16 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action) } else if (*action == 'e') { - semsg(_("E737: Key already exists: %s"), hi2->hi_key); + semsg(_(e_key_already_exists_str), hi2->hi_key); break; } else if (*action == 'f' && HI2DI(hi2) != di1) { - if (var_check_lock(di1->di_tv.v_lock, arg_errmsg, TRUE) + if (value_check_lock(di1->di_tv.v_lock, arg_errmsg, TRUE) || var_check_ro(di1->di_flags, arg_errmsg, TRUE)) break; + if (dict_wrong_func_name(d1, &HI2DI(hi2)->di_tv, hi2->hi_key)) + break; clear_tv(&di1->di_tv); copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); } @@ -929,21 +1163,22 @@ dict_lookup(hashitem_T *hi) dict_equal( dict_T *d1, dict_T *d2, - int ic, /* ignore case for strings */ - int recursive) /* TRUE when used recursively */ + int ic, // ignore case for strings + int recursive) // TRUE when used recursively { hashitem_T *hi; dictitem_T *item2; int todo; - if (d1 == NULL && d2 == NULL) - return TRUE; - if (d1 == NULL || d2 == NULL) - return FALSE; if (d1 == d2) return TRUE; if (dict_len(d1) != dict_len(d2)) return FALSE; + if (dict_len(d1) == 0) + // empty and NULL dicts are considered equal + return TRUE; + if (d1 == NULL || d2 == NULL) + return FALSE; todo = (int)d1->dv_hashtab.ht_used; for (hi = d1->dv_hashtab.ht_array; todo > 0; ++hi) @@ -961,6 +1196,250 @@ dict_equal( return TRUE; } +/* + * Count the number of times item "needle" occurs in Dict "d". Case is ignored + * if "ic" is TRUE. + */ + long +dict_count(dict_T *d, typval_T *needle, int ic) +{ + int todo; + hashitem_T *hi; + long n = 0; + + if (d == NULL) + return 0; + + todo = (int)d->dv_hashtab.ht_used; + for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { + --todo; + if (tv_equal(&HI2DI(hi)->di_tv, needle, ic, FALSE)) + ++n; + } + } + + return n; +} + +/* + * extend() a Dict. Append Dict argvars[1] to Dict argvars[0] and return the + * resulting Dict in "rettv". "is_new" is TRUE for extendnew(). + */ + void +dict_extend_func( + typval_T *argvars, + type_T *type, + char *func_name, + char_u *arg_errmsg, + int is_new, + typval_T *rettv) +{ + dict_T *d1, *d2; + char_u *action; + int i; + + d1 = argvars[0].vval.v_dict; + if (d1 == NULL) + { + emsg(_(e_cannot_extend_null_dict)); + return; + } + d2 = argvars[1].vval.v_dict; + if ((is_new || !value_check_lock(d1->dv_lock, arg_errmsg, TRUE)) + && d2 != NULL) + { + if (is_new) + { + d1 = dict_copy(d1, FALSE, TRUE, get_copyID()); + if (d1 == NULL) + return; + } + + // Check the third argument. + if (argvars[2].v_type != VAR_UNKNOWN) + { + static char *(av[]) = {"keep", "force", "error"}; + + action = tv_get_string_chk(&argvars[2]); + if (action == NULL) + return; + for (i = 0; i < 3; ++i) + if (STRCMP(action, av[i]) == 0) + break; + if (i == 3) + { + semsg(_(e_invalid_argument_str), action); + return; + } + } + else + action = (char_u *)"force"; + + if (type != NULL && check_typval_arg_type(type, &argvars[1], + func_name, 2) == FAIL) + return; + dict_extend(d1, d2, action, func_name); + + if (is_new) + { + rettv->v_type = VAR_DICT; + rettv->vval.v_dict = d1; + rettv->v_lock = FALSE; + } + else + copy_tv(&argvars[0], rettv); + } +} + +/* + * Implementation of map() and filter() for a Dict. Apply "expr" to every + * item in Dict "d" and return the result in "rettv". + */ + void +dict_filter_map( + dict_T *d, + filtermap_T filtermap, + type_T *argtype, + char *func_name, + char_u *arg_errmsg, + typval_T *expr, + typval_T *rettv) +{ + int prev_lock; + dict_T *d_ret = NULL; + hashtab_T *ht; + hashitem_T *hi; + dictitem_T *di; + int todo; + int rem; + + if (filtermap == FILTERMAP_MAPNEW) + { + rettv->v_type = VAR_DICT; + rettv->vval.v_dict = NULL; + } + if (d == NULL + || (filtermap == FILTERMAP_FILTER + && value_check_lock(d->dv_lock, arg_errmsg, TRUE))) + return; + + prev_lock = d->dv_lock; + + if (filtermap == FILTERMAP_MAPNEW) + { + if (rettv_dict_alloc(rettv) == FAIL) + return; + d_ret = rettv->vval.v_dict; + } + + if (filtermap != FILTERMAP_FILTER && d->dv_lock == 0) + d->dv_lock = VAR_LOCKED; + ht = &d->dv_hashtab; + hash_lock(ht); + todo = (int)ht->ht_used; + for (hi = ht->ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { + int r; + typval_T newtv; + + --todo; + di = HI2DI(hi); + if (filtermap == FILTERMAP_MAP + && (value_check_lock(di->di_tv.v_lock, + arg_errmsg, TRUE) + || var_check_ro(di->di_flags, + arg_errmsg, TRUE))) + break; + set_vim_var_string(VV_KEY, di->di_key, -1); + newtv.v_type = VAR_UNKNOWN; + r = filter_map_one(&di->di_tv, expr, filtermap, + &newtv, &rem); + clear_tv(get_vim_var_tv(VV_KEY)); + if (r == FAIL || did_emsg) + { + clear_tv(&newtv); + break; + } + if (filtermap == FILTERMAP_MAP) + { + if (argtype != NULL && check_typval_arg_type( + argtype->tt_member, &newtv, func_name, 0) == FAIL) + { + clear_tv(&newtv); + break; + } + // map(): replace the dict item value + clear_tv(&di->di_tv); + newtv.v_lock = 0; + di->di_tv = newtv; + } + else if (filtermap == FILTERMAP_MAPNEW) + { + // mapnew(): add the item value to the new dict + r = dict_add_tv(d_ret, (char *)di->di_key, &newtv); + clear_tv(&newtv); + if (r == FAIL) + break; + } + else if (filtermap == FILTERMAP_FILTER && rem) + { + // filter(false): remove the item from the dict + if (var_check_fixed(di->di_flags, arg_errmsg, TRUE) + || var_check_ro(di->di_flags, arg_errmsg, TRUE)) + break; + dictitem_remove(d, di); + } + } + } + hash_unlock(ht); + d->dv_lock = prev_lock; +} + +/* + * "remove({dict})" function + */ + void +dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg) +{ + dict_T *d; + char_u *key; + dictitem_T *di; + + if (argvars[2].v_type != VAR_UNKNOWN) + { + semsg(_(e_too_many_arguments_for_function_str), "remove()"); + return; + } + + d = argvars[0].vval.v_dict; + if (d == NULL || value_check_lock(d->dv_lock, arg_errmsg, TRUE)) + return; + + key = tv_get_string_chk(&argvars[1]); + if (key == NULL) + return; + + di = dict_find(d, key, -1); + if (di == NULL) + { + semsg(_(e_key_not_present_in_dictionary), key); + return; + } + + if (var_check_fixed(di->di_flags, arg_errmsg, TRUE) + || var_check_ro(di->di_flags, arg_errmsg, TRUE)) + return; + + *rettv = di->di_tv; + init_tv(&di->di_tv); + dictitem_remove(d, di); +} + /* * Turn a dict into a list: * "what" == 0: list of keys @@ -978,15 +1457,20 @@ dict_list(typval_T *argvars, typval_T *rettv, int what) dict_T *d; int todo; + if (rettv_list_alloc(rettv) == FAIL) + return; + + if (in_vim9script() && check_for_dict_arg(argvars, 0) == FAIL) + return; + if (argvars[0].v_type != VAR_DICT) { - emsg(_(e_dictreq)); + emsg(_(e_dictionary_required)); return; } - if ((d = argvars[0].vval.v_dict) == NULL) - return; - if (rettv_list_alloc(rettv) == FAIL) + if ((d = argvars[0].vval.v_dict) == NULL) + // empty dict behaves like an empty dict return; todo = (int)d->dv_hashtab.ht_used; @@ -1004,19 +1488,19 @@ dict_list(typval_T *argvars, typval_T *rettv, int what) if (what == 0) { - /* keys() */ + // keys() li->li_tv.v_type = VAR_STRING; li->li_tv.v_lock = 0; li->li_tv.vval.v_string = vim_strsave(di->di_key); } else if (what == 1) { - /* values() */ + // values() copy_tv(&di->di_tv, &li->li_tv); } else { - /* items() */ + // items() l2 = list_alloc(); li->li_tv.v_type = VAR_LIST; li->li_tv.v_lock = 0; @@ -1079,7 +1563,7 @@ dict_set_items_ro(dict_T *di) int todo = (int)di->dv_hashtab.ht_used; hashitem_T *hi; - /* Set readonly */ + // Set readonly for (hi = di->dv_hashtab.ht_array; todo > 0 ; ++hi) { if (HASHITEM_EMPTY(hi)) @@ -1095,48 +1579,21 @@ dict_set_items_ro(dict_T *di) void f_has_key(typval_T *argvars, typval_T *rettv) { + if (in_vim9script() + && (check_for_dict_arg(argvars, 0) == FAIL + || check_for_string_or_number_arg(argvars, 1) == FAIL)) + return; + if (argvars[0].v_type != VAR_DICT) { - emsg(_(e_dictreq)); + emsg(_(e_dictionary_required)); return; } if (argvars[0].vval.v_dict == NULL) return; - rettv->vval.v_number = dict_find(argvars[0].vval.v_dict, - tv_get_string(&argvars[1]), -1) != NULL; -} - -/* - * "remove({dict})" function - */ - void -dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg) -{ - dict_T *d; - char_u *key; - dictitem_T *di; - - if (argvars[2].v_type != VAR_UNKNOWN) - semsg(_(e_toomanyarg), "remove()"); - else if ((d = argvars[0].vval.v_dict) != NULL - && !var_check_lock(d->dv_lock, arg_errmsg, TRUE)) - { - key = tv_get_string_chk(&argvars[1]); - if (key != NULL) - { - di = dict_find(d, key, -1); - if (di == NULL) - semsg(_(e_dictkey), key); - else if (!var_check_fixed(di->di_flags, arg_errmsg, TRUE) - && !var_check_ro(di->di_flags, arg_errmsg, TRUE)) - { - *rettv = di->di_tv; - init_tv(&di->di_tv); - dictitem_remove(d, di); - } - } - } + rettv->vval.v_number = dict_has_key(argvars[0].vval.v_dict, + (char *)tv_get_string(&argvars[1])); } -#endif /* defined(FEAT_EVAL) */ +#endif // defined(FEAT_EVAL) diff --git a/src/diff.c b/src/diff.c index dbda795f6e8c8..863900fc34326 100644 --- a/src/diff.c +++ b/src/diff.c @@ -24,7 +24,7 @@ static __thread int diff_busy = FALSE; // using diff structs, don't change them static __thread int diff_need_update = FALSE; // ex_diffupdate needs to be called -/* flags obtained from the 'diffopt' option */ +// flags obtained from the 'diffopt' option #define DIFF_FILLER 0x001 // display filler lines #define DIFF_IBLANK 0x002 // ignore empty lines #define DIFF_ICASE 0x004 // ignore case @@ -35,19 +35,21 @@ static __thread int diff_need_update = FALSE; // ex_diffupdate needs to be calle #define DIFF_VERTICAL 0x080 // vertical splits #define DIFF_HIDDEN_OFF 0x100 // diffoff when hidden #define DIFF_INTERNAL 0x200 // use internal xdiff algorithm +#define DIFF_CLOSE_OFF 0x400 // diffoff when closing window +#define DIFF_FOLLOWWRAP 0x800 // follow the wrap option #define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL) -static __thread int diff_flags = DIFF_INTERNAL | DIFF_FILLER; +static __thread int diff_flags = DIFF_INTERNAL | DIFF_FILLER | DIFF_CLOSE_OFF; static __thread long diff_algorithm = 0; -#define LBUFLEN 50 /* length of line in diff file */ +#define LBUFLEN 50 // length of line in diff file -static __thread int diff_a_works = MAYBE; /* TRUE when "diff -a" works, FALSE when it - doesn't work, MAYBE when not checked yet */ +static __thread int diff_a_works = MAYBE; // TRUE when "diff -a" works, FALSE when it + // doesn't work, MAYBE when not checked yet #if defined(MSWIN) -static __thread int diff_bin_works = MAYBE; /* TRUE when "diff --binary" works, FALSE - when it doesn't work, MAYBE when not - checked yet */ +static __thread int diff_bin_works = MAYBE; // TRUE when "diff --binary" works, FALSE + // when it doesn't work, MAYBE when not + // checked yet #endif // used for diff input @@ -62,6 +64,14 @@ typedef struct { garray_T dout_ga; // used for internal diff } diffout_T; +// used for recording hunks from xdiff +typedef struct { + linenr_T lnum_orig; + long count_orig; + linenr_T lnum_new; + long count_new; +} diffhunk_T; + // two diff inputs and one result typedef struct { diffin_T dio_orig; // original file input @@ -82,12 +92,15 @@ static int diff_cmp(char_u *s1, char_u *s2); #ifdef FEAT_FOLDING static void diff_fold_update(diff_T *dp, int skip_idx); #endif -static void diff_read(int idx_orig, int idx_new, diffout_T *fname); +static void diff_read(int idx_orig, int idx_new, diffio_T *dio); static void diff_copy_entry(diff_T *dprev, diff_T *dp, int idx_orig, int idx_new); static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp); -static int parse_diff_ed(char_u *line, linenr_T *lnum_orig, long *count_orig, linenr_T *lnum_new, long *count_new); -static int parse_diff_unified(char_u *line, linenr_T *lnum_orig, long *count_orig, linenr_T *lnum_new, long *count_new); -static int xdiff_out(void *priv, mmbuffer_t *mb, int nbuf); +static int parse_diff_ed(char_u *line, diffhunk_T *hunk); +static int parse_diff_unified(char_u *line, diffhunk_T *hunk); +static int xdiff_out(long start_a, long count_a, long start_b, long count_b, void *priv); + +#define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \ + for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next) /* * Called when deleting or unloading a buffer: No longer make a diff with it. @@ -106,7 +119,12 @@ diff_buf_delete(buf_T *buf) tp->tp_diffbuf[i] = NULL; tp->tp_diff_invalid = TRUE; if (tp == curtab) - diff_redraw(TRUE); + { + // don't redraw right away, more might change or buffer state + // is invalid right now + need_diff_redraw = TRUE; + redraw_later(VALID); + } } } } @@ -123,8 +141,8 @@ diff_buf_adjust(win_T *win) if (!win->w_p_diff) { - /* When there is no window showing a diff for this buffer, remove - * it from the diffs. */ + // When there is no window showing a diff for this buffer, remove + // it from the diffs. FOR_ALL_WINDOWS(wp) if (wp->w_buffer == win->w_buffer && wp->w_p_diff) break; @@ -157,7 +175,7 @@ diff_buf_add(buf_T *buf) int i; if (diff_buf_idx(buf) != DB_COUNT) - return; /* It's already there. */ + return; // It's already there. for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] == NULL) @@ -168,7 +186,7 @@ diff_buf_add(buf_T *buf) return; } - semsg(_("E96: Cannot diff more than %d buffers"), DB_COUNT); + semsg(_(e_cannot_diff_more_than_nr_buffers), DB_COUNT); } /* @@ -253,7 +271,7 @@ diff_mark_adjust( int idx; tabpage_T *tp; - /* Handle all tab pages that use the current buffer in a diff. */ + // Handle all tab pages that use the current buffer in a diff. FOR_ALL_TABPAGES(tp) { idx = diff_buf_idx_tp(curbuf, tp); @@ -285,7 +303,7 @@ diff_mark_adjust_tp( int inserted, deleted; int n, off; linenr_T last; - linenr_T lnum_deleted = line1; /* lnum of remaining deletion */ + linenr_T lnum_deleted = line1; // lnum of remaining deletion int check_unchanged; if (diff_internal()) @@ -300,19 +318,19 @@ diff_mark_adjust_tp( if (line2 == MAXLNUM) { - /* mark_adjust(99, MAXLNUM, 9, 0): insert lines */ + // mark_adjust(99, MAXLNUM, 9, 0): insert lines inserted = amount; deleted = 0; } else if (amount_after > 0) { - /* mark_adjust(99, 98, MAXLNUM, 9): a change that inserts lines*/ + // mark_adjust(99, 98, MAXLNUM, 9): a change that inserts lines inserted = amount_after; deleted = 0; } else { - /* mark_adjust(98, 99, MAXLNUM, -2): delete lines */ + // mark_adjust(98, 99, MAXLNUM, -2): delete lines inserted = 0; deleted = -amount_after; } @@ -321,9 +339,9 @@ diff_mark_adjust_tp( dp = tp->tp_first_diff; for (;;) { - /* If the change is after the previous diff block and before the next - * diff block, thus not touching an existing change, create a new diff - * block. Don't do this when ex_diffgetput() is busy. */ + // If the change is after the previous diff block and before the next + // diff block, thus not touching an existing change, create a new diff + // block. Don't do this when ex_diffgetput() is busy. if ((dp == NULL || dp->df_lnum[idx] - 1 > line2 || (line2 == MAXLNUM && dp->df_lnum[idx] > line1)) && (dprev == NULL @@ -349,7 +367,7 @@ diff_mark_adjust_tp( } } - /* if at end of the list, quit */ + // if at end of the list, quit if (dp == NULL) break; @@ -364,38 +382,38 @@ diff_mark_adjust_tp( * 3 5 6 * 3 5 6 */ - /* compute last line of this change */ + // compute last line of this change last = dp->df_lnum[idx] + dp->df_count[idx] - 1; - /* 1. change completely above line1: nothing to do */ + // 1. change completely above line1: nothing to do if (last >= line1 - 1) { - /* 6. change below line2: only adjust for amount_after; also when - * "deleted" became zero when deleted all lines between two diffs */ + // 6. change below line2: only adjust for amount_after; also when + // "deleted" became zero when deleted all lines between two diffs if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2) { if (amount_after == 0) - break; /* nothing left to change */ + break; // nothing left to change dp->df_lnum[idx] += amount_after; } else { check_unchanged = FALSE; - /* 2. 3. 4. 5.: inserted/deleted lines touching this diff. */ + // 2. 3. 4. 5.: inserted/deleted lines touching this diff. if (deleted > 0) { + off = 0; if (dp->df_lnum[idx] >= line1) { - off = dp->df_lnum[idx] - lnum_deleted; if (last <= line2) { - /* 4. delete all lines of diff */ + // 4. delete all lines of diff if (dp->df_next != NULL && dp->df_next->df_lnum[idx] - 1 <= line2) { - /* delete continues in next diff, only do - * lines until that one */ + // delete continues in next diff, only do + // lines until that one n = dp->df_next->df_lnum[idx] - lnum_deleted; deleted -= n; n -= dp->df_count[idx]; @@ -407,7 +425,8 @@ diff_mark_adjust_tp( } else { - /* 5. delete lines at or just before top of diff */ + // 5. delete lines at or just before top of diff + off = dp->df_lnum[idx] - lnum_deleted; n = off; dp->df_count[idx] -= line2 - dp->df_lnum[idx] + 1; check_unchanged = TRUE; @@ -416,16 +435,15 @@ diff_mark_adjust_tp( } else { - off = 0; if (last < line2) { - /* 2. delete at end of of diff */ + // 2. delete at end of diff dp->df_count[idx] -= last - lnum_deleted + 1; if (dp->df_next != NULL && dp->df_next->df_lnum[idx] - 1 <= line2) { - /* delete continues in next diff, only do - * lines until that one */ + // delete continues in next diff, only do + // lines until that one n = dp->df_next->df_lnum[idx] - 1 - last; deleted -= dp->df_next->df_lnum[idx] - lnum_deleted; @@ -437,7 +455,7 @@ diff_mark_adjust_tp( } else { - /* 3. delete lines inside the diff */ + // 3. delete lines inside the diff n = 0; dp->df_count[idx] -= deleted; } @@ -454,24 +472,24 @@ diff_mark_adjust_tp( { if (dp->df_lnum[idx] <= line1) { - /* inserted lines somewhere in this diff */ + // inserted lines somewhere in this diff dp->df_count[idx] += inserted; check_unchanged = TRUE; } else - /* inserted lines somewhere above this diff */ + // inserted lines somewhere above this diff dp->df_lnum[idx] += inserted; } if (check_unchanged) - /* Check if inserted lines are equal, may reduce the - * size of the diff. TODO: also check for equal lines - * in the middle and perhaps split the block. */ + // Check if inserted lines are equal, may reduce the + // size of the diff. TODO: also check for equal lines + // in the middle and perhaps split the block. diff_check_unchanged(tp, dp); } } - /* check if this block touches the previous one, may merge them. */ + // check if this block touches the previous one, may merge them. if (dprev != NULL && dprev->df_lnum[idx] + dprev->df_count[idx] == dp->df_lnum[idx]) { @@ -484,7 +502,7 @@ diff_mark_adjust_tp( } else { - /* Advance to next entry. */ + // Advance to next entry. dprev = dp; dp = dp->df_next; } @@ -494,7 +512,7 @@ diff_mark_adjust_tp( dp = tp->tp_first_diff; while (dp != NULL) { - /* All counts are zero, remove this entry. */ + // All counts are zero, remove this entry. for (i = 0; i < DB_COUNT; ++i) if (tp->tp_diffbuf[i] != NULL && dp->df_count[i] != 0) break; @@ -510,7 +528,7 @@ diff_mark_adjust_tp( } else { - /* Advance to next entry. */ + // Advance to next entry. dprev = dp; dp = dp->df_next; } @@ -522,9 +540,9 @@ diff_mark_adjust_tp( // Don't redraw right away, this updates the diffs, which can be slow. need_diff_redraw = TRUE; - /* Need to recompute the scroll binding, may remove or add filler - * lines (e.g., when adding lines above w_topline). But it's slow when - * making many changes, postpone until redrawing. */ + // Need to recompute the scroll binding, may remove or add filler + // lines (e.g., when adding lines above w_topline). But it's slow when + // making many changes, postpone until redrawing. diff_need_scrollbind = TRUE; } } @@ -564,27 +582,27 @@ diff_check_unchanged(tabpage_T *tp, diff_T *dp) char_u *line_org; int dir = FORWARD; - /* Find the first buffers, use it as the original, compare the other - * buffer lines against this one. */ + // Find the first buffers, use it as the original, compare the other + // buffer lines against this one. for (i_org = 0; i_org < DB_COUNT; ++i_org) if (tp->tp_diffbuf[i_org] != NULL) break; - if (i_org == DB_COUNT) /* safety check */ + if (i_org == DB_COUNT) // safety check return; if (diff_check_sanity(tp, dp) == FAIL) return; - /* First check lines at the top, then at the bottom. */ + // First check lines at the top, then at the bottom. off_org = 0; off_new = 0; for (;;) { - /* Repeat until a line is found which is different or the number of - * lines has become zero. */ + // Repeat until a line is found which is different or the number of + // lines has become zero. while (dp->df_count[i_org] > 0) { - /* Copy the line, the next ml_get() will invalidate it. */ + // Copy the line, the next ml_get() will invalidate it. if (dir == BACKWARD) off_org = dp->df_count[i_org] - 1; line_org = vim_strsave(ml_get_buf(tp->tp_diffbuf[i_org], @@ -597,7 +615,7 @@ diff_check_unchanged(tabpage_T *tp, diff_T *dp) continue; if (dir == BACKWARD) off_new = dp->df_count[i_new] - 1; - /* if other buffer doesn't have this line, it was inserted */ + // if other buffer doesn't have this line, it was inserted if (off_new < 0 || off_new >= dp->df_count[i_new]) break; if (diff_cmp(line_org, ml_get_buf(tp->tp_diffbuf[i_new], @@ -606,11 +624,11 @@ diff_check_unchanged(tabpage_T *tp, diff_T *dp) } vim_free(line_org); - /* Stop when a line isn't equal in all diff buffers. */ + // Stop when a line isn't equal in all diff buffers. if (i_new != DB_COUNT) break; - /* Line matched in all buffers, remove it from the diff. */ + // Line matched in all buffers, remove it from the diff. for (i_new = i_org; i_new < DB_COUNT; ++i_new) if (tp->tp_diffbuf[i_new] != NULL) { @@ -650,29 +668,53 @@ diff_redraw( int dofold) // also recompute the folds { win_T *wp; + win_T *wp_other = NULL; + int used_max_fill_other = FALSE; + int used_max_fill_curwin = FALSE; int n; need_diff_redraw = FALSE; FOR_ALL_WINDOWS(wp) - if (wp->w_p_diff) + // when closing windows or wiping buffers skip invalid window + if (wp->w_p_diff && buf_valid(wp->w_buffer)) { redraw_win_later(wp, SOME_VALID); + if (wp != curwin) + wp_other = wp; #ifdef FEAT_FOLDING if (dofold && foldmethodIsDiff(wp)) foldUpdateAll(wp); #endif - /* A change may have made filler lines invalid, need to take care - * of that for other windows. */ + // A change may have made filler lines invalid, need to take care + // of that for other windows. n = diff_check(wp, wp->w_topline); if ((wp != curwin && wp->w_topfill > 0) || n > 0) { if (wp->w_topfill > n) wp->w_topfill = (n < 0 ? 0 : n); else if (n > 0 && n > wp->w_topfill) + { wp->w_topfill = n; + if (wp == curwin) + used_max_fill_curwin = TRUE; + else if (wp_other != NULL) + used_max_fill_other = TRUE; + } check_topfill(wp, FALSE); } } + + if (wp_other != NULL && curwin->w_p_scb) + { + if (used_max_fill_curwin) + // The current window was set to use the maximum number of filler + // lines, may need to reduce them. + diff_set_topline(wp_other, curwin); + else if (used_max_fill_other) + // The other window was set to use the maximum number of filler + // lines, may need to reduce them. + diff_set_topline(curwin, wp_other); + } } static void @@ -741,9 +783,14 @@ diff_write_buffer(buf_T *buf, diffin_T *din) int orig_len; char_u cbuf[MB_MAXBYTES + 1]; - // xdiff doesn't support ignoring case, fold-case the text. - c = PTR2CHAR(s); - c = enc_utf8 ? utf_fold(c) : MB_TOLOWER(c); + if (*s == NL) + c = NUL; + else + { + // xdiff doesn't support ignoring case, fold-case the text. + c = PTR2CHAR(s); + c = MB_CASEFOLD(c); + } orig_len = mb_ptr2len(s); if (mb_char2bytes(c, cbuf) != orig_len) // TODO: handle byte length difference @@ -755,7 +802,10 @@ diff_write_buffer(buf_T *buf, diffin_T *din) len += orig_len; } else - ptr[len++] = *s++; + { + ptr[len++] = *s == NL ? NUL : *s; + s++; + } } ptr[len++] = NL; } @@ -771,6 +821,7 @@ diff_write(buf_T *buf, diffin_T *din) { int r; char_u *save_ff; + int save_cmod_flags; if (din->din_fname == NULL) return diff_write_buffer(buf, din); @@ -778,9 +829,14 @@ diff_write(buf_T *buf, diffin_T *din) // Always use 'fileformat' set to "unix". save_ff = buf->b_p_ff; buf->b_p_ff = vim_strsave((char_u *)FF_UNIX); + save_cmod_flags = cmdmod.cmod_flags; + // Writing the buffer is an implementation detail of performing the diff, + // so it shouldn't update the '[ and '] marks. + cmdmod.cmod_flags |= CMOD_LOCKMARKS; r = buf_write(buf, din->din_fname, NULL, (linenr_T)1, buf->b_ml.ml_line_count, NULL, FALSE, FALSE, FALSE, TRUE); + cmdmod.cmod_flags = save_cmod_flags; free_string_option(buf->b_p_ff); buf->b_p_ff = save_ff; return r; @@ -846,7 +902,7 @@ diff_try_update( continue; // Read the diff output and add each entry to the diff list. - diff_read(idx_orig, idx_new, &dio->dio_diff); + diff_read(idx_orig, idx_new, dio); clear_diffin(&dio->dio_new); clear_diffout(&dio->dio_diff); @@ -929,14 +985,14 @@ ex_diffupdate(exarg_T *eap) // "eap" can be NULL goto theend; // Only use the internal method if it did not fail for one of the buffers. - vim_memset(&diffio, 0, sizeof(diffio)); + CLEAR_FIELD(diffio); diffio.dio_internal = diff_internal() && !diff_internal_failed(); diff_try_update(&diffio, idx_orig, eap); if (diffio.dio_internal && diff_internal_failed()) { // Internal diff failed, use external diff instead. - vim_memset(&diffio, 0, sizeof(diffio)); + CLEAR_FIELD(diffio); diff_try_update(&diffio, idx_orig, eap); } @@ -996,10 +1052,12 @@ check_external_diff(diffio_T *diffio) for (;;) { - /* There must be a line that contains "1c1". */ + // For normal diff there must be a line that contains + // "1c1". For unified diff "@@ -1 +1 @@". if (vim_fgets(linebuf, LBUFLEN, fd)) break; - if (STRNCMP(linebuf, "1c1", 3) == 0) + if (STRNCMP(linebuf, "1c1", 3) == 0 + || STRNCMP(linebuf, "@@ -1 +1 @@", 11) == 0) ok = TRUE; } fclose(fd); @@ -1011,13 +1069,13 @@ check_external_diff(diffio_T *diffio) } #ifdef FEAT_EVAL - /* When using 'diffexpr' break here. */ + // When using 'diffexpr' break here. if (*p_dex != NUL) break; #endif #if defined(MSWIN) - /* If the "-a" argument works, also check if "--binary" works. */ + // If the "-a" argument works, also check if "--binary" works. if (ok && diff_a_works == MAYBE && diff_bin_works == MAYBE) { diff_a_works = TRUE; @@ -1026,26 +1084,26 @@ check_external_diff(diffio_T *diffio) } if (!ok && diff_a_works == TRUE && diff_bin_works == TRUE) { - /* Tried --binary, but it failed. "-a" works though. */ + // Tried --binary, but it failed. "-a" works though. diff_bin_works = FALSE; ok = TRUE; } #endif - /* If we checked if "-a" works already, break here. */ + // If we checked if "-a" works already, break here. if (diff_a_works != MAYBE) break; diff_a_works = ok; - /* If "-a" works break here, otherwise retry without "-a". */ + // If "-a" works break here, otherwise retry without "-a". if (ok) break; } if (!ok) { if (io_error) - emsg(_("E810: Cannot read or write temp files")); - emsg(_("E97: Cannot create diffs")); + emsg(_(e_cannot_read_or_write_temp_files)); + emsg(_(e_cannot_create_diffs)); diff_a_works = MAYBE; #if defined(MSWIN) diff_bin_works = MAYBE; @@ -1065,9 +1123,9 @@ diff_file_internal(diffio_T *diffio) xdemitconf_t emit_cfg; xdemitcb_t emit_cb; - vim_memset(¶m, 0, sizeof(param)); - vim_memset(&emit_cfg, 0, sizeof(emit_cfg)); - vim_memset(&emit_cb, 0, sizeof(emit_cb)); + CLEAR_FIELD(param); + CLEAR_FIELD(emit_cfg); + CLEAR_FIELD(emit_cb); param.flags = diff_algorithm; @@ -1082,12 +1140,12 @@ diff_file_internal(diffio_T *diffio) emit_cfg.ctxlen = 0; // don't need any diff_context here emit_cb.priv = &diffio->dio_diff; - emit_cb.outf = xdiff_out; + emit_cfg.hunk_func = xdiff_out; if (xdl_diff(&diffio->dio_orig.din_mmfile, &diffio->dio_new.din_mmfile, ¶m, &emit_cfg, &emit_cb) < 0) { - emsg(_("E960: Problem creating the internal diff")); + emsg(_(e_problem_creating_internal_diff)); return FAIL; } return OK; @@ -1165,50 +1223,50 @@ diff_file(diffio_T *dio) void ex_diffpatch(exarg_T *eap) { - char_u *tmp_orig; /* name of original temp file */ - char_u *tmp_new; /* name of patched temp file */ + char_u *tmp_orig; // name of original temp file + char_u *tmp_new; // name of patched temp file char_u *buf = NULL; size_t buflen; win_T *old_curwin = curwin; - char_u *newname = NULL; /* name of patched file buffer */ + char_u *newname = NULL; // name of patched file buffer #ifdef UNIX char_u dirbuf[MAXPATHL]; char_u *fullname = NULL; #endif #ifdef FEAT_BROWSE char_u *browseFile = NULL; - int browse_flag = cmdmod.browse; + int save_cmod_flags = cmdmod.cmod_flags; #endif stat_T st; char_u *esc_name = NULL; #ifdef FEAT_BROWSE - if (cmdmod.browse) + if (cmdmod.cmod_flags & CMOD_BROWSE) { browseFile = do_browse(0, (char_u *)_("Patch file"), eap->arg, NULL, NULL, (char_u *)_(BROWSE_FILTER_ALL_FILES), NULL); if (browseFile == NULL) - return; /* operation cancelled */ + return; // operation cancelled eap->arg = browseFile; - cmdmod.browse = FALSE; /* don't let do_ecmd() browse again */ + cmdmod.cmod_flags &= ~CMOD_BROWSE; // don't let do_ecmd() browse again } #endif - /* We need two temp file names. */ + // We need two temp file names. tmp_orig = vim_tempname('o', FALSE); tmp_new = vim_tempname('n', FALSE); if (tmp_orig == NULL || tmp_new == NULL) goto theend; - /* Write the current buffer to "tmp_orig". */ + // Write the current buffer to "tmp_orig". if (buf_write(curbuf, tmp_orig, NULL, (linenr_T)1, curbuf->b_ml.ml_line_count, NULL, FALSE, FALSE, FALSE, TRUE) == FAIL) goto theend; #ifdef UNIX - /* Get the absolute path of the patchfile, changing directory below. */ + // Get the absolute path of the patchfile, changing directory below. fullname = FullName_save(eap->arg, FALSE); #endif esc_name = vim_strsave_shellescape( @@ -1224,11 +1282,11 @@ ex_diffpatch(exarg_T *eap) goto theend; #ifdef UNIX - /* Temporarily chdir to /tmp, to avoid patching files in the current - * directory when the patch file contains more than one patch. When we - * have our own temp dir use that instead, it will be cleaned up when we - * exit (any .rej files created). Don't change directory if we can't - * return to the current. */ + // Temporarily chdir to /tmp, to avoid patching files in the current + // directory when the patch file contains more than one patch. When we + // have our own temp dir use that instead, it will be cleaned up when we + // exit (any .rej files created). Don't change directory if we can't + // return to the current. if (mch_dirname(dirbuf, MAXPATHL) != OK || mch_chdir((char *)dirbuf) != 0) dirbuf[0] = NUL; else @@ -1245,7 +1303,7 @@ ex_diffpatch(exarg_T *eap) #ifdef FEAT_EVAL if (*p_pex != NUL) - /* Use 'patchexpr' to generate the new file. */ + // Use 'patchexpr' to generate the new file. eval_patch(tmp_orig, # ifdef UNIX fullname != NULL ? fullname : @@ -1254,11 +1312,11 @@ ex_diffpatch(exarg_T *eap) else #endif { - /* Build the patch command and execute it. Ignore errors. Switch to - * cooked mode to allow the user to respond to prompts. */ + // Build the patch command and execute it. Ignore errors. Switch to + // cooked mode to allow the user to respond to prompts. vim_snprintf((char *)buf, buflen, "patch -o %s %s < %s", tmp_new, tmp_orig, esc_name); - block_autocmds(); /* Avoid ShellCmdPost stuff */ + block_autocmds(); // Avoid ShellCmdPost stuff (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED); unblock_autocmds(); } @@ -1267,15 +1325,15 @@ ex_diffpatch(exarg_T *eap) if (dirbuf[0] != NUL) { if (mch_chdir((char *)dirbuf) != 0) - emsg(_(e_prev_dir)); + emsg(_(e_cannot_go_back_to_previous_directory)); shorten_fnames(TRUE); } #endif - /* patch probably has written over the screen */ + // patch probably has written over the screen redraw_later(CLEAR); - /* Delete any .orig or .rej file created. */ + // Delete any .orig or .rej file created. STRCPY(buf, tmp_new); STRCAT(buf, ".orig"); mch_remove(buf); @@ -1283,15 +1341,15 @@ ex_diffpatch(exarg_T *eap) STRCAT(buf, ".rej"); mch_remove(buf); - /* Only continue if the output file was created. */ + // Only continue if the output file was created. if (mch_stat((char *)tmp_new, &st) < 0 || st.st_size == 0) - emsg(_("E816: Cannot read patch output")); + emsg(_(e_cannot_read_patch_output)); else { if (curbuf->b_fname != NULL) { newname = vim_strnsave(curbuf->b_fname, - (int)(STRLEN(curbuf->b_fname) + 4)); + STRLEN(curbuf->b_fname) + 4); if (newname != NULL) STRCAT(newname, ".new"); } @@ -1299,30 +1357,30 @@ ex_diffpatch(exarg_T *eap) #ifdef FEAT_GUI need_mouse_correct = TRUE; #endif - /* don't use a new tab page, each tab page has its own diffs */ - cmdmod.tab = 0; + // don't use a new tab page, each tab page has its own diffs + cmdmod.cmod_tab = 0; if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL) { - /* Pretend it was a ":split fname" command */ + // Pretend it was a ":split fname" command eap->cmdidx = CMD_split; eap->arg = tmp_new; do_exedit(eap, old_curwin); - /* check that split worked and editing tmp_new */ + // check that split worked and editing tmp_new if (curwin != old_curwin && win_valid(old_curwin)) { - /* Set 'diff', 'scrollbind' on and 'wrap' off. */ + // Set 'diff', 'scrollbind' on and 'wrap' off. diff_win_options(curwin, TRUE); diff_win_options(old_curwin, TRUE); if (newname != NULL) { - /* do a ":file filename.new" on the patched buffer */ + // do a ":file filename.new" on the patched buffer eap->arg = newname; ex_file(eap); - /* Do filetype detection with the new name. */ + // Do filetype detection with the new name. if (au_has_group((char_u *)"filetypedetect")) do_cmdline_cmd((char_u *)":doau filetypedetect BufRead"); } @@ -1345,7 +1403,7 @@ ex_diffpatch(exarg_T *eap) vim_free(esc_name); #ifdef FEAT_BROWSE vim_free(browseFile); - cmdmod.browse = browse_flag; + cmdmod.cmod_flags = save_cmod_flags; #endif } @@ -1362,35 +1420,35 @@ ex_diffsplit(exarg_T *eap) #ifdef FEAT_GUI need_mouse_correct = TRUE; #endif - /* Need to compute w_fraction when no redraw happened yet. */ + // Need to compute w_fraction when no redraw happened yet. validate_cursor(); set_fraction(curwin); - /* don't use a new tab page, each tab page has its own diffs */ - cmdmod.tab = 0; + // don't use a new tab page, each tab page has its own diffs + cmdmod.cmod_tab = 0; if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL) { - /* Pretend it was a ":split fname" command */ + // Pretend it was a ":split fname" command eap->cmdidx = CMD_split; curwin->w_p_diff = TRUE; do_exedit(eap, old_curwin); - if (curwin != old_curwin) /* split must have worked */ + if (curwin != old_curwin) // split must have worked { - /* Set 'diff', 'scrollbind' on and 'wrap' off. */ + // Set 'diff', 'scrollbind' on and 'wrap' off. diff_win_options(curwin, TRUE); if (win_valid(old_curwin)) { diff_win_options(old_curwin, TRUE); if (bufref_valid(&old_curbuf)) - /* Move the cursor position to that of the old window. */ + // Move the cursor position to that of the old window. curwin->w_cursor.lnum = diff_get_corresponding_line( old_curbuf.br_buf, old_curwin->w_cursor.lnum); } - /* Now that lines are folded scroll to show the cursor at the same - * relative position. */ + // Now that lines are folded scroll to show the cursor at the same + // relative position. scroll_to_fraction(curwin, curwin->w_height); } } @@ -1402,7 +1460,7 @@ ex_diffsplit(exarg_T *eap) void ex_diffthis(exarg_T *eap UNUSED) { - /* Set 'diff', 'scrollbind' on and 'wrap' off. */ + // Set 'diff', 'scrollbind' on and 'wrap' off. diff_win_options(curwin, TRUE); } @@ -1414,7 +1472,7 @@ set_diff_option(win_T *wp, int value) curwin = wp; curbuf = curwin->w_buffer; ++curbuf_lock; - set_option_value((char_u *)"diff", (long)value, NULL, OPT_LOCAL); + set_option_value_give_err((char_u *)"diff", (long)value, NULL, OPT_LOCAL); --curbuf_lock; curwin = old_curwin; curbuf = curwin->w_buffer; @@ -1426,27 +1484,30 @@ set_diff_option(win_T *wp, int value) void diff_win_options( win_T *wp, - int addbuf) /* Add buffer to diff. */ + int addbuf) // Add buffer to diff. { # ifdef FEAT_FOLDING win_T *old_curwin = curwin; - /* close the manually opened folds */ + // close the manually opened folds curwin = wp; newFoldLevel(); curwin = old_curwin; # endif - /* Use 'scrollbind' and 'cursorbind' when available */ + // Use 'scrollbind' and 'cursorbind' when available if (!wp->w_p_diff) wp->w_p_scb_save = wp->w_p_scb; wp->w_p_scb = TRUE; if (!wp->w_p_diff) wp->w_p_crb_save = wp->w_p_crb; wp->w_p_crb = TRUE; - if (!wp->w_p_diff) - wp->w_p_wrap_save = wp->w_p_wrap; - wp->w_p_wrap = FALSE; + if (!(diff_flags & DIFF_FOLLOWWRAP)) + { + if (!wp->w_p_diff) + wp->w_p_wrap_save = wp->w_p_wrap; + wp->w_p_wrap = FALSE; + } # ifdef FEAT_FOLDING if (!wp->w_p_diff) { @@ -1466,12 +1527,12 @@ diff_win_options( wp->w_p_fen = TRUE; wp->w_p_fdl = 0; foldUpdateAll(wp); - /* make sure topline is not halfway a fold */ + // make sure topline is not halfway a fold changed_window_setting_win(wp); # endif if (vim_strchr(p_sbo, 'h') == NULL) do_cmdline_cmd((char_u *)"set sbo+=hor"); - /* Save the current values, to be restored in ex_diffoff(). */ + // Save the current values, to be restored in ex_diffoff(). wp->w_p_diff_saved = TRUE; set_diff_option(wp, TRUE); @@ -1495,9 +1556,9 @@ ex_diffoff(exarg_T *eap) { if (eap->forceit ? wp->w_p_diff : wp == curwin) { - /* Set 'diff' off. If option values were saved in - * diff_win_options(), restore the ones whose settings seem to have - * been left over from diff mode. */ + // Set 'diff' off. If option values were saved in + // diff_win_options(), restore the ones whose settings seem to have + // been left over from diff mode. set_diff_option(wp, FALSE); if (wp->w_p_diff_saved) @@ -1507,8 +1568,11 @@ ex_diffoff(exarg_T *eap) wp->w_p_scb = wp->w_p_scb_save; if (wp->w_p_crb) wp->w_p_crb = wp->w_p_crb_save; - if (!wp->w_p_wrap) - wp->w_p_wrap = wp->w_p_wrap_save; + if (!(diff_flags & DIFF_FOLLOWWRAP)) + { + if (!wp->w_p_wrap) + wp->w_p_wrap = wp->w_p_wrap_save; + } #ifdef FEAT_FOLDING free_string_option(wp->w_p_fdm); wp->w_p_fdm = vim_strsave( @@ -1519,8 +1583,8 @@ ex_diffoff(exarg_T *eap) if (wp->w_p_fdl == 0) wp->w_p_fdl = wp->w_p_fdl_save; - /* Only restore 'foldenable' when 'foldmethod' is not - * "manual", otherwise we continue to show the diff folds. */ + // Only restore 'foldenable' when 'foldmethod' is not + // "manual", otherwise we continue to show the diff folds. if (wp->w_p_fen) wp->w_p_fen = foldmethodIsManual(wp) ? FALSE : wp->w_p_fen_save; @@ -1528,24 +1592,32 @@ ex_diffoff(exarg_T *eap) foldUpdateAll(wp); #endif } - /* remove filler lines */ + // remove filler lines wp->w_topfill = 0; - /* make sure topline is not halfway a fold and cursor is - * invalidated */ + // make sure topline is not halfway a fold and cursor is + // invalidated changed_window_setting_win(wp); - /* Note: 'sbo' is not restored, it's a global option. */ + // Note: 'sbo' is not restored, it's a global option. diff_buf_adjust(wp); } diffwin |= wp->w_p_diff; } - /* Also remove hidden buffers from the list. */ + // Also remove hidden buffers from the list. if (eap->forceit) diff_buf_clear(); - /* Remove "hor" from from 'scrollopt' if there are no diff windows left. */ + if (!diffwin) + { + diff_need_update = FALSE; + curtab->tp_diff_invalid = FALSE; + curtab->tp_diff_update = FALSE; + diff_clear(curtab); + } + + // Remove "hor" from 'scrollopt' if there are no diff windows left. if (!diffwin && vim_strchr(p_sbo, 'h') != NULL) do_cmdline_cmd((char_u *)"set sbo-=hor"); } @@ -1557,20 +1629,21 @@ ex_diffoff(exarg_T *eap) diff_read( int idx_orig, // idx of original file int idx_new, // idx of new file - diffout_T *dout) // diff output + diffio_T *dio) // diff output { FILE *fd = NULL; int line_idx = 0; diff_T *dprev = NULL; diff_T *dp = curtab->tp_first_diff; diff_T *dn, *dpl; - char_u linebuf[LBUFLEN]; /* only need to hold the diff line */ + diffout_T *dout = &dio->dio_diff; + char_u linebuf[LBUFLEN]; // only need to hold the diff line char_u *line; long off; int i; - linenr_T lnum_orig, lnum_new; - long count_orig, count_new; - int notset = TRUE; /* block "*dp" not set yet */ + int notset = TRUE; // block "*dp" not set yet + diffhunk_T *hunk = NULL; // init to avoid gcc warning + enum { DIFF_ED, DIFF_UNIFIED, @@ -1586,80 +1659,100 @@ diff_read( fd = mch_fopen((char *)dout->dout_fname, "r"); if (fd == NULL) { - emsg(_("E98: Cannot read diff output")); + emsg(_(e_cannot_read_diff_output)); return; } } - for (;;) + if (!dio->dio_internal) { - if (fd == NULL) - { - if (line_idx >= dout->dout_ga.ga_len) - break; // did last line - line = ((char_u **)dout->dout_ga.ga_data)[line_idx++]; - } - else + hunk = ALLOC_ONE(diffhunk_T); + if (hunk == NULL) { - if (vim_fgets(linebuf, LBUFLEN, fd)) - break; // end of file - line = linebuf; - } - - if (diffstyle == DIFF_NONE) - { - // Determine diff style. - // ed like diff looks like this: - // {first}[,{last}]c{first}[,{last}] - // {first}a{first}[,{last}] - // {first}[,{last}]d{first} - // - // unified diff looks like this: - // --- file1 2018-03-20 13:23:35.783153140 +0100 - // +++ file2 2018-03-20 13:23:41.183156066 +0100 - // @@ -1,3 +1,5 @@ - if (isdigit(*line)) - diffstyle = DIFF_ED; - else if ((STRNCMP(line, "@@ ", 3) == 0)) - diffstyle = DIFF_UNIFIED; - else if ((STRNCMP(line, "--- ", 4) == 0) - && (vim_fgets(linebuf, LBUFLEN, fd) == 0) - && (STRNCMP(line, "+++ ", 4) == 0) - && (vim_fgets(linebuf, LBUFLEN, fd) == 0) - && (STRNCMP(line, "@@ ", 3) == 0)) - diffstyle = DIFF_UNIFIED; - else - // Format not recognized yet, skip over this line. Cygwin diff - // may put a warning at the start of the file. - continue; + if (fd != NULL) + fclose(fd); + return; } + } - if (diffstyle == DIFF_ED) - { - if (!isdigit(*line)) - continue; // not the start of a diff block - if (parse_diff_ed(line, &lnum_orig, &count_orig, - &lnum_new, &count_new) == FAIL) - continue; - } - else if (diffstyle == DIFF_UNIFIED) + for (;;) + { + if (dio->dio_internal) { - if (STRNCMP(line, "@@ ", 3) != 0) - continue; // not the start of a diff block - if (parse_diff_unified(line, &lnum_orig, &count_orig, - &lnum_new, &count_new) == FAIL) - continue; + if (line_idx >= dout->dout_ga.ga_len) { + break; // did last line + } + hunk = ((diffhunk_T **)dout->dout_ga.ga_data)[line_idx++]; } else { - emsg(_("E959: Invalid diff format.")); - break; + if (fd == NULL) + { + if (line_idx >= dout->dout_ga.ga_len) + break; // did last line + line = ((char_u **)dout->dout_ga.ga_data)[line_idx++]; + } + else + { + if (vim_fgets(linebuf, LBUFLEN, fd)) + break; // end of file + line = linebuf; + } + + if (diffstyle == DIFF_NONE) + { + // Determine diff style. + // ed like diff looks like this: + // {first}[,{last}]c{first}[,{last}] + // {first}a{first}[,{last}] + // {first}[,{last}]d{first} + // + // unified diff looks like this: + // --- file1 2018-03-20 13:23:35.783153140 +0100 + // +++ file2 2018-03-20 13:23:41.183156066 +0100 + // @@ -1,3 +1,5 @@ + if (isdigit(*line)) + diffstyle = DIFF_ED; + else if ((STRNCMP(line, "@@ ", 3) == 0)) + diffstyle = DIFF_UNIFIED; + else if ((STRNCMP(line, "--- ", 4) == 0) + && (vim_fgets(linebuf, LBUFLEN, fd) == 0) + && (STRNCMP(line, "+++ ", 4) == 0) + && (vim_fgets(linebuf, LBUFLEN, fd) == 0) + && (STRNCMP(line, "@@ ", 3) == 0)) + diffstyle = DIFF_UNIFIED; + else + // Format not recognized yet, skip over this line. Cygwin + // diff may put a warning at the start of the file. + continue; + } + + if (diffstyle == DIFF_ED) + { + if (!isdigit(*line)) + continue; // not the start of a diff block + if (parse_diff_ed(line, hunk) == FAIL) + continue; + } + else if (diffstyle == DIFF_UNIFIED) + { + if (STRNCMP(line, "@@ ", 3) != 0) + continue; // not the start of a diff block + if (parse_diff_unified(line, hunk) == FAIL) + continue; + } + else + { + emsg(_(e_invalid_diff_format)); + break; + } } // Go over blocks before the change, for which orig and new are equal. // Copy blocks from orig to new. while (dp != NULL - && lnum_orig > dp->df_lnum[idx_orig] + dp->df_count[idx_orig]) + && hunk->lnum_orig > dp->df_lnum[idx_orig] + + dp->df_count[idx_orig]) { if (notset) diff_copy_entry(dprev, dp, idx_orig, idx_new); @@ -1669,41 +1762,43 @@ diff_read( } if (dp != NULL - && lnum_orig <= dp->df_lnum[idx_orig] + dp->df_count[idx_orig] - && lnum_orig + count_orig >= dp->df_lnum[idx_orig]) + && hunk->lnum_orig <= dp->df_lnum[idx_orig] + + dp->df_count[idx_orig] + && hunk->lnum_orig + hunk->count_orig >= dp->df_lnum[idx_orig]) { // New block overlaps with existing block(s). // First find last block that overlaps. for (dpl = dp; dpl->df_next != NULL; dpl = dpl->df_next) - if (lnum_orig + count_orig < dpl->df_next->df_lnum[idx_orig]) + if (hunk->lnum_orig + hunk->count_orig + < dpl->df_next->df_lnum[idx_orig]) break; // If the newly found block starts before the old one, set the // start back a number of lines. - off = dp->df_lnum[idx_orig] - lnum_orig; + off = dp->df_lnum[idx_orig] - hunk->lnum_orig; if (off > 0) { for (i = idx_orig; i < idx_new; ++i) if (curtab->tp_diffbuf[i] != NULL) dp->df_lnum[i] -= off; - dp->df_lnum[idx_new] = lnum_new; - dp->df_count[idx_new] = count_new; + dp->df_lnum[idx_new] = hunk->lnum_new; + dp->df_count[idx_new] = hunk->count_new; } else if (notset) { // new block inside existing one, adjust new block - dp->df_lnum[idx_new] = lnum_new + off; - dp->df_count[idx_new] = count_new - off; + dp->df_lnum[idx_new] = hunk->lnum_new + off; + dp->df_count[idx_new] = hunk->count_new - off; } else // second overlap of new block with existing block - dp->df_count[idx_new] += count_new - count_orig + dp->df_count[idx_new] += hunk->count_new - hunk->count_orig + dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig] - (dp->df_lnum[idx_orig] + dp->df_count[idx_orig]); // Adjust the size of the block to include all the lines to the // end of the existing block or the new diff, whatever ends last. - off = (lnum_orig + count_orig) + off = (hunk->lnum_orig + hunk->count_orig) - (dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig]); if (off < 0) { @@ -1735,10 +1830,10 @@ diff_read( if (dp == NULL) goto done; - dp->df_lnum[idx_orig] = lnum_orig; - dp->df_count[idx_orig] = count_orig; - dp->df_lnum[idx_new] = lnum_new; - dp->df_count[idx_new] = count_new; + dp->df_lnum[idx_orig] = hunk->lnum_orig; + dp->df_count[idx_orig] = hunk->count_orig; + dp->df_lnum[idx_new] = hunk->lnum_new; + dp->df_count[idx_new] = hunk->count_new; // Set values for other buffers, these must be equal to the // original buffer, otherwise there would have been a change @@ -1761,6 +1856,9 @@ diff_read( } done: + if (!dio->dio_internal) + vim_free(hunk); + if (fd != NULL) fclose(fd); } @@ -1814,7 +1912,7 @@ diff_clear(tabpage_T *tp) int diff_check(win_T *wp, linenr_T lnum) { - int idx; /* index in tp_diffbuf[] for this buffer */ + int idx; // index in tp_diffbuf[] for this buffer diff_T *dp; int maxcount; int i; @@ -1822,27 +1920,27 @@ diff_check(win_T *wp, linenr_T lnum) int cmp; if (curtab->tp_diff_invalid) - ex_diffupdate(NULL); /* update after a big change */ + ex_diffupdate(NULL); // update after a big change - if (curtab->tp_first_diff == NULL || !wp->w_p_diff) /* no diffs at all */ + if (curtab->tp_first_diff == NULL || !wp->w_p_diff) // no diffs at all return 0; - /* safety check: "lnum" must be a buffer line */ + // safety check: "lnum" must be a buffer line if (lnum < 1 || lnum > buf->b_ml.ml_line_count + 1) return 0; idx = diff_buf_idx(buf); if (idx == DB_COUNT) - return 0; /* no diffs for buffer "buf" */ + return 0; // no diffs for buffer "buf" #ifdef FEAT_FOLDING - /* A closed fold never has filler lines. */ + // A closed fold never has filler lines. if (hasFoldingWin(wp, lnum, NULL, NULL, TRUE, NULL)) return 0; #endif - /* search for a change that includes "lnum" in the list of diffblocks. */ - for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + // search for a change that includes "lnum" in the list of diffblocks. + FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) break; if (dp == NULL || lnum < dp->df_lnum[idx]) @@ -1852,9 +1950,9 @@ diff_check(win_T *wp, linenr_T lnum) { int zero = FALSE; - /* Changed or inserted line. If the other buffers have a count of - * zero, the lines were inserted. If the other buffers have the same - * count, check if the lines are identical. */ + // Changed or inserted line. If the other buffers have a count of + // zero, the lines were inserted. If the other buffers have the same + // count, check if the lines are identical. cmp = FALSE; for (i = 0; i < DB_COUNT; ++i) if (i != idx && curtab->tp_diffbuf[i] != NULL) @@ -1864,36 +1962,36 @@ diff_check(win_T *wp, linenr_T lnum) else { if (dp->df_count[i] != dp->df_count[idx]) - return -1; /* nr of lines changed. */ + return -1; // nr of lines changed. cmp = TRUE; } } if (cmp) { - /* Compare all lines. If they are equal the lines were inserted - * in some buffers, deleted in others, but not changed. */ + // Compare all lines. If they are equal the lines were inserted + // in some buffers, deleted in others, but not changed. for (i = 0; i < DB_COUNT; ++i) if (i != idx && curtab->tp_diffbuf[i] != NULL && dp->df_count[i] != 0) if (!diff_equal_entry(dp, idx, i)) return -1; } - /* If there is no buffer with zero lines then there is no difference - * any longer. Happens when making a change (or undo) that removes - * the difference. Can't remove the entry here, we might be halfway - * updating the window. Just report the text as unchanged. Other - * windows might still show the change though. */ + // If there is no buffer with zero lines then there is no difference + // any longer. Happens when making a change (or undo) that removes + // the difference. Can't remove the entry here, we might be halfway + // updating the window. Just report the text as unchanged. Other + // windows might still show the change though. if (zero == FALSE) return 0; return -2; } - /* If 'diffopt' doesn't contain "filler", return 0. */ + // If 'diffopt' doesn't contain "filler", return 0. if (!(diff_flags & DIFF_FILLER)) return 0; - /* Insert filler lines above the line just below the change. Will return - * 0 when this buf had the max count. */ + // Insert filler lines above the line just below the change. Will return + // 0 when this buf had the max count. maxcount = 0; for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] != NULL && dp->df_count[i] > maxcount) @@ -2020,7 +2118,7 @@ diff_check_fill(win_T *wp, linenr_T lnum) { int n; - /* be quick when there are no filler lines */ + // be quick when there are no filler lines if (!(diff_flags & DIFF_FILLER)) return 0; n = diff_check(wp, lnum); @@ -2046,36 +2144,36 @@ diff_set_topline(win_T *fromwin, win_T *towin) fromidx = diff_buf_idx(frombuf); if (fromidx == DB_COUNT) - return; /* safety check */ + return; // safety check if (curtab->tp_diff_invalid) - ex_diffupdate(NULL); /* update after a big change */ + ex_diffupdate(NULL); // update after a big change towin->w_topfill = 0; - /* search for a change that includes "lnum" in the list of diffblocks. */ - for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + // search for a change that includes "lnum" in the list of diffblocks. + FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) if (lnum <= dp->df_lnum[fromidx] + dp->df_count[fromidx]) break; if (dp == NULL) { - /* After last change, compute topline relative to end of file; no - * filler lines. */ + // After last change, compute topline relative to end of file; no + // filler lines. towin->w_topline = towin->w_buffer->b_ml.ml_line_count - (frombuf->b_ml.ml_line_count - lnum); } else { - /* Find index for "towin". */ + // Find index for "towin". toidx = diff_buf_idx(towin->w_buffer); if (toidx == DB_COUNT) - return; /* safety check */ + return; // safety check towin->w_topline = lnum + (dp->df_lnum[toidx] - dp->df_lnum[fromidx]); if (lnum >= dp->df_lnum[fromidx]) { - /* Inside a change: compute filler lines. With three or more - * buffers we need to know the largest count. */ + // Inside a change: compute filler lines. With three or more + // buffers we need to know the largest count. max_count = 0; for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] != NULL @@ -2084,24 +2182,24 @@ diff_set_topline(win_T *fromwin, win_T *towin) if (dp->df_count[toidx] == dp->df_count[fromidx]) { - /* same number of lines: use same filler count */ + // same number of lines: use same filler count towin->w_topfill = fromwin->w_topfill; } else if (dp->df_count[toidx] > dp->df_count[fromidx]) { if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) { - /* more lines in towin and fromwin doesn't show diff - * lines, only filler lines */ + // more lines in towin and fromwin doesn't show diff + // lines, only filler lines if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) { - /* towin also only shows filler lines */ + // towin also only shows filler lines towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; towin->w_topfill = fromwin->w_topfill; } else - /* towin still has some diff lines to show */ + // towin still has some diff lines to show towin->w_topline = dp->df_lnum[toidx] + max_count - fromwin->w_topfill; } @@ -2109,16 +2207,16 @@ diff_set_topline(win_T *fromwin, win_T *towin) else if (towin->w_topline >= dp->df_lnum[toidx] + dp->df_count[toidx]) { - /* less lines in towin and no diff lines to show: compute - * filler lines */ + // less lines in towin and no diff lines to show: compute + // filler lines towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; if (diff_flags & DIFF_FILLER) { if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) - /* fromwin is also out of diff lines */ + // fromwin is also out of diff lines towin->w_topfill = fromwin->w_topfill; else - /* fromwin has some diff lines */ + // fromwin has some diff lines towin->w_topfill = dp->df_lnum[fromidx] + max_count - lnum; } @@ -2126,7 +2224,7 @@ diff_set_topline(win_T *fromwin, win_T *towin) } } - /* safety check (if diff info gets outdated strange things may happen) */ + // safety check (if diff info gets outdated strange things may happen) towin->w_botfill = FALSE; if (towin->w_topline > towin->w_buffer->b_ml.ml_line_count) { @@ -2139,7 +2237,7 @@ diff_set_topline(win_T *fromwin, win_T *towin) towin->w_topfill = 0; } - /* When w_topline changes need to recompute w_botline and cursor position */ + // When w_topline changes need to recompute w_botline and cursor position invalidate_botline_win(towin); changed_line_abv_curs_win(towin); @@ -2222,6 +2320,16 @@ diffopt_changed(void) p += 9; diff_flags_new |= DIFF_HIDDEN_OFF; } + else if (STRNCMP(p, "closeoff", 8) == 0) + { + p += 8; + diff_flags_new |= DIFF_CLOSE_OFF; + } + else if (STRNCMP(p, "followwrap", 10) == 0) + { + p += 10; + diff_flags_new |= DIFF_FOLLOWWRAP; + } else if (STRNCMP(p, "indent-heuristic", 16) == 0) { p += 16; @@ -2267,7 +2375,7 @@ diffopt_changed(void) diff_algorithm_new |= diff_indent_heuristic; - /* Can't have both "horizontal" and "vertical". */ + // Can't have both "horizontal" and "vertical". if ((diff_flags_new & DIFF_HORIZONTAL) && (diff_flags_new & DIFF_VERTICAL)) return FAIL; @@ -2284,8 +2392,8 @@ diffopt_changed(void) diff_redraw(TRUE); - /* recompute the scroll binding with the new option value, may - * remove or add filler lines */ + // recompute the scroll binding with the new option value, may + // remove or add filler lines check_scrollbind((linenr_T)0, 0L); return OK; @@ -2309,6 +2417,15 @@ diffopt_hiddenoff(void) return (diff_flags & DIFF_HIDDEN_OFF) != 0; } +/* + * Return TRUE if 'diffopt' contains "closeoff". + */ + int +diffopt_closeoff(void) +{ + return (diff_flags & DIFF_CLOSE_OFF) != 0; +} + /* * Find the difference within a changed line. * Returns TRUE if the line was added, no other buffer has it. @@ -2317,8 +2434,8 @@ diffopt_hiddenoff(void) diff_find_change( win_T *wp, linenr_T lnum, - int *startp, /* first char of the change */ - int *endp) /* last char of the change */ + int *startp, // first char of the change + int *endp) // last char of the change { char_u *line_org; char_u *line_new; @@ -2332,20 +2449,20 @@ diff_find_change( char_u *p1, *p2; int l; - /* Make a copy of the line, the next ml_get() will invalidate it. */ + // Make a copy of the line, the next ml_get() will invalidate it. line_org = vim_strsave(ml_get_buf(wp->w_buffer, lnum, FALSE)); if (line_org == NULL) return FALSE; idx = diff_buf_idx(wp->w_buffer); - if (idx == DB_COUNT) /* cannot happen */ + if (idx == DB_COUNT) // cannot happen { vim_free(line_org); return FALSE; } - /* search for a change that includes "lnum" in the list of diffblocks. */ - for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + // search for a change that includes "lnum" in the list of diffblocks. + FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) break; if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL) @@ -2359,14 +2476,14 @@ diff_find_change( for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] != NULL && i != idx) { - /* Skip lines that are not in the other change (filler lines). */ + // Skip lines that are not in the other change (filler lines). if (off >= dp->df_count[i]) continue; added = FALSE; line_new = ml_get_buf(curtab->tp_diffbuf[i], dp->df_lnum[i] + off, FALSE); - /* Search for start of difference */ + // Search for start of difference si_org = si_new = 0; while (line_org[si_org] != NUL) { @@ -2391,15 +2508,15 @@ diff_find_change( } if (has_mbyte) { - /* Move back to first byte of character in both lines (may - * have "nn^" in line_org and "n^ in line_new). */ + // Move back to first byte of character in both lines (may + // have "nn^" in line_org and "n^ in line_new). si_org -= (*mb_head_off)(line_org, line_org + si_org); si_new -= (*mb_head_off)(line_new, line_new + si_new); } if (*startp > si_org) *startp = si_org; - /* Search for end of difference, if any. */ + // Search for end of difference, if any. if (line_org[si_org] != NUL || line_new[si_new] != NUL) { ei_org = (int)STRLEN(line_org); @@ -2456,7 +2573,7 @@ diff_infold(win_T *wp, linenr_T lnum) int other = FALSE; diff_T *dp; - /* Return if 'diff' isn't set. */ + // Return if 'diff' isn't set. if (!wp->w_p_diff) return FALSE; @@ -2468,23 +2585,23 @@ diff_infold(win_T *wp, linenr_T lnum) other = TRUE; } - /* return here if there are no diffs in the window */ + // return here if there are no diffs in the window if (idx == -1 || !other) return FALSE; if (curtab->tp_diff_invalid) - ex_diffupdate(NULL); /* update after a big change */ + ex_diffupdate(NULL); // update after a big change - /* Return if there are no diff blocks. All lines will be folded. */ + // Return if there are no diff blocks. All lines will be folded. if (curtab->tp_first_diff == NULL) return TRUE; - for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) { - /* If this change is below the line there can't be any further match. */ + // If this change is below the line there can't be any further match. if (dp->df_lnum[idx] - diff_context > lnum) break; - /* If this change ends before the line we have a match. */ + // If this change ends before the line we have a match. if (dp->df_lnum[idx] + dp->df_count[idx] + diff_context > lnum) return FALSE; } @@ -2552,17 +2669,17 @@ ex_diffgetput(exarg_T *eap) int buf_empty; int found_not_ma = FALSE; - /* Find the current buffer in the list of diff buffers. */ + // Find the current buffer in the list of diff buffers. idx_cur = diff_buf_idx(curbuf); if (idx_cur == DB_COUNT) { - emsg(_("E99: Current buffer is not in diff mode")); + emsg(_(e_current_buffer_is_not_in_diff_mode)); return; } if (*eap->arg == NUL) { - /* No argument: Find the other buffer in the list of diff buffers. */ + // No argument: Find the other buffer in the list of diff buffers. for (idx_other = 0; idx_other < DB_COUNT; ++idx_other) if (curtab->tp_diffbuf[idx_other] != curbuf && curtab->tp_diffbuf[idx_other] != NULL) @@ -2575,61 +2692,61 @@ ex_diffgetput(exarg_T *eap) if (idx_other == DB_COUNT) { if (found_not_ma) - emsg(_("E793: No other buffer in diff mode is modifiable")); + emsg(_(e_no_other_buffer_in_diff_mode_is_modifiable)); else - emsg(_("E100: No other buffer in diff mode")); + emsg(_(e_no_other_buffer_in_diff_mode)); return; } - /* Check that there isn't a third buffer in the list */ + // Check that there isn't a third buffer in the list for (i = idx_other + 1; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] != curbuf && curtab->tp_diffbuf[i] != NULL && (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma)) { - emsg(_("E101: More than two buffers in diff mode, don't know which one to use")); + emsg(_(e_more_than_two_buffers_in_diff_mode_dont_know_which_one_to_use)); return; } } else { - /* Buffer number or pattern given. Ignore trailing white space. */ + // Buffer number or pattern given. Ignore trailing white space. p = eap->arg + STRLEN(eap->arg); while (p > eap->arg && VIM_ISWHITE(p[-1])) --p; for (i = 0; vim_isdigit(eap->arg[i]) && eap->arg + i < p; ++i) ; - if (eap->arg + i == p) /* digits only */ + if (eap->arg + i == p) // digits only i = atol((char *)eap->arg); else { i = buflist_findpat(eap->arg, p, FALSE, TRUE, FALSE); if (i < 0) - return; /* error message already given */ + return; // error message already given } buf = buflist_findnr(i); if (buf == NULL) { - semsg(_("E102: Can't find buffer \"%s\""), eap->arg); + semsg(_(e_cant_find_buffer_str), eap->arg); return; } if (buf == curbuf) - return; /* nothing to do */ + return; // nothing to do idx_other = diff_buf_idx(buf); if (idx_other == DB_COUNT) { - semsg(_("E103: Buffer \"%s\" is not in diff mode"), eap->arg); + semsg(_(e_buffer_str_is_not_in_diff_mode), eap->arg); return; } } diff_busy = TRUE; - /* When no range given include the line above or below the cursor. */ + // When no range given include the line above or below the cursor. if (eap->addr_count == 0) { - /* Make it possible that ":diffget" on the last line gets line below - * the cursor line when there is no difference above the cursor. */ + // Make it possible that ":diffget" on the last line gets line below + // the cursor line when there is no difference above the cursor. if (eap->cmdidx == CMD_diffget && eap->line1 == curbuf->b_ml.ml_line_count && diff_check(curwin, eap->line1) == 0 @@ -2648,21 +2765,21 @@ ex_diffgetput(exarg_T *eap) { idx_from = idx_cur; idx_to = idx_other; - /* Need to make the other buffer the current buffer to be able to make - * changes in it. */ - /* set curwin/curbuf to buf and save a few things */ + // Need to make the other buffer the current buffer to be able to make + // changes in it. + // set curwin/curbuf to buf and save a few things aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]); } - /* May give the warning for a changed buffer here, which can trigger the - * FileChangedRO autocommand, which may do nasty things and mess - * everything up. */ + // May give the warning for a changed buffer here, which can trigger the + // FileChangedRO autocommand, which may do nasty things and mess + // everything up. if (!curbuf->b_changed) { change_warning(0); if (diff_buf_idx(curbuf) != idx_to) { - emsg(_("E787: Buffer changed unexpectedly")); + emsg(_(e_buffer_changed_unexpectedly)); goto theend; } } @@ -2671,7 +2788,7 @@ ex_diffgetput(exarg_T *eap) for (dp = curtab->tp_first_diff; dp != NULL; ) { if (dp->df_lnum[idx_cur] > eap->line2 + off) - break; /* past the range that was specified */ + break; // past the range that was specified dfree = NULL; lnum = dp->df_lnum[idx_to]; @@ -2679,16 +2796,16 @@ ex_diffgetput(exarg_T *eap) if (dp->df_lnum[idx_cur] + dp->df_count[idx_cur] > eap->line1 + off && u_save(lnum - 1, lnum + count) != FAIL) { - /* Inside the specified range and saving for undo worked. */ + // Inside the specified range and saving for undo worked. start_skip = 0; end_skip = 0; if (eap->addr_count > 0) { - /* A range was specified: check if lines need to be skipped. */ + // A range was specified: check if lines need to be skipped. start_skip = eap->line1 + off - dp->df_lnum[idx_cur]; if (start_skip > 0) { - /* range starts below start of current diff block */ + // range starts below start of current diff block if (start_skip > count) { lnum += count; @@ -2707,14 +2824,14 @@ ex_diffgetput(exarg_T *eap) - (eap->line2 + off); if (end_skip > 0) { - /* range ends above end of current/from diff block */ - if (idx_cur == idx_from) /* :diffput */ + // range ends above end of current/from diff block + if (idx_cur == idx_from) // :diffput { i = dp->df_count[idx_cur] - start_skip - end_skip; if (count > i) count = i; } - else /* :diffget */ + else // :diffget { count -= end_skip; end_skip = dp->df_count[idx_from] - start_skip - count; @@ -2730,9 +2847,9 @@ ex_diffgetput(exarg_T *eap) added = 0; for (i = 0; i < count; ++i) { - /* remember deleting the last line of the buffer */ + // remember deleting the last line of the buffer buf_empty = curbuf->b_ml.ml_line_count == 1; - ml_delete(lnum, FALSE); + ml_delete(lnum); --added; } for (i = 0; i < dp->df_count[idx_from] - start_skip - end_skip; ++i) @@ -2751,10 +2868,10 @@ ex_diffgetput(exarg_T *eap) ++added; if (buf_empty && curbuf->b_ml.ml_line_count == 2) { - /* Added the first line into an empty buffer, need to - * delete the dummy empty line. */ + // Added the first line into an empty buffer, need to + // delete the dummy empty line. buf_empty = FALSE; - ml_delete((linenr_T)2, FALSE); + ml_delete((linenr_T)2); } } } @@ -2763,8 +2880,8 @@ ex_diffgetput(exarg_T *eap) if (start_skip == 0 && end_skip == 0) { - /* Check if there are any other buffers and if the diff is - * equal in them. */ + // Check if there are any other buffers and if the diff is + // equal in them. for (i = 0; i < DB_COUNT; ++i) if (curtab->tp_diffbuf[i] != NULL && i != idx_from && i != idx_to @@ -2772,7 +2889,7 @@ ex_diffgetput(exarg_T *eap) break; if (i == DB_COUNT) { - /* delete the diff entry, the buffers are now equal here */ + // delete the diff entry, the buffers are now equal here dfree = dp; dp = dp->df_next; if (dprev == NULL) @@ -2782,14 +2899,14 @@ ex_diffgetput(exarg_T *eap) } } - /* Adjust marks. This will change the following entries! */ + // Adjust marks. This will change the following entries! if (added != 0) { mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, (long)added); if (curwin->w_cursor.lnum >= lnum) { - /* Adjust the cursor position if it's in/after the changed - * lines. */ + // Adjust the cursor position if it's in/after the changed + // lines. if (curwin->w_cursor.lnum >= lnum + count) curwin->w_cursor.lnum += added; else if (added < 0) @@ -2800,22 +2917,22 @@ ex_diffgetput(exarg_T *eap) if (dfree != NULL) { - /* Diff is deleted, update folds in other windows. */ + // Diff is deleted, update folds in other windows. #ifdef FEAT_FOLDING diff_fold_update(dfree, idx_to); #endif vim_free(dfree); } else - /* mark_adjust() may have changed the count in a wrong way */ + // mark_adjust() may have changed the count in a wrong way dp->df_count[idx_to] = new_count; - /* When changing the current buffer, keep track of line numbers */ + // When changing the current buffer, keep track of line numbers if (idx_cur == idx_to) off += added; } - /* If before the range or not deleted, go to next diff. */ + // If before the range or not deleted, go to next diff. if (dfree == NULL) { dprev = dp; @@ -2823,12 +2940,12 @@ ex_diffgetput(exarg_T *eap) } } - /* restore curwin/curbuf and a few other things */ + // restore curwin/curbuf and a few other things if (eap->cmdidx != CMD_diffget) { - /* Syncing undo only works for the current buffer, but we change - * another buffer. Sync undo if the command was typed. This isn't - * 100% right when ":diffput" is used in a function or mapping. */ + // Syncing undo only works for the current buffer, but we change + // another buffer. Sync undo if the command was typed. This isn't + // 100% right when ":diffput" is used in a function or mapping. if (KeyTyped) u_sync(FALSE); aucmd_restbuf(&aco); @@ -2906,14 +3023,14 @@ diff_move_to(int dir, long count) return FAIL; if (curtab->tp_diff_invalid) - ex_diffupdate(NULL); /* update after a big change */ + ex_diffupdate(NULL); // update after a big change - if (curtab->tp_first_diff == NULL) /* no diffs today */ + if (curtab->tp_first_diff == NULL) // no diffs today return FAIL; while (--count >= 0) { - /* Check if already before first diff. */ + // Check if already before first diff. if (dir == BACKWARD && lnum <= curtab->tp_first_diff->df_lnum[idx]) break; @@ -2932,11 +3049,11 @@ diff_move_to(int dir, long count) } } - /* don't end up past the end of the file */ + // don't end up past the end of the file if (lnum > curbuf->b_ml.ml_line_count) lnum = curbuf->b_ml.ml_line_count; - /* When the cursor didn't move at all we fail. */ + // When the cursor didn't move at all we fail. if (lnum == curwin->w_cursor.lnum) return FAIL; @@ -2967,18 +3084,18 @@ diff_get_corresponding_line_int( return lnum1; if (curtab->tp_diff_invalid) - ex_diffupdate(NULL); /* update after a big change */ + ex_diffupdate(NULL); // update after a big change - if (curtab->tp_first_diff == NULL) /* no diffs today */ + if (curtab->tp_first_diff == NULL) // no diffs today return lnum1; - for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) { if (dp->df_lnum[idx1] > lnum1) return lnum1 - baseline; if ((dp->df_lnum[idx1] + dp->df_count[idx1]) > lnum1) { - /* Inside the diffblock */ + // Inside the diffblock baseline = lnum1 - dp->df_lnum[idx1]; if (baseline > dp->df_count[idx2]) baseline = dp->df_count[idx2]; @@ -3002,7 +3119,7 @@ diff_get_corresponding_line_int( - (dp->df_lnum[idx2] + dp->df_count[idx2]); } - /* If we get here then the cursor is after the last diff */ + // If we get here then the cursor is after the last diff return lnum1 - baseline; } @@ -3015,7 +3132,7 @@ diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1) { linenr_T lnum = diff_get_corresponding_line_int(buf1, lnum1); - /* don't end up past the end of the file */ + // don't end up past the end of the file if (lnum > curbuf->b_ml.ml_line_count) return curbuf->b_ml.ml_line_count; return lnum; @@ -3034,25 +3151,25 @@ diff_lnum_win(linenr_T lnum, win_T *wp) linenr_T n; idx = diff_buf_idx(curbuf); - if (idx == DB_COUNT) /* safety check */ + if (idx == DB_COUNT) // safety check return (linenr_T)0; if (curtab->tp_diff_invalid) - ex_diffupdate(NULL); /* update after a big change */ + ex_diffupdate(NULL); // update after a big change - /* search for a change that includes "lnum" in the list of diffblocks. */ - for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + // search for a change that includes "lnum" in the list of diffblocks. + FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) break; - /* When after the last change, compute relative to the last line number. */ + // When after the last change, compute relative to the last line number. if (dp == NULL) return wp->w_buffer->b_ml.ml_line_count - (curbuf->b_ml.ml_line_count - lnum); - /* Find index for "wp". */ + // Find index for "wp". i = diff_buf_idx(wp->w_buffer); - if (i == DB_COUNT) /* safety check */ + if (i == DB_COUNT) // safety check return (linenr_T)0; n = lnum + (dp->df_lnum[i] - dp->df_lnum[idx]); @@ -3068,10 +3185,7 @@ diff_lnum_win(linenr_T lnum, win_T *wp) static int parse_diff_ed( char_u *line, - linenr_T *lnum_orig, - long *count_orig, - linenr_T *lnum_new, - long *count_new) + diffhunk_T *hunk) { char_u *p; long f1, l1, f2, l2; @@ -3106,23 +3220,23 @@ parse_diff_ed( if (difftype == 'a') { - *lnum_orig = f1 + 1; - *count_orig = 0; + hunk->lnum_orig = f1 + 1; + hunk->count_orig = 0; } else { - *lnum_orig = f1; - *count_orig = l1 - f1 + 1; + hunk->lnum_orig = f1; + hunk->count_orig = l1 - f1 + 1; } if (difftype == 'd') { - *lnum_new = f2 + 1; - *count_new = 0; + hunk->lnum_new = f2 + 1; + hunk->count_new = 0; } else { - *lnum_new = f2; - *count_new = l2 - f2 + 1; + hunk->lnum_new = f2; + hunk->count_new = l2 - f2 + 1; } return OK; } @@ -3134,10 +3248,7 @@ parse_diff_ed( static int parse_diff_unified( char_u *line, - linenr_T *lnum_orig, - long *count_orig, - linenr_T *lnum_new, - long *count_new) + diffhunk_T *hunk) { char_u *p; long oldline, oldcount, newline, newcount; @@ -3176,10 +3287,10 @@ parse_diff_unified( if (newline == 0) newline = 1; - *lnum_orig = oldline; - *count_orig = oldcount; - *lnum_new = newline; - *count_new = newcount; + hunk->lnum_orig = oldline; + hunk->count_orig = oldcount; + hunk->lnum_new = newline; + hunk->count_new = newcount; return OK; } @@ -3192,26 +3303,30 @@ parse_diff_unified( * Stores the diff output in a grow array. */ static int -xdiff_out(void *priv, mmbuffer_t *mb, int nbuf) +xdiff_out( + long start_a, + long count_a, + long start_b, + long count_b, + void *priv) { diffout_T *dout = (diffout_T *)priv; - char_u *p; + diffhunk_T *p = ALLOC_ONE(diffhunk_T); - // The header line always comes by itself, text lines in at least two - // parts. We drop the text part. - if (nbuf > 1) - return 0; - - // sanity check - if (STRNCMP(mb[0].ptr, "@@ ", 3) != 0) - return 0; + if (p == NULL) + return -1; if (ga_grow(&dout->dout_ga, 1) == FAIL) + { + vim_free(p); return -1; - p = vim_strnsave((char_u *)mb[0].ptr, mb[0].size); - if (p == NULL) - return -1; - ((char_u **)dout->dout_ga.ga_data)[dout->dout_ga.ga_len++] = p; + } + + p->lnum_orig = start_a + 1; + p->count_orig = count_a; + p->lnum_new = start_b + 1; + p->count_new = count_b; + ((diffhunk_T **)dout->dout_ga.ga_data)[dout->dout_ga.ga_len++] = p; return 0; } @@ -3226,6 +3341,9 @@ xdiff_out(void *priv, mmbuffer_t *mb, int nbuf) f_diff_filler(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_DIFF + if (in_vim9script() && check_for_lnum_arg(argvars, 0) == FAIL) + return; + rettv->vval.v_number = diff_check_fill(curwin, tv_get_lnum(argvars)); #endif } @@ -3245,7 +3363,7 @@ static __thread hlf_T hlID = (hlf_T)0; f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_DIFF - linenr_T lnum = tv_get_lnum(argvars); + linenr_T lnum; #if !TARGET_OS_IPHONE static linenr_T prev_lnum = 0; static varnumber_T changedtick = 0; @@ -3257,13 +3375,19 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) int filler_lines; int col; - if (lnum < 0) /* ignore type error in {lnum} arg */ + if (in_vim9script() + && (check_for_lnum_arg(argvars,0) == FAIL + || check_for_number_arg(argvars, 1) == FAIL)) + return; + + lnum = tv_get_lnum(argvars); + if (lnum < 0) // ignore type error in {lnum} arg lnum = 0; if (lnum != prev_lnum || changedtick != CHANGEDTICK(curbuf) || fnum != curbuf->b_fnum) { - /* New line, buffer, change: need to get the values. */ + // New line, buffer, change: need to get the values. filler_lines = diff_check(curwin, lnum); if (filler_lines < 0) { @@ -3272,12 +3396,12 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) change_start = MAXCOL; change_end = -1; if (diff_find_change(curwin, lnum, &change_start, &change_end)) - hlID = HLF_ADD; /* added line */ + hlID = HLF_ADD; // added line else - hlID = HLF_CHD; /* changed line */ + hlID = HLF_CHD; // changed line } else - hlID = HLF_ADD; /* added line */ + hlID = HLF_ADD; // added line } else hlID = (hlf_T)0; @@ -3288,11 +3412,11 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (hlID == HLF_CHD || hlID == HLF_TXD) { - col = tv_get_number(&argvars[1]) - 1; /* ignore type error in {col} */ + col = tv_get_number(&argvars[1]) - 1; // ignore type error in {col} if (col >= change_start && col <= change_end) - hlID = HLF_TXD; /* changed text */ + hlID = HLF_TXD; // changed text else - hlID = HLF_CHD; /* changed line */ + hlID = HLF_CHD; // changed line } rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID; #endif diff --git a/src/digraph.c b/src/digraph.c index c36d3e183122d..3c50f0e95122a 100644 --- a/src/digraph.c +++ b/src/digraph.c @@ -26,7 +26,7 @@ typedef struct digraph static void printdigraph(digr_T *dp, result_T *previous); -/* digraphs added by the user */ +// digraphs added by the user static __thread garray_T user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL}; /* @@ -35,402 +35,224 @@ static __thread garray_T user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL}; */ static __thread digr_T digraphdefault[] = -#ifdef __MINT__ - /* - * ATARI digraphs - */ - {{'C', ',', 128}, /* ~@ XX */ - {'u', '"', 129}, /*  */ - {'e', '\'', 130}, /* ‚ */ - {'a', '^', 131}, /* ƒ */ - {'a', '"', 132}, /* „ */ - {'a', '`', 133}, /* … */ - {'a', '@', 134}, /* † */ - {'c', ',', 135}, /* ~G XX */ - {'e', '^', 136}, /* ~H XX */ - {'e', '"', 137}, /* ‰ */ - {'e', '`', 138}, /* Š */ - {'i', '"', 139}, /* ‹ */ - {'i', '^', 140}, /* Œ */ - {'i', '`', 141}, /*  */ - {'A', '"', 142}, /* Ž */ - {'A', '@', 143}, /*  */ - {'E', '\'', 144}, /*  */ - {'a', 'e', 145}, /* ‘ */ - {'A', 'E', 146}, /* ’ */ - {'o', '^', 147}, /* “ */ - {'o', '"', 148}, /* ” */ - {'o', '`', 149}, /* • */ - {'u', '^', 150}, /* – */ - {'u', '`', 151}, /* — */ - {'y', '"', 152}, /* ˜ */ - {'O', '"', 153}, /* ™ */ - {'U', '"', 154}, /* š */ - {'c', '|', 155}, /* › */ - {'$', '$', 156}, /* œ */ - {'Y', '-', 157}, /* ~] XX */ - {'s', 's', 158}, /* ž */ - {'f', 'f', 159}, /* Ÿ */ - {'a', '\'', 160}, /*   */ - {'i', '\'', 161}, /* ÂĄ */ - {'o', '\'', 162}, /* Âĸ */ - {'u', '\'', 163}, /* ÂŖ */ - {'n', '~', 164}, /* ¤ */ - {'N', '~', 165}, /* ÂĨ */ - {'a', 'a', 166}, /* ÂĻ */ - {'o', 'o', 167}, /* § */ - {'~', '?', 168}, /* ¨ */ - {'-', 'a', 169}, /* Š */ - {'a', '-', 170}, /* ÂĒ */ - {'1', '2', 171}, /* ÂĢ */ - {'1', '4', 172}, /* ÂŦ */ - {'~', '!', 173}, /* ­ */ - {'<', '<', 174}, /* ÂŽ */ - {'>', '>', 175}, /* ¯ */ - {'j', 'u', 230}, /* ÃĻ */ - {'o', '/', 237}, /* í */ - {'+', '-', 241}, /* Ãą */ - {'>', '=', 242}, /* Ã˛ */ - {'<', '=', 243}, /* Ãŗ */ - {':', '-', 246}, /* Ãļ */ - {'~', '~', 247}, /* Ãˇ */ - {'~', 'o', 248}, /* ø */ - {'2', '2', 253}, /* ÃŊ */ - {NUL, NUL, NUL} - }; - -#else /* !__MINT__ */ -# ifdef HPUX_DIGRAPHS - +#ifdef HPUX_DIGRAPHS /* * different HPUX digraphs */ - {{'A', '`', 161}, /* ÂĄ */ - {'A', '^', 162}, /* Âĸ */ - {'E', '`', 163}, /* ÂŖ */ - {'E', '^', 164}, /* ¤ */ - {'E', '"', 165}, /* ÂĨ */ - {'I', '^', 166}, /* ÂĻ */ - {'I', '"', 167}, /* § */ - {'\'', '\'', 168}, /* ¨ */ - {'`', '`', 169}, /* Š */ - {'^', '^', 170}, /* ÂĒ */ - {'"', '"', 171}, /* ÂĢ */ - {'~', '~', 172}, /* ÂŦ */ - {'U', '`', 173}, /* ­ */ - {'U', '^', 174}, /* ÂŽ */ - {'L', '=', 175}, /* ¯ */ - {'~', '_', 176}, /* ° */ - {'Y', '\'', 177}, /* Âą */ - {'y', '\'', 178}, /* ² */ - {'~', 'o', 179}, /* Âŗ */ - {'C', ',', 180}, /* ´ */ - {'c', ',', 181}, /* Âĩ */ - {'N', '~', 182}, /* Âļ */ - {'n', '~', 183}, /* ¡ */ - {'~', '!', 184}, /* ¸ */ - {'~', '?', 185}, /* š */ - {'o', 'x', 186}, /* Âē */ - {'L', '-', 187}, /* Âģ */ - {'Y', '=', 188}, /* Âŧ */ - {'p', 'p', 189}, /* ÂŊ */ - {'f', 'l', 190}, /* ž */ - {'c', '|', 191}, /* Âŋ */ - {'a', '^', 192}, /* À */ - {'e', '^', 193}, /* Á */ - {'o', '^', 194}, /*  */ - {'u', '^', 195}, /* à */ - {'a', '\'', 196}, /* Ä */ - {'e', '\'', 197}, /* Å */ - {'o', '\'', 198}, /* Æ */ - {'u', '\'', 199}, /* Ç */ - {'a', '`', 200}, /* È */ - {'e', '`', 201}, /* É */ - {'o', '`', 202}, /* Ê */ - {'u', '`', 203}, /* Ë */ - {'a', '"', 204}, /* Ì */ - {'e', '"', 205}, /* Í */ - {'o', '"', 206}, /* Î */ - {'u', '"', 207}, /* Ï */ - {'A', 'o', 208}, /* Ð */ - {'i', '^', 209}, /* Ñ */ - {'O', '/', 210}, /* Ò */ - {'A', 'E', 211}, /* Ó */ - {'a', 'o', 212}, /* Ô */ - {'i', '\'', 213}, /* Õ */ - {'o', '/', 214}, /* Ö */ - {'a', 'e', 215}, /* × */ - {'A', '"', 216}, /* Ø */ - {'i', '`', 217}, /* Ù */ - {'O', '"', 218}, /* Ú */ - {'U', '"', 219}, /* Û */ - {'E', '\'', 220}, /* Ü */ - {'i', '"', 221}, /* Ý */ - {'s', 's', 222}, /* Þ */ - {'O', '^', 223}, /* ß */ - {'A', '\'', 224}, /* à */ - {'A', '~', 225}, /* ÃĄ */ - {'a', '~', 226}, /* Ãĸ */ - {'D', '-', 227}, /* ÃŖ */ - {'d', '-', 228}, /* ä */ - {'I', '\'', 229}, /* ÃĨ */ - {'I', '`', 230}, /* ÃĻ */ - {'O', '\'', 231}, /* ç */ - {'O', '`', 232}, /* è */ - {'O', '~', 233}, /* Ê */ - {'o', '~', 234}, /* ÃĒ */ - {'S', '~', 235}, /* ÃĢ */ - {'s', '~', 236}, /* ÃŦ */ - {'U', '\'', 237}, /* í */ - {'Y', '"', 238}, /* ÃŽ */ - {'y', '"', 239}, /* ï */ - {'p', '-', 240}, /* ð */ - {'p', '~', 241}, /* Ãą */ - {'~', '.', 242}, /* Ã˛ */ - {'j', 'u', 243}, /* Ãŗ */ - {'P', 'p', 244}, /* ô */ - {'3', '4', 245}, /* Ãĩ */ - {'-', '-', 246}, /* Ãļ */ - {'1', '4', 247}, /* Ãˇ */ - {'1', '2', 248}, /* ø */ - {'a', '_', 249}, /* Ú */ - {'o', '_', 250}, /* Ãē */ - {'<', '<', 251}, /* Ãģ */ - {'x', 'x', 252}, /* Ãŧ */ - {'>', '>', 253}, /* ÃŊ */ - {'+', '-', 254}, /* Þ */ - {'n', 'u', 255}, /* x XX */ - {NUL, NUL, NUL} - }; - -# else /* !HPUX_DIGRAPHS */ - -# ifdef EBCDIC - - /* - * EBCDIC - ISO digraphs - * TODO: EBCDIC Table is Code-Page 1047 - */ - {{'a', '^', 66}, /* Ãĸ */ - {'a', '"', 67}, /* ä */ - {'a', '`', 68}, /* à */ - {'a', '\'', 69}, /* ÃĄ */ - {'a', '~', 70}, /* ÃŖ */ - {'a', '@', 71}, /* ÃĨ */ - {'a', 'a', 71}, /* ÃĨ */ - {'c', ',', 72}, /* ç */ - {'n', '~', 73}, /* Ãą */ - {'c', '|', 74}, /* Âĸ */ - {'e', '\'', 81}, /* Ê */ - {'e', '^', 82}, /* ÃĒ */ - {'e', '"', 83}, /* ÃĢ */ - {'e', '`', 84}, /* è */ - {'i', '\'', 85}, /* í */ - {'i', '^', 86}, /* ÃŽ */ - {'i', '"', 87}, /* ï */ - {'i', '`', 88}, /* ÃŦ */ - {'s', 's', 89}, /* ß */ - {'A', '^', 98}, /*  */ - {'A', '"', 99}, /* Ä */ - {'A', '`', 100}, /* À */ - {'A', '\'', 101}, /* Á */ - {'A', '~', 102}, /* à */ - {'A', '@', 103}, /* Å */ - {'A', 'A', 103}, /* Å */ - {'C', ',', 104}, /* Ç */ - {'N', '~', 105}, /* Ñ */ - {'|', '|', 106}, /* ÂĻ */ - {'o', '/', 112}, /* ø */ - {'E', '\'', 113}, /* É */ - {'E', '^', 114}, /* Ê */ - {'E', '"', 115}, /* Ë */ - {'E', '`', 116}, /* È */ - {'I', '\'', 117}, /* Í */ - {'I', '^', 118}, /* Î */ - {'I', '"', 119}, /* Ï */ - {'I', '`', 120}, /* Ì */ - {'O', '/', 128}, /* 0/ XX */ - {'<', '<', 138}, /* ÂĢ */ - {'>', '>', 139}, /* Âģ */ - {'d', '-', 140}, /* ð */ - {'y', '\'', 141}, /* ÃŊ */ - {'i', 'p', 142}, /* Þ */ - {'+', '-', 143}, /* Âą */ - {'~', 'o', 144}, /* ° */ - {'a', '-', 154}, /* ÂĒ */ - {'o', '-', 155}, /* Âē */ - {'a', 'e', 156}, /* ÃĻ */ - {',', ',', 157}, /* , XX */ - {'A', 'E', 158}, /* Æ */ - {'o', 'x', 159}, /* ¤ - currency symbol in ISO 8859-1 */ - {'e', '=', 159}, /* ¤ - euro symbol in ISO 8859-15 */ - {'E', 'u', 159}, /* ¤ - euro symbol in ISO 8859-15 */ - {'j', 'u', 160}, /* Âĩ */ - {'y', '"', 167}, /* x XX */ - {'~', '!', 170}, /* ÂĄ */ - {'~', '?', 171}, /* Âŋ */ - {'D', '-', 172}, /* Ð */ - {'I', 'p', 174}, /* Þ */ - {'r', 'O', 175}, /* ÂŽ */ - {'-', ',', 176}, /* ÂŦ */ - {'$', '$', 177}, /* ÂŖ */ - {'Y', '-', 178}, /* ÂĨ */ - {'~', '.', 179}, /* ¡ */ - {'c', 'O', 180}, /* Š */ - {'p', 'a', 181}, /* § */ - {'p', 'p', 182}, /* Âļ */ - {'1', '4', 183}, /* Âŧ */ - {'1', '2', 184}, /* ÂŊ */ - {'3', '4', 185}, /* ž */ - {'Y', '\'', 186}, /* Ý */ - {'"', '"', 187}, /* ¨ */ - {'-', '=', 188}, /* ¯ */ - {'\'', '\'', 190}, /* ´ */ - {'O', 'E', 191}, /* × - OE in ISO 8859-15 */ - {'/', '\\', 191}, /* × - multiplication symbol in ISO 8859-1 */ - {'-', '-', 202}, /* ­ */ - {'o', '^', 203}, /* ô */ - {'o', '"', 204}, /* Ãļ */ - {'o', '`', 205}, /* Ã˛ */ - {'o', '\'', 206}, /* Ãŗ */ - {'o', '~', 207}, /* Ãĩ */ - {'1', '1', 218}, /* š */ - {'u', '^', 219}, /* Ãģ */ - {'u', '"', 220}, /* Ãŧ */ - {'u', '`', 221}, /* Ú */ - {'u', '\'', 222}, /* Ãē */ - {':', '-', 225}, /* Ãˇ - division symbol in ISO 8859-1 */ - {'o', 'e', 225}, /* Ãˇ - oe in ISO 8859-15 */ - {'2', '2', 234}, /* ² */ - {'O', '^', 235}, /* Ô */ - {'O', '"', 236}, /* Ö */ - {'O', '`', 237}, /* Ò */ - {'O', '\'', 238}, /* Ó */ - {'O', '~', 239}, /* Õ */ - {'3', '3', 250}, /* Âŗ */ - {'U', '^', 251}, /* Û */ - {'U', '"', 252}, /* Ü */ - {'U', '`', 253}, /* Ù */ - {'U', '\'', 254}, /* Ú */ + {{'A', '`', 161}, // ÂĄ + {'A', '^', 162}, // Âĸ + {'E', '`', 163}, // ÂŖ + {'E', '^', 164}, // ¤ + {'E', '"', 165}, // ÂĨ + {'I', '^', 166}, // ÂĻ + {'I', '"', 167}, // § + {'\'', '\'', 168}, // ¨ + {'`', '`', 169}, // Š + {'^', '^', 170}, // ÂĒ + {'"', '"', 171}, // ÂĢ + {'~', '~', 172}, // ÂŦ + {'U', '`', 173}, // ­ + {'U', '^', 174}, // ÂŽ + {'L', '=', 175}, // ¯ + {'~', '_', 176}, // ° + {'Y', '\'', 177}, // Âą + {'y', '\'', 178}, // ² + {'~', 'o', 179}, // Âŗ + {'C', ',', 180}, // ´ + {'c', ',', 181}, // Âĩ + {'N', '~', 182}, // Âļ + {'n', '~', 183}, // ¡ + {'~', '!', 184}, // ¸ + {'~', '?', 185}, // š + {'o', 'x', 186}, // Âē + {'L', '-', 187}, // Âģ + {'Y', '=', 188}, // Âŧ + {'p', 'p', 189}, // ÂŊ + {'f', 'l', 190}, // ž + {'c', '|', 191}, // Âŋ + {'a', '^', 192}, // À + {'e', '^', 193}, // Á + {'o', '^', 194}, //  + {'u', '^', 195}, // à + {'a', '\'', 196}, // Ä + {'e', '\'', 197}, // Å + {'o', '\'', 198}, // Æ + {'u', '\'', 199}, // Ç + {'a', '`', 200}, // È + {'e', '`', 201}, // É + {'o', '`', 202}, // Ê + {'u', '`', 203}, // Ë + {'a', '"', 204}, // Ì + {'e', '"', 205}, // Í + {'o', '"', 206}, // Î + {'u', '"', 207}, // Ï + {'A', 'o', 208}, // Ð + {'i', '^', 209}, // Ñ + {'O', '/', 210}, // Ò + {'A', 'E', 211}, // Ó + {'a', 'o', 212}, // Ô + {'i', '\'', 213}, // Õ + {'o', '/', 214}, // Ö + {'a', 'e', 215}, // × + {'A', '"', 216}, // Ø + {'i', '`', 217}, // Ù + {'O', '"', 218}, // Ú + {'U', '"', 219}, // Û + {'E', '\'', 220}, // Ü + {'i', '"', 221}, // Ý + {'s', 's', 222}, // Þ + {'O', '^', 223}, // ß + {'A', '\'', 224}, // à + {'A', '~', 225}, // ÃĄ + {'a', '~', 226}, // Ãĸ + {'D', '-', 227}, // ÃŖ + {'d', '-', 228}, // ä + {'I', '\'', 229}, // ÃĨ + {'I', '`', 230}, // ÃĻ + {'O', '\'', 231}, // ç + {'O', '`', 232}, // è + {'O', '~', 233}, // Ê + {'o', '~', 234}, // ÃĒ + {'S', '~', 235}, // ÃĢ + {'s', '~', 236}, // ÃŦ + {'U', '\'', 237}, // í + {'Y', '"', 238}, // ÃŽ + {'y', '"', 239}, // ï + {'p', '-', 240}, // ð + {'p', '~', 241}, // Ãą + {'~', '.', 242}, // Ã˛ + {'j', 'u', 243}, // Ãŗ + {'P', 'p', 244}, // ô + {'3', '4', 245}, // Ãĩ + {'-', '-', 246}, // Ãļ + {'1', '4', 247}, // Ãˇ + {'1', '2', 248}, // ø + {'a', '_', 249}, // Ú + {'o', '_', 250}, // Ãē + {'<', '<', 251}, // Ãģ + {'x', 'x', 252}, // Ãŧ + {'>', '>', 253}, // ÃŊ + {'+', '-', 254}, // Þ + {'n', 'u', 255}, // x XX {NUL, NUL, NUL} }; -# else -# ifdef OLD_DIGRAPHS +#else // !HPUX_DIGRAPHS +# ifdef OLD_DIGRAPHS /* * digraphs compatible with Vim 5.x */ - {{'~', '!', 161}, /* ÂĄ */ - {'c', '|', 162}, /* Âĸ */ - {'$', '$', 163}, /* ÂŖ */ - {'o', 'x', 164}, /* ¤ - currency symbol in ISO 8859-1 */ - {'e', '=', 164}, /* ¤ - euro symbol in ISO 8859-15 */ - {'Y', '-', 165}, /* ÂĨ */ - {'|', '|', 166}, /* ÂĻ */ - {'p', 'a', 167}, /* § */ - {'"', '"', 168}, /* ¨ */ - {'c', 'O', 169}, /* Š */ - {'a', '-', 170}, /* ÂĒ */ - {'<', '<', 171}, /* ÂĢ */ - {'-', ',', 172}, /* ÂŦ */ - {'-', '-', 173}, /* ­ */ - {'r', 'O', 174}, /* ÂŽ */ - {'-', '=', 175}, /* ¯ */ - {'~', 'o', 176}, /* ° */ - {'+', '-', 177}, /* Âą */ - {'2', '2', 178}, /* ² */ - {'3', '3', 179}, /* Âŗ */ - {'\'', '\'', 180}, /* ´ */ - {'j', 'u', 181}, /* Âĩ */ - {'p', 'p', 182}, /* Âļ */ - {'~', '.', 183}, /* ¡ */ - {',', ',', 184}, /* ¸ */ - {'1', '1', 185}, /* š */ - {'o', '-', 186}, /* Âē */ - {'>', '>', 187}, /* Âģ */ - {'1', '4', 188}, /* Âŧ */ - {'1', '2', 189}, /* ÂŊ */ - {'3', '4', 190}, /* ž */ - {'~', '?', 191}, /* Âŋ */ - {'A', '`', 192}, /* À */ - {'A', '\'', 193}, /* Á */ - {'A', '^', 194}, /*  */ - {'A', '~', 195}, /* à */ - {'A', '"', 196}, /* Ä */ - {'A', '@', 197}, /* Å */ - {'A', 'A', 197}, /* Å */ - {'A', 'E', 198}, /* Æ */ - {'C', ',', 199}, /* Ç */ - {'E', '`', 200}, /* È */ - {'E', '\'', 201}, /* É */ - {'E', '^', 202}, /* Ê */ - {'E', '"', 203}, /* Ë */ - {'I', '`', 204}, /* Ì */ - {'I', '\'', 205}, /* Í */ - {'I', '^', 206}, /* Î */ - {'I', '"', 207}, /* Ï */ - {'D', '-', 208}, /* Ð */ - {'N', '~', 209}, /* Ñ */ - {'O', '`', 210}, /* Ò */ - {'O', '\'', 211}, /* Ó */ - {'O', '^', 212}, /* Ô */ - {'O', '~', 213}, /* Õ */ - {'O', '"', 214}, /* Ö */ - {'/', '\\', 215}, /* × - multiplication symbol in ISO 8859-1 */ - {'O', 'E', 215}, /* × - OE in ISO 8859-15 */ - {'O', '/', 216}, /* Ø */ - {'U', '`', 217}, /* Ù */ - {'U', '\'', 218}, /* Ú */ - {'U', '^', 219}, /* Û */ - {'U', '"', 220}, /* Ü */ - {'Y', '\'', 221}, /* Ý */ - {'I', 'p', 222}, /* Þ */ - {'s', 's', 223}, /* ß */ - {'a', '`', 224}, /* à */ - {'a', '\'', 225}, /* ÃĄ */ - {'a', '^', 226}, /* Ãĸ */ - {'a', '~', 227}, /* ÃŖ */ - {'a', '"', 228}, /* ä */ - {'a', '@', 229}, /* ÃĨ */ - {'a', 'a', 229}, /* ÃĨ */ - {'a', 'e', 230}, /* ÃĻ */ - {'c', ',', 231}, /* ç */ - {'e', '`', 232}, /* è */ - {'e', '\'', 233}, /* Ê */ - {'e', '^', 234}, /* ÃĒ */ - {'e', '"', 235}, /* ÃĢ */ - {'i', '`', 236}, /* ÃŦ */ - {'i', '\'', 237}, /* í */ - {'i', '^', 238}, /* ÃŽ */ - {'i', '"', 239}, /* ï */ - {'d', '-', 240}, /* ð */ - {'n', '~', 241}, /* Ãą */ - {'o', '`', 242}, /* Ã˛ */ - {'o', '\'', 243}, /* Ãŗ */ - {'o', '^', 244}, /* ô */ - {'o', '~', 245}, /* Ãĩ */ - {'o', '"', 246}, /* Ãļ */ - {':', '-', 247}, /* Ãˇ - division symbol in ISO 8859-1 */ - {'o', 'e', 247}, /* Ãˇ - oe in ISO 8859-15 */ - {'o', '/', 248}, /* ø */ - {'u', '`', 249}, /* Ú */ - {'u', '\'', 250}, /* Ãē */ - {'u', '^', 251}, /* Ãģ */ - {'u', '"', 252}, /* Ãŧ */ - {'y', '\'', 253}, /* ÃŊ */ - {'i', 'p', 254}, /* Þ */ - {'y', '"', 255}, /* x XX */ + {{'~', '!', 161}, // ÂĄ + {'c', '|', 162}, // Âĸ + {'$', '$', 163}, // ÂŖ + {'o', 'x', 164}, // ¤ - currency symbol in ISO 8859-1 + {'e', '=', 164}, // ¤ - euro symbol in ISO 8859-15 + {'Y', '-', 165}, // ÂĨ + {'|', '|', 166}, // ÂĻ + {'p', 'a', 167}, // § + {'"', '"', 168}, // ¨ + {'c', 'O', 169}, // Š + {'a', '-', 170}, // ÂĒ + {'<', '<', 171}, // ÂĢ + {'-', ',', 172}, // ÂŦ + {'-', '-', 173}, // ­ + {'r', 'O', 174}, // ÂŽ + {'-', '=', 175}, // ¯ + {'~', 'o', 176}, // ° + {'+', '-', 177}, // Âą + {'2', '2', 178}, // ² + {'3', '3', 179}, // Âŗ + {'\'', '\'', 180}, // ´ + {'j', 'u', 181}, // Âĩ + {'p', 'p', 182}, // Âļ + {'~', '.', 183}, // ¡ + {',', ',', 184}, // ¸ + {'1', '1', 185}, // š + {'o', '-', 186}, // Âē + {'>', '>', 187}, // Âģ + {'1', '4', 188}, // Âŧ + {'1', '2', 189}, // ÂŊ + {'3', '4', 190}, // ž + {'~', '?', 191}, // Âŋ + {'A', '`', 192}, // À + {'A', '\'', 193}, // Á + {'A', '^', 194}, //  + {'A', '~', 195}, // à + {'A', '"', 196}, // Ä + {'A', '@', 197}, // Å + {'A', 'A', 197}, // Å + {'A', 'E', 198}, // Æ + {'C', ',', 199}, // Ç + {'E', '`', 200}, // È + {'E', '\'', 201}, // É + {'E', '^', 202}, // Ê + {'E', '"', 203}, // Ë + {'I', '`', 204}, // Ì + {'I', '\'', 205}, // Í + {'I', '^', 206}, // Î + {'I', '"', 207}, // Ï + {'D', '-', 208}, // Ð + {'N', '~', 209}, // Ñ + {'O', '`', 210}, // Ò + {'O', '\'', 211}, // Ó + {'O', '^', 212}, // Ô + {'O', '~', 213}, // Õ + {'O', '"', 214}, // Ö + {'/', '\\', 215}, // × - multiplication symbol in ISO 8859-1 + {'O', 'E', 215}, // × - OE in ISO 8859-15 + {'O', '/', 216}, // Ø + {'U', '`', 217}, // Ù + {'U', '\'', 218}, // Ú + {'U', '^', 219}, // Û + {'U', '"', 220}, // Ü + {'Y', '\'', 221}, // Ý + {'I', 'p', 222}, // Þ + {'s', 's', 223}, // ß + {'a', '`', 224}, // à + {'a', '\'', 225}, // ÃĄ + {'a', '^', 226}, // Ãĸ + {'a', '~', 227}, // ÃŖ + {'a', '"', 228}, // ä + {'a', '@', 229}, // ÃĨ + {'a', 'a', 229}, // ÃĨ + {'a', 'e', 230}, // ÃĻ + {'c', ',', 231}, // ç + {'e', '`', 232}, // è + {'e', '\'', 233}, // Ê + {'e', '^', 234}, // ÃĒ + {'e', '"', 235}, // ÃĢ + {'i', '`', 236}, // ÃŦ + {'i', '\'', 237}, // í + {'i', '^', 238}, // ÃŽ + {'i', '"', 239}, // ï + {'d', '-', 240}, // ð + {'n', '~', 241}, // Ãą + {'o', '`', 242}, // Ã˛ + {'o', '\'', 243}, // Ãŗ + {'o', '^', 244}, // ô + {'o', '~', 245}, // Ãĩ + {'o', '"', 246}, // Ãļ + {':', '-', 247}, // Ãˇ - division symbol in ISO 8859-1 + {'o', 'e', 247}, // Ãˇ - oe in ISO 8859-15 + {'o', '/', 248}, // ø + {'u', '`', 249}, // Ú + {'u', '\'', 250}, // Ãē + {'u', '^', 251}, // Ãģ + {'u', '"', 252}, // Ãŧ + {'y', '\'', 253}, // ÃŊ + {'i', 'p', 254}, // Þ + {'y', '"', 255}, // x XX {NUL, NUL, NUL} }; -# else /* OLD_DIGRAPHS */ +# else // OLD_DIGRAPHS /* * digraphs for Unicode from RFC1345 * (also work for ISO-8859-1 aka latin1) */ { - {'N', 'U', 0x0a}, /* LF for NUL */ + {'N', 'U', 0x0a}, // LF for NUL {'S', 'H', 0x01}, {'S', 'X', 0x02}, {'E', 'X', 0x03}, @@ -509,7 +331,7 @@ static __thread digr_T digraphdefault[] = {'P', 'M', 0x9e}, {'A', 'C', 0x9f}, {'N', 'S', 0xa0}, -#define DG_START_LATIN 0xa1 +# define DG_START_LATIN 0xa1 {'!', 'I', 0xa1}, {'~', '!', 0xa1}, // ÂĄ Vim 5.x compatible {'C', 't', 0xa2}, @@ -658,7 +480,7 @@ static __thread digr_T digraphdefault[] = {'y', ':', 0xff}, {'y', '"', 0xff}, // x XX Vim 5.x compatible -# define USE_UNICODE_DIGRAPHS +# define USE_UNICODE_DIGRAPHS {'A', '-', 0x0100}, {'a', '-', 0x0101}, @@ -833,7 +655,7 @@ static __thread digr_T digraphdefault[] = {'\'', '0', 0x02da}, {'\'', ';', 0x02db}, {'\'', '"', 0x02dd}, -#define DG_START_GREEK 0x0386 +# define DG_START_GREEK 0x0386 {'A', '%', 0x0386}, {'E', '%', 0x0388}, {'Y', '%', 0x0389}, @@ -915,7 +737,7 @@ static __thread digr_T digraphdefault[] = {'p', '3', 0x03e1}, {'\'', '%', 0x03f4}, {'j', '3', 0x03f5}, -#define DG_START_CYRILLIC 0x0401 +# define DG_START_CYRILLIC 0x0401 {'I', 'O', 0x0401}, {'D', '%', 0x0402}, {'G', '%', 0x0403}, @@ -1020,7 +842,7 @@ static __thread digr_T digraphdefault[] = {'c', '3', 0x0481}, {'G', '3', 0x0490}, {'g', '3', 0x0491}, -#define DG_START_HEBREW 0x05d0 +# define DG_START_HEBREW 0x05d0 {'A', '+', 0x05d0}, {'B', '+', 0x05d1}, {'G', '+', 0x05d2}, @@ -1048,7 +870,7 @@ static __thread digr_T digraphdefault[] = {'R', '+', 0x05e8}, {'S', 'h', 0x05e9}, {'T', '+', 0x05ea}, -#define DG_START_ARABIC 0x060c +# define DG_START_ARABIC 0x060c {',', '+', 0x060c}, {';', '+', 0x061b}, {'?', '+', 0x061f}, @@ -1111,7 +933,7 @@ static __thread digr_T digraphdefault[] = {'7', 'a', 0x06f7}, {'8', 'a', 0x06f8}, {'9', 'a', 0x06f9}, -#define DG_START_LATIN_EXTENDED 0x1e02 +# define DG_START_LATIN_EXTENDED 0x1e02 {'B', '.', 0x1e02}, {'b', '.', 0x1e03}, {'B', '_', 0x1e06}, @@ -1206,7 +1028,7 @@ static __thread digr_T digraphdefault[] = {'y', '2', 0x1ef7}, {'Y', '?', 0x1ef8}, {'y', '?', 0x1ef9}, -#define DG_START_GREEK_EXTENDED 0x1f00 +# define DG_START_GREEK_EXTENDED 0x1f00 {';', '\'', 0x1f00}, {',', '\'', 0x1f01}, {';', '!', 0x1f02}, @@ -1215,7 +1037,7 @@ static __thread digr_T digraphdefault[] = {'?', ',', 0x1f05}, {'!', ':', 0x1f06}, {'?', ':', 0x1f07}, -#define DG_START_PUNCTUATION 0x2002 +# define DG_START_PUNCTUATION 0x2002 {'1', 'N', 0x2002}, {'1', 'M', 0x2003}, {'3', 'M', 0x2004}, @@ -1239,6 +1061,7 @@ static __thread digr_T digraphdefault[] = {'9', '"', 0x201f}, {'/', '-', 0x2020}, {'/', '=', 0x2021}, + {'o', 'o', 0x2022}, {'.', '.', 0x2025}, {',', '.', 0x2026}, {'%', '0', 0x2030}, @@ -1254,7 +1077,7 @@ static __thread digr_T digraphdefault[] = {':', 'X', 0x203b}, {'\'', '-', 0x203e}, {'/', 'f', 0x2044}, -#define DG_START_SUB_SUPER 0x2070 +# define DG_START_SUB_SUPER 0x2070 {'0', 'S', 0x2070}, {'4', 'S', 0x2074}, {'5', 'S', 0x2075}, @@ -1283,15 +1106,15 @@ static __thread digr_T digraphdefault[] = {'=', 's', 0x208c}, {'(', 's', 0x208d}, {')', 's', 0x208e}, -#define DG_START_CURRENCY 0x20a4 +# define DG_START_CURRENCY 0x20a4 {'L', 'i', 0x20a4}, {'P', 't', 0x20a7}, {'W', '=', 0x20a9}, - {'=', 'e', 0x20ac}, /* euro */ - {'E', 'u', 0x20ac}, /* euro */ - {'=', 'R', 0x20bd}, /* rouble */ - {'=', 'P', 0x20bd}, /* rouble */ -#define DG_START_OTHER1 0x2103 + {'=', 'e', 0x20ac}, // euro + {'E', 'u', 0x20ac}, // euro + {'=', 'R', 0x20bd}, // rouble + {'=', 'P', 0x20bd}, // rouble +# define DG_START_OTHER1 0x2103 {'o', 'C', 0x2103}, {'c', 'o', 0x2105}, {'o', 'F', 0x2109}, @@ -1314,7 +1137,7 @@ static __thread digr_T digraphdefault[] = {'3', '8', 0x215c}, {'5', '8', 0x215d}, {'7', '8', 0x215e}, -#define DG_START_ROMAN 0x2160 +# define DG_START_ROMAN 0x2160 {'1', 'R', 0x2160}, {'2', 'R', 0x2161}, {'3', 'R', 0x2162}, @@ -1339,7 +1162,7 @@ static __thread digr_T digraphdefault[] = {'a', 'r', 0x2179}, {'b', 'r', 0x217a}, {'c', 'r', 0x217b}, -#define DG_START_ARROWS 0x2190 +# define DG_START_ARROWS 0x2190 {'<', '-', 0x2190}, {'-', '!', 0x2191}, {'-', '>', 0x2192}, @@ -1349,7 +1172,7 @@ static __thread digr_T digraphdefault[] = {'<', '=', 0x21d0}, {'=', '>', 0x21d2}, {'=', '=', 0x21d4}, -#define DG_START_MATH 0x2200 +# define DG_START_MATH 0x2200 {'F', 'A', 0x2200}, {'d', 'P', 0x2202}, {'T', 'E', 0x2203}, @@ -1407,7 +1230,7 @@ static __thread digr_T digraphdefault[] = {'.', 'P', 0x22c5}, {':', '3', 0x22ee}, {'.', '3', 0x22ef}, -#define DG_START_TECHNICAL 0x2302 +# define DG_START_TECHNICAL 0x2302 {'E', 'h', 0x2302}, {'<', '7', 0x2308}, {'>', '7', 0x2309}, @@ -1420,7 +1243,7 @@ static __thread digr_T digraphdefault[] = {'I', 'l', 0x2321}, {'<', '/', 0x2329}, {'/', '>', 0x232a}, -#define DG_START_OTHER2 0x2423 +# define DG_START_OTHER2 0x2423 {'V', 's', 0x2423}, {'1', 'h', 0x2440}, {'3', 'h', 0x2441}, @@ -1439,7 +1262,7 @@ static __thread digr_T digraphdefault[] = {'7', '.', 0x248e}, {'8', '.', 0x248f}, {'9', '.', 0x2490}, -#define DG_START_DRAWING 0x2500 +# define DG_START_DRAWING 0x2500 {'h', 'h', 0x2500}, {'H', 'H', 0x2501}, {'v', 'v', 0x2502}, @@ -1490,7 +1313,7 @@ static __thread digr_T digraphdefault[] = {'V', 'H', 0x254b}, {'F', 'D', 0x2571}, {'B', 'D', 0x2572}, -#define DG_START_BLOCK 0x2580 +# define DG_START_BLOCK 0x2580 {'T', 'B', 0x2580}, {'L', 'B', 0x2584}, {'F', 'B', 0x2588}, @@ -1499,7 +1322,7 @@ static __thread digr_T digraphdefault[] = {'.', 'S', 0x2591}, {':', 'S', 0x2592}, {'?', 'S', 0x2593}, -#define DG_START_SHAPES 0x25a0 +# define DG_START_SHAPES 0x25a0 {'f', 'S', 0x25a0}, {'O', 'S', 0x25a1}, {'R', 'O', 0x25a2}, @@ -1533,7 +1356,7 @@ static __thread digr_T digraphdefault[] = {'I', 'c', 0x25d9}, {'F', 'd', 0x25e2}, {'B', 'd', 0x25e3}, -#define DG_START_SYMBOLS 0x2605 +# define DG_START_SYMBOLS 0x2605 {'*', '2', 0x2605}, {'*', '1', 0x2606}, {'<', 'H', 0x261c}, @@ -1553,11 +1376,11 @@ static __thread digr_T digraphdefault[] = {'M', 'b', 0x266d}, {'M', 'x', 0x266e}, {'M', 'X', 0x266f}, -#define DG_START_DINGBATS 0x2713 +# define DG_START_DINGBATS 0x2713 {'O', 'K', 0x2713}, {'X', 'X', 0x2717}, {'-', 'X', 0x2720}, -#define DG_START_CJK_SYMBOLS 0x3000 +# define DG_START_CJK_SYMBOLS 0x3000 {'I', 'S', 0x3000}, {',', '_', 0x3001}, {'.', '_', 0x3002}, @@ -1581,7 +1404,7 @@ static __thread digr_T digraphdefault[] = {'(', 'I', 0x3016}, {')', 'I', 0x3017}, {'-', '?', 0x301c}, -#define DG_START_HIRAGANA 0x3041 +# define DG_START_HIRAGANA 0x3041 {'A', '5', 0x3041}, {'a', '5', 0x3042}, {'I', '5', 0x3043}, @@ -1670,7 +1493,7 @@ static __thread digr_T digraphdefault[] = {'0', '5', 0x309c}, {'*', '5', 0x309d}, {'+', '5', 0x309e}, -#define DG_START_KATAKANA 0x30a1 +# define DG_START_KATAKANA 0x30a1 {'a', '6', 0x30a1}, {'A', '6', 0x30a2}, {'i', '6', 0x30a3}, @@ -1765,7 +1588,7 @@ static __thread digr_T digraphdefault[] = {'-', '6', 0x30fc}, {'*', '6', 0x30fd}, {'+', '6', 0x30fe}, -#define DG_START_BOPOMOFO 0x3105 +# define DG_START_BOPOMOFO 0x3105 {'b', '4', 0x3105}, {'p', '4', 0x3106}, {'m', '4', 0x3107}, @@ -1805,7 +1628,7 @@ static __thread digr_T digraphdefault[] = {'v', '4', 0x312a}, {'n', 'G', 0x312b}, {'g', 'n', 0x312c}, -#define DG_START_OTHER3 0x3220 +# define DG_START_OTHER3 0x3220 {'1', 'c', 0x3220}, {'2', 'c', 0x3221}, {'3', 'c', 0x3222}, @@ -1815,8 +1638,8 @@ static __thread digr_T digraphdefault[] = {'7', 'c', 0x3226}, {'8', 'c', 0x3227}, {'9', 'c', 0x3228}, - /* code points 0xe000 - 0xefff excluded, they have no assigned - * characters, only used in proposals. */ + // code points 0xe000 - 0xefff excluded, they have no assigned + // characters, only used in proposals. {'f', 'f', 0xfb00}, {'f', 'i', 0xfb01}, {'f', 'l', 0xfb02}, @@ -1826,34 +1649,32 @@ static __thread digr_T digraphdefault[] = {NUL, NUL, NUL} }; -# endif /* OLD_DIGRAPHS */ -# endif /* EBCDIC */ -# endif /* !HPUX_DIGRAPHS */ -#endif /* !__MINT__ */ +# endif // OLD_DIGRAPHS +#endif // !HPUX_DIGRAPHS /* * handle digraphs after typing a character */ #if TARGET_OS_IPHONE -static __thread int backspaced; /* character before K_BS */ -static __thread int lastchar; /* last typed character */ +static __thread int backspaced; // character before K_BS +static __thread int lastchar; // last typed character #endif int do_digraph(int c) { #if !TARGET_OS_IPHONE - static int backspaced; /* character before K_BS */ - static int lastchar; /* last typed character */ + static int backspaced; // character before K_BS + static int lastchar; // last typed character #endif - if (c == -1) /* init values */ + if (c == -1) // init values { backspaced = -1; } else if (p_dg) { if (backspaced >= 0) - c = getdigraph(backspaced, c, FALSE); + c = digraph_get(backspaced, c, FALSE); backspaced = -1; if ((c == K_BS || c == Ctrl_H) && lastchar >= 0) backspaced = lastchar; @@ -1932,7 +1753,7 @@ get_digraph_for_char(int val_arg) */ int get_digraph( - int cmdline) /* TRUE when called from the cmdline */ + int cmdline) // TRUE when called from the cmdline { int c, cc; @@ -1941,9 +1762,9 @@ get_digraph( c = plain_vgetc(); --no_mapping; --allow_keys; - if (c != ESC) /* ESC cancels CTRL-K */ + if (c != ESC) // ESC cancels CTRL-K { - if (IS_SPECIAL(c)) /* insert special key code */ + if (IS_SPECIAL(c)) // insert special key code return c; if (cmdline) { @@ -1963,8 +1784,8 @@ get_digraph( cc = plain_vgetc(); --no_mapping; --allow_keys; - if (cc != ESC) /* ESC cancels CTRL-K */ - return getdigraph(c, cc, TRUE); + if (cc != ESC) // ESC cancels CTRL-K + return digraph_get(c, cc, TRUE); } return NUL; } @@ -2040,13 +1861,13 @@ getexactdigraph(int char1, int char2, int meta_char) } #endif - /* Ignore multi-byte characters when not in multi-byte mode. */ + // Ignore multi-byte characters when not in multi-byte mode. if (!has_mbyte && retval > 0xff) retval = 0; - if (retval == 0) /* digraph deleted or not found */ + if (retval == 0) // digraph deleted or not found { - if (char1 == ' ' && meta_char) /* --> meta-char */ + if (char1 == ' ' && meta_char) // --> meta-char return (char2 | 0x80); return char2; } @@ -2058,7 +1879,7 @@ getexactdigraph(int char1, int char2, int meta_char) * Allow for both char1-char2 and char2-char1 */ int -getdigraph(int char1, int char2, int meta_char) +digraph_get(int char1, int char2, int meta_char) { int retval; @@ -2069,6 +1890,65 @@ getdigraph(int char1, int char2, int meta_char) return retval; } +/* + * Add a digraph to the digraph table. + */ + static void +registerdigraph(int char1, int char2, int n) +{ + int i; + digr_T *dp; + + // If the digraph already exists, replace "result". + dp = (digr_T *)user_digraphs.ga_data; + for (i = 0; i < user_digraphs.ga_len; ++i) + { + if ((int)dp->char1 == char1 && (int)dp->char2 == char2) + { + dp->result = n; + return; + } + ++dp; + } + + // Add a new digraph to the table. + if (ga_grow(&user_digraphs, 1) == OK) + { + dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len; + dp->char1 = char1; + dp->char2 = char2; + dp->result = n; + ++user_digraphs.ga_len; + } +} + +/* + * Check the characters are valid for a digraph. + * If they are valid, returns TRUE; otherwise, give an error message and + * returns FALSE. + */ + static int +check_digraph_chars_valid(int char1, int char2) +{ + if (char2 == 0) + { + char_u msg[MB_MAXBYTES + 1]; + + msg[mb_char2bytes(char1, msg)] = NUL; + + semsg(_(e_digraph_must_be_just_two_characters_str), msg); + return FALSE; + } + if (char1 == ESC || char2 == ESC) + { + emsg(_(e_escape_not_allowed_in_digraph)); + return FALSE; + } + return TRUE; +} + + + /* * Add the digraphs in the argument to the digraph table. * format: {c1}{c2} char {c1}{c2} char ... @@ -2077,8 +1957,6 @@ getdigraph(int char1, int char2, int meta_char) putdigraph(char_u *str) { int char1, char2, n; - int i; - digr_T *dp; while (*str != NUL) { @@ -2087,48 +1965,19 @@ putdigraph(char_u *str) return; char1 = *str++; char2 = *str++; - if (char2 == 0) - { - emsg(_(e_invarg)); - return; - } - if (char1 == ESC || char2 == ESC) - { - emsg(_("E104: Escape not allowed in digraph")); + + if (!check_digraph_chars_valid(char1, char2)) return; - } + str = skipwhite(str); if (!VIM_ISDIGIT(*str)) { - emsg(_(e_number_exp)); + emsg(_(e_number_expected)); return; } n = getdigits(&str); - /* If the digraph already exists, replace the result. */ - dp = (digr_T *)user_digraphs.ga_data; - for (i = 0; i < user_digraphs.ga_len; ++i) - { - if ((int)dp->char1 == char1 && (int)dp->char2 == char2) - { - dp->result = n; - break; - } - ++dp; - } - - /* Add a new digraph to the table. */ - if (i == user_digraphs.ga_len) - { - if (ga_grow(&user_digraphs, 1) == OK) - { - dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len; - dp->char1 = char1; - dp->char2 = char2; - dp->result = n; - ++user_digraphs.ga_len; - } - } + registerdigraph(char1, char2, n); } } @@ -2158,7 +2007,7 @@ listdigraphs(int use_headers) #if defined(USE_UNICODE_DIGRAPHS) digr_T tmp; - /* May need to convert the result to 'encoding'. */ + // May need to convert the result to 'encoding'. tmp.char1 = dp->char1; tmp.char2 = dp->char2; tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE); @@ -2187,8 +2036,99 @@ listdigraphs(int use_headers) ui_breakcheck(); ++dp; } - must_redraw = CLEAR; /* clear screen, because some digraphs may be - wrong, in which case we messed up ScreenLines */ + must_redraw = CLEAR; // clear screen, because some digraphs may be + // wrong, in which case we messed up ScreenLines +} + + static void +digraph_getlist_appendpair(digr_T *dp, list_T *l) +{ + char_u buf[30]; + char_u *p; + list_T *l2; + listitem_T *li, *li2; + + + li = listitem_alloc(); + if (li == NULL) + return; + list_append(l, li); + li->li_tv.v_type = VAR_LIST; + li->li_tv.v_lock = 0; + + l2 = list_alloc(); + li->li_tv.vval.v_list = l2; + if (l2 == NULL) + return; + ++l2->lv_refcount; + + li2 = listitem_alloc(); + if (li2 == NULL) + return; + list_append(l2, li2); + li2->li_tv.v_type = VAR_STRING; + li2->li_tv.v_lock = 0; + + buf[0] = dp->char1; + buf[1] = dp->char2; + buf[2] = NUL; + li2->li_tv.vval.v_string = vim_strsave(&buf[0]); + + li2 = listitem_alloc(); + if (li2 == NULL) + return; + list_append(l2, li2); + li2->li_tv.v_type = VAR_STRING; + li2->li_tv.v_lock = 0; + + p = buf; + if (has_mbyte) + p += (*mb_char2bytes)(dp->result, p); + else + *p++ = (char_u)dp->result; + *p = NUL; + + li2->li_tv.vval.v_string = vim_strsave(buf); +} + + static void +digraph_getlist_common(int list_all, typval_T *rettv) +{ + int i; + digr_T *dp; + + if (rettv_list_alloc(rettv) == FAIL) + return; + + if (list_all) + { + dp = digraphdefault; + for (i = 0; dp->char1 != NUL && !got_int; ++i) + { +#ifdef USE_UNICODE_DIGRAPHS + digr_T tmp; + + tmp.char1 = dp->char1; + tmp.char2 = dp->char2; + tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE); + if (tmp.result != 0 && tmp.result != tmp.char2 + && (has_mbyte || tmp.result <= 255)) + digraph_getlist_appendpair(&tmp, rettv->vval.v_list); +#else + if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result + && (has_mbyte || dp->result <= 255)) + digraph_getlist_appendpair(dp, rettv->vval.v_list); +#endif + ++dp; + } + } + + dp = (digr_T *)user_digraphs.ga_data; + for (i = 0; i < user_digraphs.ga_len && !got_int; ++i) + { + digraph_getlist_appendpair(dp, rettv->vval.v_list); + ++dp; + } } static __thread struct dg_header_entry { @@ -2270,7 +2210,7 @@ printdigraph(digr_T *dp, result_T *previous) p = buf; if (has_mbyte) { - /* add a space to draw a composing char on */ + // add a space to draw a composing char on if (enc_utf8 && utf_iscomposing(dp->result)) *p++ = ' '; p += (*mb_char2bytes)(dp->result, p); @@ -2287,18 +2227,230 @@ printdigraph(digr_T *dp, result_T *previous) } } -#endif /* FEAT_DIGRAPHS */ +# ifdef FEAT_EVAL +/* + * Get the two digraph characters from a typval. + * Return OK or FAIL. + */ + static int +get_digraph_chars(typval_T *arg, int *char1, int *char2) +{ + char_u buf_chars[NUMBUFLEN]; + char_u *chars = tv_get_string_buf_chk(arg, buf_chars); + char_u *p = chars; + + if (p != NULL) + { + if (*p != NUL) + { + *char1 = mb_cptr2char_adv(&p); + if (*p != NUL) + { + *char2 = mb_cptr2char_adv(&p); + if (*p == NUL) + { + if (check_digraph_chars_valid(*char1, *char2)) + return OK; + return FAIL; + } + } + } + } + semsg(_(e_digraph_must_be_just_two_characters_str), chars); + return FAIL; +} + + static int +digraph_set_common(typval_T *argchars, typval_T *argdigraph) +{ + int char1, char2; + char_u *digraph; + char_u *p; + char_u buf_digraph[NUMBUFLEN]; + varnumber_T n; + + if (get_digraph_chars(argchars, &char1, &char2) == FAIL) + return FALSE; + + digraph = tv_get_string_buf_chk(argdigraph, buf_digraph); + if (digraph == NULL) + return FALSE; + p = digraph; + n = mb_cptr2char_adv(&p); + if (*p != NUL) + { + semsg(_(e_digraph_argument_must_be_one_character_str), digraph); + return FALSE; + } + + registerdigraph(char1, char2, (int)n); + return TRUE; +} +# endif + +#endif // FEAT_DIGRAPHS + +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * "digraph_get()" function + */ + void +f_digraph_get(typval_T *argvars, typval_T *rettv) +{ +# ifdef FEAT_DIGRAPHS + int code; + char_u buf[NUMBUFLEN]; + char_u *digraphs; + + rettv->v_type = VAR_STRING; + rettv->vval.v_string = NULL; // Return empty string for failure + + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + + digraphs = tv_get_string_chk(&argvars[0]); + + if (digraphs == NULL) + return; + else if (STRLEN(digraphs) != 2) + { + semsg(_(e_digraph_must_be_just_two_characters_str), digraphs); + return; + } + code = digraph_get(digraphs[0], digraphs[1], FALSE); + + if (has_mbyte) + buf[(*mb_char2bytes)(code, buf)] = NUL; + else { + buf[0] = code; + buf[1] = NUL; + } + + rettv->vval.v_string = vim_strsave(buf); +# else + emsg(_(e_no_digraphs_version)); +# endif +} + +/* + * "digraph_getlist()" function + */ + void +f_digraph_getlist(typval_T *argvars, typval_T *rettv) +{ +# ifdef FEAT_DIGRAPHS + int flag_list_all; + + if (in_vim9script() && check_for_opt_bool_arg(argvars, 0) == FAIL) + return; + + if (argvars[0].v_type == VAR_UNKNOWN) + flag_list_all = FALSE; + else + { + int error = FALSE; + varnumber_T flag = tv_get_number_chk(&argvars[0], &error); + + if (error) + return; + flag_list_all = flag ? TRUE : FALSE; + } + + digraph_getlist_common(flag_list_all, rettv); +# else + emsg(_(e_no_digraphs_version)); +# endif +} + +/* + * "digraph_set()" function + */ + void +f_digraph_set(typval_T *argvars, typval_T *rettv) +{ +# ifdef FEAT_DIGRAPHS + rettv->v_type = VAR_BOOL; + rettv->vval.v_number = VVAL_FALSE; + + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL)) + return; + + if (!digraph_set_common(&argvars[0], &argvars[1])) + return; + + rettv->vval.v_number = VVAL_TRUE; +# else + emsg(_(e_no_digraphs_version)); +# endif +} + +/* + * "digraph_setlist()" function + */ + void +f_digraph_setlist(typval_T * argvars, typval_T *rettv) +{ +# ifdef FEAT_DIGRAPHS + list_T *pl, *l; + listitem_T *pli; + + rettv->v_type = VAR_BOOL; + rettv->vval.v_number = VVAL_FALSE; + + if (argvars[0].v_type != VAR_LIST) + { + emsg(_(e_digraph_setlist_argument_must_be_list_of_lists_with_two_items)); + return; + } + + pl = argvars[0].vval.v_list; + if (pl == NULL) + { + // Empty list always results in success. + rettv->vval.v_number = VVAL_TRUE; + return; + } + + FOR_ALL_LIST_ITEMS(pl, pli) + { + if (pli->li_tv.v_type != VAR_LIST) + { + emsg(_(e_digraph_setlist_argument_must_be_list_of_lists_with_two_items)); + return; + } + + l = pli->li_tv.vval.v_list; + if (l == NULL || l->lv_len != 2) + { + emsg(_(e_digraph_setlist_argument_must_be_list_of_lists_with_two_items)); + return; + } + + if (!digraph_set_common(&l->lv_first->li_tv, + &l->lv_first->li_next->li_tv)) + return; + } + rettv->vval.v_number = VVAL_TRUE; +# else + emsg(_(e_no_digraphs_version)); +# endif +} + +#endif // FEAT_EVAL + #if defined(FEAT_KEYMAP) || defined(PROTO) -/* structure used for b_kmap_ga.ga_data */ +// structure used for b_kmap_ga.ga_data typedef struct { char_u *from; char_u *to; } kmap_T; -#define KMAP_MAXLEN 20 /* maximum length of "from" or "to" */ +#define KMAP_MAXLEN 20 // maximum length of "from" or "to" static void keymap_unload(void); @@ -2315,8 +2467,8 @@ keymap_init(void) if (*curbuf->b_p_keymap == NUL) { - /* Stop any active keymap and clear the table. Also remove - * b:keymap_name, as no keymap is active now. */ + // Stop any active keymap and clear the table. Also remove + // b:keymap_name, as no keymap is active now. keymap_unload(); do_cmdline_cmd((char_u *)"unlet! b:keymap_name"); } @@ -2325,25 +2477,25 @@ keymap_init(void) char_u *buf; size_t buflen; - /* Source the keymap file. It will contain a ":loadkeymap" command - * which will call ex_loadkeymap() below. */ + // Source the keymap file. It will contain a ":loadkeymap" command + // which will call ex_loadkeymap() below. buflen = STRLEN(curbuf->b_p_keymap) + STRLEN(p_enc) + 14; buf = alloc(buflen); if (buf == NULL) - return e_outofmem; + return e_out_of_memory; - /* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */ + // try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' vim_snprintf((char *)buf, buflen, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc); if (source_runtime(buf, 0) == FAIL) { - /* try finding "keymap/'keymap'.vim" in 'runtimepath' */ + // try finding "keymap/'keymap'.vim" in 'runtimepath' vim_snprintf((char *)buf, buflen, "keymap/%s.vim", curbuf->b_p_keymap); if (source_runtime(buf, 0) == FAIL) { vim_free(buf); - return N_("E544: Keymap file not found"); + return N_(e_keymap_file_not_found); } } vim_free(buf); @@ -2362,14 +2514,14 @@ ex_loadkeymap(exarg_T *eap) char_u *p; char_u *s; kmap_T *kp; -#define KMAP_LLEN 200 /* max length of "to" and "from" together */ +#define KMAP_LLEN 200 // max length of "to" and "from" together char_u buf[KMAP_LLEN + 11]; int i; char_u *save_cpo = p_cpo; - if (!getline_equal(eap->getline, eap->cookie, getsourceline)) + if (!sourcing_a_script(eap)) { - emsg(_("E105: Using :loadkeymap not in a sourced file")); + emsg(_(e_using_loadkeymap_not_in_sourced_file)); return; } @@ -2379,9 +2531,9 @@ ex_loadkeymap(exarg_T *eap) keymap_unload(); curbuf->b_kmap_state = 0; - ga_init2(&curbuf->b_kmap_ga, (int)sizeof(kmap_T), 20); + ga_init2(&curbuf->b_kmap_ga, sizeof(kmap_T), 20); - /* Set 'cpoptions' to "C" to avoid line continuation. */ + // Set 'cpoptions' to "C" to avoid line continuation. p_cpo = (char_u *)"C"; /* @@ -2398,17 +2550,17 @@ ex_loadkeymap(exarg_T *eap) { kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len; s = skiptowhite(p); - kp->from = vim_strnsave(p, (int)(s - p)); + kp->from = vim_strnsave(p, s - p); p = skipwhite(s); s = skiptowhite(p); - kp->to = vim_strnsave(p, (int)(s - p)); + kp->to = vim_strnsave(p, s - p); if (kp->from == NULL || kp->to == NULL || STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN || *kp->from == NUL || *kp->to == NUL) { if (kp->to != NULL && *kp->to == NUL) - emsg(_("E791: Empty keymap entry")); + emsg(_(e_empty_keymap_entry)); vim_free(kp->from); vim_free(kp->to); } @@ -2426,7 +2578,7 @@ ex_loadkeymap(exarg_T *eap) vim_snprintf((char *)buf, sizeof(buf), " %s %s", ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].from, ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].to); - (void)do_map(2, buf, LANGMAP, FALSE); + (void)do_map(MAPTYPE_NOREMAP, buf, MODE_LANGMAP, FALSE); } p_cpo = save_cpo; @@ -2449,15 +2601,15 @@ keymap_unload(void) if (!(curbuf->b_kmap_state & KEYMAP_LOADED)) return; - /* Set 'cpoptions' to "C" to avoid line continuation. */ + // Set 'cpoptions' to "C" to avoid line continuation. p_cpo = (char_u *)"C"; - /* clear the ":lmap"s */ + // clear the ":lmap"s kp = (kmap_T *)curbuf->b_kmap_ga.ga_data; for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i) { vim_snprintf((char *)buf, sizeof(buf), " %s", kp[i].from); - (void)do_map(1, buf, LANGMAP, FALSE); + (void)do_map(MAPTYPE_UNMAP, buf, MODE_LANGMAP, FALSE); } keymap_clear(&curbuf->b_kmap_ga); @@ -2480,4 +2632,4 @@ keymap_clear(garray_T *kmap) vim_free(kp[i].to); } } -#endif /* FEAT_KEYMAP */ +#endif // FEAT_KEYMAP diff --git a/src/dimm.idl b/src/dimm.idl deleted file mode 100644 index ac449650ee6c5..0000000000000 --- a/src/dimm.idl +++ /dev/null @@ -1,544 +0,0 @@ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1992-2000. -// -// File: dimm.idl -// -// Contents: ActiveIMM interface definitions -// -// -//-------------------------------------------------------------------------- - -cpp_quote("//=--------------------------------------------------------------------------=") -cpp_quote("// dimm.h") -cpp_quote("//=--------------------------------------------------------------------------=") -cpp_quote("// (C) Copyright 1995-1998 Microsoft Corporation. All Rights Reserved.") -cpp_quote("//") -cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF") -cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO") -cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A") -cpp_quote("// PARTICULAR PURPOSE.") -cpp_quote("//=--------------------------------------------------------------------------=") -cpp_quote("") -cpp_quote("#pragma comment(lib,\"uuid.lib\")") -cpp_quote("") -cpp_quote("//--------------------------------------------------------------------------") -cpp_quote("// IActiveIMM Interfaces.") -cpp_quote("") - -/* -Disable a warning about lack of polymorphic type support for the following reasons -- the only reason to have library block in the file is to make midl accept coclass - statement and generate CLSID for CActiveIMM. -- the generated dimm_i.c has the clsid and that file is used to have clsid available -- the dimm.tlb is not used at all -- on top of it, there is no plans to port the app using dimm.idl to 64b platform. -*/ -/* - * midl_pragma is unsupported in midl version 3.01 shipped with VC5.0. - * It is supported in midl version 5.01 shipped with VC6.0 - * I could not produce message 2395. Is this needed? W.Briscoe 2001-08-14 - */ -#if (__midl >= 501) -midl_pragma warning( disable: 2395) // polymorphic types not supported in the TLB -#endif - -#ifndef DO_NO_IMPORTS -import "unknwn.idl"; -#endif - -[ - uuid(4955DD30-B159-11d0-8FCF-00AA006BCC59), - helpstring("ActiveIMM"), - lcid(0x0000), - version(0.1) -] -library ActiveIMM -{ - importlib("stdole2.tlb"); - - cpp_quote("#include ") - - cpp_quote("#if 0") - - typedef WORD LANGID; - - typedef struct - { - LPSTR lpReading; - LPSTR lpWord; - } REGISTERWORDA; - - typedef struct - { - LPWSTR lpReading; - LPWSTR lpWord; - } REGISTERWORDW; - - #define LF_FACESIZE 32 - - typedef struct - { - LONG lfHeight; - LONG lfWidth; - LONG lfEscapement; - LONG lfOrientation; - LONG lfWeight; - BYTE lfItalic; - BYTE lfUnderline; - BYTE lfStrikeOut; - BYTE lfCharSet; - BYTE lfOutPrecision; - BYTE lfClipPrecision; - BYTE lfQuality; - BYTE lfPitchAndFamily; - CHAR lfFaceName[LF_FACESIZE]; - } LOGFONTA; - - typedef struct - { - LONG lfHeight; - LONG lfWidth; - LONG lfEscapement; - LONG lfOrientation; - LONG lfWeight; - BYTE lfItalic; - BYTE lfUnderline; - BYTE lfStrikeOut; - BYTE lfCharSet; - BYTE lfOutPrecision; - BYTE lfClipPrecision; - BYTE lfQuality; - BYTE lfPitchAndFamily; - WCHAR lfFaceName[LF_FACESIZE]; - } LOGFONTW; - - typedef DWORD HIMC; - typedef DWORD HIMCC; - - typedef struct - { - DWORD dwIndex; - DWORD dwStyle; - POINT ptCurrentPos; - RECT rcArea; - } CANDIDATEFORM; - - typedef struct - { - DWORD dwStyle; - POINT ptCurrentPos; - RECT rcArea; - } COMPOSITIONFORM; - - typedef struct - { - DWORD dwSize; - DWORD dwStyle; - DWORD dwCount; - DWORD dwSelection; - DWORD dwPageStart; - DWORD dwPageSize; - DWORD dwOffset[1]; - } CANDIDATELIST; - - #define STYLE_DESCRIPTION_SIZE 32 - - typedef struct - { - DWORD dwStyle; - CHAR szDescription[STYLE_DESCRIPTION_SIZE]; - } STYLEBUFA; - - typedef struct - { - DWORD dwStyle; - WCHAR szDescription[STYLE_DESCRIPTION_SIZE]; - } STYLEBUFW; - - typedef WORD ATOM; - - cpp_quote("#endif") - - cpp_quote("#if (WINVER < 0x040A)") - - #define IMEMENUITEM_STRING_SIZE 80 - - typedef struct - { - UINT cbSize; - UINT fType; - UINT fState; - UINT wID; - HBITMAP hbmpChecked; - HBITMAP hbmpUnchecked; - DWORD dwItemData; - CHAR szString[IMEMENUITEM_STRING_SIZE]; - HBITMAP hbmpItem; - } IMEMENUITEMINFOA; - - typedef struct - { - UINT cbSize; - UINT fType; - UINT fState; - UINT wID; - HBITMAP hbmpChecked; - HBITMAP hbmpUnchecked; - DWORD dwItemData; - WCHAR szString[IMEMENUITEM_STRING_SIZE]; - HBITMAP hbmpItem; - } IMEMENUITEMINFOW; - - cpp_quote("#endif") - - cpp_quote("#ifndef _DDKIMM_H_") - - typedef struct - { - HWND hWnd; - BOOL fOpen; - POINT ptStatusWndPos; - POINT ptSoftKbdPos; - DWORD fdwConversion; - DWORD fdwSentence; - union - { - LOGFONTA A; - LOGFONTW W; - } lfFont; - COMPOSITIONFORM cfCompForm; - CANDIDATEFORM cfCandForm[4]; - HIMCC hCompStr; - HIMCC hCandInfo; - HIMCC hGuideLine; - HIMCC hPrivate; - DWORD dwNumMsgBuf; - HIMCC hMsgBuf; - DWORD fdwInit; - DWORD dwReserve[3]; - } INPUTCONTEXT; - - typedef struct - { - DWORD dwPrivateDataSize; - DWORD fdwProperty; - DWORD fdwConversionCaps; - DWORD fdwSentenceCaps; - DWORD fdwUICaps; - DWORD fdwSCSCaps; - DWORD fdwSelectCaps; - } IMEINFO; - - cpp_quote("#endif") - - [ - object, - uuid(08C03412-F96B-11d0-A475-00AA006BCC59), - pointer_default(unique) - ] - interface IEnumRegisterWordA : IUnknown - { - HRESULT Clone([out] IEnumRegisterWordA **ppEnum); - HRESULT Next([in] ULONG ulCount, [out] REGISTERWORDA *rgRegisterWord, [out] ULONG *pcFetched); - HRESULT Reset(); - HRESULT Skip([in] ULONG ulCount); - }; - - [ - object, - uuid(4955DD31-B159-11d0-8FCF-00AA006BCC59), - pointer_default(unique) - ] - interface IEnumRegisterWordW : IUnknown - { - HRESULT Clone([out] IEnumRegisterWordW **ppEnum); - HRESULT Next([in] ULONG ulCount, [out] REGISTERWORDW *rgRegisterWord, [out] ULONG *pcFetched); - HRESULT Reset(); - HRESULT Skip([in] ULONG ulCount); - }; - - - [ - object, - uuid(09b5eab0-f997-11d1-93d4-0060b067b86e), - pointer_default(unique) - ] - interface IEnumInputContext : IUnknown - { - HRESULT Clone([out] IEnumInputContext **ppEnum); - HRESULT Next([in] ULONG ulCount, [out] HIMC *rgInputContext, [out] ULONG *pcFetched); - HRESULT Reset(); - HRESULT Skip([in] ULONG ulCount); - }; - - - [ - object, - uuid(b3458082-bd00-11d1-939b-0060b067b86e), - pointer_default(unique) - ] - interface IActiveIMMRegistrar : IUnknown - { - HRESULT RegisterIME([in] REFCLSID rclsid, [in] LANGID lgid, [in] LPCWSTR pszIconFile, [in] LPCWSTR pszDesc); - HRESULT UnregisterIME([in] REFCLSID rclsid); - }; - - [ - object, - uuid(b5cf2cfa-8aeb-11d1-9364-0060b067b86e), - pointer_default(unique) - ] - interface IActiveIMMMessagePumpOwner : IUnknown - { - HRESULT Start(); - HRESULT End(); - HRESULT OnTranslateMessage([in] const MSG *pMsg); - HRESULT Pause([out] DWORD *pdwCookie); - HRESULT Resume([in] DWORD dwCookie); - } - - [ - object, - uuid(08c0e040-62d1-11d1-9326-0060b067b86e), - pointer_default(unique) - ] - interface IActiveIMMApp : IUnknown - { - HRESULT AssociateContext([in] HWND hWnd, [in] HIMC hIME, [out] HIMC *phPrev); - HRESULT ConfigureIMEA([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDA *pData); - HRESULT ConfigureIMEW([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDW *pData); - HRESULT CreateContext([out] HIMC *phIMC); - HRESULT DestroyContext([in] HIMC hIME); - HRESULT EnumRegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordA **pEnum); - HRESULT EnumRegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordW **pEnum); - HRESULT EscapeA([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult); - HRESULT EscapeW([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult); - HRESULT GetCandidateListA([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied); - HRESULT GetCandidateListW([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied); - HRESULT GetCandidateListCountA([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen); - HRESULT GetCandidateListCountW([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen); - HRESULT GetCandidateWindow([in] HIMC hIMC, [in] DWORD dwIndex, [out] CANDIDATEFORM *pCandidate); - HRESULT GetCompositionFontA([in] HIMC hIMC, [out] LOGFONTA *plf); - HRESULT GetCompositionFontW([in] HIMC hIMC, [out] LOGFONTW *plf); - HRESULT GetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf); - HRESULT GetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf); - HRESULT GetCompositionWindow([in] HIMC hIMC, [out] COMPOSITIONFORM *pCompForm); - HRESULT GetContext([in] HWND hWnd, [out] HIMC *phIMC); - HRESULT GetConversionListA([in] HKL hKL, [in] HIMC hIMC, [in] LPSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied); - HRESULT GetConversionListW([in] HKL hKL, [in] HIMC hIMC, [in] LPWSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied); - HRESULT GetConversionStatus([in] HIMC hIMC, [out] DWORD *pfdwConversion, [out] DWORD *pfdwSentence); - HRESULT GetDefaultIMEWnd([in] HWND hWnd, [out] HWND *phDefWnd); - HRESULT GetDescriptionA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szDescription, [out] UINT *puCopied); - HRESULT GetDescriptionW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szDescription, [out] UINT *puCopied); - HRESULT GetGuideLineA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPSTR pBuf, [out] DWORD *pdwResult); - HRESULT GetGuideLineW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPWSTR pBuf, [out] DWORD *pdwResult); - HRESULT GetIMEFileNameA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szFileName, [out] UINT *puCopied); - HRESULT GetIMEFileNameW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szFileName, [out] UINT *puCopied); - HRESULT GetOpenStatus([in] HIMC hIMC); - HRESULT GetProperty([in] HKL hKL, [in] DWORD fdwIndex, [out] DWORD *pdwProperty); - HRESULT GetRegisterWordStyleA([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFA *pStyleBuf, [out] UINT *puCopied); - HRESULT GetRegisterWordStyleW([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFW *pStyleBuf, [out] UINT *puCopied); - HRESULT GetStatusWindowPos([in] HIMC hIMC, [out] POINT *pptPos); - HRESULT GetVirtualKey([in] HWND hWnd, [out] UINT *puVirtualKey); - HRESULT InstallIMEA([in] LPSTR szIMEFileName, [in] LPSTR szLayoutText, [out] HKL *phKL); - HRESULT InstallIMEW([in] LPWSTR szIMEFileName, [in] LPWSTR szLayoutText, [out] HKL *phKL); - HRESULT IsIME([in] HKL hKL); - HRESULT IsUIMessageA([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam); - HRESULT IsUIMessageW([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam); - HRESULT NotifyIME([in] HIMC hIMC, [in] DWORD dwAction, [in] DWORD dwIndex, [in] DWORD dwValue); - HRESULT RegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister); - HRESULT RegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister); - HRESULT ReleaseContext([in] HWND hWnd, [in] HIMC hIMC); - HRESULT SetCandidateWindow([in] HIMC hIMC, [in] CANDIDATEFORM *pCandidate); - HRESULT SetCompositionFontA([in] HIMC hIMC, [in] LOGFONTA *plf); - HRESULT SetCompositionFontW([in] HIMC hIMC, [in] LOGFONTW *plf); - HRESULT SetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen); - HRESULT SetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen); - HRESULT SetCompositionWindow([in] HIMC hIMC, [in] COMPOSITIONFORM *pCompForm); - HRESULT SetConversionStatus([in] HIMC hIMC, [in] DWORD fdwConversion, [in] DWORD fdwSentence); - HRESULT SetOpenStatus([in] HIMC hIMC, [in] BOOL fOpen); - HRESULT SetStatusWindowPos([in] HIMC hIMC, [in] POINT *pptPos); - HRESULT SimulateHotKey([in] HWND hWnd, [in] DWORD dwHotKeyID); - HRESULT UnregisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szUnregister); - HRESULT UnregisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szUnregister); - - HRESULT Activate([in] BOOL fRestoreLayout); - HRESULT Deactivate(); - - HRESULT OnDefWindowProc([in] HWND hWnd, [in] UINT Msg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult); - - HRESULT FilterClientWindows([in] ATOM *aaClassList, [in] UINT uSize); - - HRESULT GetCodePageA([in] HKL hKL, [out] UINT *uCodePage); - HRESULT GetLangId([in] HKL hKL, [out] LANGID *plid); - - // win98/nt5 apis - HRESULT AssociateContextEx([in] HWND hWnd, [in] HIMC hIMC, [in] DWORD dwFlags); - HRESULT DisableIME([in] DWORD idThread); - HRESULT GetImeMenuItemsA([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOA *pImeParentMenu, [out] IMEMENUITEMINFOA *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult); - HRESULT GetImeMenuItemsW([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOW *pImeParentMenu, [out] IMEMENUITEMINFOW *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult); - HRESULT EnumInputContext([in] DWORD idThread, [out] IEnumInputContext **ppEnum); - }; - - [ - object, - uuid(08C03411-F96B-11d0-A475-00AA006BCC59), - pointer_default(unique) - ] - interface IActiveIMMIME : IUnknown - { - HRESULT AssociateContext([in] HWND hWnd, [in] HIMC hIME, [out] HIMC *phPrev); - HRESULT ConfigureIMEA([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDA *pData); - HRESULT ConfigureIMEW([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDW *pData); - HRESULT CreateContext([out] HIMC *phIMC); - HRESULT DestroyContext([in] HIMC hIME); - HRESULT EnumRegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordA **pEnum); - HRESULT EnumRegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordW **pEnum); - HRESULT EscapeA([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult); - HRESULT EscapeW([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult); - HRESULT GetCandidateListA([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied); - HRESULT GetCandidateListW([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied); - HRESULT GetCandidateListCountA([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen); - HRESULT GetCandidateListCountW([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen); - HRESULT GetCandidateWindow([in] HIMC hIMC, [in] DWORD dwIndex, [out] CANDIDATEFORM *pCandidate); - HRESULT GetCompositionFontA([in] HIMC hIMC, [out] LOGFONTA *plf); - HRESULT GetCompositionFontW([in] HIMC hIMC, [out] LOGFONTW *plf); - HRESULT GetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf); - HRESULT GetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf); - HRESULT GetCompositionWindow([in] HIMC hIMC, [out] COMPOSITIONFORM *pCompForm); - HRESULT GetContext([in] HWND hWnd, [out] HIMC *phIMC); - HRESULT GetConversionListA([in] HKL hKL, [in] HIMC hIMC, [in] LPSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied); - HRESULT GetConversionListW([in] HKL hKL, [in] HIMC hIMC, [in] LPWSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied); - HRESULT GetConversionStatus([in] HIMC hIMC, [out] DWORD *pfdwConversion, [out] DWORD *pfdwSentence); - HRESULT GetDefaultIMEWnd([in] HWND hWnd, [out] HWND *phDefWnd); - HRESULT GetDescriptionA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szDescription, [out] UINT *puCopied); - HRESULT GetDescriptionW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szDescription, [out] UINT *puCopied); - HRESULT GetGuideLineA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPSTR pBuf, [out] DWORD *pdwResult); - HRESULT GetGuideLineW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPWSTR pBuf, [out] DWORD *pdwResult); - HRESULT GetIMEFileNameA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szFileName, [out] UINT *puCopied); - HRESULT GetIMEFileNameW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szFileName, [out] UINT *puCopied); - HRESULT GetOpenStatus([in] HIMC hIMC); - HRESULT GetProperty([in] HKL hKL, [in] DWORD fdwIndex, [out] DWORD *pdwProperty); - HRESULT GetRegisterWordStyleA([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFA *pStyleBuf, [out] UINT *puCopied); - HRESULT GetRegisterWordStyleW([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFW *pStyleBuf, [out] UINT *puCopied); - HRESULT GetStatusWindowPos([in] HIMC hIMC, [out] POINT *pptPos); - HRESULT GetVirtualKey([in] HWND hWnd, [out] UINT *puVirtualKey); - HRESULT InstallIMEA([in] LPSTR szIMEFileName, [in] LPSTR szLayoutText, [out] HKL *phKL); - HRESULT InstallIMEW([in] LPWSTR szIMEFileName, [in] LPWSTR szLayoutText, [out] HKL *phKL); - HRESULT IsIME([in] HKL hKL); - HRESULT IsUIMessageA([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam); - HRESULT IsUIMessageW([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam); - HRESULT NotifyIME([in] HIMC hIMC, [in] DWORD dwAction, [in] DWORD dwIndex, [in] DWORD dwValue); - HRESULT RegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister); - HRESULT RegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister); - HRESULT ReleaseContext([in] HWND hWnd, [in] HIMC hIMC); - HRESULT SetCandidateWindow([in] HIMC hIMC, [in] CANDIDATEFORM *pCandidate); - HRESULT SetCompositionFontA([in] HIMC hIMC, [in] LOGFONTA *plf); - HRESULT SetCompositionFontW([in] HIMC hIMC, [in] LOGFONTW *plf); - HRESULT SetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen); - HRESULT SetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen); - HRESULT SetCompositionWindow([in] HIMC hIMC, [in] COMPOSITIONFORM *pCompForm); - HRESULT SetConversionStatus([in] HIMC hIMC, [in] DWORD fdwConversion, [in] DWORD fdwSentence); - HRESULT SetOpenStatus([in] HIMC hIMC, [in] BOOL fOpen); - HRESULT SetStatusWindowPos([in] HIMC hIMC, [in] POINT *pptPos); - HRESULT SimulateHotKey([in] HWND hWnd, [in] DWORD dwHotKeyID); - HRESULT UnregisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szUnregister); - HRESULT UnregisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szUnregister); - - // ime helper methods - HRESULT GenerateMessage([in] HIMC hIMC); - - // HIMC and HIMCC management api's - HRESULT LockIMC([in] HIMC hIMC, [out] INPUTCONTEXT **ppIMC); - HRESULT UnlockIMC([in] HIMC hIMC); - HRESULT GetIMCLockCount([in] HIMC hIMC, [out] DWORD *pdwLockCount); - HRESULT CreateIMCC([in] DWORD dwSize, [out] HIMCC *phIMCC); - HRESULT DestroyIMCC([in] HIMCC hIMCC); - HRESULT LockIMCC([in] HIMCC hIMCC, [out] void **ppv); - HRESULT UnlockIMCC([in] HIMCC hIMCC); - HRESULT ReSizeIMCC([in] HIMCC hIMCC, [in] DWORD dwSize, [out] HIMCC *phIMCC); - HRESULT GetIMCCSize([in] HIMCC hIMCC, [out] DWORD *pdwSize); - HRESULT GetIMCCLockCount([in] HIMCC hIMCC, [out] DWORD *pdwLockCount); - - // hot key manipulation api's - HRESULT GetHotKey([in] DWORD dwHotKeyID, [out] UINT *puModifiers, [out] UINT *puVKey, [out] HKL *phKL); - HRESULT SetHotKey([in] DWORD dwHotKeyID, [in] UINT uModifiers, [in] UINT uVKey, [in] HKL hKL); - - // soft keyboard api's - HRESULT CreateSoftKeyboard([in] UINT uType, [in] HWND hOwner, [in] int x, [in] int y, [out] HWND *phSoftKbdWnd); - HRESULT DestroySoftKeyboard([in] HWND hSoftKbdWnd); - HRESULT ShowSoftKeyboard([in] HWND hSoftKbdWnd, [in] int nCmdShow); - - HRESULT GetCodePageA([in] HKL hKL, [out] UINT *uCodePage); - HRESULT GetLangId([in] HKL hKL, [out] LANGID *plid); - - HRESULT KeybdEvent([in] LANGID lgidIME, [in] BYTE bVk, [in] BYTE bScan, [in] DWORD dwFlags, [in] DWORD dwExtraInfo); - - HRESULT LockModal(); - HRESULT UnlockModal(); - - // win98/nt5 apis - HRESULT AssociateContextEx([in] HWND hWnd, [in] HIMC hIMC, [in] DWORD dwFlags); - HRESULT DisableIME([in] DWORD idThread); - HRESULT GetImeMenuItemsA([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOA *pImeParentMenu, [out] IMEMENUITEMINFOA *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult); - HRESULT GetImeMenuItemsW([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOW *pImeParentMenu, [out] IMEMENUITEMINFOW *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult); - HRESULT EnumInputContext([in] DWORD idThread, [out] IEnumInputContext **ppEnum); - HRESULT RequestMessageA([in] HIMC hIMC, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult); - HRESULT RequestMessageW([in] HIMC hIMC, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult); - - HRESULT SendIMCA([in] HWND hWnd, [in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult); - HRESULT SendIMCW([in] HWND hWnd, [in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult); - - HRESULT IsSleeping(); - }; - - [ - object, - uuid(6FE20962-D077-11d0-8FE7-00AA006BCC59), - pointer_default(unique) - ] - interface IActiveIME : IUnknown - { - HRESULT Inquire([in] DWORD dwSystemInfoFlags, [out] IMEINFO *pIMEInfo, [out] LPWSTR szWndClass, [out] DWORD *pdwPrivate); - HRESULT ConversionList([in] HIMC hIMC, [in] LPWSTR szSource, [in] UINT uFlag, [in] UINT uBufLen, [out] CANDIDATELIST *pDest, [out] UINT *puCopied); - HRESULT Configure([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDW *pRegisterWord); - HRESULT Destroy([in] UINT uReserved); - HRESULT Escape([in] HIMC hIMC, [in] UINT uEscape, [in, out] void *pData, [out] LRESULT *plResult); - HRESULT SetActiveContext([in] HIMC hIMC, [in] BOOL fFlag); - HRESULT ProcessKey([in] HIMC hIMC, [in] UINT uVirKey, [in] DWORD lParam, [in] BYTE *pbKeyState); - HRESULT Notify([in] HIMC hIMC, [in] DWORD dwAction, [in] DWORD dwIndex, [in] DWORD dwValue); - HRESULT Select([in] HIMC hIMC, [in] BOOL fSelect); - HRESULT SetCompositionString([in] HIMC hIMC, [in] DWORD dwIndex, [in] void *pComp, [in] DWORD dwCompLen, [in] void *pRead, [in] DWORD dwReadLen); - HRESULT ToAsciiEx([in] UINT uVirKey, [in] UINT uScanCode, [in] BYTE *pbKeyState, [in] UINT fuState, [in] HIMC hIMC, [out] DWORD *pdwTransBuf, [out] UINT *puSize); - HRESULT RegisterWord([in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szString); - HRESULT UnregisterWord([in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szString); - HRESULT GetRegisterWordStyle([in] UINT nItem, [out] STYLEBUFW *pStyleBuf, [out] UINT *puBufSize); - HRESULT EnumRegisterWord([in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordW **ppEnum); - HRESULT GetCodePageA([out] UINT *uCodePage); - HRESULT GetLangId([out] LANGID *plid); - }; - - [ - object, - uuid(e1c4bf0e-2d53-11d2-93e1-0060b067b86e), - pointer_default(unique) - ] - interface IActiveIME2 : IActiveIME - { - HRESULT Sleep(); - HRESULT Unsleep([in] BOOL fDead); - }; - - [ - uuid(4955DD33-B159-11d0-8FCF-00AA006BCC59), - ] - coclass CActiveIMM - { - [default] interface IActiveIMMApp; - interface IActiveIMMIME; - interface IActiveIMMRegistrar; - interface IActiveIMMMessagePumpOwner; - }; -} diff --git a/src/dosinst.c b/src/dosinst.c index 02726213f724d..b3fde43836254 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -23,7 +23,7 @@ #define GVIMEXT64_PATH "GvimExt64\\gvimext.dll" #define GVIMEXT32_PATH "GvimExt32\\gvimext.dll" -/* Macro to do an error check I was typing over and over */ +// Macro to do an error check I was typing over and over #define CHECK_REG_ERROR(code) \ do { \ if (code != ERROR_SUCCESS) \ @@ -33,33 +33,33 @@ } \ } while (0) -__thread int has_vim = 0; /* installable vim.exe exists */ -__thread int has_gvim = 0; /* installable gvim.exe exists */ +__thread int has_vim = 0; // installable vim.exe exists +__thread int has_gvim = 0; // installable gvim.exe exists -__thread char oldvimrc[BUFSIZE]; /* name of existing vimrc file */ -__thread char vimrc[BUFSIZE]; /* name of vimrc file to create */ +__thread char oldvimrc[BUFSIZE]; // name of existing vimrc file +__thread char vimrc[BUFSIZE]; // name of vimrc file to create -__thread char *default_bat_dir = NULL; /* when not NULL, use this as the default - directory to write .bat files in */ -__thread char *default_vim_dir = NULL; /* when not NULL, use this as the default - install dir for NSIS */ +__thread char *default_bat_dir = NULL; // when not NULL, use this as the default + // directory to write .bat files in +__thread char *default_vim_dir = NULL; // when not NULL, use this as the default + // install dir for NSIS /* * Structure used for each choice the user can make. */ struct choice { - int active; /* non-zero when choice is active */ - char *text; /* text displayed for this choice */ - void (*changefunc)(int idx); /* function to change this choice */ - int arg; /* argument for function */ - void (*installfunc)(int idx); /* function to install this choice */ + int active; // non-zero when choice is active + char *text; // text displayed for this choice + void (*changefunc)(int idx); // function to change this choice + int arg; // argument for function + void (*installfunc)(int idx); // function to install this choice }; -struct choice choices[30]; /* choices the user can make */ -int choice_count = 0; /* number of choices available */ +struct choice choices[30]; // choices the user can make +int choice_count = 0; // number of choices available -#define TABLE_SIZE(s) (int)(sizeof(s) / sizeof(*s)) +#define TABLE_SIZE(s) (int)ARRAYSIZE(s) enum { @@ -123,13 +123,13 @@ static char *(vimfiles_dir_choices[]) = "In your HOME directory", }; -/* non-zero when selected to install the popup menu entry. */ +// non-zero when selected to install the popup menu entry. static int install_popup = 0; -/* non-zero when selected to install the "Open with" entry. */ +// non-zero when selected to install the "Open with" entry. static int install_openwith = 0; -/* non-zero when need to add an uninstall entry in the registry */ +// non-zero when need to add an uninstall entry in the registry static int need_uninstall_entry = 0; /* @@ -191,7 +191,7 @@ check_unpack(void) FILE *fd; struct stat st; - /* check for presence of the correct version number in installdir[] */ + // check for presence of the correct version number in installdir[] runtimeidx = strlen(installdir) - strlen(VIM_VERSION_NODOT); if (runtimeidx <= 0 || stricmp(installdir + runtimeidx, VIM_VERSION_NODOT) != 0 @@ -204,19 +204,19 @@ check_unpack(void) myexit(1); } - /* check if filetype.vim is present, which means the runtime archive has - * been unpacked */ + // check if filetype.vim is present, which means the runtime archive has + // been unpacked sprintf(buf, "%s\\filetype.vim", installdir); if (stat(buf, &st) < 0) { printf("ERROR: Cannot find filetype.vim in \"%s\"\n", installdir); printf("It looks like you did not unpack the runtime archive.\n"); - printf("You must unpack the runtime archive \"vim%srt.zip\" before installing.\n", - VIM_VERSION_NODOT + 3); + printf("You must unpack the runtime archive \"%srt.zip\" before installing.\n", + VIM_VERSION_NODOT); myexit(1); } - /* Check if vim.exe or gvim.exe is in the current directory. */ + // Check if vim.exe or gvim.exe is in the current directory. if ((fd = fopen("gvim.exe", "r")) != NULL) { fclose(fd); @@ -251,32 +251,32 @@ pathcmp(char *p, int plen, char *q, int qlen) qlen = strlen(q); for (i = 0; ; ++i) { - /* End of "p": check if "q" also ends or just has a slash. */ + // End of "p": check if "q" also ends or just has a slash. if (i == plen) { - if (i == qlen) /* match */ + if (i == qlen) // match return 0; if (i == qlen - 1 && (q[i] == '\\' || q[i] == '/')) - return 0; /* match with trailing slash */ - return 1; /* no match */ + return 0; // match with trailing slash + return 1; // no match } - /* End of "q": check if "p" also ends or just has a slash. */ + // End of "q": check if "p" also ends or just has a slash. if (i == qlen) { - if (i == plen) /* match */ + if (i == plen) // match return 0; if (i == plen - 1 && (p[i] == '\\' || p[i] == '/')) - return 0; /* match with trailing slash */ - return 1; /* no match */ + return 0; // match with trailing slash + return 1; // no match } if (!(mytoupper(p[i]) == mytoupper(q[i]) || ((p[i] == '/' || p[i] == '\\') && (q[i] == '/' || q[i] == '\\')))) - return 1; /* no match */ + return 1; // no match } - /*NOTREACHED*/ + //NOTREACHED } /* @@ -308,7 +308,7 @@ findoldfile(char **destination) tmpname = alloc(strlen(cp) + 1); strcpy(tmpname, cp); - tmpname[strlen(tmpname) - 1] = 'x'; /* .exe -> .exx */ + tmpname[strlen(tmpname) - 1] = 'x'; // .exe -> .exx if (access(tmpname, 0) == 0) { @@ -347,7 +347,7 @@ find_bat_exe(int check_bat_only) { int i; - /* avoid looking in the "installdir" by chdir to system root */ + // avoid looking in the "installdir" by chdir to system root mch_chdir(sysdrive); mch_chdir("\\"); @@ -386,7 +386,7 @@ get_vim_env(void) FILE *fd; char fname[BUFSIZE]; - /* First get $VIMRUNTIME. If it's set, remove the tail. */ + // First get $VIMRUNTIME. If it's set, remove the tail. vim = getenv("VIMRUNTIME"); if (vim != NULL && *vim != 0 && strlen(vim) < sizeof(buf)) { @@ -399,18 +399,18 @@ get_vim_env(void) vim = getenv("VIM"); if (vim == NULL || *vim == 0) { - /* Use the directory from an old uninstall entry. */ + // Use the directory from an old uninstall entry. if (default_vim_dir != NULL) vim = default_vim_dir; else - /* Let NSIS know there is no default, it should use - * $PROGRAMFILES. */ + // Let NSIS know there is no default, it should use + // $PROGRAMFILES. vim = ""; } } - /* NSIS also uses GetTempPath(), thus we should get the same directory - * name as where NSIS will look for vimini.ini. */ + // NSIS also uses GetTempPath(), thus we should get the same directory + // name as where NSIS will look for vimini.ini. GetTempPath(sizeof(fname) - 12, fname); add_pathsep(fname); strcat(fname, "vimini.ini"); @@ -418,8 +418,8 @@ get_vim_env(void) fd = fopen(fname, "w"); if (fd != NULL) { - /* Make it look like an .ini file, so that NSIS can read it with a - * ReadINIStr command. */ + // Make it look like an .ini file, so that NSIS can read it with a + // ReadINIStr command. fprintf(fd, "[vimini]\n"); fprintf(fd, "dir=\"%s\"\n", vim); fclose(fd); @@ -437,9 +437,9 @@ static int num_windows; * Callback used for EnumWindows(): * Count the window if the title looks like it is for the uninstaller. */ -/*ARGSUSED*/ +//ARGSUSED static BOOL CALLBACK -window_cb(HWND hwnd, LPARAM lparam) +window_cb(HWND hwnd, LPARAM lparam UNUSED) { char title[256]; @@ -469,7 +469,7 @@ run_silent_uninstall(char *uninst_exe) if (!GetTempPath(sizeof(temp_dir), temp_dir)) return FAIL; - /* Copy the uninstaller to a temporary exe. */ + // Copy the uninstaller to a temporary exe. tick = GetTickCount(); for (i = 0; ; i++) { @@ -483,7 +483,7 @@ run_silent_uninstall(char *uninst_exe) return FAIL; } - /* Run the copied uninstaller silently. */ + // Run the copied uninstaller silently. if (strchr(temp_uninst, ' ') != NULL) sprintf(buf, "\"%s\" /S _?=%s", temp_uninst, vimrt_dir); else @@ -531,12 +531,12 @@ uninstall_check(int skip_question) if (strncmp("Vim", subkey_name_buff, 3) == 0) { - /* Open the key named Vim* */ + // Open the key named Vim* code = RegOpenKeyEx(key_handle, subkey_name_buff, 0, KEY_WOW64_64KEY | KEY_READ, &uninstall_key_handle); CHECK_REG_ERROR(code); - /* get the DisplayName out of it to show the user */ + // get the DisplayName out of it to show the user local_bufsize = sizeof(temp_string_buffer); code = RegQueryValueEx(uninstall_key_handle, "displayname", 0, &value_type, (LPBYTE)temp_string_buffer, @@ -569,13 +569,13 @@ uninstall_check(int skip_question) printf("\nDo you want to uninstall \"%s\" now?\n(y)es/(n)o) ", temp_string_buffer); fflush(stdout); - /* get the UninstallString */ + // get the UninstallString local_bufsize = sizeof(temp_string_buffer); code = RegQueryValueEx(uninstall_key_handle, "uninstallstring", 0, &value_type, (LPBYTE)temp_string_buffer, &local_bufsize); CHECK_REG_ERROR(code); - /* Remember the directory, it is used as the default for NSIS. */ + // Remember the directory, it is used as the default for NSIS. default_vim_dir = alloc(strlen(temp_string_buffer) + 1); strcpy(default_vim_dir, temp_string_buffer); remove_tail(default_vim_dir); @@ -598,25 +598,25 @@ uninstall_check(int skip_question) { case 'y': case 'Y': - /* save the number of uninstall keys so we can know if - * it changed */ + // save the number of uninstall keys so we can know if + // it changed RegQueryInfoKey(key_handle, NULL, NULL, NULL, &orig_num_keys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* Find existing .bat files before deleting them. */ + // Find existing .bat files before deleting them. find_bat_exe(TRUE); if (allow_silent) { if (run_silent_uninstall(temp_string_buffer) == FAIL) - allow_silent = 0; /* Retry with non silent. */ + allow_silent = 0; // Retry with non silent. } if (!allow_silent) { - /* Execute the uninstall program. Put it in double - * quotes if there is an embedded space. */ + // Execute the uninstall program. Put it in double + // quotes if there is an embedded space. { char buf[BUFSIZE]; @@ -627,18 +627,18 @@ uninstall_check(int skip_question) run_command(buf); } - /* Count the number of windows with a title that match - * the installer, so that we can check when it's done. - * The uninstaller copies itself, executes the copy - * and exits, thus we can't wait for the process to - * finish. */ - sleep(1); /* wait for uninstaller to start up */ + // Count the number of windows with a title that + // match the installer, so that we can check when + // it's done. The uninstaller copies itself, + // executes the copy and exits, thus we can't wait + // for the process to finish. + sleep(1); // wait for uninstaller to start up num_windows = 0; EnumWindows(window_cb, 0); if (num_windows == 0) { - /* Did not find the uninstaller, ask user to press - * Enter when done. Just in case. */ + // Did not find the uninstaller, ask user to + // press Enter when done. Just in case. printf("Press Enter when the uninstaller is finished\n"); rewind(stdin); (void)getchar(); @@ -650,7 +650,8 @@ uninstall_check(int skip_question) { printf("."); fflush(stdout); - sleep(1); /* wait for the uninstaller to finish */ + sleep(1); // wait for the uninstaller to + // finish num_windows = 0; EnumWindows(window_cb, 0); } while (num_windows > 0); @@ -658,10 +659,10 @@ uninstall_check(int skip_question) } printf("\nDone!\n"); - /* Check if an uninstall reg key was deleted. - * if it was, we want to decrement key_index. - * if we don't do this, we will skip the key - * immediately after any key that we delete. */ + // Check if an uninstall reg key was deleted. + // if it was, we want to decrement key_index. + // if we don't do this, we will skip the key + // immediately after any key that we delete. RegQueryInfoKey(key_handle, NULL, NULL, NULL, &new_num_keys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -673,11 +674,11 @@ uninstall_check(int skip_question) case 'n': case 'N': - /* Do not uninstall */ + // Do not uninstall input = 'n'; break; - default: /* just drop through and redo the loop */ + default: // just drop through and redo the loop break; } @@ -705,7 +706,7 @@ inspect_system(void) int i; int foundone; - /* This may take a little while, let the user know what we're doing. */ + // This may take a little while, let the user know what we're doing. printf("Inspecting system...\n"); /* @@ -785,7 +786,7 @@ inspect_system(void) strcpy(oldvimrc + runtimeidx, "_vimrc"); if ((fd = fopen(oldvimrc, "r")) == NULL) { - strcpy(oldvimrc + runtimeidx, "vimrc~1"); /* short version of .vimrc */ + strcpy(oldvimrc + runtimeidx, "vimrc~1"); // short version of .vimrc if ((fd = fopen(oldvimrc, "r")) == NULL) { strcpy(oldvimrc + runtimeidx, ".vimrc"); @@ -814,9 +815,8 @@ add_dummy_choice(void) ++choice_count; } -/*********************************************** - * stuff for creating the batch files. - */ +//////////////////////////////////////////////// +// stuff for creating the batch files. /* * Install the vim.bat, gvim.bat, etc. files. @@ -841,12 +841,13 @@ install_bat_choice(int idx) fprintf(fd, "@echo off\n"); fprintf(fd, "rem -- Run Vim --\n"); + fprintf(fd, VIMBAT_UNINSTKEY "\n"); fprintf(fd, "\n"); fprintf(fd, "setlocal\n"); - /* Don't use double quotes for the "set" argument, also when it - * contains a space. The quotes would be included in the value - * for MSDOS and NT. + /* + * Don't use double quotes for the "set" argument, also when it + * contains a space. The quotes would be included in the value. * The order of preference is: * 1. $VIMRUNTIME/vim.exe (user preference) * 2. $VIM/vim81/vim.exe (hard coded version) @@ -858,93 +859,53 @@ install_bat_choice(int idx) fprintf(fd, "if exist \"%%VIMRUNTIME%%\\%s\" set VIM_EXE_DIR=%%VIMRUNTIME%%\n", exename); fprintf(fd, "\n"); - /* Give an error message when the executable could not be found. */ - fprintf(fd, "if exist \"%%VIM_EXE_DIR%%\\%s\" goto havevim\n", - exename); - fprintf(fd, "echo \"%%VIM_EXE_DIR%%\\%s\" not found\n", exename); - fprintf(fd, "goto eof\n"); + // Give an error message when the executable could not be found. + fprintf(fd, "if not exist \"%%VIM_EXE_DIR%%\\%s\" (\n", exename); + fprintf(fd, " echo \"%%VIM_EXE_DIR%%\\%s\" not found\n", exename); + fprintf(fd, " goto :eof\n"); + fprintf(fd, ")\n"); fprintf(fd, "\n"); - fprintf(fd, ":havevim\n"); - fprintf(fd, "rem collect the arguments in VIMARGS for Win95\n"); - fprintf(fd, "set VIMARGS=\n"); - if (*exename == 'g') - fprintf(fd, "set VIMNOFORK=\n"); - fprintf(fd, ":loopstart\n"); - fprintf(fd, "if .%%1==. goto loopend\n"); if (*exename == 'g') { - fprintf(fd, "if NOT .%%1==.--nofork goto noforklongarg\n"); - fprintf(fd, "set VIMNOFORK=1\n"); - fprintf(fd, ":noforklongarg\n"); - fprintf(fd, "if NOT .%%1==.-f goto noforkarg\n"); - fprintf(fd, "set VIMNOFORK=1\n"); - fprintf(fd, ":noforkarg\n"); + fprintf(fd, "rem check --nofork argument\n"); + fprintf(fd, "set VIMNOFORK=\n"); + fprintf(fd, ":loopstart\n"); + fprintf(fd, "if .%%1==. goto loopend\n"); + fprintf(fd, "if .%%1==.--nofork (\n"); + fprintf(fd, " set VIMNOFORK=1\n"); + fprintf(fd, ") else if .%%1==.-f (\n"); + fprintf(fd, " set VIMNOFORK=1\n"); + fprintf(fd, ")\n"); + fprintf(fd, "shift\n"); + fprintf(fd, "goto loopstart\n"); + fprintf(fd, ":loopend\n"); + fprintf(fd, "\n"); } - fprintf(fd, "set VIMARGS=%%VIMARGS%% %%1\n"); - fprintf(fd, "shift\n"); - fprintf(fd, "goto loopstart\n"); - fprintf(fd, ":loopend\n"); - fprintf(fd, "\n"); - - fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n"); - fprintf(fd, "\n"); - /* For gvim.exe use "start" to avoid that the console window stays - * open. */ if (*exename == 'g') { - fprintf(fd, "if .%%VIMNOFORK%%==.1 goto nofork\n"); - fprintf(fd, "start "); - } - - /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ - fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n", + // For gvim.exe use "start /b" to avoid that the console window + // stays open. + fprintf(fd, "if .%%VIMNOFORK%%==.1 (\n"); + fprintf(fd, " start \"dummy\" /b /wait "); + // Always use quotes, $VIM or $VIMRUNTIME might have a space. + fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg); - fprintf(fd, "goto eof\n"); - fprintf(fd, "\n"); - - if (*exename == 'g') - { - fprintf(fd, ":nofork\n"); - fprintf(fd, "start /w "); - /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ - fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n", + fprintf(fd, ") else (\n"); + fprintf(fd, " start \"dummy\" /b "); + // Always use quotes, $VIM or $VIMRUNTIME might have a space. + fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg); - fprintf(fd, "goto eof\n"); - fprintf(fd, "\n"); + fprintf(fd, ")\n"); } - - fprintf(fd, ":ntaction\n"); - fprintf(fd, "rem for WinNT we can use %%*\n"); - - /* For gvim.exe use "start /b" to avoid that the console window - * stays open. */ - if (*exename == 'g') - { - fprintf(fd, "if .%%VIMNOFORK%%==.1 goto noforknt\n"); - fprintf(fd, "start \"dummy\" /b "); - } - - /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ - fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg); - fprintf(fd, "goto eof\n"); - fprintf(fd, "\n"); - - if (*exename == 'g') + else { - fprintf(fd, ":noforknt\n"); - fprintf(fd, "start \"dummy\" /b /wait "); - /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */ + // Always use quotes, $VIM or $VIMRUNTIME might have a space. fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg); } - fprintf(fd, "\n:eof\n"); - fprintf(fd, "set VIMARGS=\n"); - if (*exename == 'g') - fprintf(fd, "set VIMNOFORK=\n"); - fclose(fd); printf("%s has been %s\n", batpath, oldname == NULL ? "created" : "overwritten"); @@ -1064,15 +1025,15 @@ change_bat_choice(int idx) if (n == count) { - /* Selected last item, don't create bat file. */ + // Selected last item, don't create bat file. *batpath = NUL; if (choices[idx].arg != 0) alloc_text(idx, " Do NOT create %s", name); } else { - /* Selected one of the paths. For the first item only keep the path, - * for the others append the batch file name. */ + // Selected one of the paths. For the first item only keep the path, + // for the others append the batch file name. strcpy(batpath, names[n]); add_pathsep(batpath); if (choices[idx].arg != 0) @@ -1092,7 +1053,7 @@ change_main_bat_choice(int idx) { int i; - /* let the user select a default directory or NONE */ + // let the user select a default directory or NONE change_bat_choice(idx); if (targets[0].batpath[0] != NUL) @@ -1100,11 +1061,11 @@ change_main_bat_choice(int idx) else choices[idx].text = bat_text_no; - /* update the individual batch file selections */ + // update the individual batch file selections for (i = 1; i < TARGET_COUNT; ++i) { - /* Only make it active when the first item has a path and the vim.exe - * or gvim.exe exists (there is a changefunc then). */ + // Only make it active when the first item has a path and the vim.exe + // or gvim.exe exists (there is a changefunc then). if (targets[0].batpath[0] != NUL && choices[idx + i].changefunc != NULL) { @@ -1135,10 +1096,10 @@ init_bat_choice(int target) choices[choice_count].arg = target; choices[choice_count].installfunc = install_bat_choice; choices[choice_count].active = 1; - choices[choice_count].text = NULL; /* will be set below */ + choices[choice_count].text = NULL; // will be set below if (oldbat != NULL) { - /* A [g]vim.bat exists: Only choice is to overwrite it or not. */ + // A [g]vim.bat exists: Only choice is to overwrite it or not. choices[choice_count].changefunc = toggle_bat_choice; *batpath = NUL; toggle_bat_choice(choice_count); @@ -1146,19 +1107,19 @@ init_bat_choice(int target) else { if (default_bat_dir != NULL) - /* Prefer using the same path as an existing .bat file. */ + // Prefer using the same path as an existing .bat file. strcpy(batpath, default_bat_dir); else { - /* No [g]vim.bat exists: Write it to a directory in $PATH. Use - * $WINDIR by default, if it's empty the first item in $PATH. */ + // No [g]vim.bat exists: Write it to a directory in $PATH. Use + // $WINDIR by default, if it's empty the first item in $PATH. p = getenv("WINDIR"); if (p != NULL && *p != NUL) strcpy(batpath, p); else { p = getenv("PATH"); - if (p == NULL || *p == NUL) /* "cannot happen" */ + if (p == NULL || *p == NUL) // "cannot happen" strcpy(batpath, "C:/Windows"); else { @@ -1186,8 +1147,8 @@ init_bat_choices(void) { int i; - /* The first item is used to switch installing batch files on/off and - * setting the default path. */ + // The first item is used to switch installing batch files on/off and + // setting the default path. choices[choice_count].text = bat_text_yes; choices[choice_count].changefunc = change_main_bat_choice; choices[choice_count].installfunc = NULL; @@ -1195,8 +1156,8 @@ init_bat_choices(void) choices[choice_count].arg = 0; ++choice_count; - /* Add items for each batch file target. Only used when not disabled by - * the first item. When a .exe exists, don't offer to create a .bat. */ + // Add items for each batch file target. Only used when not disabled by + // the first item. When a .exe exists, don't offer to create a .bat. for (i = 1; i < TARGET_COUNT; ++i) if (targets[i].oldexe == NULL && (targets[i].exenamearg[0] == 'g' ? has_gvim : has_vim)) @@ -1209,13 +1170,13 @@ init_bat_choices(void) * Install the vimrc file. */ static void -install_vimrc(int idx) +install_vimrc(int idx UNUSED) { FILE *fd, *tfd; char *fname; - /* If an old vimrc file exists, overwrite it. - * Otherwise create a new one. */ + // If an old vimrc file exists, overwrite it. + // Otherwise create a new one. if (*oldvimrc != NUL) fname = oldvimrc; else @@ -1275,7 +1236,7 @@ install_vimrc(int idx) } if ((tfd = fopen("diff.exe", "r")) != NULL) { - /* Use the diff.exe that comes with the self-extracting gvim.exe. */ + // Use the diff.exe that comes with the self-extracting gvim.exe. fclose(tfd); fprintf(fd, "\n"); fprintf(fd, "\" Use the internal diff if available.\n"); @@ -1287,8 +1248,8 @@ install_vimrc(int idx) fprintf(fd, " let opt = '-a --binary '\n"); fprintf(fd, " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif\n"); fprintf(fd, " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif\n"); - /* Use quotes only when needed, they may cause trouble. - * Always escape "!". */ + // Use quotes only when needed, they may cause trouble. + // Always escape "!". fprintf(fd, " let arg1 = v:fname_in\n"); fprintf(fd, " if arg1 =~ ' ' | let arg1 = '\"' . arg1 . '\"' | endif\n"); fprintf(fd, " let arg1 = substitute(arg1, '!', '\\!', 'g')\n"); @@ -1299,13 +1260,13 @@ install_vimrc(int idx) fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n"); fprintf(fd, " let arg3 = substitute(arg3, '!', '\\!', 'g')\n"); - /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put - * quotes around the diff command and rely on the default value of - * shellxquote to solve the quoting problem for the whole command. - * - * Otherwise put a double quote just before the space and at the - * end of the command. Putting quotes around the whole thing - * doesn't work on Win 95/98/ME. This is mostly guessed! */ + // If the path has a space: When using cmd.exe (Win NT/2000/XP) put + // quotes around the diff command and rely on the default value of + // shellxquote to solve the quoting problem for the whole command. + // + // Otherwise put a double quote just before the space and at the + // end of the command. Putting quotes around the whole thing + // doesn't work on Win 95/98/ME. This is mostly guessed! fprintf(fd, " if $VIMRUNTIME =~ ' '\n"); fprintf(fd, " if &sh =~ '\\lpVtbl->QueryInterface(shelllink_ptr, &IID_IPersistFile, (void **) &persistfile_ptr); @@ -1827,12 +1789,11 @@ create_shortcut( { wchar_t wsz[BUFSIZE]; - /* translate the (possibly) multibyte shortcut filename to windows - * Unicode so it can be used as a file name. - */ + // translate the (possibly) multibyte shortcut filename to windows + // Unicode so it can be used as a file name. MultiByteToWideChar(CP_ACP, 0, shortcut_name, -1, wsz, sizeof(wsz)/sizeof(wsz[0])); - /* set the attributes */ + // set the attributes shelllink_ptr->lpVtbl->SetPath(shelllink_ptr, shortcut_target); shelllink_ptr->lpVtbl->SetWorkingDirectory(shelllink_ptr, workingdir); @@ -1840,7 +1801,7 @@ create_shortcut( iconfile_path, iconindex); shelllink_ptr->lpVtbl->SetArguments(shelllink_ptr, shortcut_args); - /* save the shortcut to a file and return the PersistFile object*/ + // save the shortcut to a file and return the PersistFile object persistfile_ptr->lpVtbl->Save(persistfile_ptr, wsz, 1); persistfile_ptr->lpVtbl->Release(persistfile_ptr); } @@ -1850,7 +1811,7 @@ create_shortcut( return FAIL; } - /* Return the ShellLink object */ + // Return the ShellLink object shelllink_ptr->lpVtbl->Release(shelllink_ptr); } else @@ -1882,11 +1843,11 @@ build_link_name( return FAIL; } - /* Make sure the directory exists (create Start Menu\Programs\Vim). - * Ignore errors if it already exists. */ + // Make sure the directory exists (create Start Menu\Programs\Vim). + // Ignore errors if it already exists. vim_mkdir(shell_folder_path, 0755); - /* build the path to the shortcut and the path to gvim.exe */ + // build the path to the shortcut and the path to gvim.exe sprintf(link_path, "%s\\%s.lnk", shell_folder_path, link_name); return OK; @@ -1894,8 +1855,8 @@ build_link_name( static int build_shortcut( - const char *name, /* Name of the shortcut */ - const char *exename, /* Name of the executable (e.g., vim.exe) */ + const char *name, // Name of the shortcut + const char *exename, // Name of the executable (e.g., vim.exe) const char *args, const char *shell_folder, const char *workingdir) @@ -1913,7 +1874,7 @@ build_shortcut( return FAIL; } - /* Create the shortcut: */ + // Create the shortcut: return create_shortcut(link_name, executable_path, 0, executable_path, args, workingdir); } @@ -1930,7 +1891,7 @@ build_shortcut( * Create shortcut(s) in the Start Menu\Programs\Vim folder. */ static void -install_start_menu(int idx) +install_start_menu(int idx UNUSED) { need_uninstall_entry = 1; printf("Creating start menu\n"); @@ -1965,8 +1926,8 @@ install_start_menu(int idx) interactive ? "uninstall.exe" : "uninstall-gui.exe", "", VIM_STARTMENU, installdir) == FAIL) return; - /* For Windows NT the working dir of the vimtutor.bat must be right, - * otherwise gvim.exe won't be found and using gvimbat doesn't work. */ + // For Windows NT the working dir of the vimtutor.bat must be right, + // otherwise gvim.exe won't be found and using gvimbat doesn't work. if (build_shortcut("Vim tutor", "vimtutor.bat", "", VIM_STARTMENU, installdir) == FAIL) return; @@ -1976,7 +1937,7 @@ install_start_menu(int idx) { char shell_folder_path[BUFSIZE]; - /* Creating the URL shortcut works a bit differently... */ + // Creating the URL shortcut works a bit differently... if (get_shell_folder_path(shell_folder_path, VIM_STARTMENU) == FAIL) { printf("Finding the path of the Start menu failed\n"); @@ -2020,7 +1981,7 @@ toggle_startmenu_choice(int idx) void install_shortcut_gvim(int idx) { - /* Create shortcut(s) on the desktop */ + // Create shortcut(s) on the desktop if (choices[idx].arg) { (void)build_shortcut(icon_names[0], "gvim.exe", @@ -2077,11 +2038,11 @@ toggle_shortcut_choice(int idx) static void init_startmenu_choice(void) { - /* Start menu */ + // Start menu choices[choice_count].changefunc = toggle_startmenu_choice; choices[choice_count].installfunc = NULL; choices[choice_count].active = 1; - toggle_startmenu_choice(choice_count); /* set the text */ + toggle_startmenu_choice(choice_count); // set the text ++choice_count; } @@ -2091,7 +2052,7 @@ init_startmenu_choice(void) static void init_shortcut_choices(void) { - /* Shortcut to gvim */ + // Shortcut to gvim choices[choice_count].text = NULL; choices[choice_count].arg = 0; choices[choice_count].active = has_gvim; @@ -2100,7 +2061,7 @@ init_shortcut_choices(void) toggle_shortcut_choice(choice_count); ++choice_count; - /* Shortcut to evim */ + // Shortcut to evim choices[choice_count].text = NULL; choices[choice_count].arg = 0; choices[choice_count].active = has_gvim; @@ -2109,7 +2070,7 @@ init_shortcut_choices(void) toggle_shortcut_choice(choice_count); ++choice_count; - /* Shortcut to gview */ + // Shortcut to gview choices[choice_count].text = NULL; choices[choice_count].arg = 0; choices[choice_count].active = has_gvim; @@ -2145,7 +2106,7 @@ dir_remove_last(const char *path, char to[MAX_PATH]) long last_char_to_copy; long path_length = strlen(path); - /* skip the last character just in case it is a '\\' */ + // skip the last character just in case it is a '\\' last_char_to_copy = path_length - 2; c = path[last_char_to_copy]; @@ -2264,7 +2225,7 @@ change_directories_choice(int idx) { int choice_count = TABLE_SIZE(vimfiles_dir_choices); - /* Don't offer the $HOME choice if $HOME isn't set. */ + // Don't offer the $HOME choice if $HOME isn't set. if (homedir == NULL) --choice_count; choices[idx].arg = get_choice(vimfiles_dir_choices, choice_count); @@ -2274,7 +2235,7 @@ change_directories_choice(int idx) /* * Create the plugin directories... */ -/*ARGSUSED*/ +//ARGSUSED static void install_vimfilesdir(int idx) { @@ -2285,18 +2246,18 @@ install_vimfilesdir(int idx) char vimfiles_path[MAX_PATH + 9]; char tmp_dirname[BUFSIZE]; - /* switch on the location that the user wants the plugin directories - * built in */ + // switch on the location that the user wants the plugin directories + // built in switch (vimfiles_dir_choice) { case vimfiles_dir_vim: { - /* Go to the %VIM% directory - check env first, then go one dir - * below installdir if there is no %VIM% environment variable. - * The accuracy of $VIM is checked in inspect_system(), so we - * can be sure it is ok to use here. */ + // Go to the %VIM% directory - check env first, then go one dir + // below installdir if there is no %VIM% environment variable. + // The accuracy of $VIM is checked in inspect_system(), so we + // can be sure it is ok to use here. p = getenv("VIM"); - if (p == NULL) /* No $VIM in path */ + if (p == NULL) // No $VIM in path dir_remove_last(installdir, vimdir_path); else strcpy(vimdir_path, p); @@ -2321,8 +2282,8 @@ install_vimfilesdir(int idx) } } - /* Now, just create the directory. If it already exists, it will fail - * silently. */ + // Now, just create the directory. If it already exists, it will fail + // silently. sprintf(vimfiles_path, "%s\\vimfiles", vimdir_path); vim_mkdir(vimfiles_path, 0755); @@ -2386,25 +2347,25 @@ init_directories_choice(void) static void setup_choices(void) { - /* install the batch files */ + // install the batch files init_bat_choices(); - /* (over) write _vimrc file */ + // (over) write _vimrc file init_vimrc_choices(); - /* Whether to add Vim to the popup menu */ + // Whether to add Vim to the popup menu init_popup_choice(); - /* Whether to add Vim to the "Open With..." menu */ + // Whether to add Vim to the "Open With..." menu init_openwith_choice(); - /* Whether to add Vim to the Start Menu. */ + // Whether to add Vim to the Start Menu. init_startmenu_choice(); - /* Whether to add shortcuts to the Desktop. */ + // Whether to add shortcuts to the Desktop. init_shortcut_choices(); - /* Whether to create the runtime directories. */ + // Whether to create the runtime directories. init_directories_choice(); } @@ -2473,9 +2434,8 @@ command_line_setup_choices(int argc, char **argv) } else if (strcmp(argv[i], "-create-vimrc") == 0) { - /* Setup default vimrc choices. If there is already a _vimrc file, - * it will NOT be overwritten. - */ + // Setup default vimrc choices. If there is already a _vimrc file, + // it will NOT be overwritten. init_vimrc_choices(); } else if (strcmp(argv[i], "-vimrc-remap") == 0) @@ -2535,7 +2495,7 @@ command_line_setup_choices(int argc, char **argv) int vimfiles_dir_choice = (int)vimfiles_dir_none; init_directories_choice(); - if (argv[i + 1][0] != '-') + if (i + 1 < argc && argv[i + 1][0] != '-') { i++; if (strcmp(argv[i], "vim") == 0) @@ -2554,15 +2514,15 @@ command_line_setup_choices(int argc, char **argv) print_cmd_line_help(); } } - else /* No choice specified, default to vim directory */ + else // No choice specified, default to vim directory vimfiles_dir_choice = (int)vimfiles_dir_vim; choices[choice_count - 1].arg = vimfiles_dir_choice; } else if (strcmp(argv[i], "-register-OLE") == 0) { - /* This is always done when gvim is found */ + // This is always done when gvim is found } - else /* Unknown switch */ + else // Unknown switch { printf("Got unknown argument argv[%d] = %s\n", i, argv[i]); print_cmd_line_help(); @@ -2707,19 +2667,19 @@ install(void) { int i; - /* Install the selected choices. */ + // Install the selected choices. for (i = 0; i < choice_count; ++i) if (choices[i].installfunc != NULL && choices[i].active) (choices[i].installfunc)(i); - /* Add some entries to the registry, if needed. */ + // Add some entries to the registry, if needed. if (install_popup || install_openwith || (need_uninstall_entry && interactive) || !interactive) install_registry(); - /* Register gvim with OLE. */ + // Register gvim with OLE. if (has_gvim) install_OLE_register(); } @@ -2754,21 +2714,21 @@ main(int argc, char **argv) else interactive = 1; - /* Initialize this program. */ + // Initialize this program. do_inits(argv); init_homedir(); if (argc > 1 && strcmp(argv[1], "-uninstall-check") == 0) { - /* Only check for already installed Vims. Used by NSIS installer. */ + // Only check for already installed Vims. Used by NSIS installer. i = uninstall_check(1); - /* Find the value of $VIM, because NSIS isn't able to do this by - * itself. */ + // Find the value of $VIM, because NSIS isn't able to do this by + // itself. get_vim_env(); - /* When nothing found exit quietly. If something found wait for - * a little while, so that the user can read the messages. */ + // When nothing found exit quietly. If something found wait for + // a little while, so that the user can read the messages. if (i && _isatty(1)) sleep(3); exit(0); @@ -2777,22 +2737,22 @@ main(int argc, char **argv) printf("This program sets up the installation of Vim " VIM_VERSION_MEDIUM "\n\n"); - /* Check if the user unpacked the archives properly. */ + // Check if the user unpacked the archives properly. check_unpack(); - /* Check for already installed Vims. */ + // Check for already installed Vims. if (interactive) uninstall_check(0); - /* Find out information about the system. */ + // Find out information about the system. inspect_system(); if (interactive) { - /* Setup all the choices. */ + // Setup all the choices. setup_choices(); - /* Let the user change choices and finally install (or quit). */ + // Let the user change choices and finally install (or quit). for (;;) { request_choice(); @@ -2801,7 +2761,7 @@ main(int argc, char **argv) { if (isdigit(buf[0])) { - /* Change a choice. */ + // Change a choice. i = atoi(buf); if (i > 0 && i <= choice_count && choices[i - 1].active) (choices[i - 1].changefunc)(i - 1); @@ -2810,19 +2770,19 @@ main(int argc, char **argv) } else if (buf[0] == 'h' || buf[0] == 'H') { - /* Help */ + // Help show_help(); } else if (buf[0] == 'd' || buf[0] == 'D') { - /* Install! */ + // Install! install(); printf("\nThat finishes the installation. Happy Vimming!\n"); break; } else if (buf[0] == 'q' || buf[0] == 'Q') { - /* Quit */ + // Quit printf("\nExiting without anything done\n"); break; } @@ -2841,8 +2801,8 @@ main(int argc, char **argv) command_line_setup_choices(argc, argv); install(); - /* Avoid that the user has to hit Enter, just wait a little bit to - * allow reading the messages. */ + // Avoid that the user has to hit Enter, just wait a little bit to + // allow reading the messages. sleep(2); } diff --git a/src/dosinst.h b/src/dosinst.h index a83bb0839ff19..f1d3dc6eb5991 100644 --- a/src/dosinst.h +++ b/src/dosinst.h @@ -10,12 +10,6 @@ * dosinst.h: Common code for dosinst.c and uninstall.c */ -/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ -#if _MSC_VER >= 1400 -# define _CRT_SECURE_NO_DEPRECATE -# define _CRT_NONSTDC_NO_DEPRECATE -#endif - #include #include #include @@ -23,7 +17,7 @@ #include #ifndef UNIX_LINT -# include "vimio.h" +# include # include # include @@ -33,7 +27,7 @@ #endif #ifdef UNIX_LINT -/* Running lint on Unix: Some things are missing. */ +// Running lint on Unix: Some things are missing. char *searchpath(char *name); #endif @@ -52,10 +46,10 @@ char *searchpath(char *name); #define sleep(n) Sleep((n) * 1000) -/* ---------------------------------------- */ +// ---------------------------------------- -#define BUFSIZE (MAX_PATH*2) /* long enough to hold a file name path */ +#define BUFSIZE (MAX_PATH*2) // long enough to hold a file name path #define NUL 0 #define FAIL 0 @@ -79,9 +73,15 @@ char *searchpath(char *name); # define KEY_WOW64_32KEY 0x0200 # endif +#ifdef __MINGW32__ +# define UNUSED __attribute__((unused)) +#else +# define UNUSED +#endif + #define VIM_STARTMENU "Programs\\Vim " VIM_VERSION_SHORT -int interactive; /* non-zero when running interactively */ +int interactive; // non-zero when running interactively /* * Call malloc() and exit when out of memory. @@ -116,7 +116,7 @@ myexit(int n) { if (!interactive) { - /* Present a prompt, otherwise error messages can't be read. */ + // Present a prompt, otherwise error messages can't be read. printf("Press Enter to continue\n"); rewind(stdin); (void)getchar(); @@ -152,8 +152,8 @@ searchpath(char *name) static char widename[2 * BUFSIZE]; static char location[2 * BUFSIZE + 2]; - /* There appears to be a bug in FindExecutableA() on Windows NT. - * Use FindExecutableW() instead... */ + // There appears to be a bug in FindExecutableA() on Windows NT. + // Use FindExecutableW() instead... MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1, (LPWSTR)widename, BUFSIZE); if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"", @@ -206,8 +206,8 @@ get_shell_folder_path( * The resulting executable worked on Windows 95, Millennium Edition, and * 2000 Professional. But it was changed after testing... */ - LPITEMIDLIST pidl = 0; /* Pointer to an Item ID list allocated below */ - LPMALLOC pMalloc; /* Pointer to an IMalloc interface */ + LPITEMIDLIST pidl = 0; // Pointer to an Item ID list allocated below + LPMALLOC pMalloc; // Pointer to an IMalloc interface int csidl; int alt_csidl = -1; static int desktop_csidl = -1; @@ -234,7 +234,7 @@ get_shell_folder_path( return FAIL; } - /* Did this stuff before, use the same ID again. */ + // Did this stuff before, use the same ID again. if (*pcsidl >= 0) { csidl = *pcsidl; @@ -242,7 +242,7 @@ get_shell_folder_path( } retry: - /* Initialize pointer to IMalloc interface */ + // Initialize pointer to IMalloc interface if (NOERROR != SHGetMalloc(&pMalloc)) { printf("\nERROR getting interface for shell_folder_name: \"%s\"\n\n", @@ -250,7 +250,7 @@ get_shell_folder_path( return FAIL; } - /* Get an ITEMIDLIST corresponding to the folder code */ + // Get an ITEMIDLIST corresponding to the folder code if (NOERROR != SHGetSpecialFolderLocation(0, csidl, &pidl)) { if (alt_csidl < 0 || NOERROR != SHGetSpecialFolderLocation(0, @@ -264,20 +264,20 @@ get_shell_folder_path( alt_csidl = -1; } - /* Translate that ITEMIDLIST to a string */ + // Translate that ITEMIDLIST to a string r = SHGetPathFromIDList(pidl, shell_folder_path); - /* Free the data associated with pidl */ + // Free the data associated with pidl pMalloc->lpVtbl->Free(pMalloc, pidl); - /* Release the IMalloc interface */ + // Release the IMalloc interface pMalloc->lpVtbl->Release(pMalloc); if (!r) { if (alt_csidl >= 0) { - /* We probably get here for Windows 95: the "all users" - * desktop/start menu entry doesn't exist. */ + // We probably get here for Windows 95: the "all users" + // desktop/start menu entry doesn't exist. csidl = alt_csidl; alt_csidl = -1; goto retry; @@ -287,9 +287,9 @@ get_shell_folder_path( return FAIL; } - /* If there is an alternative: verify we can write in this directory. - * This should cause a retry when the "all users" directory exists but we - * are a normal user and can't write there. */ + // If there is an alternative: verify we can write in this directory. + // This should cause a retry when the "all users" directory exists but we + // are a normal user and can't write there. if (alt_csidl >= 0) { char tbuf[BUFSIZE]; @@ -329,37 +329,40 @@ get_shell_folder_path( struct { - char *name; /* Vim exe name (without .exe) */ - char *batname; /* batch file name */ - char *lnkname; /* shortcut file name */ - char *exename; /* exe file name */ - char *exenamearg; /* exe file name when using exearg */ - char *exearg; /* argument for vim.exe or gvim.exe */ - char *oldbat; /* path to existing xxx.bat or NULL */ - char *oldexe; /* path to existing xxx.exe or NULL */ - char batpath[BUFSIZE]; /* path of batch file to create; not - created when it's empty */ + char *name; // Vim exe name (without .exe) + char *batname; // batch file name + char *lnkname; // shortcut file name + char *exename; // exe file name + char *exenamearg; // exe file name when using exearg + char *exearg; // argument for vim.exe or gvim.exe + char *oldbat; // path to existing xxx.bat or NULL + char *oldexe; // path to existing xxx.exe or NULL + char batpath[BUFSIZE]; // path of batch file to create; not + // created when it's empty } targets[TARGET_COUNT] = { - {"all", "batch files"}, + {"all", "batch files", NULL, NULL, NULL, NULL, NULL, NULL, ""}, {"vim", "vim.bat", "Vim.lnk", - "vim.exe", "vim.exe", ""}, + "vim.exe", "vim.exe", "", NULL, NULL, ""}, {"gvim", "gvim.bat", "gVim.lnk", - "gvim.exe", "gvim.exe", ""}, + "gvim.exe", "gvim.exe", "", NULL, NULL, ""}, {"evim", "evim.bat", "gVim Easy.lnk", - "evim.exe", "gvim.exe", "-y"}, + "evim.exe", "gvim.exe", "-y", NULL, NULL, ""}, {"view", "view.bat", "Vim Read-only.lnk", - "view.exe", "vim.exe", "-R"}, + "view.exe", "vim.exe", "-R", NULL, NULL, ""}, {"gview", "gview.bat", "gVim Read-only.lnk", - "gview.exe", "gvim.exe", "-R"}, + "gview.exe", "gvim.exe", "-R", NULL, NULL, ""}, {"vimdiff", "vimdiff.bat", "Vim Diff.lnk", - "vimdiff.exe","vim.exe", "-d"}, + "vimdiff.exe","vim.exe", "-d", NULL, NULL, ""}, {"gvimdiff","gvimdiff.bat", "gVim Diff.lnk", - "gvimdiff.exe","gvim.exe", "-d"}, + "gvimdiff.exe","gvim.exe", "-d", NULL, NULL, ""}, {"vimtutor","vimtutor.bat", "Vim tutor.lnk", - "vimtutor.bat", "vimtutor.bat", ""}, + "vimtutor.bat", "vimtutor.bat", "", NULL, NULL, ""}, }; +/* Uninstall key for vim.bat, etc. */ +#define VIMBAT_UNINSTKEY "rem # uninstall key: " VIM_VERSION_NODOT " #" + #define ICON_COUNT 3 char *(icon_names[ICON_COUNT]) = {"gVim " VIM_VERSION_SHORT, @@ -382,17 +385,16 @@ run_command(char *cmd) char cmd_buf[BUFSIZE * 2 + 35]; char *p; - /* On WinNT, 'start' is a shell built-in for cmd.exe rather than an - * executable (start.exe) like in Win9x. */ + // On WinNT, 'start' is a shell built-in for cmd.exe rather than an + // executable (start.exe) like in Win9x. cmd_path = searchpath_save("cmd.exe"); if (cmd_path != NULL) { - /* There is a cmd.exe, so this might be Windows NT. If it is, - * we need to call cmd.exe explicitly. If it is a later OS, - * calling cmd.exe won't hurt if it is present. - * Also, "start" on NT expects a window title argument. - */ - /* Replace the slashes with backslashes. */ + // There is a cmd.exe, so this might be Windows NT. If it is, + // we need to call cmd.exe explicitly. If it is a later OS, + // calling cmd.exe won't hurt if it is present. + // Also, "start" on NT expects a window title argument. + // Replace the slashes with backslashes. while ((p = strchr(cmd_path, '/')) != NULL) *p = '\\'; sprintf(cmd_buf, "%s /c start \"vimcmd\" /wait %s", cmd_path, cmd); @@ -400,7 +402,7 @@ run_command(char *cmd) } else { - /* No cmd.exe, just make the call and let the system handle it. */ + // No cmd.exe, just make the call and let the system handle it. sprintf(cmd_buf, "start /w %s", cmd); } system(cmd_buf); @@ -422,7 +424,6 @@ add_pathsep(char *name) /* * The normal chdir() does not change the default drive. This one does. */ -/*ARGSUSED*/ int change_drive(int drive) { @@ -438,27 +439,27 @@ change_drive(int drive) int mch_chdir(char *path) { - if (path[0] == NUL) /* just checking... */ + if (path[0] == NUL) // just checking... return 0; - if (path[1] == ':') /* has a drive name */ + if (path[1] == ':') // has a drive name { if (change_drive(mytoupper(path[0]) - 'A' + 1)) - return -1; /* invalid drive name */ + return -1; // invalid drive name path += 2; } - if (*path == NUL) /* drive name only */ + if (*path == NUL) // drive name only return 0; - return chdir(path); /* let the normal chdir() do the rest */ + return chdir(path); // let the normal chdir() do the rest } /* * Expand the executable name into a full path name. */ static char * -my_fullpath(char *buf, char *fname, int len) +my_fullpath(char *buf, char *fname UNUSED, int len) { - /* Only GetModuleFileName() will get the long file name path. - * GetFullPathName() may still use the short (FAT) name. */ + // Only GetModuleFileName() will get the long file name path. + // GetFullPathName() may still use the short (FAT) name. DWORD len_read = GetModuleFileName(NULL, buf, (size_t)len); return (len_read > 0 && len_read < (DWORD)len) ? buf : NULL; @@ -482,11 +483,11 @@ remove_tail(char *path) } -char installdir[MAX_PATH-9]; /* top of the installation dir, where the - install.exe is located, E.g.: - "c:\vim\vim60" */ -int runtimeidx; /* index in installdir[] where "vim60" starts */ -char *sysdrive; /* system drive or "c:\" */ +char installdir[MAX_PATH-9]; // top of the installation dir, where the + // install.exe is located, E.g.: + // "c:\vim\vim60" +int runtimeidx; // index in installdir[] where "vim60" starts +char *sysdrive; // system drive or "c:\" /* * Setup for using this program. @@ -495,20 +496,20 @@ char *sysdrive; /* system drive or "c:\" */ static void do_inits(char **argv) { - /* Find out the full path of our executable. */ + // Find out the full path of our executable. if (my_fullpath(installdir, argv[0], sizeof(installdir)) == NULL) { printf("ERROR: Cannot get name of executable\n"); myexit(1); } - /* remove the tail, the executable name "install.exe" */ + // remove the tail, the executable name "install.exe" remove_tail(installdir); - /* change to the installdir */ + // change to the installdir mch_chdir(installdir); - /* Find the system drive. Only used for searching the Vim executable, not - * very important. */ + // Find the system drive. Only used for searching the Vim executable, not + // very important. sysdrive = getenv("SYSTEMDRIVE"); if (sysdrive == NULL || *sysdrive == NUL) sysdrive = "C:\\"; diff --git a/src/drawline.c b/src/drawline.c index c678a01d92fd0..f6191ad01f4fc 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -86,6 +86,17 @@ margin_columns_win(win_T *wp, int *left_col, int *right_col) #endif #ifdef FEAT_SIGNS +/* + * Return TRUE if CursorLineSign highlight is to be used. + */ + static int +use_cursor_line_sign(win_T *wp, linenr_T lnum) +{ + return wp->w_p_cul + && lnum == wp->w_cursor.lnum + && (wp->w_p_culopt_flags & CULOPT_NBR); +} + /* * Get information needed to display the sign in line 'lnum' in window 'wp'. * If 'nrcol' is TRUE, the sign is going to be displayed in the number column. @@ -95,7 +106,7 @@ margin_columns_win(win_T *wp, int *left_col, int *right_col) get_sign_display_info( int nrcol, win_T *wp, - linenr_T lnum UNUSED, + linenr_T lnum, sign_attrs_T *sattr, int wcr_attr, int row, @@ -121,7 +132,10 @@ get_sign_display_info( *n_extrap = number_width(wp) + 1; else { - *char_attrp = hl_combine_attr(wcr_attr, HL_ATTR(HLF_SC)); + if (use_cursor_line_sign(wp, lnum)) + *char_attrp = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLS)); + else + *char_attrp = hl_combine_attr(wcr_attr, HL_ATTR(HLF_SC)); *n_extrap = 2; } @@ -186,13 +200,17 @@ get_sign_display_info( *c_finalp = NUL; *n_extrap = (int)STRLEN(*pp_extra); } - *char_attrp = sattr->sat_texthl; + + if (use_cursor_line_sign(wp, lnum) && sattr->sat_culhl > 0) + *char_attrp = sattr->sat_culhl; + else + *char_attrp = sattr->sat_texthl; } } } #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP static __thread textprop_T *current_text_props = NULL; static __thread buf_T *current_buf = NULL; @@ -266,12 +284,16 @@ win_line( int c_extra = NUL; // extra chars, all the same int c_final = NUL; // final char, mandatory if set int extra_attr = 0; // attributes when n_extra != 0 +#if defined(FEAT_LINEBREAK) && defined(FEAT_PROP_POPUP) + int in_linebreak = FALSE; // n_extra set for showing linebreak +#endif #if !TARGET_OS_IPHONE static char_u *at_end_str = (char_u *)""; // used for p_extra when - // displaying lcs_eol at end-of-line -#endif - int lcs_eol_one = lcs_eol; // lcs_eol until it's been used - int lcs_prec_todo = lcs_prec; // lcs_prec until it's been used + // displaying eol at end-of-line +#endif + int lcs_eol_one = wp->w_lcs_chars.eol; // eol until it's been used + int lcs_prec_todo = wp->w_lcs_chars.prec; + // prec until it's been used // saved "extra" items for when draw_state becomes WL_LINE (again) int saved_n_extra = 0; @@ -291,7 +313,6 @@ win_line( int tocol = MAXCOL; // end of inverting int fromcol_prev = -2; // start of inverting after cursor int noinvcur = FALSE; // don't invert the cursor - pos_T *top, *bot; int lnum_in_visual_area = FALSE; pos_T pos; long v; @@ -318,7 +339,7 @@ win_line( int *color_cols = NULL; // pointer to according columns array #endif int eol_hl_off = 0; // 1 if highlighted char after EOL -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP int text_prop_count; int text_prop_next = 0; // next text property to use textprop_T *text_props = NULL; @@ -330,7 +351,7 @@ win_line( #endif #ifdef FEAT_SPELL int has_spell = FALSE; // this buffer has spell checking - int can_spell; + int can_spell = FALSE; # define SPWORDLEN 150 char_u nextline[SPWORDLEN * 2];// text with start of the next line int nextlinecol = 0; // column where nextline[] starts @@ -356,6 +377,8 @@ win_line( #if defined(FEAT_DIFF) || defined(FEAT_SIGNS) int filler_lines = 0; // nr of filler lines to be drawn int filler_todo = 0; // nr of filler lines still to do + 1 +#else +# define filler_lines 0 #endif #ifdef FEAT_DIFF hlf_T diff_hlf = (hlf_T)0; // type of diff highlighting @@ -363,6 +386,9 @@ win_line( int change_end = -1; // last col of changed area #endif colnr_T trailcol = MAXCOL; // start of trailing spaces + colnr_T leadcol = 0; // start of leading spaces + int in_multispace = FALSE; // in multiple consecutive spaces + int multispace_pos = 0; // position in lcs-multispace string #ifdef FEAT_LINEBREAK int need_showbreak = FALSE; // overlong line, skipping first x // chars @@ -376,6 +402,7 @@ win_line( #ifdef FEAT_SIGNS int sign_present = FALSE; sign_attrs_T sattr; + int num_attr = 0; // attribute for the number column #endif #ifdef FEAT_ARABIC int prev_c = 0; // previous Arabic character @@ -402,32 +429,32 @@ win_line( // draw_state: items that are drawn in sequence: #define WL_START 0 // nothing done yet #ifdef FEAT_CMDWIN -# define WL_CMDLINE WL_START + 1 // cmdline window column +# define WL_CMDLINE (WL_START + 1) // cmdline window column #else # define WL_CMDLINE WL_START #endif #ifdef FEAT_FOLDING -# define WL_FOLD WL_CMDLINE + 1 // 'foldcolumn' +# define WL_FOLD (WL_CMDLINE + 1) // 'foldcolumn' #else # define WL_FOLD WL_CMDLINE #endif #ifdef FEAT_SIGNS -# define WL_SIGN WL_FOLD + 1 // column for signs +# define WL_SIGN (WL_FOLD + 1) // column for signs #else # define WL_SIGN WL_FOLD // column for signs #endif -#define WL_NR WL_SIGN + 1 // line number +#define WL_NR (WL_SIGN + 1) // line number #ifdef FEAT_LINEBREAK -# define WL_BRI WL_NR + 1 // 'breakindent' +# define WL_BRI (WL_NR + 1) // 'breakindent' #else # define WL_BRI WL_NR #endif #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) -# define WL_SBR WL_BRI + 1 // 'showbreak' or 'diff' +# define WL_SBR (WL_BRI + 1) // 'showbreak' or 'diff' #else # define WL_SBR WL_BRI #endif -#define WL_LINE WL_SBR + 1 // text in the line +#define WL_LINE (WL_SBR + 1) // text in the line int draw_state = WL_START; // what to draw next #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) int feedback_col = 0; @@ -437,6 +464,7 @@ win_line( #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) int match_conc = 0; // cchar for match functions + int on_last_col = FALSE; #endif #ifdef FEAT_CONCEAL int syntax_flags = 0; @@ -514,7 +542,7 @@ win_line( { extra_check = TRUE; get_term_attr = TRUE; - win_attr = term_get_attr(wp->w_buffer, lnum, -1); + win_attr = term_get_attr(wp, lnum, -1); } #endif @@ -558,6 +586,8 @@ win_line( // handle Visual active in this window if (VIsual_active && wp->w_buffer == curwin->w_buffer) { + pos_T *top, *bot; + if (LTOREQ_POS(curwin->w_cursor, VIsual)) { // Visual is after curwin->w_cursor @@ -663,7 +693,7 @@ win_line( else tocol = MAXCOL; // do at least one character; happens when past end of line - if (fromcol == tocol) + if (fromcol == tocol && search_match_endcol) tocol = fromcol + 1; area_highlighting = TRUE; vi_attr = HL_ATTR(HLF_I); @@ -694,7 +724,9 @@ win_line( #endif #ifdef FEAT_SIGNS - sign_present = buf_get_signattrs(wp->w_buffer, lnum, &sattr); + sign_present = buf_get_signattrs(wp, lnum, &sattr); + if (sign_present) + num_attr = sattr.sat_numhl; #endif #ifdef LINE_ATTR @@ -756,16 +788,35 @@ win_line( if (wp->w_p_list) { - if (lcs_space || lcs_trail || lcs_nbsp) + if (wp->w_lcs_chars.space + || wp->w_lcs_chars.multispace != NULL + || wp->w_lcs_chars.leadmultispace != NULL + || wp->w_lcs_chars.trail + || wp->w_lcs_chars.lead + || wp->w_lcs_chars.nbsp) extra_check = TRUE; + // find start of trailing whitespace - if (lcs_trail) + if (wp->w_lcs_chars.trail) { trailcol = (colnr_T)STRLEN(ptr); while (trailcol > (colnr_T)0 && VIM_ISWHITE(ptr[trailcol - 1])) --trailcol; trailcol += (colnr_T) (ptr - line); } + // find end of leading whitespace + if (wp->w_lcs_chars.lead || wp->w_lcs_chars.leadmultispace != NULL) + { + leadcol = 0; + while (VIM_ISWHITE(ptr[leadcol])) + ++leadcol; + if (ptr[leadcol] == NUL) + // in a line full of spaces all of them are treated as trailing + leadcol = (colnr_T)0; + else + // keep track of the first column not filled with spaces + leadcol += (colnr_T) (ptr - line) + 1; + } } wcr_attr = get_wcr_attr(wp); @@ -774,10 +825,8 @@ win_line( win_attr = wcr_attr; area_highlighting = TRUE; } - if (vi_attr != 0 && win_attr != 0) - vi_attr = hl_combine_attr(win_attr, vi_attr); -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(wp)) screen_line_flags |= SLF_POPUP; #endif @@ -920,8 +969,7 @@ win_line( if (wp->w_p_cul && lnum == wp->w_cursor.lnum) { // Do not show the cursor line in the text when Visual mode is active, - // because it's not clear what is selected then. Do update - // w_last_cursorline. + // because it's not clear what is selected then. if (!(wp == curwin && VIsual_active) && wp->w_p_culopt_flags != CULOPT_NBR) { @@ -933,23 +981,31 @@ win_line( if (!cul_screenline) { cul_attr = HL_ATTR(HLF_CUL); - line_attr = cul_attr; - wp->w_last_cursorline = wp->w_cursor.lnum; +# ifdef FEAT_SIGNS + // Combine the 'cursorline' and sign highlighting, depending on + // the sign priority. + if (sign_present && sattr.sat_linehl > 0) + { + if (sattr.sat_priority >= 100) + line_attr = hl_combine_attr(cul_attr, line_attr); + else + line_attr = hl_combine_attr(line_attr, cul_attr); + } + else +# endif + line_attr = cul_attr; } else { line_attr_save = line_attr; - wp->w_last_cursorline = 0; margin_columns_win(wp, &left_curline_col, &right_curline_col); } area_highlighting = TRUE; } - else - wp->w_last_cursorline = wp->w_cursor.lnum; } #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP { char_u *prop_start; @@ -991,7 +1047,7 @@ win_line( for (;;) { #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) - int has_match_conc = 0; // match wants to conceal + int has_match_conc = 0; // match wants to conceal #endif #ifdef FEAT_CONCEAL int did_decrement_ptr = FALSE; @@ -999,6 +1055,14 @@ win_line( // Skip this quickly when working on the text. if (draw_state != WL_LINE) { +#ifdef FEAT_SYN_HL + if (cul_screenline) + { + cul_attr = 0; + line_attr = line_attr_save; + } +#endif + #ifdef FEAT_CMDWIN if (draw_state == WL_CMDLINE - 1 && n_extra == 0) { @@ -1025,17 +1089,21 @@ win_line( // Draw the 'foldcolumn'. Allocate a buffer, "extra" may // already be in use. vim_free(p_extra_free); - p_extra_free = alloc(12 + 1); - + p_extra_free = alloc(MAX_MCO * fdc + 1); if (p_extra_free != NULL) { - fill_foldcolumn(p_extra_free, wp, FALSE, lnum); - n_extra = fdc; + n_extra = (int)fill_foldcolumn(p_extra_free, wp, + FALSE, lnum); p_extra_free[n_extra] = NUL; p_extra = p_extra_free; c_extra = NUL; c_final = NUL; - char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_FC)); + if (use_cursor_line_sign(wp, lnum)) + char_attr = + hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLF)); + else + char_attr = + hl_combine_attr(wcr_attr, HL_ATTR(HLF_FC)); } } } @@ -1060,10 +1128,7 @@ win_line( // Display the absolute or relative line number. After the // first fill with blanks when the 'n' flag isn't in 'cpo' if ((wp->w_p_nu || wp->w_p_rnu) - && (row == startrow -#ifdef FEAT_DIFF - + filler_lines -#endif + && (row == startrow + filler_lines || vim_strchr(p_cpo, CPO_NUMCOL) == NULL)) { #ifdef FEAT_SIGNS @@ -1080,11 +1145,7 @@ win_line( #endif { // Draw the line number (empty space after wrapping). - if (row == startrow -#ifdef FEAT_DIFF - + filler_lines -#endif - ) + if (row == startrow + filler_lines) { long num; char *fmt = "%*ld "; @@ -1116,8 +1177,9 @@ win_line( int t; // like rl_mirror(), but keep the space at the end - p2 = skiptowhite(extra) - 1; - for (p1 = extra; p1 < p2; ++p1, --p2) + p2 = skipwhite(extra); + p2 = skiptowhite(p2) - 1; + for (p1 = skipwhite(extra); p1 < p2; ++p1, --p2) { t = *p1; *p1 = *p2; @@ -1139,15 +1201,16 @@ win_line( #ifdef FEAT_SYN_HL // When 'cursorline' is set highlight the line number of // the current line differently. - // When 'cursorlineopt' has "screenline" only highlight - // the line number itself. + // When 'cursorlineopt' does not have "line" only + // highlight the line number itself. // TODO: Can we use CursorLine instead of CursorLineNr // when CursorLineNr isn't set? if (wp->w_p_cul && lnum == wp->w_cursor.lnum && (wp->w_p_culopt_flags & CULOPT_NBR) - && (row == startrow - || wp->w_p_culopt_flags & CULOPT_LINE)) + && (row == startrow + filler_lines + || (row > startrow + filler_lines + && (wp->w_p_culopt_flags & CULOPT_LINE)))) char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLN)); #endif if (wp->w_p_rnu && lnum < wp->w_cursor.lnum @@ -1161,15 +1224,19 @@ win_line( char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_LNB)); } +#ifdef FEAT_SIGNS + if (num_attr) + char_attr = num_attr; +#endif } } #ifdef FEAT_LINEBREAK - if (wp->w_p_brisbr && draw_state == WL_BRI - 1 - && n_extra == 0 && *p_sbr != NUL) + if (wp->w_briopt_sbr && draw_state == WL_BRI - 1 + && n_extra == 0 && *get_showbreak_value(wp) != NUL) // draw indent after showbreak value draw_state = WL_BRI; - else if (wp->w_p_brisbr && draw_state == WL_SBR && n_extra == 0) + else if (wp->w_briopt_sbr && draw_state == WL_SBR && n_extra == 0) // After the showbreak, draw the breakindent draw_state = WL_BRI - 1; @@ -1178,8 +1245,7 @@ win_line( { draw_state = WL_BRI; // if need_showbreak is set, breakindent also applies - if (wp->w_p_bri && n_extra == 0 - && (row != startrow || need_showbreak) + if (wp->w_p_bri && (row != startrow || need_showbreak) # ifdef FEAT_DIFF && filler_lines == 0 # endif @@ -1188,18 +1254,21 @@ win_line( char_attr = 0; # ifdef FEAT_DIFF if (diff_hlf != (hlf_T)0) - { char_attr = HL_ATTR(diff_hlf); -# ifdef FEAT_SYN_HL - if (cul_attr != 0) - char_attr = hl_combine_attr(char_attr, cul_attr); -# endif - } # endif p_extra = NULL; c_extra = ' '; + c_final = NUL; n_extra = get_breakindent_win(wp, ml_get_buf(wp->w_buffer, lnum, FALSE)); + if (row == startrow) + { + n_extra -= win_col_off2(wp); + if (n_extra < 0) + n_extra = 0; + } + if (wp->w_skipcol > 0 && wp->w_p_wrap && wp->w_briopt_sbr) + need_showbreak = FALSE; // Correct end of highlighted area for 'breakindent', // required when 'linebreak' is also set. if (tocol == vcol) @@ -1211,6 +1280,8 @@ win_line( #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) if (draw_state == WL_SBR - 1 && n_extra == 0) { + char_u *sbr; + draw_state = WL_SBR; # ifdef FEAT_DIFF if (filler_todo > 0) @@ -1236,23 +1307,23 @@ win_line( } # endif # ifdef FEAT_LINEBREAK - if (*p_sbr != NUL && need_showbreak) + sbr = get_showbreak_value(wp); + if (*sbr != NUL && need_showbreak) { // Draw 'showbreak' at the start of each broken line. - p_extra = p_sbr; + p_extra = sbr; c_extra = NUL; c_final = NUL; - n_extra = (int)STRLEN(p_sbr); - char_attr = HL_ATTR(HLF_AT); - need_showbreak = FALSE; - vcol_sbr = vcol + MB_CHARLEN(p_sbr); + n_extra = (int)STRLEN(sbr); + if (wp->w_skipcol == 0 || !wp->w_p_wrap) + need_showbreak = FALSE; + vcol_sbr = vcol + MB_CHARLEN(sbr); // Correct end of highlighted area for 'showbreak', // required when 'linebreak' is also set. if (tocol == vcol) tocol += n_extra; // combine 'showbreak' with 'wincolor' - if (win_attr != 0) - char_attr = hl_combine_attr(win_attr, char_attr); + char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); # ifdef FEAT_SYN_HL // combine 'showbreak' with 'cursorline' if (cul_attr != 0) @@ -1280,35 +1351,27 @@ win_line( } } #ifdef FEAT_SYN_HL - if (cul_screenline) + if (cul_screenline && draw_state == WL_LINE + && vcol >= left_curline_col + && vcol < right_curline_col) { - if (draw_state == WL_LINE - && vcol >= left_curline_col - && vcol < right_curline_col) - { - cul_attr = HL_ATTR(HLF_CUL); - line_attr = cul_attr; - } - else - { - cul_attr = 0; - line_attr = line_attr_save; - } + cul_attr = HL_ATTR(HLF_CUL); + line_attr = cul_attr; } #endif // When still displaying '$' of change command, stop at cursor. // When only displaying the (relative) line number and that's done, // stop here. - if ((dollar_vcol >= 0 && wp == curwin - && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol + if (((dollar_vcol >= 0 && wp == curwin + && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol) + || (number_only && draw_state > WL_NR)) #ifdef FEAT_DIFF && filler_todo <= 0 #endif ) - || (number_only && draw_state > WL_NR)) { - screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width, + screen_line(screen_row, wp->w_wincol, col, -wp->w_width, screen_line_flags); // Pretend we have finished updating the window. Except when // 'cursorcolumn' is set. @@ -1345,8 +1408,14 @@ win_line( v = (long)(ptr - line); search_attr = update_search_hl(wp, lnum, (colnr_T)v, &line, &screen_search_hl, &has_match_conc, - &match_conc, did_line_attr, lcs_eol_one); + &match_conc, did_line_attr, lcs_eol_one, + &on_last_col); ptr = line + v; // "line" may have been changed + + // Do not allow a conceal over EOL otherwise EOL will be missed + // and bad things happen. + if (*ptr == NUL) + has_match_conc = 0; } #endif @@ -1369,13 +1438,17 @@ win_line( } #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP if (text_props != NULL) { int pi; int bcol = (int)(ptr - line); - if (n_extra > 0) + if (n_extra > 0 +# ifdef FEAT_LINEBREAK + && !in_linebreak +# endif + ) --bcol; // still working on the previous char, e.g. Tab // Check if any active property ends. @@ -1393,13 +1466,28 @@ win_line( * (text_props_active - (pi + 1))); --text_props_active; --pi; +# ifdef FEAT_LINEBREAK + // not exactly right but should work in most cases + if (in_linebreak && syntax_attr == text_prop_attr) + syntax_attr = 0; +# endif } } +# ifdef FEAT_LINEBREAK + if (n_extra > 0 && in_linebreak) + // not on the next char yet, don't start another prop + --bcol; +# endif // Add any text property that starts in this column. while (text_prop_next < text_prop_count && bcol >= text_props[text_prop_next].tp_col - 1) - text_prop_idxs[text_props_active++] = text_prop_next++; + { + if (bcol <= text_props[text_prop_next].tp_col - 1 + + text_props[text_prop_next].tp_len) + text_prop_idxs[text_props_active++] = text_prop_next; + ++text_prop_next; + } text_prop_attr = 0; text_prop_combine = FALSE; @@ -1439,7 +1527,7 @@ win_line( syntax_attr = 0; # ifdef FEAT_TERMINAL if (get_term_attr) - syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol); + syntax_attr = term_get_attr(wp, lnum, vcol); # endif // Get syntax attribute. if (has_syntax) @@ -1467,10 +1555,6 @@ win_line( prev_syntax_attr = syntax_attr; } - // combine syntax attribute with 'wincolor' - if (syntax_attr != 0 && win_attr != 0) - syntax_attr = hl_combine_attr(win_attr, syntax_attr); - if (did_emsg) { wp->w_s->b_syn_error = TRUE; @@ -1498,6 +1582,16 @@ win_line( # endif } } +# ifdef FEAT_PROP_POPUP + // Combine text property highlight into syntax highlight. + if (text_prop_type != NULL) + { + if (text_prop_combine) + syntax_attr = hl_combine_attr(syntax_attr, text_prop_attr); + else + syntax_attr = text_prop_attr; + } +# endif #endif // Decide which of the highlight attributes to use. @@ -1506,29 +1600,20 @@ win_line( if (area_attr != 0) { char_attr = hl_combine_attr(line_attr, area_attr); + if (!highlight_match) + // let search highlight show in Visual area if possible + char_attr = hl_combine_attr(search_attr, char_attr); # ifdef FEAT_SYN_HL - if (syntax_attr != 0) - char_attr = hl_combine_attr(syntax_attr, char_attr); + char_attr = hl_combine_attr(syntax_attr, char_attr); # endif } else if (search_attr != 0) { char_attr = hl_combine_attr(line_attr, search_attr); # ifdef FEAT_SYN_HL - if (syntax_attr != 0) - char_attr = hl_combine_attr(syntax_attr, char_attr); + char_attr = hl_combine_attr(syntax_attr, char_attr); # endif } -# ifdef FEAT_TEXT_PROP - else if (text_prop_type != NULL) - { - char_attr = hl_combine_attr(line_attr != 0 - ? line_attr - : syntax_attr != 0 - ? syntax_attr - : win_attr, text_prop_attr); - } -# endif else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL) || vcol < fromcol || vcol_prev < fromcol_prev || vcol >= tocol)) @@ -1536,11 +1621,10 @@ win_line( // Use line_attr when not in the Visual or 'incsearch' area // (area_attr may be 0 when "noinvcur" is set). # ifdef FEAT_SYN_HL - if (syntax_attr != 0) - char_attr = hl_combine_attr(syntax_attr, line_attr); - else + char_attr = hl_combine_attr(syntax_attr, line_attr); +# else + char_attr = line_attr; # endif - char_attr = line_attr; attr_pri = FALSE; } #else @@ -1552,27 +1636,22 @@ win_line( else { attr_pri = FALSE; -#ifdef FEAT_TEXT_PROP - if (text_prop_type != NULL) - { - if (text_prop_combine) - char_attr = hl_combine_attr( - syntax_attr, text_prop_attr); - else - char_attr = hl_combine_attr( - win_attr, text_prop_attr); - } - else -#endif #ifdef FEAT_SYN_HL - char_attr = syntax_attr; + char_attr = syntax_attr; #else - char_attr = 0; + char_attr = 0; #endif } } - if (char_attr == 0) - char_attr = win_attr; + + // combine attribute with 'wincolor' + if (win_attr != 0) + { + if (char_attr == 0) + char_attr = win_attr; + else + char_attr = hl_combine_attr(win_attr, char_attr); + } // Get the next character to put on the screen. @@ -1649,6 +1728,8 @@ win_line( if (cul_attr) multi_attr = hl_combine_attr(multi_attr, cul_attr); #endif + multi_attr = hl_combine_attr(win_attr, multi_attr); + // put the pointer back to output the double-width // character at the start of the next line. ++n_extra; @@ -1663,15 +1744,18 @@ win_line( ++p_extra; } --n_extra; +#if defined(FEAT_LINEBREAK) && defined(FEAT_PROP_POPUP) + if (n_extra <= 0) + in_linebreak = FALSE; +#endif } else { #ifdef FEAT_LINEBREAK int c0; #endif + VIM_CLEAR(p_extra_free); - if (p_extra_free != NULL) - VIM_CLEAR(p_extra_free); // Get a character from the line itself. c = *ptr; #ifdef FEAT_LINEBREAK @@ -1734,7 +1818,8 @@ win_line( if (area_attr == 0 && search_attr == 0) { n_attr = n_extra + 1; - extra_attr = HL_ATTR(HLF_8); + extra_attr = hl_combine_attr( + win_attr, HL_ATTR(HLF_8)); saved_attr2 = char_attr; // save current attr } } @@ -1787,7 +1872,7 @@ win_line( { // head byte at end of line mb_l = 1; - transchar_nonprint(extra, c); + transchar_nonprint(wp->w_buffer, extra, c); } else { @@ -1803,7 +1888,8 @@ win_line( if (area_attr == 0 && search_attr == 0) { n_attr = n_extra + 1; - extra_attr = HL_ATTR(HLF_8); + extra_attr = hl_combine_attr( + win_attr, HL_ATTR(HLF_8)); saved_attr2 = char_attr; // save current attr } mb_c = c; @@ -1824,7 +1910,7 @@ win_line( mb_c = c; mb_utf8 = FALSE; mb_l = 1; - multi_attr = HL_ATTR(HLF_AT); + multi_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); // Put pointer back so that the character will be // displayed at the start of the next line. --ptr; @@ -1847,7 +1933,7 @@ win_line( if (area_attr == 0 && search_attr == 0) { n_attr = n_extra + 1; - extra_attr = HL_ATTR(HLF_AT); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); saved_attr2 = char_attr; // save current attr } mb_c = c; @@ -1878,6 +1964,7 @@ win_line( char_u *prev_ptr, *p; int len; hlf_T spell_hlf = HLF_COUNT; + if (has_mbyte) { prev_ptr = ptr - mb_l; @@ -1900,7 +1987,7 @@ win_line( // In Insert mode only highlight a word that // doesn't touch the cursor. if (spell_hlf != HLF_COUNT - && (State & INSERT) != 0 + && (State & MODE_INSERT) && wp->w_cursor.lnum == lnum && wp->w_cursor.col >= (colnr_T)(prev_ptr - line) @@ -1954,12 +2041,28 @@ win_line( if (wp->w_p_lbr && c0 == c && VIM_ISBREAK(c) && !VIM_ISBREAK((int)*ptr)) { - int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0; - char_u *p = ptr - (mb_off + 1); + int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) + : 0; + char_u *p = ptr - (mb_off + 1); // TODO: is passing p for start of the line OK? n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1; + + // We have just drawn the showbreak value, no need to add + // space for it again. + if (vcol == vcol_sbr) + { + n_extra -= MB_CHARLEN(get_showbreak_value(wp)); + if (n_extra < 0) + n_extra = 0; + } + if (on_last_col && c != TAB) + // Do not continue search/match highlighting over the + // line break, but for TABs the highlighting should + // include the complete width of the character + search_attr = 0; + if (c == TAB && n_extra + col > wp->w_width) # ifdef FEAT_VARTABS n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts, @@ -1971,38 +2074,58 @@ win_line( c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' '; c_final = NUL; +# if defined(FEAT_PROP_POPUP) + if (n_extra > 0 && c != TAB) + in_linebreak = TRUE; +# endif if (VIM_ISWHITE(c)) { -#ifdef FEAT_CONCEAL +# ifdef FEAT_CONCEAL if (c == TAB) // See "Tab alignment" below. FIX_FOR_BOGUSCOLS; -#endif +# endif if (!wp->w_p_list) c = ' '; } } #endif - // 'list': Change char 160 to lcs_nbsp and space to lcs_space. - // But not when the character is followed by a composing - // character (use mb_l to check that). + in_multispace = c == ' ' + && ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' '); + if (!in_multispace) + multispace_pos = 0; + + // 'list': Change char 160 to 'nbsp' and space to 'space' + // setting in 'listchars'. But not when the character is + // followed by a composing character (use mb_l to check that). if (wp->w_p_list && ((((c == 160 && mb_l == 1) || (mb_utf8 && ((mb_c == 160 && mb_l == 2) || (mb_c == 0x202f && mb_l == 3)))) - && lcs_nbsp) + && wp->w_lcs_chars.nbsp) || (c == ' ' && mb_l == 1 - && lcs_space + && (wp->w_lcs_chars.space + || (in_multispace + && wp->w_lcs_chars.multispace != NULL)) + && ptr - line >= leadcol && ptr - line <= trailcol))) { - c = (c == ' ') ? lcs_space : lcs_nbsp; + if (in_multispace && wp->w_lcs_chars.multispace != NULL) + { + c = wp->w_lcs_chars.multispace[multispace_pos++]; + if (wp->w_lcs_chars.multispace[multispace_pos] == NUL) + multispace_pos = 0; + } + else + c = (c == ' ') ? wp->w_lcs_chars.space + : wp->w_lcs_chars.nbsp; if (area_attr == 0 && search_attr == 0) { n_attr = 1; - extra_attr = HL_ATTR(HLF_8); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8)); saved_attr2 = char_attr; // save current attr } mb_c = c; @@ -2016,13 +2139,32 @@ win_line( mb_utf8 = FALSE; } - if (trailcol != MAXCOL && ptr > line + trailcol && c == ' ') + if (c == ' ' && ((trailcol != MAXCOL && ptr > line + trailcol) + || (leadcol != 0 && ptr < line + leadcol))) { - c = lcs_trail; + if (leadcol != 0 && in_multispace && ptr < line + leadcol + && wp->w_lcs_chars.leadmultispace != NULL) + { + c = wp->w_lcs_chars.leadmultispace[multispace_pos++]; + if (wp->w_lcs_chars.leadmultispace[multispace_pos] + == NUL) + multispace_pos = 0; + } + + else if (ptr > line + trailcol && wp->w_lcs_chars.trail) + c = wp->w_lcs_chars.trail; + + else if (ptr < line + leadcol && wp->w_lcs_chars.lead) + c = wp->w_lcs_chars.lead; + + else if (leadcol != 0 && wp->w_lcs_chars.space) + c = wp->w_lcs_chars.space; + + if (!attr_pri) { n_attr = 1; - extra_attr = HL_ATTR(HLF_8); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8)); saved_attr2 = char_attr; // save current attr } mb_c = c; @@ -2043,15 +2185,17 @@ win_line( // when getting a character from the file, we may have to // turn it into something else on the way to putting it // into "ScreenLines". - if (c == TAB && (!wp->w_p_list || lcs_tab1)) + if (c == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1)) { int tab_len = 0; long vcol_adjusted = vcol; // removed showbreak length #ifdef FEAT_LINEBREAK + char_u *sbr = get_showbreak_value(wp); + // only adjust the tab_len, when at the first column // after the showbreak value was drawn - if (*p_sbr != NUL && vcol == vcol_sbr && wp->w_p_wrap) - vcol_adjusted = vcol - MB_CHARLEN(p_sbr); + if (*sbr != NUL && vcol == vcol_sbr && wp->w_p_wrap) + vcol_adjusted = vcol - MB_CHARLEN(sbr); #endif // tab amount depends on current column #ifdef FEAT_VARTABS @@ -2076,54 +2220,60 @@ win_line( int i; int saved_nextra = n_extra; -#ifdef FEAT_CONCEAL +# ifdef FEAT_CONCEAL if (vcol_off > 0) // there are characters to conceal tab_len += vcol_off; + // boguscols before FIX_FOR_BOGUSCOLS macro from above - if (wp->w_p_list && lcs_tab1 && old_boguscols > 0 - && n_extra > tab_len) + if (wp->w_p_list && wp->w_lcs_chars.tab1 + && old_boguscols > 0 + && n_extra > tab_len) tab_len += n_extra - tab_len; -#endif - - // if n_extra > 0, it gives the number of chars, to +# endif + // If n_extra > 0, it gives the number of chars, to // use for a tab, else we need to calculate the width - // for a tab - len = (tab_len * mb_char2len(lcs_tab2)); + // for a tab. + len = (tab_len * mb_char2len(wp->w_lcs_chars.tab2)); + if (wp->w_lcs_chars.tab3) + len += mb_char2len(wp->w_lcs_chars.tab3); if (n_extra > 0) len += n_extra - tab_len; - c = lcs_tab1; + c = wp->w_lcs_chars.tab1; p = alloc(len + 1); - vim_memset(p, ' ', len); - p[len] = NUL; - vim_free(p_extra_free); - p_extra_free = p; - for (i = 0; i < tab_len; i++) + if (p == NULL) + n_extra = 0; + else { - int lcs = lcs_tab2; - - if (*p == NUL) + vim_memset(p, ' ', len); + p[len] = NUL; + vim_free(p_extra_free); + p_extra_free = p; + for (i = 0; i < tab_len; i++) { - tab_len = i; - break; - } - - // if lcs_tab3 is given, need to change the char - // for tab - if (lcs_tab3 && i == tab_len - 1) - lcs = lcs_tab3; - mb_char2bytes(lcs, p); - p += mb_char2len(lcs); - n_extra += mb_char2len(lcs) + int lcs = wp->w_lcs_chars.tab2; + + if (*p == NUL) + { + tab_len = i; + break; + } + + // if tab3 is given, use it for the last char + if (wp->w_lcs_chars.tab3 && i == tab_len - 1) + lcs = wp->w_lcs_chars.tab3; + p += mb_char2bytes(lcs, p); + n_extra += mb_char2len(lcs) - (saved_nextra > 0 ? 1 : 0); + } + p_extra = p_extra_free; +# ifdef FEAT_CONCEAL + // n_extra will be increased by FIX_FOX_BOGUSCOLS + // macro below, so need to adjust for that here + if (vcol_off > 0) + n_extra -= vcol_off; +# endif } - p_extra = p_extra_free; -#ifdef FEAT_CONCEAL - // n_extra will be increased by FIX_FOX_BOGUSCOLS - // macro below, so need to adjust for that here - if (vcol_off > 0) - n_extra -= vcol_off; -#endif } #endif #ifdef FEAT_CONCEAL @@ -2140,25 +2290,27 @@ win_line( // Make sure, the highlighting for the tab char will be // correctly set further below (effectively reverts the - // FIX_FOR_BOGSUCOLS macro + // FIX_FOR_BOGSUCOLS macro). if (n_extra == tab_len + vc_saved && wp->w_p_list - && lcs_tab1) + && wp->w_lcs_chars.tab1) tab_len += vc_saved; } #endif mb_utf8 = FALSE; // don't draw as UTF-8 if (wp->w_p_list) { - c = (n_extra == 0 && lcs_tab3) ? lcs_tab3 : lcs_tab1; + c = (n_extra == 0 && wp->w_lcs_chars.tab3) + ? wp->w_lcs_chars.tab3 + : wp->w_lcs_chars.tab1; #ifdef FEAT_LINEBREAK if (wp->w_p_lbr) c_extra = NUL; // using p_extra from above else #endif - c_extra = lcs_tab2; - c_final = lcs_tab3; + c_extra = wp->w_lcs_chars.tab2; + c_final = wp->w_lcs_chars.tab3; n_attr = tab_len + 1; - extra_attr = HL_ATTR(HLF_8); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8)); saved_attr2 = char_attr; // save current attr mb_c = c; if (enc_utf8 && utf_char2len(c) > 1) @@ -2221,15 +2373,15 @@ win_line( c_final = NUL; } } - if (wp->w_p_list && lcs_eol > 0) - c = lcs_eol; + if (wp->w_p_list && wp->w_lcs_chars.eol > 0) + c = wp->w_lcs_chars.eol; else c = ' '; lcs_eol_one = -1; --ptr; // put it back at the NUL if (!attr_pri) { - extra_attr = HL_ATTR(HLF_AT); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); n_attr = 1; } mb_c = c; @@ -2244,7 +2396,7 @@ win_line( } else if (c != NUL) { - p_extra = transchar(c); + p_extra = transchar_buf(wp->w_buffer, c); if (n_extra == 0) n_extra = byte2cells(c) - 1; #ifdef FEAT_RIGHTLEFT @@ -2275,7 +2427,7 @@ win_line( if (!attr_pri) { n_attr = n_extra + 1; - extra_attr = HL_ATTR(HLF_8); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8)); saved_attr2 = char_attr; // save current attr } mb_utf8 = FALSE; // don't draw as UTF-8 @@ -2324,7 +2476,8 @@ win_line( // don't do search HL for the rest of the line if (line_attr != 0 && char_attr == search_attr && (did_line_attr > 1 - || (wp->w_p_list && lcs_eol > 0))) + || (wp->w_p_list && + wp->w_lcs_chars.eol > 0))) char_attr = line_attr; # ifdef FEAT_DIFF if (diff_hlf == HLF_TXD) @@ -2365,26 +2518,29 @@ win_line( #ifdef FEAT_CONCEAL if ( wp->w_p_cole > 0 - && (wp != curwin || lnum != wp->w_cursor.lnum || - conceal_cursor_line(wp)) + && (wp != curwin || lnum != wp->w_cursor.lnum + || conceal_cursor_line(wp)) && ((syntax_flags & HL_CONCEAL) != 0 || has_match_conc > 0) && !(lnum_in_visual_area && vim_strchr(wp->w_p_cocu, 'v') == NULL)) { char_attr = conceal_attr; - if ((prev_syntax_id != syntax_seqnr || has_match_conc > 1) - && (syn_get_sub_char() != NUL || match_conc - || wp->w_p_cole == 1) + if (((prev_syntax_id != syntax_seqnr + && (syntax_flags & HL_CONCEAL) != 0) + || has_match_conc > 1) + && (syn_get_sub_char() != NUL + || (has_match_conc && match_conc) + || wp->w_p_cole == 1) && wp->w_p_cole != 3) { // First time at this concealed item: display one // character. - if (match_conc) + if (has_match_conc && match_conc) c = match_conc; else if (syn_get_sub_char() != NUL) c = syn_get_sub_char(); - else if (lcs_conceal != NUL) - c = lcs_conceal; + else if (wp->w_lcs_chars.conceal != NUL) + c = wp->w_lcs_chars.conceal; else c = ' '; @@ -2447,15 +2603,18 @@ win_line( && conceal_cursor_line(wp) && (int)wp->w_virtcol <= vcol + n_skip) { -# ifdef FEAT_RIGHTLEFT +# ifdef FEAT_RIGHTLEFT if (wp->w_p_rl) wp->w_wcol = wp->w_width - col + boguscols - 1; else -# endif +# endif wp->w_wcol = col - boguscols; wp->w_wrow = row; did_wcol = TRUE; curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL; +# ifdef FEAT_PROP_POPUP + curwin->w_flags &= ~(WFLAG_WCOL_OFF_ADDED | WFLAG_WROW_OFF_ADDED); +# endif } #endif @@ -2479,7 +2638,7 @@ win_line( if (p_imst == IM_ON_THE_SPOT && xic != NULL && lnum == wp->w_cursor.lnum - && (State & INSERT) + && (State & MODE_INSERT) && !p_imdisable && im_is_preediting() && draw_state == WL_LINE) @@ -2524,7 +2683,7 @@ win_line( && draw_state > WL_NR && c != NUL) { - c = lcs_prec; + c = wp->w_lcs_chars.prec; lcs_prec_todo = NUL; if (has_mbyte && (*mb_char2cells)(mb_c) > 1) { @@ -2534,7 +2693,7 @@ win_line( c_final = NUL; n_extra = 1; n_attr = 2; - extra_attr = HL_ATTR(HLF_AT); + extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); } mb_c = c; if (enc_utf8 && utf_char2len(c) > 1) @@ -2548,7 +2707,7 @@ win_line( if (!attr_pri) { saved_attr3 = char_attr; // save current attr - char_attr = HL_ATTR(HLF_AT); // later copied to char_attr + char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); n_attr3 = 1; } } @@ -2570,7 +2729,7 @@ win_line( // highlight match at end of line. If it's beyond the last // char on the screen, just overwrite that one (tricky!) Not // needed when a '$' was displayed for 'list'. - if (lcs_eol == lcs_eol_one + if (wp->w_lcs_chars.eol == lcs_eol_one && ((area_attr != 0 && vcol == fromcol && (VIsual_mode != Ctrl_V || lnum == VIsual.lnum @@ -2674,7 +2833,7 @@ win_line( if (((wp->w_p_cuc && (int)wp->w_virtcol >= VCOL_HLC - eol_hl_off && (int)wp->w_virtcol < - wp->w_width * (row - startrow + 1) + v + (long)wp->w_width * (row - startrow + 1) + v && lnum != wp->w_cursor.lnum) || draw_color_col || win_attr != 0) @@ -2720,7 +2879,7 @@ win_line( #endif screen_line(screen_row, wp->w_wincol, col, - (int)wp->w_width, screen_line_flags); + wp->w_width, screen_line_flags); row++; // Update w_cline_height and w_cline_folded if the cursor line was @@ -2740,7 +2899,8 @@ win_line( // Show "extends" character from 'listchars' if beyond the line end and // 'list' is set. - if (lcs_ext != NUL + if (wp->w_lcs_chars.ext != NUL + && draw_state == WL_LINE && wp->w_p_list && !wp->w_p_wrap #ifdef FEAT_DIFF @@ -2755,8 +2915,8 @@ win_line( || (wp->w_p_list && lcs_eol_one > 0) || (n_extra && (c_extra != NUL || *p_extra != NUL)))) { - c = lcs_ext; - char_attr = HL_ATTR(HLF_AT); + c = wp->w_lcs_chars.ext; + char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); mb_c = c; if (enc_utf8 && utf_char2len(c) > 1) { @@ -2777,9 +2937,17 @@ win_line( // highlight the cursor position itself. // Also highlight the 'colorcolumn' if it is different than // 'cursorcolumn' + // Also highlight the 'colorcolumn' if 'breakindent' and/or 'showbreak' + // options are set vcol_save_attr = -1; - if (draw_state == WL_LINE && !lnum_in_visual_area + if (((draw_state == WL_LINE || + draw_state == WL_BRI || + draw_state == WL_SBR) && !lnum_in_visual_area && search_attr == 0 && area_attr == 0) +# ifdef FEAT_DIFF + && filler_todo <= 0 +# endif + ) { if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol && lnum != wp->w_cursor.lnum) @@ -2804,7 +2972,7 @@ win_line( #if defined(FEAT_RIGHTLEFT) if (has_mbyte && wp->w_p_rl && (*mb_char2cells)(mb_c) > 1) { - // A double-wide character is: put first halve in left cell. + // A double-wide character is: put first half in left cell. --off; --col; } @@ -3000,21 +3168,23 @@ win_line( wp->w_p_rl ? (col < 0) : #endif (col >= wp->w_width)) - && (*ptr != NUL + && (draw_state != WL_LINE + || *ptr != NUL #ifdef FEAT_DIFF || filler_todo > 0 #endif - || (wp->w_p_list && lcs_eol != NUL && p_extra != at_end_str) + || (wp->w_p_list && wp->w_lcs_chars.eol != NUL + && p_extra != at_end_str) || (n_extra != 0 && (c_extra != NUL || *p_extra != NUL))) ) { #ifdef FEAT_CONCEAL screen_line(screen_row, wp->w_wincol, col - boguscols, - (int)wp->w_width, screen_line_flags); + wp->w_width, screen_line_flags); boguscols = 0; #else screen_line(screen_row, wp->w_wincol, col, - (int)wp->w_width, screen_line_flags); + wp->w_width, screen_line_flags); #endif ++row; ++screen_row; @@ -3121,15 +3291,15 @@ win_line( #ifdef FEAT_SYN_HL if (!(cul_screenline # ifdef FEAT_DIFF - && diff_hlf == (hlf_T)0) + && diff_hlf == (hlf_T)0 # endif - ) + )) saved_char_attr = char_attr; else #endif saved_char_attr = 0; n_extra = 0; - lcs_prec_todo = lcs_prec; + lcs_prec_todo = wp->w_lcs_chars.prec; #ifdef FEAT_LINEBREAK # ifdef FEAT_DIFF if (filler_todo <= 0) @@ -3155,7 +3325,7 @@ win_line( cap_col = 0; } #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP vim_free(text_props); vim_free(text_prop_idxs); #endif @@ -3163,4 +3333,3 @@ win_line( vim_free(p_extra_free); return row; } - diff --git a/src/drawscreen.c b/src/drawscreen.c index e3da6359c2097..0ff04338e264d 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -69,6 +69,11 @@ static void win_update(win_T *wp); #ifdef FEAT_STL_OPT static void redraw_custom_statusline(win_T *wp); #endif +#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) +static int did_update_one_window; +#endif + +static void win_redr_status(win_T *wp, int ignore_pum); /* * Based on the current value of curwin->w_topline, transfer a screenfull @@ -86,15 +91,14 @@ update_screen(int type_arg) #if !TARGET_OS_IPHONE static int did_intro = FALSE; #endif -#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) - int did_one; -#endif #ifdef FEAT_GUI + int did_one = FALSE; int did_undraw = FALSE; int gui_cursor_col = 0; int gui_cursor_row = 0; #endif int no_update = FALSE; + int save_pum_will_redraw = pum_will_redraw; // Don't do anything if the screen structures are (not yet) valid. if (!screen_valid(TRUE)) @@ -154,7 +158,7 @@ update_screen(int type_arg) } updating_screen = TRUE; -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP // Update popup_mask if needed. This may set w_redraw_top and w_redraw_bot // in some windows. may_update_popup_mask(type); @@ -278,10 +282,15 @@ update_screen(int type_arg) } #endif + if (pum_redraw_in_same_position()) + // Avoid flicker if the popup menu is going to be redrawn in the same + // position. + pum_will_redraw = TRUE; + // Go from top to bottom through the windows, redrawing the ones that need // it. #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) - did_one = FALSE; + did_update_one_window = FALSE; #endif #ifdef FEAT_SEARCH_EXTRA screen_search_hl.rm.regprog = NULL; @@ -291,32 +300,23 @@ update_screen(int type_arg) if (wp->w_redr_type != 0) { cursor_off(); -#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) +#ifdef FEAT_GUI if (!did_one) { did_one = TRUE; -# ifdef FEAT_SEARCH_EXTRA - start_search_hl(); -# endif -# ifdef FEAT_CLIPBOARD - // When Visual area changed, may have to update selection. - if (clip_star.available && clip_isautosel_star()) - clip_update_selection(&clip_star); - if (clip_plus.available && clip_isautosel_plus()) - clip_update_selection(&clip_plus); -# endif -#ifdef FEAT_GUI + // Remove the cursor before starting to do anything, because // scrolling may make it difficult to redraw the text under // it. - if (gui.in_use && wp == curwin) + // Also remove the cursor if it needs to be hidden due to an + // ongoing cursor-less sleep. + if (gui.in_use && (wp == curwin || cursor_is_sleeping())) { gui_cursor_col = gui.cursor_col; gui_cursor_row = gui.cursor_row; gui_undraw_cursor(); did_undraw = TRUE; } -#endif } #endif win_update(wp); @@ -332,7 +332,9 @@ update_screen(int type_arg) #if defined(FEAT_SEARCH_EXTRA) end_search_hl(); #endif + // May need to redraw the popup menu. + pum_will_redraw = save_pum_will_redraw; pum_may_redraw(); // Reset b_mod_set flags. Going through all windows is probably faster @@ -340,11 +342,18 @@ update_screen(int type_arg) FOR_ALL_WINDOWS(wp) wp->w_buffer->b_mod_set = FALSE; -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP // Display popup windows on top of the windows and command line. update_popups(win_update); #endif +#ifdef FEAT_TERMINAL + FOR_ALL_WINDOWS(wp) + // If this window contains a terminal, after redrawing all windows, the + // dirty row range can be reset. + term_did_update_window(wp); +#endif + after_updating_screen(TRUE); // Clear or redraw the command line. Done last, because scrolling may @@ -389,6 +398,20 @@ update_screen(int type_arg) return OK; } +/* + * Return the row for drawing the statusline and the ruler of window "wp". + */ + int +statusline_row(win_T *wp) +{ +#if defined(FEAT_PROP_POPUP) + // If the window is really zero height the winbar isn't displayed. + if (wp->w_frame->fr_height == wp->w_status_height && !popup_is_popup(wp)) + return wp->w_winrow; +#endif + return W_WINROW(wp) + wp->w_height; +} + /* * Redraw the status line of window wp. * @@ -399,7 +422,7 @@ update_screen(int type_arg) #if TARGET_OS_IPHONE static __thread int busy = FALSE; #endif - void + static void win_redr_status(win_T *wp, int ignore_pum UNUSED) { int row; @@ -418,6 +441,8 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) return; busy = TRUE; + row = statusline_row(wp); + wp->w_redr_status = FALSE; if (wp->w_status_height == 0) { @@ -447,22 +472,23 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) p = NameBuff; len = (int)STRLEN(p); - if (bt_help(wp->w_buffer) + if ((bt_help(wp->w_buffer) #ifdef FEAT_QUICKFIX - || wp->w_p_pvw + || wp->w_p_pvw #endif - || bufIsChanged(wp->w_buffer) - || wp->w_buffer->b_p_ro) + || bufIsChanged(wp->w_buffer) + || wp->w_buffer->b_p_ro) + && len < MAXPATHL - 1) *(p + len++) = ' '; if (bt_help(wp->w_buffer)) { - STRCPY(p + len, _("[Help]")); + vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]")); len += (int)STRLEN(p + len); } #ifdef FEAT_QUICKFIX if (wp->w_p_pvw) { - STRCPY(p + len, _("[Preview]")); + vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Preview]")); len += (int)STRLEN(p + len); } #endif @@ -472,12 +498,12 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) #endif ) { - STRCPY(p + len, "[+]"); - len += 3; + vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]"); + len += (int)STRLEN(p + len); } if (wp->w_buffer->b_p_ro) { - STRCPY(p + len, _("[RO]")); + vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[RO]")); len += (int)STRLEN(p + len); } @@ -517,13 +543,12 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) len = this_ru_col - 1; } - row = W_WINROW(wp) + wp->w_height; screen_puts(p, row, wp->w_wincol, attr); screen_fill(row, row + 1, len + wp->w_wincol, this_ru_col + wp->w_wincol, fillchar, fillchar, attr); if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL) - && (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1)) + && (this_ru_col - len) > (int)(STRLEN(NameBuff) + 1)) screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff) - 1 + wp->w_wincol), attr); @@ -541,8 +566,7 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) fillchar = fillchar_status(&attr, wp); else fillchar = fillchar_vsep(&attr); - screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp), - attr); + screen_putchar(fillchar, row, W_ENDCOL(wp), attr); } busy = FALSE; } @@ -609,15 +633,14 @@ showruler(int always) win_redr_ruler(curwin, always, FALSE); #endif -#ifdef FEAT_TITLE if (need_maketitle -# ifdef FEAT_STL_OPT +#ifdef FEAT_STL_OPT || (p_icon && (stl_syntax & STL_IN_ICON)) || (p_title && (stl_syntax & STL_IN_TITLE)) -# endif +#endif ) maketitle(); -#endif + // Redraw the tab pages line if needed. if (redraw_tabline) draw_tabline(); @@ -665,14 +688,12 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) #ifdef FEAT_STL_OPT if (*p_ruf) { - int save_called_emsg = called_emsg; + int called_emsg_before = called_emsg; - called_emsg = FALSE; win_redr_custom(wp, TRUE); - if (called_emsg) + if (called_emsg > called_emsg_before) set_string_option_direct((char_u *)"rulerformat", -1, (char_u *)"", OPT_FREE, SID_ERROR); - called_emsg |= save_called_emsg; return; } #endif @@ -680,7 +701,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) /* * Check if not in Insert mode and the line is empty (will show "0-1"). */ - if (!(State & INSERT) + if ((State & MODE_INSERT) == 0 && *ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE) == NUL) empty_line = TRUE; @@ -704,7 +725,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) cursor_off(); if (wp->w_status_height) { - row = W_WINROW(wp) + wp->w_height; + row = statusline_row(wp); fillchar = fillchar_status(&attr, wp); off = wp->w_wincol; width = wp->w_width; @@ -720,7 +741,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) // In list mode virtcol needs to be recomputed virtcol = wp->w_virtcol; - if (wp->w_p_list && lcs_tab1 == NUL) + if (wp->w_p_list && wp->w_lcs_chars.tab1 == NUL) { wp->w_p_list = FALSE; getvvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL); @@ -791,7 +812,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) i = redraw_cmdline; screen_fill(row, row + 1, this_ru_col + off + (int)STRLEN(buffer), - (int)(off + width), + (off + width), fillchar, fillchar, attr); // don't redraw the cmdline because of showing the ruler redraw_cmdline = i; @@ -987,7 +1008,7 @@ redraw_win_toolbar(win_T *wp) int button_attr = syn_name2attr((char_u *)"ToolbarButton"); vim_free(wp->w_winbar_items); - for (menu = wp->w_winbar->children; menu != NULL; menu = menu->next) + FOR_ALL_CHILD_MENUS(wp->w_winbar, menu) ++item_count; wp->w_winbar_items = ALLOC_CLEAR_MULT(winbar_item_T, item_count + 1); @@ -1032,8 +1053,7 @@ redraw_win_toolbar(win_T *wp) } wp->w_winbar_items[item_idx].wb_menu = NULL; // end marker - screen_line(wp->w_winrow, wp->w_wincol, (int)wp->w_width, - (int)wp->w_width, 0); + screen_line(wp->w_winrow, wp->w_wincol, wp->w_width, wp->w_width, 0); } #endif @@ -1068,7 +1088,9 @@ fold_line( linenr_T lnum, int row) { - char_u buf[FOLD_TEXT_LEN]; + // Max value of 'foldcolumn' is 12 and maximum number of bytes in a + // multi-byte character is MAX_MCO. + char_u buf[MAX_MCO * 12 + 1]; pos_T *top, *bot; linenr_T lnume = lnum + fold_count - 1; int len; @@ -1101,37 +1123,14 @@ fold_line( } #endif - // 2. Add the 'foldcolumn' - // Reduce the width when there is not enough space. - fdc = compute_foldcolumn(wp, col); - if (fdc > 0) - { - fill_foldcolumn(buf, wp, TRUE, lnum); -#ifdef FEAT_RIGHTLEFT - if (wp->w_p_rl) - { - int i; - - copy_text_attr(off + wp->w_width - fdc - col, buf, fdc, - HL_ATTR(HLF_FC)); - // reverse the fold column - for (i = 0; i < fdc; ++i) - ScreenLines[off + wp->w_width - i - 1 - col] = buf[i]; - } - else -#endif - copy_text_attr(off + col, buf, fdc, HL_ATTR(HLF_FC)); - col += fdc; - } - #ifdef FEAT_RIGHTLEFT # define RL_MEMSET(p, v, l) \ do { \ if (wp->w_p_rl) \ - for (ri = 0; ri < l; ++ri) \ + for (ri = 0; ri < (l); ++ri) \ ScreenAttrs[off + (wp->w_width - (p) - (l)) + ri] = v; \ else \ - for (ri = 0; ri < l; ++ri) \ + for (ri = 0; ri < (l); ++ri) \ ScreenAttrs[off + (p) + ri] = v; \ } while (0) #else @@ -1142,6 +1141,53 @@ fold_line( } while (0) #endif + // 2. Add the 'foldcolumn' + // Reduce the width when there is not enough space. + fdc = compute_foldcolumn(wp, col); + if (fdc > 0) + { + char_u *p; + int i; + int idx; + + fill_foldcolumn(buf, wp, TRUE, lnum); + p = buf; + for (i = 0; i < fdc; i++) + { + int ch; + + if (has_mbyte) + ch = mb_ptr2char_adv(&p); + else + ch = *p++; +#ifdef FEAT_RIGHTLEFT + if (wp->w_p_rl) + idx = off + wp->w_width - i - 1 - col; + else +#endif + idx = off + col + i; + if (enc_utf8) + { + if (ch >= 0x80) + { + ScreenLinesUC[idx] = ch; + ScreenLinesC[0][idx] = 0; + ScreenLines[idx] = 0x80; + } + else + { + ScreenLines[idx] = ch; + ScreenLinesUC[idx] = 0; + } + } + else + ScreenLines[idx] = ch; + } + + RL_MEMSET(col, HL_ATTR(HLF_FC), fdc); + col += fdc; + } + // Set all attributes of the 'number' or 'relativenumber' column and the // text RL_MEMSET(col, HL_ATTR(HLF_FL), wp->w_width - col); @@ -1340,8 +1386,7 @@ fold_line( } #endif - screen_line(row + W_WINROW(wp), wp->w_wincol, (int)wp->w_width, - (int)wp->w_width, 0); + screen_line(row + W_WINROW(wp), wp->w_wincol, wp->w_width, wp->w_width, 0); // Update w_cline_height and w_cline_folded if the cursor line was // updated (saves a call to plines() later). @@ -1354,6 +1399,15 @@ fold_line( curwin->w_cline_folded = TRUE; curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW); } + +# ifdef FEAT_CONCEAL + // When the line was not folded w_wrow may have been set, recompute it. + if (wp == curwin + && wp->w_cursor.lnum >= lnum + && wp->w_cursor.lnum <= lnume + && conceal_cursor_line(wp)) + curs_columns(TRUE); +# endif } #endif @@ -1418,16 +1472,20 @@ win_update(win_T *wp) #if !TARGET_OS_IPHONE static int recursive = FALSE; // being called recursively #endif - int old_botline = wp->w_botline; + linenr_T old_botline = wp->w_botline; +#ifdef FEAT_CONCEAL + int old_wrow = wp->w_wrow; + int old_wcol = wp->w_wcol; +#endif #ifdef FEAT_FOLDING long fold_count; #endif #ifdef FEAT_SYN_HL // remember what happened to the previous line, to know if // check_visual_highlight() can be used -#define DID_NONE 1 // didn't update a line -#define DID_LINE 2 // updated a normal line -#define DID_FOLD 3 // updated a folded line +# define DID_NONE 1 // didn't update a line +# define DID_LINE 2 // updated a normal line +# define DID_FOLD 3 // updated a folded line int did_update = DID_NONE; linenr_T syntax_last_parsed = 0; // last parsed text line #endif @@ -1436,8 +1494,24 @@ win_update(win_T *wp) #if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA) int save_got_int; #endif -#ifdef SYN_TIME_LIMIT - proftime_T syntax_tm; + +#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) + // This needs to be done only for the first window when update_screen() is + // called. + if (!did_update_one_window) + { + did_update_one_window = TRUE; +# ifdef FEAT_SEARCH_EXTRA + start_search_hl(); +# endif +# ifdef FEAT_CLIPBOARD + // When Visual area changed, may have to update selection. + if (clip_star.available && clip_isautosel_star()) + clip_update_selection(&clip_star); + if (clip_plus.available && clip_isautosel_plus()) + clip_update_selection(&clip_plus); +# endif + } #endif type = wp->w_redr_type; @@ -1448,8 +1522,13 @@ win_update(win_T *wp) wp->w_lines_valid = 0; } - // Window is zero-height: nothing to draw. - if (wp->w_height + WINBAR_HEIGHT(wp) == 0) + // Window frame is zero-height: nothing to draw. + if (wp->w_height + WINBAR_HEIGHT(wp) == 0 + || (wp->w_frame->fr_height == wp->w_status_height +#if defined(FEAT_PROP_POPUP) + && !popup_is_popup(wp) +#endif + )) { wp->w_redr_type = 0; return; @@ -1556,6 +1635,19 @@ win_update(win_T *wp) } #endif } + +#ifdef FEAT_SEARCH_EXTRA + if (search_hl_has_cursor_lnum > 0) + { + // CurSearch was used last time, need to redraw the line with it to + // avoid having two matches highlighted with CurSearch. + if (mod_top == 0 || mod_top > search_hl_has_cursor_lnum) + mod_top = search_hl_has_cursor_lnum; + if (mod_bot == 0 || mod_bot < search_hl_has_cursor_lnum + 1) + mod_bot = search_hl_has_cursor_lnum + 1; + } +#endif + #ifdef FEAT_FOLDING if (mod_top != 0 && hasAnyFolding(wp)) { @@ -1622,6 +1714,10 @@ win_update(win_T *wp) } wp->w_redraw_top = 0; // reset for next time wp->w_redraw_bot = 0; +#ifdef FEAT_SEARCH_EXTRA + search_hl_has_cursor_lnum = 0; +#endif + // When only displaying the lines at the top, set top_end. Used when // window has scrolled down for msg_scrolled. @@ -1665,10 +1761,13 @@ win_update(win_T *wp) #endif ) { - if (mod_top != 0 && wp->w_topline == mod_top) + if (mod_top != 0 + && wp->w_topline == mod_top + && (!wp->w_lines[0].wl_valid + || wp->w_topline == wp->w_lines[0].wl_lnum)) { - // w_topline is the first changed line, the scrolling will be done - // further down. + // w_topline is the first changed line and window is not scrolled, + // the scrolling from changed lines will be done further down. } else if (wp->w_lines[0].wl_valid && (wp->w_topline < wp->w_lines[0].wl_lnum @@ -1748,10 +1847,11 @@ win_update(win_T *wp) // When topline didn't change, find first entry in w_lines[] that // needs updating. - // try to find wp->w_topline in wp->w_lines[].wl_lnum + // Try to find wp->w_topline in wp->w_lines[].wl_lnum. The check + // for "Rows" is in case "wl_size" is incorrect somehow. j = -1; row = 0; - for (i = 0; i < wp->w_lines_valid; i++) + for (i = 0; i < wp->w_lines_valid && i < Rows; i++) { if (wp->w_lines[i].wl_valid && wp->w_lines[i].wl_lnum == wp->w_topline) @@ -1781,6 +1881,8 @@ win_update(win_T *wp) // ... but don't delete new filler lines. row -= wp->w_topfill; #endif + if (row > Rows) // just in case + row = Rows; if (row > 0) { check_for_delay(FALSE); @@ -1879,9 +1981,8 @@ win_update(win_T *wp) if (VIsual_active) { - if (VIsual_active - && (VIsual_mode != wp->w_old_visual_mode - || type == INVERTED_ALL)) + if (VIsual_mode != wp->w_old_visual_mode + || type == INVERTED_ALL) { // If the type of Visual selection changed, redraw the whole // selection. Also when the ownership of the X selection is @@ -1946,18 +2047,47 @@ win_update(win_T *wp) { colnr_T fromc, toc; #if defined(FEAT_LINEBREAK) - int save_ve_flags = ve_flags; + int save_ve_flags = curwin->w_ve_flags; if (curwin->w_p_lbr) - ve_flags = VE_ALL; + curwin->w_ve_flags = VE_ALL; #endif getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); + ++toc; #if defined(FEAT_LINEBREAK) - ve_flags = save_ve_flags; + curwin->w_ve_flags = save_ve_flags; #endif - ++toc; + // Highlight to the end of the line, unless 'virtualedit' has + // "block". if (curwin->w_curswant == MAXCOL) - toc = MAXCOL; + { + if (get_ve_flags() & VE_BLOCK) + { + pos_T pos; + int cursor_above = + curwin->w_cursor.lnum < VIsual.lnum; + + // Need to find the longest line. + toc = 0; + pos.coladd = 0; + for (pos.lnum = curwin->w_cursor.lnum; cursor_above + ? pos.lnum <= VIsual.lnum + : pos.lnum >= VIsual.lnum; + pos.lnum += cursor_above ? 1 : -1) + { + colnr_T t; + + pos.col = (int)STRLEN(ml_get_buf(wp->w_buffer, + pos.lnum, FALSE)); + getvvcol(wp, &pos, NULL, NULL, &t); + if (toc < t) + toc = t; + } + ++toc; + } + else + toc = MAXCOL; + } if (fromc != wp->w_old_cursor_fcol || toc != wp->w_old_cursor_lcol) @@ -2069,8 +2199,8 @@ win_update(win_T *wp) #endif #ifdef SYN_TIME_LIMIT // Set the time limit to 'redrawtime'. - profile_setlimit(p_rdt, &syntax_tm); - syn_set_timeout(&syntax_tm); + redrawtime_limit_set = TRUE; + init_regexp_timeout(p_rdt); #endif #ifdef FEAT_FOLDING win_foldinfo.fi_level = 0; @@ -2146,8 +2276,8 @@ win_update(win_T *wp) #endif )))) #ifdef FEAT_SYN_HL - || (wp->w_p_cul && (lnum == wp->w_cursor.lnum - || lnum == wp->w_last_cursorline)) + || (wp->w_p_cul && lnum == wp->w_cursor.lnum) + || lnum == wp->w_last_cursorline #endif ) { @@ -2160,9 +2290,11 @@ win_update(win_T *wp) // up or down to minimize redrawing. // Don't do this when the change continues until the end. // Don't scroll when dollar_vcol >= 0, keep the "$". + // Don't scroll when redrawing the top, scrolled already above. if (lnum == mod_top && mod_bot != MAXLNUM - && !(dollar_vcol >= 0 && mod_bot == mod_top + 1)) + && !(dollar_vcol >= 0 && mod_bot == mod_top + 1) + && row >= top_end) { int old_rows = 0; int new_rows = 0; @@ -2214,13 +2346,15 @@ win_update(win_T *wp) ++new_rows; else #endif + { #ifdef FEAT_DIFF if (l == wp->w_topline) - new_rows += plines_win_nofill(wp, l, TRUE) + new_rows += plines_win_nofill(wp, l, TRUE) + wp->w_topfill; - else + else #endif - new_rows += plines_win(wp, l, TRUE); + new_rows += plines_win(wp, l, TRUE); + } ++j; if (new_rows > wp->w_height - row - 2) { @@ -2407,11 +2541,11 @@ win_update(win_T *wp) } else { - if (wp->w_p_rnu) + if (wp->w_p_rnu && wp->w_last_cursor_lnum_rnu != wp->w_cursor.lnum) { #ifdef FEAT_FOLDING - // 'relativenumber' set: The text doesn't need to be drawn, but - // the number column nearly always does. + // 'relativenumber' set and the cursor moved vertically: The + // text doesn't need to be drawn, but the number column does. fold_count = foldedCount(wp, lnum, &win_foldinfo); if (fold_count != 0) fold_line(wp, fold_count, &win_foldinfo, lnum, row); @@ -2439,25 +2573,38 @@ win_update(win_T *wp) eof = TRUE; break; } + + // Safety check: if any of the wl_size values is wrong we might go over + // the end of w_lines[]. + if (idx >= Rows) + break; } // End of loop over all window lines. +#ifdef FEAT_SYN_HL + // Now that the window has been redrawn with the old and new cursor line, + // update w_last_cursorline. + wp->w_last_cursorline = wp->w_p_cul ? wp->w_cursor.lnum : 0; +#endif + wp->w_last_cursor_lnum_rnu = wp->w_p_rnu ? wp->w_cursor.lnum : 0; + #ifdef FEAT_VTP // Rewrite the character at the end of the screen line. - if (use_vtp()) + // See the version that was fixed. + if (use_vtp() && get_conpty_fix_type() < 1) { - int i; + int k; - for (i = 0; i < Rows; ++i) + for (k = 0; k < Rows; ++k) if (enc_utf8) - if ((*mb_off2cells)(LineOffset[i] + Columns - 2, - LineOffset[i] + screen_Columns) > 1) - screen_draw_rectangle(i, Columns - 2, 1, 2, FALSE); + if ((*mb_off2cells)(LineOffset[k] + Columns - 2, + LineOffset[k] + screen_Columns) > 1) + screen_draw_rectangle(k, Columns - 2, 1, 2, FALSE); else - screen_draw_rectangle(i, Columns - 1, 1, 1, FALSE); + screen_draw_rectangle(k, Columns - 1, 1, 1, FALSE); else - screen_char(LineOffset[i] + Columns - 1, i, Columns - 1); + screen_char(LineOffset[k] + Columns - 1, k, Columns - 1); } #endif @@ -2492,7 +2639,7 @@ win_update(win_T *wp) wp->w_filler_rows = wp->w_height - srow; } #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP else if (WIN_IS_POPUP(wp)) { // popup line that doesn't fit is left as-is @@ -2504,8 +2651,8 @@ win_update(win_T *wp) int scr_row = W_WINROW(wp) + wp->w_height - 1; // Last line isn't finished: Display "@@@" in the last screen line. - screen_puts_len((char_u *)"@@", 2, scr_row, wp->w_wincol, - HL_ATTR(HLF_AT)); + screen_puts_len((char_u *)"@@", wp->w_width > 2 ? 2 : wp->w_width, + scr_row, wp->w_wincol, HL_ATTR(HLF_AT)); screen_fill(scr_row, scr_row + 1, (int)wp->w_wincol + 2, (int)W_ENDCOL(wp), '@', ' ', HL_ATTR(HLF_AT)); @@ -2514,10 +2661,13 @@ win_update(win_T *wp) } else if (dy_flags & DY_LASTLINE) // 'display' has "lastline" { + int start_col = (int)W_ENDCOL(wp) - 3; + // Last line isn't finished: Display "@@@" at the end. screen_fill(W_WINROW(wp) + wp->w_height - 1, W_WINROW(wp) + wp->w_height, - (int)W_ENDCOL(wp) - 3, (int)W_ENDCOL(wp), + start_col < wp->w_wincol ? wp->w_wincol : start_col, + (int)W_ENDCOL(wp), '@', '@', HL_ATTR(HLF_AT)); set_empty_rows(wp, srow); wp->w_botline = lnum; @@ -2554,13 +2704,16 @@ win_update(win_T *wp) wp->w_botline = lnum; // Make sure the rest of the screen is blank - // put '~'s on rows that aren't part of the file. - win_draw_end(wp, WIN_IS_POPUP(wp) ? ' ' : '~', - ' ', FALSE, row, wp->w_height, HLF_EOB); + // write the 'fill_eob' character to rows that aren't part of the file + if (WIN_IS_POPUP(wp)) + win_draw_end(wp, ' ', ' ', FALSE, row, wp->w_height, HLF_AT); + else + win_draw_end(wp, fill_eob, ' ', FALSE, row, wp->w_height, HLF_EOB); } #ifdef SYN_TIME_LIMIT - syn_set_timeout(NULL); + disable_regexp_timeout(); + redrawtime_limit_set = FALSE; #endif // Reset the type of redrawing required, the window has been updated. @@ -2585,18 +2738,52 @@ win_update(win_T *wp) wp->w_valid |= VALID_BOTLINE; if (wp == curwin && wp->w_botline != old_botline && !recursive) { + win_T *wwp; +#if defined(FEAT_CONCEAL) + linenr_T old_topline = wp->w_topline; + int new_wcol = wp->w_wcol; +#endif recursive = TRUE; curwin->w_valid &= ~VALID_TOPLINE; update_topline(); // may invalidate w_botline again - if (must_redraw != 0) + +#if defined(FEAT_CONCEAL) + if (old_wcol != new_wcol && (wp->w_valid & (VALID_WCOL|VALID_WROW)) + != (VALID_WCOL|VALID_WROW)) + { + // A win_line() call applied a fix to screen cursor column to + // accommodate concealment of cursor line, but in this call to + // update_topline() the cursor's row or column got invalidated. + // If they are left invalid, setcursor() will recompute them + // but there won't be any further win_line() call to re-fix the + // column and the cursor will end up misplaced. So we call + // cursor validation now and reapply the fix again (or call + // win_line() to do it for us). + validate_cursor(); + if (wp->w_wcol == old_wcol && wp->w_wrow == old_wrow + && old_topline == wp->w_topline) + wp->w_wcol = new_wcol; + else + redrawWinline(wp, wp->w_cursor.lnum); + } +#endif + // New redraw either due to updated topline or due to wcol fix. + if (wp->w_redr_type != 0) { // Don't update for changes in buffer again. i = curbuf->b_mod_set; curbuf->b_mod_set = FALSE; + j = curbuf->b_mod_xlines; + curbuf->b_mod_xlines = 0; win_update(curwin); - must_redraw = 0; curbuf->b_mod_set = i; + curbuf->b_mod_xlines = j; } + // Other windows might have w_redr_type raised in update_topline(). + must_redraw = 0; + FOR_ALL_WINDOWS(wwp) + if (wwp->w_redr_type > must_redraw) + must_redraw = wwp->w_redr_type; recursive = FALSE; } } @@ -2627,7 +2814,7 @@ update_prepare(void) #ifdef FEAT_SEARCH_EXTRA start_search_hl(); #endif -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP // Update popup_mask if needed. may_update_popup_mask(must_redraw); #endif @@ -2682,7 +2869,7 @@ update_debug_sign(buf_T *buf, linenr_T lnum) // Return when there is nothing to do, screen updating is already // happening (recursive call), messages on the screen or still starting up. if (!doit || updating_screen - || State == ASKMORE || State == HITRETURN + || State == MODE_ASKMORE || State == MODE_HITRETURN || msg_scrolled #ifdef FEAT_GUI || gui.starting @@ -2743,7 +2930,7 @@ updateWindow(win_T *wp) ) win_redr_status(wp, FALSE); -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP // Display popup windows on top of everything. update_popups(win_update); #endif @@ -2773,7 +2960,8 @@ redraw_asap(int type) schar_T *screenline2 = NULL; // copy from ScreenLines2[] redraw_later(type); - if (msg_scrolled || (State != NORMAL && State != NORMAL_BUSY) || exiting) + if (msg_scrolled || (State != MODE_NORMAL && State != MODE_NORMAL_BUSY) + || exiting) return ret; // Allocate space to save the text displayed in the command line area. @@ -2890,16 +3078,26 @@ redraw_asap(int type) * it belongs. If highlighting was changed a redraw is needed. * If "call_update_screen" is FALSE don't call update_screen() when at the * command line. + * If "redraw_message" is TRUE. */ void -redraw_after_callback(int call_update_screen) +redraw_after_callback(int call_update_screen, int do_message) { ++redrawing_for_callback; - if (State == HITRETURN || State == ASKMORE) - ; // do nothing - else if (State & CMDLINE) + if (State == MODE_HITRETURN || State == MODE_ASKMORE + || State == MODE_SETWSIZE || State == MODE_EXTERNCMD + || State == MODE_CONFIRM || exmode_active) { + if (do_message) + repeat_message(); + } + else if (State & MODE_CMDLINE) + { +#ifdef FEAT_WILDMENU + if (pum_visible()) + cmdline_pum_display(); +#endif // Don't redraw when in prompt_for_number(). if (cmdline_row > 0) { @@ -2917,11 +3115,21 @@ redraw_after_callback(int call_update_screen) redrawcmdline_ex(FALSE); } } - else if (State & (NORMAL | INSERT | TERMINAL)) + else if (State & (MODE_NORMAL | MODE_INSERT | MODE_TERMINAL)) { + update_topline(); + validate_cursor(); + // keep the command line if possible update_screen(VALID_NO_UPDATE); setcursor(); + + if (msg_scrolled == 0) + { + // don't want a hit-enter prompt when something else is displayed + msg_didany = FALSE; + need_wait_return = FALSE; + } } cursor_on(); #ifdef FEAT_GUI @@ -3007,6 +3215,11 @@ redraw_buf_later(buf_T *buf, int type) if (wp->w_buffer == buf) redraw_win_later(wp, type); } +#if defined(FEAT_TERMINAL) && defined(FEAT_PROP_POPUP) + // terminal in popup window is not in list of windows + if (curwin->w_buffer == buf) + redraw_win_later(curwin, type); +#endif } #if defined(FEAT_SIGNS) || defined(PROTO) diff --git a/src/edit.c b/src/edit.c index 07d85078c4449..13effd402fd60 100644 --- a/src/edit.c +++ b/src/edit.c @@ -18,17 +18,13 @@ #define BACKSPACE_WORD_NOT_SPACE 3 #define BACKSPACE_LINE 4 -/* Set when doing something for completion that may call edit() recursively, - * which is not allowed. */ +// Set when doing something for completion that may call edit() recursively, +// which is not allowed. static __thread int compl_busy = FALSE; + static void ins_ctrl_v(void); -#ifdef FEAT_JOB_CHANNEL -static void init_prompt(int cmdchar_todo); -#endif static void insert_special(int, int, int); -static void internal_format(int textwidth, int second_indent, int flags, int format_only, int c); -static void check_auto_format(int); static void redo_literal(int c); static void start_arrow_common(pos_T *end_insert_pos, int change); #ifdef FEAT_SPELL @@ -78,33 +74,29 @@ static int ins_ctrl_ey(int tc); static char_u *do_insert_char_pre(int c); #endif -static __thread colnr_T Insstart_textlen; /* length of line when insert started */ -static __thread colnr_T Insstart_blank_vcol; /* vcol for first inserted blank */ -static __thread int update_Insstart_orig = TRUE; /* set Insstart_orig to Insstart */ +static __thread colnr_T Insstart_textlen; // length of line when insert started +static __thread colnr_T Insstart_blank_vcol; // vcol for first inserted blank +static __thread int update_Insstart_orig = TRUE; // set Insstart_orig to Insstart -static __thread char_u *last_insert = NULL; /* the text of the previous insert, - K_SPECIAL and CSI are escaped */ -static __thread int last_insert_skip; /* nr of chars in front of previous insert */ -static __thread int new_insert_skip; /* nr of chars in front of current insert */ -static __thread int did_restart_edit; /* "restart_edit" when calling edit() */ +static __thread char_u *last_insert = NULL; // the text of the previous insert, + // K_SPECIAL and CSI are escaped +static __thread int last_insert_skip; // nr of chars in front of previous insert +static __thread int new_insert_skip; // nr of chars in front of current insert +static __thread int did_restart_edit; // "restart_edit" when calling edit() -#ifdef FEAT_CINDENT -static __thread int can_cindent; /* may do cindenting on this line */ -#endif +static __thread int can_cindent; // may do cindenting on this line #ifdef FEAT_RIGHTLEFT -static __thread int revins_on; /* reverse insert mode on */ -static __thread int revins_chars; /* how much to skip after edit */ -static __thread int revins_legal; /* was the last char 'legal'? */ -static __thread int revins_scol; /* start column of revins session */ +static __thread int revins_on; // reverse insert mode on +static __thread int revins_chars; // how much to skip after edit +static __thread int revins_legal; // was the last char 'legal'? +static __thread int revins_scol; // start column of revins session #endif -static __thread int ins_need_undo; /* call u_save() before inserting a - char. Set when edit() is called. - after that arrow_used is used. */ +static __thread int ins_need_undo; // call u_save() before inserting a + // char. Set when edit() is called. + // after that arrow_used is used. -static __thread int did_add_space = FALSE; // auto_format() added an extra space - // under the cursor static __thread int dont_sync_undo = FALSE; // CTRL-G U prevents syncing undo for // the next left/right cursor key @@ -133,7 +125,7 @@ static __thread linenr_T o_lnum = 0; int edit( int cmdchar, - int startln, /* if set, insert at start of line */ + int startln, // if set, insert at start of line long count) { int c = 0; @@ -144,54 +136,49 @@ edit( static linenr_T o_lnum = 0; #endif int i; - int did_backspace = TRUE; /* previous char was backspace */ -#ifdef FEAT_CINDENT - int line_is_white = FALSE; /* line is empty before insert */ -#endif - linenr_T old_topline = 0; /* topline before insertion */ + int did_backspace = TRUE; // previous char was backspace + int line_is_white = FALSE; // line is empty before insert + linenr_T old_topline = 0; // topline before insertion #ifdef FEAT_DIFF int old_topfill = -1; #endif - int inserted_space = FALSE; /* just inserted a space */ - int replaceState = REPLACE; - int nomove = FALSE; /* don't move cursor on return */ + int inserted_space = FALSE; // just inserted a space + int replaceState = MODE_REPLACE; + int nomove = FALSE; // don't move cursor on return #ifdef FEAT_JOB_CHANNEL int cmdchar_todo = cmdchar; #endif +#ifdef FEAT_CONCEAL + int cursor_line_was_concealed; +#endif - /* Remember whether editing was restarted after CTRL-O. */ + // Remember whether editing was restarted after CTRL-O. did_restart_edit = restart_edit; - /* sleep before redrawing, needed for "CTRL-O :" that results in an - * error message */ + // sleep before redrawing, needed for "CTRL-O :" that results in an + // error message check_for_delay(TRUE); - /* set Insstart_orig to Insstart */ + // set Insstart_orig to Insstart update_Insstart_orig = TRUE; #ifdef HAVE_SANDBOX - /* Don't allow inserting in the sandbox. */ + // Don't allow inserting in the sandbox. if (sandbox != 0) { - emsg(_(e_sandbox)); + emsg(_(e_not_allowed_in_sandbox)); return FALSE; } #endif - /* Don't allow changes in the buffer while editing the cmdline. The - * caller of getcmdline() may get confused. */ - if (textlock != 0) + // Don't allow changes in the buffer while editing the cmdline. The + // caller of getcmdline() may get confused. + // Don't allow recursive insert mode when busy with completion. + if (textlock != 0 || ins_compl_active() || compl_busy || pum_visible()) { - emsg(_(e_secure)); + emsg(_(e_not_allowed_to_change_text_or_change_window)); return FALSE; } - - /* Don't allow recursive insert mode when busy with completion. */ - if (ins_compl_active() || compl_busy || pum_visible()) - { - emsg(_(e_secure)); - return FALSE; - } - ins_compl_clear(); /* clear stuff for CTRL-X mode */ + ins_compl_clear(); // clear stuff for CTRL-X mode /* * Trigger InsertEnter autocommands. Do not do this for "r" or "grx". @@ -208,16 +195,20 @@ edit( else ptr = (char_u *)"i"; set_vim_var_string(VV_INSERTMODE, ptr, 1); - set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */ + set_vim_var_string(VV_CHAR, NULL, -1); // clear v:char #endif ins_apply_autocmds(EVENT_INSERTENTER); - /* Make sure the cursor didn't move. Do call check_cursor_col() in - * case the text was modified. Since Insert mode was not started yet - * a call to check_cursor_col() may move the cursor, especially with - * the "A" command, thus set State to avoid that. Also check that the - * line number is still valid (lines may have been deleted). - * Do not restore if v:char was set to a non-empty string. */ + // Check for changed highlighting, e.g. for ModeMsg. + if (need_highlight_changed) + highlight_changed(); + + // Make sure the cursor didn't move. Do call check_cursor_col() in + // case the text was modified. Since Insert mode was not started yet + // a call to check_cursor_col() may move the cursor, especially with + // the "A" command, thus set State to avoid that. Also check that the + // line number is still valid (lines may have been deleted). + // Do not restore if v:char was set to a non-empty string. if (!EQUAL_POS(curwin->w_cursor, save_cursor) #ifdef FEAT_EVAL && *get_vim_var_str(VV_CHAR) == NUL @@ -227,16 +218,16 @@ edit( int save_state = State; curwin->w_cursor = save_cursor; - State = INSERT; + State = MODE_INSERT; check_cursor_col(); State = save_state; } } #ifdef FEAT_CONCEAL - /* Check if the cursor line needs redrawing before changing State. If - * 'concealcursor' is "n" it needs to be redrawn without concealing. */ - conceal_check_cursor_line(); + // Check if the cursor line was concealed before changing State. + cursor_line_was_concealed = curwin->w_p_cole > 0 + && conceal_cursor_line(curwin); #endif /* @@ -262,7 +253,7 @@ edit( AppendNumberToRedobuff(count); if (cmdchar == 'V' || cmdchar == 'v') { - /* "gR" or "gr" command */ + // "gR" or "gr" command AppendCharToRedobuff('g'); AppendCharToRedobuff((cmdchar == 'v') ? 'r' : 'R'); } @@ -272,34 +263,39 @@ edit( AppendCharToRedobuff('a'); else AppendCharToRedobuff(cmdchar); - if (cmdchar == 'g') /* "gI" command */ + if (cmdchar == 'g') // "gI" command AppendCharToRedobuff('I'); - else if (cmdchar == 'r') /* "r" command */ - count = 1; /* insert only one */ + else if (cmdchar == 'r') // "r" command + count = 1; // insert only one } } if (cmdchar == 'R') { - State = REPLACE; + State = MODE_REPLACE; } else if (cmdchar == 'V' || cmdchar == 'v') { - State = VREPLACE; - replaceState = VREPLACE; + State = MODE_VREPLACE; + replaceState = MODE_VREPLACE; orig_line_count = curbuf->b_ml.ml_line_count; vr_lines_changed = 1; } else - State = INSERT; + State = MODE_INSERT; + may_trigger_modechanged(); stop_insert_mode = FALSE; - /* - * Need to recompute the cursor position, it might move when the cursor is - * on a TAB or special character. - */ - curs_columns(TRUE); +#ifdef FEAT_CONCEAL + // Check if the cursor line needs redrawing after changing State. If + // 'concealcursor' is "n" it needs to be redrawn without concealing. + conceal_check_cursor_line(cursor_line_was_concealed); +#endif + + // need to position cursor again when on a TAB + if (gchar_cursor() == TAB) + curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL); /* * Enable langmap or IME, indicated by 'iminsert'. @@ -308,7 +304,7 @@ edit( * when hitting . */ if (curbuf->b_p_iminsert == B_IMODE_LMAP) - State |= LANGMAP; + State |= MODE_LANGMAP; #ifdef HAVE_INPUT_METHOD im_set_active(curbuf->b_p_iminsert == B_IMODE_IM); #endif @@ -318,8 +314,8 @@ edit( clear_showcmd(); #endif #ifdef FEAT_RIGHTLEFT - /* there is no reverse replace mode */ - revins_on = (State == INSERT && p_ri); + // there is no reverse replace mode + revins_on = (State == MODE_INSERT && p_ri); if (revins_on) undisplay_dollar(); revins_chars = 0; @@ -327,10 +323,18 @@ edit( revins_scol = -1; #endif if (!p_ek) - /* Disable bracketed paste mode, we won't recognize the escape - * sequences. */ + { + MAY_WANT_TO_LOG_THIS; + + // Disable bracketed paste mode, we won't recognize the escape + // sequences. out_str(T_BD); + // Disable modifyOtherKeys, keys with modifiers would cause exiting + // Insert mode. + out_str(T_CTE); + } + /* * Handle restarting Insert mode. * Don't do this for "CTRL-O ." (repeat an insert): In that case we get @@ -375,19 +379,17 @@ edit( else arrow_used = FALSE; - /* we are in insert mode now, don't need to start it anymore */ + // we are in insert mode now, don't need to start it anymore need_start_insertmode = FALSE; - /* Need to save the line for undo before inserting the first char. */ + // Need to save the line for undo before inserting the first char. ins_need_undo = TRUE; where_paste_started.lnum = 0; -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif #ifdef FEAT_FOLDING - /* The cursor line is not in a closed fold, unless 'insertmode' is set or - * restarting. */ + // The cursor line is not in a closed fold, unless 'insertmode' is set or + // restarting. if (!p_im && did_restart_edit == 0) foldOpenCursor(); #endif @@ -405,10 +407,10 @@ edit( change_warning(i == 0 ? 0 : i + 1); #ifdef CURSOR_SHAPE - ui_cursor_shape(); /* may show different cursor shape */ + ui_cursor_shape(); // may show different cursor shape #endif #ifdef FEAT_DIGRAPHS - do_digraph(-1); /* clear digraphs */ + do_digraph(-1); // clear digraphs #endif /* @@ -433,29 +435,29 @@ edit( { #ifdef FEAT_RIGHTLEFT if (!revins_legal) - revins_scol = -1; /* reset on illegal motions */ + revins_scol = -1; // reset on illegal motions else revins_legal = 0; #endif - if (arrow_used) /* don't repeat insert when arrow key used */ + if (arrow_used) // don't repeat insert when arrow key used count = 0; if (update_Insstart_orig) Insstart_orig = Insstart; - if (stop_insert_mode && !pum_visible()) + if (stop_insert_mode && !ins_compl_active()) { - /* ":stopinsert" used or 'insertmode' reset */ + // ":stopinsert" used or 'insertmode' reset count = 0; goto doESCkey; } - /* set curwin->w_curswant for next K_DOWN or K_UP */ + // set curwin->w_curswant for next K_DOWN or K_UP if (!arrow_used) curwin->w_set_curswant = TRUE; - /* If there is no typeahead may check for timestamps (e.g., for when a - * menu invoked a shell command). */ + // If there is no typeahead may check for timestamps (e.g., for when a + // menu invoked a shell command). if (stuff_empty()) { did_check_timestamps = FALSE; @@ -469,18 +471,18 @@ edit( msg_scroll = FALSE; #ifdef FEAT_GUI - /* When 'mousefocus' is set a mouse movement may have taken us to - * another window. "need_mouse_correct" may then be set because of an - * autocommand. */ + // When 'mousefocus' is set a mouse movement may have taken us to + // another window. "need_mouse_correct" may then be set because of an + // autocommand. if (need_mouse_correct) gui_mouse_correct(); #endif #ifdef FEAT_FOLDING - /* Open fold at the cursor line, according to 'foldopen'. */ + // Open fold at the cursor line, according to 'foldopen'. if (fdo_flags & FDO_INSERT) foldOpenCursor(); - /* Close folds where the cursor isn't, according to 'foldclose' */ + // Close folds where the cursor isn't, according to 'foldclose' if (!char_avail()) foldCheckClose(); #endif @@ -516,7 +518,7 @@ edit( if ( #ifdef FEAT_VARTABS - (int)curwin->w_wcol < mincol - tabstop_at( + curwin->w_wcol < mincol - tabstop_at( get_nolist_virtcol(), curbuf->b_p_ts, curbuf->b_p_vts_array) #else @@ -544,12 +546,12 @@ edit( } } - /* May need to adjust w_topline to show the cursor. */ + // May need to adjust w_topline to show the cursor. update_topline(); did_backspace = FALSE; - validate_cursor(); /* may set must_redraw */ + validate_cursor(); // may set must_redraw /* * Redraw the display when no characters are waiting. @@ -569,45 +571,58 @@ edit( #endif #ifdef USE_ON_FLY_SCROLL - dont_scroll = FALSE; /* allow scrolling here */ + dont_scroll = FALSE; // allow scrolling here #endif /* * Get a character for Insert mode. Ignore K_IGNORE and K_NOP. */ if (c != K_CURSORHOLD) - lastc = c; /* remember the previous char for CTRL-D */ + lastc = c; // remember the previous char for CTRL-D - /* After using CTRL-G U the next cursor key will not break undo. */ + // After using CTRL-G U the next cursor key will not break undo. if (dont_sync_undo == MAYBE) dont_sync_undo = TRUE; else dont_sync_undo = FALSE; if (cmdchar == K_PS) - /* Got here from normal mode when bracketed paste started. */ + // Got here from normal mode when bracketed paste started. c = K_PS; else do { c = safe_vgetc(); - if (stop_insert_mode) + if (stop_insert_mode +#ifdef FEAT_TERMINAL + || (c == K_IGNORE && term_use_loop()) +#endif + ) { - // Insert mode ended, possibly from a callback. + // Insert mode ended, possibly from a callback, or a timer + // must have opened a terminal window. + if (c != K_IGNORE && c != K_NOP) + vungetc(c); count = 0; nomove = TRUE; + ins_compl_prep(ESC); goto doESCkey; } } while (c == K_IGNORE || c == K_NOP); - /* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */ + // Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. did_cursorhold = TRUE; #ifdef FEAT_RIGHTLEFT if (p_hkmap && KeyTyped) - c = hkmap(c); /* Hebrew mode mapping */ + c = hkmap(c); // Hebrew mode mapping #endif + // If the window was made so small that nothing shows, make it at least + // one line and one column when typing. + if (KeyTyped && !KeyStuffed) + win_ensure_size(); + /* * Special handling of keys while the popup menu is visible or wanted * and the cursor is still in the completed word. Only when there is @@ -618,18 +633,18 @@ edit( && curwin->w_cursor.col >= ins_compl_col() && ins_compl_has_shown_match()) { - /* BS: Delete one character from "compl_leader". */ + // BS: Delete one character from "compl_leader". if ((c == K_BS || c == Ctrl_H) && curwin->w_cursor.col > ins_compl_col() && (c = ins_compl_bs()) == NUL) continue; - /* When no match was selected or it was edited. */ + // When no match was selected or it was edited. if (!ins_compl_used_match()) { - /* CTRL-L: Add one character from the current match to - * "compl_leader". Except when at the original match and - * there is nothing to add, CTRL-L works like CTRL-P then. */ + // CTRL-L: Add one character from the current match to + // "compl_leader". Except when at the original match and + // there is nothing to add, CTRL-L works like CTRL-P then. if (c == Ctrl_L && (!ctrl_x_mode_line_or_eval() || ins_compl_long_shown_match())) @@ -638,12 +653,12 @@ edit( continue; } - /* A non-white character that fits in with the current - * completion: Add to "compl_leader". */ + // A non-white character that fits in with the current + // completion: Add to "compl_leader". if (ins_compl_accept_char(c)) { #if defined(FEAT_EVAL) - /* Trigger InsertCharPre. */ + // Trigger InsertCharPre. char_u *str = do_insert_char_pre(c); char_u *p; @@ -659,9 +674,9 @@ edit( continue; } - /* Pressing CTRL-Y selects the current match. When - * ins_compl_enter_selects() is set the Enter key does the - * same. */ + // Pressing CTRL-Y selects the current match. When + // ins_compl_enter_selects() is set the Enter key does the + // same. if ((c == Ctrl_Y || (ins_compl_enter_selects() && (c == CAR || c == K_KENTER || c == NL))) && stop_arrow() == OK) @@ -672,18 +687,18 @@ edit( } } - /* Prepare for or stop CTRL-X mode. This doesn't do completion, but - * it does fix up the text when finishing completion. */ + // Prepare for or stop CTRL-X mode. This doesn't do completion, but + // it does fix up the text when finishing completion. ins_compl_init_get_longest(); if (ins_compl_prep(c)) continue; - /* CTRL-\ CTRL-N goes to Normal mode, - * CTRL-\ CTRL-G goes to mode selected with 'insertmode', - * CTRL-\ CTRL-O is like CTRL-O but without moving the cursor. */ + // CTRL-\ CTRL-N goes to Normal mode, + // CTRL-\ CTRL-G goes to mode selected with 'insertmode', + // CTRL-\ CTRL-O is like CTRL-O but without moving the cursor. if (c == Ctrl_BSL) { - /* may need to redraw when no more chars available now */ + // may need to redraw when no more chars available now ins_redraw(FALSE); ++no_mapping; ++allow_keys; @@ -692,7 +707,7 @@ edit( --allow_keys; if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O) { - /* it's something else */ + // it's something else vungetc(c); c = Ctrl_BSL; } @@ -703,7 +718,7 @@ edit( if (c == Ctrl_O) { ins_ctrl_o(); - ins_at_eol = FALSE; /* cursor keeps its column */ + ins_at_eol = FALSE; // cursor keeps its column nomove = TRUE; } count = 0; @@ -720,17 +735,16 @@ edit( if (c == Ctrl_V || c == Ctrl_Q) { ins_ctrl_v(); - c = Ctrl_V; /* pretend CTRL-V is last typed character */ + c = Ctrl_V; // pretend CTRL-V is last typed character continue; } -#ifdef FEAT_CINDENT if (cindent_on() && ctrl_x_mode_none()) { - /* A key name preceded by a bang means this key is not to be - * inserted. Skip ahead to the re-indenting below. - * A key name preceded by a star means that indenting has to be - * done before inserting the key. */ + // A key name preceded by a bang means this key is not to be + // inserted. Skip ahead to the re-indenting below. + // A key name preceded by a star means that indenting has to be + // done before inserting the key. line_is_white = inindent(0); if (in_cinkeys(c, '!', line_is_white)) goto force_cindent; @@ -738,7 +752,6 @@ edit( && stop_arrow() == OK) do_c_expr_indent(); } -#endif #ifdef FEAT_RIGHTLEFT if (curwin->w_p_rl) @@ -766,18 +779,18 @@ edit( */ switch (c) { - case ESC: /* End input mode */ + case ESC: // End input mode if (echeck_abbr(ESC + ABBR_OFF)) break; - /* FALLTHROUGH */ + // FALLTHROUGH - case Ctrl_C: /* End input mode */ + case Ctrl_C: // End input mode #ifdef FEAT_CMDWIN if (c == Ctrl_C && cmdwin_type != 0) { - /* Close the cmdline window. */ + // Close the cmdline window. cmdwin_result = K_IGNORE; - got_int = FALSE; /* don't stop executing autocommands et al. */ + got_int = FALSE; // don't stop executing autocommands et al. nomove = TRUE; goto doESCkey; } @@ -799,13 +812,13 @@ edit( #ifdef UNIX do_intr: #endif - /* when 'insertmode' set, and not halfway a mapping, don't leave - * Insert mode */ + // when 'insertmode' set, and not halfway a mapping, don't leave + // Insert mode if (goto_im()) { if (got_int) { - (void)vgetc(); /* flush all buffers */ + (void)vgetc(); // flush all buffers got_int = FALSE; } else @@ -816,8 +829,8 @@ edit( /* * This is the ONLY return from edit()! */ - /* Always update o_lnum, so that a "CTRL-O ." that adds a line - * still puts the cursor back after the inserted text. */ + // Always update o_lnum, so that a "CTRL-O ." that adds a line + // still puts the cursor back after the inserted text. if (ins_at_eol && gchar_cursor() == NUL) o_lnum = curwin->w_cursor.lnum; @@ -833,16 +846,16 @@ edit( } continue; - case Ctrl_Z: /* suspend when 'insertmode' set */ + case Ctrl_Z: // suspend when 'insertmode' set if (!p_im) - goto normalchar; /* insert CTRL-Z as normal char */ + goto normalchar; // insert CTRL-Z as normal char do_cmdline_cmd((char_u *)"stop"); #ifdef CURSOR_SHAPE - ui_cursor_shape(); /* may need to update cursor shape */ + ui_cursor_shape(); // may need to update cursor shape #endif continue; - case Ctrl_O: /* execute one command */ + case Ctrl_O: // execute one command #ifdef FEAT_COMPL_FUNC if (ctrl_x_mode_omni()) goto docomplete; @@ -851,8 +864,8 @@ edit( break; ins_ctrl_o(); - /* don't move the cursor left when 'virtualedit' has "onemore". */ - if (ve_flags & VE_ONEMORE) + // don't move the cursor left when 'virtualedit' has "onemore". + if (get_ve_flags() & VE_ONEMORE) { ins_at_eol = FALSE; nomove = TRUE; @@ -860,15 +873,15 @@ edit( count = 0; goto doESCkey; - case K_INS: /* toggle insert/replace mode */ + case K_INS: // toggle insert/replace mode case K_KINS: ins_insert(replaceState); break; - case K_SELECT: /* end of Select mode mapping - ignore */ + case K_SELECT: // end of Select mode mapping - ignore break; - case K_HELP: /* Help key works like */ + case K_HELP: // Help key works like case K_F1: case K_XF1: stuffcharReadbuff(K_HELP); @@ -877,55 +890,55 @@ edit( goto doESCkey; #ifdef FEAT_NETBEANS_INTG - case K_F21: /* NetBeans command */ - ++no_mapping; /* don't map the next key hits */ + case K_F21: // NetBeans command + ++no_mapping; // don't map the next key hits i = plain_vgetc(); --no_mapping; netbeans_keycommand(i); break; #endif - case K_ZERO: /* Insert the previously inserted text. */ + case K_ZERO: // Insert the previously inserted text. case NUL: case Ctrl_A: - /* For ^@ the trailing ESC will end the insert, unless there is an - * error. */ + // For ^@ the trailing ESC will end the insert, unless there is an + // error. if (stuff_inserted(NUL, 1L, (c == Ctrl_A)) == FAIL && c != Ctrl_A && !p_im) - goto doESCkey; /* quit insert mode */ + goto doESCkey; // quit insert mode inserted_space = FALSE; break; - case Ctrl_R: /* insert the contents of a register */ + case Ctrl_R: // insert the contents of a register ins_reg(); auto_format(FALSE, TRUE); inserted_space = FALSE; break; - case Ctrl_G: /* commands starting with CTRL-G */ + case Ctrl_G: // commands starting with CTRL-G ins_ctrl_g(); break; - case Ctrl_HAT: /* switch input mode and/or langmap */ + case Ctrl_HAT: // switch input mode and/or langmap ins_ctrl_hat(); break; #ifdef FEAT_RIGHTLEFT - case Ctrl__: /* switch between languages */ + case Ctrl__: // switch between languages if (!p_ari) goto normalchar; ins_ctrl_(); break; #endif - case Ctrl_D: /* Make indent one shiftwidth smaller. */ + case Ctrl_D: // Make indent one shiftwidth smaller. #if defined(FEAT_FIND_ID) if (ctrl_x_mode_path_defines()) goto docomplete; #endif - /* FALLTHROUGH */ + // FALLTHROUGH - case Ctrl_T: /* Make indent one shiftwidth greater. */ + case Ctrl_T: // Make indent one shiftwidth greater. if (c == Ctrl_T && ctrl_x_mode_thesaurus()) { if (has_compl_option(FALSE)) @@ -938,19 +951,20 @@ edit( inserted_space = FALSE; break; - case K_DEL: /* delete character under the cursor */ + case K_DEL: // delete character under the cursor case K_KDEL: ins_del(); auto_format(FALSE, TRUE); break; - case K_BS: /* delete character before the cursor */ + case K_BS: // delete character before the cursor + case K_S_BS: case Ctrl_H: did_backspace = ins_bs(c, BACKSPACE_CHAR, &inserted_space); auto_format(FALSE, TRUE); break; - case Ctrl_W: /* delete word before the cursor */ + case Ctrl_W: // delete word before the cursor #ifdef FEAT_JOB_CHANNEL if (bt_prompt(curbuf) && (mod_mask & MOD_MASK_SHIFT) == 0) { @@ -967,9 +981,9 @@ edit( auto_format(FALSE, TRUE); break; - case Ctrl_U: /* delete all inserted text in current line */ + case Ctrl_U: // delete all inserted text in current line # ifdef FEAT_COMPL_FUNC - /* CTRL-X CTRL-U completes with 'completefunc'. */ + // CTRL-X CTRL-U completes with 'completefunc'. if (ctrl_x_mode_function()) goto docomplete; # endif @@ -978,7 +992,7 @@ edit( inserted_space = FALSE; break; - case K_LEFTMOUSE: /* mouse keys */ + case K_LEFTMOUSE: // mouse keys case K_LEFTMOUSE_NM: case K_LEFTDRAG: case K_LEFTRELEASE: @@ -999,30 +1013,30 @@ edit( ins_mouse(c); break; - case K_MOUSEDOWN: /* Default action for scroll wheel up: scroll up */ + case K_MOUSEDOWN: // Default action for scroll wheel up: scroll up ins_mousescroll(MSCR_DOWN); break; - case K_MOUSEUP: /* Default action for scroll wheel down: scroll down */ + case K_MOUSEUP: // Default action for scroll wheel down: scroll down ins_mousescroll(MSCR_UP); break; - case K_MOUSELEFT: /* Scroll wheel left */ + case K_MOUSELEFT: // Scroll wheel left ins_mousescroll(MSCR_LEFT); break; - case K_MOUSERIGHT: /* Scroll wheel right */ + case K_MOUSERIGHT: // Scroll wheel right ins_mousescroll(MSCR_RIGHT); break; case K_PS: bracketed_paste(PASTE_INSERT, FALSE, NULL); if (cmdchar == K_PS) - /* invoked from normal mode, bail out */ + // invoked from normal mode, bail out goto doESCkey; break; case K_PE: - /* Got K_PE without K_PS, ignore. */ + // Got K_PE without K_PS, ignore. break; #ifdef FEAT_GUI_TABLINE @@ -1032,17 +1046,30 @@ edit( break; #endif - case K_IGNORE: /* Something mapped to nothing */ + case K_IGNORE: // Something mapped to nothing + break; + + case K_COMMAND: // command + case K_SCRIPT_COMMAND: // command + do_cmdkey_command(c, 0); +#ifdef FEAT_TERMINAL + if (term_use_loop()) + // Started a terminal that gets the input, exit Insert mode. + goto doESCkey; +#endif break; - case K_CURSORHOLD: /* Didn't type something for a while. */ + case K_CURSORHOLD: // Didn't type something for a while. ins_apply_autocmds(EVENT_CURSORHOLDI); did_cursorhold = TRUE; + // If CTRL-G U was used apply it to the next typed key. + if (dont_sync_undo == TRUE) + dont_sync_undo = MAYBE; break; #ifdef FEAT_GUI_MSWIN - /* On MS-Windows ignore , we get it when closing the window - * was cancelled. */ + // On MS-Windows ignore , we get it when closing the window + // was cancelled. case K_F4: if (mod_mask != MOD_MASK_ALT) goto normalchar; @@ -1059,45 +1086,45 @@ edit( break; #endif - case K_HOME: /* */ + case K_HOME: // case K_KHOME: case K_S_HOME: case K_C_HOME: ins_home(c); break; - case K_END: /* */ + case K_END: // case K_KEND: case K_S_END: case K_C_END: ins_end(c); break; - case K_LEFT: /* */ + case K_LEFT: // if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)) ins_s_left(); else ins_left(); break; - case K_S_LEFT: /* */ + case K_S_LEFT: // case K_C_LEFT: ins_s_left(); break; - case K_RIGHT: /* */ + case K_RIGHT: // if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)) ins_s_right(); else ins_right(); break; - case K_S_RIGHT: /* */ + case K_S_RIGHT: // case K_C_RIGHT: ins_s_right(); break; - case K_UP: /* */ + case K_UP: // if (pum_visible()) goto docomplete; if (mod_mask & MOD_MASK_SHIFT) @@ -1106,7 +1133,7 @@ edit( ins_up(FALSE); break; - case K_S_UP: /* */ + case K_S_UP: // case K_PAGEUP: case K_KPAGEUP: if (pum_visible()) @@ -1114,7 +1141,7 @@ edit( ins_pageup(); break; - case K_DOWN: /* */ + case K_DOWN: // if (pum_visible()) goto docomplete; if (mod_mask & MOD_MASK_SHIFT) @@ -1123,7 +1150,7 @@ edit( ins_down(FALSE); break; - case K_S_DOWN: /* */ + case K_S_DOWN: // case K_PAGEDOWN: case K_KPAGEDOWN: if (pum_visible()) @@ -1132,39 +1159,39 @@ edit( break; #ifdef FEAT_DND - case K_DROP: /* drag-n-drop event */ + case K_DROP: // drag-n-drop event ins_drop(); break; #endif - case K_S_TAB: /* When not mapped, use like a normal TAB */ + case K_S_TAB: // When not mapped, use like a normal TAB c = TAB; - /* FALLTHROUGH */ + // FALLTHROUGH - case TAB: /* TAB or Complete patterns along path */ + case TAB: // TAB or Complete patterns along path #if defined(FEAT_FIND_ID) if (ctrl_x_mode_path_patterns()) goto docomplete; #endif inserted_space = FALSE; if (ins_tab()) - goto normalchar; /* insert TAB as a normal char */ + goto normalchar; // insert TAB as a normal char auto_format(FALSE, TRUE); break; - case K_KENTER: /* */ + case K_KENTER: // c = CAR; - /* FALLTHROUGH */ + // FALLTHROUGH case CAR: case NL: #if defined(FEAT_QUICKFIX) - /* In a quickfix window a jumps to the error under the - * cursor. */ + // In a quickfix window a jumps to the error under the + // cursor. if (bt_quickfix(curbuf) && c == CAR) { - if (curwin->w_llist_ref == NULL) /* quickfix window */ + if (curwin->w_llist_ref == NULL) // quickfix window do_cmdline_cmd((char_u *)".cc"); - else /* location list window */ + else // location list window do_cmdline_cmd((char_u *)".ll"); break; } @@ -1172,7 +1199,7 @@ edit( #ifdef FEAT_CMDWIN if (cmdwin_type != 0) { - /* Execute the command in the cmdline window. */ + // Execute the command in the cmdline window. cmdwin_result = CAR; goto doESCkey; } @@ -1189,12 +1216,12 @@ edit( } #endif if (ins_eol(c) == FAIL && !p_im) - goto doESCkey; /* out of memory */ + goto doESCkey; // out of memory auto_format(FALSE, FALSE); inserted_space = FALSE; break; - case Ctrl_K: /* digraph or keyword completion */ + case Ctrl_K: // digraph or keyword completion if (ctrl_x_mode_dictionary()) { if (has_compl_option(TRUE)) @@ -1208,30 +1235,30 @@ edit( #endif goto normalchar; - case Ctrl_X: /* Enter CTRL-X mode */ + case Ctrl_X: // Enter CTRL-X mode ins_ctrl_x(); break; - case Ctrl_RSB: /* Tag name completion after ^X */ + case Ctrl_RSB: // Tag name completion after ^X if (!ctrl_x_mode_tags()) goto normalchar; goto docomplete; - case Ctrl_F: /* File name completion after ^X */ + case Ctrl_F: // File name completion after ^X if (!ctrl_x_mode_files()) goto normalchar; goto docomplete; - case 's': /* Spelling completion after ^X */ + case 's': // Spelling completion after ^X case Ctrl_S: if (!ctrl_x_mode_spell()) goto normalchar; goto docomplete; - case Ctrl_L: /* Whole line completion after ^X */ + case Ctrl_L: // Whole line completion after ^X if (!ctrl_x_mode_whole_line()) { - /* CTRL-L with 'insertmode' set: Leave Insert mode */ + // CTRL-L with 'insertmode' set: Leave Insert mode if (p_im) { if (echeck_abbr(Ctrl_L + ABBR_OFF)) @@ -1240,38 +1267,39 @@ edit( } goto normalchar; } - /* FALLTHROUGH */ + // FALLTHROUGH - case Ctrl_P: /* Do previous/next pattern completion */ + case Ctrl_P: // Do previous/next pattern completion case Ctrl_N: - /* if 'complete' is empty then plain ^P is no longer special, - * but it is under other ^X modes */ + // if 'complete' is empty then plain ^P is no longer special, + // but it is under other ^X modes if (*curbuf->b_p_cpt == NUL && (ctrl_x_mode_normal() || ctrl_x_mode_whole_line()) - && !(compl_cont_status & CONT_LOCAL)) + && !compl_status_local()) goto normalchar; docomplete: compl_busy = TRUE; #ifdef FEAT_FOLDING - disable_fold_update++; /* don't redraw folds here */ + disable_fold_update++; // don't redraw folds here #endif if (ins_complete(c, TRUE) == FAIL) - compl_cont_status = 0; + compl_status_clear(); #ifdef FEAT_FOLDING disable_fold_update--; #endif compl_busy = FALSE; + can_si = may_do_si(); // allow smartindenting break; - case Ctrl_Y: /* copy from previous line or scroll down */ - case Ctrl_E: /* copy from next line or scroll up */ + case Ctrl_Y: // copy from previous line or scroll down + case Ctrl_E: // copy from next line or scroll up c = ins_ctrl_ey(c); break; default: #ifdef UNIX - if (c == intr_char) /* special interrupt char */ + if (c == intr_char) // special interrupt char goto do_intr; #endif @@ -1282,7 +1310,7 @@ edit( #if defined(FEAT_EVAL) if (!p_paste) { - /* Trigger InsertCharPre. */ + // Trigger InsertCharPre. char_u *str = do_insert_char_pre(c); char_u *p; @@ -1290,7 +1318,7 @@ edit( { if (*str != NUL && stop_arrow() != FAIL) { - /* Insert the new value of v:char literally. */ + // Insert the new value of v:char literally. for (p = str; *p != NUL; MB_PTR_ADV(p)) { c = PTR2CHAR(p); @@ -1305,32 +1333,28 @@ edit( c = NUL; } - /* If the new value is already inserted or an empty string - * then don't insert any character. */ + // If the new value is already inserted or an empty string + // then don't insert any character. if (c == NUL) break; } #endif -#ifdef FEAT_SMARTINDENT - /* Try to perform smart-indenting. */ + // Try to perform smart-indenting. ins_try_si(c); -#endif if (c == ' ') { inserted_space = TRUE; -#ifdef FEAT_CINDENT if (inindent(0)) can_cindent = FALSE; -#endif if (Insstart_blank_vcol == MAXCOL && curwin->w_cursor.lnum == Insstart.lnum) Insstart_blank_vcol = get_nolist_virtcol(); } - /* Insert a normal character and check for abbreviations on a - * special character. Let CTRL-] expand abbreviations without - * inserting it. */ + // Insert a normal character and check for abbreviations on a + // special character. Let CTRL-] expand abbreviations without + // inserting it. if (vim_iswordc(c) || (!echeck_abbr( // Add ABBR_OFF for characters above 0x100, this is // what check_abbr() expects. @@ -1347,27 +1371,26 @@ edit( auto_format(FALSE, TRUE); #ifdef FEAT_FOLDING - /* When inserting a character the cursor line must never be in a - * closed fold. */ + // When inserting a character the cursor line must never be in a + // closed fold. foldOpenCursor(); #endif break; - } /* end of switch (c) */ + } // end of switch (c) - /* If typed something may trigger CursorHoldI again. */ + // If typed something may trigger CursorHoldI again. if (c != K_CURSORHOLD #ifdef FEAT_COMPL_FUNC - /* but not in CTRL-X mode, a script can't restore the state */ + // but not in CTRL-X mode, a script can't restore the state && ctrl_x_mode_normal() #endif ) did_cursorhold = FALSE; - /* If the cursor was moved we didn't just insert a space */ + // If the cursor was moved we didn't just insert a space if (arrow_used) inserted_space = FALSE; -#ifdef FEAT_CINDENT if (can_cindent && cindent_on() && ctrl_x_mode_normal()) { force_cindent: @@ -1377,14 +1400,13 @@ edit( if (in_cinkeys(c, ' ', line_is_white)) { if (stop_arrow() == OK) - /* re-indent the current line */ + // re-indent the current line do_c_expr_indent(); } } -#endif /* FEAT_CINDENT */ - } /* for (;;) */ - /* NOTREACHED */ + } // for (;;) + // NOTREACHED } int @@ -1412,10 +1434,10 @@ ins_redraw(int ready) // not busy with something if (char_avail()) return; - /* Trigger CursorMoved if the cursor moved. Not when the popup menu is - * visible, the command might delete it. */ + // Trigger CursorMoved if the cursor moved. Not when the popup menu is + // visible, the command might delete it. if (ready && (has_cursormovedI() -# ifdef FEAT_TEXT_PROP +# ifdef FEAT_PROP_POPUP || popup_visible # endif # if defined(FEAT_CONCEAL) @@ -1426,21 +1448,21 @@ ins_redraw(int ready) // not busy with something && !pum_visible()) { # ifdef FEAT_SYN_HL - /* Need to update the screen first, to make sure syntax - * highlighting is correct after making a change (e.g., inserting - * a "(". The autocommand may also require a redraw, so it's done - * again below, unfortunately. */ + // Need to update the screen first, to make sure syntax + // highlighting is correct after making a change (e.g., inserting + // a "(". The autocommand may also require a redraw, so it's done + // again below, unfortunately. if (syntax_present(curwin) && must_redraw) update_screen(0); # endif if (has_cursormovedI()) { - /* Make sure curswant is correct, an autocommand may call - * getcurpos(). */ + // Make sure curswant is correct, an autocommand may call + // getcurpos(). update_curswant(); ins_apply_autocmds(EVENT_CURSORMOVEDI); } -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP if (popup_visible) popup_check_cursor_pos(); #endif @@ -1455,9 +1477,9 @@ ins_redraw(int ready) // not busy with something last_cursormoved = curwin->w_cursor; } - /* Trigger TextChangedI if b_changedtick differs. */ + // Trigger TextChangedI if b_changedtick_i differs. if (ready && has_textchangedI() - && curbuf->b_last_changedtick != CHANGEDTICK(curbuf) + && curbuf->b_last_changedtick_i != CHANGEDTICK(curbuf) && !pum_visible()) { aco_save_T aco; @@ -1467,15 +1489,15 @@ ins_redraw(int ready) // not busy with something aucmd_prepbuf(&aco, curbuf); apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf); aucmd_restbuf(&aco); - curbuf->b_last_changedtick = CHANGEDTICK(curbuf); + curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf); if (tick != CHANGEDTICK(curbuf)) // see ins_apply_autocmds() u_save(curwin->w_cursor.lnum, (linenr_T)(curwin->w_cursor.lnum + 1)); } - /* Trigger TextChangedP if b_changedtick differs. When the popupmenu closes - * TextChangedI will need to trigger for backwards compatibility, thus use - * different b_last_changedtick* variables. */ + // Trigger TextChangedP if b_changedtick_pum differs. When the popupmenu + // closes TextChangedI will need to trigger for backwards compatibility, + // thus use different b_last_changedtick* variables. if (ready && has_textchangedP() && curbuf->b_last_changedtick_pum != CHANGEDTICK(curbuf) && pum_visible()) @@ -1493,6 +1515,9 @@ ins_redraw(int ready) // not busy with something (linenr_T)(curwin->w_cursor.lnum + 1)); } + if (ready) + may_trigger_winscrolled(); + // Trigger SafeState if nothing is pending. may_trigger_safestate(ready && !ins_compl_active() @@ -1515,10 +1540,10 @@ ins_redraw(int ready) // not busy with something if (must_redraw) update_screen(0); else if (clear_cmdline || redraw_cmdline) - showmode(); /* clear cmdline and show mode */ + showmode(); // clear cmdline and show mode showruler(FALSE); setcursor(); - emsg_on_display = FALSE; /* may remove error message now */ + emsg_on_display = FALSE; // may remove error message now } /* @@ -1530,7 +1555,7 @@ ins_ctrl_v(void) int c; int did_putchar = FALSE; - /* may need to redraw when no more chars available now */ + // may need to redraw when no more chars available now ins_redraw(FALSE); if (redrawing() && !char_avail()) @@ -1538,20 +1563,23 @@ ins_ctrl_v(void) edit_putchar('^', TRUE); did_putchar = TRUE; } - AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */ + AppendToRedobuff((char_u *)CTRL_V_STR); // CTRL-V #ifdef FEAT_CMDL_INFO add_to_showcmd_c(Ctrl_V); #endif - c = get_literal(); + // Do not change any modifyOtherKeys ESC sequence to a normal key for + // CTRL-SHIFT-V. + c = get_literal(mod_mask & MOD_MASK_SHIFT); if (did_putchar) - /* when the line fits in 'columns' the '^' is at the start of the next - * line and will not removed by the redraw */ + // when the line fits in 'columns' the '^' is at the start of the next + // line and will not removed by the redraw edit_unputchar(); #ifdef FEAT_CMDL_INFO clear_showcmd(); #endif + insert_special(c, FALSE, TRUE); #ifdef FEAT_RIGHTLEFT revins_chars++; @@ -1559,16 +1587,73 @@ ins_ctrl_v(void) #endif } +/* + * After getting an ESC or CSI for a literal key: If the typeahead buffer + * contains a modifyOtherKeys sequence then decode it and return the result. + * Otherwise return "c". + * Note that this doesn't wait for characters, they must be in the typeahead + * buffer already. + */ + static int +decodeModifyOtherKeys(int c) +{ + char_u *p = typebuf.tb_buf + typebuf.tb_off; + int idx; + int form = 0; + int argidx = 0; + int arg[2] = {0, 0}; + + // Recognize: + // form 0: {lead}{key};{modifier}u + // form 1: {lead}27;{modifier};{key}~ + if (typebuf.tb_len >= 4 && (c == CSI || (c == ESC && *p == '['))) + { + idx = (*p == '['); + if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';') + { + form = 1; + idx += 3; + } + while (idx < typebuf.tb_len && argidx < 2) + { + if (p[idx] == ';') + ++argidx; + else if (VIM_ISDIGIT(p[idx])) + arg[argidx] = arg[argidx] * 10 + (p[idx] - '0'); + else + break; + ++idx; + } + if (idx < typebuf.tb_len + && p[idx] == (form == 1 ? '~' : 'u') + && argidx == 1) + { + // Match, consume the code. + typebuf.tb_off += idx + 1; + typebuf.tb_len -= idx + 1; +#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) + if (typebuf.tb_len == 0) + typebuf_was_filled = FALSE; +#endif + + mod_mask = decode_modifiers(arg[!form]); + c = merge_modifyOtherKeys(arg[form], &mod_mask); + } + } + + return c; +} + /* * Put a character directly onto the screen. It's not stored in a buffer. * Used while handling CTRL-K, CTRL-V, etc. in Insert mode. */ static __thread int pc_status; -#define PC_STATUS_UNSET 0 /* pc_bytes was not set */ -#define PC_STATUS_RIGHT 1 /* right halve of double-wide char */ -#define PC_STATUS_LEFT 2 /* left halve of double-wide char */ -#define PC_STATUS_SET 3 /* pc_bytes was filled */ -static __thread char_u pc_bytes[MB_MAXBYTES + 1]; /* saved bytes */ +#define PC_STATUS_UNSET 0 // pc_bytes was not set +#define PC_STATUS_RIGHT 1 // right half of double-wide char +#define PC_STATUS_LEFT 2 // left half of double-wide char +#define PC_STATUS_SET 3 // pc_bytes was filled +static __thread char_u pc_bytes[MB_MAXBYTES + 1]; // saved bytes static __thread int pc_attr; static __thread int pc_row; static __thread int pc_col; @@ -1580,7 +1665,7 @@ edit_putchar(int c, int highlight) if (ScreenLines != NULL) { - update_topline(); /* just in case w_topline isn't valid */ + update_topline(); // just in case w_topline isn't valid validate_cursor(); if (highlight) attr = HL_ATTR(HLF_8); @@ -1613,7 +1698,7 @@ edit_putchar(int c, int highlight) pc_status = PC_STATUS_LEFT; } - /* save the character to be able to put it back */ + // save the character to be able to put it back if (pc_status == PC_STATUS_UNSET) { screen_getbytes(pc_row, pc_col, pc_bytes, &pc_attr); @@ -1625,68 +1710,17 @@ edit_putchar(int c, int highlight) #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* - * Return the effective prompt for the current buffer. - */ - char_u * -prompt_text(void) -{ - if (curbuf->b_prompt_text == NULL) - return (char_u *)"% "; - return curbuf->b_prompt_text; -} - -/* - * Prepare for prompt mode: Make sure the last line has the prompt text. - * Move the cursor to this line. - */ - static void -init_prompt(int cmdchar_todo) -{ - char_u *prompt = prompt_text(); - char_u *text; - - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - text = ml_get_curline(); - if (STRNCMP(text, prompt, STRLEN(prompt)) != 0) - { - // prompt is missing, insert it or append a line with it - if (*text == NUL) - ml_replace(curbuf->b_ml.ml_line_count, prompt, TRUE); - else - ml_append(curbuf->b_ml.ml_line_count, prompt, 0, FALSE); - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - coladvance((colnr_T)MAXCOL); - changed_bytes(curbuf->b_ml.ml_line_count, 0); - } - - // Insert always starts after the prompt, allow editing text after it. - if (Insstart_orig.lnum != curwin->w_cursor.lnum - || Insstart_orig.col != (int)STRLEN(prompt)) - { - Insstart.lnum = curwin->w_cursor.lnum; - Insstart.col = (int)STRLEN(prompt); - Insstart_orig = Insstart; - Insstart_textlen = Insstart.col; - Insstart_blank_vcol = MAXCOL; - arrow_used = FALSE; - } - - if (cmdchar_todo == 'A') - coladvance((colnr_T)MAXCOL); - if (cmdchar_todo == 'I' || curwin->w_cursor.col <= (int)STRLEN(prompt)) - curwin->w_cursor.col = (int)STRLEN(prompt); - /* Make sure the cursor is in a valid position. */ - check_cursor(); -} - -/* - * Return TRUE if the cursor is in the editable position of the prompt line. + * Set the insert start position for when using a prompt buffer. */ - int -prompt_curpos_editable() + void +set_insstart(linenr_T lnum, int col) { - return curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count - && curwin->w_cursor.col >= (int)STRLEN(prompt_text()); + Insstart.lnum = lnum; + Insstart.col = col; + Insstart_orig = Insstart; + Insstart_textlen = Insstart.col; + Insstart_blank_vcol = MAXCOL; + arrow_used = FALSE; } #endif @@ -1726,11 +1760,11 @@ display_dollar(colnr_T col) { char_u *p; - /* If on the last byte of a multi-byte move to the first byte. */ + // If on the last byte of a multi-byte move to the first byte. p = ml_get_curline(); curwin->w_cursor.col -= (*mb_head_off)(p, p + col); } - curs_columns(FALSE); /* recompute w_wrow and w_wcol */ + curs_columns(FALSE); // recompute w_wrow and w_wcol if (curwin->w_wcol < curwin->w_width) { edit_putchar('$', FALSE); @@ -1755,27 +1789,27 @@ undisplay_dollar(void) /* * Truncate the space at the end of a line. This is to be used only in an - * insert mode. It handles fixing the replace stack for REPLACE and VREPLACE - * modes. + * insert mode. It handles fixing the replace stack for MODE_REPLACE and + * MODE_VREPLACE modes. */ void truncate_spaces(char_u *line) { int i; - /* find start of trailing white space */ + // find start of trailing white space for (i = (int)STRLEN(line) - 1; i >= 0 && VIM_ISWHITE(line[i]); i--) { if (State & REPLACE_FLAG) - replace_join(0); /* remove a NUL from the replace stack */ + replace_join(0); // remove a NUL from the replace stack } line[i + 1] = NUL; } /* - * Backspace the cursor until the given column. Handles REPLACE and VREPLACE - * modes correctly. May also be used when not in insert mode at all. - * Will attempt not to go before "col" even when there is a composing + * Backspace the cursor until the given column. Handles MODE_REPLACE and + * MODE_VREPLACE modes correctly. May also be used when not in insert mode at + * all. Will attempt not to go before "col" even when there is a composing * character. */ void @@ -1803,15 +1837,15 @@ del_char_after_col(int limit_col UNUSED) { colnr_T ecol = curwin->w_cursor.col + 1; - /* Make sure the cursor is at the start of a character, but - * skip forward again when going too far back because of a - * composing character. */ + // Make sure the cursor is at the start of a character, but + // skip forward again when going too far back because of a + // composing character. mb_adjust_cursor(); while (curwin->w_cursor.col < (colnr_T)limit_col) { int l = utf_ptr2len(ml_get_cursor()); - if (l == 0) /* end of line */ + if (l == 0) // end of line break; curwin->w_cursor.col += l; } @@ -1829,9 +1863,11 @@ del_char_after_col(int limit_col UNUSED) * A one, two or three digit decimal number is interpreted as its byte value. * If one or two digits are entered, the next character is given to vungetc(). * For Unicode a character > 255 may be returned. + * If "noReduceKeys" is TRUE do not change any modifyOtherKeys ESC sequence + * into a normal key, return ESC. */ int -get_literal(void) +get_literal(int noReduceKeys) { int cc; int nc; @@ -1851,19 +1887,31 @@ get_literal(void) * vi-compatible (maybe there should be an option for it?) -- webb */ if (gui.in_use) + { ++allow_keys; + if (noReduceKeys) + ++no_reduce_keys; + } #endif #ifdef USE_ON_FLY_SCROLL - dont_scroll = TRUE; /* disallow scrolling here */ + dont_scroll = TRUE; // disallow scrolling here #endif - ++no_mapping; /* don't map the next key hits */ + ++no_mapping; // don't map the next key hits cc = 0; i = 0; for (;;) { nc = plain_vgetc(); + if ((nc == ESC || nc == CSI) && !noReduceKeys) + nc = decodeModifyOtherKeys(nc); + + if ((mod_mask & ~MOD_MASK_SHIFT) != 0) + // A character with non-Shift modifiers should not be a valid + // character for i_CTRL-V_digit. + break; + #ifdef FEAT_CMDL_INFO - if (!(State & CMDLINE) && MB_BYTE2LEN_CHECK(nc) == 1) + if ((State & MODE_CMDLINE) == 0 && MB_BYTE2LEN_CHECK(nc) == 1) add_to_showcmd(nc); #endif if (nc == 'x' || nc == 'X') @@ -1897,25 +1945,25 @@ get_literal(void) } if (cc > 255 && unicode == 0) - cc = 255; /* limit range to 0-255 */ + cc = 255; // limit range to 0-255 nc = 0; - if (hex) /* hex: up to two chars */ + if (hex) // hex: up to two chars { if (i >= 2) break; } - else if (unicode) /* Unicode: up to four or eight chars */ + else if (unicode) // Unicode: up to four or eight chars { if ((unicode == 'u' && i >= 4) || (unicode == 'U' && i >= 8)) break; } - else if (i >= 3) /* decimal or octal: up to three chars */ + else if (i >= 3) // decimal or octal: up to three chars break; } - if (i == 0) /* no number entered */ + if (i == 0) // no number entered { - if (nc == K_ZERO) /* NUL is stored as NL */ + if (nc == K_ZERO) // NUL is stored as NL { cc = '\n'; nc = 0; @@ -1927,20 +1975,28 @@ get_literal(void) } } - if (cc == 0) /* NUL is stored as NL */ + if (cc == 0) // NUL is stored as NL cc = '\n'; if (enc_dbcs && (cc & 0xff) == 0) - cc = '?'; /* don't accept an illegal DBCS char, the NUL in the - second byte will cause trouble! */ + cc = '?'; // don't accept an illegal DBCS char, the NUL in the + // second byte will cause trouble! --no_mapping; #ifdef FEAT_GUI if (gui.in_use) + { --allow_keys; + if (noReduceKeys) + --no_reduce_keys; + } #endif if (nc) + { vungetc(nc); - got_int = FALSE; /* CTRL-C typed after CTRL-V is not an interrupt */ + // A character typed with i_CTRL-V_digit cannot have modifiers. + mod_mask = 0; + } + got_int = FALSE; // CTRL-C typed after CTRL-V is not an interrupt return cc; } @@ -1951,7 +2007,7 @@ get_literal(void) insert_special( int c, int allow_modmask, - int ctrlv) /* c was typed after CTRL-V */ + int ctrlv) // c was typed after CTRL-V { char_u *p; int len; @@ -1964,7 +2020,7 @@ insert_special( * unless 'allow_modmask' is TRUE. */ #ifdef MACOS_X - /* Command-key never produces a normal key */ + // Command-key never produces a normal key if (mod_mask & MOD_MASK_CMD) allow_modmask = TRUE; #endif @@ -1996,13 +2052,7 @@ insert_special( * stop and defer processing to the "normal" mechanism. * '0' and '^' are special, because they can be followed by CTRL-D. */ -#ifdef EBCDIC -# define ISSPECIAL(c) ((c) < ' ' || (c) == '0' || (c) == '^') -#else -# define ISSPECIAL(c) ((c) < ' ' || (c) >= DEL || (c) == '0' || (c) == '^') -#endif - -#define WHITECHAR(cc) (VIM_ISWHITE(cc) && (!enc_utf8 || !utf_iscomposing(utf_ptr2char(ml_get_cursor() + 1)))) +#define ISSPECIAL(c) ((c) < ' ' || (c) >= DEL || (c) == '0' || (c) == '^') /* * "flags": INSCHAR_FORMAT - force formatting @@ -2016,9 +2066,9 @@ insert_special( */ void insertchar( - int c, /* character to insert or NUL */ - int flags, /* INSCHAR_FORMAT, etc. */ - int second_indent) /* indent for second line if >= 0 */ + int c, // character to insert or NUL + int flags, // INSCHAR_FORMAT, etc. + int second_indent) // indent for second line if >= 0 { int textwidth; char_u *p; @@ -2036,7 +2086,7 @@ insertchar( * - Otherwise: * - Don't do this if inserting a blank * - Don't do this if an existing character is being replaced, unless - * we're in VREPLACE mode. + * we're in MODE_VREPLACE state. * - Do this if the cursor is not on the line where insert started * or - 'formatoptions' doesn't have 'l' or the line was not too long * before the insert. @@ -2056,8 +2106,8 @@ insertchar( || Insstart_blank_vcol <= (colnr_T)textwidth )))))) { - /* Format with 'formatexpr' when it's set. Use internal formatting - * when 'formatexpr' isn't set or it returns non-zero. */ + // Format with 'formatexpr' when it's set. Use internal formatting + // when 'formatexpr' isn't set or it returns non-zero. #if defined(FEAT_EVAL) int do_internal = TRUE; colnr_T virtcol = get_nolist_virtcol() @@ -2067,8 +2117,8 @@ insertchar( && (force_format || virtcol > (colnr_T)textwidth)) { do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0); - /* It may be required to save for undo again, e.g. when setline() - * was called. */ + // It may be required to save for undo again, e.g. when setline() + // was called. ins_need_undo = TRUE; } if (do_internal) @@ -2076,11 +2126,11 @@ insertchar( internal_format(textwidth, second_indent, flags, c == NUL, c); } - if (c == NUL) /* only formatting was wanted */ + if (c == NUL) // only formatting was wanted return; // Check whether this character should end a comment. - if (did_ai && (int)c == end_comment_pending) + if (did_ai && c == end_comment_pending) { char_u *line; char_u lead_end[COM_MAX_LEN]; // end-comment string @@ -2131,11 +2181,9 @@ insertchar( end_comment_pending = NUL; did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif /* * If there's any pending input, grab up to INPUT_BUFLEN at once. @@ -2149,7 +2197,7 @@ insertchar( * InsertCharPre autocommand could change the input buffer. */ #ifdef USE_ON_FLY_SCROLL - dont_scroll = FALSE; /* allow scrolling here */ + dont_scroll = FALSE; // allow scrolling here #endif if ( !ISSPECIAL(c) @@ -2157,9 +2205,7 @@ insertchar( && !has_insertcharpre() && vpeekc() != NUL && !(State & REPLACE_FLAG) -#ifdef FEAT_CINDENT && !cindent_on() -#endif #ifdef FEAT_RIGHTLEFT && !p_ri #endif @@ -2193,7 +2239,7 @@ insertchar( #ifdef FEAT_RIGHTLEFT c = vgetc(); if (p_hkmap && KeyTyped) - c = hkmap(c); /* Hebrew mode mapping */ + c = hkmap(c); // Hebrew mode mapping buf[i++] = c; #else buf[i++] = vgetc(); @@ -2201,8 +2247,8 @@ insertchar( } #ifdef FEAT_DIGRAPHS - do_digraph(-1); /* clear digraphs */ - do_digraph(buf[i-1]); /* may be the start of a digraph */ + do_digraph(-1); // clear digraphs + do_digraph(buf[i-1]); // may be the start of a digraph #endif buf[i] = NUL; ins_str(buf); @@ -2240,567 +2286,6 @@ insertchar( } } -/* - * Format text at the current insert position. - * - * If the INSCHAR_COM_LIST flag is present, then the value of second_indent - * will be the comment leader length sent to open_line(). - */ - static void -internal_format( - int textwidth, - int second_indent, - int flags, - int format_only, - int c) /* character to be inserted (can be NUL) */ -{ - int cc; - int save_char = NUL; - int haveto_redraw = FALSE; - int fo_ins_blank = has_format_option(FO_INS_BLANK); - int fo_multibyte = has_format_option(FO_MBYTE_BREAK); - int fo_white_par = has_format_option(FO_WHITE_PAR); - int first_line = TRUE; - colnr_T leader_len; - int no_leader = FALSE; - int do_comments = (flags & INSCHAR_DO_COM); -#ifdef FEAT_LINEBREAK - int has_lbr = curwin->w_p_lbr; - - /* make sure win_lbr_chartabsize() counts correctly */ - curwin->w_p_lbr = FALSE; -#endif - - /* - * When 'ai' is off we don't want a space under the cursor to be - * deleted. Replace it with an 'x' temporarily. - */ - if (!curbuf->b_p_ai && !(State & VREPLACE_FLAG)) - { - cc = gchar_cursor(); - if (VIM_ISWHITE(cc)) - { - save_char = cc; - pchar_cursor('x'); - } - } - - /* - * Repeat breaking lines, until the current line is not too long. - */ - while (!got_int) - { - int startcol; /* Cursor column at entry */ - int wantcol; /* column at textwidth border */ - int foundcol; /* column for start of spaces */ - int end_foundcol = 0; /* column for start of word */ - colnr_T len; - colnr_T virtcol; - int orig_col = 0; - char_u *saved_text = NULL; - colnr_T col; - colnr_T end_col; - int wcc; // counter for whitespace chars - - virtcol = get_nolist_virtcol() - + char2cells(c != NUL ? c : gchar_cursor()); - if (virtcol <= (colnr_T)textwidth) - break; - - if (no_leader) - do_comments = FALSE; - else if (!(flags & INSCHAR_FORMAT) - && has_format_option(FO_WRAP_COMS)) - do_comments = TRUE; - - /* Don't break until after the comment leader */ - if (do_comments) - leader_len = get_leader_len(ml_get_curline(), NULL, FALSE, TRUE); - else - leader_len = 0; - - /* If the line doesn't start with a comment leader, then don't - * start one in a following broken line. Avoids that a %word - * moved to the start of the next line causes all following lines - * to start with %. */ - if (leader_len == 0) - no_leader = TRUE; - if (!(flags & INSCHAR_FORMAT) - && leader_len == 0 - && !has_format_option(FO_WRAP)) - - break; - if ((startcol = curwin->w_cursor.col) == 0) - break; - - /* find column of textwidth border */ - coladvance((colnr_T)textwidth); - wantcol = curwin->w_cursor.col; - - curwin->w_cursor.col = startcol; - foundcol = 0; - - /* - * Find position to break at. - * Stop at first entered white when 'formatoptions' has 'v' - */ - while ((!fo_ins_blank && !has_format_option(FO_INS_VI)) - || (flags & INSCHAR_FORMAT) - || curwin->w_cursor.lnum != Insstart.lnum - || curwin->w_cursor.col >= Insstart.col) - { - if (curwin->w_cursor.col == startcol && c != NUL) - cc = c; - else - cc = gchar_cursor(); - if (WHITECHAR(cc)) - { - /* remember position of blank just before text */ - end_col = curwin->w_cursor.col; - - // find start of sequence of blanks - wcc = 0; - while (curwin->w_cursor.col > 0 && WHITECHAR(cc)) - { - dec_cursor(); - cc = gchar_cursor(); - - // Increment count of how many whitespace chars in this - // group; we only need to know if it's more than one. - if (wcc < 2) - wcc++; - } - if (curwin->w_cursor.col == 0 && WHITECHAR(cc)) - break; /* only spaces in front of text */ - - // Don't break after a period when 'formatoptions' has 'p' and - // there are less than two spaces. - if (has_format_option(FO_PERIOD_ABBR) && cc == '.' && wcc < 2) - continue; - - /* Don't break until after the comment leader */ - if (curwin->w_cursor.col < leader_len) - break; - if (has_format_option(FO_ONE_LETTER)) - { - /* do not break after one-letter words */ - if (curwin->w_cursor.col == 0) - break; /* one-letter word at begin */ - /* do not break "#a b" when 'tw' is 2 */ - if (curwin->w_cursor.col <= leader_len) - break; - col = curwin->w_cursor.col; - dec_cursor(); - cc = gchar_cursor(); - - if (WHITECHAR(cc)) - continue; /* one-letter, continue */ - curwin->w_cursor.col = col; - } - - inc_cursor(); - - end_foundcol = end_col + 1; - foundcol = curwin->w_cursor.col; - if (curwin->w_cursor.col <= (colnr_T)wantcol) - break; - } - else if (cc >= 0x100 && fo_multibyte) - { - /* Break after or before a multi-byte character. */ - if (curwin->w_cursor.col != startcol) - { - /* Don't break until after the comment leader */ - if (curwin->w_cursor.col < leader_len) - break; - col = curwin->w_cursor.col; - inc_cursor(); - /* Don't change end_foundcol if already set. */ - if (foundcol != curwin->w_cursor.col) - { - foundcol = curwin->w_cursor.col; - end_foundcol = foundcol; - if (curwin->w_cursor.col <= (colnr_T)wantcol) - break; - } - curwin->w_cursor.col = col; - } - - if (curwin->w_cursor.col == 0) - break; - - col = curwin->w_cursor.col; - - dec_cursor(); - cc = gchar_cursor(); - - if (WHITECHAR(cc)) - continue; /* break with space */ - /* Don't break until after the comment leader */ - if (curwin->w_cursor.col < leader_len) - break; - - curwin->w_cursor.col = col; - - foundcol = curwin->w_cursor.col; - end_foundcol = foundcol; - if (curwin->w_cursor.col <= (colnr_T)wantcol) - break; - } - if (curwin->w_cursor.col == 0) - break; - dec_cursor(); - } - - if (foundcol == 0) /* no spaces, cannot break line */ - { - curwin->w_cursor.col = startcol; - break; - } - - /* Going to break the line, remove any "$" now. */ - undisplay_dollar(); - - /* - * Offset between cursor position and line break is used by replace - * stack functions. VREPLACE does not use this, and backspaces - * over the text instead. - */ - if (State & VREPLACE_FLAG) - orig_col = startcol; /* Will start backspacing from here */ - else - replace_offset = startcol - end_foundcol; - - /* - * adjust startcol for spaces that will be deleted and - * characters that will remain on top line - */ - curwin->w_cursor.col = foundcol; - while ((cc = gchar_cursor(), WHITECHAR(cc)) - && (!fo_white_par || curwin->w_cursor.col < startcol)) - inc_cursor(); - startcol -= curwin->w_cursor.col; - if (startcol < 0) - startcol = 0; - - if (State & VREPLACE_FLAG) - { - /* - * In VREPLACE mode, we will backspace over the text to be - * wrapped, so save a copy now to put on the next line. - */ - saved_text = vim_strsave(ml_get_cursor()); - curwin->w_cursor.col = orig_col; - if (saved_text == NULL) - break; /* Can't do it, out of memory */ - saved_text[startcol] = NUL; - - /* Backspace over characters that will move to the next line */ - if (!fo_white_par) - backspace_until_column(foundcol); - } - else - { - /* put cursor after pos. to break line */ - if (!fo_white_par) - curwin->w_cursor.col = foundcol; - } - - /* - * Split the line just before the margin. - * Only insert/delete lines, but don't really redraw the window. - */ - open_line(FORWARD, OPENLINE_DELSPACES + OPENLINE_MARKFIX - + (fo_white_par ? OPENLINE_KEEPTRAIL : 0) - + (do_comments ? OPENLINE_DO_COM : 0) - + ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0) - , ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent)); - if (!(flags & INSCHAR_COM_LIST)) - old_indent = 0; - - replace_offset = 0; - if (first_line) - { - if (!(flags & INSCHAR_COM_LIST)) - { - /* - * This section is for auto-wrap of numeric lists. When not - * in insert mode (i.e. format_lines()), the INSCHAR_COM_LIST - * flag will be set and open_line() will handle it (as seen - * above). The code here (and in get_number_indent()) will - * recognize comments if needed... - */ - if (second_indent < 0 && has_format_option(FO_Q_NUMBER)) - second_indent = - get_number_indent(curwin->w_cursor.lnum - 1); - if (second_indent >= 0) - { - if (State & VREPLACE_FLAG) - change_indent(INDENT_SET, second_indent, - FALSE, NUL, TRUE); - else - if (leader_len > 0 && second_indent - leader_len > 0) - { - int i; - int padding = second_indent - leader_len; - - /* We started at the first_line of a numbered list - * that has a comment. the open_line() function has - * inserted the proper comment leader and positioned - * the cursor at the end of the split line. Now we - * add the additional whitespace needed after the - * comment leader for the numbered list. */ - for (i = 0; i < padding; i++) - ins_str((char_u *)" "); - } - else - { - (void)set_indent(second_indent, SIN_CHANGED); - } - } - } - first_line = FALSE; - } - - if (State & VREPLACE_FLAG) - { - /* - * In VREPLACE mode we have backspaced over the text to be - * moved, now we re-insert it into the new line. - */ - ins_bytes(saved_text); - vim_free(saved_text); - } - else - { - /* - * Check if cursor is not past the NUL off the line, cindent - * may have added or removed indent. - */ - curwin->w_cursor.col += startcol; - len = (colnr_T)STRLEN(ml_get_curline()); - if (curwin->w_cursor.col > len) - curwin->w_cursor.col = len; - } - - haveto_redraw = TRUE; -#ifdef FEAT_CINDENT - can_cindent = TRUE; -#endif - /* moved the cursor, don't autoindent or cindent now */ - did_ai = FALSE; -#ifdef FEAT_SMARTINDENT - did_si = FALSE; - can_si = FALSE; - can_si_back = FALSE; -#endif - line_breakcheck(); - } - - if (save_char != NUL) /* put back space after cursor */ - pchar_cursor(save_char); - -#ifdef FEAT_LINEBREAK - curwin->w_p_lbr = has_lbr; -#endif - if (!format_only && haveto_redraw) - { - update_topline(); - redraw_curbuf_later(VALID); - } -} - -/* - * Called after inserting or deleting text: When 'formatoptions' includes the - * 'a' flag format from the current line until the end of the paragraph. - * Keep the cursor at the same position relative to the text. - * The caller must have saved the cursor line for undo, following ones will be - * saved here. - */ - void -auto_format( - int trailblank, /* when TRUE also format with trailing blank */ - int prev_line) /* may start in previous line */ -{ - pos_T pos; - colnr_T len; - char_u *old; - char_u *new, *pnew; - int wasatend; - int cc; - - if (!has_format_option(FO_AUTO)) - return; - - pos = curwin->w_cursor; - old = ml_get_curline(); - - /* may remove added space */ - check_auto_format(FALSE); - - /* Don't format in Insert mode when the cursor is on a trailing blank, the - * user might insert normal text next. Also skip formatting when "1" is - * in 'formatoptions' and there is a single character before the cursor. - * Otherwise the line would be broken and when typing another non-white - * next they are not joined back together. */ - wasatend = (pos.col == (colnr_T)STRLEN(old)); - if (*old != NUL && !trailblank && wasatend) - { - dec_cursor(); - cc = gchar_cursor(); - if (!WHITECHAR(cc) && curwin->w_cursor.col > 0 - && has_format_option(FO_ONE_LETTER)) - dec_cursor(); - cc = gchar_cursor(); - if (WHITECHAR(cc)) - { - curwin->w_cursor = pos; - return; - } - curwin->w_cursor = pos; - } - - /* With the 'c' flag in 'formatoptions' and 't' missing: only format - * comments. */ - if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP) - && get_leader_len(old, NULL, FALSE, TRUE) == 0) - return; - - /* - * May start formatting in a previous line, so that after "x" a word is - * moved to the previous line if it fits there now. Only when this is not - * the start of a paragraph. - */ - if (prev_line && !paragraph_start(curwin->w_cursor.lnum)) - { - --curwin->w_cursor.lnum; - if (u_save_cursor() == FAIL) - return; - } - - /* - * Do the formatting and restore the cursor position. "saved_cursor" will - * be adjusted for the text formatting. - */ - saved_cursor = pos; - format_lines((linenr_T)-1, FALSE); - curwin->w_cursor = saved_cursor; - saved_cursor.lnum = 0; - - if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) - { - /* "cannot happen" */ - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - coladvance((colnr_T)MAXCOL); - } - else - check_cursor_col(); - - /* Insert mode: If the cursor is now after the end of the line while it - * previously wasn't, the line was broken. Because of the rule above we - * need to add a space when 'w' is in 'formatoptions' to keep a paragraph - * formatted. */ - if (!wasatend && has_format_option(FO_WHITE_PAR)) - { - new = ml_get_curline(); - len = (colnr_T)STRLEN(new); - if (curwin->w_cursor.col == len) - { - pnew = vim_strnsave(new, len + 2); - pnew[len] = ' '; - pnew[len + 1] = NUL; - ml_replace(curwin->w_cursor.lnum, pnew, FALSE); - /* remove the space later */ - did_add_space = TRUE; - } - else - /* may remove added space */ - check_auto_format(FALSE); - } - - check_cursor(); -} - -/* - * When an extra space was added to continue a paragraph for auto-formatting, - * delete it now. The space must be under the cursor, just after the insert - * position. - */ - static void -check_auto_format( - int end_insert) /* TRUE when ending Insert mode */ -{ - int c = ' '; - int cc; - - if (did_add_space) - { - cc = gchar_cursor(); - if (!WHITECHAR(cc)) - /* Somehow the space was removed already. */ - did_add_space = FALSE; - else - { - if (!end_insert) - { - inc_cursor(); - c = gchar_cursor(); - dec_cursor(); - } - if (c != NUL) - { - /* The space is no longer at the end of the line, delete it. */ - del_char(FALSE); - did_add_space = FALSE; - } - } - } -} - -/* - * Find out textwidth to be used for formatting: - * if 'textwidth' option is set, use it - * else if 'wrapmargin' option is set, use curwin->w_width - 'wrapmargin' - * if invalid value, use 0. - * Set default to window width (maximum 79) for "gq" operator. - */ - int -comp_textwidth( - int ff) /* force formatting (for "gq" command) */ -{ - int textwidth; - - textwidth = curbuf->b_p_tw; - if (textwidth == 0 && curbuf->b_p_wm) - { - /* The width is the window width minus 'wrapmargin' minus all the - * things that add to the margin. */ - textwidth = curwin->w_width - curbuf->b_p_wm; -#ifdef FEAT_CMDWIN - if (cmdwin_type != 0) - textwidth -= 1; -#endif -#ifdef FEAT_FOLDING - textwidth -= curwin->w_p_fdc; -#endif -#ifdef FEAT_SIGNS - if (signcolumn_on(curwin)) - textwidth -= 1; -#endif - if (curwin->w_p_nu || curwin->w_p_rnu) - textwidth -= 8; - } - if (textwidth < 0) - textwidth = 0; - if (ff && textwidth == 0) - { - textwidth = curwin->w_width - 1; - if (textwidth > 79) - textwidth = 79; - } - return textwidth; -} - /* * Put a character in the redo buffer, for when just after a CTRL-V. */ @@ -2809,8 +2294,8 @@ redo_literal(int c) { char_u buf[10]; - /* Only digits need special treatment. Translate them into a string of - * three digits. */ + // Only digits need special treatment. Translate them into a string of + // three digits. if (VIM_ISDIGIT(c)) { vim_snprintf((char *)buf, sizeof(buf), "%03d", c); @@ -2826,7 +2311,7 @@ redo_literal(int c) */ void start_arrow( - pos_T *end_insert_pos) /* can be NULL */ + pos_T *end_insert_pos) // can be NULL { start_arrow_common(end_insert_pos, TRUE); } @@ -2837,8 +2322,8 @@ start_arrow( */ static void start_arrow_with_change( - pos_T *end_insert_pos, /* can be NULL */ - int end_change) /* end undoable change */ + pos_T *end_insert_pos, // can be NULL + int end_change) // end undoable change { start_arrow_common(end_insert_pos, end_change); if (!end_change) @@ -2850,14 +2335,14 @@ start_arrow_with_change( static void start_arrow_common( - pos_T *end_insert_pos, /* can be NULL */ - int end_change) /* end undoable change */ + pos_T *end_insert_pos, // can be NULL + int end_change) // end undoable change { - if (!arrow_used && end_change) /* something has been inserted */ + if (!arrow_used && end_change) // something has been inserted { AppendToRedobuff(ESC_STR); stop_insert(end_insert_pos, FALSE, FALSE); - arrow_used = TRUE; /* this means we stopped the current insert */ + arrow_used = TRUE; // this means we stopped the current insert } #ifdef FEAT_SPELL check_spell_redraw(); @@ -2893,10 +2378,10 @@ stop_arrow(void) { if (arrow_used) { - Insstart = curwin->w_cursor; /* new insertion starts here */ + Insstart = curwin->w_cursor; // new insertion starts here if (Insstart.col > Insstart_orig.col && !ins_need_undo) - /* Don't update the original insert position when moved to the - * right, except when nothing was inserted yet. */ + // Don't update the original insert position when moved to the + // right, except when nothing was inserted yet. update_Insstart_orig = FALSE; Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); @@ -2913,7 +2398,7 @@ stop_arrow(void) vr_lines_changed = 1; } ResetRedobuff(); - AppendToRedobuff((char_u *)"1i"); /* pretend we start an insertion */ + AppendToRedobuff((char_u *)"1i"); // pretend we start an insertion new_insert_skip = 2; } else if (ins_need_undo) @@ -2923,7 +2408,7 @@ stop_arrow(void) } #ifdef FEAT_FOLDING - /* Always open fold at the cursor line when inserting something. */ + // Always open fold at the cursor line when inserting something. foldOpenCursor(); #endif @@ -2938,14 +2423,14 @@ stop_arrow(void) static void stop_insert( pos_T *end_insert_pos, - int esc, /* called by ins_esc() */ - int nomove) /* , don't move cursor */ + int esc, // called by ins_esc() + int nomove) // , don't move cursor { int cc; char_u *ptr; stop_redo_ins(); - replace_flush(); /* abandon replace stack */ + replace_flush(); // abandon replace stack /* * Save the inserted text for later redo with ^@ and CTRL-A. @@ -2965,17 +2450,17 @@ stop_insert( if (!arrow_used && end_insert_pos != NULL) { - /* Auto-format now. It may seem strange to do this when stopping an - * insertion (or moving the cursor), but it's required when appending - * a line and having it end in a space. But only do it when something - * was actually inserted, otherwise undo won't work. */ + // Auto-format now. It may seem strange to do this when stopping an + // insertion (or moving the cursor), but it's required when appending + // a line and having it end in a space. But only do it when something + // was actually inserted, otherwise undo won't work. if (!ins_need_undo && has_format_option(FO_AUTO)) { pos_T tpos = curwin->w_cursor; - /* When the cursor is at the end of the line after a space the - * formatting will move it to the following word. Avoid that by - * moving the cursor onto the space. */ + // When the cursor is at the end of the line after a space the + // formatting will move it to the following word. Avoid that by + // moving the cursor onto the space. cc = 'x'; if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL) { @@ -3000,14 +2485,14 @@ stop_insert( } } - /* If a space was inserted for auto-formatting, remove it now. */ + // If a space was inserted for auto-formatting, remove it now. check_auto_format(TRUE); - /* If we just did an auto-indent, remove the white space from the end - * of the line, and put the cursor back. - * Do this when ESC was used or moving the cursor up/down. - * Check for the old position still being valid, just in case the text - * got changed unexpectedly. */ + // If we just did an auto-indent, remove the white space from the end + // of the line, and put the cursor back. + // Do this when ESC was used or moving the cursor up/down. + // Check for the old position still being valid, just in case the text + // got changed unexpectedly. if (!nomove && did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL && curwin->w_cursor.lnum != end_insert_pos->lnum)) && end_insert_pos->lnum <= curbuf->b_ml.ml_line_count) @@ -3015,7 +2500,7 @@ stop_insert( pos_T tpos = curwin->w_cursor; curwin->w_cursor = *end_insert_pos; - check_cursor_col(); /* make sure it is not past the line */ + check_cursor_col(); // make sure it is not past the line for (;;) { if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) @@ -3024,42 +2509,32 @@ stop_insert( if (!VIM_ISWHITE(cc)) break; if (del_char(TRUE) == FAIL) - break; /* should not happen */ + break; // should not happen } if (curwin->w_cursor.lnum != tpos.lnum) curwin->w_cursor = tpos; else { - /* reset tpos, could have been invalidated in the loop above */ + // reset tpos, could have been invalidated in the loop above tpos = curwin->w_cursor; tpos.col++; if (cc != NUL && gchar_pos(&tpos) == NUL) - ++curwin->w_cursor.col; /* put cursor back on the NUL */ + ++curwin->w_cursor.col; // put cursor back on the NUL } - /* may have started Visual mode, adjust the position for - * deleted characters. */ - if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) - { - int len = (int)STRLEN(ml_get_curline()); - - if (VIsual.col > len) - { - VIsual.col = len; - VIsual.coladd = 0; - } - } + // may have started Visual mode, adjust the position for + // deleted characters. + if (VIsual_active) + check_visual_pos(); } } did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif - /* Set '[ and '] to the inserted text. When end_insert_pos is NULL we are - * now in a different buffer. */ + // Set '[ and '] to the inserted text. When end_insert_pos is NULL we are + // now in a different buffer. if (end_insert_pos != NULL) { curbuf->b_op_start = Insstart; @@ -3082,7 +2557,7 @@ set_last_insert(int c) if (last_insert != NULL) { s = last_insert; - /* Use the CTRL-V only when entering a special char */ + // Use the CTRL-V only when entering a special char if (c < ' ' || c == DEL) *s++ = Ctrl_V; s = add_char2buf(c, s); @@ -3116,7 +2591,7 @@ add_char2buf(int c, char_u *s) for (i = 0; i < len; ++i) { c = temp[i]; - /* Need to escape K_SPECIAL and CSI like in the typeahead buffer. */ + // Need to escape K_SPECIAL and CSI like in the typeahead buffer. if (c == K_SPECIAL) { *s++ = K_SPECIAL; @@ -3184,29 +2659,29 @@ oneright(void) { pos_T prevpos = curwin->w_cursor; - /* Adjust for multi-wide char (excluding TAB) */ + // Adjust for multi-wide char (excluding TAB) ptr = ml_get_cursor(); coladvance(getviscol() + ((*ptr != TAB && vim_isprintc((*mb_ptr2char)(ptr))) ? ptr2cells(ptr) : 1)); curwin->w_set_curswant = TRUE; - /* Return OK if the cursor moved, FAIL otherwise (at window edge). */ + // Return OK if the cursor moved, FAIL otherwise (at window edge). return (prevpos.col != curwin->w_cursor.col || prevpos.coladd != curwin->w_cursor.coladd) ? OK : FAIL; } ptr = ml_get_cursor(); if (*ptr == NUL) - return FAIL; /* already at the very end */ + return FAIL; // already at the very end if (has_mbyte) l = (*mb_ptr2len)(ptr); else l = 1; - /* move "l" bytes right, but don't end up on the NUL, unless 'virtualedit' - * contains "onemore". */ - if (ptr[l] == NUL && (ve_flags & VE_ONEMORE) == 0) + // move "l" bytes right, but don't end up on the NUL, unless 'virtualedit' + // contains "onemore". + if (ptr[l] == NUL && (get_ve_flags() & VE_ONEMORE) == 0) return FAIL; curwin->w_cursor.col += l; @@ -3228,15 +2703,15 @@ oneleft(void) return FAIL; #ifdef FEAT_LINEBREAK - /* We might get stuck on 'showbreak', skip over it. */ + // We might get stuck on 'showbreak', skip over it. width = 1; for (;;) { coladvance(v - width); - /* getviscol() is slow, skip it when 'showbreak' is empty, - * 'breakindent' is not set and there are no multi-byte - * characters */ - if ((*p_sbr == NUL && !curwin->w_p_bri + // getviscol() is slow, skip it when 'showbreak' is empty, + // 'breakindent' is not set and there are no multi-byte + // characters + if ((*get_showbreak_value(curwin) == NUL && !curwin->w_p_bri && !has_mbyte) || getviscol() < v) break; ++width; @@ -3249,7 +2724,7 @@ oneleft(void) { char_u *ptr; - /* Adjust for multi-wide char (not a TAB) */ + // Adjust for multi-wide char (not a TAB) ptr = ml_get_cursor(); if (*ptr != TAB && vim_isprintc((*mb_ptr2char)(ptr)) && ptr2cells(ptr) > 1) @@ -3266,8 +2741,8 @@ oneleft(void) curwin->w_set_curswant = TRUE; --curwin->w_cursor.col; - /* if the character on the left of the current cursor is a multi-byte - * character, move to its first byte */ + // if the character on the left of the current cursor is a multi-byte + // character, move to its first byte if (has_mbyte) mb_adjust_cursor(); return OK; @@ -3276,15 +2751,15 @@ oneleft(void) int cursor_up( long n, - int upd_topline) /* When TRUE: update topline */ + int upd_topline) // When TRUE: update topline { linenr_T lnum; if (n > 0) { lnum = curwin->w_cursor.lnum; - /* This fails if the cursor is already in the first line or the count - * is larger than the line number and '-' is in 'cpoptions' */ + // This fails if the cursor is already in the first line or the count + // is larger than the line number and '-' is in 'cpoptions' if (lnum <= 1 || (n >= lnum && vim_strchr(p_cpo, CPO_MINUS) != NULL)) return FAIL; if (n >= lnum) @@ -3296,19 +2771,19 @@ cursor_up( /* * Count each sequence of folded lines as one logical line. */ - /* go to the start of the current fold */ + // go to the start of the current fold (void)hasFolding(lnum, &lnum, NULL); while (n--) { - /* move up one line */ + // move up one line --lnum; if (lnum <= 1) break; - /* If we entered a fold, move to the beginning, unless in - * Insert mode or when 'foldopen' contains "all": it will open - * in a moment. */ - if (n > 0 || !((State & INSERT) || (fdo_flags & FDO_ALL))) + // If we entered a fold, move to the beginning, unless in + // Insert mode or when 'foldopen' contains "all": it will open + // in a moment. + if (n > 0 || !((State & MODE_INSERT) || (fdo_flags & FDO_ALL))) (void)hasFolding(lnum, &lnum, NULL); } if (lnum < 1) @@ -3320,11 +2795,11 @@ cursor_up( curwin->w_cursor.lnum = lnum; } - /* try to advance to the column we want to be at */ + // try to advance to the column we want to be at coladvance(curwin->w_curswant); if (upd_topline) - update_topline(); /* make sure curwin->w_topline is valid */ + update_topline(); // make sure curwin->w_topline is valid return OK; } @@ -3335,7 +2810,7 @@ cursor_up( int cursor_down( long n, - int upd_topline) /* When TRUE: update topline */ + int upd_topline) // When TRUE: update topline { linenr_T lnum; @@ -3343,11 +2818,11 @@ cursor_down( { lnum = curwin->w_cursor.lnum; #ifdef FEAT_FOLDING - /* Move to last line of fold, will fail if it's the end-of-file. */ + // Move to last line of fold, will fail if it's the end-of-file. (void)hasFolding(lnum, NULL, &lnum); #endif - /* This fails if the cursor is already in the last line or would move - * beyond the last line and '-' is in 'cpoptions' */ + // This fails if the cursor is already in the last line or would move + // beyond the last line and '-' is in 'cpoptions' if (lnum >= curbuf->b_ml.ml_line_count || (lnum + n > curbuf->b_ml.ml_line_count && vim_strchr(p_cpo, CPO_MINUS) != NULL)) @@ -3360,7 +2835,7 @@ cursor_down( { linenr_T last; - /* count each sequence of folded lines as one logical line */ + // count each sequence of folded lines as one logical line while (n--) { if (hasFolding(lnum, NULL, &last)) @@ -3379,11 +2854,11 @@ cursor_down( curwin->w_cursor.lnum = lnum; } - /* try to advance to the column we want to be at */ + // try to advance to the column we want to be at coladvance(curwin->w_curswant); if (upd_topline) - update_topline(); /* make sure curwin->w_topline is valid */ + update_topline(); // make sure curwin->w_topline is valid return OK; } @@ -3395,9 +2870,9 @@ cursor_down( */ int stuff_inserted( - int c, /* Command character to be inserted */ - long count, /* Repeat this many times */ - int no_esc) /* Don't add an ESC at the end */ + int c, // Command character to be inserted + long count, // Repeat this many times + int no_esc) // Don't add an ESC at the end { char_u *esc_ptr; char_u *ptr; @@ -3407,20 +2882,19 @@ stuff_inserted( ptr = get_last_insert(); if (ptr == NULL) { - emsg(_(e_noinstext)); + emsg(_(e_no_inserted_text_yet)); return FAIL; } - /* may want to stuff the command character, to start Insert mode */ + // may want to stuff the command character, to start Insert mode if (c != NUL) stuffcharReadbuff(c); - if ((esc_ptr = (char_u *)vim_strrchr(ptr, ESC)) != NULL) - *esc_ptr = NUL; /* remove the ESC */ + if ((esc_ptr = vim_strrchr(ptr, ESC)) != NULL) + *esc_ptr = NUL; // remove the ESC - /* when the last char is either "0" or "^" it will be quoted if no ESC - * comes after it OR if it will inserted more than once and "ptr" - * starts with ^D. -- Acevedo - */ + // when the last char is either "0" or "^" it will be quoted if no ESC + // comes after it OR if it will inserted more than once and "ptr" + // starts with ^D. -- Acevedo last_ptr = (esc_ptr ? esc_ptr : ptr + STRLEN(ptr)) - 1; if (last_ptr >= ptr && (*last_ptr == '0' || *last_ptr == '^') && (no_esc || (*ptr == Ctrl_D && count > 1))) @@ -3432,11 +2906,10 @@ stuff_inserted( do { stuffReadbuff(ptr); - /* a trailing "0" is inserted as "048", "^" as "^" */ + // a trailing "0" is inserted as "048", "^" as "^" if (last) - stuffReadbuff((char_u *)(last == '0' - ? IF_EB("\026\060\064\070", CTRL_V_STR "xf0") - : IF_EB("\026^", CTRL_V_STR "^"))); + stuffReadbuff( + (char_u *)(last == '0' ? "\026\060\064\070" : "\026^")); } while (--count > 0); @@ -3444,9 +2917,9 @@ stuff_inserted( *last_ptr = last; if (esc_ptr != NULL) - *esc_ptr = ESC; /* put the ESC back */ + *esc_ptr = ESC; // put the ESC back - /* may want to stuff a trailing ESC, to get out of Insert mode */ + // may want to stuff a trailing ESC, to get out of Insert mode if (!no_esc) stuffcharReadbuff(ESC); @@ -3477,7 +2950,7 @@ get_last_insert_save(void) if (s != NULL) { len = (int)STRLEN(s); - if (len > 0 && s[len - 1] == ESC) /* remove trailing ESC */ + if (len > 0 && s[len - 1] == ESC) // remove trailing ESC s[len - 1] = NUL; } return s; @@ -3492,8 +2965,8 @@ get_last_insert_save(void) static int echeck_abbr(int c) { - /* Don't check for abbreviation in paste mode, when disabled and just - * after moving around with cursor keys. */ + // Don't check for abbreviation in paste mode, when disabled and just + // after moving around with cursor keys. if (p_paste || no_abbr || arrow_used) return FALSE; @@ -3521,22 +2994,22 @@ echeck_abbr(int c) */ static __thread char_u *replace_stack = NULL; -static __thread long replace_stack_nr = 0; /* next entry in replace stack */ -static __thread long replace_stack_len = 0; /* max. number of entries */ +static __thread long replace_stack_nr = 0; // next entry in replace stack +static __thread long replace_stack_len = 0; // max. number of entries void replace_push( - int c) /* character that is replaced (NUL is none) */ + int c) // character that is replaced (NUL is none) { char_u *p; - if (replace_stack_nr < replace_offset) /* nothing to do */ + if (replace_stack_nr < replace_offset) // nothing to do return; if (replace_stack_len <= replace_stack_nr) { replace_stack_len += 50; p = ALLOC_MULT(char_u, replace_stack_len); - if (p == NULL) /* out of memory */ + if (p == NULL) // out of memory { replace_stack_len -= 50; return; @@ -3591,7 +3064,7 @@ replace_pop(void) */ void replace_join( - int off) /* offset for which NUL to remove */ + int off) // offset for which NUL to remove { int i; @@ -3607,7 +3080,7 @@ replace_join( /* * Pop bytes from the replace stack until a NUL is found, and insert them - * before the cursor. Can only be used in REPLACE or VREPLACE mode. + * before the cursor. Can only be used in MODE_REPLACE or MODE_VREPLACE state. */ static void replace_pop_ins(void) @@ -3615,7 +3088,7 @@ replace_pop_ins(void) int cc; int oldState = State; - State = NORMAL; /* don't want REPLACE here */ + State = MODE_NORMAL; // don't want MODE_REPLACE here while ((cc = replace_pop()) > 0) { mb_replace_pop_ins(cc); @@ -3647,33 +3120,32 @@ mb_replace_pop_ins(int cc) ins_char(cc); if (enc_utf8) - /* Handle composing chars. */ + // Handle composing chars. for (;;) { c = replace_pop(); - if (c == -1) /* stack empty */ + if (c == -1) // stack empty break; if ((n = MB_BYTE2LEN(c)) == 1) { - /* Not a multi-byte char, put it back. */ + // Not a multi-byte char, put it back. replace_push(c); break; } + + buf[0] = c; + for (i = 1; i < n; ++i) + buf[i] = replace_pop(); + if (utf_iscomposing(utf_ptr2char(buf))) + ins_bytes_len(buf, n); else { - buf[0] = c; - for (i = 1; i < n; ++i) - buf[i] = replace_pop(); - if (utf_iscomposing(utf_ptr2char(buf))) - ins_bytes_len(buf, n); - else - { - /* Not a composing char, put it back. */ - for (i = n - 1; i >= 0; --i) - replace_push(buf[i]); - break; - } + // Not a composing char, put it back. + for (i = n - 1; i >= 0; --i) + replace_push(buf[i]); + break; } + } } @@ -3713,7 +3185,7 @@ replace_do_bs(int limit_col) cc = replace_pop(); if (cc > 0) { -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP size_t len_before = 0; // init to shut up GCC if (curbuf->b_has_textprop) @@ -3726,8 +3198,8 @@ replace_do_bs(int limit_col) #endif if (State & VREPLACE_FLAG) { - /* Get the number of screen cells used by the character we are - * going to delete. */ + // Get the number of screen cells used by the character we are + // going to delete. getvcol(curwin, &curwin->w_cursor, NULL, &start_vcol, NULL); orig_vcols = chartabsize(ml_get_cursor(), start_vcol); } @@ -3748,7 +3220,7 @@ replace_do_bs(int limit_col) if (State & VREPLACE_FLAG) { - /* Get the number of screen cells used by the inserted characters */ + // Get the number of screen cells used by the inserted characters p = ml_get_cursor(); ins_len = (int)STRLEN(p) - orig_len; vcol = start_vcol; @@ -3759,8 +3231,8 @@ replace_do_bs(int limit_col) } vcol -= start_vcol; - /* Delete spaces that were inserted after the cursor to keep the - * text aligned. */ + // Delete spaces that were inserted after the cursor to keep the + // text aligned. curwin->w_cursor.col += ins_len; while (vcol > orig_vcols && gchar_cursor() == ' ') { @@ -3773,7 +3245,7 @@ replace_do_bs(int limit_col) // mark the buffer as changed and prepare for displaying changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); -#ifdef FEAT_TEXT_PROP +#ifdef FEAT_PROP_POPUP if (curbuf->b_has_textprop) { size_t len_now = STRLEN(ml_get_curline()); @@ -3795,7 +3267,7 @@ replace_do_bs(int limit_col) int hkmap(int c) { - if (p_hkmapp) /* phonetic mapping, by Ilya Dogolazky */ + if (p_hkmapp) // phonetic mapping, by Ilya Dogolazky { enum {hALEF=0, BET, GIMEL, DALET, HEI, VAV, ZAIN, HET, TET, IUD, KAFsofit, hKAF, LAMED, MEMsofit, MEM, NUNsofit, NUN, SAMEH, AIN, @@ -3813,27 +3285,22 @@ hkmap(int c) if (c == 'N' || c == 'M' || c == 'P' || c == 'C' || c == 'Z') return (int)(map[CharOrd(c)] - 1 + p_aleph); - /* '-1'='sofit' */ + // '-1'='sofit' else if (c == 'x') return 'X'; else if (c == 'q') - return '\''; /* {geresh}={'} */ + return '\''; // {geresh}={'} else if (c == 246) - return ' '; /* \"o --> ' ' for a german keyboard */ + return ' '; // \"o --> ' ' for a german keyboard else if (c == 228) - return ' '; /* \"a --> ' ' -- / -- */ + return ' '; // \"a --> ' ' -- / -- else if (c == 252) - return ' '; /* \"u --> ' ' -- / -- */ -#ifdef EBCDIC - else if (islower(c)) -#else - /* NOTE: islower() does not do the right thing for us on Linux so we - * do this the same was as 5.7 and previous, so it works correctly on - * all systems. Specifically, the e.g. Delete and Arrow keys are - * munged and won't work if e.g. searching for Hebrew text. - */ + return ' '; // \"u --> ' ' -- / -- + // NOTE: islower() does not do the right thing for us on Linux so we + // do this the same was as 5.7 and previous, so it works correctly on + // all systems. Specifically, the e.g. Delete and Arrow keys are + // munged and won't work if e.g. searching for Hebrew text. else if (c >= 'a' && c <= 'z') -#endif return (int)(map[CharOrdLow(c)] + p_aleph); else return c; @@ -3848,19 +3315,14 @@ hkmap(int c) case 'q': return '/'; case 'w': return '\''; - /* Hebrew letters - set offset from 'a' */ + // Hebrew letters - set offset from 'a' case ',': c = '{'; break; case '.': c = 'v'; break; case ';': c = 't'; break; default: { static char str[] = "zqbcxlsjphmkwonu ydafe rig"; -#ifdef EBCDIC - /* see note about islower() above */ - if (!islower(c)) -#else if (c < 'a' || c > 'z') -#endif return c; c = str[CharOrdLow(c)]; break; @@ -3886,7 +3348,7 @@ ins_reg(void) pc_status = PC_STATUS_UNSET; if (redrawing() && !char_avail()) { - /* may need to redraw when no more chars available now */ + // may need to redraw when no more chars available now ins_redraw(FALSE); edit_putchar('"', TRUE); @@ -3896,7 +3358,7 @@ ins_reg(void) } #ifdef USE_ON_FLY_SCROLL - dont_scroll = TRUE; /* disallow scrolling here */ + dont_scroll = TRUE; // disallow scrolling here #endif /* @@ -3904,11 +3366,12 @@ ins_reg(void) * deleted when ESC is hit. */ ++no_mapping; + ++allow_keys; regname = plain_vgetc(); LANGMAP_ADJUST(regname, TRUE); if (regname == Ctrl_R || regname == Ctrl_O || regname == Ctrl_P) { - /* Get a third key for literal register insertion */ + // Get a third key for literal register insertion literally = regname; #ifdef FEAT_CMDL_INFO add_to_showcmd_c(literally); @@ -3917,10 +3380,11 @@ ins_reg(void) LANGMAP_ADJUST(regname, TRUE); } --no_mapping; + --allow_keys; #ifdef FEAT_EVAL - /* Don't call u_sync() while typing the expression or giving an error - * message for it. Only call it explicitly. */ + // Don't call u_sync() while typing the expression or giving an error + // message for it. Only call it explicitly. ++no_u_sync; if (regname == '=') { @@ -3928,8 +3392,8 @@ ins_reg(void) # ifdef HAVE_INPUT_METHOD int im_on = im_get_status(); # endif - /* Sync undo when evaluating the expression calls setline() or - * append(), so that it can be undone separately. */ + // Sync undo when evaluating the expression calls setline() or + // append(), so that it can be undone separately. u_sync_once = 2; regname = get_expr_register(); @@ -3946,30 +3410,30 @@ ins_reg(void) if (regname == NUL || !valid_yank_reg(regname, FALSE)) { vim_beep(BO_REG); - need_redraw = TRUE; /* remove the '"' */ + need_redraw = TRUE; // remove the '"' } else { #endif if (literally == Ctrl_O || literally == Ctrl_P) { - /* Append the command to the redo buffer. */ + // Append the command to the redo buffer. AppendCharToRedobuff(Ctrl_R); AppendCharToRedobuff(literally); AppendCharToRedobuff(regname); - do_put(regname, BACKWARD, 1L, + do_put(regname, NULL, BACKWARD, 1L, (literally == Ctrl_P ? PUT_FIXINDENT : 0) | PUT_CURSEND); } else if (insert_reg(regname, literally) == FAIL) { vim_beep(BO_REG); - need_redraw = TRUE; /* remove the '"' */ + need_redraw = TRUE; // remove the '"' } else if (stop_insert_mode) - /* When the '=' register was used and a function was invoked that - * did ":stopinsert" then stuff_empty() returns FALSE but we won't - * insert anything, need to remove the '"' */ + // When the '=' register was used and a function was invoked that + // did ":stopinsert" then stuff_empty() returns FALSE but we won't + // insert anything, need to remove the '"' need_redraw = TRUE; #ifdef FEAT_EVAL @@ -3983,11 +3447,11 @@ ins_reg(void) clear_showcmd(); #endif - /* If the inserted register is empty, we need to remove the '"' */ + // If the inserted register is empty, we need to remove the '"' if (need_redraw || stuff_empty()) edit_unputchar(); - /* Disallow starting Visual mode here, would get a weird mode. */ + // Disallow starting Visual mode here, would get a weird mode. if (!vis_active && VIsual_active) end_visual_mode(); } @@ -4008,40 +3472,42 @@ ins_ctrl_g(void) * deleted when ESC is hit. */ ++no_mapping; + ++allow_keys; c = plain_vgetc(); --no_mapping; + --allow_keys; switch (c) { - /* CTRL-G k and CTRL-G : cursor up to Insstart.col */ + // CTRL-G k and CTRL-G : cursor up to Insstart.col case K_UP: case Ctrl_K: case 'k': ins_up(TRUE); break; - /* CTRL-G j and CTRL-G : cursor down to Insstart.col */ + // CTRL-G j and CTRL-G : cursor down to Insstart.col case K_DOWN: case Ctrl_J: case 'j': ins_down(TRUE); break; - /* CTRL-G u: start new undoable edit */ + // CTRL-G u: start new undoable edit case 'u': u_sync(TRUE); ins_need_undo = TRUE; - /* Need to reset Insstart, esp. because a BS that joins - * a line to the previous one must save for undo. */ + // Need to reset Insstart, esp. because a BS that joins + // a line to the previous one must save for undo. update_Insstart_orig = FALSE; Insstart = curwin->w_cursor; break; - /* CTRL-G U: do not break undo with the next char */ + // CTRL-G U: do not break undo with the next char case 'U': - /* Allow one left/right cursor movement with the next char, - * without breaking undo. */ + // Allow one left/right cursor movement with the next char, + // without breaking undo. dont_sync_undo = MAYBE; break; - /* Unknown CTRL-G command, reserved for future expansion. */ + // Unknown CTRL-G command, reserved for future expansion. default: vim_beep(BO_CTRLG); } } @@ -4052,18 +3518,18 @@ ins_ctrl_g(void) static void ins_ctrl_hat(void) { - if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE)) + if (map_to_exists_mode((char_u *)"", MODE_LANGMAP, FALSE)) { - /* ":lmap" mappings exists, Toggle use of ":lmap" mappings. */ - if (State & LANGMAP) + // ":lmap" mappings exists, Toggle use of ":lmap" mappings. + if (State & MODE_LANGMAP) { curbuf->b_p_iminsert = B_IMODE_NONE; - State &= ~LANGMAP; + State &= ~MODE_LANGMAP; } else { curbuf->b_p_iminsert = B_IMODE_LMAP; - State |= LANGMAP; + State |= MODE_LANGMAP; #ifdef HAVE_INPUT_METHOD im_set_active(FALSE); #endif @@ -4072,7 +3538,7 @@ ins_ctrl_hat(void) #ifdef HAVE_INPUT_METHOD else { - /* There are no ":lmap" mappings, toggle IM */ + // There are no ":lmap" mappings, toggle IM if (im_get_status()) { curbuf->b_p_iminsert = B_IMODE_NONE; @@ -4081,7 +3547,7 @@ ins_ctrl_hat(void) else { curbuf->b_p_iminsert = B_IMODE_IM; - State &= ~LANGMAP; + State &= ~MODE_LANGMAP; im_set_active(TRUE); } } @@ -4089,12 +3555,12 @@ ins_ctrl_hat(void) set_iminsert_global(); showmode(); #ifdef FEAT_GUI - /* may show different cursor shape or color */ + // may show different cursor shape or color if (gui.in_use) gui_update_cursor(TRUE, FALSE); #endif #if defined(FEAT_KEYMAP) - /* Show/unshow value of 'keymap' in status lines. */ + // Show/unshow value of 'keymap' in status lines. status_redraw_curbuf(); #endif } @@ -4111,26 +3577,21 @@ static __thread int disabled_redraw = FALSE; ins_esc( long *count, int cmdchar, - int nomove) /* don't move cursor */ + int nomove) // don't move cursor { int temp; #if !TARGET_OS_IPHONE static int disabled_redraw = FALSE; #endif +#ifdef FEAT_CONCEAL + // Remember if the cursor line was concealed before changing State. + int cursor_line_was_concealed = curwin->w_p_cole > 0 + && conceal_cursor_line(curwin); +#endif #ifdef FEAT_SPELL check_spell_redraw(); #endif -#if defined(FEAT_HANGULIN) -# if defined(ESC_CHG_TO_ENG_MODE) - hangul_input_state_set(0); -# endif - if (composing_hangul) - { - push_raw_key(composing_hangul_buffer, 2); - composing_hangul = 0; - } -#endif temp = curwin->w_cursor.col; if (disabled_redraw) @@ -4159,30 +3620,33 @@ ins_esc( *count = 0; } - if (--*count > 0) /* repeat what was typed */ + if (--*count > 0) // repeat what was typed { - /* Vi repeats the insert without replacing characters. */ + // Vi repeats the insert without replacing characters. if (vim_strchr(p_cpo, CPO_REPLCNT) != NULL) State &= ~REPLACE_FLAG; (void)start_redo_ins(); if (cmdchar == 'r' || cmdchar == 'v') - stuffRedoReadbuff(ESC_STR); /* no ESC in redo buffer */ + stuffRedoReadbuff(ESC_STR); // no ESC in redo buffer ++RedrawingDisabled; disabled_redraw = TRUE; - return FALSE; /* repeat the insert */ + return FALSE; // repeat the insert } stop_insert(&curwin->w_cursor, TRUE, nomove); undisplay_dollar(); } - /* When an autoindent was removed, curswant stays after the - * indent */ + if (cmdchar != 'r' && cmdchar != 'v') + ins_apply_autocmds(EVENT_INSERTLEAVEPRE); + + // When an autoindent was removed, curswant stays after the + // indent if (restart_edit == NUL && (colnr_T)temp == curwin->w_cursor.col) curwin->w_set_curswant = TRUE; - /* Remember the last Insert position in the '^ mark. */ - if (!cmdmod.keepjumps) + // Remember the last Insert position in the '^ mark. + if ((cmdmod.cmod_flags & CMOD_KEEPJUMPS) == 0) curbuf->b_last_insert = curwin->w_cursor; /* @@ -4199,7 +3663,7 @@ ins_esc( #endif ) { - if (curwin->w_cursor.coladd > 0 || ve_flags == VE_ALL) + if (curwin->w_cursor.coladd > 0 || get_ve_flags() == VE_ALL) { oneleft(); if (restart_edit != NUL) @@ -4208,33 +3672,47 @@ ins_esc( else { --curwin->w_cursor.col; - /* Correct cursor for multi-byte character. */ + // Correct cursor for multi-byte character. if (has_mbyte) mb_adjust_cursor(); } } #ifdef HAVE_INPUT_METHOD - /* Disable IM to allow typing English directly for Normal mode commands. - * When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as - * well). */ - if (!(State & LANGMAP)) + // Disable IM to allow typing English directly for Normal mode commands. + // When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as + // well). + if (!(State & MODE_LANGMAP)) im_save_status(&curbuf->b_p_iminsert); im_set_active(FALSE); #endif - State = NORMAL; - /* need to position cursor again (e.g. when on a TAB ) */ - changed_cline_bef_curs(); + State = MODE_NORMAL; + may_trigger_modechanged(); + // need to position cursor again when on a TAB + if (gchar_cursor() == TAB) + curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL); setmouse(); #ifdef CURSOR_SHAPE - ui_cursor_shape(); /* may show different cursor shape */ + ui_cursor_shape(); // may show different cursor shape #endif if (!p_ek) - /* Re-enable bracketed paste mode. */ + { + MAY_WANT_TO_LOG_THIS; + + // Re-enable bracketed paste mode. out_str(T_BE); + // Re-enable modifyOtherKeys. + out_str(T_CTI); + } +#ifdef FEAT_CONCEAL + // Check if the cursor line needs redrawing after changing State. If + // 'concealcursor' is "i" it needs to be redrawn without concealing. + conceal_check_cursor_line(cursor_line_was_concealed); +#endif + // When recording or for CTRL-O, need to display the new mode. // Otherwise remove the mode message. if (reg_recording != 0 || restart_edit != NUL) @@ -4242,7 +3720,7 @@ ins_esc( else if (p_smd && (got_int || !skip_showmode())) msg(""); - return TRUE; /* exit Insert mode */ + return TRUE; // exit Insert mode } #ifdef FEAT_RIGHTLEFT @@ -4259,7 +3737,7 @@ ins_ctrl_(void) ++curwin->w_cursor.col; } p_ri = !p_ri; - revins_on = (State == INSERT && p_ri); + revins_on = (State == MODE_INSERT && p_ri); if (revins_on) { revins_scol = curwin->w_cursor.col; @@ -4300,18 +3778,18 @@ ins_start_select(int c) # endif if (!(mod_mask & MOD_MASK_SHIFT)) break; - /* FALLTHROUGH */ + // FALLTHROUGH case K_S_LEFT: case K_S_RIGHT: case K_S_UP: case K_S_DOWN: case K_S_END: case K_S_HOME: - /* Start selection right away, the cursor can move with - * CTRL-O when beyond the end of the line. */ + // Start selection right away, the cursor can move with + // CTRL-O when beyond the end of the line. start_selection(); - /* Execute the key in (insert) Select mode. */ + // Execute the key in (insert) Select mode. stuffcharReadbuff(Ctrl_O); if (mod_mask) { @@ -4338,18 +3816,18 @@ ins_insert(int replaceState) #ifdef FEAT_EVAL set_vim_var_string(VV_INSERTMODE, (char_u *)((State & REPLACE_FLAG) ? "i" - : replaceState == VREPLACE ? "v" - : "r"), 1); + : replaceState == MODE_VREPLACE ? "v" : "r"), 1); #endif ins_apply_autocmds(EVENT_INSERTCHANGE); if (State & REPLACE_FLAG) - State = INSERT | (State & LANGMAP); + State = MODE_INSERT | (State & MODE_LANGMAP); else - State = replaceState | (State & LANGMAP); + State = replaceState | (State & MODE_LANGMAP); + may_trigger_modechanged(); AppendCharToRedobuff(K_INS); showmode(); #ifdef CURSOR_SHAPE - ui_cursor_shape(); /* may show different cursor shape */ + ui_cursor_shape(); // may show different cursor shape #endif } @@ -4361,13 +3839,12 @@ ins_ctrl_o(void) { if (State & VREPLACE_FLAG) restart_edit = 'V'; - else - if (State & REPLACE_FLAG) + else if (State & REPLACE_FLAG) restart_edit = 'R'; else restart_edit = 'I'; if (virtual_active()) - ins_at_eol = FALSE; /* cursor always keeps its column */ + ins_at_eol = FALSE; // cursor always keeps its column else ins_at_eol = (gchar_cursor() == NUL); } @@ -4393,12 +3870,12 @@ ins_shift(int c, int lastc) && curwin->w_cursor.col > 0) { --curwin->w_cursor.col; - (void)del_char(FALSE); /* delete the '^' or '0' */ - /* In Replace mode, restore the characters that '^' or '0' replaced. */ + (void)del_char(FALSE); // delete the '^' or '0' + // In Replace mode, restore the characters that '^' or '0' replaced. if (State & REPLACE_FLAG) replace_pop_ins(); if (lastc == '^') - old_indent = get_indent(); /* remember curr. indent */ + old_indent = get_indent(); // remember curr. indent change_indent(INDENT_SET, 0, TRUE, 0, TRUE); } else @@ -4406,14 +3883,10 @@ ins_shift(int c, int lastc) if (did_ai && *skipwhite(ml_get_curline()) != NUL) did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif -#ifdef FEAT_CINDENT - can_cindent = FALSE; /* no cindenting after ^D or ^T */ -#endif + can_cindent = FALSE; // no cindenting after ^D or ^T } static void @@ -4423,31 +3896,29 @@ ins_del(void) if (stop_arrow() == FAIL) return; - if (gchar_cursor() == NUL) /* delete newline */ + if (gchar_cursor() == NUL) // delete newline { temp = curwin->w_cursor.col; - if (!can_bs(BS_EOL) /* only if "eol" included */ + if (!can_bs(BS_EOL) // only if "eol" included || do_join(2, FALSE, TRUE, FALSE, FALSE) == FAIL) vim_beep(BO_BS); else { curwin->w_cursor.col = temp; - /* Adjust orig_line_count in case more lines have been deleted than - * have been added. That makes sure, that open_line() later - * can access all buffer lines correctly */ + // Adjust orig_line_count in case more lines have been deleted than + // have been added. That makes sure, that open_line() later + // can access all buffer lines correctly if (State & VREPLACE_FLAG && orig_line_count > curbuf->b_ml.ml_line_count) orig_line_count = curbuf->b_ml.ml_line_count; } } - else if (del_char(FALSE) == FAIL) /* delete char under cursor */ + else if (del_char(FALSE) == FAIL) // delete char under cursor vim_beep(BO_BS); did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif AppendCharToRedobuff(K_DEL); } @@ -4461,8 +3932,8 @@ ins_bs_one(colnr_T *vcolp) getvcol(curwin, &curwin->w_cursor, vcolp, NULL, NULL); if (State & REPLACE_FLAG) { - /* Don't delete characters before the insert point when in - * Replace mode */ + // Don't delete characters before the insert point when in + // Replace mode if (curwin->w_cursor.lnum != Insstart.lnum || curwin->w_cursor.col >= Insstart.col) replace_do_bs(-1); @@ -4483,13 +3954,14 @@ ins_bs( { linenr_T lnum; int cc; - int temp = 0; /* init for GCC */ + int temp = 0; // init for GCC colnr_T save_col; colnr_T mincol; int did_backspace = FALSE; int in_indent; int oldState; - int cpc[MAX_MCO]; /* composing characters */ + int cpc[MAX_MCO]; // composing characters + int call_fix_indent = FALSE; /* * can't delete anything in an empty file @@ -4504,8 +3976,11 @@ ins_bs( #endif ((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0) || (!can_bs(BS_START) - && (arrow_used - || (curwin->w_cursor.lnum == Insstart_orig.lnum + && ((arrow_used +#ifdef FEAT_JOB_CHANNEL + && !bt_prompt(curbuf) +#endif + ) || (curwin->w_cursor.lnum == Insstart_orig.lnum && curwin->w_cursor.col <= Insstart_orig.col))) || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0 && curwin->w_cursor.col <= ai_col) @@ -4518,21 +3993,18 @@ ins_bs( if (stop_arrow() == FAIL) return FALSE; in_indent = inindent(0); -#ifdef FEAT_CINDENT if (in_indent) can_cindent = FALSE; -#endif - end_comment_pending = NUL; /* After BS, don't auto-end comment */ + end_comment_pending = NUL; // After BS, don't auto-end comment #ifdef FEAT_RIGHTLEFT - if (revins_on) /* put cursor after last inserted char */ + if (revins_on) // put cursor after last inserted char inc_cursor(); #endif - /* Virtualedit: - * BACKSPACE_CHAR eats a virtual space - * BACKSPACE_WORD eats all coladd - * BACKSPACE_LINE eats all coladd and keeps going - */ + // Virtualedit: + // BACKSPACE_CHAR eats a virtual space + // BACKSPACE_WORD eats all coladd + // BACKSPACE_LINE eats all coladd and keeps going if (curwin->w_cursor.coladd > 0) { if (mode == BACKSPACE_CHAR) @@ -4573,7 +4045,7 @@ ins_bs( */ cc = -1; if (State & REPLACE_FLAG) - cc = replace_pop(); /* returns -1 if NL was inserted */ + cc = replace_pop(); // returns -1 if NL was inserted /* * In replace mode, in the line we started replacing, we only move the * cursor. @@ -4587,12 +4059,12 @@ ins_bs( if (!(State & VREPLACE_FLAG) || curwin->w_cursor.lnum > orig_line_count) { - temp = gchar_cursor(); /* remember current char */ + temp = gchar_cursor(); // remember current char --curwin->w_cursor.lnum; - /* When "aw" is in 'formatoptions' we must delete the space at - * the end of the line, otherwise the line will be broken - * again when auto-formatting. */ + // When "aw" is in 'formatoptions' we must delete the space at + // the end of the line, otherwise the line will be broken + // again when auto-formatting. if (has_format_option(FO_AUTO) && has_format_option(FO_WHITE_PAR)) { @@ -4613,20 +4085,20 @@ ins_bs( dec_cursor(); /* - * In REPLACE mode we have to put back the text that was replaced - * by the NL. On the replace stack is first a NUL-terminated - * sequence of characters that were deleted and then the - * characters that NL replaced. + * In MODE_REPLACE mode we have to put back the text that was + * replaced by the NL. On the replace stack is first a + * NUL-terminated sequence of characters that were deleted and then + * the characters that NL replaced. */ if (State & REPLACE_FLAG) { /* - * Do the next ins_char() in NORMAL state, to + * Do the next ins_char() in MODE_NORMAL state, to * prevent ins_char() from replacing characters and * avoiding showmatch(). */ oldState = State; - State = NORMAL; + State = MODE_NORMAL; /* * restore characters (blanks) deleted after cursor */ @@ -4637,7 +4109,7 @@ ins_bs( curwin->w_cursor.col = save_col; cc = replace_pop(); } - /* restore the characters that NL replaced */ + // restore the characters that NL replaced replace_pop_ins(); State = oldState; } @@ -4650,17 +4122,13 @@ ins_bs( * Delete character(s) before the cursor. */ #ifdef FEAT_RIGHTLEFT - if (revins_on) /* put cursor on last inserted char */ + if (revins_on) // put cursor on last inserted char dec_cursor(); #endif mincol = 0; - /* keep indent */ + // keep indent if (mode == BACKSPACE_LINE - && (curbuf->b_p_ai -#ifdef FEAT_CINDENT - || cindent_on() -#endif - ) + && (curbuf->b_p_ai || cindent_on()) #ifdef FEAT_RIGHTLEFT && !revins_on #endif @@ -4669,7 +4137,11 @@ ins_bs( save_col = curwin->w_cursor.col; beginline(BL_WHITE); if (curwin->w_cursor.col < save_col) + { mincol = curwin->w_cursor.col; + // should now fix the indent to match with the previous line + call_fix_indent = TRUE; + } curwin->w_cursor.col = save_col; } @@ -4695,9 +4167,9 @@ ins_bs( colnr_T start_vcol; *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. */ + // 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(); @@ -4711,7 +4183,7 @@ ins_bs( } else want_vcol = tabstop_start(want_vcol, get_sts_value(), - curbuf->b_p_vsts_array); + curbuf->b_p_vsts_array); #else if (p_sta && in_indent) ts = (int)get_sw_value(curbuf); @@ -4720,15 +4192,15 @@ ins_bs( want_vcol = (want_vcol / ts) * ts; #endif - /* delete characters until we are at or before want_vcol */ - while (vcol > want_vcol + // 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); - /* insert extra spaces until we are at want_vcol */ + // insert extra spaces until we are at want_vcol while (vcol < want_vcol) { - /* Remember the first char we inserted */ + // Remember the first char we inserted if (curwin->w_cursor.lnum == Insstart_orig.lnum && curwin->w_cursor.col < Insstart_orig.col) Insstart_orig.col = curwin->w_cursor.col; @@ -4744,14 +4216,14 @@ ins_bs( 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 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); } /* - * Delete upto starting point, start of line or previous word. + * Delete up to starting point, start of line or previous word. */ else { @@ -4762,25 +4234,25 @@ ins_bs( do { #ifdef FEAT_RIGHTLEFT - if (!revins_on) /* put cursor on char to be deleted */ + if (!revins_on) // put cursor on char to be deleted #endif dec_cursor(); cc = gchar_cursor(); - /* look multi-byte character class */ + // look multi-byte character class if (has_mbyte) { prev_cclass = cclass; cclass = mb_get_class(ml_get_cursor()); } - /* start of word? */ + // start of word? if (mode == BACKSPACE_WORD && !vim_isspace(cc)) { mode = BACKSPACE_WORD_NOT_SPACE; temp = vim_iswordc(cc); } - /* end of word? */ + // end of word? else if (mode == BACKSPACE_WORD_NOT_SPACE && ((vim_isspace(cc) || vim_iswordc(cc) != temp) || prev_cclass != cclass)) @@ -4819,7 +4291,7 @@ ins_bs( break; #endif } - /* Just a single backspace?: */ + // Just a single backspace?: if (mode == BACKSPACE_CHAR) break; } while ( @@ -4827,18 +4299,22 @@ ins_bs( revins_on || #endif (curwin->w_cursor.col > mincol - && (curwin->w_cursor.lnum != Insstart_orig.lnum - || curwin->w_cursor.col != Insstart_orig.col))); + && (can_bs(BS_NOSTOP) + || (curwin->w_cursor.lnum != Insstart_orig.lnum + || curwin->w_cursor.col != Insstart_orig.col) + ))); } did_backspace = TRUE; } -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif if (curwin->w_cursor.col <= 1) did_ai = FALSE; + + if (call_fix_indent) + fix_indent(); + /* * It's a little strange to put backspaces into the redo * buffer, but it makes auto-indent a lot easier to deal @@ -4846,25 +4322,25 @@ ins_bs( */ AppendCharToRedobuff(c); - /* If deleted before the insertion point, adjust it */ + // If deleted before the insertion point, adjust it if (curwin->w_cursor.lnum == Insstart_orig.lnum && curwin->w_cursor.col < Insstart_orig.col) Insstart_orig.col = curwin->w_cursor.col; - /* vi behaviour: the cursor moves backward but the character that - * was there remains visible - * Vim behaviour: the cursor moves backward and the character that - * was there is erased from the screen. - * We can emulate the vi behaviour by pretending there is a dollar - * displayed even when there isn't. - * --pkv Sun Jan 19 01:56:40 EST 2003 */ + // vi behaviour: the cursor moves backward but the character that + // was there remains visible + // Vim behaviour: the cursor moves backward and the character that + // was there is erased from the screen. + // We can emulate the vi behaviour by pretending there is a dollar + // displayed even when there isn't. + // --pkv Sun Jan 19 01:56:40 EST 2003 if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == -1) dollar_vcol = curwin->w_virtcol; #ifdef FEAT_FOLDING - /* When deleting a char the cursor line must never be in a closed fold. - * E.g., when 'foldmethod' is indent and deleting the first non-white - * char before a Tab. */ + // When deleting a char the cursor line must never be in a closed fold. + // E.g., when 'foldmethod' is indent and deleting the first non-white + // char before a Tab. if (did_backspace) foldOpenCursor(); #endif @@ -4888,15 +4364,15 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) int save_allow_keys = allow_keys; int save_paste = p_paste; - /* If the end code is too long we can't detect it, read everything. */ - if (STRLEN(end) >= NUMBUFLEN) + // If the end code is too long we can't detect it, read everything. + if (end != NULL && STRLEN(end) >= NUMBUFLEN) end = NULL; ++no_mapping; allow_keys = 0; if (!p_paste) // Also have the side effects of setting 'paste' to make it work much // faster. - set_option_value((char_u *)"paste", TRUE, NULL, 0); + set_option_value_give_err((char_u *)"paste", TRUE, NULL, 0); for (;;) { @@ -4906,9 +4382,9 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) do c = vgetc(); while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); - if (c == NUL || got_int) + if (c == NUL || got_int || (ex_normal_busy > 0 && c == Ctrl_C)) // When CTRL-C was encountered the typeahead will be flushed and we - // won't get the end sequence. + // won't get the end sequence. Except when using ":normal". break; if (has_mbyte) @@ -4919,7 +4395,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) if (end != NULL && STRNCMP(buf, end, idx) == 0) { if (end[idx] == NUL) - break; /* Found the end of paste code. */ + break; // Found the end of paste code. continue; } if (!drop) @@ -4931,7 +4407,8 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) break; case PASTE_EX: - if (gap != NULL && ga_grow(gap, idx) == OK) + // add one for the NUL that is going to be appended + if (gap != NULL && ga_grow(gap, idx + 1) == OK) { mch_memmove((char *)gap->ga_data + gap->ga_len, buf, (size_t)idx); @@ -4970,7 +4447,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) --no_mapping; allow_keys = save_allow_keys; if (!save_paste) - set_option_value((char_u *)"paste", FALSE, NULL, 0); + set_option_value_give_err((char_u *)"paste", FALSE, NULL, 0); return ret_char; } @@ -4979,15 +4456,13 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) static void ins_tabline(int c) { - /* We will be leaving the current window, unless closing another tab. */ + // We will be leaving the current window, unless closing another tab. if (c != K_TABMENU || current_tabmenu != TABLINE_MENU_CLOSE || (current_tab != 0 && current_tab != tabpage_index(curtab))) { undisplay_dollar(); start_arrow(&curwin->w_cursor); -# ifdef FEAT_CINDENT can_cindent = TRUE; -# endif } if (c == K_TABLINE) @@ -4995,7 +4470,7 @@ ins_tabline(int c) else { handle_tabmenu(); - redraw_statuslines(); /* will redraw the tabline when needed */ + redraw_statuslines(); // will redraw the tabline when needed } } #endif @@ -5011,9 +4486,7 @@ ins_scroll(void) if (gui_do_scroll()) { start_arrow(&tpos); -# ifdef FEAT_CINDENT can_cindent = TRUE; -# endif } } @@ -5027,9 +4500,7 @@ ins_horscroll(void) if (gui_do_horiz_scroll(scrollbar_value, FALSE)) { start_arrow(&tpos); -# ifdef FEAT_CINDENT can_cindent = TRUE; -# endif } } #endif @@ -5049,8 +4520,8 @@ ins_left(void) if (oneleft() == OK) { #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) - /* Only call start_arrow() when not busy with preediting, it will - * break undo. K_LEFT is inserted in im_correct_cursor(). */ + // Only call start_arrow() when not busy with preediting, it will + // break undo. K_LEFT is inserted in im_correct_cursor(). if (p_imst == IM_OVER_THE_SPOT || !im_is_preediting()) #endif { @@ -5059,7 +4530,7 @@ ins_left(void) AppendCharToRedobuff(K_LEFT); } #ifdef FEAT_RIGHTLEFT - /* If exit reversed string, position is fixed */ + // If exit reversed string, position is fixed if (revins_scol != -1 && (int)curwin->w_cursor.col >= revins_scol) revins_legal++; revins_chars++; @@ -5072,11 +4543,11 @@ ins_left(void) */ else if (vim_strchr(p_ww, '[') != NULL && curwin->w_cursor.lnum > 1) { - /* always break undo when moving upwards/downwards, else undo may break */ + // always break undo when moving upwards/downwards, else undo may break start_arrow(&tpos); --(curwin->w_cursor.lnum); coladvance((colnr_T)MAXCOL); - curwin->w_set_curswant = TRUE; /* so we stay at the end */ + curwin->w_set_curswant = TRUE; // so we stay at the end } else vim_beep(BO_CRSR); @@ -5175,8 +4646,8 @@ ins_right(void) revins_chars--; #endif } - /* if 'whichwrap' set for cursor in insert mode, may move the - * cursor to the next line */ + // if 'whichwrap' set for cursor in insert mode, may move the + // cursor to the next line else if (vim_strchr(p_ww, ']') != NULL && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) { @@ -5215,7 +4686,7 @@ ins_s_right() static void ins_up( - int startcol) /* when TRUE move to Insstart.col */ + int startcol) // when TRUE move to Insstart.col { pos_T tpos; linenr_T old_topline = curwin->w_topline; @@ -5236,9 +4707,7 @@ ins_up( ) redraw_later(VALID); start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -5253,7 +4722,7 @@ ins_pageup(void) if (mod_mask & MOD_MASK_CTRL) { - /* : tab page back */ + // : tab page back if (first_tabpage->tp_next != NULL) { start_arrow(&curwin->w_cursor); @@ -5266,9 +4735,7 @@ ins_pageup(void) if (onepage(BACKWARD, 1L) == OK) { start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -5276,7 +4743,7 @@ ins_pageup(void) static void ins_down( - int startcol) /* when TRUE move to Insstart.col */ + int startcol) // when TRUE move to Insstart.col { pos_T tpos; linenr_T old_topline = curwin->w_topline; @@ -5297,9 +4764,7 @@ ins_down( ) redraw_later(VALID); start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -5314,7 +4779,7 @@ ins_pagedown(void) if (mod_mask & MOD_MASK_CTRL) { - /* : tab page forward */ + // : tab page forward if (first_tabpage->tp_next != NULL) { start_arrow(&curwin->w_cursor); @@ -5327,9 +4792,7 @@ ins_pagedown(void) if (onepage(FORWARD, 1L) == OK) { start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -5339,7 +4802,7 @@ ins_pagedown(void) static void ins_drop(void) { - do_put('~', BACKWARD, 1L, PUT_CURSEND); + do_put('~', NULL, BACKWARD, 1L, PUT_CURSEND); } #endif @@ -5360,10 +4823,8 @@ ins_tab(void) return FALSE; ind = inindent(0); -#ifdef FEAT_CINDENT if (ind) can_cindent = FALSE; -#endif /* * When nothing special, insert TAB like a normal character. @@ -5371,13 +4832,13 @@ ins_tab(void) if (!curbuf->b_p_et #ifdef FEAT_VARTABS && !(p_sta && ind - /* These five lines mean 'tabstop' != 'shiftwidth' */ + // These five lines mean 'tabstop' != 'shiftwidth' && ((tabstop_count(curbuf->b_p_vts_array) > 1) || (tabstop_count(curbuf->b_p_vts_array) == 1 - && tabstop_first(curbuf->b_p_vts_array) + && tabstop_first(curbuf->b_p_vts_array) != get_sw_value(curbuf)) - || (tabstop_count(curbuf->b_p_vts_array) == 0 - && curbuf->b_p_ts != get_sw_value(curbuf)))) + || (tabstop_count(curbuf->b_p_vts_array) == 0 + && curbuf->b_p_ts != get_sw_value(curbuf)))) && tabstop_count(curbuf->b_p_vsts_array) == 0 #else && !(p_sta && ind && curbuf->b_p_ts != get_sw_value(curbuf)) @@ -5389,32 +4850,30 @@ ins_tab(void) return TRUE; did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif AppendToRedobuff((char_u *)"\t"); #ifdef FEAT_VARTABS - if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ + if (p_sta && ind) // insert tab in indent, use 'shiftwidth' { temp = (int)get_sw_value(curbuf); temp -= get_nolist_virtcol() % temp; } else if (tabstop_count(curbuf->b_p_vsts_array) > 0 || curbuf->b_p_sts != 0) - /* use 'softtabstop' when set */ + // use 'softtabstop' when set temp = tabstop_padding(get_nolist_virtcol(), get_sts_value(), curbuf->b_p_vsts_array); - else /* otherwise use 'tabstop' */ + else // otherwise use 'tabstop' temp = tabstop_padding(get_nolist_virtcol(), curbuf->b_p_ts, curbuf->b_p_vts_array); #else - if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ + if (p_sta && ind) // insert tab in indent, use 'shiftwidth' temp = (int)get_sw_value(curbuf); - else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */ + else if (curbuf->b_p_sts != 0) // use 'softtabstop' when set temp = (int)get_sts_value(); - else /* otherwise use 'tabstop' */ + else // otherwise use 'tabstop' temp = (int)curbuf->b_p_ts; temp -= get_nolist_virtcol() % temp; #endif @@ -5422,7 +4881,7 @@ ins_tab(void) /* * Insert the first space with ins_char(). It will delete one char in * replace mode. Insert the rest with ins_str(); it will not delete any - * chars. For VREPLACE mode, we use ins_char() for all characters. + * chars. For MODE_VREPLACE state, we use ins_char() for all characters. */ ins_char(' '); while (--temp > 0) @@ -5432,7 +4891,7 @@ ins_tab(void) else { ins_str((char_u *)" "); - if (State & REPLACE_FLAG) /* no char replaced */ + if (State & REPLACE_FLAG) // no char replaced replace_push(NUL); } } @@ -5442,14 +4901,14 @@ ins_tab(void) */ #ifdef FEAT_VARTABS if (!curbuf->b_p_et && (tabstop_count(curbuf->b_p_vsts_array) > 0 - || get_sts_value() > 0 + || get_sts_value() > 0 || (p_sta && ind))) #else if (!curbuf->b_p_et && (get_sts_value() || (p_sta && ind))) #endif { char_u *ptr; - char_u *saved_line = NULL; /* init for GCC */ + char_u *saved_line = NULL; // init for GCC pos_T pos; pos_T fpos; pos_T *cursor; @@ -5458,8 +4917,8 @@ ins_tab(void) int save_list = curwin->w_p_list; /* - * Get the current line. For VREPLACE mode, don't make real changes - * yet, just work on a copy of the line. + * Get the current line. For MODE_VREPLACE state, don't make real + * changes yet, just work on a copy of the line. */ if (State & VREPLACE_FLAG) { @@ -5476,11 +4935,11 @@ ins_tab(void) cursor = &curwin->w_cursor; } - /* When 'L' is not in 'cpoptions' a tab always takes up 'ts' spaces. */ + // When 'L' is not in 'cpoptions' a tab always takes up 'ts' spaces. if (vim_strchr(p_cpo, CPO_LISTWM) == NULL) curwin->w_p_list = FALSE; - /* Find first white before the cursor */ + // Find first white before the cursor fpos = curwin->w_cursor; while (fpos.col > 0 && VIM_ISWHITE(ptr[-1])) { @@ -5488,7 +4947,7 @@ ins_tab(void) --ptr; } - /* In Replace mode, don't change characters before the insert point. */ + // In Replace mode, don't change characters before the insert point. if ((State & REPLACE_FLAG) && fpos.lnum == Insstart.lnum && fpos.col < Insstart.col) @@ -5497,12 +4956,12 @@ ins_tab(void) fpos.col = Insstart.col; } - /* compute virtual column numbers of first white and cursor */ + // compute virtual column numbers of first white and cursor getvcol(curwin, &fpos, &vcol, NULL, NULL); getvcol(curwin, cursor, &want_vcol, NULL, NULL); - /* Use as many TABs as possible. Beware of 'breakindent', 'showbreak' - * and 'linebreak' adding extra virtual columns. */ + // Use as many TABs as possible. Beware of 'breakindent', 'showbreak' + // and 'linebreak' adding extra virtual columns. while (VIM_ISWHITE(*ptr)) { i = lbr_chartabsize(NULL, (char_u *)"\t", vcol); @@ -5513,8 +4972,8 @@ ins_tab(void) *ptr = TAB; if (change_col < 0) { - change_col = fpos.col; /* Column of first change */ - /* May have to adjust Insstart */ + change_col = fpos.col; // Column of first change + // May have to adjust Insstart if (fpos.lnum == Insstart.lnum && fpos.col < Insstart.col) Insstart.col = fpos.col; } @@ -5529,7 +4988,7 @@ ins_tab(void) int repl_off = 0; char_u *line = ptr; - /* Skip over the spaces we need. */ + // Skip over the spaces we need. while (vcol < want_vcol && *ptr == ' ') { vcol += lbr_chartabsize(line, ptr, vcol); @@ -5538,24 +4997,46 @@ ins_tab(void) } if (vcol > want_vcol) { - /* Must have a char with 'showbreak' just before it. */ + // Must have a char with 'showbreak' just before it. --ptr; --repl_off; } fpos.col += repl_off; - /* Delete following spaces. */ + // Delete following spaces. i = cursor->col - fpos.col; if (i > 0) { - STRMOVE(ptr, ptr + i); - /* correct replace stack. */ +#ifdef FEAT_PROP_POPUP + if (!(State & VREPLACE_FLAG)) + { + char_u *newp; + int col; + + newp = alloc(curbuf->b_ml.ml_line_len - i); + if (newp == NULL) + return FALSE; + + col = ptr - curbuf->b_ml.ml_line_ptr; + if (col > 0) + mch_memmove(newp, ptr - col, col); + mch_memmove(newp + col, ptr + i, + curbuf->b_ml.ml_line_len - col - i); + + if (curbuf->b_ml.ml_flags & ML_LINE_DIRTY) + vim_free(curbuf->b_ml.ml_line_ptr); + curbuf->b_ml.ml_line_ptr = newp; + curbuf->b_ml.ml_line_len -= i; + curbuf->b_ml.ml_flags = + (curbuf->b_ml.ml_flags | ML_LINE_DIRTY) & ~ML_EMPTY; + } + else +#endif + STRMOVE(ptr, ptr + i); + // correct replace stack. if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG)) for (temp = i; --temp >= 0; ) replace_join(repl_off); -#ifdef FEAT_TEXT_PROP - curbuf->b_ml.ml_line_len -= i; -#endif } #ifdef FEAT_NETBEANS_INTG if (netbeans_active()) @@ -5568,17 +5049,17 @@ ins_tab(void) cursor->col -= i; /* - * In VREPLACE mode, we haven't changed anything yet. Do it now by - * backspacing over the changed spacing and then inserting the new - * spacing. + * In MODE_VREPLACE state, we haven't changed anything yet. Do it + * now by backspacing over the changed spacing and then inserting + * the new spacing. */ if (State & VREPLACE_FLAG) { - /* Backspace from real cursor to change_col */ + // Backspace from real cursor to change_col backspace_until_column(change_col); - /* Insert each char in saved_line from changed_col to - * ptr-cursor */ + // Insert each char in saved_line from changed_col to + // ptr-cursor ins_bytes_len(saved_line + change_col, cursor->col - change_col); } @@ -5616,33 +5097,32 @@ ins_eol(int c) replace_push(NUL); /* - * In VREPLACE mode, a NL replaces the rest of the line, and starts + * In MODE_VREPLACE state, a NL replaces the rest of the line, and starts * replacing the next line, so we push all of the characters left on the * line onto the replace stack. This is not done here though, it is done * in open_line(). */ - /* Put cursor on NUL if on the last char and coladd is 1 (happens after - * CTRL-O). */ + // Put cursor on NUL if on the last char and coladd is 1 (happens after + // CTRL-O). if (virtual_active() && curwin->w_cursor.coladd > 0) coladvance(getviscol()); #ifdef FEAT_RIGHTLEFT - /* NL in reverse insert will always start in the end of - * current line. */ + // NL in reverse insert will always start in the end of + // current line. if (revins_on) curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor()); #endif AppendToRedobuff(NL_STR); i = open_line(FORWARD, - has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM : 0, old_indent); + has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM : 0, old_indent, + NULL); old_indent = 0; -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif #ifdef FEAT_FOLDING - /* When inserting a line the cursor line must never be in a closed fold. */ + // When inserting a line the cursor line must never be in a closed fold. foldOpenCursor(); #endif @@ -5665,7 +5145,7 @@ ins_digraph(void) pc_status = PC_STATUS_UNSET; if (redrawing() && !char_avail()) { - /* may need to redraw when no more chars available now */ + // may need to redraw when no more chars available now ins_redraw(FALSE); edit_putchar('?', TRUE); @@ -5676,22 +5156,22 @@ ins_digraph(void) } #ifdef USE_ON_FLY_SCROLL - dont_scroll = TRUE; /* disallow scrolling here */ + dont_scroll = TRUE; // disallow scrolling here #endif - /* don't map the digraph chars. This also prevents the - * mode message to be deleted when ESC is hit */ + // don't map the digraph chars. This also prevents the + // mode message to be deleted when ESC is hit ++no_mapping; ++allow_keys; c = plain_vgetc(); --no_mapping; --allow_keys; if (did_putchar) - /* when the line fits in 'columns' the '?' is at the start of the next - * line and will not be removed by the redraw */ + // when the line fits in 'columns' the '?' is at the start of the next + // line and will not be removed by the redraw edit_unputchar(); - if (IS_SPECIAL(c) || mod_mask) /* special key */ + if (IS_SPECIAL(c) || mod_mask) // special key { #ifdef FEAT_CMDL_INFO clear_showcmd(); @@ -5704,7 +5184,7 @@ ins_digraph(void) did_putchar = FALSE; if (redrawing() && !char_avail()) { - /* may need to redraw when no more chars available now */ + // may need to redraw when no more chars available now ins_redraw(FALSE); if (char2cells(c) == 1) @@ -5723,13 +5203,13 @@ ins_digraph(void) --no_mapping; --allow_keys; if (did_putchar) - /* when the line fits in 'columns' the '?' is at the start of the - * next line and will not be removed by a redraw */ + // when the line fits in 'columns' the '?' is at the start of the + // next line and will not be removed by a redraw edit_unputchar(); if (cc != ESC) { AppendToRedobuff((char_u *)CTRL_V_STR); - c = getdigraph(c, cc, TRUE); + c = digraph_get(c, cc, TRUE); #ifdef FEAT_CMDL_INFO clear_showcmd(); #endif @@ -5761,7 +5241,7 @@ ins_copychar(linenr_T lnum) return NUL; } - /* try to advance to the cursor column */ + // try to advance to the cursor column temp = 0; line = ptr = ml_get(lnum); prev_ptr = ptr; @@ -5803,12 +5283,12 @@ ins_ctrl_ey(int tc) { long tw_save; - /* The character must be taken literally, insert like it - * was typed after a CTRL-V, and pretend 'textwidth' - * wasn't set. Digits, 'o' and 'x' are special after a - * CTRL-V, don't use it for these. */ + // The character must be taken literally, insert like it + // was typed after a CTRL-V, and pretend 'textwidth' + // wasn't set. Digits, 'o' and 'x' are special after a + // CTRL-V, don't use it for these. if (c < 256 && !isalnum(c)) - AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */ + AppendToRedobuff((char_u *)CTRL_V_STR); // CTRL-V tw_save = curbuf->b_p_tw; curbuf->b_p_tw = -1; insert_special(c, TRUE, FALSE); @@ -5817,7 +5297,7 @@ ins_ctrl_ey(int tc) revins_chars++; revins_legal++; #endif - c = Ctrl_V; /* pretend CTRL-V is last character */ + c = Ctrl_V; // pretend CTRL-V is last character auto_format(FALSE, TRUE); } } @@ -5856,7 +5336,7 @@ do_insert_char_pre(int c) char_u buf[MB_MAXBYTES + 1]; int save_State = State; - /* Return quickly when there is nothing to do. */ + // Return quickly when there is nothing to do. if (!has_insertcharpre()) return NULL; @@ -5868,21 +5348,21 @@ do_insert_char_pre(int c) buf[1] = NUL; } - /* Lock the text to avoid weird things from happening. */ + // Lock the text to avoid weird things from happening. ++textlock; - set_vim_var_string(VV_CHAR, buf, -1); /* set v:char */ + set_vim_var_string(VV_CHAR, buf, -1); // set v:char res = NULL; if (ins_apply_autocmds(EVENT_INSERTCHARPRE)) { - /* Get the value of v:char. It may be empty or more than one - * character. Only use it when changed, otherwise continue with the - * original character to avoid breaking autoindent. */ + // Get the value of v:char. It may be empty or more than one + // character. Only use it when changed, otherwise continue with the + // original character to avoid breaking autoindent. if (STRCMP(buf, get_vim_var_str(VV_CHAR)) != 0) res = vim_strsave(get_vim_var_str(VV_CHAR)); } - set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */ + set_vim_var_string(VV_CHAR, NULL, -1); // clear v:char --textlock; // Restore the State, it may have been changed. @@ -5892,7 +5372,6 @@ do_insert_char_pre(int c) } #endif -#if defined(FEAT_CINDENT) || defined(PROTO) int get_can_cindent(void) { @@ -5904,7 +5383,6 @@ set_can_cindent(int val) { can_cindent = val; } -#endif /* * Trigger "event" and take care of fixing undo. @@ -5919,7 +5397,8 @@ ins_apply_autocmds(event_T event) // If u_savesub() was called then we are not prepared to start // a new line. Call u_save() with no contents to fix that. - if (tick != CHANGEDTICK(curbuf)) + // Except when leaving Insert mode. + if (event != EVENT_INSERTLEAVE && tick != CHANGEDTICK(curbuf)) u_save(curwin->w_cursor.lnum, (linenr_T)(curwin->w_cursor.lnum + 1)); return r; diff --git a/src/errors.h b/src/errors.h new file mode 100644 index 0000000000000..43a1c9b95507b --- /dev/null +++ b/src/errors.h @@ -0,0 +1,3306 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + */ + +/* + * Definition of error messages, sorted on error number. + */ + +EXTERN char e_interrupted[] + INIT(= N_("Interrupted")); + +EXTERN char e_backslash_should_be_followed_by[] + INIT(= N_("E10: \\ should be followed by /, ? or &")); +#ifdef FEAT_CMDWIN +EXTERN char e_invalid_in_cmdline_window[] + INIT(= N_("E11: Invalid in command-line window; executes, CTRL-C quits")); +#endif +EXTERN char e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search[] + INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search")); +EXTERN char e_file_exists[] + INIT(= N_("E13: File exists (add ! to override)")); +// E14 unused +#ifdef FEAT_EVAL +EXTERN char e_invalid_expression_str[] + INIT(= N_("E15: Invalid expression: \"%s\"")); +#endif +EXTERN char e_invalid_range[] + INIT(= N_("E16: Invalid range")); +#if defined(UNIX) || defined(FEAT_SYN_HL) \ + || defined(FEAT_SPELL) || defined(FEAT_EVAL) +EXTERN char e_str_is_directory[] + INIT(= N_("E17: \"%s\" is a directory")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_unexpected_characters_in_let[] + INIT(= N_("E18: Unexpected characters in :let")); +EXTERN char e_unexpected_characters_in_assignment[] + INIT(= N_("E18: Unexpected characters in assignment")); +#endif +EXTERN char e_mark_has_invalid_line_number[] + INIT(= N_("E19: Mark has invalid line number")); +EXTERN char e_mark_not_set[] + INIT(= N_("E20: Mark not set")); +EXTERN char e_cannot_make_changes_modifiable_is_off[] + INIT(= N_("E21: Cannot make changes, 'modifiable' is off")); +EXTERN char e_scripts_nested_too_deep[] + INIT(= N_("E22: Scripts nested too deep")); +EXTERN char e_no_alternate_file[] + INIT(= N_("E23: No alternate file")); +EXTERN char e_no_such_abbreviation[] + INIT(= N_("E24: No such abbreviation")); +#if !defined(FEAT_GUI) || defined(VIMDLL) +EXTERN char e_gui_cannot_be_used_not_enabled_at_compile_time[] + INIT(= N_("E25: GUI cannot be used: Not enabled at compile time")); +#endif +#ifndef FEAT_RIGHTLEFT +EXTERN char e_hebrew_cannot_be_used_not_enabled_at_compile_time[] + INIT(= N_("E26: Hebrew cannot be used: Not enabled at compile time\n")); +#endif +EXTERN char e_farsi_support_has_been_removed[] + INIT(= N_("E27: Farsi support has been removed\n")); +#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_SYN_HL) +EXTERN char e_no_such_highlight_group_name_str[] + INIT(= N_("E28: No such highlight group name: %s")); +#endif +EXTERN char e_no_inserted_text_yet[] + INIT(= N_("E29: No inserted text yet")); +EXTERN char e_no_previous_command_line[] + INIT(= N_("E30: No previous command line")); +EXTERN char e_no_such_mapping[] + INIT(= N_("E31: No such mapping")); +EXTERN char e_no_file_name[] + INIT(= N_("E32: No file name")); +EXTERN char e_no_previous_substitute_regular_expression[] + INIT(= N_("E33: No previous substitute regular expression")); +EXTERN char e_no_previous_command[] + INIT(= N_("E34: No previous command")); +EXTERN char e_no_previous_regular_expression[] + INIT(= N_("E35: No previous regular expression")); +EXTERN char e_not_enough_room[] + INIT(= N_("E36: Not enough room")); +EXTERN char e_no_write_since_last_change[] + INIT(= N_("E37: No write since last change")); +EXTERN char e_no_write_since_last_change_add_bang_to_override[] + INIT(= N_("E37: No write since last change (add ! to override)")); +EXTERN char e_null_argument[] + INIT(= N_("E38: Null argument")); +#if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS) || defined(FEAT_EVAL) +EXTERN char e_number_expected[] + INIT(= N_("E39: Number expected")); +#endif +#ifdef FEAT_QUICKFIX +EXTERN char e_cant_open_errorfile_str[] + INIT(= N_("E40: Can't open errorfile %s")); +#endif +EXTERN char e_out_of_memory[] + INIT(= N_("E41: Out of memory!")); +#ifdef FEAT_QUICKFIX +EXTERN char e_no_errors[] + INIT(= N_("E42: No Errors")); +#endif +EXTERN char e_damaged_match_string[] + INIT(= N_("E43: Damaged match string")); +EXTERN char e_corrupted_regexp_program[] + INIT(= N_("E44: Corrupted regexp program")); +EXTERN char e_readonly_option_is_set_add_bang_to_override[] + INIT(= N_("E45: 'readonly' option is set (add ! to override)")); +#ifdef FEAT_EVAL +EXTERN char e_cannot_change_readonly_variable[] + INIT(= N_("E46: Cannot change read-only variable")); +EXTERN char e_cannot_change_readonly_variable_str[] + INIT(= N_("E46: Cannot change read-only variable \"%s\"")); +#endif +#ifdef FEAT_QUICKFIX +EXTERN char e_error_while_reading_errorfile[] + INIT(= N_("E47: Error while reading errorfile")); +#endif +#ifdef HAVE_SANDBOX +EXTERN char e_not_allowed_in_sandbox[] + INIT(= N_("E48: Not allowed in sandbox")); +#endif +EXTERN char e_invalid_scroll_size[] + INIT(= N_("E49: Invalid scroll size")); +#ifdef FEAT_SYN_HL +EXTERN char e_too_many_z[] + INIT(= N_("E50: Too many \\z(")); +#endif +EXTERN char e_too_many_str_open[] + INIT(= N_("E51: Too many %s(")); +#ifdef FEAT_SYN_HL +EXTERN char e_unmatched_z[] + INIT(= N_("E52: Unmatched \\z(")); +#endif +EXTERN char e_unmatched_str_percent_open[] + INIT(= N_("E53: Unmatched %s%%(")); +EXTERN char e_unmatched_str_open[] + INIT(= N_("E54: Unmatched %s(")); +EXTERN char e_unmatched_str_close[] + INIT(= N_("E55: Unmatched %s)")); +// E56 unused +// E57 unused +// E58 unused +EXTERN char e_invalid_character_after_str_at[] + INIT(= N_("E59: Invalid character after %s@")); +EXTERN char e_too_many_complex_str_curly[] + INIT(= N_("E60: Too many complex %s{...}s")); +EXTERN char e_nested_str[] + INIT(= N_("E61: Nested %s*")); +EXTERN char e_nested_str_chr[] + INIT(= N_("E62: Nested %s%c")); +EXTERN char e_invalid_use_of_underscore[] + INIT(= N_("E63: Invalid use of \\_")); +EXTERN char e_str_chr_follows_nothing[] + INIT(= N_("E64: %s%c follows nothing")); +EXTERN char e_illegal_back_reference[] + INIT(= N_("E65: Illegal back reference")); +#ifdef FEAT_SYN_HL +EXTERN char e_z_not_allowed_here[] + INIT(= N_("E66: \\z( not allowed here")); +EXTERN char e_z1_z9_not_allowed_here[] + INIT(= N_("E67: \\z1 - \\z9 not allowed here")); +#endif +EXTERN char e_invalid_character_after_bsl_z[] + INIT(= N_("E68: Invalid character after \\z")); +EXTERN char e_missing_sb_after_str[] + INIT(= N_("E69: Missing ] after %s%%[")); +EXTERN char e_empty_str_brackets[] + INIT(= N_("E70: Empty %s%%[]")); +EXTERN char e_invalid_character_after_str[] + INIT(= N_("E71: Invalid character after %s%%")); +EXTERN char e_close_error_on_swap_file[] + INIT(= N_("E72: Close error on swap file")); +EXTERN char e_tag_stack_empty[] + INIT(= N_("E73: Tag stack empty")); +EXTERN char e_command_too_complex[] + INIT(= N_("E74: Command too complex")); +EXTERN char e_name_too_long[] + INIT(= N_("E75: Name too long")); +EXTERN char e_too_many_brackets[] + INIT(= N_("E76: Too many [")); +EXTERN char e_too_many_file_names[] + INIT(= N_("E77: Too many file names")); +EXTERN char e_unknown_mark[] + INIT(= N_("E78: Unknown mark")); +EXTERN char e_cannot_expand_wildcards[] + INIT(= N_("E79: Cannot expand wildcards")); +EXTERN char e_error_while_writing[] + INIT(= N_("E80: Error while writing")); +#ifdef FEAT_EVAL +EXTERN char e_using_sid_not_in_script_context[] + INIT(= N_("E81: Using not in a script context")); +#endif +EXTERN char e_cannot_allocate_any_buffer_exiting[] + INIT(= N_("E82: Cannot allocate any buffer, exiting...")); +EXTERN char e_cannot_allocate_buffer_using_other_one[] + INIT(= N_("E83: Cannot allocate buffer, using other one...")); +EXTERN char e_no_modified_buffer_found[] + INIT(= N_("E84: No modified buffer found")); +EXTERN char e_there_is_no_listed_buffer[] + INIT(= N_("E85: There is no listed buffer")); +EXTERN char e_buffer_nr_does_not_exist[] + INIT(= N_("E86: Buffer %ld does not exist")); +EXTERN char e_cannot_go_beyond_last_buffer[] + INIT(= N_("E87: Cannot go beyond last buffer")); +EXTERN char e_cannot_go_before_first_buffer[] + INIT(= N_("E88: Cannot go before first buffer")); +EXTERN char e_no_write_since_last_change_for_buffer_nr_add_bang_to_override[] + INIT(= N_("E89: No write since last change for buffer %d (add ! to override)")); +EXTERN char e_cannot_unload_last_buffer[] + INIT(= N_("E90: Cannot unload last buffer")); +EXTERN char e_shell_option_is_empty[] + INIT(= N_("E91: 'shell' option is empty")); +EXTERN char e_buffer_nr_not_found[] + INIT(= N_("E92: Buffer %d not found")); +EXTERN char e_more_than_one_match_for_str[] + INIT(= N_("E93: More than one match for %s")); +EXTERN char e_no_matching_buffer_for_str[] + INIT(= N_("E94: No matching buffer for %s")); +EXTERN char e_buffer_with_this_name_already_exists[] + INIT(= N_("E95: Buffer with this name already exists")); +#if defined(FEAT_DIFF) +EXTERN char e_cannot_diff_more_than_nr_buffers[] + INIT(= N_("E96: Cannot diff more than %d buffers")); +EXTERN char e_cannot_create_diffs[] + INIT(= N_("E97: Cannot create diffs")); +EXTERN char e_cannot_read_diff_output[] + INIT(= N_("E98: Cannot read diff output")); +EXTERN char e_current_buffer_is_not_in_diff_mode[] + INIT(= N_("E99: Current buffer is not in diff mode")); +EXTERN char e_no_other_buffer_in_diff_mode[] + INIT(= N_("E100: No other buffer in diff mode")); +EXTERN char e_more_than_two_buffers_in_diff_mode_dont_know_which_one_to_use[] + INIT(= N_("E101: More than two buffers in diff mode, don't know which one to use")); +EXTERN char e_cant_find_buffer_str[] + INIT(= N_("E102: Can't find buffer \"%s\"")); +EXTERN char e_buffer_str_is_not_in_diff_mode[] + INIT(= N_("E103: Buffer \"%s\" is not in diff mode")); +#endif +#ifdef FEAT_DIGRAPHS +EXTERN char e_escape_not_allowed_in_digraph[] + INIT(= N_("E104: Escape not allowed in digraph")); +#endif +#ifdef FEAT_KEYMAP +EXTERN char e_using_loadkeymap_not_in_sourced_file[] + INIT(= N_("E105: Using :loadkeymap not in a sourced file")); +#endif +// E106 unused +#ifdef FEAT_EVAL +EXTERN char e_missing_parenthesis_str[] + INIT(= N_("E107: Missing parentheses: %s")); +EXTERN char e_no_such_variable_str[] + INIT(= N_("E108: No such variable: \"%s\"")); +EXTERN char e_missing_colon_after_questionmark[] + INIT(= N_("E109: Missing ':' after '?'")); +EXTERN char e_missing_closing_paren[] + INIT(= N_("E110: Missing ')'")); +EXTERN char e_missing_closing_square_brace[] + INIT(= N_("E111: Missing ']'")); +EXTERN char e_option_name_missing_str[] + INIT(= N_("E112: Option name missing: %s")); +EXTERN char e_unknown_option_str[] + INIT(= N_("E113: Unknown option: %s")); +EXTERN char e_missing_double_quote_str[] + INIT(= N_("E114: Missing double quote: %s")); +EXTERN char e_missing_single_quote_str[] + INIT(= N_("E115: Missing single quote: %s")); +EXTERN char e_invalid_arguments_for_function_str[] + INIT(= N_("E116: Invalid arguments for function %s")); +EXTERN char e_unknown_function_str[] + INIT(= N_("E117: Unknown function: %s")); +EXTERN char e_too_many_arguments_for_function_str[] + INIT(= N_("E118: Too many arguments for function: %s")); +EXTERN char e_not_enough_arguments_for_function_str[] + INIT(= N_("E119: Not enough arguments for function: %s")); +EXTERN char e_using_sid_not_in_script_context_str[] + INIT(= N_("E120: Using not in a script context: %s")); +EXTERN char e_undefined_variable_str[] + INIT(= N_("E121: Undefined variable: %s")); +EXTERN char e_undefined_variable_char_str[] + INIT(= N_("E121: Undefined variable: %c:%s")); +EXTERN char e_function_str_already_exists_add_bang_to_replace[] + INIT(= N_("E122: Function %s already exists, add ! to replace it")); +EXTERN char e_undefined_function_str[] + INIT(= N_("E123: Undefined function: %s")); +EXTERN char e_missing_paren_str[] + INIT(= N_("E124: Missing '(': %s")); +EXTERN char e_illegal_argument_str[] + INIT(= N_("E125: Illegal argument: %s")); +EXTERN char e_missing_endfunction[] + INIT(= N_("E126: Missing :endfunction")); +EXTERN char e_cannot_redefine_function_str_it_is_in_use[] + INIT(= N_("E127: Cannot redefine function %s: It is in use")); +EXTERN char e_function_name_must_start_with_capital_or_s_str[] + INIT(= N_("E128: Function name must start with a capital or \"s:\": %s")); +EXTERN char e_function_name_required[] + INIT(= N_("E129: Function name required")); +// E130 unused +EXTERN char e_cannot_delete_function_str_it_is_in_use[] + INIT(= N_("E131: Cannot delete function %s: It is in use")); +EXTERN char e_function_call_depth_is_higher_than_macfuncdepth[] + INIT(= N_("E132: Function call depth is higher than 'maxfuncdepth'")); +EXTERN char e_return_not_inside_function[] + INIT(= N_("E133: :return not inside a function")); +#endif +EXTERN char e_cannot_move_range_of_lines_into_itself[] + INIT(= N_("E134: Cannot move a range of lines into itself")); +EXTERN char e_filter_autocommands_must_not_change_current_buffer[] + INIT(= N_("E135: *Filter* Autocommands must not change current buffer")); +#if defined(FEAT_VIMINFO) +EXTERN char e_viminfo_too_many_errors_skipping_rest_of_file[] + INIT(= N_("E136: viminfo: Too many errors, skipping rest of file")); +EXTERN char e_viminfo_file_is_not_writable_str[] + INIT(= N_("E137: Viminfo file is not writable: %s")); +EXTERN char e_cant_write_viminfo_file_str[] + INIT(= N_("E138: Can't write viminfo file %s!")); +#endif +EXTERN char e_file_is_loaded_in_another_buffer[] + INIT(= N_("E139: File is loaded in another buffer")); +EXTERN char e_use_bang_to_write_partial_buffer[] + INIT(= N_("E140: Use ! to write partial buffer")); +EXTERN char e_no_file_name_for_buffer_nr[] + INIT(= N_("E141: No file name for buffer %ld")); +EXTERN char e_file_not_written_writing_is_disabled_by_write_option[] + INIT(= N_("E142: File not written: Writing is disabled by 'write' option")); +EXTERN char e_autocommands_unexpectedly_deleted_new_buffer_str[] + INIT(= N_("E143: Autocommands unexpectedly deleted new buffer %s")); +EXTERN char e_non_numeric_argument_to_z[] + INIT(= N_("E144: Non-numeric argument to :z")); +EXTERN char e_shell_commands_and_some_functionality_not_allowed_in_rvim[] + INIT(= N_("E145: Shell commands and some functionality not allowed in rvim")); +EXTERN char e_regular_expressions_cant_be_delimited_by_letters[] + INIT(= N_("E146: Regular expressions can't be delimited by letters")); +EXTERN char e_cannot_do_global_recursive_with_range[] + INIT(= N_("E147: Cannot do :global recursive with a range")); +EXTERN char e_regular_expression_missing_from_global[] + INIT(= N_("E148: Regular expression missing from :global")); +EXTERN char e_sorry_no_help_for_str[] + INIT(= N_("E149: Sorry, no help for %s")); +EXTERN char e_not_a_directory_str[] + INIT(= N_("E150: Not a directory: %s")); +EXTERN char e_no_match_str_1[] + INIT(= N_("E151: No match: %s")); +EXTERN char e_cannot_open_str_for_writing_1[] + INIT(= N_("E152: Cannot open %s for writing")); +EXTERN char e_unable_to_open_str_for_reading[] + INIT(= N_("E153: Unable to open %s for reading")); +EXTERN char e_duplicate_tag_str_in_file_str_str[] + INIT(= N_("E154: Duplicate tag \"%s\" in file %s/%s")); +#ifdef FEAT_SIGNS +EXTERN char e_unknown_sign_str[] + INIT(= N_("E155: Unknown sign: %s")); +EXTERN char e_missing_sign_name[] + INIT(= N_("E156: Missing sign name")); +EXTERN char e_invalid_sign_id_nr[] + INIT(= N_("E157: Invalid sign ID: %d")); +#endif +#if defined(FEAT_SIGNS) || defined(FEAT_EVAL) +EXTERN char e_invalid_buffer_name_str[] + INIT(= N_("E158: Invalid buffer name: %s")); +#endif +#ifdef FEAT_SIGNS +EXTERN char e_missing_sign_number[] + INIT(= N_("E159: Missing sign number")); +EXTERN char e_unknown_sign_command_str[] + INIT(= N_("E160: Unknown sign command: %s")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_breakpoint_not_found_str[] + INIT(= N_("E161: Breakpoint not found: %s")); +#endif +EXTERN char e_no_write_since_last_change_for_buffer_str[] + INIT(= N_("E162: No write since last change for buffer \"%s\"")); +EXTERN char e_there_is_only_one_file_to_edit[] + INIT(= N_("E163: There is only one file to edit")); +EXTERN char e_cannot_go_before_first_file[] + INIT(= N_("E164: Cannot go before first file")); +EXTERN char e_cannot_go_beyond_last_file[] + INIT(= N_("E165: Cannot go beyond last file")); +EXTERN char e_cant_open_linked_file_for_writing[] + INIT(= N_("E166: Can't open linked file for writing")); +EXTERN char e_scriptencoding_used_outside_of_sourced_file[] + INIT(= N_("E167: :scriptencoding used outside of a sourced file")); +#ifdef FEAT_EVAL +EXTERN char e_finish_used_outside_of_sourced_file[] + INIT(= N_("E168: :finish used outside of a sourced file")); +#endif +EXTERN char e_command_too_recursive[] + INIT(= N_("E169: Command too recursive")); +#ifdef FEAT_EVAL +EXTERN char e_missing_endwhile[] + INIT(= N_("E170: Missing :endwhile")); +EXTERN char e_missing_endfor[] + INIT(= N_("E170: Missing :endfor")); +EXTERN char e_missing_endif[] + INIT(= N_("E171: Missing :endif")); +EXTERN char e_missing_marker[] + INIT(= N_("E172: Missing marker")); +#endif +EXTERN char e_nr_more_file_to_edit[] + INIT(= N_("E173: %d more file to edit")); +EXTERN char e_nr_more_files_to_edit[] + INIT(= N_("E173: %d more files to edit")); +EXTERN char e_command_already_exists_add_bang_to_replace_it_str[] + INIT(= N_("E174: Command already exists: add ! to replace it: %s")); +EXTERN char e_no_attribute_specified[] + INIT(= N_("E175: No attribute specified")); +EXTERN char e_invalid_number_of_arguments[] + INIT(= N_("E176: Invalid number of arguments")); +EXTERN char e_count_cannot_be_specified_twice[] + INIT(= N_("E177: Count cannot be specified twice")); +EXTERN char e_invalid_default_value_for_count[] + INIT(= N_("E178: Invalid default value for count")); +EXTERN char e_argument_required_for_str[] + INIT(= N_("E179: Argument required for %s")); +EXTERN char e_invalid_complete_value_str[] + INIT(= N_("E180: Invalid complete value: %s")); +EXTERN char e_invalid_address_type_value_str[] + INIT(= N_("E180: Invalid address type value: %s")); +EXTERN char e_invalid_attribute_str[] + INIT(= N_("E181: Invalid attribute: %s")); +EXTERN char e_invalid_command_name[] + INIT(= N_("E182: Invalid command name")); +EXTERN char e_user_defined_commands_must_start_with_an_uppercase_letter[] + INIT(= N_("E183: User defined commands must start with an uppercase letter")); +EXTERN char e_no_such_user_defined_command_str[] + INIT(= N_("E184: No such user-defined command: %s")); +EXTERN char e_cannot_find_color_scheme_str[] + INIT(= N_("E185: Cannot find color scheme '%s'")); +EXTERN char e_no_previous_directory[] + INIT(= N_("E186: No previous directory")); +EXTERN char e_directory_unknown[] + INIT(= N_("E187: Directory unknown")); +EXTERN char e_obtaining_window_position_not_implemented_for_this_platform[] + INIT(= N_("E188: Obtaining window position not implemented for this platform")); +EXTERN char e_str_exists_add_bang_to_override[] + INIT(= N_("E189: \"%s\" exists (add ! to override)")); +EXTERN char e_cannot_open_str_for_writing_2[] + INIT(= N_("E190: Cannot open \"%s\" for writing")); +EXTERN char e_argument_must_be_letter_or_forward_backward_quote[] + INIT(= N_("E191: Argument must be a letter or forward/backward quote")); +EXTERN char e_recursive_use_of_normal_too_deep[] + INIT(= N_("E192: Recursive use of :normal too deep")); +#ifdef FEAT_EVAL +EXTERN char e_str_not_inside_function[] + INIT(= N_("E193: %s not inside a function")); +#endif +EXTERN char e_no_alternate_file_name_to_substitute_for_hash[] + INIT(= N_("E194: No alternate file name to substitute for '#'")); +#ifdef FEAT_VIMINFO +EXTERN char e_cannot_open_viminfo_file_for_reading[] + INIT(= N_("E195: Cannot open viminfo file for reading")); +#endif +#ifndef FEAT_DIGRAPHS +EXTERN char e_no_digraphs_version[] + INIT(= N_("E196: No digraphs in this version")); +#endif +EXTERN char e_cannot_set_language_to_str[] + INIT(= N_("E197: Cannot set language to \"%s\"")); +// E198 unused +#ifdef FEAT_CMDWIN +EXTERN char e_active_window_or_buffer_deleted[] + INIT(= N_("E199: Active window or buffer deleted")); +#endif +EXTERN char e_readpre_autocommands_made_file_unreadable[] + INIT(= N_("E200: *ReadPre autocommands made the file unreadable")); +EXTERN char e_readpre_autocommands_must_not_change_current_buffer[] + INIT(= N_("E201: *ReadPre autocommands must not change current buffer")); +#ifdef FEAT_EVAL +EXTERN char e_conversion_mad_file_unreadable[] + INIT(= N_("E202: Conversion made file unreadable!")); +#endif +EXTERN char e_autocommands_deleted_or_unloaded_buffer_to_be_written[] + INIT(= N_("E203: Autocommands deleted or unloaded buffer to be written")); +EXTERN char e_autocommands_changed_number_of_lines_in_unexpected_way[] + INIT(= N_("E204: Autocommand changed number of lines in unexpected way")); +EXTERN char e_patchmode_cant_save_original_file[] + INIT(= N_("E205: Patchmode: can't save original file")); +EXTERN char e_patchmode_cant_touch_empty_original_file[] + INIT(= N_("E206: Patchmode: can't touch empty original file")); +EXTERN char e_cant_delete_backup_file[] + INIT(= N_("E207: Can't delete backup file")); +EXTERN char e_error_writing_to_str[] + INIT(= N_("E208: Error writing to \"%s\"")); +EXTERN char e_error_closing_str[] + INIT(= N_("E209: Error closing \"%s\"")); +EXTERN char e_error_reading_str[] + INIT(= N_("E210: Error reading \"%s\"")); +EXTERN char e_file_str_no_longer_available[] + INIT(= N_("E211: File \"%s\" no longer available")); +EXTERN char e_cant_open_file_for_writing[] + INIT(= N_("E212: Can't open file for writing")); +EXTERN char e_cannot_convert_add_bang_to_write_without_conversion[] + INIT(= N_("E213: Cannot convert (add ! to write without conversion)")); +#ifdef FEAT_EVAL +EXTERN char e_cant_find_temp_file_for_writing[] + INIT(= N_("E214: Can't find temp file for writing")); +#endif +EXTERN char e_illegal_character_after_star_str[] + INIT(= N_("E215: Illegal character after *: %s")); +EXTERN char e_no_such_event_str[] + INIT(= N_("E216: No such event: %s")); +EXTERN char e_no_such_group_or_event_str[] + INIT(= N_("E216: No such group or event: %s")); +EXTERN char e_cant_execute_autocommands_for_all_events[] + INIT(= N_("E217: Can't execute autocommands for ALL events")); +EXTERN char e_autocommand_nesting_too_deep[] + INIT(= N_("E218: Autocommand nesting too deep")); +EXTERN char e_missing_open_curly[] + INIT(= N_("E219: Missing {.")); +EXTERN char e_missing_close_curly[] + INIT(= N_("E220: Missing }.")); +#ifdef FEAT_EVAL +EXTERN char e_marker_cannot_start_with_lower_case_letter[] + INIT(= N_("E221: Marker cannot start with lower case letter")); +#endif +EXTERN char e_add_to_internal_buffer_that_was_already_read_from[] + INIT(= N_("E222: Add to internal buffer that was already read from")); +EXTERN char e_recursive_mapping[] + INIT(= N_("E223: Recursive mapping")); +EXTERN char e_global_abbreviation_already_exists_for_str[] + INIT(= N_("E224: Global abbreviation already exists for %s")); +EXTERN char e_global_mapping_already_exists_for_str[] + INIT(= N_("E225: Global mapping already exists for %s")); +EXTERN char e_abbreviation_already_exists_for_str[] + INIT(= N_("E226: Abbreviation already exists for %s")); +EXTERN char e_mapping_already_exists_for_str[] + INIT(= N_("E227: Mapping already exists for %s")); +EXTERN char e_makemap_illegal_mode[] + INIT(= N_("E228: makemap: Illegal mode")); +#ifdef FEAT_GUI +EXTERN char e_cannot_start_the_GUI[] + INIT(= N_("E229: Cannot start the GUI")); +EXTERN char e_cannot_read_from_str[] + INIT(= N_("E230: Cannot read from \"%s\"")); +EXTERN char e_guifontwide_invalid[] + INIT(= N_("E231: 'guifontwide' invalid")); +#ifdef FEAT_BEVAL_GUI +EXTERN char e_cannot_create_ballooneval_with_both_message_and_callback[] + INIT(= N_("E232: Cannot create BalloonEval with both message and callback")); +#endif +# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) +EXTERN char e_cannot_open_display[] + INIT(= N_("E233: Cannot open display")); +# endif +# if defined(FEAT_XFONTSET) +EXTERN char e_unknown_fontset_str[] + INIT(= N_("E234: Unknown fontset: %s")); +# endif +# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU) +EXTERN char e_unknown_font_str[] + INIT(= N_("E235: Unknown font: %s")); +# endif +# if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) +EXTERN char e_font_str_is_not_fixed_width[] + INIT(= N_("E236: Font \"%s\" is not fixed-width")); +# endif +#endif +#ifdef MSWIN +EXTERN char e_printer_selection_failed[] + INIT(= N_("E237: Printer selection failed")); +EXTERN char e_print_error_str[] + INIT(= N_("E238: Print error: %s")); +#endif +#ifdef FEAT_SIGNS +EXTERN char e_invalid_sign_text_str[] + INIT(= N_("E239: Invalid sign text: %s")); +#endif +#if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) +EXTERN char e_no_connection_to_x_server[] + INIT(= N_("E240: No connection to the X server")); +#endif +#ifdef FEAT_CLIENTSERVER +EXTERN char e_unable_to_send_to_str[] + INIT(= N_("E241: Unable to send to %s")); +#endif +EXTERN char e_cant_split_window_while_closing_another[] + INIT(= N_("E242: Can't split a window while closing another")); +#if defined(FEAT_GUI_MSWIN) && !defined(FEAT_OLE) +EXTERN char e_argument_not_supported_str_use_ole_version[] + INIT(= N_("E243: Argument not supported: \"-%s\"; Use the OLE version.")); +#endif +#ifdef MSWIN +EXTERN char e_illegal_str_name_str_in_font_name_str[] + INIT(= N_("E244: Illegal %s name \"%s\" in font name \"%s\"")); +EXTERN char e_illegal_char_nr_in_font_name_str[] + INIT(= N_("E245: Illegal char '%c' in font name \"%s\"")); +#endif +EXTERN char e_filechangedshell_autocommand_deleted_buffer[] + INIT(= N_("E246: FileChangedShell autocommand deleted buffer")); +#ifdef FEAT_CLIENTSERVER +EXTERN char e_no_registered_server_named_str[] + INIT(= N_("E247: No registered server named \"%s\"")); +EXTERN char e_failed_to_send_command_to_destination_program[] + INIT(= N_("E248: Failed to send command to the destination program")); +#endif +EXTERN char e_window_layout_changed_unexpectedly[] + INIT(= N_("E249: Window layout changed unexpectedly")); +#ifdef FEAT_XFONTSET +EXTERN char e_fonts_for_the_following_charsets_are_missing_in_fontset[] + INIT(= N_("E250: Fonts for the following charsets are missing in fontset %s:")); +#endif +#ifdef FEAT_CLIENTSERVER +EXTERN char e_vim_instance_registry_property_is_badly_formed_deleted[] + INIT(= N_("E251: VIM instance registry property is badly formed. Deleted!")); +#endif +#ifdef FEAT_GUI_X11 +EXTERN char e_fontsent_name_str_font_str_is_not_fixed_width[] + INIT(= N_("E252: Fontset name: %s - Font '%s' is not fixed-width")); +EXTERN char e_fontset_name_str[] + INIT(= N_("E253: Fontset name: %s")); +#endif +#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) +EXTERN char e_cannot_allocate_color_str[] + INIT(= N_("E254: Cannot allocate color %s")); +#endif +#if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK) +EXTERN char e_couldnt_read_in_sign_data[] + INIT(= N_("E255: Couldn't read in sign data")); +#endif +// E256 unused +#ifdef FEAT_CSCOPE +EXTERN char e_cstag_tag_not_founc[] + INIT(= N_("E257: cstag: Tag not found")); +#endif +#ifdef FEAT_CLIENTSERVER +EXTERN char e_unable_to_send_to_client[] + INIT(= N_("E258: Unable to send to client")); +#endif +#ifdef FEAT_CSCOPE +EXTERN char e_no_matches_found_for_cscope_query_str_of_str[] + INIT(= N_("E259: No matches found for cscope query %s of %s")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_missing_name_after_method[] + INIT(= N_("E260: Missing name after ->")); +#endif +#ifdef FEAT_CSCOPE +EXTERN char e_cscope_connection_str_not_founc[] + INIT(= N_("E261: Cscope connection %s not found")); +EXTERN char e_error_reading_cscope_connection_nr[] + INIT(= N_("E262: Error reading cscope connection %d")); +#endif +#if defined(DYNAMIC_PYTHON) || defined(DYNAMIC_PYTHON3) +EXTERN char e_sorry_this_command_is_disabled_python_library_could_not_be_found[] + INIT(= N_("E263: Sorry, this command is disabled, the Python library could not be loaded.")); +#endif +#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) +EXTERN char e_python_error_initialising_io_object[] + INIT(= N_("E264: Python: Error initialising I/O objects")); +#endif +#ifdef FEAT_RUBY +EXTERN char e_dollar_must_be_an_instance_of_string[] + INIT(= N_("E265: $_ must be an instance of String")); +#endif +#ifdef DYNAMIC_RUBY +EXTERN char e_sorry_this_command_is_disabled_the_ruby_library_could_not_be_loaded[] + INIT(= N_("E266: Sorry, this command is disabled, the Ruby library could not be loaded.")); +#endif +#ifdef FEAT_RUBY +EXTERN char e_unexpected_return[] + INIT(= N_("E267: Unexpected return")); +EXTERN char e_unexpected_next[] + INIT(= N_("E268: Unexpected next")); +EXTERN char e_unexpected_break[] + INIT(= N_("E269: Unexpected break")); +EXTERN char e_unexpected_redo[] + INIT(= N_("E270: Unexpected redo")); +EXTERN char e_retry_outside_of_rescue_clause[] + INIT(= N_("E271: Retry outside of rescue clause")); +EXTERN char e_unhandled_exception[] + INIT(= N_("E272: Unhandled exception")); +EXTERN char e_unknown_longjmp_status_nr[] + INIT(= N_("E273: Unknown longjmp status %d")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_no_white_space_allowed_before_parenthesis[] + INIT(= N_("E274: No white space allowed before parenthesis")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_cannot_add_text_property_to_unloaded_buffer[] + INIT(= N_("E275: Cannot add text property to unloaded buffer")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_function_as_method_str[] + INIT(= N_("E276: Cannot use function as a method: %s")); +#endif +#ifdef FEAT_CLIENTSERVER +EXTERN char e_unable_to_read_server_reply[] + INIT(= N_("E277: Unable to read a server reply")); +#endif +// E278 unused +#if defined(FEAT_TERMINAL) && !defined(UNIX) && !defined(MSWIN) +EXTERN char e_sorry_plusplusshell_not_supported_on_this_system[] + INIT(= N_("E279: Sorry, ++shell is not supported on this system")); +#endif +#ifdef FEAT_TCL +EXTERN char e_tcl_fatal_error_reflist_corrupt_please_report_this[] + INIT(= N_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org")); +#endif +// E281 unused +EXTERN char e_cannot_read_from_str_2[] + INIT(= N_("E282: Cannot read from \"%s\"")); +EXTERN char e_no_marks_matching_str[] + INIT(= N_("E283: No marks matching \"%s\"")); +#ifdef FEAT_XIM +# ifndef FEAT_GUI_GTK +EXTERN char e_cannot_set_ic_values[] + INIT(= N_("E284: Cannot set IC values")); +# endif +# ifdef FEAT_GUI_X11 +EXTERN char e_failed_to_create_input_context[] + INIT(= N_("E285: Failed to create input context")); +EXTERN char e_failed_to_open_input_method[] + INIT(= N_("E286: Failed to open input method")); +EXTERN char e_warning_could_not_set_destroy_callback_to_im[] + INIT(= N_("E287: Warning: Could not set destroy callback to IM")); +EXTERN char e_input_method_doesnt_support_any_style[] + INIT(= N_("E288: Input method doesn't support any style")); +EXTERN char e_input_method_doesnt_support_my_preedit_type[] + INIT(= N_("E289: Input method doesn't support my preedit type")); +# endif +#endif +#ifdef FEAT_SEARCH_EXTRA +EXTERN char e_list_or_number_required[] + INIT(= N_("E290: List or number required")); +#endif +// E291 unused +EXTERN char e_invalid_count_for_del_bytes_nr[] + INIT(= N_("E292: Invalid count for del_bytes(): %ld")); +EXTERN char e_block_was_not_locked[] + INIT(= N_("E293: Block was not locked")); +EXTERN char e_seek_error_in_swap_file_read[] + INIT(= N_("E294: Seek error in swap file read")); +EXTERN char e_read_error_in_swap_file[] + INIT(= N_("E295: Read error in swap file")); +EXTERN char e_seek_error_in_swap_file_write[] + INIT(= N_("E296: Seek error in swap file write")); +EXTERN char e_write_error_in_swap_file[] + INIT(= N_("E297: Write error in swap file")); +EXTERN char e_didnt_get_block_nr_zero[] + INIT(= N_("E298: Didn't get block nr 0?")); +EXTERN char e_didnt_get_block_nr_one[] + INIT(= N_("E298: Didn't get block nr 1?")); +EXTERN char e_didnt_get_block_nr_two[] + INIT(= N_("E298: Didn't get block nr 2?")); +#ifdef FEAT_PERL +EXTERN char e_perl_evaluation_forbidden_in_sandbox_without_safe_module[] + INIT(= N_("E299: Perl evaluation forbidden in sandbox without the Safe module")); +#endif +EXTERN char e_swap_file_already_exists_symlink_attack[] + INIT(= N_("E300: Swap file already exists (symlink attack?)")); +EXTERN char e_oops_lost_the_swap_file[] + INIT(= N_("E301: Oops, lost the swap file!!!")); +EXTERN char e_could_not_rename_swap_file[] + INIT(= N_("E302: Could not rename swap file")); +EXTERN char e_unable_to_open_swap_file_for_str_recovery_impossible[] + INIT(= N_("E303: Unable to open swap file for \"%s\", recovery impossible")); +EXTERN char e_ml_upd_block0_didnt_get_block_zero[] + INIT(= N_("E304: ml_upd_block0(): Didn't get block 0??")); +EXTERN char e_no_swap_file_found_for_str[] + INIT(= N_("E305: No swap file found for %s")); +EXTERN char e_cannot_open_str[] + INIT(= N_("E306: Cannot open %s")); +EXTERN char e_str_does_not_look_like_vim_swap_file[] + INIT(= N_("E307: %s does not look like a Vim swap file")); +EXTERN char e_warning_original_file_may_have_been_changed[] + INIT(= N_("E308: Warning: Original file may have been changed")); +EXTERN char e_unable_to_read_block_one_from_str[] + INIT(= N_("E309: Unable to read block 1 from %s")); +EXTERN char e_block_one_id_wrong_str_not_swp_file[] + INIT(= N_("E310: Block 1 ID wrong (%s not a .swp file?)")); +EXTERN char e_recovery_interrupted[] + INIT(= N_("E311: Recovery Interrupted")); +EXTERN char e_errors_detected_while_recovering_look_for_lines_starting_with_questions[] + INIT(= N_("E312: Errors detected while recovering; look for lines starting with ???")); +EXTERN char e_cannot_preserve_there_is_no_swap_file[] + INIT(= N_("E313: Cannot preserve, there is no swap file")); +EXTERN char e_preserve_failed[] + INIT(= N_("E314: Preserve failed")); +EXTERN char e_ml_get_invalid_lnum_nr[] + INIT(= N_("E315: ml_get: Invalid lnum: %ld")); +EXTERN char e_ml_get_cannot_find_line_nr_in_buffer_nr_str[] + INIT(= N_("E316: ml_get: Cannot find line %ld in buffer %d %s")); +EXTERN char e_pointer_block_id_wrong[] + INIT(= N_("E317: Pointer block id wrong")); +EXTERN char e_pointer_block_id_wrong_two[] + INIT(= N_("E317: Pointer block id wrong 2")); +EXTERN char e_pointer_block_id_wrong_three[] + INIT(= N_("E317: Pointer block id wrong 3")); +EXTERN char e_pointer_block_id_wrong_four[] + INIT(= N_("E317: Pointer block id wrong 4")); +EXTERN char e_updated_too_many_blocks[] + INIT(= N_("E318: Updated too many blocks?")); +EXTERN char e_sorry_command_is_not_available_in_this_version[] + INIT(= N_("E319: Sorry, the command is not available in this version")); +EXTERN char e_cannot_find_line_nr[] + INIT(= N_("E320: Cannot find line %ld")); +EXTERN char e_could_not_reload_str[] + INIT(= N_("E321: Could not reload \"%s\"")); +EXTERN char e_line_number_out_of_range_nr_past_the_end[] + INIT(= N_("E322: Line number out of range: %ld past the end")); +EXTERN char e_line_count_wrong_in_block_nr[] + INIT(= N_("E323: Line count wrong in block %ld")); +#ifdef FEAT_POSTSCRIPT +EXTERN char e_cant_open_postscript_output_file[] + INIT(= N_("E324: Can't open PostScript output file")); +#endif +EXTERN char e_attention[] + INIT(= N_("E325: ATTENTION")); +EXTERN char e_too_many_swap_files_found[] + INIT(= N_("E326: Too many swap files found")); +#ifdef FEAT_MENU +EXTERN char_u e_part_of_menu_item_path_is_not_sub_menu[] + INIT(= N_("E327: Part of menu-item path is not sub-menu")); +EXTERN char e_menu_only_exists_in_another_mode[] + INIT(= N_("E328: Menu only exists in another mode")); +EXTERN char_u e_no_menu_str[] + INIT(= N_("E329: No menu \"%s\"")); +EXTERN char e_menu_path_must_not_lead_to_sub_menu[] + INIT(= N_("E330: Menu path must not lead to a sub-menu")); +EXTERN char e_must_not_add_menu_items_directly_to_menu_bar[] + INIT(= N_("E331: Must not add menu items directly to menu bar")); +EXTERN char e_separator_cannot_be_part_of_menu_path[] + INIT(= N_("E332: Separator cannot be part of a menu path")); +EXTERN char e_menu_path_must_lead_to_menu_item[] + INIT(= N_("E333: Menu path must lead to a menu item")); +EXTERN char e_menu_not_found_str[] + INIT(= N_("E334: Menu not found: %s")); +EXTERN char e_menu_not_defined_for_str_mode[] + INIT(= N_("E335: Menu not defined for %s mode")); +EXTERN char e_menu_path_must_lead_to_sub_menu[] + INIT(= N_("E336: Menu path must lead to a sub-menu")); +EXTERN char e_menu_not_found_check_menu_names[] + INIT(= N_("E337: Menu not found - check menu names")); +#endif +#ifdef FEAT_BROWSE +EXTERN char e_sorry_no_file_browser_in_console_mode[] + INIT(= N_("E338: Sorry, no file browser in console mode")); +#endif +EXTERN char e_pattern_too_long[] + INIT(= N_("E339: Pattern too long")); +// E340 unused +EXTERN char e_internal_error_lalloc_zero[] + INIT(= N_("E341: Internal error: lalloc(0, )")); +EXTERN char e_out_of_memory_allocating_nr_bytes[] + INIT(= N_("E342: Out of memory! (allocating %lu bytes)")); +#ifdef FEAT_PATH_EXTRA +EXTERN char e_invalid_path_number_must_be_at_end_of_path_or_be_followed_by_str[] + INIT(= N_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'.")); +#endif +#ifdef FEAT_SEARCHPATH +EXTERN char e_cant_find_directory_str_in_cdpath[] + INIT(= N_("E344: Can't find directory \"%s\" in cdpath")); +EXTERN char e_cant_find_file_str_in_path[] + INIT(= N_("E345: Can't find file \"%s\" in path")); +EXTERN char e_no_more_directory_str_found_in_cdpath[] + INIT(= N_("E346: No more directory \"%s\" found in cdpath")); +EXTERN char e_no_more_file_str_found_in_path[] + INIT(= N_("E347: No more file \"%s\" found in path")); +#endif +EXTERN char e_no_string_under_cursor[] + INIT(= N_("E348: No string under cursor")); +EXTERN char e_no_identifier_under_cursor[] + INIT(= N_("E349: No identifier under cursor")); +#ifdef FEAT_FOLDING +EXTERN char e_cannot_create_fold_with_current_foldmethod[] + INIT(= N_("E350: Cannot create fold with current 'foldmethod'")); +EXTERN char e_cannot_delete_fold_with_current_foldmethod[] + INIT(= N_("E351: Cannot delete fold with current 'foldmethod'")); +EXTERN char e_cannot_erase_folds_with_current_foldmethod[] + INIT(= N_("E352: Cannot erase folds with current 'foldmethod'")); +#endif +EXTERN char e_nothing_in_register_str[] + INIT(= N_("E353: Nothing in register %s")); +EXTERN char e_invalid_register_name_str[] + INIT(= N_("E354: Invalid register name: '%s'")); +EXTERN char e_unknown_option_str_2[] + INIT(= N_("E355: Unknown option: %s")); +EXTERN char e_get_varp_error[] + INIT(= N_("E356: get_varp ERROR")); +#ifdef FEAT_LANGMAP +EXTERN char e_langmap_matching_character_missing_for_str[] + INIT(= N_("E357: 'langmap': Matching character missing for %s")); +EXTERN char e_langmap_extra_characters_after_semicolon_str[] + INIT(= N_("E358: 'langmap': Extra characters after semicolon: %s")); +#endif +#if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN) \ + || defined(UNIX) || defined(VMS) +EXTERN char e_screen_mode_setting_not_supported[] + INIT(= N_("E359: Screen mode setting not supported")); +#endif +#ifdef AMIGA +EXTERN char e_cannot_execute_shell_with_f_option[] + INIT(= N_("E360: Cannot execute shell with -f option")); +#endif +// E361 unused +#if defined(FEAT_EVAL) && defined(FEAT_FLOAT) +EXTERN char e_using_boolean_value_as_float[] + INIT(= N_("E362: Using a boolean value as a Float")); +#endif +EXTERN char e_pattern_uses_more_memory_than_maxmempattern[] + INIT(= N_("E363: Pattern uses more memory than 'maxmempattern'")); +#ifdef FEAT_LIBCALL +EXTERN char e_library_call_failed_for_str[] + INIT(= N_("E364: Library call failed for \"%s()\"")); +#endif +#ifdef FEAT_POSTSCRIPT +EXTERN char e_failed_to_print_postscript_file[] + INIT(= N_("E365: Failed to print PostScript file")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_not_allowed_to_enter_popup_window[] + INIT(= N_("E366: Not allowed to enter a popup window")); +#endif +EXTERN char e_no_such_group_str[] + INIT(= N_("E367: No such group: \"%s\"")); +#ifdef FEAT_LIBCALL +EXTERN char e_got_sig_str_in_libcall[] + INIT(= N_("E368: Got SIG%s in libcall()")); +#endif +EXTERN char e_invalid_item_in_str_brackets[] + INIT(= N_("E369: Invalid item in %s%%[]")); +#ifdef USING_LOAD_LIBRARY +EXTERN char e_could_not_load_library_str_str[] + INIT(= N_("E370: Could not load library %s: %s")); +#endif +#ifdef FEAT_GUI_MSWIN +EXTERN char e_command_not_found[] + INIT(= N_("E371: Command not found")); +#endif +#ifdef FEAT_QUICKFIX +EXTERN char e_too_many_chr_in_format_string[] + INIT(= N_("E372: Too many %%%c in format string")); +EXTERN char e_unexpected_chr_in_format_str[] + INIT(= N_("E373: Unexpected %%%c in format string")); +EXTERN char e_missing_rsb_in_format_string[] + INIT(= N_("E374: Missing ] in format string")); +EXTERN char e_unsupported_chr_in_format_string[] + INIT(= N_("E375: Unsupported %%%c in format string")); +EXTERN char e_invalid_chr_in_format_string_prefix[] + INIT(= N_("E376: Invalid %%%c in format string prefix")); +EXTERN char e_invalid_chr_in_format_string[] + INIT(= N_("E377: Invalid %%%c in format string")); +EXTERN char e_errorformat_contains_no_pattern[] + INIT(= N_("E378: 'errorformat' contains no pattern")); +EXTERN char e_missing_or_empty_directory_name[] + INIT(= N_("E379: Missing or empty directory name")); +EXTERN char e_at_bottom_of_quickfix_stack[] + INIT(= N_("E380: At bottom of quickfix stack")); +EXTERN char e_at_top_of_quickfix_stack[] + INIT(= N_("E381: At top of quickfix stack")); +EXTERN char e_cannot_write_buftype_option_is_set[] + INIT(= N_("E382: Cannot write, 'buftype' option is set")); +#endif +EXTERN char e_invalid_search_string_str[] + INIT(= N_("E383: Invalid search string: %s")); +EXTERN char e_search_hit_top_without_match_for_str[] + INIT(= N_("E384: Search hit TOP without match for: %s")); +EXTERN char e_search_hit_bottom_without_match_for_str[] + INIT(= N_("E385: Search hit BOTTOM without match for: %s")); +EXTERN char e_expected_question_or_slash_after_semicolon[] + INIT(= N_("E386: Expected '?' or '/' after ';'")); +#ifdef FEAT_FIND_ID +EXTERN char e_match_is_on_current_line[] + INIT(= N_("E387: Match is on current line")); +EXTERN char e_couldnt_find_definition[] + INIT(= N_("E388: Couldn't find definition")); +EXTERN char e_couldnt_find_pattern[] + INIT(= N_("E389: Couldn't find pattern")); +#endif +#ifdef FEAT_SYN_HL +EXTERN char e_illegal_argument_str_2[] + INIT(= N_("E390: Illegal argument: %s")); +EXTERN char e_no_such_syntax_cluster_1[] + INIT(= N_("E391: No such syntax cluster: %s")); +EXTERN char e_no_such_syntax_cluster_2[] + INIT(= N_("E392: No such syntax cluster: %s")); +EXTERN char e_groupthere_not_accepted_here[] + INIT(= N_("E393: group[t]here not accepted here")); +EXTERN char e_didnt_find_region_item_for_str[] + INIT(= N_("E394: Didn't find region item for %s")); +EXTERN char e_contains_argument_not_accepted_here[] + INIT(= N_("E395: Contains argument not accepted here")); +// E396 unused +EXTERN char e_filename_required[] + INIT(= N_("E397: Filename required")); +EXTERN char e_missing_equal_str[] + INIT(= N_("E398: Missing '=': %s")); +EXTERN char e_not_enough_arguments_syntax_region_str[] + INIT(= N_("E399: Not enough arguments: syntax region %s")); +EXTERN char e_no_cluster_specified[] + INIT(= N_("E400: No cluster specified")); +EXTERN char e_pattern_delimiter_not_found_str[] + INIT(= N_("E401: Pattern delimiter not found: %s")); +EXTERN char e_garbage_after_pattern_str[] + INIT(= N_("E402: Garbage after pattern: %s")); +EXTERN char e_syntax_sync_line_continuations_pattern_specified_twice[] + INIT(= N_("E403: syntax sync: Line continuations pattern specified twice")); +EXTERN char e_illegal_arguments_str[] + INIT(= N_("E404: Illegal arguments: %s")); +EXTERN char e_missing_equal_sign_str[] + INIT(= N_("E405: Missing equal sign: %s")); +EXTERN char e_empty_argument_str[] + INIT(= N_("E406: Empty argument: %s")); +EXTERN char e_str_not_allowed_here[] + INIT(= N_("E407: %s not allowed here")); +EXTERN char e_str_must_be_first_in_contains_list[] + INIT(= N_("E408: %s must be first in contains list")); +EXTERN char e_unknown_group_name_str[] + INIT(= N_("E409: Unknown group name: %s")); +EXTERN char e_invalid_syntax_subcommand_str[] + INIT(= N_("E410: Invalid :syntax subcommand: %s")); +#endif +EXTERN char e_highlight_group_name_not_found_str[] + INIT(= N_("E411: Highlight group not found: %s")); +EXTERN char e_not_enough_arguments_highlight_link_str[] + INIT(= N_("E412: Not enough arguments: \":highlight link %s\"")); +EXTERN char e_too_many_arguments_highlight_link_str[] + INIT(= N_("E413: Too many arguments: \":highlight link %s\"")); +EXTERN char e_group_has_settings_highlight_link_ignored[] + INIT(= N_("E414: Group has settings, highlight link ignored")); +EXTERN char e_unexpected_equal_sign_str[] + INIT(= N_("E415: Unexpected equal sign: %s")); +EXTERN char e_missing_equal_sign_str_2[] + INIT(= N_("E416: Missing equal sign: %s")); +EXTERN char e_missing_argument_str[] + INIT(= N_("E417: Missing argument: %s")); +EXTERN char e_illegal_value_str[] + INIT(= N_("E418: Illegal value: %s")); +EXTERN char e_fg_color_unknown[] + INIT(= N_("E419: FG color unknown")); +EXTERN char e_bg_color_unknown[] + INIT(= N_("E420: BG color unknown")); +EXTERN char e_color_name_or_number_not_recognized[] + INIT(= N_("E421: Color name or number not recognized: %s")); +EXTERN char e_terminal_code_too_long_str[] + INIT(= N_("E422: Terminal code too long: %s")); +EXTERN char e_illegal_argument_str_3[] + INIT(= N_("E423: Illegal argument: %s")); +EXTERN char e_too_many_different_highlighting_attributes_in_use[] + INIT(= N_("E424: Too many different highlighting attributes in use")); +EXTERN char e_cannot_go_before_first_matching_tag[] + INIT(= N_("E425: Cannot go before first matching tag")); +EXTERN char e_tag_not_found_str[] + INIT(= N_("E426: Tag not found: %s")); +EXTERN char e_there_is_only_one_matching_tag[] + INIT(= N_("E427: There is only one matching tag")); +EXTERN char e_cannot_go_beyond_last_matching_tag[] + INIT(= N_("E428: Cannot go beyond last matching tag")); +EXTERN char e_file_str_does_not_exist[] + INIT(= N_("E429: File \"%s\" does not exist")); +#ifdef FEAT_EMACS_TAGS +EXTERN char e_tag_file_path_truncated_for_str[] + INIT(= N_("E430: Tag file path truncated for %s\n")); +#endif +EXTERN char e_format_error_in_tags_file_str[] + INIT(= N_("E431: Format error in tags file \"%s\"")); +EXTERN char e_tags_file_not_sorted_str[] + INIT(= N_("E432: Tags file not sorted: %s")); +EXTERN char e_no_tags_file[] + INIT(= N_("E433: No tags file")); +EXTERN char e_canot_find_tag_pattern[] + INIT(= N_("E434: Can't find tag pattern")); +EXTERN char e_couldnt_find_tag_just_guessing[] + INIT(= N_("E435: Couldn't find tag, just guessing!")); +EXTERN char e_no_str_entry_in_termcap[] + INIT(= N_("E436: No \"%s\" entry in termcap")); +EXTERN char e_terminal_capability_cm_required[] + INIT(= N_("E437: Terminal capability \"cm\" required")); +EXTERN char e_u_undo_line_numbers_wrong[] + INIT(= N_("E438: u_undo: Line numbers wrong")); +EXTERN char e_undo_list_corrupt[] + INIT(= N_("E439: Undo list corrupt")); +EXTERN char e_undo_line_missing[] + INIT(= N_("E440: Undo line missing")); +#ifdef FEAT_QUICKFIX +EXTERN char e_there_is_no_preview_window[] + INIT(= N_("E441: There is no preview window")); +#endif +EXTERN char e_cant_split_topleft_and_botright_at_the_same_time[] + INIT(= N_("E442: Can't split topleft and botright at the same time")); +EXTERN char e_cannot_rotate_when_another_window_is_split[] + INIT(= N_("E443: Cannot rotate when another window is split")); +EXTERN char e_cannot_close_last_window[] + INIT(= N_("E444: Cannot close last window")); +EXTERN char e_other_window_contains_changes[] + INIT(= N_("E445: Other window contains changes")); +#ifdef FEAT_SEARCHPATH +EXTERN char e_no_file_name_under_cursor[] + INIT(= N_("E446: No file name under cursor")); +EXTERN char e_cant_find_file_str_in_path_2[] + INIT(= N_("E447: Can't find file \"%s\" in path")); +#endif +#ifdef USING_LOAD_LIBRARY +EXTERN char e_could_not_load_library_function_str[] + INIT(= N_("E448: Could not load library function %s")); +#endif +#ifdef FEAT_CLIENTSERVER +EXTERN char e_invalid_expression_received[] + INIT(= N_("E449: Invalid expression received")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_buffer_number_text_or_list_required[] + INIT(= N_("E450: Buffer number, text or a list required")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_expected_right_curly_str[] + INIT(= N_("E451: Expected }: %s")); +EXTERN char e_double_semicolon_in_list_of_variables[] + INIT(= N_("E452: Double ; in list of variables")); +#endif +EXTERN char e_ul_color_unknown[] + INIT(= N_("E453: UL color unknown")); +#ifdef FEAT_EVAL +EXTERN char e_function_list_was_modified[] + INIT(= N_("E454: Function list was modified")); +#endif +#ifdef FEAT_POSTSCRIPT +EXTERN char e_error_writing_to_postscript_output_file[] + INIT(= N_("E455: Error writing to PostScript output file")); +EXTERN char e_cant_open_file_str_2[] + INIT(= N_("E456: Can't open file \"%s\"")); +EXTERN char e_cant_find_postscript_resource_file_str_ps[] + INIT(= N_("E456: Can't find PostScript resource file \"%s.ps\"")); +EXTERN char e_cant_read_postscript_resource_file_str[] + INIT(= N_("E457: Can't read PostScript resource file \"%s\"")); +#endif +#ifdef FEAT_GUI_X11 +EXTERN char e_cannot_allocate_colormap_entry_some_colors_may_be_incorrect[] + INIT(= N_("E458: Cannot allocate colormap entry, some colors may be incorrect")); +#endif +#if defined(UNIX) || defined(FEAT_SESSION) +EXTERN char e_cannot_go_back_to_previous_directory[] + INIT(= N_("E459: Cannot go back to previous directory")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_entries_missing_in_mapset_dict_argument[] + INIT(= N_("E460: Entries missing in mapset() dict argument")); +EXTERN char e_illegal_variable_name_str[] + INIT(= N_("E461: Illegal variable name: %s")); +#endif +EXTERN char e_could_not_prepare_for_reloading_str[] + INIT(= N_("E462: Could not prepare for reloading \"%s\"")); +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_region_is_guarded_cannot_modify[] + INIT(= N_("E463: Region is guarded, cannot modify")); +#endif +EXTERN char e_ambiguous_use_of_user_defined_command[] + INIT(= N_("E464: Ambiguous use of user-defined command")); +#ifdef FEAT_EVAL +EXTERN char e_ambiguous_use_of_user_defined_command_str[] + INIT(= N_("E464: Ambiguous use of user-defined command: %s")); +#endif +EXTERN char e_winsize_requires_two_number_arguments[] + INIT(= N_("E465: :winsize requires two number arguments")); +EXTERN char e_winpos_requires_two_number_arguments[] + INIT(= N_("E466: :winpos requires two number arguments")); +#ifdef FEAT_EVAL +EXTERN char e_custom_completion_requires_function_argument[] + INIT(= N_("E467: Custom completion requires a function argument")); +#endif +EXTERN char e_completion_argument_only_allowed_for_custom_completion[] + INIT(= N_("E468: Completion argument only allowed for custom completion")); +#ifdef FEAT_CSCOPE +EXTERN char e_invalid_cscopequickfix_flag_chr_for_chr[] + INIT(= N_("E469: Invalid cscopequickfix flag %c for %c")); +#endif +EXTERN char e_command_aborted[] + INIT(= N_("E470: Command aborted")); +EXTERN char e_argument_required[] + INIT(= N_("E471: Argument required")); +EXTERN char e_command_failed[] + INIT(= N_("E472: Command failed")); +EXTERN char e_internal_error_in_regexp[] + INIT(= N_("E473: Internal error in regexp")); +EXTERN char e_invalid_argument[] + INIT(= N_("E474: Invalid argument")); +EXTERN char e_invalid_argument_str[] + INIT(= N_("E475: Invalid argument: %s")); +EXTERN char e_invalid_value_for_argument_str[] + INIT(= N_("E475: Invalid value for argument %s")); +#if defined(FEAT_JOB_CHANNEL) || defined(FEAT_PROP_POPUP) || defined(FEAT_EVAL) +EXTERN char e_invalid_value_for_argument_str_str[] + INIT(= N_("E475: Invalid value for argument %s: %s")); +#endif +EXTERN char e_invalid_command[] + INIT(= N_("E476: Invalid command")); +#ifdef FEAT_EVAL +EXTERN char e_invalid_command_str[] + INIT(= N_("E476: Invalid command: %s")); +#endif +EXTERN char e_no_bang_allowed[] + INIT(= N_("E477: No ! allowed")); +EXTERN char e_dont_panic[] + INIT(= N_("E478: Don't panic!")); +EXTERN char e_no_match[] + INIT(= N_("E479: No match")); +EXTERN char e_no_match_str_2[] + INIT(= N_("E480: No match: %s")); +EXTERN char e_no_range_allowed[] + INIT(= N_("E481: No range allowed")); +EXTERN char e_cant_create_file_str[] + INIT(= N_("E482: Can't create file %s")); +EXTERN char e_cant_get_temp_file_name[] + INIT(= N_("E483: Can't get temp file name")); +EXTERN char e_cant_open_file_str[] + INIT(= N_("E484: Can't open file %s")); +EXTERN char e_cant_read_file_str[] + INIT(= N_("E485: Can't read file %s")); +EXTERN char e_pattern_not_found[] + INIT(= N_("E486: Pattern not found")); +EXTERN char e_pattern_not_found_str[] + INIT(= N_("E486: Pattern not found: %s")); +EXTERN char e_argument_must_be_positive[] + INIT(= N_("E487: Argument must be positive")); +EXTERN char e_trailing_characters[] + INIT(= N_("E488: Trailing characters")); +EXTERN char e_trailing_characters_str[] + INIT(= N_("E488: Trailing characters: %s")); +EXTERN char e_no_call_stack_to_substitute_for_stack[] + INIT(= N_("E489: No call stack to substitute for \"\"")); +#ifdef FEAT_FOLDING +EXTERN char e_no_fold_found[] + INIT(= N_("E490: No fold found")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_json_decode_error_at_str[] + INIT(= N_("E491: JSON decode error at '%s'")); +#endif +EXTERN char e_not_an_editor_command[] + INIT(= N_("E492: Not an editor command")); +EXTERN char e_backwards_range_given[] + INIT(= N_("E493: Backwards range given")); +EXTERN char e_use_w_or_w_gt_gt[] + INIT(= N_("E494: Use w or w>>")); +EXTERN char e_no_autocommand_file_name_to_substitute_for_afile[] + INIT(= N_("E495: No autocommand file name to substitute for \"\"")); +EXTERN char e_no_autocommand_buffer_name_to_substitute_for_abuf[] + INIT(= N_("E496: No autocommand buffer number to substitute for \"\"")); +EXTERN char e_no_autocommand_match_name_to_substitute_for_amatch[] + INIT(= N_("E497: No autocommand match name to substitute for \"\"")); +EXTERN char e_no_source_file_name_to_substitute_for_sfile[] + INIT(= N_("E498: No :source file name to substitute for \"\"")); +EXTERN char e_empty_file_name_for_percent_or_hash_only_works_with_ph[] + // xgettext:no-c-format + INIT(= N_("E499: Empty file name for '%' or '#', only works with \":p:h\"")); +EXTERN char e_evaluates_to_an_empty_string[] + INIT(= N_("E500: Evaluates to an empty string")); +EXTERN char e_at_end_of_file[] + INIT(= N_("E501: At end-of-file")); + // E502 +EXTERN char e_is_a_directory[] + INIT(= N_("is a directory")); + // E503 +EXTERN char e_is_not_file_or_writable_device[] + INIT(= N_("is not a file or writable device")); +EXTERN char e_str_is_not_file_or_writable_device[] + INIT(= N_("E503: \"%s\" is not a file or writable device")); + // E504 +EXTERN char e_is_read_only_cannot_override_W_in_cpoptions[] + INIT(= N_("is read-only (cannot override: \"W\" in 'cpoptions')")); + // E505 +EXTERN char e_is_read_only_add_bang_to_override[] + INIT(= N_("is read-only (add ! to override)")); +EXTERN char e_str_is_read_only_add_bang_to_override[] + INIT(= N_("E505: \"%s\" is read-only (add ! to override)")); +EXTERN char e_canot_write_to_backup_file_add_bang_to_override[] + INIT(= N_("E506: Can't write to backup file (add ! to override)")); +EXTERN char e_close_error_for_backup_file_add_bang_to_write_anyway[] + INIT(= N_("E507: Close error for backup file (add ! to write anyway)")); +EXTERN char e_cant_read_file_for_backup_add_bang_to_write_anyway[] + INIT(= N_("E508: Can't read file for backup (add ! to write anyway)")); +EXTERN char e_cannot_create_backup_file_add_bang_to_write_anyway[] + INIT(= N_("E509: Cannot create backup file (add ! to override)")); +EXTERN char e_cant_make_backup_file_add_bang_to_write_anyway[] + INIT(= N_("E510: Can't make backup file (add ! to write anyway)")); +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_netbeans_already_connected[] + INIT(= N_("E511: NetBeans already connected")); +#endif +EXTERN char e_close_failed[] + INIT(= N_("E512: Close failed")); +EXTERN char e_write_error_conversion_failed_make_fenc_empty_to_override[] + INIT(= N_("E513: Write error, conversion failed (make 'fenc' empty to override)")); +EXTERN char e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override[] + INIT(= N_("E513: Write error, conversion failed in line %ld (make 'fenc' empty to override)")); +EXTERN char e_write_error_file_system_full[] + INIT(= N_("E514: Write error (file system full?)")); +EXTERN char e_no_buffers_were_unloaded[] + INIT(= N_("E515: No buffers were unloaded")); +EXTERN char e_no_buffers_were_deleted[] + INIT(= N_("E516: No buffers were deleted")); +EXTERN char e_no_buffers_were_wiped_out[] + INIT(= N_("E517: No buffers were wiped out")); +EXTERN char e_unknown_option[] + INIT(= N_("E518: Unknown option")); +EXTERN char e_option_not_supported[] + INIT(= N_("E519: Option not supported")); +EXTERN char e_not_allowed_in_modeline[] + INIT(= N_("E520: Not allowed in a modeline")); +EXTERN char e_number_required_after_equal[] + INIT(= N_("E521: Number required after =")); +EXTERN char e_number_required_after_str_equal_str[] + INIT(= N_("E521: Number required: &%s = '%s'")); +EXTERN char e_not_found_in_termcap[] + INIT(= N_("E522: Not found in termcap")); +EXTERN char e_not_allowed_here[] + INIT(= N_("E523: Not allowed here")); +EXTERN char e_missing_colon[] + INIT(= N_("E524: Missing colon")); +EXTERN char e_zero_length_string[] + INIT(= N_("E525: Zero length string")); +#ifdef FEAT_VIMINFO +EXTERN char e_missing_number_after_angle_str_angle[] + INIT(= N_("E526: Missing number after <%s>")); +EXTERN char e_missing_comma[] + INIT(= N_("E527: Missing comma")); +EXTERN char e_must_specify_a_value[] + INIT(= N_("E528: Must specify a ' value")); +#endif +EXTERN char e_cannot_set_term_to_empty_string[] + INIT(= N_("E529: Cannot set 'term' to empty string")); +#ifdef FEAT_GUI +EXTERN char e_cannot_change_term_in_GUI[] + INIT(= N_("E530: Cannot change 'term' in the GUI")); +EXTERN char e_use_gui_to_start_GUI[] + INIT(= N_("E531: Use \":gui\" to start the GUI")); +#endif +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_highlighting_color_name_too_long_in_defineAnnoType[] + INIT(= N_("E532: Highlighting color name too long in defineAnnoType")); +#endif +#ifdef FEAT_GUI +EXTERN char e_cant_select_wide_font[] + INIT(= N_("E533: Can't select wide font")); +EXTERN char e_invalid_wide_font[] + INIT(= N_("E534: Invalid wide font")); +#endif +EXTERN char e_illegal_character_after_chr[] + INIT(= N_("E535: Illegal character after <%c>")); +#ifdef FEAT_FOLDING +EXTERN char e_comma_required[] + INIT(= N_("E536: Comma required")); +EXTERN char e_commentstring_must_be_empty_or_contain_str[] + INIT(= N_("E537: 'commentstring' must be empty or contain %s")); +#endif +EXTERN char e_pattern_found_in_every_line_str[] + INIT(= N_("E538: Pattern found in every line: %s")); +EXTERN char e_illegal_character_str[] + INIT(= N_("E539: Illegal character <%s>")); +#ifdef FEAT_STL_OPT +EXTERN char e_unclosed_expression_sequence[] + INIT(= N_("E540: Unclosed expression sequence")); +// E541 unused +EXTERN char e_unbalanced_groups[] + INIT(= N_("E542: Unbalanced groups")); +#endif +#ifdef MSWIN +EXTERN char e_not_valid_codepage[] + INIT(= N_("E543: Not a valid codepage")); +#endif +#ifdef FEAT_KEYMAP +EXTERN char e_keymap_file_not_found[] + INIT(= N_("E544: Keymap file not found")); +#endif +#ifdef CURSOR_SHAPE +EXTERN char e_missing_colon_2[] + INIT(= N_("E545: Missing colon")); +EXTERN char e_illegal_mode[] + INIT(= N_("E546: Illegal mode")); +#endif +#ifdef FEAT_MOUSESHAPE +EXTERN char e_illegal_mouseshape[] + INIT(= N_("E547: Illegal mouseshape")); +#endif +EXTERN char e_digit_expected[] + INIT(= N_("E548: Digit expected")); +EXTERN char e_illegal_percentage[] + INIT(= N_("E549: Illegal percentage")); +#ifdef FEAT_PRINTER +EXTERN char e_missing_colon_3[] + INIT(= N_("E550: Missing colon")); +EXTERN char e_illegal_component[] + INIT(= N_("E551: Illegal component")); +EXTERN char e_digit_expected_2[] + INIT(= N_("E552: Digit expected")); +#endif +#ifdef FEAT_QUICKFIX +EXTERN char e_no_more_items[] + INIT(= N_("E553: No more items")); +#endif +EXTERN char e_syntax_error_in_str_curlies[] + INIT(= N_("E554: Syntax error in %s{...}")); +EXTERN char e_at_bottom_of_tag_stack[] + INIT(= N_("E555: At bottom of tag stack")); +EXTERN char e_at_top_of_tag_stack[] + INIT(= N_("E556: At top of tag stack")); +EXTERN char e_cannot_open_termcap_file[] + INIT(= N_("E557: Cannot open termcap file")); +EXTERN char e_terminal_entry_not_found_in_terminfo[] + INIT(= N_("E558: Terminal entry not found in terminfo")); +#if defined(HAVE_TGETENT) && !defined(TERMINFO) +EXTERN char e_terminal_entry_not_found_in_termcap[] + INIT(= N_("E559: Terminal entry not found in termcap")); +#endif +#ifdef FEAT_CSCOPE +EXTERN char e_usage_cscope_str[] + INIT(= N_("E560: Usage: cs[cope] %s")); +EXTERN char e_unknown_cscope_search_type[] + INIT(= N_("E561: Unknown cscope search type")); +EXTERN char e_usage_cstag_ident[] + INIT(= N_("E562: Usage: cstag ")); +EXTERN char e_stat_str_error_nr[] + INIT(= N_("E563: stat(%s) error: %d")); +EXTERN char e_str_is_not_directory_or_valid_cscope_database[] + INIT(= N_("E564: %s is not a directory or a valid cscope database")); +#endif +EXTERN char e_not_allowed_to_change_text_or_change_window[] + INIT(= N_("E565: Not allowed to change text or change window")); +#ifdef FEAT_CSCOPE +EXTERN char e_could_not_create_cscope_pipes[] + INIT(= N_("E566: Could not create cscope pipes")); +EXTERN char e_no_cscope_connections[] + INIT(= N_("E567: No cscope connections")); +EXTERN char e_duplicate_cscope_database_not_added[] + INIT(= N_("E568: Duplicate cscope database not added")); +// E569 unused +EXTERN char e_fatal_error_in_cs_manage_matches[] + INIT(= N_("E570: Fatal error in cs_manage_matches")); +#endif +#ifdef DYNAMIC_TCL +EXTERN char e_sorry_this_command_is_disabled_tcl_library_could_not_be_loaded[] + INIT(= N_("E571: Sorry, this command is disabled: the Tcl library could not be loaded.")); +#endif +#ifdef FEAT_TCL +EXTERN char e_exit_code_nr[] + INIT(= N_("E572: Exit code %d")); +#endif +#ifdef FEAT_CLIENTSERVER +EXTERN char e_invalid_server_id_used_str[] + INIT(= N_("E573: Invalid server id used: %s")); +#endif +#ifdef FEAT_VIMINFO +EXTERN char e_unknown_register_type_nr[] + INIT(= N_("E574: Unknown register type %d")); + // E575 +EXTERN char e_illegal_starting_char[] + INIT(= N_("Illegal starting char")); + // E576 +EXTERN char e_nonr_missing_gt[] + INIT(= N_("Missing '>'")); + // E577 +EXTERN char e_illegal_register_name[] + INIT(= N_("Illegal register name")); +#endif +// E578 unused +#ifdef FEAT_EVAL +EXTERN char e_if_nesting_too_deep[] + INIT(= N_("E579: :if nesting too deep")); +EXTERN char e_block_nesting_too_deep[] + INIT(= N_("E579: Block nesting too deep")); +EXTERN char e_endif_without_if[] + INIT(= N_("E580: :endif without :if")); +EXTERN char e_else_without_if[] + INIT(= N_("E581: :else without :if")); +EXTERN char e_elseif_without_if[] + INIT(= N_("E582: :elseif without :if")); +EXTERN char e_multiple_else[] + INIT(= N_("E583: Multiple :else")); +EXTERN char e_elseif_after_else[] + INIT(= N_("E584: :elseif after :else")); +EXTERN char e_while_for_nesting_too_deep[] + INIT(= N_("E585: :while/:for nesting too deep")); +EXTERN char e_continue_without_while_or_for[] + INIT(= N_("E586: :continue without :while or :for")); +EXTERN char e_break_without_while_or_for[] + INIT(= N_("E587: :break without :while or :for")); +EXTERN char e_endwhile_without_while[] + INIT(= N_("E588: :endwhile without :while")); +EXTERN char e_endfor_without_for[] + INIT(= N_("E588: :endfor without :for")); +#endif +EXTERN char e_backupext_and_patchmode_are_equal[] + INIT(= N_("E589: 'backupext' and 'patchmode' are equal")); +#ifdef FEAT_QUICKFIX +EXTERN char e_preview_window_already_exists[] + INIT(= N_("E590: A preview window already exists")); +#endif +EXTERN char e_winheight_cannot_be_smaller_than_winminheight[] + INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'")); +EXTERN char e_winwidth_cannot_be_smaller_than_winminwidth[] + INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'")); +EXTERN char e_need_at_least_nr_lines[] + INIT(= N_("E593: Need at least %d lines")); +EXTERN char e_need_at_least_nr_columns[] + INIT(= N_("E594: Need at least %d columns")); +#ifdef FEAT_LINEBREAK +EXTERN char e_showbreak_contains_unprintable_or_wide_character[] + INIT(= N_("E595: 'showbreak' contains unprintable or wide character")); +#endif +#ifdef FEAT_GUI +EXTERN char e_invalid_fonts[] + INIT(= N_("E596: Invalid font(s)")); +# ifdef FEAT_XFONTSET +EXTERN char e_cant_select_fontset[] + INIT(= N_("E597: Can't select fontset")); +EXTERN char e_invalid_fontset[] + INIT(= N_("E598: Invalid fontset")); +# endif +#endif +#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) +EXTERN char e_value_of_imactivatekey_is_invalid[] + INIT(= N_("E599: Value of 'imactivatekey' is invalid")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_missing_endtry[] + INIT(= N_("E600: Missing :endtry")); +EXTERN char e_try_nesting_too_deep[] + INIT(= N_("E601: :try nesting too deep")); +EXTERN char e_endtry_without_try[] + INIT(= N_("E602: :endtry without :try")); +EXTERN char e_catch_without_try[] + INIT(= N_("E603: :catch without :try")); +EXTERN char e_catch_after_finally[] + INIT(= N_("E604: :catch after :finally")); +EXTERN char e_exception_not_caught_str[] + INIT(= N_("E605: Exception not caught: %s")); +EXTERN char e_finally_without_try[] + INIT(= N_("E606: :finally without :try")); +EXTERN char e_multiple_finally[] + INIT(= N_("E607: Multiple :finally")); +EXTERN char e_cannot_throw_exceptions_with_vim_prefix[] + INIT(= N_("E608: Cannot :throw exceptions with 'Vim' prefix")); +#endif +#ifdef FEAT_CSCOPE +EXTERN char e_cscope_error_str[] + INIT(= N_("E609: Cscope error: %s")); +#endif +EXTERN char e_no_argument_to_delete[] + INIT(= N_("E610: No argument to delete")); +#ifdef FEAT_EVAL +EXTERN char e_using_special_as_number[] + INIT(= N_("E611: Using a Special as a Number")); +#endif +#ifdef FEAT_SIGNS +EXTERN char e_too_many_signs_defined[] + INIT(= N_("E612: Too many signs defined")); +#endif +#if defined(MSWIN) && defined(FEAT_PRINTER) +EXTERN char e_unknown_printer_font_str[] + INIT(= N_("E613: Unknown printer font: %s")); +#endif +// E614 unused +// E615 unused +// E616 unused +#ifdef FEAT_GUI_GTK +EXTERN char e_cannot_be_changed_in_gtk_GUI[] + INIT(= N_("E617: Cannot be changed in the GTK GUI")); +#endif +#ifdef FEAT_POSTSCRIPT +EXTERN char e_file_str_is_not_postscript_resource_file[] + INIT(= N_("E618: File \"%s\" is not a PostScript resource file")); +EXTERN char e_file_str_is_not_supported_postscript_resource_file[] + INIT(= N_("E619: File \"%s\" is not a supported PostScript resource file")); +EXTERN char e_unable_to_convert_to_print_encoding_str[] + INIT(= N_("E620: Unable to convert to print encoding \"%s\"")); +EXTERN char e_str_resource_file_has_wrong_version[] + INIT(= N_("E621: \"%s\" resource file has wrong version")); +#endif +#ifdef FEAT_CSCOPE +EXTERN char e_could_not_fork_for_cscope[] + INIT(= N_("E622: Could not fork for cscope")); +# ifndef UNIX +EXTERN char e_could_not_spawn_cscope_process[] + INIT(= N_("E623: Could not spawn cscope process")); +# endif +#endif +#if defined(FEAT_PRINTER) && defined(FEAT_POSTSCRIPT) +EXTERN char e_cant_open_file_str_3[] + INIT(= N_("E624: Can't open file \"%s\"")); +#endif +#if defined(FEAT_CSCOPE) && !defined(UNIX) +EXTERN char e_cannot_open_cscope_database_str[] + INIT(= N_("E625: Cannot open cscope database: %s")); +EXTERN char e_cannot_get_cscope_database_information[] + INIT(= N_("E626: Cannot get cscope database information")); +#endif +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_missing_colon_str[] + INIT(= "E627: Missing colon: %s"); +EXTERN char e_missing_bang_or_slash_in_str[] + INIT(= "E628: Missing ! or / in: %s"); +#ifdef NBDEBUG +EXTERN char e_bad_return_from_nb_do_cmd[] + INIT(= "E629: Bad return from nb_do_cmd"); +#endif +#endif +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_str_write_while_not_connected[] + INIT(= N_("E630: %s(): Write while not connected")); +EXTERN char e_str_write_failed[] + INIT(= N_("E631: %s(): Write failed")); +#endif +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_invalid_buffer_identifier_in_getlength[] + INIT(= "E632: Invalid buffer identifier in getLength"); +EXTERN char e_invalid_buffer_identifier_in_gettext[] + INIT(= "E633: Invalid buffer identifier in getText"); +EXTERN char e_invalid_buffer_identifier_in_remove[] + INIT(= "E634: Invalid buffer identifier in remove"); +EXTERN char e_invalid_buffer_identifier_in_insert[] + INIT(= "E635: Invalid buffer identifier in insert"); +EXTERN char e_invalid_buffer_identifier_in_create[] + INIT(= "E636: Invalid buffer identifier in create"); +EXTERN char e_invalid_buffer_identifier_in_startdocumentlisten[] + INIT(= "E637: Invalid buffer identifier in startDocumentListen"); +EXTERN char e_invalid_buffer_identifier_in_stopdocumentlisten[] + INIT(= "E638: Invalid buffer identifier in stopDocumentListen"); +EXTERN char e_invalid_buffer_identifier_in_settitle[] + INIT(= "E639: Invalid buffer identifier in setTitle"); +EXTERN char e_invalid_buffer_identifier_in_initdone[] + INIT(= "E640: Invalid buffer identifier in initDone"); +EXTERN char e_invalid_buffer_identifier_in_setbuffernumber[] + INIT(= "E641: Invalid buffer identifier in setBufferNumber"); +EXTERN char e_file_str_not_found_in_setbuffernumber[] + INIT(= "E642: File %s not found in setBufferNumber"); +EXTERN char e_invalid_buffer_identifier_in_setfullname[] + INIT(= "E643: Invalid buffer identifier in setFullName"); +EXTERN char e_invalid_buffer_identifier_in_editfile[] + INIT(= "E644: Invalid buffer identifier in editFile"); +EXTERN char e_invalid_buffer_identifier_in_setvisible[] + INIT(= "E645: Invalid buffer identifier in setVisible"); +EXTERN char e_invalid_buffer_identifier_in_setmodified[] + INIT(= "E646: Invalid buffer identifier in setModified"); +EXTERN char e_invalid_buffer_identifier_in_setdot[] + INIT(= "E647: Invalid buffer identifier in setDot"); +EXTERN char e_invalid_buffer_identifier_in_close[] + INIT(= "E648: Invalid buffer identifier in close"); +EXTERN char e_invalid_buffer_identifier_in_close_2[] + INIT(= "E649: Invalid buffer identifier in close"); +EXTERN char e_invalid_buffer_identifier_in_defineannotype[] + INIT(= "E650: Invalid buffer identifier in defineAnnoType"); +EXTERN char e_invalid_buffer_identifier_in_addanno[] + INIT(= "E651: Invalid buffer identifier in addAnno"); +EXTERN char e_invalid_buffer_identifier_in_getanno[] + INIT(= "E652: Invalid buffer identifier in getAnno"); +#endif +// E653 unused +EXTERN char e_missing_delimiter_after_search_pattern_str[] + INIT(= N_("E654: Missing delimiter after search pattern: %s")); +#ifdef FEAT_EVAL +EXTERN char e_too_many_symbolic_links_cycle[] + INIT(= N_("E655: Too many symbolic links (cycle?)")); +#endif +#ifdef FEAT_NETBEANS_INTG + // E656 +EXTERN char e_netbeans_disallows_writes_of_unmodified_buffers[] + INIT(= N_("NetBeans disallows writes of unmodified buffers")); + // E657 +EXTERN char e_partial_writes_disallowed_for_netbeans_buffers[] + INIT(= N_("Partial writes disallowed for NetBeans buffers")); +EXTERN char e_netbeans_connection_lost_for_buffer_nr[] + INIT(= N_("E658: NetBeans connection lost for buffer %d")); +#endif +#ifdef FEAT_PYTHON +EXTERN char e_cannot_invoke_python_recursively[] + INIT(= N_("E659: Cannot invoke Python recursively")); +#endif +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_cannot_open_netbeans_connection_info_file[] + INIT(= "E660: Cannot open NetBeans connection info file"); +#endif +#ifdef FEAT_MULTI_LANG +EXTERN char e_sorry_no_str_help_for_str[] + INIT(= N_("E661: Sorry, no '%s' help for %s")); +#endif +EXTERN char e_at_start_of_changelist[] + INIT(= N_("E662: At start of changelist")); +EXTERN char e_at_end_of_changelist[] + INIT(= N_("E663: At end of changelist")); +EXTERN char e_changelist_is_empty[] + INIT(= N_("E664: Changelist is empty")); +#ifdef FEAT_GUI +EXTERN char e_cannot_start_gui_no_valid_font_found[] + INIT(= N_("E665: Cannot start GUI, no valid font found")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_compiler_not_supported_str[] + INIT(= N_("E666: Compiler not supported: %s")); +#endif +#ifdef HAVE_FSYNC +EXTERN char e_fsync_failed[] + INIT(= N_("E667: Fsync failed")); +#endif +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_wrong_access_mode_for_netbeans_connection_info_file_str[] + INIT(= N_("E668: Wrong access mode for NetBeans connection info file: \"%s\"")); +#endif +EXTERN char e_unprintable_character_in_group_name[] + INIT(= N_("E669: Unprintable character in group name")); +EXTERN char e_mix_of_help_file_encodings_within_language_str[] + INIT(= N_("E670: Mix of help file encodings within a language: %s")); +#ifdef FEAT_GUI_MSWIN +EXTERN char e_cannot_find_window_title_str[] + INIT(= N_("E671: Cannot find window title \"%s\"")); +EXTERN char e_unable_to_open_window_inside_mdi_application[] + INIT(= N_("E672: Unable to open window inside MDI application")); +#endif +#if defined(FEAT_PRINTER) && defined(FEAT_POSTSCRIPT) +EXTERN char e_incompatible_multi_byte_encoding_and_character_set[] + INIT(= N_("E673: Incompatible multi-byte encoding and character set")); +EXTERN char e_printmbcharset_cannot_be_empty_with_multi_byte_encoding[] + INIT(= N_("E674: printmbcharset cannot be empty with multi-byte encoding.")); +EXTERN char e_no_default_font_specified_for_multi_byte_printing[] + INIT(= N_("E675: No default font specified for multi-byte printing.")); +#endif +EXTERN char e_no_matching_autocommands_for_acwrite_buffer[] + INIT(= N_("E676: No matching autocommands for acwrite buffer")); +#ifdef FEAT_SYN_HL +EXTERN char e_error_writing_temp_file[] + INIT(= N_("E677: Error writing temp file")); +#endif +EXTERN char e_invalid_character_after_str_2[] + INIT(= N_("E678: Invalid character after %s%%[dxouU]")); +#ifdef FEAT_SYN_HL +EXTERN char e_recursive_loop_loading_syncolor_vim[] + INIT(= N_("E679: Recursive loop loading syncolor.vim")); +#endif +EXTERN char e_buffer_nr_invalid_buffer_number[] + INIT(= N_("E680: : invalid buffer number")); +#ifdef FEAT_QUICKFIX +EXTERN char e_buffer_is_not_loaded[] + INIT(= N_("E681: Buffer is not loaded")); +EXTERN char e_invalid_search_pattern_or_delimiter[] + INIT(= N_("E682: Invalid search pattern or delimiter")); +EXTERN char e_file_name_missing_or_invalid_pattern[] + INIT(= N_("E683: File name missing or invalid pattern")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_list_index_out_of_range_nr[] + INIT(= N_("E684: List index out of range: %ld")); +#endif +EXTERN char e_internal_error_str[] + INIT(= N_("E685: Internal error: %s")); +#ifdef FEAT_EVAL +EXTERN char e_argument_of_str_must_be_list[] + INIT(= N_("E686: Argument of %s must be a List")); +EXTERN char e_less_targets_than_list_items[] + INIT(= N_("E687: Less targets than List items")); +EXTERN char e_more_targets_than_list_items[] + INIT(= N_("E688: More targets than List items")); +EXTERN char e_can_only_index_list_dictionary_or_blob[] + INIT(= N_("E689: Can only index a List, Dictionary or Blob")); +EXTERN char e_missing_in_after_for[] + INIT(= N_("E690: Missing \"in\" after :for")); +EXTERN char e_can_only_compare_list_with_list[] + INIT(= N_("E691: Can only compare List with List")); +EXTERN char e_invalid_operation_for_list[] + INIT(= N_("E692: Invalid operation for List")); +// E693 unused +EXTERN char e_invalid_operation_for_funcrefs[] + INIT(= N_("E694: Invalid operation for Funcrefs")); +EXTERN char e_cannot_index_a_funcref[] + INIT(= N_("E695: Cannot index a Funcref")); +EXTERN char e_missing_comma_in_list_str[] + INIT(= N_("E696: Missing comma in List: %s")); +EXTERN char e_missing_end_of_list_rsb_str[] + INIT(= N_("E697: Missing end of List ']': %s")); +EXTERN char e_variable_nested_too_deep_for_making_copy[] + INIT(= N_("E698: Variable nested too deep for making a copy")); +EXTERN char e_too_many_arguments[] + INIT(= N_("E699: Too many arguments")); +EXTERN char e_unknown_function_str_2[] + INIT(= N_("E700: Unknown function: %s")); +EXTERN char e_invalid_type_for_len[] + INIT(= N_("E701: Invalid type for len()")); +EXTERN char e_sort_compare_function_failed[] + INIT(= N_("E702: Sort compare function failed")); +EXTERN char e_using_funcref_as_number[] + INIT(= N_("E703: Using a Funcref as a Number")); +EXTERN char e_funcref_variable_name_must_start_with_capital_str[] + INIT(= N_("E704: Funcref variable name must start with a capital: %s")); +EXTERN char e_variable_name_conflicts_with_existing_function_str[] + INIT(= N_("E705: Variable name conflicts with existing function: %s")); +// E706 unused +EXTERN char e_function_name_conflicts_with_variable_str[] + INIT(= N_("E707: Function name conflicts with variable: %s")); +EXTERN char e_slice_must_come_last[] + INIT(= N_("E708: [:] must come last")); +EXTERN char e_slice_requires_list_or_blob_value[] + INIT(= N_("E709: [:] requires a List or Blob value")); +EXTERN char e_list_value_has_more_items_than_targets[] + INIT(= N_("E710: List value has more items than targets")); +EXTERN char e_list_value_does_not_have_enough_items[] + INIT(= N_("E711: List value does not have enough items")); +EXTERN char e_argument_of_str_must_be_list_or_dictionary[] + INIT(= N_("E712: Argument of %s must be a List or Dictionary")); +EXTERN char e_cannot_use_empty_key_for_dictionary[] + INIT(= N_("E713: Cannot use empty key for Dictionary")); +EXTERN char e_list_required[] + INIT(= N_("E714: List required")); +EXTERN char e_dictionary_required[] + INIT(= N_("E715: Dictionary required")); +EXTERN char e_key_not_present_in_dictionary[] + INIT(= N_("E716: Key not present in Dictionary: \"%s\"")); +EXTERN char e_dictionary_entry_already_exists[] + INIT(= N_("E717: Dictionary entry already exists")); +EXTERN char e_funcref_required[] + INIT(= N_("E718: Funcref required")); +EXTERN char e_cannot_slice_dictionary[] + INIT(= N_("E719: Cannot slice a Dictionary")); +EXTERN char e_missing_colon_in_dictionary[] + INIT(= N_("E720: Missing colon in Dictionary: %s")); +EXTERN char e_duplicate_key_in_dicitonary[] + INIT(= N_("E721: Duplicate key in Dictionary: \"%s\"")); +EXTERN char e_missing_comma_in_dictionary[] + INIT(= N_("E722: Missing comma in Dictionary: %s")); +EXTERN char e_missing_dict_end[] + INIT(= N_("E723: Missing end of Dictionary '}': %s")); +EXTERN char e_variable_nested_too_deep_for_displaying[] + INIT(= N_("E724: Variable nested too deep for displaying")); +EXTERN char e_calling_dict_function_without_dictionary_str[] + INIT(= N_("E725: Calling dict function without Dictionary: %s")); +EXTERN char e_stride_is_zero[] + INIT(= N_("E726: Stride is zero")); +EXTERN char e_start_past_end[] + INIT(= N_("E727: Start past end")); +EXTERN char e_using_dictionary_as_number[] + INIT(= N_("E728: Using a Dictionary as a Number")); +EXTERN char e_using_funcref_as_string[] + INIT(= N_("E729: Using a Funcref as a String")); +EXTERN char e_using_list_as_string[] + INIT(= N_("E730: Using a List as a String")); +EXTERN char e_using_dictionary_as_string[] + INIT(= N_("E731: Using a Dictionary as a String")); +EXTERN char e_using_endfor_with_while[] + INIT(= N_("E732: Using :endfor with :while")); +EXTERN char e_using_endwhile_with_for[] + INIT(= N_("E733: Using :endwhile with :for")); +EXTERN char e_wrong_variable_type_for_str_equal[] + INIT(= N_("E734: Wrong variable type for %s=")); +EXTERN char e_can_only_compare_dictionary_with_dictionary[] + INIT(= N_("E735: Can only compare Dictionary with Dictionary")); +EXTERN char e_invalid_operation_for_dictionary[] + INIT(= N_("E736: Invalid operation for Dictionary")); +EXTERN char e_key_already_exists_str[] + INIT(= N_("E737: Key already exists: %s")); +EXTERN char e_cant_list_variables_for_str[] + INIT(= N_("E738: Can't list variables for %s")); +EXTERN char e_cannot_create_directory_str[] + INIT(= N_("E739: Cannot create directory: %s")); +EXTERN char e_too_many_arguments_for_function_str_2[] + INIT(= N_("E740: Too many arguments for function %s")); +EXTERN char e_value_is_locked[] + INIT(= N_("E741: Value is locked")); +EXTERN char e_value_is_locked_str[] + INIT(= N_("E741: Value is locked: %s")); +EXTERN char e_cannot_change_value[] + INIT(= N_("E742: Cannot change value")); +EXTERN char e_cannot_change_value_of_str[] + INIT(= N_("E742: Cannot change value of %s")); +EXTERN char e_variable_nested_too_deep_for_unlock[] + INIT(= N_("E743: Variable nested too deep for (un)lock")); +#endif +#ifdef FEAT_NETBEANS_INTG +EXTERN char e_netbeans_does_not_allow_changes_in_read_only_files[] + INIT(= N_("E744: NetBeans does not allow changes in read-only files")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_using_list_as_number[] + INIT(= N_("E745: Using a List as a Number")); +EXTERN char e_function_name_does_not_match_script_file_name_str[] + INIT(= N_("E746: Function name does not match script file name: %s")); +#endif +EXTERN char e_cannot_change_directory_buffer_is_modified_add_bang_to_override[] + INIT(= N_("E747: Cannot change directory, buffer is modified (add ! to override)")); +EXTERN char e_no_previously_used_register[] + INIT(= N_("E748: No previously used register")); +EXTERN char e_empty_buffer[] + INIT(= N_("E749: Empty buffer")); +#ifdef FEAT_PROFILE +EXTERN char e_first_use_profile_start_fname[] + INIT(= N_("E750: First use \":profile start {fname}\"")); +#endif +#ifdef FEAT_SPELL +EXTERN char e_output_file_name_must_not_have_region_name[] + INIT(= N_("E751: Output file name must not have region name")); +EXTERN char e_no_previous_spell_replacement[] + INIT(= N_("E752: No previous spell replacement")); +EXTERN char e_not_found_str[] + INIT(= N_("E753: Not found: %s")); +EXTERN char e_only_up_to_nr_regions_supported[] + INIT(= N_("E754: Only up to %d regions supported")); +EXTERN char e_invalid_region_in_str[] + INIT(= N_("E755: Invalid region in %s")); +EXTERN char e_spell_checking_is_not_possible[] + INIT(= N_("E756: Spell checking is not possible")); +EXTERN char e_this_does_not_look_like_spell_file[] + INIT(= N_("E757: This does not look like a spell file")); +EXTERN char e_truncated_spell_file[] + INIT(= N_("E758: Truncated spell file")); +EXTERN char e_format_error_in_spell_file[] + INIT(= N_("E759: Format error in spell file")); +EXTERN char e_no_word_count_in_str[] + INIT(= N_("E760: No word count in %s")); +EXTERN char e_format_error_in_affix_file_fol_low_or_upp[] + INIT(= N_("E761: Format error in affix file FOL, LOW or UPP")); +EXTERN char e_character_in_fol_low_or_upp_is_out_of_range[] + INIT(= N_("E762: Character in FOL, LOW or UPP is out of range")); +EXTERN char e_word_characters_differ_between_spell_files[] + INIT(= N_("E763: Word characters differ between spell files")); +#endif +#if defined(FEAT_SYN_HL) || defined(FEAT_COMPL_FUNC) +EXTERN char e_option_str_is_not_set[] + INIT(= N_("E764: Option '%s' is not set")); +#endif +#ifdef FEAT_SPELL +EXTERN char e_spellfile_does_not_have_nr_entries[] + INIT(= N_("E765: 'spellfile' does not have %d entries")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_insufficient_arguments_for_printf[] + INIT(= N_("E766: Insufficient arguments for printf()")); +#endif +EXTERN char e_too_many_arguments_to_printf[] + INIT(= N_("E767: Too many arguments for printf()")); +EXTERN char e_swap_file_exists_str_silent_overrides[] + INIT(= N_("E768: Swap file exists: %s (:silent! overrides)")); +EXTERN char e_missing_rsb_after_str_lsb[] + INIT(= N_("E769: Missing ] after %s[")); +#ifdef FEAT_SPELL +EXTERN char e_unsupported_section_in_spell_file[] + INIT(= N_("E770: Unsupported section in spell file")); +EXTERN char e_old_spell_file_needs_to_be_updated[] + INIT(= N_("E771: Old spell file, needs to be updated")); +EXTERN char e_spell_file_is_for_newer_version_of_vim[] + INIT(= N_("E772: Spell file is for newer version of Vim")); +#endif +EXTERN char e_symlink_loop_for_str[] + INIT(= N_("E773: Symlink loop for \"%s\"")); +#ifdef FEAT_EVAL +EXTERN char e_operatorfunc_is_empty[] + INIT(= N_("E774: 'operatorfunc' is empty")); +#else +EXTERN char e_eval_feature_not_available[] + INIT(= N_("E775: Eval feature not available")); +#endif +#ifdef FEAT_QUICKFIX +EXTERN char e_no_location_list[] + INIT(= N_("E776: No location list")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_string_or_list_expected[] + INIT(= N_("E777: String or List expected")); +#endif +#ifdef FEAT_SPELL +EXTERN char e_this_does_not_look_like_sug_file_str[] + INIT(= N_("E778: This does not look like a .sug file: %s")); +EXTERN char e_old_sug_file_needs_to_be_updated_str[] + INIT(= N_("E779: Old .sug file, needs to be updated: %s")); +EXTERN char e_sug_file_is_for_newer_version_of_vim_str[] + INIT(= N_("E780: .sug file is for newer version of Vim: %s")); +EXTERN char e_sug_file_doesnt_match_spl_file_str[] + INIT(= N_("E781: .sug file doesn't match .spl file: %s")); +EXTERN char e_error_while_reading_sug_file_str[] + INIT(= N_("E782: Error while reading .sug file: %s")); +EXTERN char e_duplicate_char_in_map_entry[] + INIT(= N_("E783: Duplicate char in MAP entry")); +#endif +EXTERN char e_cannot_close_last_tab_page[] + INIT(= N_("E784: Cannot close last tab page")); +#ifdef FEAT_EVAL +# ifdef FEAT_COMPL_FUNC +EXTERN char e_complete_can_only_be_used_in_insert_mode[] + INIT(= N_("E785: complete() can only be used in Insert mode")); +# endif +EXTERN char e_range_not_allowed[] + INIT(= N_("E786: Range not allowed")); +#endif +#ifdef FEAT_DIFF +EXTERN char e_buffer_changed_unexpectedly[] + INIT(= N_("E787: Buffer changed unexpectedly")); +#endif +EXTERN char e_not_allowed_to_edit_another_buffer_now[] + INIT(= N_("E788: Not allowed to edit another buffer now")); +#ifdef FEAT_SYN_HL +EXTERN char e_error_missing_rsb_str[] + INIT(= N_("E789: Missing ']': %s")); +#endif +EXTERN char e_undojoin_is_not_allowed_after_undo[] + INIT(= N_("E790: undojoin is not allowed after undo")); +#ifdef FEAT_KEYMAP +EXTERN char e_empty_keymap_entry[] + INIT(= N_("E791: Empty keymap entry")); +#endif +#ifdef FEAT_MENU +EXTERN char e_empty_menu_name[] + INIT(= N_("E792: Empty menu name")); +#endif +#ifdef FEAT_DIFF +EXTERN char e_no_other_buffer_in_diff_mode_is_modifiable[] + INIT(= N_("E793: No other buffer in diff mode is modifiable")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_cannot_set_variable_in_sandbox[] + INIT(= N_("E794: Cannot set variable in the sandbox")); +EXTERN char e_cannot_set_variable_in_sandbox_str[] + INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\"")); +EXTERN char e_cannot_delete_variable[] + INIT(= N_("E795: Cannot delete variable")); +EXTERN char e_cannot_delete_variable_str[] + INIT(= N_("E795: Cannot delete variable %s")); + // E796 +# ifdef MSWIN +EXTERN char e_writing_to_device_disabled_with_opendevice_option[] + INIT(= N_("writing to device disabled with 'opendevice' option")); +# endif +#endif +#ifdef FEAT_SPELL +EXTERN char e_spellfilemising_autocommand_deleted_buffer[] + INIT(= N_("E797: SpellFileMissing autocommand deleted buffer")); +#endif +#ifdef FEAT_SEARCH_EXTRA +EXTERN char e_id_is_reserved_for_match_nr[] + INIT(= N_("E798: ID is reserved for \":match\": %d")); +EXTERN char e_invalid_id_nr_must_be_greater_than_or_equal_to_one_1[] + INIT(= N_("E799: Invalid ID: %d (must be greater than or equal to 1)")); +#endif +#ifndef FEAT_ARABIC +EXTERN char e_arabic_cannot_be_used_not_enabled_at_compile_time[] + INIT(= N_("E800: Arabic cannot be used: Not enabled at compile time\n")); +#endif +#ifdef FEAT_SEARCH_EXTRA +EXTERN char e_id_already_taken_nr[] + INIT(= N_("E801: ID already taken: %d")); +EXTERN char e_invalid_id_nr_must_be_greater_than_or_equal_to_one_2[] + INIT(= N_("E802: Invalid ID: %d (must be greater than or equal to 1)")); +EXTERN char e_id_not_found_nr[] + INIT(= N_("E803: ID not found: %d")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_percent_with_float[] + // xgettext:no-c-format + INIT(= N_("E804: Cannot use '%' with Float")); +#endif +#ifdef FEAT_FLOAT +EXTERN char e_using_float_as_number[] + INIT(= N_("E805: Using a Float as a Number")); +EXTERN char e_using_float_as_string[] + INIT(= N_("E806: Using Float as a String")); +#endif +#ifdef FEAT_FLOAT +EXTERN char e_expected_float_argument_for_printf[] + INIT(= N_("E807: Expected Float argument for printf()")); +#endif +#if defined(FEAT_EVAL) && defined(FEAT_FLOAT) +EXTERN char e_number_or_float_required[] + INIT(= N_("E808: Number or Float required")); +#endif +#ifndef FEAT_EVAL +EXTERN char e_hashsmall_is_not_available_without_the_eval_feature[] + INIT(= N_("E809: #< is not available without the +eval feature")); +#endif +#ifdef FEAT_DIFF +EXTERN char e_cannot_read_or_write_temp_files[] + INIT(= N_("E810: Cannot read or write temp files")); +#endif +EXTERN char e_not_allowed_to_change_buffer_information_now[] + INIT(= N_("E811: Not allowed to change buffer information now")); +EXTERN char e_autocommands_changed_buffer_or_buffer_name[] + INIT(= N_("E812: Autocommands changed buffer or buffer name")); +EXTERN char e_cannot_close_autocmd_or_popup_window[] + INIT(= N_("E813: Cannot close autocmd or popup window")); +EXTERN char e_cannot_close_window_only_autocmd_window_would_remain[] + INIT(= N_("E814: Cannot close window, only autocmd window would remain")); +#ifdef FEAT_MZSCHEME +EXTERN char e_sorry_this_command_is_disabled_the_mzscheme_libraries_could_not_be_loaded[] + INIT(= N_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded.")); +#endif +#ifdef FEAT_DIFF +EXTERN char e_cannot_read_patch_output[] + INIT(= N_("E816: Cannot read patch output")); +#endif +#ifdef FEAT_CRYPT +EXTERN char e_blowfish_big_little_endian_use_wrong[] + INIT(= N_("E817: Blowfish big/little endian use wrong")); +EXTERN char e_sha256_test_failed[] + INIT(= N_("E818: sha256 test failed")); +EXTERN char e_blowfish_test_failed[] + INIT(= N_("E819: Blowfish test failed")); +EXTERN char e_sizeof_uint32_isnot_four[] + INIT(= N_("E820: sizeof(uint32_t) != 4")); +EXTERN char e_file_is_encrypted_with_unknown_method[] + INIT(= N_("E821: File is encrypted with unknown method")); +#endif +#ifdef FEAT_PERSISTENT_UNDO +EXTERN char e_cannot_open_undo_file_for_reading_str[] + INIT(= N_("E822: Cannot open undo file for reading: %s")); +EXTERN char e_not_an_undo_file_str[] + INIT(= N_("E823: Not an undo file: %s")); +EXTERN char e_incompatible_undo_file_str[] + INIT(= N_("E824: Incompatible undo file: %s")); +EXTERN char e_corrupted_undo_file_str_str[] + INIT(= N_("E825: Corrupted undo file (%s): %s")); +# ifdef FEAT_CRYPT +EXTERN char e_undo_file_decryption_failed[] + INIT(= N_("E826: Undo file decryption failed: %s")); +# else +EXTERN char e_undo_file_is_encrypted_str[] + INIT(= N_("E827: Undo file is encrypted: %s")); +# endif +EXTERN char e_cannot_open_undo_file_for_writing_str[] + INIT(= N_("E828: Cannot open undo file for writing: %s")); +EXTERN char e_write_error_in_undo_file_str[] + INIT(= N_("E829: Write error in undo file: %s")); +#endif +EXTERN char e_undo_number_nr_not_found[] + INIT(= N_("E830: Undo number %ld not found")); +#ifdef FEAT_CRYPT +EXTERN char e_bf_key_init_called_with_empty_password[] + INIT(= N_("E831: bf_key_init() called with empty password")); +# ifdef FEAT_PERSISTENT_UNDO +EXTERN char e_non_encrypted_file_has_encrypted_undo_file[] + INIT(= N_("E832: Non-encrypted file has encrypted undo file: %s")); +# endif +#else +EXTERN char e_str_is_encrypted_and_this_version_of_vim_does_not_support_encryption[] + INIT(= N_("E833: %s is encrypted and this version of Vim does not support encryption")); +#endif +EXTERN char e_conflicts_with_value_of_listchars[] + INIT(= N_("E834: Conflicts with value of 'listchars'")); +EXTERN char e_conflicts_with_value_of_fillchars[] + INIT(= N_("E835: Conflicts with value of 'fillchars'")); +#ifdef DYNAMIC_PYTHON +EXTERN char e_this_vim_cannot_execute_python_after_using_py3[] + INIT(= N_("E836: This Vim cannot execute :python after using :py3")); +EXTERN char e_this_vim_cannot_execute_py3_after_using_python[] + INIT(= N_("E837: This Vim cannot execute :py3 after using :python")); +#endif +#if defined(FEAT_NETBEANS_INTG) && defined(FEAT_GUI) +EXTERN char e_netbeans_is_not_supported_with_this_GUI[] + INIT(= N_("E838: NetBeans is not supported with this GUI")); +#endif +// E839 unused +# ifdef FEAT_COMPL_FUNC +EXTERN char e_complete_function_deleted_text[] + INIT(= N_("E840: Completion function deleted text")); +# endif +EXTERN char e_reserved_name_cannot_be_used_for_user_defined_command[] + INIT(= N_("E841: Reserved name, cannot be used for user defined command")); +EXTERN char e_no_line_number_to_use_for_slnum[] + INIT(= N_("E842: No line number to use for \"\"")); +#ifdef FEAT_CRYPT +EXTERN char e_error_while_updating_swap_file_crypt[] + INIT(= N_("E843: Error while updating swap file crypt")); +#endif +#ifdef FEAT_CONCEAL +EXTERN char e_invalid_cchar_value[] + INIT(= N_("E844: Invalid cchar value")); +#endif +#ifdef FEAT_SPELL +EXTERN char e_insufficient_memory_word_list_will_be_incomplete[] + INIT(= N_("E845: Insufficient memory, word list will be incomplete")); +#endif +EXTERN char e_key_code_not_set[] + INIT(= N_("E846: Key code not set")); +#ifdef FEAT_SYN_HL +EXTERN char e_too_many_syntax_includes[] + INIT(= N_("E847: Too many syntax includes")); +EXTERN char e_too_many_syntax_clusters[] + INIT(= N_("E848: Too many syntax clusters")); +#endif +EXTERN char e_too_many_highlight_and_syntax_groups[] + INIT(= N_("E849: Too many highlight and syntax groups")); +#ifndef FEAT_CLIPBOARD +EXTERN char e_invalid_register_name[] + INIT(= N_("E850: Invalid register name")); +#endif +#ifdef FEAT_GUI +EXTERN char e_failed_to_create_new_process_for_GUI[] + INIT(= N_("E851: Failed to create a new process for the GUI")); +EXTERN char e_the_child_process_failed_to_start_GUI[] + INIT(= N_("E852: The child process failed to start the GUI")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_duplicate_argument_name_str[] + INIT(= N_("E853: Duplicate argument name: %s")); +#endif +EXTERN char e_path_too_long_for_completion[] + INIT(= N_("E854: Path too long for completion")); +EXTERN char e_autocommands_caused_command_to_abort[] + INIT(= N_("E855: Autocommands caused command to abort")); +#ifdef FEAT_EVAL +EXTERN char e_assert_fails_second_arg[] + INIT(= N_("E856: \"assert_fails()\" second argument must be a string or a list with one or two strings")); +EXTERN char e_dictionary_key_str_required[] + INIT(= N_("E857: Dictionary key \"%s\" required")); +#endif +#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) +EXTERN char e_eval_did_not_return_valid_python_object[] + INIT(= N_("E858: Eval did not return a valid python object")); +EXTERN char e_failed_to_convert_returned_python_object_to_vim_value[] + INIT(= N_("E859: Failed to convert returned python object to a Vim value")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_need_id_and_type_with_both[] + INIT(= N_("E860: Need 'id' and 'type' with 'both'")); +# ifdef FEAT_TERMINAL +EXTERN char e_cannot_open_second_popup_with_terminal[] + INIT(= N_("E861: Cannot open a second popup with a terminal")); +# endif +#endif +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_g_here[] + INIT(= N_("E862: Cannot use g: here")); +#endif +#if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) +EXTERN char e_not_allowed_for_terminal_in_popup_window[] + INIT(= N_("E863: Not allowed for a terminal in a popup window")); +#endif +EXTERN char e_percent_hash_can_only_be_followed_by_zero_one_two_automatic_engine_will_be_used[] + // xgettext:no-c-format + INIT(= N_("E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be used")); +EXTERN char e_nfa_regexp_end_encountered_prematurely[] + INIT(= N_("E865: (NFA) Regexp end encountered prematurely")); +EXTERN char e_nfa_regexp_misplaced_chr[] + INIT(= N_("E866: (NFA regexp) Misplaced %c")); +EXTERN char e_nfa_regexp_unknown_operator_z_chr[] + INIT(= N_("E867: (NFA regexp) Unknown operator '\\z%c'")); +EXTERN char e_nfa_regexp_unknown_operator_percent_chr[] + INIT(= N_("E867: (NFA regexp) Unknown operator '\\%%%c'")); +EXTERN char e_error_building_nfa_with_equivalence_class[] + INIT(= N_("E868: Error building NFA with equivalence class!")); +EXTERN char e_nfa_regexp_unknown_operator_at_chr[] + INIT(= N_("E869: (NFA regexp) Unknown operator '\\@%c'")); +EXTERN char e_nfa_regexp_error_reading_repetition_limits[] + INIT(= N_("E870: (NFA regexp) Error reading repetition limits")); +EXTERN char e_nfa_regexp_cant_have_multi_follow_multi[] + INIT(= N_("E871: (NFA regexp) Can't have a multi follow a multi")); +EXTERN char e_nfa_regexp_too_many_parens[] + INIT(= N_("E872: (NFA regexp) Too many '('")); +EXTERN char e_nfa_regexp_proper_termination_error[] + INIT(= N_("E873: (NFA regexp) proper termination error")); +EXTERN char e_nfa_regexp_could_not_pop_stack[] + INIT(= N_("E874: (NFA regexp) Could not pop the stack!")); +EXTERN char e_nfa_regexp_while_converting_from_postfix_to_nfa_too_many_stats_left_on_stack[] + INIT(= N_("E875: (NFA regexp) (While converting from postfix to NFA), too many states left on stack")); +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(= 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 +EXTERN char e_nfa_regexp_too_many_z[] + INIT(= N_("E879: (NFA regexp) Too many \\z(")); +#endif +#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) +EXTERN char e_cant_handle_systemexit_of_python_exception_in_vim[] + INIT(= N_("E880: Can't handle SystemExit of python exception in vim")); +#endif +EXTERN char e_line_count_changed_unexpectedly[] + INIT(= N_("E881: Line count changed unexpectedly")); +#ifdef FEAT_EVAL +EXTERN char e_uniq_compare_function_failed[] + INIT(= N_("E882: Uniq compare function failed")); +EXTERN char e_search_pattern_and_expression_register_may_not_contain_two_or_more_lines[] + INIT(= N_("E883: Search pattern and expression register may not contain two or more lines")); +EXTERN char e_function_name_cannot_contain_colon_str[] + INIT(= N_("E884: Function name cannot contain a colon: %s")); +#endif +#ifdef FEAT_SIGNS +EXTERN char e_not_possible_to_change_sign_str[] + INIT(= N_("E885: Not possible to change sign %s")); +#endif +#ifdef FEAT_VIMINFO +EXTERN char e_cant_rename_viminfo_file_to_str[] + INIT(= N_("E886: Can't rename viminfo file to %s!")); +#endif +EXTERN char e_sorry_this_command_is_disabled_python_side_module_could_not_be_loaded[] + INIT(= N_("E887: Sorry, this command is disabled, the Python's site module could not be loaded.")); +EXTERN char e_nfa_regexp_cannot_repeat_str[] + INIT(= N_("E888: (NFA regexp) cannot repeat %s")); +#ifdef FEAT_PROP_POPUP +EXTERN char e_number_required[] + INIT(= N_("E889: Number required")); +#endif +#ifdef FEAT_SYN_HL +EXTERN char e_trailing_char_after_rsb_str_str[] + INIT(= N_("E890: Trailing char after ']': %s]%s")); +#endif +#ifdef FEAT_FLOAT +EXTERN char e_using_funcref_as_float[] + INIT(= N_("E891: Using a Funcref as a Float")); +EXTERN char e_using_string_as_float[] + INIT(= N_("E892: Using a String as a Float")); +EXTERN char e_using_list_as_float[] + INIT(= N_("E893: Using a List as a Float")); +EXTERN char e_using_dictionary_as_float[] + INIT(= N_("E894: Using a Dictionary as a Float")); +#endif +#ifdef FEAT_MZSCHEME +EXTERN char e_sorry_this_command_is_disabled_the_mzscheme_racket_base_module_could_not_be_loaded[] + INIT(= N_("E895: Sorry, this command is disabled, the MzScheme's racket/base module could not be loaded.")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_argument_of_str_must_be_list_dictionary_or_blob[] + INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob")); +EXTERN char e_list_or_blob_required[] + INIT(= N_("E897: List or Blob required")); +#endif +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_socket_in_channel_connect[] + INIT(= N_("E898: socket() in channel_connect()")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_argument_of_str_must_be_list_or_blob[] + INIT(= N_("E899: Argument of %s must be a List or Blob")); +EXTERN char e_maxdepth_must_be_non_negative_number[] + INIT(= N_("E900: maxdepth must be non-negative number")); +#endif +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_getaddrinfo_in_channel_open_str[] + INIT(= N_("E901: getaddrinfo() in channel_open(): %s")); +# ifndef FEAT_IPV6 +EXTERN char e_gethostbyname_in_channel_open[] + INIT(= N_("E901: gethostbyname() in channel_open()")); +# endif +EXTERN char e_cannot_connect_to_port[] + INIT(= N_("E902: Cannot connect to port")); +EXTERN char e_received_command_with_non_string_argument[] + INIT(= N_("E903: Received command with non-string argument")); +EXTERN char e_last_argument_for_expr_call_must_be_number[] + INIT(= N_("E904: Last argument for expr/call must be a number")); +EXTERN char e_third_argument_for_call_must_be_list[] + INIT(= N_("E904: Third argument for call must be a list")); +EXTERN char e_received_unknown_command_str[] + INIT(= N_("E905: Received unknown command: %s")); +EXTERN char e_not_an_open_channel[] + INIT(= N_("E906: Not an open channel")); +#endif +#ifdef FEAT_FLOAT +EXTERN char e_using_special_value_as_float[] + INIT(= N_("E907: Using a special value as a Float")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_using_invalid_value_as_string_str[] + INIT(= N_("E908: Using an invalid value as a String: %s")); +EXTERN char e_cannot_index_special_variable[] + INIT(= N_("E909: Cannot index a special variable")); +#endif +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_using_job_as_number[] + INIT(= N_("E910: Using a Job as a Number")); +EXTERN char e_using_job_as_float[] + INIT(= N_("E911: Using a Job as a Float")); +EXTERN char e_cannot_use_evalexpr_sendexpr_with_raw_or_nl_channel[] + INIT(= N_("E912: Cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel")); +EXTERN char e_using_channel_as_number[] + INIT(= N_("E913: Using a Channel as a Number")); +EXTERN char e_using_channel_as_float[] + INIT(= N_("E914: Using a Channel as a Float")); +EXTERN char e_in_io_buffer_requires_in_buf_or_in_name_to_be_set[] + INIT(= N_("E915: in_io buffer requires in_buf or in_name to be set")); +EXTERN char e_not_valid_job[] + INIT(= N_("E916: Not a valid job")); +EXTERN char e_cannot_use_callback_with_str[] + INIT(= N_("E917: Cannot use a callback with %s()")); +EXTERN char e_buffer_must_be_loaded_str[] + INIT(= N_("E918: Buffer must be loaded: %s")); +#endif +EXTERN char e_directory_not_found_in_str_str[] + INIT(= N_("E919: Directory not found in '%s': \"%s\"")); +#ifdef FEAT_JOB_CHANNEL +EXTERN char e_io_file_requires_name_to_be_set[] + INIT(= N_("E920: _io file requires _name to be set")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_invalid_callback_argument[] + INIT(= N_("E921: Invalid callback argument")); +EXTERN char e_expected_dict[] + INIT(= N_("E922: Expected a dict")); +EXTERN char e_second_argument_of_function_must_be_list_or_dict[] + INIT(= N_("E923: Second argument of function() must be a list or a dict")); +#endif +#ifdef FEAT_QUICKFIX +EXTERN char e_current_window_was_closed[] + INIT(= N_("E924: Current window was closed")); +EXTERN char e_current_quickfix_list_was_changed[] + INIT(= N_("E925: Current quickfix list was changed")); +EXTERN char e_current_location_list_was_changed[] + INIT(= N_("E926: Current location list was changed")); +#endif +#ifdef FEAT_EVAL +# ifdef FEAT_QUICKFIX +EXTERN char e_invalid_action_str_1[] + INIT(= N_("E927: Invalid action: '%s'")); +# endif +EXTERN char e_string_required[] + INIT(= N_("E928: String required")); +#endif +#ifdef FEAT_VIMINFO +EXTERN char e_too_many_viminfo_temp_files_like_str[] + INIT(= N_("E929: Too many viminfo temp files, like %s!")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_redir_inside_execute[] + INIT(= N_("E930: Cannot use :redir inside execute()")); +#endif +EXTERN char e_buffer_cannot_be_registered[] + INIT(= N_("E931: Buffer cannot be registered")); +#ifdef FEAT_EVAL +EXTERN char e_closure_function_should_not_be_at_top_level[] + INIT(= N_("E932: Closure function should not be at top level: %s")); +EXTERN char e_function_was_deleted_str[] + INIT(= N_("E933: Function was deleted: %s")); +#endif +#ifdef FEAT_SIGNS +EXTERN char e_cannot_jump_to_buffer_that_does_not_have_name[] + INIT(= N_("E934: Cannot jump to a buffer that does not have a name")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_invalid_submatch_number_nr[] + INIT(= N_("E935: Invalid submatch number: %d")); +#endif +EXTERN char e_cannot_delete_current_group[] + INIT(= N_("E936: Cannot delete the current group")); +EXTERN char e_attempt_to_delete_buffer_that_is_in_use_str[] + INIT(= N_("E937: Attempt to delete a buffer that is in use: %s")); +#ifdef FEAT_EVAL +EXTERN char e_duplicate_key_in_json_str[] + INIT(= N_("E938: Duplicate key in JSON: \"%s\"")); +#endif +EXTERN char e_positive_count_required[] + INIT(= N_("E939: Positive count required")); +#ifdef FEAT_EVAL +EXTERN char e_cannot_lock_or_unlock_variable_str[] + INIT(= N_("E940: Cannot lock or unlock variable %s")); +# ifdef FEAT_CLIENTSERVER +EXTERN char e_already_started_server[] + INIT(= N_("E941: Already started a server")); +# else +EXTERN char e_clientserver_feature_not_available[] + INIT(= N_("E942: +clientserver feature not available")); +# endif +#endif +EXTERN char e_command_table_needs_to_be_updated_run_make_cmdidxs[] + INIT(= N_("E943: Command table needs to be updated, run 'make cmdidxs'")); +EXTERN char e_reverse_range_in_character_class[] + INIT(= N_("E944: Reverse range in character class")); +EXTERN char e_range_too_large_in_character_class[] + INIT(= N_("E945: Range too large in character class")); +#ifdef FEAT_TERMINAL +EXTERN char e_cannot_make_terminal_with_running_job_modifiable[] + INIT(= N_("E946: Cannot make a terminal with running job modifiable")); +EXTERN char e_job_still_running_in_buffer_str[] + INIT(= N_("E947: Job still running in buffer \"%s\"")); +EXTERN char e_job_still_running[] + INIT(= N_("E948: Job still running")); +EXTERN char e_job_still_running_add_bang_to_end_the_job[] + INIT(= N_("E948: Job still running (add ! to end the job)")); +#endif +EXTERN char e_file_changed_while_writing[] + INIT(= N_("E949: File changed while writing")); +EXTERN char e_cannot_convert_between_str_and_str[] + INIT(= N_("E950: Cannot convert between %s and %s")); +EXTERN char e_percent_value_too_large[] + // xgettext:no-c-format + INIT(= N_("E951: \\% value too large")); +#if defined(FEAT_EVAL) && defined(FEAT_QUICKFIX) +EXTERN char e_autocommand_caused_recursive_behavior[] + INIT(= N_("E952: Autocommand caused recursive behavior")); +#endif +#ifdef FEAT_TERMINAL +EXTERN char e_file_exists_str[] + INIT(= N_("E953: File exists: %s")); +#endif +#if defined(FEAT_TERMGUICOLORS) && defined(FEAT_VTP) +EXTERN char e_24_bit_colors_are_not_supported_on_this_environment[] + INIT(= N_("E954: 24-bit colors are not supported on this environment")); +#endif +#ifdef FEAT_TERMINAL +EXTERN char e_not_terminal_buffer[] + INIT(= N_("E955: Not a terminal buffer")); +#endif +EXTERN char e_cannot_use_pattern_recursively[] + INIT(= N_("E956: Cannot use pattern recursively")); +#ifdef FEAT_EVAL +EXTERN char e_invalid_window_number[] + INIT(= N_("E957: Invalid window number")); +#endif +#ifdef FEAT_TERMINAL +EXTERN char e_job_already_finished[] + INIT(= N_("E958: Job already finished")); +#endif +#ifdef FEAT_DIFF +EXTERN char e_invalid_diff_format[] + INIT(= N_("E959: Invalid diff format.")); +EXTERN char e_problem_creating_internal_diff[] + INIT(= N_("E960: Problem creating the internal diff")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_no_line_number_to_use_for_sflnum[] + INIT(= N_("E961: No line number to use for \"\"")); +EXTERN char e_invalid_action_str_2[] + INIT(= N_("E962: Invalid action: '%s'")); +EXTERN char e_setting_str_to_value_with_wrong_type[] + INIT(= N_("E963: Setting %s to value with wrong type")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char_u e_invalid_column_number_nr[] + INIT(= N_("E964: Invalid column number: %ld")); +EXTERN char e_missing_property_type_name[] + INIT(= N_("E965: Missing property type name")); +#endif +#ifdef FEAT_EVAL +EXTERN char_u e_invalid_line_number_nr[] + INIT(= N_("E966: Invalid line number: %ld")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_text_property_info_corrupted[] + INIT(= N_("E967: Text property info corrupted")); +EXTERN char e_need_at_least_one_of_id_or_type[] + INIT(= N_("E968: Need at least one of 'id' or 'type'")); +EXTERN char e_property_type_str_already_defined[] + INIT(= N_("E969: Property type %s already defined")); +EXTERN char e_unknown_highlight_group_name_str[] + INIT(= N_("E970: Unknown highlight group name: '%s'")); +EXTERN char e_type_not_exist[] + INIT(= N_("E971: Property type %s does not exist")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_blob_value_does_not_have_right_number_of_bytes[] + INIT(= N_("E972: Blob value does not have the right number of bytes")); +EXTERN char e_blob_literal_should_have_an_even_number_of_hex_characters[] + INIT(= N_("E973: Blob literal should have an even number of hex characters")); +EXTERN char e_using_blob_as_number[] + INIT(= N_("E974: Using a Blob as a Number")); +# ifdef FEAT_FLOAT +EXTERN char e_using_blob_as_float[] + INIT(= N_("E975: Using a Blob as a Float")); +# endif +EXTERN char e_using_blob_as_string[] + INIT(= N_("E976: Using a Blob as a String")); +EXTERN char e_can_only_compare_blob_with_blob[] + INIT(= N_("E977: Can only compare Blob with Blob")); +EXTERN char e_invalid_operation_for_blob[] + INIT(= N_("E978: Invalid operation for Blob")); +EXTERN char e_blob_index_out_of_range_nr[] + INIT(= N_("E979: Blob index out of range: %ld")); +# ifndef USE_INPUT_BUF +EXTERN char e_lowlevel_input_not_supported[] + INIT(= N_("E980: Lowlevel input not supported")); +# endif +#endif +EXTERN char e_command_not_allowed_in_rvim[] + INIT(= N_("E981: Command not allowed in rvim")); +#if defined(FEAT_TERMINAL) && defined(MSWIN) +EXTERN char e_conpty_is_not_available[] + INIT(= N_("E982: ConPTY is not available")); +#endif +EXTERN char e_duplicate_argument_str[] + INIT(= N_("E983: Duplicate argument: %s")); +EXTERN char e_scriptversion_used_outside_of_sourced_file[] + INIT(= N_("E984: :scriptversion used outside of a sourced file")); +#ifdef FEAT_EVAL +EXTERN char e_dot_equal_not_supported_with_script_version_two[] + INIT(= N_("E985: .= is not supported with script version >= 2")); +EXTERN char e_cannot_modify_tag_stack_within_tagfunc[] + INIT(= N_("E986: Cannot modify the tag stack within tagfunc")); +EXTERN char e_invalid_return_value_from_tagfunc[] + INIT(= N_("E987: Invalid return value from tagfunc")); +#endif +#ifdef GUI_MAY_SPAWN +EXTERN char e_gui_cannot_be_used_cannot_execute_gvim_exe[] + INIT(= N_("E988: GUI cannot be used. Cannot execute gvim.exe.")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_non_default_argument_follows_default_argument[] + INIT(= N_("E989: Non-default argument follows default argument")); +EXTERN char e_missing_end_marker_str[] + INIT(= N_("E990: Missing end marker '%s'")); +EXTERN char e_cannot_use_heredoc_here[] + INIT(= N_("E991: Cannot use =<< here")); +#endif +EXTERN char e_not_allowed_in_modeline_when_modelineexpr_is_off[] + INIT(= N_("E992: Not allowed in a modeline when 'modelineexpr' is off")); +#ifdef FEAT_EVAL +EXTERN char e_window_nr_is_not_popup_window[] + INIT(= N_("E993: Window %d is not a popup window")); +EXTERN char e_not_allowed_in_popup_window[] + INIT(= N_("E994: Not allowed in a popup window")); +EXTERN char e_cannot_modify_existing_variable[] + INIT(= N_("E995: Cannot modify existing variable")); +EXTERN char e_cannot_lock_range[] + INIT(= N_("E996: Cannot lock a range")); +EXTERN char e_cannot_lock_option[] + INIT(= N_("E996: Cannot lock an option")); +EXTERN char e_cannot_lock_list_or_dict[] + INIT(= N_("E996: Cannot lock a list or dict")); +EXTERN char e_cannot_lock_environment_variable[] + INIT(= N_("E996: Cannot lock an environment variable")); +EXTERN char e_cannot_lock_register[] + INIT(= N_("E996: Cannot lock a register")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_tabpage_not_found_nr[] + INIT(= N_("E997: Tabpage not found: %d")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_reduce_of_an_empty_str_with_no_initial_value[] + INIT(= N_("E998: Reduce of an empty %s with no initial value")); +#endif +EXTERN char e_scriptversion_not_supported_nr[] + INIT(= N_("E999: scriptversion not supported: %d")); +// E1000 unused +#ifdef FEAT_EVAL +EXTERN char e_variable_not_found_str[] + INIT(= N_("E1001: Variable not found: %s")); +EXTERN char e_syntax_error_at_str[] + INIT(= N_("E1002: Syntax error at %s")); +EXTERN char e_missing_return_value[] + INIT(= N_("E1003: Missing return value")); +EXTERN char e_white_space_required_before_and_after_str_at_str[] + INIT(= N_("E1004: White space required before and after '%s' at \"%s\"")); +EXTERN char e_too_many_argument_types[] + INIT(= N_("E1005: Too many argument types")); +EXTERN char e_str_is_used_as_argument[] + INIT(= N_("E1006: %s is used as an argument")); +EXTERN char e_mandatory_argument_after_optional_argument[] + INIT(= N_("E1007: Mandatory argument after optional argument")); +EXTERN char e_missing_type[] + INIT(= N_("E1008: Missing ")); +EXTERN char e_missing_gt_after_type[] + INIT(= N_("E1009: Missing > after type")); +EXTERN char e_type_not_recognized_str[] + INIT(= N_("E1010: Type not recognized: %s")); +EXTERN char e_name_too_long_str[] + INIT(= N_("E1011: Name too long: %s")); +EXTERN char e_type_mismatch_expected_str_but_got_str[] + INIT(= N_("E1012: Type mismatch; expected %s but got %s")); +EXTERN char e_type_mismatch_expected_str_but_got_str_in_str[] + INIT(= N_("E1012: Type mismatch; expected %s but got %s in %s")); +EXTERN char e_argument_nr_type_mismatch_expected_str_but_got_str[] + INIT(= N_("E1013: Argument %d: type mismatch, expected %s but got %s")); +EXTERN char e_argument_nr_type_mismatch_expected_str_but_got_str_in_str[] + INIT(= N_("E1013: Argument %d: type mismatch, expected %s but got %s in %s")); +EXTERN char e_invalid_key_str[] + INIT(= N_("E1014: Invalid key: %s")); +EXTERN char e_name_expected_str[] + INIT(= N_("E1015: Name expected: %s")); +EXTERN char e_cannot_declare_a_scope_variable[] + INIT(= N_("E1016: Cannot declare a %s variable: %s")); +EXTERN char e_cannot_declare_an_environment_variable[] + INIT(= N_("E1016: Cannot declare an environment variable: %s")); +EXTERN char e_variable_already_declared[] + INIT(= N_("E1017: Variable already declared: %s")); +EXTERN char e_cannot_assign_to_constant[] + INIT(= N_("E1018: Cannot assign to a constant: %s")); +EXTERN char e_can_only_concatenate_to_string[] + INIT(= N_("E1019: Can only concatenate to string")); +EXTERN char e_cannot_use_operator_on_new_variable[] + INIT(= N_("E1020: Cannot use an operator on a new variable: %s")); +EXTERN char e_const_requires_a_value[] + INIT(= N_("E1021: Const requires a value")); +EXTERN char e_type_or_initialization_required[] + INIT(= N_("E1022: Type or initialization required")); +EXTERN char e_using_number_as_bool_nr[] + INIT(= N_("E1023: Using a Number as a Bool: %lld")); +EXTERN char e_using_number_as_string[] + INIT(= N_("E1024: Using a Number as a String")); +EXTERN char e_using_rcurly_outside_if_block_scope[] + INIT(= N_("E1025: Using } outside of a block scope")); +#endif +EXTERN char e_missing_rcurly[] + INIT(= N_("E1026: Missing }")); +#ifdef FEAT_EVAL +EXTERN char e_missing_return_statement[] + INIT(= N_("E1027: Missing return statement")); +EXTERN char e_compiling_def_function_failed[] + INIT(= N_("E1028: Compiling :def function failed")); +EXTERN char e_expected_str_but_got_str[] + INIT(= N_("E1029: Expected %s but got %s")); +EXTERN char e_using_string_as_number_str[] + INIT(= N_("E1030: Using a String as a Number: \"%s\"")); +EXTERN char e_cannot_use_void_value[] + INIT(= N_("E1031: Cannot use void value")); +EXTERN char e_missing_catch_or_finally[] + INIT(= N_("E1032: Missing :catch or :finally")); +EXTERN char e_catch_unreachable_after_catch_all[] + INIT(= N_("E1033: Catch unreachable after catch-all")); +EXTERN char e_cannot_use_reserved_name[] + INIT(= N_("E1034: Cannot use reserved name %s")); +EXTERN char e_percent_requires_number_arguments[] + // xgettext:no-c-format + INIT(= N_("E1035: % requires number arguments")); +EXTERN char e_char_requires_number_or_float_arguments[] + INIT(= N_("E1036: %c requires number or float arguments")); +EXTERN char e_cannot_use_str_with_str[] + INIT(= N_("E1037: Cannot use \"%s\" with %s")); +EXTERN char e_vim9script_can_only_be_used_in_script[] + INIT(= N_("E1038: \"vim9script\" can only be used in a script")); +EXTERN char e_vim9script_must_be_first_command_in_script[] + INIT(= N_("E1039: \"vim9script\" must be the first command in a script")); +#endif +EXTERN char e_cannot_use_scriptversion_after_vim9script[] + INIT(= N_("E1040: Cannot use :scriptversion after :vim9script")); +#ifdef FEAT_EVAL +EXTERN char e_redefining_script_item_str[] + INIT(= N_("E1041: Redefining script item: \"%s\"")); +EXTERN char e_export_can_only_be_used_in_vim9script[] + INIT(= N_("E1042: Export can only be used in vim9script")); +EXTERN char e_invalid_command_after_export[] + INIT(= N_("E1043: Invalid command after :export")); +EXTERN char e_export_with_invalid_argument[] + INIT(= N_("E1044: Export with invalid argument")); +// E1045 not used +// E1046 not used +EXTERN char e_syntax_error_in_import_str[] + INIT(= N_("E1047: Syntax error in import: %s")); +EXTERN char e_item_not_found_in_script_str[] + INIT(= N_("E1048: Item not found in script: %s")); +EXTERN char e_item_not_exported_in_script_str[] + INIT(= N_("E1049: Item not exported in script: %s")); +EXTERN char e_colon_required_before_range_str[] + INIT(= N_("E1050: Colon required before a range: %s")); +EXTERN char e_wrong_argument_type_for_plus[] + INIT(= N_("E1051: Wrong argument type for +")); +EXTERN char e_cannot_declare_an_option[] + INIT(= N_("E1052: Cannot declare an option: %s")); +EXTERN char e_could_not_import_str[] + INIT(= N_("E1053: Could not import \"%s\"")); +EXTERN char e_variable_already_declared_in_script_str[] + INIT(= N_("E1054: Variable already declared in the script: %s")); +EXTERN char e_missing_name_after_dots[] + INIT(= N_("E1055: Missing name after ...")); +EXTERN char e_expected_type_str[] + INIT(= N_("E1056: Expected a type: %s")); +EXTERN char e_missing_enddef[] + INIT(= N_("E1057: Missing :enddef")); +EXTERN char e_function_nesting_too_deep[] + INIT(= N_("E1058: Function nesting too deep")); +EXTERN char e_no_white_space_allowed_before_colon_str[] + INIT(= N_("E1059: No white space allowed before colon: %s")); +EXTERN char e_expected_dot_after_name_str[] + INIT(= N_("E1060: Expected dot after name: %s")); +EXTERN char e_cannot_find_function_str[] + INIT(= N_("E1061: Cannot find function %s")); +EXTERN char e_cannot_index_number[] + INIT(= N_("E1062: Cannot index a Number")); +EXTERN char e_type_mismatch_for_v_variable[] + INIT(= N_("E1063: Type mismatch for v: variable")); +#endif +EXTERN char e_yank_register_changed_while_using_it[] + INIT(= N_("E1064: Yank register changed while using it")); +EXTERN char e_command_cannot_be_shortened_str[] + INIT(= N_("E1065: Command cannot be shortened: %s")); +#ifdef FEAT_EVAL +EXTERN char e_cannot_declare_a_register_str[] + INIT(= N_("E1066: Cannot declare a register: %s")); +EXTERN char e_separator_mismatch_str[] + INIT(= N_("E1067: Separator mismatch: %s")); +EXTERN char e_no_white_space_allowed_before_str_str[] + INIT(= N_("E1068: No white space allowed before '%s': %s")); +EXTERN char e_white_space_required_after_str_str[] + INIT(= N_("E1069: White space required after '%s': %s")); +EXTERN char e_invalid_string_for_import_str[] + INIT(= N_("E1071: Invalid string for :import: %s")); +EXTERN char e_cannot_compare_str_with_str[] + INIT(= N_("E1072: Cannot compare %s with %s")); +EXTERN char e_name_already_defined_str[] + INIT(= N_("E1073: Name already defined: %s")); +EXTERN char e_no_white_space_allowed_after_dot[] + INIT(= N_("E1074: No white space allowed after dot")); +EXTERN char e_namespace_not_supported_str[] + INIT(= N_("E1075: Namespace not supported: %s")); +# ifndef FEAT_FLOAT +EXTERN char e_this_vim_is_not_compiled_with_float_support[] + INIT(= N_("E1076: This Vim is not compiled with float support")); +# endif +EXTERN char e_missing_argument_type_for_str[] + INIT(= N_("E1077: Missing argument type for %s")); +#endif +EXTERN char e_invalid_command_nested_did_you_mean_plusplus_nested[] + INIT(= N_("E1078: Invalid command \"nested\", did you mean \"++nested\"?")); +#ifdef FEAT_EVAL +EXTERN char e_cannot_declare_variable_on_command_line[] + INIT(= N_("E1079: Cannot declare a variable on the command line")); +EXTERN char e_invalid_assignment[] + INIT(= N_("E1080: Invalid assignment")); +EXTERN char e_cannot_unlet_str[] + INIT(= N_("E1081: Cannot unlet %s")); +#endif +EXTERN char e_command_modifier_without_command[] + INIT(= N_("E1082: Command modifier without command")); +#ifdef FEAT_EVAL +EXTERN char e_missing_backtick[] + INIT(= N_("E1083: Missing backtick")); +EXTERN char e_cannot_delete_vim9_script_function_str[] + INIT(= N_("E1084: Cannot delete Vim9 script function %s")); +EXTERN char e_not_callable_type_str[] + INIT(= N_("E1085: Not a callable type: %s")); +// E1086 unused +EXTERN char e_cannot_use_index_when_declaring_variable[] + INIT(= N_("E1087: Cannot use an index when declaring a variable")); +EXTERN char e_script_cannot_import_itself[] + INIT(= N_("E1088: Script cannot import itself")); +EXTERN char e_unknown_variable_str[] + INIT(= N_("E1089: Unknown variable: %s")); +EXTERN char e_cannot_assign_to_argument[] + INIT(= N_("E1090: Cannot assign to argument %s")); +EXTERN char e_function_is_not_compiled_str[] + INIT(= N_("E1091: Function is not compiled: %s")); +EXTERN char e_cannot_nest_redir[] + INIT(= N_("E1092: Cannot nest :redir")); +EXTERN char e_expected_nr_items_but_got_nr[] + INIT(= N_("E1093: Expected %d items but got %d")); +EXTERN char e_import_can_only_be_used_in_script[] + INIT(= N_("E1094: Import can only be used in a script")); +EXTERN char e_unreachable_code_after_return[] + INIT(= N_("E1095: Unreachable code after :return")); +EXTERN char e_returning_value_in_function_without_return_type[] + INIT(= N_("E1096: Returning a value in a function without a return type")); +EXTERN char e_line_incomplete[] + INIT(= N_("E1097: Line incomplete")); +EXTERN char e_string_list_or_blob_required[] + INIT(= N_("E1098: String, List or Blob required")); +EXTERN char e_unknown_error_while_executing_str[] + INIT(= N_("E1099: Unknown error while executing %s")); +EXTERN char e_command_not_supported_in_vim9_script_missing_var_str[] + INIT(= N_("E1100: Command not supported in Vim9 script (missing :var?): %s")); +EXTERN char e_cannot_declare_script_variable_in_function_str[] + INIT(= N_("E1101: Cannot declare a script variable in a function: %s")); +EXTERN char e_lambda_function_not_found_str[] + INIT(= N_("E1102: Lambda function not found: %s")); +EXTERN char e_dictionary_not_set[] + INIT(= N_("E1103: Dictionary not set")); +EXTERN char e_missing_gt[] + INIT(= N_("E1104: Missing >")); +EXTERN char e_cannot_convert_str_to_string[] + INIT(= N_("E1105: Cannot convert %s to string")); +EXTERN char e_one_argument_too_many[] + INIT(= N_("E1106: One argument too many")); +EXTERN char e_nr_arguments_too_many[] + INIT(= N_("E1106: %d arguments too many")); +EXTERN char e_string_list_dict_or_blob_required[] + INIT(= N_("E1107: String, List, Dict or Blob required")); +EXTERN char e_item_not_found_str[] + INIT(= N_("E1108: Item not found: %s")); +EXTERN char e_list_item_nr_is_not_list[] + INIT(= N_("E1109: List item %d is not a List")); +EXTERN char e_list_item_nr_does_not_contain_3_numbers[] + INIT(= N_("E1110: List item %d does not contain 3 numbers")); +EXTERN char e_list_item_nr_range_invalid[] + INIT(= N_("E1111: List item %d range invalid")); +EXTERN char e_list_item_nr_cell_width_invalid[] + INIT(= N_("E1112: List item %d cell width invalid")); +EXTERN char e_overlapping_ranges_for_nr[] + INIT(= N_("E1113: Overlapping ranges for 0x%lx")); +EXTERN char e_only_values_of_0x100_and_higher_supported[] + INIT(= N_("E1114: Only values of 0x100 and higher supported")); +EXTERN char e_assert_fails_fourth_argument[] + INIT(= N_("E1115: \"assert_fails()\" fourth argument must be a number")); +EXTERN char e_assert_fails_fifth_argument[] + INIT(= N_("E1116: \"assert_fails()\" fifth argument must be a string")); +EXTERN char e_cannot_use_bang_with_nested_def[] + INIT(= N_("E1117: Cannot use ! with nested :def")); +EXTERN char e_cannot_change_locked_list[] + INIT(= N_("E1118: Cannot change locked list")); +EXTERN char e_cannot_change_locked_list_item[] + INIT(= N_("E1119: Cannot change locked list item")); +EXTERN char e_cannot_change_dict[] + INIT(= N_("E1120: Cannot change dict")); +EXTERN char e_cannot_change_dict_item[] + INIT(= N_("E1121: Cannot change dict item")); +EXTERN char e_variable_is_locked_str[] + INIT(= N_("E1122: Variable is locked: %s")); +EXTERN char e_missing_comma_before_argument_str[] + INIT(= N_("E1123: Missing comma before argument: %s")); +EXTERN char e_str_cannot_be_used_in_legacy_vim_script[] + INIT(= N_("E1124: \"%s\" cannot be used in legacy Vim script")); +EXTERN char e_final_requires_a_value[] + INIT(= N_("E1125: Final requires a value")); +EXTERN char e_cannot_use_let_in_vim9_script[] + INIT(= N_("E1126: Cannot use :let in Vim9 script")); +EXTERN char e_missing_name_after_dot[] + INIT(= N_("E1127: Missing name after dot")); +EXTERN char e_endblock_without_block[] + INIT(= N_("E1128: } without {")); +EXTERN char e_throw_with_empty_string[] + INIT(= N_("E1129: Throw with empty string")); +EXTERN char e_cannot_add_to_null_list[] + INIT(= N_("E1130: Cannot add to null list")); +EXTERN char e_cannot_add_to_null_blob[] + INIT(= N_("E1131: Cannot add to null blob")); +EXTERN char e_missing_function_argument[] + INIT(= N_("E1132: Missing function argument")); +EXTERN char e_cannot_extend_null_dict[] + INIT(= N_("E1133: Cannot extend a null dict")); +EXTERN char e_cannot_extend_null_list[] + INIT(= N_("E1134: Cannot extend a null list")); +EXTERN char e_using_string_as_bool_str[] + INIT(= N_("E1135: Using a String as a Bool: \"%s\"")); +#endif +EXTERN char e_cmd_mapping_must_end_with_cr_before_second_cmd[] + INIT(= N_("E1136: mapping must end with before second ")); +EXTERN char e_cmd_maping_must_not_include_str_key[] + INIT(= N_("E1137: mapping must not include %s key")); +#ifdef FEAT_EVAL +EXTERN char e_using_bool_as_number[] + INIT(= N_("E1138: Using a Bool as a Number")); +EXTERN char e_missing_matching_bracket_after_dict_key[] + INIT(= N_("E1139: Missing matching bracket after dict key")); +EXTERN char e_for_argument_must_be_sequence_of_lists[] + INIT(= N_("E1140: :for argument must be a sequence of lists")); +EXTERN char e_indexable_type_required[] + INIT(= N_("E1141: Indexable type required")); +EXTERN char e_calling_test_garbagecollect_now_while_v_testing_is_not_set[] + INIT(= N_("E1142: Calling test_garbagecollect_now() while v:testing is not set")); +EXTERN char e_empty_expression_str[] + INIT(= N_("E1143: Empty expression: \"%s\"")); +EXTERN char e_command_str_not_followed_by_white_space_str[] + INIT(= N_("E1144: Command \"%s\" is not followed by white space: %s")); +EXTERN char e_missing_heredoc_end_marker_str[] + INIT(= N_("E1145: Missing heredoc end marker: %s")); +EXTERN char e_command_not_recognized_str[] + INIT(= N_("E1146: Command not recognized: %s")); +EXTERN char e_list_not_set[] + INIT(= N_("E1147: List not set")); +EXTERN char e_cannot_index_str[] + INIT(= N_("E1148: Cannot index a %s")); +EXTERN char e_script_variable_invalid_after_reload_in_function_str[] + INIT(= N_("E1149: Script variable is invalid after reload in function %s")); +EXTERN char e_script_variable_type_changed[] + INIT(= N_("E1150: Script variable type changed")); +EXTERN char e_mismatched_endfunction[] + INIT(= N_("E1151: Mismatched endfunction")); +EXTERN char e_mismatched_enddef[] + INIT(= N_("E1152: Mismatched enddef")); +EXTERN char e_invalid_operation_for_str[] + INIT(= N_("E1153: Invalid operation for %s")); +EXTERN char e_divide_by_zero[] + INIT(= N_("E1154: Divide by zero")); +#endif +EXTERN char e_cannot_define_autocommands_for_all_events[] + INIT(= N_("E1155: Cannot define autocommands for ALL events")); +EXTERN char e_cannot_change_arglist_recursively[] + INIT(= N_("E1156: Cannot change the argument list recursively")); +#ifdef FEAT_EVAL +EXTERN char e_missing_return_type[] + INIT(= N_("E1157: Missing return type")); +EXTERN char e_cannot_use_flatten_in_vim9_script[] + INIT(= N_("E1158: Cannot use flatten() in Vim9 script, use flattennew()")); +#endif +EXTERN char e_cannot_split_window_when_closing_buffer[] + INIT(= N_("E1159: Cannot split a window when closing the buffer")); +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_default_for_variable_arguments[] + INIT(= N_("E1160: Cannot use a default for variable arguments")); +EXTERN char e_cannot_json_encode_str[] + INIT(= N_("E1161: Cannot json encode a %s")); +EXTERN char e_register_name_must_be_one_char_str[] + INIT(= N_("E1162: Register name must be one character: %s")); +EXTERN char e_variable_nr_type_mismatch_expected_str_but_got_str[] + INIT(= N_("E1163: Variable %d: type mismatch, expected %s but got %s")); +EXTERN char e_variable_nr_type_mismatch_expected_str_but_got_str_in_str[] + INIT(= N_("E1163: Variable %d: type mismatch, expected %s but got %s in %s")); +#endif +EXTERN char e_vim9cmd_must_be_followed_by_command[] + INIT(= N_("E1164: vim9cmd must be followed by a command")); +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_range_with_assignment_str[] + INIT(= N_("E1165: Cannot use a range with an assignment: %s")); +EXTERN char e_cannot_use_range_with_dictionary[] + INIT(= N_("E1166: Cannot use a range with a dictionary")); +EXTERN char e_argument_name_shadows_existing_variable_str[] + INIT(= N_("E1167: Argument name shadows existing variable: %s")); +EXTERN char e_argument_already_declared_in_script_str[] + INIT(= N_("E1168: Argument already declared in the script: %s")); +EXTERN char e_expression_too_recursive_str[] + INIT(= N_("E1169: Expression too recursive: %s")); +EXTERN char e_cannot_use_hash_curly_to_start_comment[] + INIT(= N_("E1170: Cannot use #{ to start a comment")); +EXTERN char e_missing_end_block[] + INIT(= N_("E1171: Missing } after inline function")); +EXTERN char e_cannot_use_default_values_in_lambda[] + INIT(= N_("E1172: Cannot use default values in a lambda")); +EXTERN char e_text_found_after_str_str[] + INIT(= N_("E1173: Text found after %s: %s")); +EXTERN char e_string_required_for_argument_nr[] + INIT(= N_("E1174: String required for argument %d")); +EXTERN char e_non_empty_string_required_for_argument_nr[] + INIT(= N_("E1175: Non-empty string required for argument %d")); +EXTERN char e_misplaced_command_modifier[] + INIT(= N_("E1176: Misplaced command modifier")); +EXTERN char e_for_loop_on_str_not_supported[] + INIT(= N_("E1177: For loop on %s not supported")); +EXTERN char e_cannot_lock_unlock_local_variable[] + INIT(= N_("E1178: Cannot lock or unlock a local variable")); +#endif +#ifdef FEAT_TERMINAL +EXTERN char e_failed_to_extract_pwd_from_str_check_your_shell_config[] + INIT(= N_("E1179: Failed to extract PWD from %s, check your shell's config related to OSC 7")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_variable_arguments_type_must_be_list_str[] + INIT(= N_("E1180: Variable arguments type must be a list: %s")); +EXTERN char e_cannot_use_underscore_here[] + INIT(= N_("E1181: Cannot use an underscore here")); +EXTERN char e_cannot_define_dict_func_in_vim9_script_str[] + INIT(= N_("E1182: Cannot define a dict function in Vim9 script: %s")); +EXTERN char e_cannot_use_range_with_assignment_operator_str[] + INIT(= N_("E1183: Cannot use a range with an assignment operator: %s")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_blob_not_set[] + INIT(= N_("E1184: Blob not set")); +EXTERN char e_missing_redir_end[] + INIT(= N_("E1185: Missing :redir END")); +EXTERN char e_expression_does_not_result_in_value_str[] + INIT(= N_("E1186: Expression does not result in a value: %s")); +#endif +EXTERN char e_failed_to_source_defaults[] + INIT(= N_("E1187: Failed to source defaults.vim")); +#if defined(FEAT_TERMINAL) && defined(FEAT_CMDWIN) +EXTERN char e_cannot_open_terminal_from_command_line_window[] + INIT(= N_("E1188: Cannot open a terminal from the command line window")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_cannot_use_legacy_with_command_str[] + INIT(= N_("E1189: Cannot use :legacy with this command: %s")); +EXTERN char e_one_argument_too_few[] + INIT(= N_("E1190: One argument too few")); +EXTERN char e_nr_arguments_too_few[] + INIT(= N_("E1190: %d arguments too few")); +EXTERN char e_call_to_function_that_failed_to_compile_str[] + INIT(= N_("E1191: Call to function that failed to compile: %s")); +EXTERN char e_empty_function_name[] + INIT(= N_("E1192: Empty function name")); +#endif +// libsodium +#ifdef FEAT_CRYPT +# ifndef FEAT_SODIUM +EXTERN char e_libsodium_not_built_in[] + INIT(= N_("E1193: cryptmethod xchacha20 not built into this Vim")); +# else +# if 0 +EXTERN char e_libsodium_cannot_encrypt_header[] + INIT(= N_("E1194: Cannot encrypt header, not enough space")); +EXTERN char e_libsodium_cannot_encrypt_buffer[] + INIT(= N_("E1195: Cannot encrypt buffer, not enough space")); +EXTERN char e_libsodium_cannot_decrypt_header[] + INIT(= N_("E1196: Cannot decrypt header, not enough space")); +# endif +EXTERN char e_libsodium_cannot_allocate_buffer[] + INIT(= N_("E1197: Cannot allocate_buffer for encryption")); +EXTERN char e_libsodium_decryption_failed_header_incomplete[] + INIT(= N_("E1198: Decryption failed: Header incomplete!")); +# if 0 +EXTERN char e_libsodium_cannot_decrypt_buffer[] + INIT(= N_("E1199: Cannot decrypt buffer, not enough space")); +# endif +EXTERN char e_libsodium_decryption_failed[] + INIT(= N_("E1200: Decryption failed!")); +EXTERN char e_libsodium_decryption_failed_premature[] + INIT(= N_("E1201: Decryption failed: pre-mature end of file!")); +# endif +#endif +#ifdef FEAT_EVAL +EXTERN char e_no_white_space_allowed_after_str_str[] + INIT(= N_("E1202: No white space allowed after '%s': %s")); +EXTERN char e_dot_can_only_be_used_on_dictionary_str[] + INIT(= N_("E1203: Dot can only be used on a dictionary: %s")); +#endif +EXTERN char e_regexp_number_after_dot_pos_search_chr[] + INIT(= N_("E1204: No Number allowed after .: '\\%%%c'")); +EXTERN char e_no_white_space_allowed_between_option_and[] + INIT(= N_("E1205: No white space allowed between option and")); +#ifdef FEAT_EVAL +EXTERN char e_dict_required_for_argument_nr[] + INIT(= N_("E1206: Dictionary required for argument %d")); +EXTERN char e_expression_without_effect_str[] + INIT(= N_("E1207: Expression without an effect: %s")); +#endif +EXTERN char e_complete_used_without_allowing_arguments[] + INIT(= N_("E1208: -complete used without allowing arguments")); +#ifdef FEAT_EVAL +EXTERN char e_invalid_value_for_line_number_str[] + INIT(= N_("E1209: Invalid value for a line number: \"%s\"")); +EXTERN char e_number_required_for_argument_nr[] + INIT(= N_("E1210: Number required for argument %d")); +EXTERN char e_list_required_for_argument_nr[] + INIT(= N_("E1211: List required for argument %d")); +EXTERN char e_bool_required_for_argument_nr[] + INIT(= N_("E1212: Bool required for argument %d")); +EXTERN char e_redefining_imported_item_str[] + INIT(= N_("E1213: Redefining imported item \"%s\"")); +#endif +#if defined(FEAT_DIGRAPHS) && defined(FEAT_EVAL) +EXTERN char e_digraph_must_be_just_two_characters_str[] + INIT(= N_("E1214: Digraph must be just two characters: %s")); +EXTERN char e_digraph_argument_must_be_one_character_str[] + INIT(= N_("E1215: Digraph must be one character: %s")); +EXTERN char e_digraph_setlist_argument_must_be_list_of_lists_with_two_items[] + INIT(= N_("E1216: digraph_setlist() argument must be a list of lists with two items")); +#endif +#ifdef FEAT_EVAL +# ifdef FEAT_JOB_CHANNEL +EXTERN char e_chan_or_job_required_for_argument_nr[] + INIT(= N_("E1217: Channel or Job required for argument %d")); +EXTERN char e_job_required_for_argument_nr[] + INIT(= N_("E1218: Job required for argument %d")); +# endif +EXTERN char e_float_or_number_required_for_argument_nr[] + INIT(= N_("E1219: Float or Number required for argument %d")); +EXTERN char e_string_or_number_required_for_argument_nr[] + INIT(= N_("E1220: String or Number required for argument %d")); +# ifdef FEAT_JOB_CHANNEL +EXTERN char e_string_or_blob_required_for_argument_nr[] + INIT(= N_("E1221: String or Blob required for argument %d")); +# endif +EXTERN char e_string_or_list_required_for_argument_nr[] + INIT(= N_("E1222: String or List required for argument %d")); +EXTERN char e_string_or_dict_required_for_argument_nr[] + INIT(= N_("E1223: String or Dictionary required for argument %d")); +EXTERN char e_string_number_or_list_required_for_argument_nr[] + INIT(= N_("E1224: String, Number or List required for argument %d")); +EXTERN char e_string_list_or_dict_required_for_argument_nr[] + INIT(= N_("E1225: String, List or Dictionary required for argument %d")); +EXTERN char e_list_or_blob_required_for_argument_nr[] + INIT(= N_("E1226: List or Blob required for argument %d")); +EXTERN char e_list_or_dict_required_for_argument_nr[] + INIT(= N_("E1227: List or Dictionary required for argument %d")); +EXTERN char e_list_dict_or_blob_required_for_argument_nr[] + INIT(= N_("E1228: List, Dictionary or Blob required for argument %d")); +EXTERN char e_expected_dictionary_for_using_key_str_but_got_str[] + INIT(= N_("E1229: Expected dictionary for using key \"%s\", but got %s")); +#endif +#ifdef FEAT_SODIUM +EXTERN char e_encryption_sodium_mlock_failed[] + INIT(= N_("E1230: Encryption: sodium_mlock() failed")); +#endif +EXTERN char e_cannot_use_bar_to_separate_commands_here_str[] + INIT(= N_("E1231: Cannot use a bar to separate commands here: %s")); +#ifdef FEAT_EVAL +EXTERN char e_argument_of_exists_compiled_must_be_literal_string[] + INIT(= N_("E1232: Argument of exists_compiled() must be a literal string")); +EXTERN char e_exists_compiled_can_only_be_used_in_def_function[] + INIT(= N_("E1233: exists_compiled() can only be used in a :def function")); +#endif +EXTERN char e_legacy_must_be_followed_by_command[] + INIT(= N_("E1234: legacy must be followed by a command")); +#ifdef FEAT_EVAL +// E1235 unused +EXTERN char e_cannot_use_str_itself_it_is_imported[] + INIT(= N_("E1236: Cannot use %s itself, it is imported")); +#endif +EXTERN char e_no_such_user_defined_command_in_current_buffer_str[] + INIT(= N_("E1237: No such user-defined command in current buffer: %s")); +#ifdef FEAT_EVAL +EXTERN char e_blob_required_for_argument_nr[] + INIT(= N_("E1238: Blob required for argument %d")); +EXTERN char e_invalid_value_for_blob_nr[] + INIT(= N_("E1239: Invalid value for blob: %d")); +#endif +EXTERN char e_resulting_text_too_long[] + INIT(= N_("E1240: Resulting text too long")); +#ifdef FEAT_EVAL +EXTERN char e_separator_not_supported_str[] + INIT(= N_("E1241: Separator not supported: %s")); +EXTERN char e_no_white_space_allowed_before_separator_str[] + INIT(= N_("E1242: No white space allowed before separator: %s")); +#endif +#ifdef FEAT_GUI_GTK +EXTERN char e_ascii_code_not_in_range[] + INIT(= N_("E1243: ASCII code not in 32-127 range")); +#endif +#ifdef FEAT_EVAL +# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) +EXTERN char e_bad_color_string_str[] + INIT(= N_("E1244: Bad color string: %s")); +# endif +EXTERN char e_cannot_expand_sfile_in_vim9_function[] + INIT(= N_("E1245: Cannot expand in a Vim9 function")); +EXTERN char e_cannot_find_variable_to_unlock_str[] + INIT(= N_("E1246: Cannot find variable to (un)lock: %s")); +#endif +EXTERN char e_line_number_out_of_range[] + INIT(= N_("E1247: Line number out of range")); +#ifdef FEAT_EVAL +EXTERN char e_closure_called_from_invalid_context[] + INIT(= N_("E1248: Closure called from invalid context")); +#endif +EXTERN char e_highlight_group_name_too_long[] + INIT(= N_("E1249: Highlight group name too long")); +#ifdef FEAT_EVAL +EXTERN char e_argument_of_str_must_be_list_string_dictionary_or_blob[] + INIT(= N_("E1250: Argument of %s must be a List, String, Dictionary or Blob")); +EXTERN char e_list_dict_blob_or_string_required_for_argument_nr[] + INIT(= N_("E1251: List, Dictionary, Blob or String required for argument %d")); +EXTERN char e_string_list_or_blob_required_for_argument_nr[] + INIT(= N_("E1252: String, List or Blob required for argument %d")); +EXTERN char e_string_expected_for_argument_nr[] + INIT(= N_("E1253: String expected for argument %d")); +EXTERN char e_cannot_use_script_variable_in_for_loop[] + INIT(= N_("E1254: Cannot use script variable in for loop")); +#endif +EXTERN char e_cmd_mapping_must_end_with_cr[] + INIT(= N_("E1255: mapping must end with ")); +#ifdef FEAT_EVAL +EXTERN char e_string_or_function_required_for_argument_nr[] + INIT(= N_("E1256: String or function required for argument %d")); +EXTERN char e_imported_script_must_use_as_or_end_in_dot_vim_str[] + INIT(= N_("E1257: Imported script must use \"as\" or end in .vim: %s")); +EXTERN char e_no_dot_after_imported_name_str[] + INIT(= N_("E1258: No '.' after imported name: %s")); +EXTERN char e_missing_name_after_imported_name_str[] + INIT(= N_("E1259: Missing name after imported name: %s")); +EXTERN char e_cannot_unlet_imported_item_str[] + INIT(= N_("E1260: Cannot unlet an imported item: %s")); +EXTERN char e_cannot_import_dot_vim_without_using_as[] + INIT(= N_("E1261: Cannot import .vim without using \"as\"")); +EXTERN char e_cannot_import_same_script_twice_str[] + INIT(= N_("E1262: Cannot import the same script twice: %s")); +EXTERN char e_cannot_use_name_with_hash_in_vim9_script_use_export_instead[] + INIT(= N_("E1263: Cannot use name with # in Vim9 script, use export instead")); +EXTERN char e_autoload_import_cannot_use_absolute_or_relative_path[] + INIT(= N_("E1264: Autoload import cannot use absolute or relative path: %s")); +EXTERN char e_cannot_use_partial_here[] + INIT(= N_("E1265: Cannot use a partial here")); +#endif +#if defined(FEAT_PYTHON3) && defined(MSWIN) +EXTERN char e_critical_error_in_python3_initialization_check_your_installation[] + INIT(= N_("E1266: Critical error in python3 initialization, check your python3 installation")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_function_name_must_start_with_capital_str[] + INIT(= N_("E1267: Function name must start with a capital: %s")); +EXTERN char e_cannot_use_s_colon_in_vim9_script_str[] + INIT(= N_("E1268: Cannot use s: in Vim9 script: %s")); +EXTERN char e_cannot_create_vim9_script_variable_in_function_str[] + INIT(= N_("E1269: Cannot create a Vim9 script variable in a function: %s")); +#endif +EXTERN char e_cannot_use_s_backslash_in_vim9_script[] + INIT(= N_("E1270: Cannot use :s\\/sub/ in Vim9 script")); +#ifdef FEAT_EVAL +EXTERN char e_compiling_closure_without_context_str[] + INIT(= N_("E1271: Compiling closure without context: %s")); +EXTERN char e_using_type_not_in_script_context_str[] + INIT(= N_("E1272: Using type not in a script context: %s")); +#endif +EXTERN char e_nfa_regexp_missing_value_in_chr[] + INIT(= N_("E1273: (NFA regexp) missing value in '\\%%%c'")); +EXTERN char e_no_script_file_name_to_substitute_for_script[] + INIT(= N_("E1274: No script file name to substitute for \"