From 8365bc678739b07964aa511d4b7935df4b909622 Mon Sep 17 00:00:00 2001 From: "deepin-community-bot[bot]" <156989552+deepin-community-bot[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 09:29:55 +0000 Subject: [PATCH] feat: update vim to 2:9.1.1230-2 --- .git-blame-ignore-revs | 10 - .gitignore | 2 + .hgignore | 2 + CONTRIBUTING.md | 28 +- Filelist | 9 - ci/appveyor.bat | 6 +- ci/ddebs.list | 3 - ci/if_feat_check.vim | 15 - ci/if_ver-1.vim | 4 +- ci/if_ver-2.vim | 6 +- ci/pinned-pkgs | 69 - ci/setup-sway.sh | 7 - debian/changelog | 20 +- ...-popups-inconsistently-shifted-to-th.patch | 8 +- .../Set-NoDisplay-true-for-vim-desktop.patch | 28 - ...re-LaTeX-commands-for-tex-filetype-d.patch | 4 +- ...etype-using-the-contents-of-the-file.patch | 4 +- ...ision-to-disable-modelines-by-defaul.patch | 4 +- ...vimrc.tiny-when-Vim-is-invoked-as-vi.patch | 12 +- ...-Crash-when-evaluating-variable-name.patch | 57 + ...44-part-of-patch-v9.1.1242-was-wrong.patch | 44 + debian/patches/series | 3 +- debian/upstream/metadata | 7 - runtime/autoload/dist/ft.vim | 109 +- runtime/autoload/dist/script.vim | 7 +- runtime/autoload/dist/vim.vim | 4 +- runtime/autoload/dist/vimindent.vim | 6 +- runtime/autoload/getscript.vim | 131 +- runtime/autoload/htmlfold.vim | 192 - runtime/autoload/python.vim | 2 - runtime/autoload/rustfmt.vim | 7 +- runtime/autoload/tar.vim | 28 +- runtime/autoload/tutor.vim | 22 - runtime/compiler/gleam_build.vim | 25 - runtime/defaults.vim | 1 - runtime/doc/Makefile | 4 +- runtime/doc/autocmd.txt | 29 +- runtime/doc/builtin.txt | 318 +- runtime/doc/change.txt | 10 +- runtime/doc/develop.txt | 100 +- runtime/doc/diff.txt | 32 +- runtime/doc/editing.txt | 7 +- runtime/doc/eval.txt | 373 +- runtime/doc/filetype.txt | 55 +- runtime/doc/helphelp.txt | 24 +- runtime/doc/if_perl.txt | 4 +- runtime/doc/if_pyth.txt | 27 +- runtime/doc/insert.txt | 6 +- runtime/doc/motion.txt | 8 +- runtime/doc/options.txt | 283 +- runtime/doc/pattern.txt | 8 +- runtime/doc/pi_getscript.txt | 4 +- runtime/doc/pi_netrw.txt | 15 +- runtime/doc/pi_tar.txt | 11 +- runtime/doc/pi_zip.txt | 16 +- runtime/doc/quickfix.txt | 18 +- runtime/doc/quickref.txt | 4 +- runtime/doc/syntax.txt | 50 +- runtime/doc/tags | 70 +- runtime/doc/tagsrch.txt | 35 +- runtime/doc/testing.txt | 9 +- runtime/doc/todo.txt | 44 +- runtime/doc/usr_05.txt | 24 +- runtime/doc/usr_41.txt | 57 +- runtime/doc/various.txt | 6 +- runtime/doc/version9.txt | 54 +- runtime/doc/vi_diff.txt | 7 +- runtime/doc/vim9.txt | 49 +- runtime/doc/vim9class.txt | 21 +- runtime/doc/windows.txt | 6 +- runtime/filetype.vim | 45 +- runtime/ftplugin/abnf.vim | 17 - runtime/ftplugin/dax.vim | 16 - runtime/ftplugin/fstab.vim | 13 +- runtime/ftplugin/gleam.vim | 27 +- runtime/ftplugin/go.vim | 7 - runtime/ftplugin/groff.vim | 15 - runtime/ftplugin/heex.vim | 7 - runtime/ftplugin/help.vim | 28 +- runtime/ftplugin/html.vim | 50 +- runtime/ftplugin/java.vim | 32 +- runtime/ftplugin/lf.vim | 22 - runtime/ftplugin/lprolog.vim | 10 +- runtime/ftplugin/lua.vim | 74 +- runtime/ftplugin/mbsync.vim | 13 - runtime/ftplugin/mediawiki.vim | 7 - runtime/ftplugin/mojo.vim | 7 - runtime/ftplugin/nix.vim | 6 +- runtime/ftplugin/nroff.vim | 20 +- runtime/ftplugin/pq.vim | 16 - runtime/ftplugin/remind.vim | 14 - runtime/ftplugin/rust.vim | 16 +- runtime/ftplugin/spajson.vim | 14 - runtime/ftplugin/svelte.vim | 33 +- runtime/ftplugin/tera.vim | 7 - runtime/ftplugin/tutor.vim | 27 +- runtime/ftplugin/yaml.vim | 24 +- runtime/indent/cucumber.vim | 6 - runtime/indent/html.vim | 6 +- runtime/indent/javascript.vim | 4 +- runtime/indent/make.vim | 15 +- runtime/indent/spajson.vim | 6 - runtime/indent/testdir/README.txt | 3 - runtime/indent/testdir/bitbake.in | 2 - runtime/indent/testdir/bitbake.ok | 2 - runtime/indent/testdir/html.in | 1 - runtime/indent/testdir/html.ok | 1 - runtime/indent/testdir/make.in | 20 - runtime/indent/testdir/make.ok | 20 - runtime/indent/testdir/python.in | 2 - runtime/indent/testdir/python.ok | 2 - runtime/indent/testdir/runtest.vim | 13 + runtime/indent/testdir/tools/tracer.vim | 166 - runtime/indent/testdir/vim.in | 2 - runtime/indent/testdir/vim.ok | 2 - runtime/indent/testdir/vim9.in | 6 +- runtime/indent/testdir/vim9.ok | 6 +- runtime/keymap/brazilian_portuguese-abnt.vim | 71 - .../keymap/brazilian_portuguese-compact.vim | 72 - runtime/optwin.vim | 15 +- .../dist/opt/comment/autoload/comment.vim | 25 +- .../opt/editorconfig/plugin/editorconfig.vim | 2 +- .../dist/opt/helptoc/autoload/helptoc.vim | 529 +-- runtime/pack/dist/opt/helptoc/doc/helptoc.txt | 349 -- runtime/pack/dist/opt/helptoc/doc/tags | 16 - .../pack/dist/opt/hlyank/plugin/hlyank.vim | 9 +- .../pack/dist/opt/netrw/autoload/netrw.vim | 185 +- .../pack/dist/opt/netrw/autoload/netrw/fs.vim | 24 - .../dist/opt/netrw/autoload/netrw/msg.vim | 2 +- .../dist/opt/netrw/autoload/netrwSettings.vim | 2 +- runtime/pack/dist/opt/netrw/doc/netrw.txt | 13 +- .../dist/opt/netrw/plugin/netrwPlugin.vim | 2 +- runtime/plugin/matchparen.vim | 2 +- runtime/plugin/openPlugin.vim | 12 +- runtime/plugin/tutor.vim | 6 - runtime/plugin/zipPlugin.vim | 4 +- runtime/syntax/Makefile | 1 + runtime/syntax/asy.vim | 6 - runtime/syntax/cfg.vim | 2 +- runtime/syntax/confini.vim | 6 - runtime/syntax/dax.vim | 151 - runtime/syntax/generator/gen_syntax_vim.vim | 25 +- runtime/syntax/generator/vim.vim.base | 604 +-- runtime/syntax/gleam.vim | 97 - runtime/syntax/groovy.vim | 3 +- runtime/syntax/html.vim | 4 +- runtime/syntax/hyprlang.vim | 7 +- runtime/syntax/java.vim | 44 +- runtime/syntax/jjdescription.vim | 3 +- runtime/syntax/jq.vim | 7 - runtime/syntax/lf.vim | 404 +- runtime/syntax/make.vim | 54 +- runtime/syntax/mbsync.vim | 218 - runtime/syntax/modula2.vim | 7 - runtime/syntax/nroff.vim | 14 +- runtime/syntax/odin.vim | 11 +- runtime/syntax/omnimark.vim | 933 +--- runtime/syntax/pacmanlog.vim | 7 - runtime/syntax/pov.vim | 6 +- runtime/syntax/pq.vim | 337 -- runtime/syntax/rasi.vim | 6 - runtime/syntax/sh.vim | 37 +- runtime/syntax/shared/debversions.vim | 6 +- runtime/syntax/solidity.vim | 14 +- runtime/syntax/spajson.vim | 50 - runtime/syntax/spec.vim | 3 +- .../testdir/dumps/c_character_constant_00.vim | 2 - .../testdir/dumps/c_character_constant_01.vim | 2 - .../testdir/dumps/c_character_constant_02.vim | 2 - .../testdir/dumps/c_string_literal_00.vim | 2 - .../testdir/dumps/c_string_literal_01.vim | 2 - .../testdir/dumps/c_string_literal_02.vim | 2 - .../testdir/dumps/c_string_literal_03.vim | 2 - .../testdir/dumps/html_fold_expr_00.dump | 20 - .../testdir/dumps/html_fold_expr_01.dump | 20 - .../testdir/dumps/html_fold_expr_02.dump | 20 - .../testdir/dumps/html_fold_expr_03.dump | 20 - .../testdir/dumps/html_fold_expr_04.dump | 20 - .../testdir/dumps/html_fold_expr_05.dump | 20 - .../testdir/dumps/html_fold_expr_06.dump | 20 - .../testdir/dumps/html_fold_syntax_00.dump | 20 - .../testdir/dumps/html_fold_syntax_01.dump | 20 - .../testdir/dumps/html_fold_syntax_02.dump | 20 - .../testdir/dumps/html_fold_syntax_03.dump | 20 - .../testdir/dumps/html_fold_syntax_04.dump | 20 - .../testdir/dumps/html_fold_syntax_05.dump | 20 - .../testdir/dumps/html_fold_syntax_06.dump | 20 - .../testdir/dumps/java_comments_html_00.dump | 8 +- .../dumps/java_comments_markdown_00.dump | 4 +- .../dumps/java_comments_markdown_07.dump | 6 +- .../testdir/dumps/java_previews_455_00.dump | 2 +- runtime/syntax/testdir/dumps/sh_13_00.dump | 20 - runtime/syntax/testdir/dumps/sh_14_00.dump | 20 - .../syntax/testdir/dumps/sh_ksh_array_00.dump | 20 - .../syntax/testdir/dumps/sh_ksh_array_01.dump | 20 - .../syntax/testdir/dumps/sh_quoting_00.dump | 20 - .../syntax/testdir/dumps/vim9_comment_00.dump | 2 +- .../syntax/testdir/dumps/vim9_comment_01.dump | 10 +- .../syntax/testdir/dumps/vim9_comment_02.dump | 12 +- .../syntax/testdir/dumps/vim9_comment_03.dump | 32 +- .../syntax/testdir/dumps/vim9_comment_04.dump | 20 - .../syntax/testdir/dumps/vim9_comment_05.dump | 20 - .../testdir/dumps/vim9_constructor_00.dump | 20 - .../testdir/dumps/vim9_def_variables_00.dump | 2 +- .../testdir/dumps/vim9_def_variables_03.dump | 2 +- .../testdir/dumps/vim9_def_variables_10.dump | 2 +- .../testdir/dumps/vim9_def_variables_11.dump | 2 +- .../dumps/vim9_ex_comment_strings_00.dump | 4 +- .../dumps/vim9_ex_comment_strings_01.dump | 6 +- .../testdir/dumps/vim9_ex_enum2_00.dump | 20 - .../testdir/dumps/vim9_ex_enum2_01.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_00.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_01.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_02.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_03.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_04.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_05.dump | 20 - .../syntax/testdir/dumps/vim9_ex_enum_06.dump | 20 - .../testdir/dumps/vim9_ex_enum_fold_00.dump | 4 +- .../testdir/dumps/vim9_ex_enum_fold_01.dump | 20 +- .../testdir/dumps/vim9_ex_enum_fold_02.dump | 38 +- .../dumps/vim9_ex_interface_fold_01.dump | 2 +- .../dumps/vim9_ex_interface_fold_02.dump | 2 +- .../dumps/vim9_ex_no_comment_strings_00.dump | 4 +- .../dumps/vim9_ex_no_comment_strings_01.dump | 6 +- .../syntax/testdir/dumps/vim9_expr_00.dump | 24 +- .../syntax/testdir/dumps/vim9_expr_01.dump | 36 +- .../syntax/testdir/dumps/vim9_expr_02.dump | 36 +- .../syntax/testdir/dumps/vim9_expr_03.dump | 34 +- .../syntax/testdir/dumps/vim9_expr_04.dump | 34 +- .../syntax/testdir/dumps/vim9_expr_05.dump | 36 +- .../syntax/testdir/dumps/vim9_expr_06.dump | 36 +- .../syntax/testdir/dumps/vim9_expr_07.dump | 30 +- .../syntax/testdir/dumps/vim9_expr_08.dump | 32 +- .../syntax/testdir/dumps/vim9_expr_09.dump | 36 +- .../syntax/testdir/dumps/vim9_expr_10.dump | 20 - .../testdir/dumps/vim9_function_calls_00.dump | 2 +- ...x_loadkeymap_01.vim => vim9_keymap_01.vim} | 0 .../syntax/testdir/dumps/vim9_lambda_00.dump | 18 +- .../syntax/testdir/dumps/vim9_lambda_01.dump | 28 +- .../syntax/testdir/dumps/vim9_lambda_02.dump | 30 +- .../syntax/testdir/dumps/vim9_lambda_03.dump | 28 +- .../syntax/testdir/dumps/vim9_lambda_04.dump | 30 +- .../syntax/testdir/dumps/vim9_lambda_05.dump | 32 +- .../syntax/testdir/dumps/vim9_lambda_06.dump | 34 +- .../syntax/testdir/dumps/vim9_lambda_07.dump | 20 - .../syntax/testdir/dumps/vim9_lambda_08.dump | 20 - .../syntax/testdir/dumps/vim9_lambda_09.dump | 20 - .../dumps/vim9_super_this_keywords2_02.dump | 22 +- .../dumps/vim9_super_this_keywords2_03.dump | 8 +- .../syntax/testdir/dumps/vim9_tuple_00.dump | 20 - .../syntax/testdir/dumps/vim9_tuple_01.dump | 20 - .../testdir/dumps/vim9_variables_01.dump | 2 +- .../testdir/dumps/vim9_variables_02.dump | 4 +- .../testdir/dumps/vim9_variables_03.dump | 34 +- .../testdir/dumps/vim9_variables_04.dump | 32 +- .../testdir/dumps/vim9_variables_05.dump | 34 +- .../testdir/dumps/vim9_variables_06.dump | 40 +- .../testdir/dumps/vim9_variables_07.dump | 40 +- .../testdir/dumps/vim9_variables_08.dump | 34 +- .../testdir/dumps/vim9_variables_09.dump | 34 +- .../testdir/dumps/vim9_variables_10.dump | 38 +- .../testdir/dumps/vim9_variables_11.dump | 34 +- .../testdir/dumps/vim9_variables_12.dump | 32 +- .../testdir/dumps/vim9_variables_13.dump | 20 - .../syntax/testdir/dumps/vim_comment_00.dump | 4 +- .../syntax/testdir/dumps/vim_comment_01.dump | 8 +- .../syntax/testdir/dumps/vim_comment_02.dump | 12 +- .../syntax/testdir/dumps/vim_comment_03.dump | 16 +- .../syntax/testdir/dumps/vim_comment_04.dump | 20 - .../testdir/dumps/vim_ex_augroup_00.dump | 40 +- .../testdir/dumps/vim_ex_augroup_01.dump | 20 - .../testdir/dumps/vim_ex_augroup_02.dump | 20 - .../testdir/dumps/vim_ex_augroup_03.dump | 20 - .../testdir/dumps/vim_ex_autocmd_00.dump | 20 - .../testdir/dumps/vim_ex_autocmd_01.dump | 20 - .../testdir/dumps/vim_ex_autocmd_02.dump | 20 - .../testdir/dumps/vim_ex_autocmd_03.dump | 20 - .../testdir/dumps/vim_ex_autocmd_04.dump | 20 - .../testdir/dumps/vim_ex_autocmd_05.dump | 20 - .../testdir/dumps/vim_ex_autocmd_06.dump | 20 - .../testdir/dumps/vim_ex_autocmd_07.dump | 20 - .../testdir/dumps/vim_ex_autocmd_08.dump | 20 - .../testdir/dumps/vim_ex_autocmd_09.dump | 20 - .../testdir/dumps/vim_ex_autocmd_10.dump | 20 - .../testdir/dumps/vim_ex_autocmd_11.dump | 20 - .../testdir/dumps/vim_ex_autocmd_12.dump | 20 - .../testdir/dumps/vim_ex_autocmd_13.dump | 20 - .../testdir/dumps/vim_ex_autocmd_14.dump | 20 - .../testdir/dumps/vim_ex_autocmd_15.dump | 20 - .../testdir/dumps/vim_ex_autocmd_16.dump | 20 - .../testdir/dumps/vim_ex_command_00.dump | 18 +- .../testdir/dumps/vim_ex_command_01.dump | 26 +- .../testdir/dumps/vim_ex_command_02.dump | 38 +- .../testdir/dumps/vim_ex_command_03.dump | 30 +- .../testdir/dumps/vim_ex_command_04.dump | 38 +- .../testdir/dumps/vim_ex_command_05.dump | 20 - .../testdir/dumps/vim_ex_command_06.dump | 20 - .../testdir/dumps/vim_ex_command_07.dump | 20 - .../testdir/dumps/vim_ex_command_08.dump | 20 - .../dumps/vim_ex_comment_strings_00.dump | 8 +- .../dumps/vim_ex_comment_strings_01.dump | 6 +- .../syntax/testdir/dumps/vim_ex_def_04.dump | 2 +- .../syntax/testdir/dumps/vim_ex_def_05.dump | 2 +- .../syntax/testdir/dumps/vim_ex_def_06.dump | 2 +- .../testdir/dumps/vim_ex_def_fold_04.dump | 2 +- .../testdir/dumps/vim_ex_def_fold_06.dump | 2 +- .../testdir/dumps/vim_ex_def_fold_07.dump | 2 +- .../dumps/vim_ex_def_nested_fold_01.dump | 20 + .../testdir/dumps/vim_ex_filter_00.dump | 20 - .../testdir/dumps/vim_ex_function_10.dump | 2 +- .../dumps/vim_ex_function_nested_fold_01.dump | 20 + .../dumps/vim_ex_function_nested_fold_02.dump | 20 + .../syntax/testdir/dumps/vim_ex_grep_00.dump | 20 - .../syntax/testdir/dumps/vim_ex_grep_01.dump | 20 - .../syntax/testdir/dumps/vim_ex_grep_02.dump | 20 - .../testdir/dumps/vim_ex_helpgrep_00.dump | 20 - .../syntax/testdir/dumps/vim_ex_make_00.dump | 20 - .../syntax/testdir/dumps/vim_ex_make_01.dump | 20 - .../syntax/testdir/dumps/vim_ex_make_02.dump | 20 - .../syntax/testdir/dumps/vim_ex_map_05.dump | 2 +- .../syntax/testdir/dumps/vim_ex_match_01.dump | 2 +- .../dumps/vim_ex_no_comment_strings_00.dump | 8 +- .../dumps/vim_ex_no_comment_strings_01.dump | 6 +- .../syntax/testdir/dumps/vim_ex_redir_00.dump | 20 - .../syntax/testdir/dumps/vim_ex_redir_01.dump | 20 - .../syntax/testdir/dumps/vim_ex_redir_02.dump | 20 - .../syntax/testdir/dumps/vim_ex_set_01.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_02.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_03.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_04.dump | 2 +- .../syntax/testdir/dumps/vim_ex_set_05.dump | 4 +- .../syntax/testdir/dumps/vim_ex_set_06.dump | 18 +- .../syntax/testdir/dumps/vim_ex_set_07.dump | 20 - .../dumps/vim_ex_set_backslash_00.dump | 20 - .../dumps/vim_ex_set_backslash_01.dump | 20 - .../dumps/vim_ex_set_backslash_02.dump | 20 - .../dumps/vim_ex_set_backslash_03.dump | 20 - .../dumps/vim_ex_set_backslash_04.dump | 20 - .../syntax/testdir/dumps/vim_ex_sort_00.dump | 20 - .../syntax/testdir/dumps/vim_ex_sort_01.dump | 20 - .../syntax/testdir/dumps/vim_ex_sort_02.dump | 20 - .../syntax/testdir/dumps/vim_ex_sort_03.dump | 20 - .../testdir/dumps/vim_ex_substitute_02.dump | 2 +- .../testdir/dumps/vim_ex_substitute_04.dump | 2 +- .../testdir/dumps/vim_ex_substitute_06.dump | 2 +- .../testdir/dumps/vim_ex_substitute_07.dump | 6 +- .../testdir/dumps/vim_ex_substitute_08.dump | 6 +- .../testdir/dumps/vim_ex_vimgrep_00.dump | 20 - .../testdir/dumps/vim_ex_vimgrep_01.dump | 20 - .../testdir/dumps/vim_ex_vimgrep_02.dump | 20 - .../testdir/dumps/vim_ex_vimgrep_03.dump | 20 - .../testdir/dumps/vim_ex_vimgrep_04.dump | 20 - runtime/syntax/testdir/dumps/vim_expr_00.dump | 18 +- runtime/syntax/testdir/dumps/vim_expr_01.dump | 26 +- runtime/syntax/testdir/dumps/vim_expr_02.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_03.dump | 32 +- runtime/syntax/testdir/dumps/vim_expr_04.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_05.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_06.dump | 32 +- runtime/syntax/testdir/dumps/vim_expr_07.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_08.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_09.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_10.dump | 32 +- runtime/syntax/testdir/dumps/vim_expr_11.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_12.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_13.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_14.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_15.dump | 36 +- runtime/syntax/testdir/dumps/vim_expr_16.dump | 38 +- runtime/syntax/testdir/dumps/vim_expr_17.dump | 34 +- runtime/syntax/testdir/dumps/vim_expr_18.dump | 38 +- runtime/syntax/testdir/dumps/vim_expr_19.dump | 20 - runtime/syntax/testdir/dumps/vim_expr_20.dump | 20 - runtime/syntax/testdir/dumps/vim_expr_21.dump | 20 - runtime/syntax/testdir/dumps/vim_expr_22.dump | 20 - runtime/syntax/testdir/dumps/vim_expr_23.dump | 20 - ...ex_loadkeymap_01.vim => vim_keymap_04.vim} | 0 .../syntax/testdir/dumps/vim_lambda_00.dump | 20 +- .../syntax/testdir/dumps/vim_lambda_01.dump | 28 +- .../syntax/testdir/dumps/vim_lambda_02.dump | 28 +- .../syntax/testdir/dumps/vim_lambda_03.dump | 26 +- .../syntax/testdir/dumps/vim_lambda_04.dump | 30 +- .../syntax/testdir/dumps/vim_lambda_05.dump | 30 +- .../syntax/testdir/dumps/vim_lambda_06.dump | 26 +- .../syntax/testdir/dumps/vim_lambda_07.dump | 20 - .../syntax/testdir/input/html_fold_expr.html | 105 - .../testdir/input/html_fold_syntax.html | 105 - .../testdir/input/java_comments_html.java | 6 +- .../testdir/input/java_comments_markdown.java | 4 +- .../testdir/input/java_previews_455.java | 2 +- .../testdir/input/setup/html_fold_expr.vim | 2 - .../testdir/input/setup/java_module_info.vim | 2 +- .../testdir/input/setup/vim9_ex_enum.vim | 1 - .../testdir/input/setup/vim9_ex_enum2.vim | 1 - .../testdir/input/setup/vim_ex_redir.vim | 2 - runtime/syntax/testdir/input/sh_13.sh | 9 - runtime/syntax/testdir/input/sh_14.sh | 8 - runtime/syntax/testdir/input/sh_ksh_array.sh | 21 - runtime/syntax/testdir/input/sh_quoting.sh | 4 - runtime/syntax/testdir/input/vim9_comment.vim | 28 - .../syntax/testdir/input/vim9_constructor.vim | 19 - runtime/syntax/testdir/input/vim9_ex_enum.vim | 111 - .../syntax/testdir/input/vim9_ex_enum2.vim | 32 - .../testdir/input/vim9_ex_enum_fold.vim | 23 +- runtime/syntax/testdir/input/vim9_expr.vim | 18 +- .../testdir/input/vim9_function_calls.vim | 2 +- runtime/syntax/testdir/input/vim9_lambda.vim | 48 +- runtime/syntax/testdir/input/vim9_shebang.vim | 0 runtime/syntax/testdir/input/vim9_tuple.vim | 26 - .../syntax/testdir/input/vim9_variables.vim | 18 - runtime/syntax/testdir/input/vim_comment.vim | 4 - .../syntax/testdir/input/vim_ex_augroup.vim | 49 +- .../syntax/testdir/input/vim_ex_autocmd.vim | 264 -- .../syntax/testdir/input/vim_ex_command.vim | 108 +- runtime/syntax/testdir/input/vim_ex_def.vim | 2 +- .../syntax/testdir/input/vim_ex_filter.vim | 13 - .../syntax/testdir/input/vim_ex_function.vim | 2 +- runtime/syntax/testdir/input/vim_ex_grep.vim | 47 - .../syntax/testdir/input/vim_ex_helpgrep.vim | 11 - runtime/syntax/testdir/input/vim_ex_make.vim | 38 - runtime/syntax/testdir/input/vim_ex_redir.vim | 46 - runtime/syntax/testdir/input/vim_ex_set.vim | 13 +- .../testdir/input/vim_ex_set_backslash.vim | 79 - runtime/syntax/testdir/input/vim_ex_sort.vim | 55 - .../testdir/input/vim_ex_substitute.vim | 1 + .../syntax/testdir/input/vim_ex_vimgrep.vim | 69 - runtime/syntax/testdir/input/vim_expr.vim | 96 +- runtime/syntax/testdir/input/vim_lambda.vim | 9 - runtime/syntax/testdir/input/vim_shebang.vim | 0 runtime/syntax/testdir/runtest.vim | 30 +- runtime/syntax/tutor.vim | 9 - runtime/syntax/typst.vim | 11 +- runtime/syntax/vim.vim | 672 +-- runtime/tutor/en/vim-01-beginner.tutor | 19 +- runtime/tutor/sr/vim-01-beginner.tutor | 12 +- runtime/tutor/tutor.tutor | 11 +- runtime/tutor/tutor1.gl | 1048 ----- runtime/tutor/tutor1.gl.utf-8 | 1049 ----- runtime/tutor/tutor2.gl | 215 - runtime/tutor/tutor2.gl.utf-8 | 215 - src/Make_ami.mak | 1 - src/Make_cyg_ming.mak | 5 +- src/Make_mvc.mak | 10 +- src/Make_vms.mms | 5 - src/Makefile | 15 +- src/README.md | 6 +- src/auto/configure | 3932 +++++++---------- src/autocmd.c | 20 +- src/buffer.c | 600 ++- src/change.c | 7 +- src/channel.c | 2 +- src/cindent.c | 33 +- src/clipboard.c | 2 +- src/cmdexpand.c | 138 +- src/dict.c | 4 +- src/diff.c | 822 +--- src/drawline.c | 55 +- src/edit.c | 22 +- src/errors.h | 82 +- src/eval.c | 366 +- src/evalfunc.c | 593 +-- src/evalvars.c | 150 +- src/ex_cmds.c | 7 +- src/ex_docmd.c | 15 +- src/ex_getln.c | 17 - src/feature.h | 13 +- src/fileio.c | 2 - src/findfile.c | 3 +- src/float.c | 2 +- src/fold.c | 7 +- src/gc.c | 200 +- src/globals.h | 30 +- src/gui.c | 61 +- src/gui_gtk_x11.c | 92 +- src/gui_haiku.cc | 3 +- src/gui_w32.c | 132 +- src/highlight.c | 1 - src/if_py_both.h | 462 +- src/if_python.c | 36 +- src/if_python3.c | 38 +- src/if_ruby.c | 69 +- src/indent.c | 17 +- src/insexpand.c | 1064 +---- src/job.c | 2 +- src/json.c | 37 - src/linematch.c | 12 +- src/list.c | 125 +- src/macros.h | 4 - src/main.c | 89 +- src/mbyte.c | 4 +- src/message.c | 27 +- src/message_test.c | 8 +- src/misc2.c | 341 +- src/mouse.c | 10 + src/move.c | 16 +- src/netbeans.c | 2 +- src/normal.c | 8 +- src/ops.c | 4 +- src/option.c | 49 - src/option.h | 6 - src/optiondefs.h | 31 +- src/optionstr.c | 146 +- src/os_mswin.c | 270 +- src/os_unix.c | 21 +- src/os_win32.c | 15 +- src/po/ru.cp1251.po | 315 +- src/po/ru.po | 315 +- src/popupmenu.c | 479 +- src/popupwin.c | 30 +- src/profiler.c | 2 +- src/proto.h | 2 - src/proto/autocmd.pro | 6 +- src/proto/buffer.pro | 1 + src/proto/charset.pro | 2 +- src/proto/cmdexpand.pro | 2 - src/proto/diff.pro | 8 +- src/proto/eval.pro | 3 +- src/proto/evalfunc.pro | 1 - src/proto/filepath.pro | 2 +- src/proto/gc.pro | 11 +- src/proto/getchar.pro | 2 +- src/proto/highlight.pro | 2 +- src/proto/insexpand.pro | 11 +- src/proto/list.pro | 2 - src/proto/mark.pro | 2 +- src/proto/mbyte.pro | 2 +- src/proto/move.pro | 2 +- src/proto/normal.pro | 2 +- src/proto/option.pro | 2 +- src/proto/optionstr.pro | 4 +- src/proto/os_mswin.pro | 5 +- src/proto/os_unix.pro | 4 +- src/proto/popupwin.pro | 3 +- src/proto/quickfix.pro | 3 - src/proto/search.pro | 3 +- src/proto/strings.pro | 1 + src/proto/tag.pro | 2 +- src/proto/term.pro | 2 +- src/proto/testing.pro | 1 - src/proto/tuple.pro | 34 - src/proto/typval.pro | 15 +- src/proto/undo.pro | 2 +- src/proto/userfunc.pro | 2 +- src/proto/vim9class.pro | 4 +- src/proto/vim9compile.pro | 1 + src/proto/vim9instr.pro | 1 - src/proto/vim9type.pro | 3 - src/proto/window.pro | 8 +- src/quickfix.c | 423 +- src/regexp.c | 12 +- src/regexp_bt.c | 16 +- src/regexp_nfa.c | 10 +- src/register.c | 15 +- src/screen.c | 15 +- src/search.c | 43 +- src/session.c | 2 +- src/strings.c | 33 +- src/structs.h | 79 +- src/tag.c | 4 +- src/term.c | 451 +- src/terminal.c | 74 +- src/termlib.c | 3 +- src/testdir/Make_all.mak | 5 - src/testdir/check.vim | 26 - src/testdir/dumps/Test_diff_inline_01.dump | 20 - src/testdir/dumps/Test_diff_inline_02.dump | 20 - src/testdir/dumps/Test_diff_inline_03.dump | 20 - src/testdir/dumps/Test_diff_inline_04.dump | 20 - src/testdir/dumps/Test_diff_inline_05.dump | 20 - src/testdir/dumps/Test_diff_inline_06.dump | 20 - src/testdir/dumps/Test_diff_inline_07.dump | 20 - src/testdir/dumps/Test_diff_inline_08.dump | 20 - src/testdir/dumps/Test_diff_inline_09.dump | 20 - src/testdir/dumps/Test_diff_inline_10.dump | 20 - src/testdir/dumps/Test_diff_inline_11.dump | 20 - src/testdir/dumps/Test_diff_inline_12.dump | 20 - src/testdir/dumps/Test_diff_inline_13.dump | 20 - src/testdir/dumps/Test_diff_inline_14.dump | 20 - src/testdir/dumps/Test_diff_inline_15.dump | 20 - .../dumps/Test_diff_inline_char_01.dump | 20 - .../dumps/Test_diff_inline_char_02.dump | 20 - .../Test_diff_inline_multibuffer_01.dump | 20 - .../Test_diff_inline_multibuffer_02.dump | 20 - .../Test_diff_inline_multibuffer_03.dump | 20 - .../Test_diff_inline_multibuffer_04.dump | 20 - .../Test_diff_inline_multibuffer_05.dump | 20 - .../Test_diff_inline_multibuffer_06.dump | 20 - .../Test_diff_inline_multibuffer_07.dump | 20 - .../dumps/Test_diff_inline_multiline_01.dump | 20 - .../dumps/Test_diff_inline_multiline_02.dump | 20 - .../dumps/Test_diff_inline_multiline_03.dump | 20 - .../dumps/Test_diff_inline_multiline_04.dump | 20 - .../dumps/Test_diff_inline_multiline_05.dump | 20 - .../dumps/Test_diff_inline_multiline_06.dump | 20 - .../dumps/Test_diff_inline_multiline_07.dump | 20 - .../dumps/Test_diff_inline_multiline_08.dump | 20 - .../dumps/Test_diff_inline_multiline_09.dump | 20 - .../dumps/Test_diff_inline_multiline_10.dump | 20 - .../dumps/Test_diff_inline_word_01.dump | 20 - .../dumps/Test_diff_inline_word_02.dump | 20 - .../dumps/Test_diff_inline_word_03.dump | 20 - .../dumps/Test_matchparen_winscrolled1.dump | 7 - .../dumps/Test_matchparen_winscrolled2.dump | 7 - src/testdir/dumps/Test_pum_maxwidth_01.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_02.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_03.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_04.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_05.dump | 10 - src/testdir/dumps/Test_pum_maxwidth_06.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_07.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_08.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_09.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_10.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_11.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_12.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_13.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_14.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_15.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_16.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_17.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_18.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_19.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_20.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_21.dump | 8 - src/testdir/dumps/Test_pum_maxwidth_22.dump | 8 - .../Test_sign_number_without_signtext.dump | 5 - .../dumps/Test_switchwin_clear_pum_01.dump | 20 - .../dumps/Test_switchwin_clear_pum_02.dump | 20 - .../dumps/Test_tabnext_clear_pum_01.dump | 20 - .../dumps/Test_tabnext_clear_pum_02.dump | 20 - src/testdir/dumps/Test_xxd_color_0.dump | 3 +- src/testdir/dumps/Test_xxd_color_1.vim | 3 +- src/testdir/gen_opt_test.vim | 14 +- src/testdir/lsan-suppress.txt | 3 - src/testdir/runtest.vim | 2 - src/testdir/screendump.vim | 4 - src/testdir/test_arglist.vim | 2 +- src/testdir/test_autocmd.vim | 246 +- src/testdir/test_balloon.vim | 4 +- src/testdir/test_blob.vim | 7 +- src/testdir/test_buffer.vim | 35 - src/testdir/test_clientserver.vim | 41 - src/testdir/test_cmdline.vim | 79 +- src/testdir/test_codestyle.vim | 25 - src/testdir/test_comments.vim | 24 +- src/testdir/test_conceal.vim | 6 - src/testdir/test_crash.vim | 1 - src/testdir/test_crypt.vim | 6 +- src/testdir/test_cursor_func.vim | 4 - src/testdir/test_delete.vim | 1 - src/testdir/test_diffmode.vim | 212 +- src/testdir/test_display.vim | 2 - src/testdir/test_edit.vim | 3 +- src/testdir/test_eval_stuff.vim | 6 +- src/testdir/test_expr.vim | 24 +- src/testdir/test_filetype.vim | 158 +- src/testdir/test_filter_map.vim | 1 - src/testdir/test_format.vim | 12 +- src/testdir/test_functions.vim | 30 +- src/testdir/test_gui.vim | 8 +- src/testdir/test_help.vim | 17 - src/testdir/test_hlsearch.vim | 2 - src/testdir/test_ins_complete.vim | 1223 +---- src/testdir/test_lambda.vim | 2 +- src/testdir/test_let.vim | 22 +- src/testdir/test_listdict.vim | 28 +- src/testdir/test_match.vim | 5 - src/testdir/test_menu.vim | 1 - src/testdir/test_messages.vim | 4 - src/testdir/test_method.vim | 4 +- src/testdir/test_mksession.vim | 18 - src/testdir/test_move.vim | 1 - src/testdir/test_normal.vim | 44 - src/testdir/test_options.vim | 34 +- src/testdir/test_plugin_comment.vim | 214 +- src/testdir/test_plugin_matchparen.vim | 24 - src/testdir/test_plugin_tutor.vim | 16 - src/testdir/test_popup.vim | 217 - src/testdir/test_popupwin.vim | 2 +- src/testdir/test_popupwin_textprop.vim | 4 +- src/testdir/test_put.vim | 10 - src/testdir/test_python2.vim | 210 +- src/testdir/test_python3.vim | 220 - src/testdir/test_quickfix.vim | 222 - src/testdir/test_registers.vim | 9 - src/testdir/test_search.vim | 34 +- src/testdir/test_shell.vim | 14 - src/testdir/test_signs.vim | 20 - src/testdir/test_source.vim | 4 +- src/testdir/test_startup.vim | 67 +- src/testdir/test_statusline.vim | 4 - src/testdir/test_substitute.vim | 1 - src/testdir/test_syntax.vim | 1 - src/testdir/test_tabpage.vim | 1 - src/testdir/test_tagfunc.vim | 19 - src/testdir/test_termencoding.vim | 1 - src/testdir/test_terminal.vim | 7 - src/testdir/test_terminal2.vim | 4 - src/testdir/test_terminal3.vim | 5 - src/testdir/test_textprop.vim | 68 - src/testdir/test_trycatch.vim | 12 +- src/testdir/test_tuple.vim | 2356 ---------- src/testdir/test_undo.vim | 1 - src/testdir/test_usercommands.vim | 4 +- src/testdir/test_utf8.vim | 3 - src/testdir/test_vim9_assign.vim | 29 +- src/testdir/test_vim9_builtin.vim | 44 +- src/testdir/test_vim9_class.vim | 680 +-- src/testdir/test_vim9_cmd.vim | 32 +- src/testdir/test_vim9_disassemble.vim | 181 - src/testdir/test_vim9_expr.vim | 28 +- src/testdir/test_vim9_func.vim | 5 - src/testdir/test_vim9_import.vim | 1 - src/testdir/test_vim9_script.vim | 25 +- src/testdir/test_viminfo.vim | 26 - src/testdir/test_vimscript.vim | 11 - src/testdir/test_window_cmd.vim | 12 - src/testdir/test_xxd.vim | 1 - src/testdir/vim9.vim | 158 +- src/testing.c | 12 +- src/textformat.c | 23 +- src/time.c | 2 +- src/tuple.c | 1122 ----- src/typval.c | 181 +- src/usercmd.c | 16 +- src/userfunc.c | 211 +- src/version.c | 310 -- src/vim.h | 18 +- src/vim9.h | 6 - src/vim9class.c | 9 +- src/vim9cmds.c | 39 +- src/vim9compile.c | 105 +- src/vim9execute.c | 433 +- src/vim9expr.c | 181 +- src/vim9instr.c | 126 +- src/vim9script.c | 41 +- src/vim9type.c | 894 +--- src/viminfo.c | 27 +- src/window.c | 25 +- src/xxd/xxd.c | 376 +- 741 files changed, 7765 insertions(+), 34613 deletions(-) delete mode 100644 ci/ddebs.list delete mode 100644 ci/if_feat_check.vim delete mode 100644 ci/pinned-pkgs delete mode 100644 ci/setup-sway.sh delete mode 100644 debian/patches/Set-NoDisplay-true-for-vim-desktop.patch create mode 100644 debian/patches/patch-9.1.1242-Crash-when-evaluating-variable-name.patch create mode 100644 debian/patches/patch-9.1.1244-part-of-patch-v9.1.1242-was-wrong.patch delete mode 100644 debian/upstream/metadata delete mode 100644 runtime/autoload/htmlfold.vim delete mode 100644 runtime/compiler/gleam_build.vim delete mode 100644 runtime/ftplugin/abnf.vim delete mode 100644 runtime/ftplugin/dax.vim delete mode 100644 runtime/ftplugin/groff.vim delete mode 100644 runtime/ftplugin/lf.vim delete mode 100644 runtime/ftplugin/mbsync.vim delete mode 100644 runtime/ftplugin/pq.vim delete mode 100644 runtime/ftplugin/remind.vim delete mode 100644 runtime/ftplugin/spajson.vim delete mode 100644 runtime/indent/spajson.vim delete mode 100644 runtime/indent/testdir/make.in delete mode 100644 runtime/indent/testdir/make.ok delete mode 100644 runtime/indent/testdir/tools/tracer.vim delete mode 100644 runtime/keymap/brazilian_portuguese-abnt.vim delete mode 100644 runtime/keymap/brazilian_portuguese-compact.vim delete mode 100644 runtime/pack/dist/opt/helptoc/doc/helptoc.txt delete mode 100644 runtime/pack/dist/opt/helptoc/doc/tags delete mode 100644 runtime/syntax/dax.vim delete mode 100644 runtime/syntax/gleam.vim delete mode 100644 runtime/syntax/mbsync.vim delete mode 100644 runtime/syntax/pq.vim delete mode 100644 runtime/syntax/spajson.vim delete mode 100644 runtime/syntax/testdir/dumps/c_character_constant_00.vim delete mode 100644 runtime/syntax/testdir/dumps/c_character_constant_01.vim delete mode 100644 runtime/syntax/testdir/dumps/c_character_constant_02.vim delete mode 100644 runtime/syntax/testdir/dumps/c_string_literal_00.vim delete mode 100644 runtime/syntax/testdir/dumps/c_string_literal_01.vim delete mode 100644 runtime/syntax/testdir/dumps/c_string_literal_02.vim delete mode 100644 runtime/syntax/testdir/dumps/c_string_literal_03.vim delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_00.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_01.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_02.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_03.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_04.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_05.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_expr_06.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_00.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_01.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_02.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_03.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_04.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_05.dump delete mode 100644 runtime/syntax/testdir/dumps/html_fold_syntax_06.dump delete mode 100644 runtime/syntax/testdir/dumps/sh_13_00.dump delete mode 100644 runtime/syntax/testdir/dumps/sh_14_00.dump delete mode 100644 runtime/syntax/testdir/dumps/sh_ksh_array_00.dump delete mode 100644 runtime/syntax/testdir/dumps/sh_ksh_array_01.dump delete mode 100644 runtime/syntax/testdir/dumps/sh_quoting_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_comment_04.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_comment_05.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_constructor_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum2_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum2_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_03.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_04.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_05.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_ex_enum_06.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_expr_10.dump rename runtime/syntax/testdir/dumps/{vim9_ex_loadkeymap_01.vim => vim9_keymap_01.vim} (100%) delete mode 100644 runtime/syntax/testdir/dumps/vim9_lambda_07.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_lambda_08.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_lambda_09.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_tuple_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_tuple_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim9_variables_13.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_comment_04.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_augroup_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_augroup_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_augroup_03.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_03.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_04.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_05.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_06.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_07.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_08.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_09.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_10.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_11.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_12.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_13.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_14.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_15.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_autocmd_16.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_05.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_06.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_07.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_command_08.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_filter_00.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump create mode 100644 runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_grep_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_grep_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_grep_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_helpgrep_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_make_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_make_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_make_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_redir_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_redir_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_redir_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_07.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_03.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_set_backslash_04.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_sort_03.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_00.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_01.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_02.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_03.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_ex_vimgrep_04.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_expr_19.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_expr_20.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_expr_21.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_expr_22.dump delete mode 100644 runtime/syntax/testdir/dumps/vim_expr_23.dump rename runtime/syntax/testdir/dumps/{vim_ex_loadkeymap_01.vim => vim_keymap_04.vim} (100%) delete mode 100644 runtime/syntax/testdir/dumps/vim_lambda_07.dump delete mode 100644 runtime/syntax/testdir/input/html_fold_expr.html delete mode 100644 runtime/syntax/testdir/input/html_fold_syntax.html delete mode 100644 runtime/syntax/testdir/input/setup/html_fold_expr.vim delete mode 100644 runtime/syntax/testdir/input/setup/vim9_ex_enum.vim delete mode 100644 runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim delete mode 100644 runtime/syntax/testdir/input/setup/vim_ex_redir.vim delete mode 100644 runtime/syntax/testdir/input/sh_13.sh delete mode 100644 runtime/syntax/testdir/input/sh_14.sh delete mode 100755 runtime/syntax/testdir/input/sh_ksh_array.sh delete mode 100644 runtime/syntax/testdir/input/sh_quoting.sh delete mode 100644 runtime/syntax/testdir/input/vim9_constructor.vim delete mode 100644 runtime/syntax/testdir/input/vim9_ex_enum.vim delete mode 100644 runtime/syntax/testdir/input/vim9_ex_enum2.vim mode change 100644 => 100755 runtime/syntax/testdir/input/vim9_shebang.vim delete mode 100644 runtime/syntax/testdir/input/vim9_tuple.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_autocmd.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_filter.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_grep.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_helpgrep.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_make.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_redir.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_set_backslash.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_sort.vim delete mode 100644 runtime/syntax/testdir/input/vim_ex_vimgrep.vim mode change 100644 => 100755 runtime/syntax/testdir/input/vim_shebang.vim delete mode 100644 runtime/tutor/tutor1.gl delete mode 100644 runtime/tutor/tutor1.gl.utf-8 delete mode 100644 runtime/tutor/tutor2.gl delete mode 100644 runtime/tutor/tutor2.gl.utf-8 delete mode 100644 src/proto/tuple.pro delete mode 100644 src/testdir/dumps/Test_diff_inline_01.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_02.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_03.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_04.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_05.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_06.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_07.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_08.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_09.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_10.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_11.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_12.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_13.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_14.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_15.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_char_01.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_char_02.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_01.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_02.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_03.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_04.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_05.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_06.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multibuffer_07.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_01.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_02.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_03.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_04.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_05.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_06.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_07.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_08.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_09.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_multiline_10.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_word_01.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_word_02.dump delete mode 100644 src/testdir/dumps/Test_diff_inline_word_03.dump delete mode 100644 src/testdir/dumps/Test_matchparen_winscrolled1.dump delete mode 100644 src/testdir/dumps/Test_matchparen_winscrolled2.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_01.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_02.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_03.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_04.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_05.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_06.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_07.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_08.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_09.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_10.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_11.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_12.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_13.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_14.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_15.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_16.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_17.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_18.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_19.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_20.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_21.dump delete mode 100644 src/testdir/dumps/Test_pum_maxwidth_22.dump delete mode 100644 src/testdir/dumps/Test_sign_number_without_signtext.dump delete mode 100644 src/testdir/dumps/Test_switchwin_clear_pum_01.dump delete mode 100644 src/testdir/dumps/Test_switchwin_clear_pum_02.dump delete mode 100644 src/testdir/dumps/Test_tabnext_clear_pum_01.dump delete mode 100644 src/testdir/dumps/Test_tabnext_clear_pum_02.dump delete mode 100644 src/testdir/test_plugin_tutor.vim delete mode 100644 src/testdir/test_tuple.vim delete mode 100644 src/tuple.c diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 5f3160d6..4d064077 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -13,13 +13,3 @@ # change indentation style of netrw plugin c363ca1ecd1f8db03663ef98dcf41eeacc3c22c7 c673b805ad80d0aef07e745d412a2bf298ba1c07 -# fix indentation style in insexpand.c v9.1.1352 -355db99d12a89f05765948b33eecd6d9733e16bb -# fix indentation styles in various files v9.1.1363 -c2a9000bc1b4a2cbcfeef55450c184b16906d910 -# indentation style in various files v9.1.1364 -562610cfa327c8ebff12a1700525e17a070d5e2c -# Patch v9.1.1371 -19e1dd6b6aeb96d64122332a8c3d17b9d5ca007b -# Patch v9.1.1372 -a4a00a7ad0cfa26685c057c11a09bec2c962346a diff --git a/.gitignore b/.gitignore index aee4e994..420b3d90 100644 --- a/.gitignore +++ b/.gitignore @@ -96,7 +96,9 @@ src/json_test src/message_test src/kword_test +runtime/syntax/testdir/Xfilter runtime/syntax/testdir/done/ +runtime/syntax/testdir/failed/ runtime/syntax/testdir/messages runtime/syntax/testdir/testdeps.mk runtime/syntax/testdir/vimcmd diff --git a/.hgignore b/.hgignore index 38388a53..d7677be5 100644 --- a/.hgignore +++ b/.hgignore @@ -98,7 +98,9 @@ src/json_test src/message_test src/kword_test +runtime/syntax/testdir/Xfilter runtime/syntax/testdir/done/ +runtime/syntax/testdir/failed/ runtime/syntax/testdir/messages runtime/syntax/testdir/testdeps.mk runtime/syntax/testdir/vimcmd diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1572775..17bb9b30 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,31 +21,6 @@ Contributions will be distributed with Vim under the Vim license. Providing a change to be included implies that you agree with this and your contribution does not cause us trouble with trademarks or patents. There is no CLA to sign. -## Signing-off commits - -While not required, it's recommended to use **Signed-off commits** to ensure -transparency, accountability, and compliance with open-source best practices. -Signed-off commits follow the [Developer Certificate of Origin (DCO)][15], -which confirms that contributors have the right to submit their changes under -the project's license. This process adds a `Signed-off-by` line to commit -messages, verifying that the contributor agrees to the project's licensing -terms. To sign off a commit, simply use the -s flag when committing: - -```sh -git commit -s -``` - -This ensures that every contribution is properly documented and traceable, -aligning with industry standards used in projects like the Linux Kernel or -the git project. By making Signed-off commits a standard practice, we help -maintain a legally compliant and well-governed codebase while fostering trust -within our contributor community. - -When merging PRs into Vim, the current maintainer @chrisbra usually adds missing -`Signed-off-by` trailers for the author user name and email address as well for -anybody that explicitly *ACK*s a pull request as a statement that those -approvers are happy with that particular change. - # Reporting issues We use GitHub issues, but that is not a requirement. Writing to the Vim @@ -71,7 +46,7 @@ Or open [the todo file][todo list] on GitHub to see the latest version. # Syntax, indent and other runtime files The latest version of these files can be obtained from the repository. -They are usually not updated with numbered patches. However, they may +They are usually not updated with numbered patches. However, they may or may not work with older Vim releases (since they may contain new features). If you find a problem with one of these files or have a suggestion for @@ -138,4 +113,3 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website, [12]: https://github.com/vim/vim/blob/master/src/testdir/test_filetype.vim [13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt [14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt -[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin diff --git a/Filelist b/Filelist index 85e4d329..95bed7d6 100644 --- a/Filelist +++ b/Filelist @@ -23,12 +23,8 @@ SRC_ALL = \ ci/appveyor.bat \ ci/config.mk*.sed \ ci/if_ver*.vim \ - ci/if_feat_check.vim \ ci/setup-xvfb.sh \ - ci/setup-sway.sh \ ci/remove_snap.sh \ - ci/ddebs.list \ - ci/pinned-pkgs \ src/Make_all.mak \ src/README.md \ src/alloc.c \ @@ -161,7 +157,6 @@ SRC_ALL = \ src/textobject.c \ src/textprop.c \ src/time.c \ - src/tuple.c \ src/typval.c \ src/ui.c \ src/undo.c \ @@ -344,7 +339,6 @@ SRC_ALL = \ src/proto/textobject.pro \ src/proto/textprop.pro \ src/proto/time.pro \ - src/proto/tuple.pro \ src/proto/typval.pro \ src/proto/ui.pro \ src/proto/undo.pro \ @@ -810,8 +804,6 @@ RT_ALL = \ runtime/pack/dist/opt/editorconfig/ftdetect/editorconfig.vim \ runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \ runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \ - runtime/pack/dist/opt/helptoc/doc/helptoc.txt \ - runtime/pack/dist/opt/helptoc/doc/tags \ runtime/pack/dist/opt/helptoc/plugin/helptoc.vim \ runtime/pack/dist/opt/hlyank/plugin/hlyank.vim \ runtime/pack/dist/opt/justify/plugin/justify.vim \ @@ -868,7 +860,6 @@ RT_SCRIPTS = \ runtime/indent/testdir/*.vim \ runtime/indent/testdir/*.in \ runtime/indent/testdir/*.ok \ - runtime/indent/testdir/tools/* \ runtime/ftplugin/*.vim \ runtime/ftplugin/logtalk.dict \ runtime/ftplugin/README.txt \ diff --git a/ci/appveyor.bat b/ci/appveyor.bat index 17d95ff6..c77cee19 100644 --- a/ci/appveyor.bat +++ b/ci/appveyor.bat @@ -71,7 +71,7 @@ cd src echo "Building MSVC 64bit console Version" nmake -f Make_mvc.mak CPU=AMD64 ^ OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^ - FEATURES=%FEATURE% CI_CFLAGS=/we4267 + FEATURES=%FEATURE% if not exist vim.exe ( echo Build failure. exit 1 @@ -85,11 +85,11 @@ if "%FEATURE%" == "HUGE" ( OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^ PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^ PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^ - FEATURES=%FEATURE% CI_CFLAGS=/we4267 + FEATURES=%FEATURE% ) ELSE ( nmake -f Make_mvc.mak CPU=AMD64 ^ OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^ - FEATURES=%FEATURE% CI_CFLAGS=/we4267 + FEATURES=%FEATURE% ) if not exist gvim.exe ( echo Build failure. diff --git a/ci/ddebs.list b/ci/ddebs.list deleted file mode 100644 index e4491a60..00000000 --- a/ci/ddebs.list +++ /dev/null @@ -1,3 +0,0 @@ -deb http://ddebs.ubuntu.com noble main restricted universe multiverse -deb http://ddebs.ubuntu.com noble-updates main restricted universe multiverse -deb http://ddebs.ubuntu.com noble-proposed main restricted universe multiverse diff --git a/ci/if_feat_check.vim b/ci/if_feat_check.vim deleted file mode 100644 index f846f7cb..00000000 --- a/ci/if_feat_check.vim +++ /dev/null @@ -1,15 +0,0 @@ -if 1 " This prevents it from being run in tiny versions - " Check for required features - if exists("g:required") - for feature in g:required - if !has(feature) - echo "Error: Feature '" .. feature .. "' not found" - echo '' - cquit - endif - endfor - echo "\nChecked features: " .. string(g:required) - echo '' - endif -endif -" vim: sts=2 sw=2 et diff --git a/ci/if_ver-1.vim b/ci/if_ver-1.vim index 397c05a4..adc40a7c 100644 --- a/ci/if_ver-1.vim +++ b/ci/if_ver-1.vim @@ -1,6 +1,6 @@ -" Print all interface versions. Part 1. +" Print all interface versions for Ubuntu. Part 1. -if 1 " This prevents it from being run in tiny versions +if 1 execute 'source' expand(':h') .. '/if_ver-cmd.vim' echo "*** Interface versions ***\n" diff --git a/ci/if_ver-2.vim b/ci/if_ver-2.vim index f717ec1e..83e80e48 100644 --- a/ci/if_ver-2.vim +++ b/ci/if_ver-2.vim @@ -1,8 +1,6 @@ -" Print py3 interface versions. Part 2. -" This is done separately from part 1 because Vim cannot concurrently load -" Python 2 and 3 together. +" Print py3 interface versions for Ubuntu. Part 2. -if 1 " This prevents it from being run in tiny versions +if 1 execute 'source' expand(':h') .. '/if_ver-cmd.vim' echo 'Python 3:' diff --git a/ci/pinned-pkgs b/ci/pinned-pkgs deleted file mode 100644 index 0603e141..00000000 --- a/ci/pinned-pkgs +++ /dev/null @@ -1,69 +0,0 @@ -# Unfortunately ubtunu does not keep the debug packages strictly up-to-date -# with the main packages. So this file needs to pin the main packages back to -# the version for which debug packages are available. - -Package: libwayland-client0 -Pin: version 1.20.0-1 -Pin-Priority: 1000 - -Package: libwayland-client0 -Pin: version 1.20.0-1ubuntu0.1 -Pin-Priority: 100 - -Package: libwayland-cursor0 -Pin: version 1.20.0-1 -Pin-Priority: 1000 - -Package: libwayland-cursor0 -Pin: version 1.20.0-1ubuntu0.1 -Pin-Priority: 100 - -Package: libwayland-egl1 -Pin: version 1.20.0-1 -Pin-Priority: 1000 - -Package: libwayland-egl1 -Pin: version 1.20.0-1ubuntu0.1 -Pin-Priority: 100 - -Package: libwayland-dev -Pin: version 1.20.0-1 -Pin-Priority: 1000 - -Package: libwayland-dev -Pin: version 1.20.0-1ubuntu0.1 -Pin-Priority: 100 - -Package: libwayland-server0 -Pin: version 1.20.0-1 -Pin-Priority: 1000 - -Package: libwayland-server0 -Pin: version 1.20.0-1ubuntu0.1 -Pin-Priority: 100 - -Package: libwayland-bin -Pin: version 1.20.0-1 -Pin-Priority: 1000 - -Package: libwayland-bin -Pin: version 1.20.0-1ubuntu0.1 -Pin-Priority: 100 - -# As of 2025-04-27 the base library package libgtk-3-0t64 is still at 3.24.41-4ubuntu1.2 -Package: libgtk-3-0t64-dbgsym -Pin: version 3.24.41-4ubuntu1.2 -Pin-Priority: 1000 - -Package: libgtk-3-0t64-dbgsym -Pin: version 3.24.41-4ubuntu1.3 -Pin-Priority: 100 - -# As of 2025-04-27 the base binary package libgtk-3-bin is still at 3.24.41-4ubuntu1.2 -Package: libgtk-3-bin-dbgsym -Pin: version 3.24.41-4ubuntu1.2 -Pin-Priority: 1000 - -Package: libgtk-3-bin-dbgsym -Pin: version 3.24.41-4ubuntu1.3 -Pin-Priority: 100 diff --git a/ci/setup-sway.sh b/ci/setup-sway.sh deleted file mode 100644 index 060b7f9e..00000000 --- a/ci/setup-sway.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -e - -# Using a systemd user service doesn't work because it seems like github actions -# doesn't support user sessions? Just run sway in the background and disown it. -WLR_BACKENDS=headless sway & -disown diff --git a/debian/changelog b/debian/changelog index 39f5aec2..6ce46b97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,15 +1,9 @@ -vim (2:9.1.1385-1deepin1) experimental; urgency=medium +vim (2:9.1.1230-2) unstable; urgency=medium - [ James McCoy ] - * Merge upstream tag v9.1.1385 - - [ Kirill Rekhov ] - * d/upstream/metadata: add metadata - * Fix day-of-week for changelog entries 1:6.3-015+1, 1:6.3-010+1, 4.6-2. - - * Set NoDisplay=true for vim.desktop + * Backport v9.1.1242 and v9.1.1244 to fix crash when evaluating a variable + name. (Closes: #1106133) - -- lhdjply Wed, 21 Mar 2025 15:27:16 +0800 + -- James McCoy Thu, 22 May 2025 20:48:59 -0400 vim (2:9.1.1230-1) unstable; urgency=medium @@ -4487,7 +4481,7 @@ vim (1:6.3-015+1) unstable; urgency=medium and fixes svn commit file highlighting. * Added a new patch which adds s390 and amd64 to debcontrol.vim. - -- Norbert Tretkowski Tue, 17 Aug 2004 19:34:13 +0200 + -- Norbert Tretkowski Wed, 17 Aug 2004 19:34:13 +0200 vim (1:6.3-013+2) unstable; urgency=low @@ -4534,7 +4528,7 @@ vim (1:6.3-010+1) unstable; urgency=low + updated kvim patch to apply without conflicts to new vim upstream patches - -- Norbert Tretkowski Wed, 30 Jun 2004 18:35:26 +0200 + -- Norbert Tretkowski Thu, 30 Jun 2004 18:35:26 +0200 vim (1:6.3-004+1) unstable; urgency=low @@ -7559,7 +7553,7 @@ vim (4.6-2) unstable; urgency=low * Built with libc6, ncurses3.4, and xlib6g * Updated menu entry - -- Galen Hazelwood Tue, 09 Sep 1997 12:44:30 -0600 + -- Galen Hazelwood Thu, 9 Sep 1997 12:44:30 -0600 vim (4.6-1) frozen unstable; urgency=low diff --git a/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch b/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch index 7507aedc..51e89680 100644 --- a/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch +++ b/debian/patches/Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch @@ -28,7 +28,7 @@ index ba87b31..e7526ec 100644 the screen, then the popup is moved to the left so as to fit the diff --git a/src/popupwin.c b/src/popupwin.c -index 60a54d7..bb4c550 100644 +index 76ebf38..33bff26 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -1433,7 +1433,17 @@ popup_adjust_position(win_T *wp) @@ -76,7 +76,7 @@ index 60a54d7..bb4c550 100644 { wp->w_width = len + margin_width; diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim -index 3c8e5d7..7920443 100644 +index 5082676..e182505 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -31,7 +31,7 @@ func Test_simple_popup() @@ -152,10 +152,10 @@ index 3c8e5d7..7920443 100644 \ wrap: 0, \ fixed: 1, diff --git a/src/version.c b/src/version.c -index a2cfb00..6091dcd 100644 +index f50c414..11ba12a 100644 --- a/src/version.c +++ b/src/version.c -@@ -1576,8 +1576,6 @@ static int included_patches[] = +@@ -1266,8 +1266,6 @@ static int included_patches[] = 951, /**/ 950, diff --git a/debian/patches/Set-NoDisplay-true-for-vim-desktop.patch b/debian/patches/Set-NoDisplay-true-for-vim-desktop.patch deleted file mode 100644 index 3a5e0565..00000000 --- a/debian/patches/Set-NoDisplay-true-for-vim-desktop.patch +++ /dev/null @@ -1,28 +0,0 @@ -Description: Set NoDisplay=true for vim.desktop -Author: Tianyu Chen -Origin: vendor -Bug-deepin: https://pms.uniontech.com/bug-view-285241.html -Forwarded: not-needed -Last-Update: 2024-11-18 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/src/po/vim.desktop.in -+++ b/src/po/vim.desktop.in -@@ -69,6 +69,7 @@ - TryExec=vim - Exec=vim %F - Terminal=true -+NoDisplay=true - Type=Application - # Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon! - Keywords=Text;editor; ---- a/runtime/vim.desktop -+++ b/runtime/vim.desktop -@@ -111,6 +111,7 @@ - TryExec=vim - Exec=vim %F - Terminal=true -+NoDisplay=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; diff --git a/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch index 73871dbf..7e9f14ba 100644 --- a/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch +++ b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch @@ -13,10 +13,10 @@ Signed-off-by: James McCoy 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim -index 95135c8..38e1cad 100644 +index a740305..3155be1 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim -@@ -1193,7 +1193,7 @@ export def FTtex() +@@ -1140,7 +1140,7 @@ export def FTtex() var firstNC = search('^\s*[^[:space:]%]', 'c', 1000) if firstNC > 0 # Check the next thousand lines for a LaTeX or ConTeXt keyword. diff --git a/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch index 48ef92d0..49cc6666 100644 --- a/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch +++ b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch @@ -8,10 +8,10 @@ Closes: #382541 1 file changed, 8 insertions(+) diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim -index c184bd0..02e4605 100644 +index 859126f..7534ef4 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim -@@ -424,6 +424,14 @@ def DetectFromText(line1: string) +@@ -423,6 +423,14 @@ def DetectFromText(line1: string) elseif line1 =~ 'exec\s\+\S*scheme' || line2 =~ 'exec\s\+\S*scheme' setl ft=scheme diff --git a/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch index 7cffce16..58b2edfa 100644 --- a/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch +++ b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch @@ -15,10 +15,10 @@ Signed-off-by: James McCoy 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt -index 5563a05..9b182c4 100644 +index a824536..6d790bf 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt -@@ -5861,7 +5861,7 @@ A jump table for the options with a short description can be found at |Q_op|. +@@ -5756,7 +5756,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'modeline'* *'ml'* *'nomodeline'* *'noml'* 'modeline' 'ml' boolean (Vim default: on (off for root), diff --git a/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch index f46c048a..8a5f9430 100644 --- a/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch +++ b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch @@ -17,10 +17,10 @@ Signed-off-by: James Vega 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c -index 31494e3..735b303 100644 +index f603a52..403e390 100644 --- a/src/main.c +++ b/src/main.c -@@ -2008,6 +2008,10 @@ parse_command_name(mparm_T *parmp) +@@ -1973,6 +1973,10 @@ parse_command_name(mparm_T *parmp) } else if (STRNICMP(initstr, "vim", 3) == 0) initstr += 3; @@ -31,7 +31,7 @@ index 31494e3..735b303 100644 // Catch "[r][g]vimdiff" and "[r][g]viewdiff". if (STRICMP(initstr, "diff") == 0) -@@ -3303,7 +3307,12 @@ source_startup_scripts(mparm_T *parmp) +@@ -3268,7 +3272,12 @@ source_startup_scripts(mparm_T *parmp) * Get system wide defaults, if the file name is defined. */ #ifdef SYS_VIMRC_FILE @@ -45,7 +45,7 @@ index 31494e3..735b303 100644 #endif #ifdef MACOS_X (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, -@@ -3346,13 +3355,25 @@ source_startup_scripts(mparm_T *parmp) +@@ -3311,13 +3320,25 @@ source_startup_scripts(mparm_T *parmp) #ifdef USR_EXRC_FILE2 && do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE, NULL) == FAIL @@ -86,10 +86,10 @@ index 39c9304..fbc5c64 100644 # define SYS_VIMRC_FILE "$VIM/vimrc" #endif diff --git a/src/structs.h b/src/structs.h -index caf61ed..8d8b8a7 100644 +index ce98bce..dc7e649 100644 --- a/src/structs.h +++ b/src/structs.h -@@ -4695,6 +4695,9 @@ typedef struct +@@ -4627,6 +4627,9 @@ typedef struct #ifdef FEAT_DIFF int diff_mode; // start with 'diff' set #endif diff --git a/debian/patches/patch-9.1.1242-Crash-when-evaluating-variable-name.patch b/debian/patches/patch-9.1.1242-Crash-when-evaluating-variable-name.patch new file mode 100644 index 00000000..bb05df72 --- /dev/null +++ b/debian/patches/patch-9.1.1242-Crash-when-evaluating-variable-name.patch @@ -0,0 +1,57 @@ +From: Christian Brabandt +Date: Wed, 26 Mar 2025 19:25:57 +0100 +Subject: patch 9.1.1242: Crash when evaluating variable name + +Problem: Crash when evaluating variable name (after v9.1.0870) +Solution: calculate the strlen() directly instead of pointer + arithmetics, fix missing assignment to lp->ll_name_end in + get_lval() (zeertzjq) + +closes: #16972 +fixes: vim-airline/vim-airline#2710 +related: #16066 + +Co-authored-by: zeertzjq +Signed-off-by: Christian Brabandt +(cherry picked from commit 06774a271a7d728f188175340154361255d6b0a4) +Signed-off-by: James McCoy +--- + src/eval.c | 4 +++- + src/version.c | 2 ++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/eval.c b/src/eval.c +index 9a140c1..eb6b8d9 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -2051,6 +2051,8 @@ get_lval( + } + } + lp->ll_name = lp->ll_exp_name; ++ if (lp->ll_name != NULL) ++ lp->ll_name_end = lp->ll_name + STRLEN(lp->ll_name); + } + else + { +@@ -2261,7 +2263,7 @@ set_var_lval( + + // handle +=, -=, *=, /=, %= and .= + di = NULL; +- if (eval_variable(lp->ll_name, (int)(lp->ll_name_end - lp->ll_name), ++ if (eval_variable(lp->ll_name, (int)STRLEN(lp->ll_name), + lp->ll_sid, &tv, &di, EVAL_VAR_VERBOSE) == OK) + { + if (di != NULL && check_typval_is_value(&di->di_tv) == FAIL) +diff --git a/src/version.c b/src/version.c +index 11ba12a..6b9759c 100644 +--- a/src/version.c ++++ b/src/version.c +@@ -704,6 +704,8 @@ static char *(features[]) = + + static int included_patches[] = + { /* Add new patch number below this line */ ++/**/ ++ 1242, + /**/ + 1230, + /**/ diff --git a/debian/patches/patch-9.1.1244-part-of-patch-v9.1.1242-was-wrong.patch b/debian/patches/patch-9.1.1244-part-of-patch-v9.1.1242-was-wrong.patch new file mode 100644 index 00000000..946ef2d2 --- /dev/null +++ b/debian/patches/patch-9.1.1244-part-of-patch-v9.1.1242-was-wrong.patch @@ -0,0 +1,44 @@ +From: Christian Brabandt +Date: Wed, 26 Mar 2025 20:36:12 +0100 +Subject: patch 9.1.1244: part of patch v9.1.1242 was wrong + +Problem: part of patch v9.1.1242 was wrong +Solution: revert part of the patch + +fixes: #16983 +related: #16972 + +Signed-off-by: Christian Brabandt +(cherry picked from commit 35cb38d34b69e4263f0eb9f78a676a5fb6d11250) +Signed-off-by: James McCoy +--- + src/eval.c | 2 -- + src/version.c | 2 ++ + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/eval.c b/src/eval.c +index eb6b8d9..4cdd1f2 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -2051,8 +2051,6 @@ get_lval( + } + } + lp->ll_name = lp->ll_exp_name; +- if (lp->ll_name != NULL) +- lp->ll_name_end = lp->ll_name + STRLEN(lp->ll_name); + } + else + { +diff --git a/src/version.c b/src/version.c +index 6b9759c..30f58fd 100644 +--- a/src/version.c ++++ b/src/version.c +@@ -704,6 +704,8 @@ static char *(features[]) = + + static int included_patches[] = + { /* Add new patch number below this line */ ++/**/ ++ 1244, + /**/ + 1242, + /**/ diff --git a/debian/patches/series b/debian/patches/series index 567810f1..09620bfd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,4 +3,5 @@ debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch Revert-patch-9.1.0949-popups-inconsistently-shifted-to-th.patch -Set-NoDisplay-true-for-vim-desktop.patch +patch-9.1.1242-Crash-when-evaluating-variable-name.patch +patch-9.1.1244-part-of-patch-v9.1.1242-was-wrong.patch diff --git a/debian/upstream/metadata b/debian/upstream/metadata deleted file mode 100644 index 4ad7b6bc..00000000 --- a/debian/upstream/metadata +++ /dev/null @@ -1,7 +0,0 @@ -Bug-Database: https://github.com/vim/vim/issues -Bug-Submit: https://github.com/vim/vim/issues/new -Changelog: https://github.com/vim/vim/commits/master/ -Documentation: https://github.com/vim/vim/wiki -Repository: https://github.com/vim/vim.git -Repository-Browse: https://github.com/vim/vim -Security-Contact: https://github.com/vim/vim/blob/master/SECURITY.md diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 95135c8b..a7403052 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Apr 21 +# Last Change: 2025 Jan 25 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -203,36 +203,19 @@ export def FTlpc() setf c enddef -# Searches within the first `maxlines` lines of the file for distinctive -# Objective-C or C++ syntax and returns the appropriate filetype. Returns a -# null_string if the search was inconclusive. -def CheckObjCOrCpp(maxlines = 100): string - var n = 1 - while n < maxlines && n <= line('$') - const line = getline(n) - if line =~ '\v^\s*\@%(class|interface|end)>' - return 'objcpp' - elseif line =~ '\v^\s*%(class|namespace|template|using)>' - return 'cpp' - endif - ++n - endwhile - return null_string -enddef - -# Determines whether a *.h file is C, C++, Ch, or Objective-C/Objective-C++. export def FTheader() - if exists('g:filetype_h') - execute $'setf {g:filetype_h}' - elseif exists('g:c_syntax_for_h') + if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 + if exists("g:c_syntax_for_h") + setf objc + else + setf objcpp + endif + elseif exists("g:c_syntax_for_h") setf c - elseif exists('g:ch_syntax_for_h') + elseif exists("g:ch_syntax_for_h") setf ch else - # Search the first 100 lines of the file for distinctive Objective-C or C++ - # syntax and set the filetype accordingly. Otherwise, use C as the default - # filetype. - execute $'setf {CheckObjCOrCpp() ?? 'c'}' + setf cpp endif enddef @@ -574,47 +557,17 @@ export def FTm() enddef export def FTmake() - # Check if it is a BSD, GNU, or Microsoft Makefile - unlet! b:make_flavor - - # 1. filename - if expand('%:t') == 'BSDmakefile' - b:make_flavor = 'bsd' - setf make - return - elseif expand('%:t') == 'GNUmakefile' - b:make_flavor = 'gnu' - setf make - return - endif - - # 2. user's setting - if exists('g:make_flavor') - b:make_flavor = g:make_flavor - setf make - return - elseif get(g:, 'make_microsoft') - echom "make_microsoft is deprecated; try g:make_flavor = 'microsoft' instead" - b:make_flavor = 'microsoft' - setf make - return - endif - - # 3. try to detect a flavor from file content + # Check if it is a Microsoft Makefile + unlet! b:make_microsoft var n = 1 while n < 1000 && n <= line('$') var line = getline(n) if line =~? '^\s*!\s*\(ifn\=\(def\)\=\|include\|message\|error\)\>' - b:make_flavor = 'microsoft' - break - elseif line =~ '^\.\%(export\|error\|for\|if\%(n\=\%(def\|make\)\)\=\|info\|warning\)\>' - b:make_flavor = 'bsd' + b:make_microsoft = 1 break - elseif line =~ '^ *\%(ifn\=\%(eq\|def\)\|define\|override\)\>' - b:make_flavor = 'gnu' + elseif line =~ '^ *ifn\=\(eq\|def\)\>' || line =~ '^ *[-s]\=include\s' break - elseif line =~ '\$[({][a-z-]\+\s\+\S\+' # a function call, e.g. $(shell pwd) - b:make_flavor = 'gnu' + elseif line =~ '^ *\w\+\s*[!?:+]=' break endif n += 1 @@ -639,19 +592,14 @@ export def FTmms() setf mmix enddef -# This function checks if one of the first five lines start with a typical -# nroff pattern in man files. In that case it is probably an nroff file: -# 'filetype' is set and 1 is returned. +# 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 - var n = 1 - while n <= 5 - var line = getline(n) - if line =~ '^\%([.'']\s*\%(TH\|D[dt]\|S[Hh]\|d[es]1\?\|so\)\s\+\S\|[.'']\s*ig\>\|\%([.'']\s*\)\?\\"\)' - setf nroff - return 1 - endif - n += 1 - endwhile + if getline(1)[0] .. getline(2)[0] .. getline(3)[0] + .. getline(4)[0] .. getline(5)[0] =~ '\.' + setf nroff + return 1 + endif return 0 enddef @@ -927,16 +875,16 @@ export def SetFileTypeSH(name: string, setft = true): string if setft && expand("") =~ g:ft_ignore_pat return '' endif - if name =~ '^csh$' || name =~ '^#!.\{-2,}\' + if name =~ '\' # Some .sh scripts contain #!/bin/csh. return SetFileTypeShell("csh", setft) - elseif name =~ '^tcsh$' || name =~ '^#!.\{-2,}\' + elseif name =~ '\' # Some .sh scripts contain #!/bin/tcsh. return SetFileTypeShell("tcsh", setft) - elseif name =~ '^zsh$' || name =~ '^#!.\{-2,}\' + elseif name =~ '\' # Some .sh scripts contain #!/bin/zsh. return SetFileTypeShell("zsh", setft) - elseif name =~ '^ksh$' || name =~ '^#!.\{-2,}\' + elseif name =~ '\' b:is_kornshell = 1 if exists("b:is_bash") unlet b:is_bash @@ -944,8 +892,7 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - elseif exists("g:bash_is_sh") || name =~ '^bash2\=$' || - \ name =~ '^#!.\{-2,}\' + elseif exists("g:bash_is_sh") || name =~ '\' || name =~ '\' b:is_bash = 1 if exists("b:is_kornshell") unlet b:is_kornshell @@ -953,7 +900,7 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - elseif name =~ '^\%(da\)\=sh$' || name =~ '^#!.\{-2,}\<\%(da\)\=sh\>' + elseif name =~ '\' || name =~ '\' # Ubuntu links "sh" to "dash", thus it is expected to work the same way b:is_sh = 1 if exists("b:is_kornshell") diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index c184bd03..859126f0 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: The Vim Project -# Last Change: 2025 Apr 24 +# Last Change: 2025 Jan 20 # Former Maintainer: Bram Moolenaar export def DetectFiletype() @@ -26,9 +26,8 @@ def DetectFromHashBang(firstline: string) # "#!/usr/bin/bash" to make matching easier. # Recognize only a few {options} that are commonly used. if line1 =~ '^#!\s*\S*\ -" Last Change: 2025 Apr 27 +" Last Change: 2023 Nov 04 " enable the zip and gzip plugin by default, if not set diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim index 37f2ee5e..0681496a 100644 --- a/runtime/autoload/dist/vimindent.vim +++ b/runtime/autoload/dist/vimindent.vim @@ -2,7 +2,7 @@ vim9script # Language: Vim script # Maintainer: github user lacygoill -# Last Change: 2025 Apr 13 +# Last Change: 2024 Dec 26 # # Includes changes from The Vim Project: # - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966) @@ -981,10 +981,8 @@ def SearchPair( # {{{3 if end == '[' || end == ']' e = e->escape('[]') endif - # VIM_INDENT_TEST_TRACE_START return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e, flags, (): bool => InCommentOrString(), stopline, TIMEOUT) - # VIM_INDENT_TEST_TRACE_END dist#vimindent#SearchPair enddef def SearchPairStart( # {{{3 @@ -1270,9 +1268,7 @@ def NonCommentedMatch(line: dict, pat: string): bool # {{{3 var pos: list = getcurpos() cursor(line.lnum, 1) - # VIM_INDENT_TEST_TRACE_START var match_lnum: number = search(pat, 'cnW', line.lnum, TIMEOUT, (): bool => InCommentOrString()) - # VIM_INDENT_TEST_TRACE_END dist#vimindent#NonCommentedMatch setpos('.', pos) return match_lnum > 0 enddef diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index 1e3b5b39..e599d1ed 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -13,7 +13,6 @@ " substitution of hardcoded commands with global variables " 2024 Nov 12 by Vim Project: fix problems on Windows (#16036) " 2025 Feb 28 by Vim Project: add support for bzip3 (#16755) -" 2025 May 11 by Vim Project: check network connectivity (#17249) " }}} " " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim @@ -148,6 +147,9 @@ if g:GetLatestVimScripts_allowautoinstall elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) let s:autoinstall= $HOME."/".s:dotvim endif +" call Decho("s:autoinstall<".s:autoinstall.">") +"else "Decho +" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled") endif " --------------------------------------------------------------------- @@ -161,19 +163,24 @@ silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts() " scripts based on the list in " (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat fun! getscript#GetLatestVimScripts() +" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">") +" 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/available") return endif " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") +" call Decho("found directory<".datadir.">") let datadir= datadir . "/GetLatest" break endif if filereadable(datadir."GetLatestVimScripts.dat") +" call Decho("found ".datadir."/GetLatestVimScripts.dat") break endif endfor @@ -181,25 +188,32 @@ fun! getscript#GetLatestVimScripts() " Sanity checks: readability and writability if datadir == "" echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install' +" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory") return endif if filewritable(datadir) != 2 echoerr "(getLatestVimScripts) Your ".datadir." isn't writable" +" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">") return endif let datafile= datadir."/GetLatestVimScripts.dat" if !filereadable(datafile) echoerr "Your data file<".datafile."> isn't readable" +" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">") return endif if !filewritable(datafile) echoerr "Your data file<".datafile."> isn't writable" +" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">") return endif " -------------------- " Passed sanity checks " -------------------- +" call Decho("datadir <".datadir.">") +" call Decho("datafile <".datafile.">") + " don't let any event handlers interfere (like winmanager's, taglist's, etc) let eikeep = &ei let hlskeep = &hls @@ -212,20 +226,25 @@ fun! getscript#GetLatestVimScripts() " 3. split window " 4. edit datafile let origdir= getcwd() +" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge'))) exe "cd ".fnameescape(substitute(datadir,'\','/','ge')) split +" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge'))) exe "e ".fnameescape(substitute(datafile,'\','/','ge')) res 1000 let s:downloads = 0 let s:downerrors= 0 - let s:message = [] " Check on dependencies mentioned in plugins +" call Decho(" ") +" call Decho("searching plugins for GetLatestVimScripts dependencies") let lastline = line("$") +" call Decho("lastline#".lastline) let firstdir = substitute(&rtp,',.*$','','') let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"ftplugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n') +" extend the search to the packages too (this script predates the feature) let plugins += split(globpath(firstdir,"pack/*/start/*/plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"pack/*/opt/*/plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"pack/*/start/*/ftplugin/**/*.vim"),'\n') @@ -238,10 +257,14 @@ fun! getscript#GetLatestVimScripts() " It reads the plugin script at the end of the GetLatestVimScripts.dat " file, examines it, and then removes it. for plugin in plugins +" call Decho(" ") +" call Decho("plugin<".plugin.">") " read plugin in " evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it $ +" call Decho(".dependency checking<".plugin."> line$=".line("$")) +" call Decho("..exe silent r ".fnameescape(plugin)) exe "silent r ".fnameescape(plugin) exe "silent bwipe ".bufnr("#") @@ -249,6 +272,7 @@ fun! getscript#GetLatestVimScripts() let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','') let llp1 = lastline+1 +" call Decho("..depscript<".depscript.">") " found a "GetLatestVimScripts: # #" line in the script; " check if it's already in the datafile by searching backwards from llp1, @@ -262,17 +286,21 @@ fun! getscript#GetLatestVimScripts() " this second search is taken when, for example, a 0 0 scriptname is to be skipped over let srchline= search('\<'.noai_script.'\>','bW') endif +" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline) if srchline == 0 " found a new script to permanently include in the datafile let keep_rega = @a let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','') echomsg "Appending <".@a."> to ".datafile." for ".depscript +" call Decho("..Appending <".@a."> to ".datafile." for ".depscript) exe lastline."put a" let @a = keep_rega let lastline = llp1 let curline = curline + 1 let foundscript = foundscript + 1 +" else " Decho +" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")") endif let curline = curline + 1 @@ -281,8 +309,12 @@ fun! getscript#GetLatestVimScripts() " llp1: last line plus one let llp1= lastline + 1 +" call Decho(".deleting lines: ".llp1.",$d") exe "silent! ".llp1.",$d" endfor +" call Decho("--- end dependency checking loop --- foundscript=".foundscript) +" call Decho(" ") +" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!") if foundscript == 0 setlocal nomod @@ -291,32 +323,32 @@ fun! getscript#GetLatestVimScripts() " -------------------------------------------------------------------- " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat " -------------------------------------------------------------------- +" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">") setlocal lz 1 +" /^-----/,$g/^\s*\d/call Decho(getline(".")) + 1 /^-----/,$g/^\s*\d/call s:GetOneScript() +" call Decho("--- end out-of-date checking --- ") " Final report (an echomsg) try silent! ?^-------? catch /^Vim\%((\a\+)\)\=:E114/ +" call Dret("GetLatestVimScripts : nothing done!") return endtry exe "norm! kz\" redraw! - if !empty(s:message) - echohl WarningMsg - for mess in s:message - echom mess - endfor - let s:downerrors += len(s:message) - endif let s:msg = "" if s:downloads == 1 let s:msg = "Downloaded one updated script to <".datadir.">" + elseif s:downloads == 2 + let s:msg= "Downloaded two updated scripts to <".datadir.">" elseif s:downloads > 1 let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">" else - let s:msg= empty(s:message) ? "Everything was already current" : "There were some errors" + let s:msg= "Everything was already current" endif if s:downerrors > 0 let s:msg= s:msg." (".s:downerrors." downloading errors)" @@ -334,6 +366,8 @@ fun! getscript#GetLatestVimScripts() let &hls = hlskeep let &acd = acdkeep setlocal nolz +" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") +" call Dret("GetLatestVimScripts : did ".s:downloads." downloads") endfun " --------------------------------------------------------------------- @@ -342,6 +376,8 @@ endfun " ScriptID, SourceID, and Filename. " It downloads any scripts that have newer versions from vim.sourceforge.net. fun! s:GetOneScript(...) +" call Dfunc("GetOneScript()") + " set options to allow progress to be shown on screen let rega= @a let t_ti= &t_ti @@ -367,9 +403,13 @@ fun! s:GetOneScript(...) let srcid = a:2 let fname = a:3 let cmmnt = "" +" call Decho("scriptid<".scriptid.">") +" call Decho("srcid <".srcid.">") +" call Decho("fname <".fname.">") else let curline = getline(".") if curline =~ '^\s*#' +" call Dret("GetOneScript : skipping a pure comment line") return endif let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$' @@ -393,26 +433,36 @@ fun! s:GetOneScript(...) catch /^Vim\%((\a\+)\)\=:E486/ let cmmnt= "" endtry +" call Decho("curline <".curline.">") +" call Decho("parsepat<".parsepat.">") +" call Decho("scriptid<".scriptid.">") +" call Decho("srcid <".srcid.">") +" call Decho("fname <".fname.">") endif " plugin author protection from downloading his/her own scripts atop their latest work - " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname if scriptid == 0 || srcid == 0 + " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname +" call Dret("GetOneScript : skipping a scriptid==srcid==0 line") return endif let doautoinstall= 0 if fname =~ ":AutoInstall:" +" call Decho("case AutoInstall: fname<".fname.">") let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','') +" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall) if s:autoinstall != "" let doautoinstall = g:GetLatestVimScripts_allowautoinstall endif else let aicmmnt= fname endif +" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall) exe "norm z\" redraw! +" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid) echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid " grab a copy of the plugin's vim.sourceforge.net webpage @@ -420,17 +470,15 @@ fun! s:GetOneScript(...) let tmpfile = tempname() let v:errmsg = "" - " Check if URLs are reachable - if !CheckVimScriptURL(scriptid, srcid) - return - endif - " make up to three tries at downloading the description let itry= 1 while itry <= 3 +" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) if has("win32") || has("win16") || has("win95") +" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw! else +" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr) endif if itry == 1 @@ -448,6 +496,7 @@ fun! s:GetOneScript(...) endif let itry= itry + 1 endwhile +" call Decho(" --- end downloading tries while loop --- itry=".itry) " testing: did finding "Click on the package..." fail? if findpkg == 0 || itry >= 4 @@ -458,9 +507,12 @@ fun! s:GetOneScript(...) let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 +" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">" +" call Dret("GetOneScript : srch for /Click on the package/ failed") return endif +" call Decho('found "Click on the package to download"') let findsrcid= search('src_id=','W') if findsrcid == 0 @@ -471,22 +523,28 @@ fun! s:GetOneScript(...) let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 +" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">" +" call Dret("GetOneScript : srch for /src_id/ failed") return endif +" call Decho('found "src_id=" in description page') let srcidpat = '^\s*\([^<]\+\)<.*$' let latestsrcid= substitute(getline("."),srcidpat,'\1','') let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded +" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">") silent q! call delete(tmpfile) " convert the strings-of-numbers into numbers let srcid = srcid + 0 let latestsrcid = latestsrcid + 0 +" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">") " has the plugin's most-recent srcid increased, which indicates that it has been updated if latestsrcid > srcid +" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">") let s:downloads= s:downloads + 1 if sname == bufname("%") @@ -497,16 +555,20 @@ fun! s:GetOneScript(...) " ----------------------------------------------------------------------------- " the plugin has been updated since we last obtained it, so download a new copy " ----------------------------------------------------------------------------- +" call Decho(".downloading new <".sname.">") echomsg ".downloading new <".sname.">" if has("win32") || has("win16") || has("win95") +" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|bw! else +" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) endif " -------------------------------------------------------------------------- " AutoInstall: only if doautoinstall has been requested by the plugin itself " -------------------------------------------------------------------------- +" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall) if doautoinstall if filereadable(sname) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall) @@ -540,6 +602,7 @@ fun! s:GetOneScript(...) exe "sil !".g:GetLatestVimScripts_unxz." ".shellescape(sname) let sname= substitute(sname,'\.xz$','','') else +" call Decho("no decompression needed") endif " distribute archive(.zip, .tar, .vba, .vmb, ...) contents @@ -569,6 +632,8 @@ fun! s:GetOneScript(...) else unlet g:vimball_home endif + else +" call Decho("no dearchiving needed") endif " --------------------------------------------- @@ -600,41 +665,7 @@ fun! s:GetOneScript(...) " update the data in the file call setline(line("."),modline) endif -endfun -" CheckVimScriptURL: Check Network Connection {{{1 -" Check status code of scriptaddr and downloadaddr -" return v:true if the script is downloadable or v:false in case of errors -fun CheckVimScriptURL(script_id, src_id) - " doesn't work with powershell - if !executable('curl') || &shell =~? 'pwsh\|powershell' - return v:true - endif - let output = has("win32") ? ' -o NUL ' : ' -o /dev/null ' - - let temp = tempname() - defer delete(temp) - let script_url = g:GetLatestVimScripts_scriptaddr . a:script_id - let download_url = g:GetLatestVimScripts_downloadaddr . a:src_id - - let script_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(script_url) . ' >' . shellescape(temp) - call system(script_cmd) - let script_status = readfile(temp, 'b')[0] - - let download_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(download_url) . ' >' . shellescape(temp) - call system(download_cmd) - let download_status = readfile(temp, 'b')[0] - - if script_status !=# '200' - let s:message += [ printf('Error: Failed to reach script: %s', a:script_id) ] - return v:false - endif - - if download_status !=# '200' - let s:message += [ printf('Error: Failed to download script %s', a:script_id) ] - return v:false - endif - return v:true endfun " --------------------------------------------------------------------- diff --git a/runtime/autoload/htmlfold.vim b/runtime/autoload/htmlfold.vim deleted file mode 100644 index 76ccaefa..00000000 --- a/runtime/autoload/htmlfold.vim +++ /dev/null @@ -1,192 +0,0 @@ -" HTML folding script, :h ft-html-plugin -" Latest Change: 2025 May 10 -" Original Author: Aliaksei Budavei <0x000c70@gmail.com> - -function! htmlfold#MapBalancedTags() abort - " Describe only _a capturable-name prefix_ for start and end patterns of - " a tag so that start tags with attributes spanning across lines can also be - " matched with a single call of "getline()". - let tag = '\m\c 0 - let name_attr = synIDattr(synID(lnum, cnum, 0), 'name') - - if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag' - let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') - - if !empty(name) - call insert(names, tolower(name), 0) - call insert(pairs, [lnum, -1], 0) - endif - elseif name_attr ==# 'htmlEndTag' - let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') - - if !empty(name) - let idx = index(names, tolower(name)) - - if idx >= 0 - " Dismiss inlined balanced tags and opened-only tags. - if pairs[idx][0] != lnum - let pairs[idx][1] = lnum - call add(ends, lnum) - endif - - " Claim a pair. - let names[: idx] = repeat([''], (idx + 1)) - endif - endif - endif - - " Advance the cursor, at "<", past "", etc. - call cursor(lnum, (cnum + 3)) - let [lnum, cnum] = searchpos(tag, 'cnW') - endwhile - finally - call setpos('.', pos) - endtry - - if empty(ends) - return {} - endif - - let folds = {} - let pending_end = ends[0] - let level = 0 - - while !empty(pairs) - let [start, end] = remove(pairs, -1) - - if end < 0 - continue - endif - - if start >= pending_end - " Mark a sibling tag. - call remove(ends, 0) - - while start >= ends[0] - " Mark a parent tag. - call remove(ends, 0) - let level -= 1 - endwhile - - let pending_end = ends[0] - else - " Mark a child tag. - let level += 1 - endif - - " Flatten the innermost inlined folds. - let folds[start] = get(folds, start, ('>' . level)) - let folds[end] = get(folds, end, ('<' . level)) - endwhile - - return folds -endfunction - -" See ":help vim9-mix". -if !has("vim9script") - finish -endif - -def! g:htmlfold#MapBalancedTags(): dict - # Describe only _a capturable-name prefix_ for start and end patterns of - # a tag so that start tags with attributes spanning across lines can also be - # matched with a single call of "getline()". - const tag: string = '\m\c = [] - var pairs: list> = [] - var ends: list = [] - const pos: list = getpos('.') - - try - cursor(1, 1) - var [lnum: number, cnum: number] = searchpos(tag, 'cnW') - - # Pair up nearest non-inlined tags in scope. - while lnum > 0 - const name_attr: string = synIDattr(synID(lnum, cnum, 0), 'name') - - if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag' - const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') - - if !empty(name) - insert(names, tolower(name), 0) - insert(pairs, [lnum, -1], 0) - endif - elseif name_attr ==# 'htmlEndTag' - const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') - - if !empty(name) - const idx: number = index(names, tolower(name)) - - if idx >= 0 - # Dismiss inlined balanced tags and opened-only tags. - if pairs[idx][0] != lnum - pairs[idx][1] = lnum - add(ends, lnum) - endif - - # Claim a pair. - names[: idx] = repeat([''], (idx + 1)) - endif - endif - endif - - # Advance the cursor, at "<", past "", etc. - cursor(lnum, (cnum + 3)) - [lnum, cnum] = searchpos(tag, 'cnW') - endwhile - finally - setpos('.', pos) - endtry - - if empty(ends) - return {} - endif - - var folds: dict = {} - var pending_end: number = ends[0] - var level: number = 0 - - while !empty(pairs) - const [start: number, end: number] = remove(pairs, -1) - - if end < 0 - continue - endif - - if start >= pending_end - # Mark a sibling tag. - remove(ends, 0) - - while start >= ends[0] - # Mark a parent tag. - remove(ends, 0) - level -= 1 - endwhile - - pending_end = ends[0] - else - # Mark a child tag. - level += 1 - endif - - # Flatten the innermost inlined folds. - folds[start] = get(folds, start, ('>' .. level)) - folds[end] = get(folds, end, ('<' .. level)) - endwhile - - return folds -enddef - -" vim: fdm=syntax sw=2 ts=8 noet diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim index cf01198d..d5f48623 100644 --- a/runtime/autoload/python.vim +++ b/runtime/autoload/python.vim @@ -20,12 +20,10 @@ let g:python_indent = extend(get(g:, 'python_indent', {}), #{ let s:maxoff = 50 " maximum number of lines to look backwards for () function s:SearchBracket(fromlnum, flags) - " VIM_INDENT_TEST_TRACE_START return searchpairpos('[[({]', '', '[])}]', a:flags, \ {-> synstack('.', col('.')) \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0}, \ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout) - " VIM_INDENT_TEST_TRACE_END python#s:SearchBracket endfunction " See if the specified line is already user-dedented from the expected value. diff --git a/runtime/autoload/rustfmt.vim b/runtime/autoload/rustfmt.vim index f325df2f..8fd38581 100644 --- a/runtime/autoload/rustfmt.vim +++ b/runtime/autoload/rustfmt.vim @@ -1,6 +1,5 @@ " Author: Stephen Sugden " Last Modified: 2023-09-11 -" Last Change: 2025 Mar 31 by Vim project (rename s:RustfmtConfigOptions()) " " Adapted from https://github.com/fatih/vim-go " For bugs, patches and license go to https://github.com/rust-lang/rust.vim @@ -62,7 +61,7 @@ function! s:RustfmtWriteMode() endif endfunction -function! rustfmt#RustfmtConfigOptions() +function! s:RustfmtConfigOptions() let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';') if l:rustfmt_toml !=# '' return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p")) @@ -85,7 +84,7 @@ function! s:RustfmtCommandRange(filename, line1, line2) let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]} let l:write_mode = s:RustfmtWriteMode() - let l:rustfmt_config = rustfmt#RustfmtConfigOptions() + let l:rustfmt_config = s:RustfmtConfigOptions() " FIXME: When --file-lines gets to be stable, add version range checking " accordingly. @@ -100,7 +99,7 @@ endfunction function! s:RustfmtCommand() let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display' - let config = rustfmt#RustfmtConfigOptions() + let config = s:RustfmtConfigOptions() return join([g:rustfmt_command, write_mode, config, g:rustfmt_options]) endfunction diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 499036ef..4aab9156 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -14,7 +14,6 @@ " 2025 Mar 02 by Vim Project: escape the filename before using :read " 2025 Mar 02 by Vim Project: determine the compression using readblob() " instead of shelling out to file(1) -" 2025 Apr 16 by Vim Project: decouple from netrw by adding s:WinPath() " " Contains many ideas from Michael Toren's " @@ -147,7 +146,7 @@ fun! tar#Browse(tarfile) let lastline= line("$") call setline(lastline+1,'" tar.vim version '.g:loaded_tar) call setline(lastline+2,'" Browsing tarfile '.a:tarfile) - call setline(lastline+3,'" Select a file with cursor and press ENTER, "x" to extract a file') + call setline(lastline+3,'" Select a file with cursor and press ENTER') keepj $put ='' keepj sil! 0d keepj $ @@ -616,7 +615,7 @@ fun! tar#Extract() let tarball = expand("%") let tarbase = substitute(tarball,'\..*$','','') - let extractcmd= s:WinPath(g:tar_extractcmd) + let extractcmd= netrw#WinPath(g:tar_extractcmd) if filereadable(tarbase.".tar") call system(extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname)) if v:shell_error != 0 @@ -766,25 +765,6 @@ fun! s:Header(fname) return "unknown" endfun -" --------------------------------------------------------------------- -" s:WinPath: {{{2 -fun! s:WinPath(path) - if (!g:netrw_cygwin || &shell !~ '\%(\\|\\)\%(\.exe\)\=$') && has("win32") - " remove cygdrive prefix, if present - let path = substitute(a:path, '/cygdrive/\(.\)', '\1:', '') - " remove trailing slash (Win95) - let path = substitute(path, '\(\\\|/\)$', '', 'g') - " remove escaped spaces - let path = substitute(path, '\ ', ' ', 'g') - " convert slashes to backslashes - let path = substitute(path, '/', '\', 'g') - else - let path = a:path - endif - - return path -endfun - " --------------------------------------------------------------------- " tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2 fun! tar#Vimuntar(...) @@ -806,7 +786,7 @@ fun! tar#Vimuntar(...) if simplify(curdir) != simplify(vimhome) " copy (possibly compressed) tarball to .vim/vimfiles - call system(s:WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) + call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) exe "cd ".fnameescape(vimhome) endif @@ -828,7 +808,7 @@ fun! tar#Vimuntar(...) else call vimball#Decompress(tartail,0) endif - let extractcmd= s:WinPath(g:tar_extractcmd) + let extractcmd= netrw#WinPath(g:tar_extractcmd) call system(extractcmd." ".shellescape(tarbase.".tar")) " set up help diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim index 6ab79602..3265fdde 100644 --- a/runtime/autoload/tutor.vim +++ b/runtime/autoload/tutor.vim @@ -210,7 +210,6 @@ function! tutor#TutorCmd(tutor_name) call tutor#SetupVim() exe "edit ".l:to_open - call tutor#EnableInteractive(v:true) endfunction function! tutor#TutorCmdComplete(lead,line,pos) @@ -218,24 +217,3 @@ function! tutor#TutorCmdComplete(lead,line,pos) let l:names = uniq(sort(map(l:tutors, 'fnamemodify(v:val, ":t:r")'), 's:Sort')) return join(l:names, "\n") endfunction - -" Enables/disables interactive mode. -function! tutor#EnableInteractive(enable) - let enable = a:enable - if enable - setlocal buftype=nofile - setlocal concealcursor+=inv - setlocal conceallevel=2 - call tutor#ApplyMarks() - augroup tutor_interactive - autocmd! TextChanged,TextChangedI call tutor#ApplyMarksOnChanged() - augroup END - else - setlocal buftype< - setlocal concealcursor< - setlocal conceallevel< - if exists('#tutor_interactive') - autocmd! tutor_interactive * - endif - endif -endfunction diff --git a/runtime/compiler/gleam_build.vim b/runtime/compiler/gleam_build.vim deleted file mode 100644 index c2b1679b..00000000 --- a/runtime/compiler/gleam_build.vim +++ /dev/null @@ -1,25 +0,0 @@ -" Vim compiler file -" Language: Gleam -" Maintainer: Kirill Morozov -" Based On: https://github.com/gleam-lang/gleam.vim -" Last Change: 2025 Apr 21 - -if exists('current_compiler') - finish -endif -let current_compiler = "gleam_build" - -CompilerSet makeprg=gleam\ build - -" Example error message: -" -" error: Unknown variable -" ┌─ /home/michael/root/projects/tutorials/gleam/try/code/src/main.gleam:19:18 -" │ -" 19 │ Ok(tuple(name, spot)) -" │ ^^^^ did you mean `sport`? -" -" The name `spot` is not in scope here. -CompilerSet errorformat=%Eerror:\ %m,%Wwarning:\ %m,%C\ %#┌─%#\ %f:%l:%c\ %#-%# - -" vim: sw=2 sts=2 et diff --git a/runtime/defaults.vim b/runtime/defaults.vim index f5b4888a..38b03da1 100644 --- a/runtime/defaults.vim +++ b/runtime/defaults.vim @@ -107,7 +107,6 @@ if 1 \ let line = line("'\"") \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' \ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1 - \ && !&diff \ | execute "normal! g`\"" \ | endif diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index 01b2c3e8..e2789338 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -142,9 +142,7 @@ os_win32.txt: touch $@ pi_netrw.txt: ../pack/dist/opt/netrw/doc/netrw.txt - cp ../pack/dist/opt/netrw/doc/netrw.txt $@.tmp - sed -e '1s/$$/ *pi_netrw.txt*/' $@.tmp > $@ && \ - rm -f $@.tmp + cp ../pack/dist/opt/netrw/doc/netrw.txt $@ vietnamese.txt: touch $@ diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 204a9117..372d1acb 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2025 Apr 21 +*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -398,7 +398,6 @@ Name triggered by ~ |CmdlineChanged| after a change was made to the command-line text |CmdlineEnter| after the cursor moves to the command line |CmdlineLeave| before the cursor leaves the command line -|CmdlineLeavePre| before preparing to leave the command line |InsertEnter| starting Insert mode |InsertChange| when typing while in Insert or Replace mode @@ -594,8 +593,7 @@ BufWriteCmd Before writing the whole buffer to a file. The buffer contents should not be changed. When the command resets 'modified' the undo information is adjusted to mark older undo - states as 'modified', like |:write| does. Use - the |'[| and |']| marks for the range of lines. + states as 'modified', like |:write| does. |Cmd-event| *BufWritePost* BufWritePost After writing the whole buffer to a file @@ -640,18 +638,6 @@ CmdlineLeave Before leaving the command line; including is set to a single character, indicating the type of command-line. |cmdwin-char| - *CmdlineLeavePre* -CmdlineLeavePre Just before leaving the command line, and - before |CmdlineLeave|. Useful for capturing - completion info with |cmdcomplete_info()|, as - this information is cleared before - |CmdlineLeave| is triggered. Triggered for - non-interactive use of ":" in a mapping, but - not when using ||. Also triggered when - abandoning the command line by typing CTRL-C - or . is set to a single - character indicating the command-line type. - See |cmdwin-char| for details. *CmdwinEnter* CmdwinEnter After entering the command-line window. Useful for setting options specifically for @@ -900,14 +886,14 @@ FileType When the 'filetype' option has been set. The FileWriteCmd Before writing to a file, when not writing the whole buffer. Should do the writing to the file. Should not change the buffer. Use the - |'[| and |']| marks for the range of lines. + '[ and '] marks for the range of lines. |Cmd-event| *FileWritePost* FileWritePost After writing to a file, when not writing the whole buffer. *FileWritePre* FileWritePre Before writing to a file, when not writing the - whole buffer. Use the |'[| and |']| marks for the + whole buffer. Use the '[ and '] marks for the range of lines. *FilterReadPost* FilterReadPost After reading a file from a filter command. @@ -1494,13 +1480,6 @@ WinScrolled After any window in the current tab page or changed width or height. See |win-scrolled-resized|. - Note: This can not be skipped with - `:noautocmd`, because it triggers after - processing normal commands when Vim is back in - the main loop. If you want to disable this, - consider setting the 'eventignore' option - instead. - The pattern is matched against the |window-ID| of the first window that scrolled or resized. Both and are set to the diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index b9d0719a..dc47f410 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 May 09 +*builtin.txt* For Vim version 9.1. Last change: 2025 Mar 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -129,14 +129,11 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]]) chdir({dir}) String change current working directory cindent({lnum}) Number C indent for line {lnum} clearmatches([{win}]) none clear all matches -cmdcomplete_info() Dict get current cmdline completion - information col({expr} [, {winid}]) Number column byte index of cursor or mark complete({startcol}, {matches}) none set Insert mode completion complete_add({expr}) Number add completion match complete_check() Number check for key typed during completion complete_info([{what}]) Dict get current completion information -complete_match([{lnum}, {col}]) List get completion column and trigger text confirm({msg} [, {choices} [, {default} [, {type}]]]) Number number of choice picked by user copy({expr}) any make a shallow copy of {expr} @@ -194,8 +191,9 @@ filter({expr1}, {expr2}) List/Dict/Blob/String remove items from {expr1} where {expr2} is 0 finddir({name} [, {path} [, {count}]]) + String find directory {name} in {path} findfile({name} [, {path} [, {count}]]) - String/List find dir/file {name} in {path} + String find file {name} in {path} flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels flattennew({list} [, {maxdepth}]) List flatten a copy of {list} @@ -209,7 +207,7 @@ foldclosedend({lnum}) Number last line of fold at {lnum} if closed foldlevel({lnum}) Number fold level at {lnum} foldtext() String line displayed for closed fold foldtextresult({lnum}) String text for closed fold at {lnum} -foreach({expr1}, {expr2}) List/Tuple/Dict/Blob/String +foreach({expr1}, {expr2}) List/Dict/Blob/String for each item in {expr1} call {expr2} foreground() Number bring the Vim window to the foreground fullcommand({name} [, {vim9}]) String get full command from {name} @@ -350,7 +348,7 @@ job_start({command} [, {options}]) Job start a job job_status({job}) String get the status of {job} job_stop({job} [, {how}]) Number stop {job} -join({expr} [, {sep}]) String join items in {expr} into one String +join({list} [, {sep}]) String join {list} items into one String js_decode({string}) any decode JS style JSON js_encode({expr}) String encode JS style JSON json_decode({string}) any decode JSON @@ -366,7 +364,6 @@ line2byte({lnum}) Number byte count of line {lnum} lispindent({lnum}) Number Lisp indent for line {lnum} list2blob({list}) Blob turn {list} of numbers into a Blob list2str({list} [, {utf8}]) String turn {list} of numbers into a String -list2tuple({list}) Tuple turn {list} of items into a tuple listener_add({callback} [, {buf}]) Number add a callback to listen to changes listener_flush([{buf}]) none invoke listener callbacks @@ -514,10 +511,10 @@ remove({blob}, {idx} [, {end}]) Number/Blob remove bytes {idx}-{end} from {blob} remove({dict}, {key}) any remove entry {key} from {dict} rename({from}, {to}) Number rename (move) file from {from} to {to} -repeat({expr}, {count}) List/Tuple/Blob/String +repeat({expr}, {count}) List/Blob/String repeat {expr} {count} times resolve({filename}) String get filename a shortcut points to -reverse({obj}) List/Tuple/Blob/String +reverse({obj}) List/Blob/String reverse {obj} round({expr}) Float round off {expr} rubyeval({expr}) any evaluate |Ruby| expression @@ -716,7 +713,6 @@ test_null_job() Job null value for testing test_null_list() List null value for testing test_null_partial() Funcref null value for testing test_null_string() String null value for testing -test_null_tuple() Tuple null value for testing test_option_not_set({name}) none reset flag indicating option was set test_override({expr}, {val}) none test with Vim internal overrides test_refcount({expr}) Number get the reference count of {expr} @@ -738,7 +734,6 @@ tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} trim({text} [, {mask} [, {dir}]]) String trim characters in {mask} from {text} trunc({expr}) Float truncate Float {expr} -tuple2list({tuple}) List turn {tuple} of items into a list type({expr}) Number type of value {expr} typename({expr}) String representation of the type of {expr} undofile({name}) String undo file name for {name} @@ -1328,11 +1323,9 @@ blob2str({blob} [, {options}]) *blob2str()* See also |str2blob()| Examples: > - blob2str(0z6162) returns ['ab'] - blob2str(0zC2ABC2BB) returns ['«»'] - blob2str(0z610A62) returns ['a', 'b'] - blob2str(0z610062) returns ['a\nb'] - blob2str(0zABBB, {'encoding': 'latin1'}) returns ['«»'] + blob2str(0z6162) returns ["ab"] + blob2str(0zC2ABC2BB) returns ["«»"] + blob2str(0zABBB, {'encoding': 'latin1'}) returns ["«»"] < Can also be used as a |method|: > GetBlob()->blob2str() @@ -1834,29 +1827,6 @@ clearmatches([{win}]) *clearmatches()* Return type: |Number| -cmdcomplete_info() *cmdcomplete_info()* - Returns a |Dictionary| with information about cmdline - completion. See |cmdline-completion|. - The items are: - cmdline_orig The original command-line string before - completion began. - pum_visible |TRUE| if popup menu is visible. - See |pumvisible()|. - matches List of all completion candidates. Each item - is a string. - selected Selected item index. First index is zero. - Index is -1 if no item is selected (showing - typed text only, or the last completion after - no item is selected when using the or - keys) - - Returns an empty |Dictionary| if no completion was attempted, - if there was only one candidate and it was fully completed, or - if an error occurred. - - Return type: dict - - col({expr} [, {winid}]) *col()* The result is a Number, which is the byte index of the column position given with {expr}. @@ -2032,50 +2002,6 @@ complete_info([{what}]) *complete_info()* < Return type: dict -complete_match([{lnum}, {col}]) *complete_match()* - Searches backward from the given position and returns a List - of matches according to the 'isexpand' option. When no - arguments are provided, uses the current cursor position. - - Each match is represented as a List containing - [startcol, trigger_text] where: - - startcol: column position where completion should start, - or -1 if no trigger position is found. For multi-character - triggers, returns the column of the first character. - - trigger_text: the matching trigger string from 'isexpand', - or empty string if no match was found or when using the - default 'iskeyword' pattern. - - When 'isexpand' is empty, uses the 'iskeyword' pattern - "\k\+$" to find the start of the current keyword. - - Examples: > - set isexpand=.,->,/,/*,abc - func CustomComplete() - let res = complete_match() - if res->len() == 0 | return | endif - let [col, trigger] = res[0] - let items = [] - if trigger == '/*' - let items = ['/** */'] - elseif trigger == '/' - let items = ['/*! */', '// TODO:', '// fixme:'] - elseif trigger == '.' - let items = ['length()'] - elseif trigger =~ '^\->' - let items = ['map()', 'reduce()'] - elseif trigger =~ '^\abc' - let items = ['def', 'ghk'] - endif - if items->len() > 0 - let startcol = trigger =~ '^/' ? col : col + len(trigger) - call complete(startcol, items) - endif - endfunc - inoremap call CustomComplete() -< - Return type: list> - *confirm()* confirm({msg} [, {choices} [, {default} [, {type}]]]) confirm() offers the user a dialog, from which a choice can be @@ -2145,8 +2071,7 @@ copy({expr}) *copy()* that the original |List| can be changed without changing the copy, and vice versa. But the items are identical, thus changing an item changes the contents of both |Lists|. - A |Tuple| or |Dictionary| is copied in a similar way as a - |List|. + A |Dictionary| is copied in a similar way as a |List|. Also see |deepcopy()|. Can also be used as a |method|: > mylist->copy() @@ -2189,10 +2114,10 @@ cosh({expr}) *cosh()* count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706* Return the number of times an item with value {expr} appears - in |String|, |List|, |Tuple| or |Dictionary| {comp}. + in |String|, |List| or |Dictionary| {comp}. If {start} is given then start with the item with this index. - {start} can only be used with a |List| or a |Tuple|. + {start} can only be used with a |List|. When {ic} is given and it's |TRUE| then case is ignored. @@ -2312,8 +2237,7 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698* |Dictionary|, a copy for it is made, recursively. Thus changing an item in the copy does not change the contents of the original |List|. - A |Tuple| or |Dictionary| is copied in a similar way as a - |List|. + A |Dictionary| is copied in a similar way as a |List|. When {noref} is omitted or zero a contained |List| or |Dictionary| is only copied once. All references point to @@ -2621,8 +2545,8 @@ echoraw({string}) *echoraw()* empty({expr}) *empty()* Return the Number 1 if {expr} is empty, zero otherwise. - - A |List|, |Tuple| or |Dictionary| is empty when it does - not have any items. + - A |List| or |Dictionary| is empty when it does not have any + items. - A |String| is empty when its length is zero. - A |Number| and |Float| are empty when their value is zero. - |v:false|, |v:none| and |v:null| are empty, |v:true| is not. @@ -3166,7 +3090,7 @@ feedkeys({string} [, {mode}]) *feedkeys()* Can also be used as a |method|: > GetInput()->feedkeys() < - Return type: |Number| + Return type: |String| or list depending on {list} filecopy({from}, {to}) *filecopy()* @@ -3304,8 +3228,7 @@ finddir({name} [, {path} [, {count}]]) *finddir()* Can also be used as a |method|: > GetName()->finddir() < - Return type: list if {count} is negative, |String| - otherwise + Return type: |String| findfile({name} [, {path} [, {count}]]) *findfile()* @@ -3319,8 +3242,7 @@ findfile({name} [, {path} [, {count}]]) *findfile()* Can also be used as a |method|: > GetName()->findfile() < - Return type: list if {count} is negative, |String| - otherwise + Return type: |String| flatten({list} [, {maxdepth}]) *flatten()* @@ -3551,9 +3473,8 @@ foldtextresult({lnum}) *foldtextresult()* Return type: |String| -foreach({expr1}, {expr2}) *foreach()* *E1525* - {expr1} must be a |List|, |Tuple|, |String|, |Blob| or - |Dictionary|. +foreach({expr1}, {expr2}) *foreach()* + {expr1} must be a |List|, |String|, |Blob| or |Dictionary|. For each item in {expr1} execute {expr2}. {expr1} is not modified; its values may be, as with |:lockvar| 1. |E741| See |map()| and |filter()| to modify {expr1}. @@ -3562,10 +3483,10 @@ foreach({expr1}, {expr2}) *foreach()* *E1525* If {expr2} is a |string|, inside {expr2} |v:val| has the value of the current item. For a |Dictionary| |v:key| has the key - of the current item and for a |List| or a |Tuple| |v:key| has - the index of the current item. For a |Blob| |v:key| has the - index of the current byte. For a |String| |v:key| has the - index of the current character. + of the current item and for a |List| |v:key| has the index of + the current item. For a |Blob| |v:key| has the index of the + current byte. For a |String| |v:key| has the index of the + current character. Examples: > call foreach(mylist, 'used[v:val] = true') < This records the items that are in the {expr1} list. @@ -3591,8 +3512,8 @@ foreach({expr1}, {expr2}) *foreach()* *E1525* Can also be used as a |method|: > mylist->foreach(expr2) < - Return type: |String|, |Blob|, list<{type}>, tuple<{type}> or - dict<{type}> depending on {expr1} + Return type: |String|, |Blob| list<{type}> or dict<{type}> + depending on {expr1} *foreground()* foreground() Move the Vim window to the foreground. Useful when sent from @@ -3765,15 +3686,6 @@ get({list}, {idx} [, {default}]) *get()* *get()-list* < Return type: any, depending on {list} -get({tuple}, {idx} [, {default}]) *get()-tuple* - Get item {idx} from |Tuple| {tuple}. When this item is not - available return {default}. Return zero when {default} is - omitted. - Preferably used as a |method|: > - mytuple->get(idx) -< - Return type: any, depending on {tuple} - get({blob}, {idx} [, {default}]) *get()-blob* Get byte {idx} from |Blob| {blob}. When this byte is not available return {default}. Return -1 when {default} is @@ -4314,7 +4226,6 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* file file and directory names file_in_path file and directory names in |'path'| filetype filetype names |'filetype'| - filetypecmd |:filetype| suboptions function function name help help subjects highlight highlight groups @@ -4961,7 +4872,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* Can also be used as a |method|: > GetRegname()->getreg() < - Return type: |String| or list depending on {list} + Return type: |String| getreginfo([{regname}]) *getreginfo()* @@ -5908,8 +5819,8 @@ id({item}) *id()* < prevents {item} from being garbage collected and provides a way to get the {item} from the `id`. - {item} may be a List, Tuple, Dictionary, Object, Job, Channel - or Blob. If the item is not a permitted type, or it is a null + {item} may be a List, Dictionary, Object, Job, Channel or + Blob. If the item is not a permitted type, or it is a null value, then an empty String is returned. Can also be used as a |method|: > @@ -5936,12 +5847,12 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()* Find {expr} in {object} and return its index. See |indexof()| for using a lambda to select the item. - If {object} is a |List| or a |Tuple| return the lowest index - where the item has a value equal to {expr}. There is no - automatic conversion, so the String "4" is different from the - Number 4. And the number 4 is different from the Float 4.0. - The value of 'ignorecase' is not used here, case matters as - indicated by the {ic} argument. + If {object} is a |List| return the lowest index where the item + has a value equal to {expr}. There is no automatic + conversion, so the String "4" is different from the Number 4. + And the number 4 is different from the Float 4.0. The value + of 'ignorecase' is not used here, case matters as indicated by + the {ic} argument. If {object} is |Blob| return the lowest index where the byte value is equal to {expr}. @@ -5965,11 +5876,11 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()* indexof({object}, {expr} [, {opts}]) *indexof()* Returns the index of an item in {object} where {expr} is - v:true. {object} must be a |List|, a |Tuple| or a |Blob|. + v:true. {object} must be a |List| or a |Blob|. - If {object} is a |List| or a |Tuple|, evaluate {expr} for each - item in the List or Tuple until the expression is v:true - and return the index of this item. + If {object} is a |List|, evaluate {expr} for each item in the + List until the expression is v:true and return the index of + this item. If {object} is a |Blob| evaluate {expr} for each byte in the Blob until the expression is v:true and return the index of @@ -5977,11 +5888,11 @@ indexof({object}, {expr} [, {opts}]) *indexof()* {expr} must be a |string| or |Funcref|. - If {expr} is a |string|: If {object} is a |List| or a |Tuple|, - inside {expr} |v:key| has the index of the current List or - Tuple item and |v:val| has the value of the item. If {object} - is a |Blob|, inside {expr} |v:key| has the index of the - current byte and |v:val| has the byte value. + If {expr} is a |string|: If {object} is a |List|, inside + {expr} |v:key| has the index of the current List item and + |v:val| has the value of the item. If {object} is a |Blob|, + inside {expr} |v:key| has the index of the current byte and + |v:val| has the byte value. If {expr} is a |Funcref| it must take two arguments: 1. the key or the index of the current item. @@ -6291,9 +6202,9 @@ items({dict}) *items()* echo key .. ': ' .. value endfor < - A |List|, a |Tuple| or a |String| argument is also supported. - In these cases, items() returns a List with the index and the - value at the index. + A List or a String argument is also supported. In these + cases, items() returns a List with the index and the value at + the index. Can also be used as a |method|: > mydict->items() @@ -6304,17 +6215,16 @@ items({dict}) *items()* job_ functions are documented here: |job-functions-details| -join({expr} [, {sep}]) *join()* - Join the items in {expr} together into one String. {expr} can - be a |List| or a |Tuple|. +join({list} [, {sep}]) *join()* + Join the items in {list} together into one String. When {sep} is specified it is put in between the items. If {sep} is omitted a single space is used. Note that {sep} is not added at the end. You might want to add it there too: > let lines = join(mylist, "\n") .. "\n" -< String items are used as-is. |Lists|, |Tuples| and - |Dictionaries| are converted into a string like with - |string()|. The opposite function is |split()|. +< String items are used as-is. |Lists| and |Dictionaries| are + converted into a string like with |string()|. + The opposite function is |split()|. Can also be used as a |method|: > mylist->join() @@ -6408,8 +6318,6 @@ json_encode({expr}) *json_encode()* |Funcref| not possible, error |List| as an array (possibly null); when used recursively: [] - |Tuple| as an array (possibly null); when - used recursively: [] |Dict| as an object (possibly null); when used recursively: {} |Blob| as an array of the individual bytes @@ -6458,8 +6366,6 @@ len({expr}) *len()* *E701* used, as with |strlen()|. When {expr} is a |List| the number of items in the |List| is returned. - When {expr} is a |Tuple| the number of items in the |Tuple| is - returned. When {expr} is a |Blob| the number of bytes is returned. When {expr} is a |Dictionary| the number of entries in the |Dictionary| is returned. @@ -6641,25 +6547,6 @@ list2str({list} [, {utf8}]) *list2str()* Return type: |String| -list2tuple({list}) *list2tuple()* - Create a Tuple from a shallow copy of the list items. - Examples: > - list2tuple([1, 2, 3]) returns (1, 2, 3) -< |tuple2list()| does the opposite. - - This function doesn't recursively convert all the List items - in {list} to a Tuple. Note that the items are identical - between the list and the tuple, changing an item changes the - contents of both the tuple and the list. - - Returns an empty tuple on error. - - Can also be used as a |method|: > - GetList()->list2tuple() -< - Return type: tuple<{type}> (depending on the given |List|) - - listener_add({callback} [, {buf}]) *listener_add()* Add a callback function that will be invoked when changes have been made to buffer {buf}. @@ -7575,12 +7462,11 @@ max({expr}) *max()* Return the maximum value of all items in {expr}. Example: > echo max([apples, pears, oranges]) -< {expr} can be a |List|, a |Tuple| or a |Dictionary|. For a - Dictionary, it returns the maximum of all values in the - Dictionary. If {expr} is neither a List nor a Tuple nor a - Dictionary, or one of the items in {expr} cannot be used as a - Number this results in an error. An empty |List|, |Tuple| - or |Dictionary| results in zero. +< {expr} can be a |List| or a |Dictionary|. For a Dictionary, + it returns the maximum of all values in the Dictionary. + If {expr} is neither a List nor a Dictionary, or one of the + items in {expr} cannot be used as a Number this results in + an error. An empty |List| or |Dictionary| results in zero. Can also be used as a |method|: > mylist->max() @@ -7667,12 +7553,11 @@ min({expr}) *min()* Return the minimum value of all items in {expr}. Example: > echo min([apples, pears, oranges]) -< {expr} can be a |List|, a |Tuple| or a |Dictionary|. For a - Dictionary, it returns the minimum of all values in the - Dictionary. If {expr} is neither a List nor a Tuple nor a - Dictionary, or one of the items in {expr} cannot be used as a - Number this results in an error. An empty |List|, |Tuple| or - |Dictionary| results in zero. +< {expr} can be a |List| or a |Dictionary|. For a Dictionary, + it returns the minimum of all values in the Dictionary. + If {expr} is neither a List nor a Dictionary, or one of the + items in {expr} cannot be used as a Number this results in + an error. An empty |List| or |Dictionary| results in zero. Can also be used as a |method|: > mylist->min() @@ -8230,8 +8115,7 @@ printf({fmt}, {expr1} ...) *printf()* < 1.41 You will get an overflow error |E1510|, when the field-width - or precision will result in a string longer than 1 MiB - (1024*1024 = 1048576) chars. + or precision will result in a string longer than 6400 chars. *E1500* You cannot mix positional and non-positional arguments: > @@ -8409,14 +8293,13 @@ py3eval({expr} [, {locals}]) *py3eval()* converted to Vim data structures. If a {locals} |Dictionary| is given, it defines set of local variables available in the expression. The keys are variable - names and the values are the variable values. |Dictionary|, - |List| and |Tuple| values are referenced, and may be updated - by the expression (as if |python-bindeval| was used). + names and the values are the variable values. |Dictionary| and + |List| values are referenced, and may be updated by the + expression (as if |python-bindeval| was used). Numbers and strings are returned as they are (strings are copied though, Unicode strings are additionally converted to 'encoding'). Lists are represented as Vim |List| type. - Tuples are represented as Vim |Tuple| type. Dictionaries are represented as Vim |Dictionary| type with keys converted to strings. Note that in a `:def` function local variables are not visible @@ -8438,7 +8321,6 @@ pyeval({expr} [, {locals}]) *pyeval()* Numbers and strings are returned as they are (strings are copied though). Lists are represented as Vim |List| type. - Tuples are represented as Vim |Tuple| type. Dictionaries are represented as Vim |Dictionary| type, non-string keys result in error. Note that in a `:def` function local variables are not visible @@ -8698,8 +8580,8 @@ readfile({fname} [, {type} [, {max}]]) reduce({object}, {func} [, {initial}]) *reduce()* *E998* {func} is called for every item in {object}, which can be a - |String|, |List|, |Tuple| or a |Blob|. {func} is called with - two arguments: the result so far and current item. After + |String|, |List| or a |Blob|. {func} is called with two + arguments: the result so far and current item. After processing all items the result is returned. *E1132* {initial} is the initial result. When omitted, the first item @@ -9020,16 +8902,16 @@ repeat({expr}, {count}) *repeat()* result. Example: > :let separator = repeat('-', 80) < When {count} is zero or negative the result is empty. - When {expr} is a |List|, a |Tuple| or a |Blob| the result is - {expr} concatenated {count} times. Example: > + When {expr} is a |List| or a |Blob| the result is {expr} + concatenated {count} times. Example: > :let longlist = repeat(['a', 'b'], 3) < Results in ['a', 'b', 'a', 'b', 'a', 'b']. Can also be used as a |method|: > mylist->repeat(count) < - Return type: |String|, |Blob|, list<{type}> or tuple<{type}> - depending on {expr} + Return type: |String|, |Blob| or list<{type}> depending on + {expr} resolve({filename}) *resolve()* *E655* @@ -9056,19 +8938,18 @@ resolve({filename}) *resolve()* *E655* reverse({object}) *reverse()* Reverse the order of items in {object}. {object} can be a - |List|, a |Tuple|, a |Blob| or a |String|. For a List and a - Blob the items are reversed in-place and {object} is returned. - For a Tuple, a new Tuple is returned. + |List|, a |Blob| or a |String|. For a List and a Blob the + items are reversed in-place and {object} is returned. For a String a new String is returned. - Returns zero if {object} is not a List, Tuple, Blob or a - String. If you want a List or Blob to remain unmodified make - a copy first: > + Returns zero if {object} is not a List, Blob or a String. + If you want a List or Blob to remain unmodified make a copy + first: > :let revlist = reverse(copy(mylist)) < Can also be used as a |method|: > mylist->reverse() < - Return type: |String|, |Blob|, list<{type}> or tuple<{type}> - depending on {object} + Return type: |String|, |Blob| or list<{type}> depending on + {object} round({expr}) *round()* @@ -9827,7 +9708,6 @@ setcursorcharpos({list}) Can also be used as a |method|: > GetCursorPos()->setcursorcharpos() < - Returns 0 when the position could be set, -1 otherwise. Return type: |Number| @@ -10422,7 +10302,7 @@ slice({expr}, {start} [, {end}]) *slice()* Can also be used as a |method|: > GetList()->slice(offset) < - Return type: list<{type}> or tuple<{type}> + Return type: list<{type}> sort({list} [, {how} [, {dict}]]) *sort()* *E702* @@ -10786,12 +10666,11 @@ str2blob({list} [, {options}]) *str2blob()* See also |blob2str()| Examples: > - str2blob(["ab"]) returns 0z6162 - str2blob(["«»"]) returns 0zC2ABC2BB - str2blob(["a\nb"]) returns 0z610062 - str2blob(["a","b"]) returns 0z610A62 - str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB + str2blob(["ab"]) returns 0z6162 + str2blob(["«»"]) returns 0zC2ABC2BB + str2blob(["a\nb"]) returns 0z610A62 str2blob(readfile('myfile.txt')) + str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB < Can also be used as a |method|: > GetListOfStrings()->str2blob() @@ -11034,16 +10913,15 @@ string({expr}) *string()* Funcref function('name') Blob 0z00112233.44556677.8899 List [item, item] - Tuple (item, item) Dictionary {key: value, key: value} Class class SomeName Object object of SomeName {lnum: 1, col: 3} Enum enum EnumName EnumValue enum name.value {name: str, ordinal: nr} - When a |List|, |Tuple| or |Dictionary| has a recursive - reference it is replaced by "[...]" or "(...)" or "{...}". - Using eval() on the result will then fail. + When a |List| or |Dictionary| has a recursive reference it is + replaced by "[...]" or "{...}". Using eval() on the result + will then fail. For an object, invokes the string() method to get a textual representation of the object. If the method is not present, @@ -11997,25 +11875,6 @@ trunc({expr}) *trunc()* Return type: |Float| -tuple2list({tuple}) *tuple2list()* - Create a List from a shallow copy of the tuple items. - Examples: > - tuple2list((1, 2, 3)) returns [1, 2, 3] -< |list2tuple()| does the opposite. - - This function doesn't recursively convert all the Tuple items - in {tuple} to a List. Note that the items are identical - between the list and the tuple, changing an item changes the - contents of both the tuple and the list. - - Returns an empty list on error. - - Can also be used as a |method|: > - GetTuple()->tuple2list() -< - Return type: list<{type}> (depending on the given |Tuple|) - - *type()* type({expr}) The result is a Number representing the type of {expr}. Instead of using the number directly, it is better to use the @@ -12036,7 +11895,6 @@ type({expr}) The result is a Number representing the type of {expr}. Typealias: 14 |v:t_typealias| Enum: 15 |v:t_enum| EnumValue: 16 |v:t_enumvalue| - Tuple: 17 |v:t_tuple| For backward compatibility, this method can be used: > :if type(myvar) == type(0) :if type(myvar) == type("") diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 24137c74..c656a117 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 9.1. Last change: 2025 Apr 03 +*change.txt* For Vim version 9.1. Last change: 2025 Mar 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -156,8 +156,8 @@ only after a '.'). The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting spaces before and after a multibyte character |fo-table|. -The |'[| mark is set at the end of the first line that was joined, |']| at the -end of the resulting line. +The '[ mark is set at the end of the first line that was joined, '] at the end +of the resulting line. ============================================================================== @@ -1188,8 +1188,8 @@ the ":put" command, Vim always inserts the text in the next line. You can exchange two characters with the command sequence "xp". You can exchange two lines with the command sequence "ddp". You can exchange two words with the command sequence "deep" (start with the cursor in the blank space before the -first word). You can use the |']| or |`]| command after the put command to -move the cursor to the end of the inserted text, or use |'[| or |`[| to move +first word). You can use the "']" or "`]" command after the put command to +move the cursor to the end of the inserted text, or use "'[" or "`[" to move the cursor to the start. *put-Visual-mode* *v_p* *v_P* diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 621e7f66..d97d230e 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 9.1. Last change: 2025 May 05 +*develop.txt* For Vim version 9.1. Last change: 2024 Dec 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -192,7 +192,7 @@ For any non-trivial change, please always create a pull request on github, since this triggers the test suite. *style-clang-format* -sound.c and sign.c can be (semi-) automatically formatted using the +sound.c and sign.c can be (semi-) automatically formated using the `clang-format` formatter according to the distributed .clang-format file. Other source files do not yet correspond to the .clang-format file. This may change in the future and they may be reformatted as well. @@ -215,7 +215,7 @@ them: - flexible array members: Not supported by HP-UX C compiler (John Marriott) -COMMENTS *style-comments* +COMMENTS *style-comments* Try to avoid putting multiline comments inside a function body: if the function is so complex that you need to separately comment parts of it, you @@ -230,7 +230,8 @@ For everything else use: > // comment < -INDENTATION *style-indentation* + +INDENTATION *style-indentation* We use 4 space to indent the code. If you are using Vim to edit the source, you don't need to do anything due to the |modeline|. @@ -238,7 +239,7 @@ you don't need to do anything due to the |modeline|. For other editors an `.editorconfig` is provided at the root of the repo. -DECLARATIONS *style-declarations* +DECLARATIONS *style-declarations* Declare, when possible, `for` loop variables in the guard: OK: > @@ -258,76 +259,114 @@ Wrong: > int *ptr; < -BRACES *style-braces* + +BRACES *style-braces* All curly braces must be returned onto a new line: OK: > if (cond) { - cmd; - cmd; + cmd; + cmd; } else { - cmd; - cmd; + cmd; + cmd; } < Wrong: > if (cond) { - cmd; - cmd; + cmd; + cmd; } else { - cmd; - cmd; + cmd; + cmd; } < OK: > while (cond) { cmd; - cmd; } < Wrong: > while (cond) { cmd; - cmd; } < +When a block has one line, including comments, the braces can be left out. OK: > - do - { + if (cond) cmd; + else cmd; - } while (cond); < -or > - do +Wrong: > + if (cond) + /* + * comment + */ + cmd; + else + cmd; +< +When an `if`/`else` has braces on one block, the other should have it too. +OK: > + if (cond) + { + cmd; + } + else { cmd; cmd; } - while (cond); < Wrong: > - do { + if (cond) + cmd; + else + { + cmd; + cmd; + } + + if (cond) + { + cmd; + cmd; + } + else cmd; +< +OK: > + while (cond) cmd; - } while (cond); < +Wrong: +> + while (cond) + if (cond) + cmd; +< + TYPES *style-types* -Use descriptive types. These are defined in src/vim.h, src/structs.h etc. +Use descriptive types. You can find a list of them in the src/structs.h file +and probably in a typedef in the file you are working on. + Note that all custom types are postfixed with "_T" -Example: > - linenr_T - buf_T - pos_T +OK: > + int is_valid_line_number(linenr_T lnum); +< +Wrong: > + int is_valid_line_number(unsigned long lnum); < + SPACES AND PUNCTUATION *style-spaces* No space between a function name and the bracket: @@ -347,8 +386,8 @@ Wrong: func(arg1,arg2); for (i = 0;i < 2;++i) Use a space before and after '=', '+', '/', etc. -OK: var = a * 5; Wrong: var=a*5; +OK: var = a * 5; Use empty lines to group similar actions together. @@ -373,6 +412,7 @@ Wrong: > while (buf != NULL && !got_int) < + FUNCTIONS *style-functions* Use function declarations with the return type on a separate indented line. diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 81564664..e3abbdef 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 9.1. Last change: 2025 Mar 28 +*diff.txt* For Vim version 9.1. Last change: 2024 Feb 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -226,28 +226,14 @@ The diffs are highlighted with these groups: |hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in this buffer but not in another. |hl-DiffChange| DiffChange Changed lines. -|hl-DiffText| DiffText Changed text inside a Changed line. Exact - behavior depends on the `inline:` setting in - 'diffopt'. - With `inline:` set to "simple", Vim finds the - first character that is different, and the - last character that is different (searching - from the end of the line). The text in - between is highlighted. This means that parts - in the middle that are still the same are - highlighted anyway. The 'diffopt' flags - "iwhite" and "icase" are used here. - With `inline:` set to "char" or "word", Vim - uses the internal diff library to perform a - detailed diff between the changed blocks and - highlight the exact difference between the - two. Will respect any 'diffopt' flag that - affects internal diff. - Not used when `inline:` is set to "none". -|hl-DiffTextAdd| DiffTextAdd Added text inside a Changed line. Similar to - DiffText, but used when there is no - corresponding text in other buffers. Not used - when `inline:` is set to "simple" or "none". +|hl-DiffText| DiffText Changed text inside a Changed line. Vim + finds the first character that is different, + and the last character that is different + (searching from the end of the line). The + text in between is highlighted. This means + that parts in the middle that are still the + same are highlighted anyway. The 'diffopt' + flags "iwhite" and "icase" are used here. |hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines, because they don't really exist in this buffer. diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index a88aad1a..a70515d6 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 9.1. Last change: 2025 Apr 03 +*editing.txt* For Vim version 9.1. Last change: 2024 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -974,9 +974,8 @@ Note: When the 'write' option is off, you are not able to write any file. executed like with ":!{cmd}", any '!' is replaced with the previous command |:!|. -The default [range] for the ":w" command is the whole buffer (1,$). The |'[| -and |']| marks will be set to the [range] being used for the write command. -If you write the whole buffer, it is no longer considered changed. When you +The default [range] for the ":w" command is the whole buffer (1,$). If you +write the whole buffer, it is no longer considered changed. When you write it to a different file with ":w somefile" it depends on the "+" flag in 'cpoptions'. When included, the write command will reset the 'modified' flag, even though the buffer itself may still be different from its file. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 170d2d03..0ada1b21 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.1. Last change: 2025 Apr 02 +*eval.txt* For Vim version 9.1. Last change: 2025 Feb 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -21,10 +21,9 @@ a remark is given. 1.1 Variable types 1.2 Function references |Funcref| 1.3 Lists |Lists| - 1.4 Tuples |Tuples| - 1.5 Dictionaries |Dictionaries| - 1.6 Blobs |Blobs| - 1.7 More about variables |more-variables| + 1.4 Dictionaries |Dictionaries| + 1.5 Blobs |Blobs| + 1.6 More about variables |more-variables| 2. Expression syntax |expression-syntax| 3. Internal variable |internal-variables| 4. Builtin Functions |functions| @@ -47,8 +46,8 @@ Profiling is documented at |profiling|. 1.1 Variable types ~ *E712* *E896* *E897* *E899* *E1098* - *E1107* *E1135* *E1138* *E1523* -There are eleven types of variables: + *E1107* *E1135* *E1138* +There are ten types of variables: *Number* *Integer* Number A 32 or 64 bit signed number. |expr-number| @@ -64,10 +63,6 @@ String A NUL terminated string of 8-bit unsigned characters (bytes). List An ordered sequence of items, see |List| for details. Example: [1, 2, ['a', 'b']] -Tuple An ordered immutable sequence of items, see |Tuple| for - details. - Example: (1, 2, ('a', 'b')) - Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| Examples: @@ -170,17 +165,16 @@ A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE. *E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910* *E913* *E974* *E975* *E976* *E1319* *E1320* *E1321* *E1322* - *E1323* *E1324* *E1520* *E1522* -|List|, |Tuple|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| -and |object| types are not automatically converted. + *E1323* *E1324* +|List|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| and +|object| types are not automatically converted. *E805* *E806* *E808* When mixing Number and Float the Number is converted to Float. Otherwise there is no automatic conversion of Float. You can use str2float() for String to Float, printf() for Float to String and float2nr() for Float to Number. - *E362* *E891* *E892* *E893* *E894* - *E907* *E911* *E914* *E1521* + *E362* *E891* *E892* *E893* *E894* *E907* *E911* *E914* When expecting a Float a Number can also be used, but nothing else. *no-type-checking* @@ -273,9 +267,9 @@ position in the sequence. List creation ~ *E696* *E697* -A List is created with a comma-separated sequence of items in square brackets. +A List is created with a comma-separated list of items in square brackets. Examples: > - :let mylist = [1, "two", 3, "four"] + :let mylist = [1, two, 3, "four"] :let emptylist = [] An item can be any expression. Using a List for an item creates a @@ -333,13 +327,13 @@ similar to -1. > :let otherlist = mylist[:] " make a copy of the List Notice that the last index is inclusive. If you prefer using an exclusive -index use the |slice()| function. +index use the |slice()| method. -If the first index is beyond the last item of the List or the last index is +If the first index is beyond the last item of the List or the second item is before the first item, the result is an empty list. There is no error message. -If the last index is equal to or greater than the length of the list the +If the second index is equal to or greater than the length of the list the length minus one is used: > :let mylist = [0, 1, 2, 3] :echo mylist[2:8] " result: [2, 3] @@ -469,8 +463,8 @@ Changing the order of items in a list: > For loop ~ -The |:for| loop executes commands for each item in a List, Tuple, String or -Blob. A variable is set to each item in sequence. Example with a List: > +The |:for| loop executes commands for each item in a List, String or Blob. +A variable is set to each item in sequence. Example with a List: > :for item in mylist : call Doit(item) :endfor @@ -503,8 +497,6 @@ It is also possible to put remaining items in a List variable: > : endif :endfor -For a Tuple one tuple item at a time is used. - For a Blob one byte at a time is used. For a String one character, including any composing characters, is used as a @@ -535,216 +527,8 @@ Don't forget that a combination of features can make things simple. For example, to add up all the numbers in a list: > :exe 'let sum = ' .. join(nrlist, '+') -1.4 Tuples ~ - *tuple* *Tuple* *Tuples* - *E1532* *E1533* -A Tuple is an ordered sequence of items. An item can be of any type. Items -can be accessed by their index number. A Tuple is immutable. - -A Tuple is similar to a List but uses less memory and provides O(1) lookup -time for an item. - -Tuple creation ~ - *E1526* *E1527* -A Tuple is created with a comma-separated sequence of items in parentheses. -Examples: > - :let mytuple = (1, "two", 3, "four") - :let tuple = (5,) - :let emptytuple = () - -An item can be any expression. If there is only one item in the tuple, then -the item must be followed by a comma. - -Using a Tuple for an item creates a Tuple of Tuples: > - :let nesttuple = ((11, 12), (21, 22), (31, 32)) - - -Tuple index ~ - *tuple-index* *E1519* -An item in the Tuple can be accessed by putting the index in square brackets -after the Tuple. Indexes are zero-based, thus the first item has index zero. -> - :let item = mytuple[0] " get the first item: 1 - :let item = mytuple[2] " get the third item: 3 - -When the resulting item is a tuple this can be repeated: > - :let item = nesttuple[0][1] " get the first tuple, second item: 12 -< -A negative index is counted from the end. Index -1 refers to the last item in -the Tuple, -2 to the last but one item, etc. > - :let last = mytuple[-1] " get the last item: "four" - -To avoid an error for an invalid index use the |get()| function. When an item -is not available it returns zero or the default value you specify: > - :echo get(mytuple, idx) - :echo get(mytuple, idx, "NONE") - - -Tuple modification ~ - *tuple-modification* -A tuple is immutable and items cannot be added or removed from a tuple. But -List and Dict items within a tuple can be modified: > - :let tuple = (1, [2, 3], {'a': 4}) - :let tuple[1][0] = 10 - :let tuple[2]['a'] = 20 - - -Tuple concatenation ~ - *tuple-concatenation* -Two tuples can be concatenated with the "+" operator: > - :let longtuple = mytuple + (5, 6) - :let longtuple = (5, 6) + mytuple -To prepend or append an item, turn it into a tuple by putting () around it. -The item must be followed by a comma. - - *E1540* -Two variadic tuples with same item type can be concatenated but with different -item types cannot be concatenated. Examples: > - var a: tuple<...list> = (1, 2) - var b: tuple<...list> = ('a', 'b') - echo a + b # not allowed - - var a: tuple = (1, 2) - var b: tuple<...list> = ('a', 'b') - echo a + b # allowed - - var a: tuple<...list> = (1, 2) - var b: tuple = (3, 4) - echo a + b # not allowed - - var a: tuple<...list> = (1, 2) - var b: tuple> = (3, 4) - echo a + b # not allowed -< -Note that a tuple is immutable and items cannot be added or removed from a -tuple. - - -Subtuple ~ - *subtuple* -A part of the Tuple can be obtained by specifying the first and last index, -separated by a colon in square brackets: > - :let shorttuple = mytuple[2:-1] " get Tuple (3, "four") - -Omitting the first index is similar to zero. Omitting the last index is -similar to -1. > - :let endtuple = mytuple[2:] " from item 2 to the end: (3, "four") - :let shorttuple = mytuple[2:2] " Tuple with one item: (3,) - :let othertuple = mytuple[:] " make a copy of the Tuple - -Notice that the last index is inclusive. If you prefer using an exclusive -index, use the |slice()| function. - -If the first index is beyond the last item of the Tuple or the last index is -before the first item, the result is an empty tuple. There is no error -message. - -If the last index is equal to or greater than the length of the tuple, the -length minus one is used: > - :let mytuple = (0, 1, 2, 3) - :echo mytuple[2:8] " result: (2, 3) - -NOTE: mytuple[s:e] means using the variable "s:e" as index. Watch out for -using a single letter variable before the ":". Insert a space when needed: -mytuple[s : e]. - - -Tuple identity ~ - *tuple-identity* -When variable "aa" is a tuple and you assign it to another variable "bb", both -variables refer to the same tuple: > - :let aa = (1, 2, 3) - :let bb = aa -< - -Making a copy of a tuple is done with the |copy()| function. Using [:] also -works, as explained above. This creates a shallow copy of the tuple: For -example, changing a list item in the tuple will also change the item in the -copied tuple: > - :let aa = ([1, 'a'], 2, 3) - :let bb = copy(aa) - :let aa[0][1] = 'aaa' - :echo aa -< ([1, aaa], 2, 3) > - :echo bb -< ([1, aaa], 2, 3) - -To make a completely independent tuple, use |deepcopy()|. This also makes a -copy of the values in the tuple, recursively. Up to a hundred levels deep. - -The operator "is" can be used to check if two variables refer to the same -Tuple. "isnot" does the opposite. In contrast, "==" compares if two tuples -have the same value. > - :let atuple = (1, 2, 3) - :let btuple = (1, 2, 3) - :echo atuple is btuple -< 0 > - :echo atuple == btuple -< 1 - -Note about comparing tuples: Two tuples are considered equal if they have the -same length and all items compare equal, as with using "==". There is one -exception: When comparing a number with a string they are considered -different. There is no automatic type conversion, as with using "==" on -variables. Example: > - echo 4 == "4" -< 1 > - echo (4,) == ("4",) -< 0 - -Thus comparing Tuples is more strict than comparing numbers and strings. You -can compare simple values this way too by putting them in a tuple: > - :let a = 5 - :let b = "5" - :echo a == b -< 1 > - :echo (a,) == (b,) -< 0 - - -Tuple unpack ~ - -To unpack the items in a tuple to individual variables, put the variables in -square brackets, like list items: > - :let [var1, var2] = mytuple - -When the number of variables does not match the number of items in the tuple -this produces an error. To handle any extra items from the tuple, append ";" -and a variable name (which will then be of type tuple): > - :let [var1, var2; rest] = mytuple - -This works like: > - :let var1 = mytuple[0] - :let var2 = mytuple[1] - :let rest = mytuple[2:] - -Except that there is no error if there are only two items. "rest" will be an -empty tuple then. - - -Tuple functions ~ - *E1536* -Functions that are useful with a Tuple: > - :let xs = count(tuple, 'x') " count number of 'x's in tuple - :if empty(tuple) " check if tuple is empty - :let i = index(tuple, 'x') " index of first 'x' in tuple - :let l = items(tuple) " list of items in a tuple - :let string = join(tuple, ', ') " create string from tuple items - :let l = len(tuple) " number of items in tuple - :let big = max(tuple) " maximum value in tuple - :let small = min(tuple) " minimum value in tuple - :let r = repeat(tuple, n) " repeat a tuple n times - :let r = reverse(tuple) " reverse a tuple - :let s = slice(tuple, n1, n2) " slice a tuple - :let s = string(tuple) " String representation of tuple - :let l = tuple2list(tuple) " convert a tuple to list - :let t = list2tuple(list) " convert a list to tuple -< - *E1524* -A tuple cannot be used with the |map()|, |mapnew()| and |filter()| functions. - -1.5 Dictionaries ~ +1.4 Dictionaries ~ *dict* *Dict* *Dictionaries* *Dictionary* A Dictionary is an associative array: Each entry has a key and a value. The entry can be located with the key. The entries are stored without a specific @@ -753,10 +537,10 @@ ordering. Dictionary creation ~ *E720* *E721* *E722* *E723* -A Dictionary is created with a comma-separated sequence of entries in curly +A Dictionary is created with a comma-separated list of entries in curly braces. Each entry has a key and a value, separated by a colon. Each key can only appear once. Examples: > - :let mydict = {'one': 1, 'two': 2, 'three': 3} + :let mydict = {1: 'one', 2: 'two', 3: 'three'} :let emptydict = {} < *E713* *E716* *E717* A key is always a String. You can use a Number, it will be converted to a @@ -786,11 +570,8 @@ An extra comma after the last entry is ignored. Accessing entries ~ The normal way to access an entry is by putting the key in square brackets: > - :let mydict = {'one': 1, 'two': 2, 'three': 3} :let val = mydict["one"] :let mydict["four"] = 4 - :let val = mydict.one - :let mydict.four = 4 You can add new entries to an existing Dictionary this way, unlike Lists. @@ -928,7 +709,7 @@ Functions that can be used with a Dictionary: > :call map(dict, '">> " .. v:val') " prepend ">> " to each item -1.6 Blobs ~ +1.5 Blobs ~ *blob* *Blob* *Blobs* *E978* A Blob is a binary object. It can be used to read an image from a file and send it over a channel, for example. @@ -1075,7 +856,7 @@ Making a copy of a Blob is done with the |copy()| function. Using [:] also works, as explained above. -1.7 More about variables ~ +1.6 More about variables ~ *more-variables* If you need to know the type of a variable or expression, use the |type()| function. @@ -1126,18 +907,16 @@ Expression syntax summary, from least to most significant: etc. As above, append ? for ignoring case, # for matching case - expr5 is expr5 same |List|, |Tuple|, |Dictionary| or |Blob| + expr5 is expr5 same |List|, |Dictionary| or |Blob| instance + expr5 isnot expr5 different |List|, |Dictionary| or |Blob| instance - expr5 isnot expr5 different |List|, |Tuple|, |Dictionary| or - |Blob| instance |expr5| expr6 expr6 << expr6 bitwise left shift expr6 >> expr6 bitwise right shift |expr6| expr7 - expr7 + expr7 ... number addition, list or tuple or blob - concatenation + expr7 + expr7 ... number addition, list or blob concatenation expr7 - expr7 ... number subtraction expr7 . expr7 ... string concatenation expr7 .. expr7 ... string concatenation @@ -1156,10 +935,8 @@ Expression syntax summary, from least to most significant: + expr9 unary plus |expr10| expr11 - expr10[expr1] byte of a String or item of a |List| or - |Tuple| + expr10[expr1] byte of a String or item of a |List| expr10[expr1 : expr1] substring of a String or sublist of a |List| - or a slice of a |Tuple| expr10.name entry in a |Dictionary| expr10(expr1, ...) function call with |Funcref| variable expr10->name(expr1, ...) |method| call @@ -1168,7 +945,6 @@ Expression syntax summary, from least to most significant: "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| - (expr1, ...) |Tuple| {expr1: expr1, ...} |Dictionary| #{key: expr1, ...} legacy |Dictionary| &option option value @@ -1325,11 +1101,10 @@ Examples: "abc" == "Abc" evaluates to 1 if 'ignorecase' is set, 0 otherwise NOTE: In |Vim9| script 'ignorecase' is not used. - *E691* *E692* *E1517* *E1518* + *E691* *E692* A |List| can only be compared with a |List| and only "equal", "not equal", "is" and "isnot" can be used. This compares the values of the list, recursively. Ignoring case means case is ignored when comparing item values. -Same applies for a |Tuple|. *E735* *E736* A |Dictionary| can only be compared with a |Dictionary| and only "equal", "not @@ -1349,13 +1124,12 @@ Dictionary and arguments, use |get()| to get the function name: > if get(Part1, 'name') == get(Part2, 'name') " Part1 and Part2 refer to the same function < *E1037* -Using "is" or "isnot" with a |List|, |Tuple|, |Dictionary| or |Blob| checks -whether the expressions are referring to the same |List|, |Tuple|, -|Dictionary| or |Blob| instance. A copy of a |List| or |Tuple| is different -from the original |List| or |Tuple|. When using "is" without a |List|, -|Tuple|, |Dictionary| or |Blob|, it is equivalent to using "equal", using -"isnot" is equivalent to using "not equal". Except that a different type -means the values are different: > +Using "is" or "isnot" with a |List|, |Dictionary| or |Blob| checks whether +the expressions are referring to the same |List|, |Dictionary| or |Blob| +instance. A copy of a |List| is different from the original |List|. When +using "is" without a |List|, |Dictionary| or |Blob|, it is equivalent to +using "equal", using "isnot" equivalent to using "not equal". Except that +a different type means the values are different: > echo 4 == '4' 1 echo 4 is '4' @@ -1373,7 +1147,7 @@ that: > because 'x' converted to a Number is zero. However: > echo [0] == ['x'] 0 -Inside a List or Tuple or Dictionary this conversion is not used. +Inside a List or Dictionary this conversion is not used. In |Vim9| script the types must match. @@ -1417,14 +1191,13 @@ topmost bit (sometimes called the sign bit) is cleared. If the right operand expr6 and expr7 *expr6* *expr7* *E1036* *E1051* --------------- - *expr-+* -expr7 + expr7 Number addition, |List| or |Tuple| or |Blob| concatenation +expr7 + expr7 Number addition, |List| or |Blob| concatenation *expr-+* expr7 - expr7 Number subtraction *expr--* expr7 . expr7 String concatenation *expr-.* expr7 .. expr7 String concatenation *expr-..* For |Lists| only "+" is possible and then both expr7 must be a list. The -result is a new list with the two lists concatenated. Same for a |Tuple|. +result is a new list with the two lists Concatenated. For String concatenation ".." is preferred, since "." is ambiguous, it is also used for |Dict| member access and floating point numbers. @@ -1522,8 +1295,7 @@ in any order. E.g., these are all possible: expr10->(expr1, ...)[expr1] Evaluation is always from left to right. - *expr-[]* *E111* -expr10[expr1] item of String or |List| or |Tuple| +expr10[expr1] item of String or |List| *expr-[]* *E111* *E909* *subscript* *E1062* In legacy Vim script: If expr10 is a Number or String this results in a String that contains the @@ -1556,8 +1328,6 @@ Generally, if a |List| index is equal to or higher than the length of the |List|, or more negative than the length of the |List|, this results in an error. -A |Tuple| index is similar to a |List| index as explained above. - expr10[expr1a : expr1b] substring or |sublist| *expr-[:]* *substring* @@ -1599,7 +1369,6 @@ just above. Also see |sublist| below. Examples: > :let l = mylist[:3] " first four items :let l = mylist[4:4] " List with one item :let l = mylist[:] " shallow copy of a List -A |Tuple| slice is similar to a |List| slice. If expr10 is a |Blob| this results in a new |Blob| with the bytes in the indexes expr1a and expr1b, inclusive. Examples: > @@ -2846,8 +2615,6 @@ v:t_typealias Value of |typealias| type. Read-only. See: |type()| v:t_enum Value of |enum| type. Read-only. See: |type()| *v:t_enumvalue* *t_enumvalue-variable* v:t_enumvalue Value of |enumvalue| type. Read-only. See: |type()| - *v:t_tuple* *t_tuple-variable* -v:t_tuple Value of |Tuple| type. Read-only. See: |type()| *v:termresponse* *termresponse-variable* v:termresponse The escape sequence returned by the terminal for the |t_RV| @@ -3167,13 +2934,13 @@ declarations and assignments do not use a command. |vim9-declaration| :let &g:{option-name} -= {expr1} Like above, but only set the global value of an option (if there is one). Works like |:setglobal|. - *E1093* *E1537* *E1538* *E1535* + *E1093* :let [{name1}, {name2}, ...] = {expr1} *:let-unpack* *E687* *E688* - {expr1} must evaluate to a |List| or a |Tuple|. The - first item in the list or tuple is assigned to - {name1}, the second item to {name2}, etc. + {expr1} must evaluate to a |List|. The first item in + the list is assigned to {name1}, the second item to + {name2}, etc. The number of names must match the number of items in - the |List| or |Tuple|. + the |List|. Each name can be one of the items of the ":let" command as mentioned above. Example: > @@ -3190,22 +2957,16 @@ declarations and assignments do not use a command. |vim9-declaration| :let [{name1}, {name2}, ...] .= {expr1} :let [{name1}, {name2}, ...] += {expr1} :let [{name1}, {name2}, ...] -= {expr1} -:let [{name1}, {name2}, ...] *= {expr1} -:let [{name1}, {name2}, ...] /= {expr1} -:let [{name1}, {name2}, ...] %= {expr1} - Like above, but append, add, subtract, multiply, - divide, or modulo the value for each |List| or |Tuple| - item. + Like above, but append/add/subtract the value for each + |List| item. :let [{name}, ..., ; {lastname}] = {expr1} *E452* - Like |:let-unpack| above, but the |List| or |Tuple| - may have more items than there are names. A list or a - tuple of the remaining items is assigned to - {lastname}. If there are no remaining items, - {lastname} is set to an empty list or tuple. + Like |:let-unpack| above, but the |List| may have more + items than there are names. A list of the remaining + items is assigned to {lastname}. If there are no + remaining items {lastname} is set to an empty list. Example: > :let [a, b; rest] = ["aval", "bval", 3, 4] - :let [a, b; rest] = ("aval", "bval", 3, 4) < :let [{name}, ..., ; {lastname}] .= {expr1} :let [{name}, ..., ; {lastname}] += {expr1} @@ -3400,26 +3161,23 @@ text... get an error message: "E940: Cannot lock or unlock variable {name}". - [depth] is relevant when locking a |List|, a |Tuple| - or a |Dictionary|. It specifies how deep the locking - goes: + [depth] is relevant when locking a |List| or + |Dictionary|. It specifies how deep the locking goes: 0 Lock the variable {name} but not its value. - 1 Lock the |List| or |Tuple| or - |Dictionary| itself, cannot add or - remove items, but can still change - their values. + 1 Lock the |List| or |Dictionary| itself, + cannot add or remove items, but can + still change their values. 2 Also lock the values, cannot change the items. If an item is a |List| or - |Tuple| or |Dictionary|, cannot add or - remove items, but can still change the + |Dictionary|, cannot add or remove + items, but can still change the values. - 3 Like 2 but for the |List| / |Tuple| / - |Dictionary| in the |List| / |Tuple| / + 3 Like 2 but for the |List| / + |Dictionary| in the |List| / |Dictionary|, one level deeper. - The default [depth] is 2, thus when {name} is a - |List|, a |Tuple| or a |Dictionary| the values cannot - be changed. + The default [depth] is 2, thus when {name} is a |List| + or |Dictionary| the values cannot be changed. Example with [depth] 0: > let mylist = [1, 2, 3] @@ -3524,7 +3282,7 @@ text... :endfo[r] *:endfo* *:endfor* Repeat the commands between `:for` and `:endfor` for each item in {object}. {object} can be a |List|, - a |Tuple|, a |Blob| or a |String|. *E1177* + a |Blob| or a |String|. *E1177* Variable {var} is set to the value of each item. In |Vim9| script the loop variable must not have been @@ -5149,7 +4907,7 @@ executable. It takes the following arguments: filetype string executable string - *dist#vim9#Open()* *:Open* *:URLOpen* + *dist#vim9#Open()* *:Open* *g:Openprg* *gx* dist#vim9#Open(file: string) ~ @@ -5157,8 +4915,6 @@ Opens `path` with the system default handler (macOS `open`, Windows `explorer.exe`, Linux `xdg-open`, …). If the variable |g:Openprg| exists the string specified in the variable is used instead. -The |:Open| user command uses file completion for its argument. - This function is by default called using the gx mapping. In visual mode tries to open the visually selected text. @@ -5177,18 +4933,13 @@ Usage: >vim :call dist#vim9#Open() :Open < - *package-open* -The |:Open| and |:Launch| command are provided by the included plugin -$VIMRUNTIME/plugin/openPlugin.vim - *dist#vim9#Launch()* *:Launch* + *dist#vim9#Launch()* *:Launch* dist#vim9#Launch(file: string) ~ Launches with the appropriate system programs. Intended for launching GUI programs within Vim. -The |:Launch| user command uses shell completion for its first argument. - NOTE: escaping of is left to the user Examples: >vim diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 63d7b030..20bf3959 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 9.1. Last change: 2025 May 10 +*filetype.txt* For Vim version 9.1. Last change: 2025 Mar 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -153,17 +153,11 @@ variables can be used to overrule the filetype used for certain extensions: *.f g:filetype_f |ft-forth-syntax| *.frm g:filetype_frm |ft-form-syntax| *.fs g:filetype_fs |ft-forth-syntax| - *.h g:c_syntax_for_h |ft-c-syntax| (deprecated) - *.h g:ch_syntax_for_h |ft-ch-syntax| (deprecated) - *.h g:filetype_h |ft-c-syntax| - |ft-ch-syntax| - |ft-cpp-syntax| + *.h g:c_syntax_for_h |ft-c-syntax| *.i g:filetype_i |ft-progress-syntax| *.inc g:filetype_inc *.lsl g:filetype_lsl *.m g:filetype_m |ft-mathematica-syntax| - *[mM]makefile,*.mk,*.mak,[mM]akefile* - g:make_flavor |ft-make-syntax| *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md g:filetype_md |ft-pandoc-syntax| *.mod g:filetype_mod @@ -269,7 +263,7 @@ D. If your filetype can only be detected by inspecting the contents of the item of the 'runtimepath' option. Example for Unix: > :!mkdir ~/.vim < - 2. Create a Vim script file for doing this. Example: > + 2. Create a vim script file for doing this. Example: > if did_filetype() " filetype already set.. finish " ..don't do these checks endif @@ -666,16 +660,6 @@ possibilities: > The `:Cycle` command is also mapped to the CTRL-A and CTRL-X keys. For details, see `git-rebase --help`. -GLEAM *ft-gleam-plugin* - -By default the following options are set for the recommended gleam style: > - - setlocal expandtab shiftwidth=2 softtabstop=2 - -To disable this behavior, set the following variable in your vimrc: > - - let g:gleam_recommended_style = 0 - GO *ft-go-plugin* By default the following options are set, based on Golang official docs: > @@ -702,32 +686,6 @@ HARE *ft-hare* Since the text for this plugin is rather long it has been put in a separate file: |ft_hare.txt|. -HTML *ft-html-plugin* - -Tag folding poses a few difficulties. Many elements, e.g. `blockquote`, are -always delimited by start and end tags; end tags for some elements, e.g. `p`, -can be omitted in certain contexts; void elements, e.g. `hr`, have no end tag. -Although the rules for supporting omissible end tags are ad-hoc and involved -[0], they apply to elements in scope. Assuming syntactical wellformedness, an -end tag can be associated with its nearest matching start tag discoverable in -scope [1] and towards the beginning of a file, whereas all unbalanced tags and -inlined tags can be disregarded. Having syntax highlighting in effect, tag -folding using the |fold-expr| method can be enabled with: > - let g:html_expr_folding = 1 -< -By default, tag folding will be redone from scratch after each occurrence of -a |TextChanged| or an |InsertLeave| event. Such frequency may not be desired, -especially for large files, and this recomputation can be disabled with: > - let g:html_expr_folding_without_recomputation = 1 - doautocmd FileType -< -To force another recomputation, do: > - unlet! b:foldsmap - normal zx -< -[0] https://html.spec.whatwg.org/multipage/syntax.html#optional-tags -[1] https://en.wikipedia.org/wiki/Dangling_else - IDRIS2 *ft-idris2-plugin* By default the following options are set: > @@ -1069,13 +1027,6 @@ functions with [[ and ]]. Move around comments with ]" and [". The mappings can be disabled with: > let g:no_vim_maps = 1 -YAML *ft-yaml-plugin* -By default, the YAML filetype plugin enables the following options: > - setlocal shiftwidth=2 softtabstop=2 - -To disable this, set the following variable: > - let g:yaml_recommended_style = 0 - ZIG *ft-zig-plugin* diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 4e08d905..7b9dd767 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2025 May 04 +*helphelp.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -287,11 +287,9 @@ The latter supports the following normal commands: > | select first entry | select last entry -The plugin can also provide a table of contents in buffers of the following -filetypes: asciidoc, html, man, markdown, tex, vim, and xhtml. In addition -it also provide a table of contents for a terminal buffer, which produces -entries that are the past executed shell commands. To find those, by default, -the following pattern is used: > +The plugin can also provide a table of contents in man pages, markdown files, +and terminal buffers. In the latter, the entries will be the past executed +shell commands. To find those, the following pattern is used: > ^\w\+@\w\+:\f\+\$\s @@ -305,9 +303,6 @@ Tip: After inserting a pattern to look for with the `/` command, if you press instead of , you can then get more context for each remaining entry by pressing `J` or `K`. -Refer |helptoc.vim| for more details about helptoc, particularly about using -it with filetypes other than help, and configuring its options. - ============================================================================== 2. Translated help files *help-translated* @@ -388,10 +383,6 @@ standard Vim help files, except for the first line. If you are writing a new help file it's best to copy one of the existing files and use it as a template. -Vim help files generally use 2 spaces after a sentence (since they are written -using a fixed-width font and that was the prefered style in the 70s/80s), like -what is described here: https://english.stackexchange.com/a/2602 - The first line in a help file should have the following format: *plugin_name.txt* {short description of the plugin} @@ -480,13 +471,8 @@ highlighting. So do these: You can find the details in $VIMRUNTIME/syntax/help.vim -FILETYPE COMPLETION *ft-help-omni* - -To get completion for help tags when writing a tag reference, you can use the -|i_CTRL-X_CTRL-O| command. - - GENDER NEUTRAL LANGUAGE + *gender-neutral* *inclusion* Vim is for everybody, no matter race, gender or anything. For new or updated help text, gender neutral language is recommended. Some of the help text is diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt index 85e5a90e..86edd05a 100644 --- a/runtime/doc/if_perl.txt +++ b/runtime/doc/if_perl.txt @@ -1,4 +1,4 @@ -*if_perl.txt* For Vim version 9.1. Last change: 2025 Apr 27 +*if_perl.txt* For Vim version 9.1. Last change: 2023 May 14 VIM REFERENCE MANUAL by Sven Verdoolaege @@ -74,7 +74,7 @@ The ActiveState one should work, Strawberry Perl is a good alternative. |script-here|. -Example Vim script: > +Example vim script: > function! WhitePearl() perl << EOF diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index b17e1e76..480ff02c 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 9.1. Last change: 2025 Mar 26 +*if_pyth.txt* For Vim version 9.1. Last change: 2024 Nov 09 VIM REFERENCE MANUAL by Paul Moore @@ -184,9 +184,8 @@ vim.eval(str) *python-eval* evaluator (see |expression|). Returns the expression result as: - a string if the Vim expression evaluates to a string or number - a list if the Vim expression evaluates to a Vim list - - a tuple if the Vim expression evaluates to a Vim tuple - a dictionary if the Vim expression evaluates to a Vim dictionary - Dictionaries, lists and tuples are recursively expanded. + Dictionaries and lists are recursively expanded. Examples: > :" value of the 'textwidth' option :py text_width = vim.eval("&tw") @@ -197,8 +196,6 @@ vim.eval(str) *python-eval* :" Result is a string! Use string.atoi() to convert to a number. :py str = vim.eval("12+12") : - :py tuple = vim.eval('(1, 2, 3)') - : :py tagList = vim.eval('taglist("eval_expr")') < The latter will return a python list of python dicts, for instance: [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~ @@ -210,8 +207,8 @@ vim.eval(str) *python-eval* vim.bindeval(str) *python-bindeval* Like |python-eval|, but returns special objects described in - |python-bindeval-objects|. These python objects let you modify - (|List|, |Tuple| or |Dictionary|) or call (|Funcref|) vim objects. + |python-bindeval-objects|. These python objects let you modify (|List| + or |Dictionary|) or call (|Funcref|) vim objects. vim.strwidth(str) *python-strwidth* Like |strwidth()|: returns number of display cells str occupies, tab @@ -691,22 +688,6 @@ vim.List object *python-List* print isinstance(l, vim.List) # True class List(vim.List): # Subclassing -vim.Tuple object *python-Tuple* - Sequence-like object providing access to vim |Tuple| type. - Supports `.locked` attribute, see |python-.locked|. Also supports the - following methods: - Method Description ~ - __new__(), __new__(iterable) - You can use `vim.Tuple()` to create new vim tuples. - Without arguments constructs empty list. - Examples: > - t = vim.Tuple("abc") # Constructor, result: ('a', 'b', 'c') - print t[1:] # slicing - print t[0] # getting item - for i in t: # iteration - print isinstance(t, vim.Tuple) # True - class Tuple(vim.Tuple): # Subclassing - vim.Function object *python-Function* Function-like object, acting like vim |Funcref| object. Accepts special keyword argument `self`, see |Dictionary-function|. You can also use diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index f3d92b29..5c0ebcf2 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 9.1. Last change: 2025 May 08 +*insert.txt* For Vim version 9.1. Last change: 2025 Mar 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1167,9 +1167,6 @@ For example, the function can contain this: > let matches = ... list of words ... return {'words': matches, 'refresh': 'always'} < -If looking for matches is time-consuming, |complete_check()| may be used to -maintain responsiveness. - *complete-items* Each list item can either be a string or a Dictionary. When it is a string it is used as the completion. When it is a Dictionary it can contain these @@ -1347,7 +1344,6 @@ use all space available. The 'pumwidth' option can be used to set a minimum width. The default is 15 characters. - *compl-states* There are three states: 1. A complete match has been inserted, e.g., after using CTRL-N or CTRL-P. 2. A cursor key has been used to select another match. The match was not diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 726d15dd..4e57797a 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 9.1. Last change: 2025 Apr 03 +*motion.txt* For Vim version 9.1. Last change: 2024 Dec 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -895,12 +895,12 @@ Numbered mark should be stored. See |viminfo-file-marks|. *'[* *`[* -'[ `[ To the first character of the previously changed, - or yanked text. Also set when writing the buffer. +'[ `[ To the first character of the previously changed + or yanked text. *']* *`]* '] `] To the last character of the previously changed or - yanked text. Also set when writing the buffer. + yanked text. After executing an operator the Cursor is put at the beginning of the text that was operated upon. After a put command ("p" or "P") the cursor is diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 5563a052..a8245362 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 May 10 +*options.txt* For Vim version 9.1. Last change: 2025 Mar 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -212,7 +212,7 @@ A few examples: > :set makeprg=make,file results in "make,file" :set makeprg=make\\,file results in "make\,file" :set tags=tags,file results in "tags" and "file" - :set tags=tags\\,file results in "tags\,file" + :set tags=tags\\,file results in "tags,file" :let &tags='tags\,file' (same as above) The "|" character separates a ":set" command from a following command. To @@ -1717,19 +1717,6 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. - *'chistory'* *'chi'* -'chistory' 'chi' number (default: 10) - global - {only available when compiled with the |+quickfix| - feature} - Number of quickfix lists that should be remembered for the quickfix - stack. Must be between 1 and 100. If the option is set to a value - that is lower than the amount of entries in the quickfix list stack, - entries will be removed starting from the oldest one. If the current - quickfix list was removed, then the quickfix list at top of the stack - (the most recently created) will be used in its place. For additional - info, see |quickfix-stack|. - *'cindent'* *'cin'* *'nocindent'* *'nocin'* 'cindent' 'cin' boolean (default off) local to buffer @@ -2085,28 +2072,6 @@ A jump table for the options with a short description can be found at |Q_op|. |i_CTRL-X_CTRL-D| ] tag completion t same as "]" - f{func} call the function {func}. Multiple "f" flags may be specified. - Refer to |complete-functions| for details on how the function - is invoked and what it should return. The value can be the - name of a function or a |Funcref|. For |Funcref| values, - spaces must be escaped with a backslash ('\'), and commas with - double backslashes ('\\') (see |option-backslash|). - If the Dict returned by the {func} includes {"refresh": "always"}, - the function will be invoked again whenever the leading text - changes. - Completion matches are always inserted at the keyword - boundary, regardless of the column returned by {func} when - a:findstart is 1. This ensures compatibility with other - completion sources. - To make further modifications to the inserted text, {func} - can make use of |CompleteDonePre|. - If generating matches is potentially slow, |complete_check()| - should be used to avoid blocking and preserve editor - responsiveness. - f equivalent to using "f{func}", where the function is taken from - the 'completefunc' option. - o equivalent to using "f{func}", where the function is taken from - the 'omnifunc' option. Unloaded buffers are not loaded, thus their autocmds |:autocmd| are not executed, this may lead to unexpected completions from some files @@ -2125,13 +2090,6 @@ A jump table for the options with a short description can be found at |Q_op|. based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). - An optional match limit can be specified for a completion source by - appending a caret ("^") followed by a {count} to the source flag. - For example: ".^9,w,u,t^5" limits matches from the current buffer - to 9 and from tags to 5. Other sources remain unlimited. - Note: The match limit takes effect only during forward completion - (CTRL-N) and is ignored during backward completion (CTRL-P). - *'completefunc'* *'cfu'* 'completefunc' 'cfu' string (default: empty) local to buffer @@ -2208,12 +2166,6 @@ A jump table for the options with a short description can be found at |Q_op|. Useful when there is additional information about the match, e.g., what file it comes from. - nearest Matches are listed based on their proximity to the cursor - position, unlike the default behavior, which only - considers proximity for matches appearing below the - cursor. This applies only to matches from the current - buffer. No effect if "fuzzy" is present. - noinsert Do not insert any text for a match until the user selects a match from the menu. Only works in combination with "menu" or "menuone". No effect if "longest" is present. @@ -2703,7 +2655,7 @@ A jump table for the options with a short description can be found at |Q_op|. *E1193* *E1194* *E1195* *E1196* *E1230* *E1197* *E1198* *E1199* *E1200* *E1201* xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication - Code. Medium strong to strong encryption. + Code. Medium strong till strong encryption. Encryption is provided by the libsodium library, it requires Vim to be built with |+sodium|. It adds a seed and a message authentication code (MAC) @@ -2958,8 +2910,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'dip'* *'diffopt'* -'diffopt' 'dip' string (default - "internal,filler,closeoff,inline:simple") +'diffopt' 'dip' string (default "internal,filler,closeoff") global {not available when compiled without the |+diff| feature} @@ -3024,24 +2975,6 @@ A jump table for the options with a short description can be found at |Q_op|. Use the indent heuristic for the internal diff library. - inline:{text} Highlight inline differences within a change. - See |view-diffs|. Supported values are: - - none Do not perform inline highlighting. - simple Highlight from first different - character to the last one in each - line. This is the default if no - `inline:` value is set. - char Use internal diff to perform a - character-wise diff and highlight the - difference. - word Use internal diff to perform a - |word|-wise diff and highlight the - difference. Non-alphanumeric - multi-byte characters such as emoji - and CJK characters are considered - individual words. - internal Use the internal diff library. This is ignored when 'diffexpr' is set. *E960* When running out of memory when writing a @@ -3638,8 +3571,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'fillchars'* *'fcs'* 'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@") global or local to window |global-local| - Characters to fill the statuslines, vertical separators, special - lines in the window and truncated text in the |ins-completion-menu|. + Characters to fill the statuslines, vertical separators and special + lines in the window. It is a comma-separated list of items. Each item has a name, a colon and the value of that item: |E1511| @@ -3654,17 +3587,15 @@ A jump table for the options with a short description can be found at |Q_op|. diff '-' deleted lines of the 'diff' option eob '~' empty lines below the end of a buffer lastline '@' 'display' contains lastline/truncate - trunc '>' truncated text in the - |ins-completion-menu|. - truncrl '<' same as "trunc" in 'rightleft' mode Any one that is omitted will fall back to the default. Example: > :set fillchars=stl:\ ,stlnc:\ ,vert:\|,fold:-,diff:- < - All items support single-byte and multibyte characters. But - double-width characters are not supported. |E1512| + For the "stl", "stlnc", "foldopen", "foldclose" and "foldsep" items + single-byte and multibyte characters are supported. But double-width + characters are not supported. |E1512| The highlighting used for these items: item name highlight group ~ @@ -3672,15 +3603,9 @@ A jump table for the options with a short description can be found at |Q_op|. stlnc StatusLineNC |hl-StatusLineNC| vert VertSplit |hl-VertSplit| fold Folded |hl-Folded| - foldopen FoldColumn |hl-FoldColumn| - foldclose FoldColumn |hl-FoldColumn| - foldsep FoldColumn |hl-FoldColumn| diff DiffDelete |hl-DiffDelete| eob EndOfBuffer |hl-EndOfBuffer| lastline NonText |hl-NonText| - trunc one of the many Popup menu highlighting groups like - |hl-PmenuSel| - truncrl same as "trunc" *'findfunc'* *'ffu'* *E1514* 'findfunc' 'ffu' string (default empty) @@ -4467,10 +4392,10 @@ A jump table for the options with a short description can be found at |Q_op|. v:Visual,V:VisualNOS,w:WarningMsg, W:WildMenu,f:Folded,F:FoldColumn, A:DiffAdd,C:DiffChange,D:DiffDelete, - T:DiffText,E:DiffTextAdd,>:SignColumn, - -:Conceal,B:SpellBad,P:SpellCap, - R:SpellRare, L:SpellLocal,+:Pmenu, - =:PmenuSel, k:PmenuMatch,<:PmenuMatchSel, + T:DiffText,>:SignColumn,-:Conceal, + B:SpellBad,P:SpellCap,R:SpellRare, + L:SpellLocal,+:Pmenu,=:PmenuSel, + k:PmenuMatch,<:PmenuMatchSel, [:PmenuKind,]:PmenuKindSel, {:PmenuExtra,}:PmenuExtraSel, x:PmenuSbar,X:PmenuThumb,*:TabLine, @@ -4522,8 +4447,7 @@ A jump table for the options with a short description can be found at |Q_op|. |hl-DiffAdd| A added line in diff mode |hl-DiffChange| C changed line in diff mode |hl-DiffDelete| D deleted line in diff mode - |hl-DiffText| T changed text in diff mode - |hl-DiffTextAdd| E inserted text in diff mode + |hl-DiffText| T inserted text in diff mode |hl-SignColumn| > column used for |signs| |hl-Conceal| - the placeholders used for concealed characters (see 'conceallevel') @@ -4844,7 +4768,7 @@ A jump table for the options with a short description can be found at |Q_op|. < Also used for the |gf| command if an unmodified file name can't be found. Allows doing "gf" on the name after an 'include' statement. - Note: Not used for ||. + Also used for ||. If the expression starts with s: or ||, then it is replaced with the script ID (|local-function|). Example: > @@ -4982,23 +4906,6 @@ A jump table for the options with a short description can be found at |Q_op|. and there is a letter before it, the completed part is made uppercase. With 'noinfercase' the match is used as-is. - *'isexpand'* *'ise'* -'isexpand' 'ise' string (default: "") - local to buffer - Defines characters and patterns for completion in insert mode. Used - by the |complete_match()| function to determine the starting position - for completion. This is a comma-separated list of triggers. Each - trigger can be: - - A single character like "." or "/" - - A sequence of characters like "->", "/*", or "/**" - - Note: Use "\\," to add a literal comma as trigger character, see - |option-backslash|. - - Examples: > - set isexpand=.,->,/*,\\, -< - *'insertmode'* *'im'* *'noinsertmode'* *'noim'* 'insertmode' 'im' boolean (default off) global @@ -5389,18 +5296,6 @@ A jump table for the options with a short description can be found at |Q_op|. temporarily when performing an operation where redrawing may cause flickering or cause a slowdown. - *'lhistory'* *'lhi'* -'lhistory' 'lhi' number (default: 10) - local to window - {only available when compiled with the |+quickfix| - feature} - Like 'chistory', but for the location list stack associated with a - window. If the option is changed in either the location list window - itself or the window that is associated with the location list stack, - the new value will also be applied to the other one. This means this - value will always be the same for a given location list window and its - corresponding window. See |quickfix-stack| for additional info. - *'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'* 'linebreak' 'lbr' boolean (default off) local to window @@ -6037,7 +5932,7 @@ A jump table for the options with a short description can be found at |Q_op|. feature} This option tells Vim what the mouse pointer should look like in different modes. The option is a comma-separated list of parts, much - like used for 'guicursor'. Each part consists of a mode/location-list + like used for 'guicursor'. Each part consist of a mode/location-list and an argument-list: mode-list:shape,mode-list:shape,.. The mode-list is a dash separated list of these modes/locations: @@ -6065,26 +5960,26 @@ A jump table for the options with a short description can be found at |Q_op|. The shape is one of the following: avail name looks like ~ - w x g arrow Normal mouse pointer - w x blank no pointer at all (use with care!) - w x g beam I-beam - w x g updown up-down sizing arrows - w x g leftright left-right sizing arrows - w x g busy The system's usual busy pointer - w x g no The system's usual 'no input' pointer - x g udsizing indicates up-down resizing - x g lrsizing indicates left-right resizing - x g crosshair like a big thin + - x g hand1 black hand - x g hand2 white hand - x pencil what you write with - x g question big ? - x rightup-arrow arrow pointing right-up - w x up-arrow arrow pointing up + w x arrow Normal mouse pointer + w x blank no pointer at all (use with care!) + w x beam I-beam + w x updown up-down sizing arrows + w x leftright left-right sizing arrows + w x busy The system's usual busy pointer + w x no The system's usual 'no input' pointer + x udsizing indicates up-down resizing + x lrsizing indicates left-right resizing + x crosshair like a big thin + + x hand1 black hand + x hand2 white hand + x pencil what you write with + x question big ? + x rightup-arrow arrow pointing right-up + w x up-arrow arrow pointing up x any X11 pointer number (see X11/cursorfont.h) The "avail" column contains a 'w' if the shape is available for Win32, - x for X11 (including GTK+ 2), g for GTK+ 3. + x for X11. Any modes not specified or shapes not available use the normal mouse pointer. @@ -6564,17 +6459,6 @@ A jump table for the options with a short description can be found at |Q_op|. global Determines the maximum number of items to show in the popup menu for Insert mode completion. When zero as much space as available is used. - |ins-completion-menu|. - - *'pummaxwidth'* *'pmw'* -'pummaxwidth' 'pmw' number (default 0) - global - Determines the maximum width to use for the popup menu for completion. - When zero, there is no maximum width limit, otherwise the popup menu - will never be wider than this value. Truncated text will be indicated - by "trunc" value of 'fillchars' option. - - This option takes precedence over 'pumwidth'. |ins-completion-menu|. *'pumwidth'* *'pw'* @@ -7741,11 +7625,9 @@ A jump table for the options with a short description can be found at |Q_op|. Override the 'ignorecase' option if the search pattern contains upper case characters. Only used when the search pattern is typed and 'ignorecase' option is on. Used for the commands "/", "?", "n", "N", - ":g" and ":s" and when filtering matches for the completion menu - |compl-states|. - Not used for "*", "#", "gd", tag search, etc. After "*" and "#" you - can make 'smartcase' used by doing a "/" command, recalling the search - pattern from history and hitting . + ":g" and ":s". Not used for "*", "#", "gd", tag search, etc. After + "*" and "#" you can make 'smartcase' used by doing a "/" command, + recalling the search pattern from history and hitting . NOTE: This option is reset when 'compatible' is set. *'smartindent'* *'si'* *'nosmartindent'* *'nosi'* @@ -8522,8 +8404,7 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer {not available when compiled without the |+eval| feature} - This option specifies a function to be used to perform tag searches - (including |taglist()|). + This option specifies a function to be used to perform tag searches. The function gets the tag pattern and should return a List of matching tags. See |tag-function| for an explanation of how to write the function and an example. The value can be the name of a function, a @@ -9694,65 +9575,55 @@ A jump table for the options with a short description can be found at |Q_op|. *'wildmode'* *'wim'* 'wildmode' 'wim' string (Vim default: "full") global - Completion mode used for the character specified with 'wildchar'. - This option is a comma-separated list of up to four parts, - corresponding to the first, second, third, and fourth presses of - 'wildchar'. Each part is a colon-separated list of completion - behaviors, which are applied simultaneously during that phase. - - The possible behavior values are: - "" Only complete (insert) the first match. No further - matches are cycled or listed. - "full" Complete the next full match. Cycles through all - matches, returning to the original input after the - last match. If 'wildmenu' is enabled, it will be - shown. - "longest" Complete to the longest common substring. If this - doesn't extend the input, the next 'wildmode' part is - used. - "list" If multiple matches are found, list all of them. - "lastused" When completing buffer names, sort them by most - recently used (excluding the current buffer). Only - applies to buffer name completion. - "noselect" If 'wildmenu' is enabled, show the menu but do not - preselect the first item. - If only one match exists, it is completed fully, unless "noselect" is - specified. - - Some useful combinations of colon-separated values: - "longest:full" Start with the longest common string and show - 'wildmenu' (if enabled). Does not cycle - through full matches. - "list:full" List all matches and complete first match. - "list:longest" List all matches and complete till the longest - common prefix. - "list:lastused" List all matches. When completing buffers, - sort them by most recently used (excluding the - current buffer). - "noselect:lastused" Do not preselect the first item in 'wildmenu' - if it is active. When completing buffers, - sort them by most recently used (excluding the - current buffer). + Completion mode that is used for the character specified with + 'wildchar'. It is a comma-separated list of up to four parts. Each + part specifies what to do for each consecutive use of 'wildchar'. The + first part specifies the behavior for the first use of 'wildchar', + The second part for the second use, etc. + + Each part consists of a colon separated list consisting of the + following possible values: + "" Complete only the first match. + "full" Complete the next full match. After the last match, + the original string is used and then the first match + again. Will also start 'wildmenu' if it is enabled. + "longest" Complete till longest common string. If this doesn't + result in a longer string, use the next part. + "list" When more than one match, list all matches. + "lastused" When completing buffer names and more than one buffer + matches, sort buffers by time last used (other than + the current buffer). + "noselect" Do not pre-select first menu item and start 'wildmenu' + if it is enabled. + When there is only a single match, it is fully completed in all cases + except when "noselect" is present. + + Examples of useful colon-separated values: + "longest:full" Like "longest", but also start 'wildmenu' if it is + enabled. Will not complete to the next full match. + "list:full" When more than one match, list all matches and + complete first match. + "list:longest" When more than one match, list all matches and + complete till longest common string. + "list:lastused" When more than one buffer matches, list all matches + and sort buffers by time last used (other than the + current buffer). Examples: > :set wildmode=full -< Complete full match on every press (default behavior) > +< Complete first full match, next match, etc. (the default) > :set wildmode=longest,full -< First press: longest common substring - Second press: cycle through full matches > +< Complete longest common string, then each full match > :set wildmode=list:full -< First press: list all matches and complete the first one > +< List all matches and complete each full match > :set wildmode=list,full -< First press: list matches only - Second press: complete full matches > +< List all matches without completing, then each full match > :set wildmode=longest,list -< First press: longest common substring - Second press: list all matches > +< Complete longest common string, then list alternatives > :set wildmode=noselect:full -< First press: show 'wildmenu' without completing or selecting - Second press: cycle full matches > +< Display 'wildmenu' without completing, then each full match > :set wildmode=noselect:lastused,full -< Same as above, but buffer matches are sorted by time last used +< Same as above, but sort buffers by time last used. More info here: |cmdline-completion|. *'wildoptions'* *'wop'* diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 857a3e64..f11040c4 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 9.1. Last change: 2025 Mar 28 +*pattern.txt* For Vim version 9.1. Last change: 2025 Mar 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1222,8 +1222,7 @@ x A single character, with no special meaning, matches itself \o40 octal number of character up to 0o377 \x20 hexadecimal number of character up to 0xff \u20AC hex. number of multibyte character up to 0xffff - \U1234 hex. number of multibyte character up to 8 characters - 0xffffffff |E1541| + \U1234 hex. number of multibyte character up to 0xffffffff NOTE: The other backslash codes mentioned above do not work inside []! - Matching with a collection can be slow, because each character in @@ -1264,8 +1263,7 @@ x A single character, with no special meaning, matches itself \%u20AC Matches the character specified with up to four hexadecimal characters. \%U1234abcd Matches the character specified with up to eight hexadecimal - characters, up to 0x7fffffff (the maximum allowed value is INT_MAX - |E1541|, but the maximum valid Unicode codepoint is U+10FFFF). + characters, up to 0x7fffffff ============================================================================== 7. Ignoring case in a pattern */ignorecase* diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt index e549ea64..20caab1e 100644 --- a/runtime/doc/pi_getscript.txt +++ b/runtime/doc/pi_getscript.txt @@ -1,4 +1,4 @@ -*pi_getscript.txt* For Vim version 9.1. Last change: 2025 Apr 27 +*pi_getscript.txt* For Vim version 9.1. Last change: 2025 Mar 15 > GETSCRIPT REFERENCE MANUAL by Charles E. Campbell < @@ -156,7 +156,7 @@ may have. As an example, consider: > " GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim -This comment line tells getscript.vim to check Vim script #884 and that the +This comment line tells getscript.vim to check vimscript #884 and that the script is automatically installable. Getscript will also use this line to help build the GetLatestVimScripts.dat file, by including a line such as: > diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 00799911..f6cc0ddb 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*netrw.txt* *pi_netrw.txt* +*netrw.txt* ------------------------------------------------ NETRW REFERENCE MANUAL by Charles E. Campbell @@ -431,6 +431,17 @@ settings are described below, in |netrw-browser-options|, and in *g:netrw_silent* =0 : transfers done normally =1 : transfers done silently + *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window + Move the mouse and pause to remove the popup window. + (default value if popup windows are available) + =1 : messages from netrw will use a separate one + line window. This window provides reliable + delivery of messages. + (default value if popup windows are not available) + =0 : messages from netrw will use echoerr ; + messages don't always seem to show up this + way, but one doesn't have to quit the window. + *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also permits network browsing to use ls with time and size sorting (default if windows) @@ -460,7 +471,7 @@ file using root-relative paths, use the full path: ============================================================================== 4. Network-Oriented File Transfer *netrw-xfer* {{{1 -Network-oriented file transfer under Vim is implemented by a Vim script +Network-oriented file transfer under Vim is implemented by a vim script () using plugin techniques. It currently supports both reading and writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, dav/cadaver, rsync, or sftp. diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt index 6d49928d..5b317d60 100644 --- a/runtime/doc/pi_tar.txt +++ b/runtime/doc/pi_tar.txt @@ -1,4 +1,4 @@ -*pi_tar.txt* For Vim version 9.1. Last change: 2025 Mar 16 +*pi_tar.txt* For Vim version 9.1. Last change: 2024 May 11 +====================+ | Tar File Interface | @@ -74,15 +74,6 @@ Copyright 2005-2017: *tar-copyright* let g:loaded_tarPlugin= 1 let g:loaded_tar = 1 < - *tar-mappings* - MAPPINGS~ - - The following (buffer-local) mappings are available in a tar buffer: - - Open selected file for editing, any changes will be - written back to the archive. - same as - x Extract selected file. ============================================================================== 3. Options *tar-options* diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index afc2d0ee..2e98becf 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -1,4 +1,4 @@ -*pi_zip.txt* For Vim version 9.1. Last change: 2025 Apr 02 +*pi_zip.txt* For Vim version 9.1. Last change: 2023 Nov 05 +====================+ | Zip File Interface | @@ -100,14 +100,12 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright* should be treated as zip files. Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc. - Currently (as of April 2025) it holds: > - - let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx, - \ *.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz, - \ *.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf, - \ *.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam, - \ *.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.whl,*.wsz, - \ *.xap,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip' + Currently (11/30/15) it holds: > + + let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip, + \ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm, + \ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm, + \ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub' ============================================================================== 4. History *zip-history* {{{1 diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index a9a43fed..91e48637 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2025 Apr 06 +*quickfix.txt* For Vim version 9.1. Last change: 2025 Mar 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -43,12 +43,12 @@ From inside Vim an easy way to run a command and handle the output is with the The 'errorformat' option should be set to match the error messages from your compiler (see |errorformat| below). - *quickfix-stack* *quickfix-ID* + *quickfix-ID* Each quickfix list has a unique identifier called the quickfix ID and this number will not change within a Vim session. The |getqflist()| function can be used to get the identifier assigned to a list. There is also a quickfix list -number which may change whenever more than 'chistory' lists are added to a -quickfix stack. +number which may change whenever more than ten lists are added to a quickfix +stack. *location-list* *E776* A location list is a window-local quickfix list. You get one after commands @@ -860,12 +860,10 @@ using these functions are below: ============================================================================= 3. Using more than one list of errors *quickfix-error-lists* -So far it has been assumed that there is only one list of errors. Actually -there can be multiple used lists that are remembered; see 'chistory' and -'lhistory'. -When starting a new list, the previous ones are automatically kept. Two -commands can be used to access older error lists. They set one of the -existing error lists as the current one. +So far has been assumed that there is only one list of errors. Actually the +ten last used lists are remembered. When starting a new list, the previous +ones are automatically kept. Two commands can be used to access older error +lists. They set one of the existing error lists as the current one. *:colder* *:col* *E380* :col[der] [count] Go to older error list. When [count] is given, do diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 349c1af8..87764a29 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 9.1. Last change: 2025 Apr 06 +*quickref.txt* For Vim version 9.1. Last change: 2025 Feb 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -639,7 +639,6 @@ Short explanation of each option: *option-list* 'cdpath' 'cd' list of directories searched with ":cd" 'cedit' key used to open the command-line window 'charconvert' 'ccv' expression for character encoding conversion -'chistory' 'chi' maximum number of quickfix lists in history 'cindent' 'cin' do C program indenting 'cinkeys' 'cink' keys that trigger indent when 'cindent' is set 'cinoptions' 'cino' how to do indenting when 'cindent' is set @@ -787,7 +786,6 @@ Short explanation of each option: *option-list* 'langremap' 'lrm' do apply 'langmap' to mapped characters 'laststatus' 'ls' tells when last window has status lines 'lazyredraw' 'lz' don't redraw while executing macros -'lhistory' 'lhi' maximum number of location lists in history 'linebreak' 'lbr' wrap long lines at a blank 'lines' number of lines in the display 'linespace' 'lsp' number of pixel lines to use between characters diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index ed728301..fe6865e1 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 28 +*syntax.txt* For Vim version 9.1. Last change: 2025 Mar 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1056,12 +1056,8 @@ Variable Highlight ~ *c_ansi_typedefs* ... but do standard ANSI types *c_ansi_constants* ... but do standard ANSI constants *c_no_utf* don't highlight \u and \U in strings -*c_syntax_for_h* use C syntax for *.h files instead of C++/ObjC/ObjC++ - (NOTE: This variable is deprecated and no longer - necessary, as *.h files now default to C, unless the - file contains C++ or Objective-C syntax. If the - automated detection fails, the default filetype can - be adjusted using `g:filetype_h`.) +*c_syntax_for_h* for *.h files use C syntax instead of C++ and use objc + syntax instead of objcpp *c_no_if0* don't highlight "#if 0" blocks as comments *c_no_cformat* don't highlight %-formats in strings *c_no_c99* don't highlight C99 standard items @@ -1120,12 +1116,9 @@ the C syntax file. See |c.vim| for all the settings that are available for C. By setting a variable you can tell Vim to use Ch syntax for *.h files, instead of C or C++: > - :let g:filetype_h = 'ch' - -NOTE: In previous versions of Vim, the following (now-deprecated) variable was -used, but is no longer the preferred approach: > :let ch_syntax_for_h = 1 + CHILL *chill.vim* *ft-chill-syntax* Chill syntax highlighting is similar to C. See |c.vim| for all the settings @@ -2175,13 +2168,6 @@ line for any comments written in this way, and showing the contents of a first line otherwise, with > :let g:java_foldtext_show_first_or_second_line = 1 -HTML tags in Javadoc comments can additionally be folded by following the -instructions listed under |html-folding| and giving explicit consent with > - :let g:java_consent_to_html_syntax_folding = 1 -Do not default to this kind of folding unless ALL start tags and optional end -tags are balanced in Javadoc comments; otherwise, put up with creating runaway -folds that break syntax highlighting. - Trailing whitespace characters or a run of space characters before a tab character can be marked as an error with > :let g:java_space_errors = 1 @@ -2216,12 +2202,12 @@ cycles for such a feature to become either integrated into the platform or withdrawn from this effort. To cater for early adopters, there is optional support in Vim for syntax related preview features that are implemented. You can request it by specifying a list of preview feature numbers as follows: > - :let g:java_syntax_previews = [488, 494] + :let g:java_syntax_previews = [455, 476] The supported JEP numbers are to be drawn from this table: `430`: String Templates [JDK 21] - `488`: Primitive types in Patterns, instanceof, and switch - `494`: Module Import Declarations + `455`: Primitive types in Patterns, instanceof, and switch + `476`: Module Import Declarations Note that as soon as the particular preview feature will have been integrated into the Java platform, its entry will be removed from the table and related @@ -2407,16 +2393,11 @@ Comments are also highlighted by default. You can turn this off by using: > :let make_no_comments = 1 -There are various Make implementations, which add extensions other than the -POSIX specification and thus are mutually incompatible. If the filename is -BSDmakefile or GNUmakefile, the corresponding implementation is automatically -determined; otherwise vim tries to detect it by the file contents. If you see -any wrong highlights because of this, you can enforce a flavor by setting one -of the following: > +Microsoft Makefile handles variable expansion and comments differently +(backslashes are not used for escape). If you see any wrong highlights +because of this, you can try this: > - :let g:make_flavor = 'bsd' " or - :let g:make_flavor = 'gnu' " or - :let g:make_flavor = 'microsoft' + :let make_microsoft = 1 MAPLE *maple.vim* *ft-maple-syntax* @@ -2470,12 +2451,6 @@ have the following in your .vimrc: > let filetype_m = "mma" -MBSYNC *mbsync.vim* *ft-mbsync-syntax* - -The mbsync application uses a configuration file to setup mailboxes names, -user and password. All files ending with `.mbsyncrc` or with the name -`isyncrc` will be recognized as mbsync configuration files. - MEDIAWIKI *ft-mediawiki-syntax* By default, syntax highlighting includes basic HTML tags like style and @@ -5857,9 +5832,6 @@ DiffChange Diff mode: Changed line. |diff.txt| DiffDelete Diff mode: Deleted line. |diff.txt| *hl-DiffText* DiffText Diff mode: Changed text within a changed line. |diff.txt| - *hl-DiffTextAdd* -DiffTextAdd Diff mode: Added text within a changed line. Linked to - |hl-DiffText| by default. |diff.txt| *hl-EndOfBuffer* EndOfBuffer Filler lines (~) after the last line in the buffer. By default, this is highlighted like |hl-NonText|. diff --git a/runtime/doc/tags b/runtime/doc/tags index b820c960..1eebe14b 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -134,8 +134,6 @@ $quote eval.txt /*$quote* 'ch' options.txt /*'ch'* 'character' intro.txt /*'character'* 'charconvert' options.txt /*'charconvert'* -'chi' options.txt /*'chi'* -'chistory' options.txt /*'chistory'* 'ci' options.txt /*'ci'* 'cia' options.txt /*'cia'* 'cin' options.txt /*'cin'* @@ -436,8 +434,6 @@ $quote eval.txt /*$quote* 'infercase' options.txt /*'infercase'* 'insertmode' options.txt /*'insertmode'* 'is' options.txt /*'is'* -'ise' options.txt /*'ise'* -'isexpand' options.txt /*'isexpand'* 'isf' options.txt /*'isf'* 'isfname' options.txt /*'isfname'* 'isi' options.txt /*'isi'* @@ -467,8 +463,6 @@ $quote eval.txt /*$quote* 'lazyredraw' options.txt /*'lazyredraw'* 'lbr' options.txt /*'lbr'* 'lcs' options.txt /*'lcs'* -'lhi' options.txt /*'lhi'* -'lhistory' options.txt /*'lhistory'* 'linebreak' options.txt /*'linebreak'* 'lines' options.txt /*'lines'* 'linespace' options.txt /*'linespace'* @@ -849,7 +843,6 @@ $quote eval.txt /*$quote* 'pm' options.txt /*'pm'* 'pmbcs' options.txt /*'pmbcs'* 'pmbfn' options.txt /*'pmbfn'* -'pmw' options.txt /*'pmw'* 'popt' options.txt /*'popt'* 'pp' options.txt /*'pp'* 'preserveindent' options.txt /*'preserveindent'* @@ -867,7 +860,6 @@ $quote eval.txt /*$quote* 'prompt' options.txt /*'prompt'* 'pt' options.txt /*'pt'* 'pumheight' options.txt /*'pumheight'* -'pummaxwidth' options.txt /*'pummaxwidth'* 'pumwidth' options.txt /*'pumwidth'* 'pvh' options.txt /*'pvh'* 'pvp' options.txt /*'pvp'* @@ -2194,7 +2186,6 @@ $quote eval.txt /*$quote* :TermdebugCommand terminal.txt /*:TermdebugCommand* :Texplore pi_netrw.txt /*:Texplore* :Tutor pi_tutor.txt /*:Tutor* -:URLOpen eval.txt /*:URLOpen* :Until terminal.txt /*:Until* :Up terminal.txt /*:Up* :UseVimball pi_vimball.txt /*:UseVimball* @@ -4081,7 +4072,6 @@ Cmdline-mode cmdline.txt /*Cmdline-mode* CmdlineChanged autocmd.txt /*CmdlineChanged* CmdlineEnter autocmd.txt /*CmdlineEnter* CmdlineLeave autocmd.txt /*CmdlineLeave* -CmdlineLeavePre autocmd.txt /*CmdlineLeavePre* CmdwinEnter autocmd.txt /*CmdwinEnter* CmdwinLeave autocmd.txt /*CmdwinLeave* ColorScheme autocmd.txt /*ColorScheme* @@ -4602,34 +4592,9 @@ E1513 message.txt /*E1513* E1514 options.txt /*E1514* E1515 builtin.txt /*E1515* E1516 builtin.txt /*E1516* -E1517 eval.txt /*E1517* -E1518 eval.txt /*E1518* -E1519 eval.txt /*E1519* E152 helphelp.txt /*E152* -E1520 eval.txt /*E1520* -E1521 eval.txt /*E1521* -E1522 eval.txt /*E1522* -E1523 eval.txt /*E1523* -E1524 eval.txt /*E1524* -E1525 builtin.txt /*E1525* -E1526 eval.txt /*E1526* -E1527 eval.txt /*E1527* -E1528 vim9.txt /*E1528* -E1529 vim9.txt /*E1529* E153 helphelp.txt /*E153* -E1530 vim9.txt /*E1530* -E1531 vim9.txt /*E1531* -E1532 eval.txt /*E1532* -E1533 eval.txt /*E1533* -E1534 vim9.txt /*E1534* -E1535 eval.txt /*E1535* -E1536 eval.txt /*E1536* -E1537 eval.txt /*E1537* -E1538 eval.txt /*E1538* -E1539 vim9.txt /*E1539* E154 helphelp.txt /*E154* -E1540 eval.txt /*E1540* -E1541 vi_diff.txt /*E1541* E155 sign.txt /*E155* E156 sign.txt /*E156* E157 sign.txt /*E157* @@ -5820,8 +5785,6 @@ TextChangedP autocmd.txt /*TextChangedP* TextChangedT autocmd.txt /*TextChangedT* TextYankPost autocmd.txt /*TextYankPost* Transact-SQL ft_sql.txt /*Transact-SQL* -Tuple eval.txt /*Tuple* -Tuples eval.txt /*Tuples* U undo.txt /*U* UTF-8 mbyte.txt /*UTF-8* UTF8-xterm mbyte.txt /*UTF8-xterm* @@ -6571,7 +6534,6 @@ close_cb channel.txt /*close_cb* closure eval.txt /*closure* cmdarg-variable eval.txt /*cmdarg-variable* cmdbang-variable eval.txt /*cmdbang-variable* -cmdcomplete_info() builtin.txt /*cmdcomplete_info()* cmdline-arguments vi_diff.txt /*cmdline-arguments* cmdline-changed version5.txt /*cmdline-changed* cmdline-completion cmdline.txt /*cmdline-completion* @@ -6645,7 +6607,6 @@ compl-keyword insert.txt /*compl-keyword* compl-omni insert.txt /*compl-omni* compl-omni-filetypes insert.txt /*compl-omni-filetypes* compl-spelling insert.txt /*compl-spelling* -compl-states insert.txt /*compl-states* compl-stop insert.txt /*compl-stop* compl-tag insert.txt /*compl-tag* compl-thesaurus insert.txt /*compl-thesaurus* @@ -6666,7 +6627,6 @@ complete_add() builtin.txt /*complete_add()* complete_check() builtin.txt /*complete_check()* complete_info() builtin.txt /*complete_info()* complete_info_mode builtin.txt /*complete_info_mode* -complete_match() builtin.txt /*complete_match()* completed_item-variable eval.txt /*completed_item-variable* completion-functions usr_41.txt /*completion-functions* complex-change change.txt /*complex-change* @@ -7394,17 +7354,14 @@ ft-fvwm-syntax syntax.txt /*ft-fvwm-syntax* ft-gdscript-plugin filetype.txt /*ft-gdscript-plugin* ft-gitcommit-plugin filetype.txt /*ft-gitcommit-plugin* ft-gitrebase-plugin filetype.txt /*ft-gitrebase-plugin* -ft-gleam-plugin filetype.txt /*ft-gleam-plugin* ft-go-plugin filetype.txt /*ft-go-plugin* ft-gprof-plugin filetype.txt /*ft-gprof-plugin* ft-groff-syntax syntax.txt /*ft-groff-syntax* ft-gsp-syntax syntax.txt /*ft-gsp-syntax* ft-hare filetype.txt /*ft-hare* ft-haskell-syntax syntax.txt /*ft-haskell-syntax* -ft-help-omni helphelp.txt /*ft-help-omni* ft-html-indent indent.txt /*ft-html-indent* ft-html-omni insert.txt /*ft-html-omni* -ft-html-plugin filetype.txt /*ft-html-plugin* ft-html-syntax syntax.txt /*ft-html-syntax* ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax* ft-ia64-syntax syntax.txt /*ft-ia64-syntax* @@ -7438,7 +7395,6 @@ ft-markdown-syntax syntax.txt /*ft-markdown-syntax* ft-masm-syntax syntax.txt /*ft-masm-syntax* ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax* ft-matlab-indent indent.txt /*ft-matlab-indent* -ft-mbsync-syntax syntax.txt /*ft-mbsync-syntax* ft-mediawiki-syntax syntax.txt /*ft-mediawiki-syntax* ft-metafont ft_mp.txt /*ft-metafont* ft-metafont-intro ft_mp.txt /*ft-metafont-intro* @@ -7536,7 +7492,6 @@ ft-xml-omni insert.txt /*ft-xml-omni* ft-xml-syntax syntax.txt /*ft-xml-syntax* ft-xpm-syntax syntax.txt /*ft-xpm-syntax* ft-yaml-indent indent.txt /*ft-yaml-indent* -ft-yaml-plugin filetype.txt /*ft-yaml-plugin* ft-yaml-syntax syntax.txt /*ft-yaml-syntax* ft-zig-plugin filetype.txt /*ft-zig-plugin* ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin* @@ -7776,6 +7731,7 @@ g:netrw_sshport pi_netrw.txt /*g:netrw_sshport* g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt* g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape* g:netrw_uid pi_netrw.txt /*g:netrw_uid* +g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow* g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf* g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp* g:netrw_usetab pi_netrw.txt /*g:netrw_usetab* @@ -7916,7 +7872,6 @@ get()-blob builtin.txt /*get()-blob* get()-dict builtin.txt /*get()-dict* get()-func builtin.txt /*get()-func* get()-list builtin.txt /*get()-list* -get()-tuple builtin.txt /*get()-tuple* get-ms-debuggers debug.txt /*get-ms-debuggers* getbufinfo() builtin.txt /*getbufinfo()* getbufline() builtin.txt /*getbufline()* @@ -8223,7 +8178,6 @@ hl-DiffAdd syntax.txt /*hl-DiffAdd* hl-DiffChange syntax.txt /*hl-DiffChange* hl-DiffDelete syntax.txt /*hl-DiffDelete* hl-DiffText syntax.txt /*hl-DiffText* -hl-DiffTextAdd syntax.txt /*hl-DiffTextAdd* hl-Directory syntax.txt /*hl-Directory* hl-EndOfBuffer syntax.txt /*hl-EndOfBuffer* hl-ErrorMsg syntax.txt /*hl-ErrorMsg* @@ -8604,6 +8558,7 @@ jsbterm-mouse options.txt /*jsbterm-mouse* json.vim syntax.txt /*json.vim* json_decode() builtin.txt /*json_decode()* json_encode() builtin.txt /*json_encode()* +jtags tagsrch.txt /*jtags* jump-motions motion.txt /*jump-motions* jumplist motion.txt /*jumplist* jumplist-stack motion.txt /*jumplist-stack* @@ -8697,7 +8652,6 @@ list-modification eval.txt /*list-modification* list-repeat windows.txt /*list-repeat* list2blob() builtin.txt /*list2blob()* list2str() builtin.txt /*list2str()* -list2tuple() builtin.txt /*list2tuple()* listener_add() builtin.txt /*listener_add()* listener_flush() builtin.txt /*listener_flush()* listener_remove() builtin.txt /*listener_remove()* @@ -8862,7 +8816,6 @@ matlab-indent indent.txt /*matlab-indent* matlab-indenting indent.txt /*matlab-indenting* max() builtin.txt /*max()* maxcol-variable eval.txt /*maxcol-variable* -mbsync.vim syntax.txt /*mbsync.vim* mbyte-IME mbyte.txt /*mbyte-IME* mbyte-XIM mbyte.txt /*mbyte-XIM* mbyte-combining mbyte.txt /*mbyte-combining* @@ -9463,7 +9416,6 @@ package-hlyank usr_05.txt /*package-hlyank* package-justify usr_25.txt /*package-justify* package-matchit usr_05.txt /*package-matchit* package-nohlsearch usr_05.txt /*package-nohlsearch* -package-open eval.txt /*package-open* package-termdebug terminal.txt /*package-termdebug* package-translate_example repeat.txt /*package-translate_example* package-translation repeat.txt /*package-translation* @@ -9542,7 +9494,6 @@ phtml.vim syntax.txt /*phtml.vim* pi_getscript.txt pi_getscript.txt /*pi_getscript.txt* pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_logipat.txt pi_logipat.txt /*pi_logipat.txt* -pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_tar.txt pi_tar.txt /*pi_tar.txt* @@ -9704,7 +9655,6 @@ python-2-and-3 if_pyth.txt /*python-2-and-3* python-Dictionary if_pyth.txt /*python-Dictionary* python-Function if_pyth.txt /*python-Function* python-List if_pyth.txt /*python-List* -python-Tuple if_pyth.txt /*python-Tuple* python-VIM_SPECIAL_PATH if_pyth.txt /*python-VIM_SPECIAL_PATH* python-_get_paths if_pyth.txt /*python-_get_paths* python-bindeval if_pyth.txt /*python-bindeval* @@ -9782,7 +9732,6 @@ quickfix-pandoc quickfix.txt /*quickfix-pandoc* quickfix-parse quickfix.txt /*quickfix-parse* quickfix-perl quickfix.txt /*quickfix-perl* quickfix-size quickfix.txt /*quickfix-size* -quickfix-stack quickfix.txt /*quickfix-stack* quickfix-title quickfix.txt /*quickfix-title* quickfix-valid quickfix.txt /*quickfix-valid* quickfix-window quickfix.txt /*quickfix-window* @@ -10376,7 +10325,6 @@ subscript eval.txt /*subscript* substitute() builtin.txt /*substitute()* substitute-CR version6.txt /*substitute-CR* substring eval.txt /*substring* -subtuple eval.txt /*subtuple* suffixes cmdline.txt /*suffixes* suspend starting.txt /*suspend* swap-exists-choices usr_11.txt /*swap-exists-choices* @@ -10626,7 +10574,6 @@ t_ti term.txt /*t_ti* t_tp version4.txt /*t_tp* t_ts term.txt /*t_ts* t_ts_old version4.txt /*t_ts_old* -t_tuple-variable eval.txt /*t_tuple-variable* t_typealias-variable eval.txt /*t_typealias-variable* t_u7 term.txt /*t_u7* t_ue term.txt /*t_ue* @@ -10689,7 +10636,6 @@ tar-contents pi_tar.txt /*tar-contents* tar-copyright pi_tar.txt /*tar-copyright* tar-history pi_tar.txt /*tar-history* tar-manual pi_tar.txt /*tar-manual* -tar-mappings pi_tar.txt /*tar-mappings* tar-options pi_tar.txt /*tar-options* tar-usage pi_tar.txt /*tar-usage* tcl if_tcl.txt /*tcl* @@ -10864,7 +10810,6 @@ test_null_job() testing.txt /*test_null_job()* test_null_list() testing.txt /*test_null_list()* test_null_partial() testing.txt /*test_null_partial()* test_null_string() testing.txt /*test_null_string()* -test_null_tuple() testing.txt /*test_null_tuple()* test_option_not_set() testing.txt /*test_option_not_set()* test_override() testing.txt /*test_override()* test_refcount() testing.txt /*test_refcount()* @@ -10950,14 +10895,6 @@ try-echoerr eval.txt /*try-echoerr* try-finally eval.txt /*try-finally* try-nested eval.txt /*try-nested* try-nesting eval.txt /*try-nesting* -tuple eval.txt /*tuple* -tuple-concatenation eval.txt /*tuple-concatenation* -tuple-functions usr_41.txt /*tuple-functions* -tuple-identity eval.txt /*tuple-identity* -tuple-index eval.txt /*tuple-index* -tuple-modification eval.txt /*tuple-modification* -tuple-type vim9.txt /*tuple-type* -tuple2list() builtin.txt /*tuple2list()* tutor usr_01.txt /*tutor* two-engines pattern.txt /*two-engines* type() builtin.txt /*type()* @@ -11154,7 +11091,6 @@ v:t_none eval.txt /*v:t_none* v:t_number eval.txt /*v:t_number* v:t_object eval.txt /*v:t_object* v:t_string eval.txt /*v:t_string* -v:t_tuple eval.txt /*v:t_tuple* v:t_typealias eval.txt /*v:t_typealias* v:termblinkresp eval.txt /*v:termblinkresp* v:termrbgresp eval.txt /*v:termrbgresp* @@ -11294,7 +11230,6 @@ variable-categories vim9.txt /*variable-categories* variable-scope eval.txt /*variable-scope* variable-types vim9.txt /*variable-types* variables eval.txt /*variables* -variadic-tuple vim9.txt /*variadic-tuple* various various.txt /*various* various-cmds various.txt /*various-cmds* various-functions usr_41.txt /*various-functions* @@ -11384,7 +11319,6 @@ vim-modes-intro intro.txt /*vim-modes-intro* vim-raku ft_raku.txt /*vim-raku* vim-script-intro usr_41.txt /*vim-script-intro* vim-script-library eval.txt /*vim-script-library* -vim-script-notation usr_41.txt /*vim-script-notation* vim-security intro.txt /*vim-security* vim-shebang various.txt /*vim-shebang* vim-tutor-create pi_tutor.txt /*vim-tutor-create* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 0717f2ff..858309a2 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim version 9.1. Last change: 2025 May 01 +*tagsrch.txt* For Vim version 9.1. Last change: 2024 Aug 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -526,7 +526,7 @@ directory where the tag file is. ============================================================================== 5. Tags file format *tags-file-format* *E431* - *ctags* + *ctags* *jtags* A tags file can be created with an external command, for example "ctags". It will contain a tag for each function. Some versions of "ctags" will also make a tag for each "#defined" macro, typedefs, enums, etc. @@ -542,11 +542,13 @@ exuberant ctags This is a very good one. It works for C, C++, Java, many items. See http://ctags.sourceforge.net. No new version since 2009. etags Connected to Emacs. Supports many languages. -|:helptags| For Vim's |help| files +JTags For Java, in Java. It can be found at + http://www.fleiner.com/jtags/. ptags.py For Python, in Python. Found in your Python source directory at Tools/scripts/ptags.py. -ptags For Perl, in Perl. It can be found at - https://metacpan.org/pod/Vim::Tag +ptags For Perl, in Perl. It can be found at (link seems + dead): + http://www.eleves.ens.fr:8080/home/nthiery/Tags/. gnatxref For Ada. See http://www.gnuada.org/. gnatxref is part of the gnat package. @@ -892,8 +894,8 @@ Common arguments for the commands above: 7. Using 'tagfunc' *tag-function* It is possible to provide Vim with a function which will generate a list of -tags used for commands like |:tag|, |:tselect|, Normal mode tag commands like -|CTRL-]| and for the |taglist()| function. +tags used for commands like |:tag|, |:tselect| and Normal mode tag commands +like |CTRL-]|. The function used for generating the taglist is specified by setting the 'tagfunc' option. The function will be called with three arguments: @@ -912,7 +914,7 @@ Currently up to three flags may be passed to the tag function: (mnemonic: the tag function may use the context around the cursor to perform a better job of generating the tag list.) 'i' In Insert mode, the user was completing a tag (with - |i_CTRL-X_CTRL-]| or 'complete' contains "`t`" or "`]`"). + |i_CTRL-X_CTRL-]| or 'completeopt' contains `t`). 'r' The first argument to tagfunc should be interpreted as a |pattern| (see |tag-regexp|), such as when using: > :tag /pat @@ -948,14 +950,15 @@ It is not allowed to close a window or change window from inside 'tagfunc'. The following is a hypothetical example of a function used for 'tagfunc'. It uses the output of |taglist()| to generate the result: a list of tags in the inverse order of file names. ->vim - function CompareFilenames(item1, item2) - let f1 = a:item1['filename'] - let f2 = a:item2['filename'] - return f1 >=# f2 ? -1 : f1 <=# f2 ? 1 : 0 - endfunction - +> function TagFunc(pattern, flags, info) + function CompareFilenames(item1, item2) + let f1 = a:item1['filename'] + let f2 = a:item2['filename'] + return f1 >=# f2 ? + \ -1 : f1 <=# f2 ? 1 : 0 + endfunction + let result = taglist(a:pattern) call sort(result, "CompareFilenames") @@ -963,7 +966,5 @@ inverse order of file names. endfunc set tagfunc=TagFunc < -Note: When executing |taglist()| the 'tagfunc' function won't be called -recursively. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index e6f4590c..7d0402c1 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 9.1. Last change: 2025 Mar 25 +*testing.txt* For Vim version 9.1. Last change: 2024 Jul 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -68,7 +68,7 @@ test_feedinput({string}) *test_feedinput()* test_garbagecollect_now() *test_garbagecollect_now()* - Like |garbagecollect()|, but executed right away. This must + Like garbagecollect(), but executed right away. This must only be called directly to avoid any structure to exist internally, and |v:testing| must have been set before calling any function. *E1142* @@ -364,11 +364,6 @@ test_null_string() *test_null_string()* Return type: |String| -test_null_tuple() *test_null_tuple()* - Return a |Tuple| that is null. Only useful for testing. - - Return type: |Tuple| - test_option_not_set({name}) *test_option_not_set()* Reset the flag that indicates option {name} was set. Thus it looks like it still has the default value. Use like this: > diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 52236878..cf9a82ac 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 9.1. Last change: 2025 Apr 24 +*todo.txt* For Vim version 9.1. Last change: 2025 Mar 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -357,6 +357,8 @@ https://github.com/vim/vim/pull/5566 PR #11579 to add visualtext(), return Visually selected text. +PR #12032: Support Python 3 stable ABI. + PR #11860: Add more info to 'colorcolumn': display a character and highlight for each separate entry. Disadvantage: option value gets very complicated with multiple entries, e.g. every 8 columns. @@ -704,6 +706,8 @@ find them. (Max Kukartsev, #6218) Enable 'termbidi' if $VTE_VERSION >= 5703 ? +Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509) + "--cleanFOO" does not result in an error. (#5537) Output from assert_equalfile() doesn't give a hint about what's different. @@ -1486,6 +1490,8 @@ github with a URL like this: https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff Diff for version.c contains more context, can't skip a patch. +Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) + Comparing nested structures with "==" uses a different comparator than when comparing individual items. @@ -1508,6 +1514,9 @@ C highlighting: modern C allows: /* comment */ #ifdef and also line continuation after #include. I can't recommend it though. +Build with Python on Mac does not always use the right library. +(Kazunobu Kuriyama, 2015 Mar 28) + To support Thai (and other languages) word boundaries, include the ICU library: http://userguide.icu-project.org/boundaryanalysis @@ -1784,6 +1793,13 @@ Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17) b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan 7) +Win32: The Python interface only works with one version of Python, selected at +compile time. Can this be made to work with version 2.1 and 2.2 dynamically? + +Python: Be able to define a Python function that can be called directly from +Vim script. Requires converting the arguments and return value, like with +vim.bindeval(). + Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers, 2012 Aug 4) @@ -2896,20 +2912,6 @@ Quickfix/Location List: 7 Add a command that goes back to the position from before jumping to the first quickfix location. - -Python Interface: -- Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509) -- Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) -- Build with Python on Mac does not always use the right library. - (Kazunobu Kuriyama, 2015 Mar 28) -- Win32: The Python interface only works with one version of Python, - selected at compile time. Can this be made to work with version 2.1 and - 2.2 dynamically? -- Be able to define a Python function that can be called directly from Vim - script. Requires converting the arguments and return value, like with - vim.bindeval(). - - Vi incompatibility: - Try new POSIX tests, made after my comments. (Geoff Clare, 2005 April 7) Version 1.5 is in ~/src/posix/1.5. (Lynne Canal) @@ -4749,10 +4751,20 @@ Insert mode completion/expansion: 7 When expanding file names with an environment variable, add the match with the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and "$HOME/tmp" +8 When there is no word before the cursor but something like "sys." complete + with "sys.". Works well for C and similar languages. 9 ^X^L completion doesn't repeat correctly. It uses the first match with the last added line, instead of continuing where the last match ended. (Webb) -8 Add option 'istagword': characters used for CTRL-]. like 'isexpand' +8 Add option to set different behavior for Insert mode completion: + - ignore/match case + - different characters than 'iskeyword' +8 Add option 'isexpand', containing characters when doing expansion (so that + "." and "\" can be included, without changing 'iskeyword'). (Goldfarb) + Also: 'istagword': characters used for CTRL-]. + When 'isexpand' or 'istagword' are empty, use 'iskeyword'. + Alternative: Use a pattern so that start and end of a keyword can be + defined, only allow dash in the middle, etc. 8 Add a command to undo the completion, go back to the original text. 7 Completion of an abbreviation: Can leave letters out, like what Instant text does: www.textware.com diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index fea6cddd..4b7bc9ff 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 9.1. Last change: 2025 Apr 10 +*usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 18 VIM USER MANUAL - by Bram Moolenaar @@ -307,27 +307,23 @@ This switches on three very clever mechanisms: filetypes. See |:filetype-indent-on| and 'indentexpr'. - *restore-cursor* *last-position-jump* >vim + *restore-cursor* *last-position-jump* > augroup RestoreCursor autocmd! autocmd BufReadPost * \ let line = line("'\"") \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' \ && index(['xxd', 'gitrebase'], &filetype) == -1 - \ && !&diff \ | execute "normal! g`\"" \ | endif augroup END Another autocommand. This time it is used after reading any file. The complicated stuff after it checks if the '" mark is defined, and jumps to it -if so. It doesn't do that when: - - editing a commit or rebase message, which are likely a different one than - last time, - - using xxd(1) to filter and edit binary files, which transforms input files - back and forth, causing them to have dual nature, so to speak (see also - |using-xxd|) and - - Vim is in diff mode +if so. It doesn't do that for a commit or rebase message, which are likely +a different one than last time, and when using xxd(1) to filter and edit +binary files, which transforms input files back and forth, causing them to +have dual nature, so to speak. See also |using-xxd|. The backslash at the start of a line is used to continue the command from the previous line. That avoids a line getting very long. See |line-continuation|. @@ -474,8 +470,8 @@ Load the plugin with this command: > packadd hlyank < This package briefly highlights the affected region of the last |yank| -command. See |52.6| for a simplified implementation using the -|getregionpos()| function. +command. See |52.6| for a simplified implementation using the |getregionpos()| +function. The plugin understands the following configuration variables (the settings show the default values). @@ -485,9 +481,7 @@ To specify a different highlighting group, use: > < To use a different highlighting duration, use: > :let g:hlyank_duration = 300 -The unit is milliseconds, and the upper limit is 3000 ms. If you set a value -higher than this, the highlighting duration will be 3000 ms. - +< To highlight in visual mode, use: > :let g:hlyank_invisual = v:true diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index ffa6fcb7..0d09fc9c 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 9.1. Last change: 2025 Apr 27 +*usr_41.txt* For Vim version 9.1. Last change: 2025 Feb 01 VIM USER MANUAL - by Bram Moolenaar @@ -35,10 +35,8 @@ like for example .vim files or configuration files like .vimrc and .gvimrc. These scripts may define functions, commands and settings that Vim uses to customize and extend its behavior. - *vim-script-notation* -The correct notation is "Vim script" (or "Vim9 script" when refering to the -new Vim9 language |Vim9-script|), so we will use "Vim script" to refer to the -Vim scripting language throughout this documentation. This shorthand helps to +With a slight abuse of nomenclature, we will use "Vim script" to refer to the +Vim scripting language throughout this documentation. This shorthand helps to streamline explanations and discussions about scripting with Vim. A Vim plugin is a collection of one or more Vim scripts, along with additional @@ -841,30 +839,6 @@ List manipulation: *list-functions* repeat() repeat a List multiple times flatten() flatten a List flattennew() flatten a copy of a List - items() get List of List index-value pairs - -Tuple manipulation: *tuple-functions* - copy() make a shallow copy of a Tuple - count() count number of times a value appears in a - Tuple - deepcopy() make a full copy of a Tuple - empty() check if Tuple is empty - foreach() apply function to Tuple items - get() get an item without error for wrong index - index() index of a value in a Tuple - indexof() index in a Tuple where an expression is true - items() get List of Tuple index-value pairs - join() join Tuple items into a String - len() number of items in a Tuple - list2tuple() convert a list of items into a Tuple - max() maximum value in a Tuple - min() minimum value in a Tuple - reduce() reduce a Tuple to a value - repeat() repeat a Tuple multiple times - reverse() reverse the order of items in a Tuple - slice() take a slice of a Tuple - string() string representation of a Tuple - tuple2list() convert a Tuple into a List Dictionary manipulation: *dict-functions* get() get an entry without an error for a wrong key @@ -1113,7 +1087,6 @@ Command line: *command-line-functions* getcmdwintype() return the current command-line window type getcompletion() list of command-line completion matches fullcommand() get full command name - cmdcomplete_info() get command-line completion information Quickfix and location lists: *quickfix-functions* getqflist() list of quickfix errors @@ -1126,8 +1099,6 @@ Insert mode completion: *completion-functions* complete_add() add to found matches complete_check() check if completion should be aborted complete_info() get current completion information - complete_match() get insert completion start match col and - trigger text pumvisible() check if the popup menu is displayed pum_getpos() position and size of popup menu if visible @@ -1263,7 +1234,6 @@ Testing: *test-functions* test_null_list() return a null List test_null_partial() return a null Partial function test_null_string() return a null String - test_null_tuple() return a null Tuple test_settime() set the time Vim uses internally test_setmouse() set the mouse position test_feedinput() add key sequence to input buffer @@ -1679,8 +1649,8 @@ More information about defining your own functions here: |user-functions|. ============================================================================== *41.8* Lists and Dictionaries -So far we have used the basic types String and Number. Vim also supports -three composite types: List, Tuple and Dictionary. +So far we have used the basic types String and Number. Vim also supports two +composite types: List and Dictionary. A List is an ordered sequence of items. The items can be any kind of value, thus you can make a List of numbers, a List of Lists and even a List of mixed @@ -1781,23 +1751,6 @@ This looks into lines 1 to 50 (inclusive) and echoes any date found in there. For further reading see |Lists|. -TUPLE - -A Tuple is an immutable ordered sequence of items. An item can be of any -type. Items can be accessed by their index number. To create a Tuple with -three strings: > - - var atuple = ('one', 'two', 'three') - -The Tuple items are enclosed in parenthesis and separated by commas. To -create an empty Tuple: > - - var atuple = () - -The |:for| loop can be used to iterate over the items in a Tuple similar to a -List. - -For further reading see |Tuples|. DICTIONARIES diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index b68c336f..6fd4a5f7 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 9.1. Last change: 2025 Apr 21 +*various.txt* For Vim version 9.1. Last change: 2025 Feb 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -98,9 +98,7 @@ g8 Print the hex values of the bytes used in the *:p* *:pr* *:print* *E749* :[range]p[rint] [flags] - Print [range] lines (default current line). Can also - be spelled `:[range]|` due to Vi compatibility (see - |:bar|). Gives an error in an empty buffer. + Print [range] lines (default current line). Note: If you are looking for a way to print your text on paper see |:hardcopy|. In the GUI you can use the File.Print menu entry. diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 371e4b31..377ab2ae 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 May 08 +*version9.txt* For Vim version 9.1. Last change: 2025 Mar 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41553,18 +41553,6 @@ Enum support for Vim9 script |:enum| Support for protected _new() method -Add support for object<{type}> as variable data type |vim9-types| - -Diff mode ~ ---------- -Include the "linematch" algorithm for the 'diffopt' setting. This aligns -changes between buffers on similar lines improving the diff highlighting in -Vim - -Improve the diff highlighting for changes within a line. Configurable using -the "inline" sub option value for the 'diffopt' setting, with "inline:simple" -being added to the default "diffopt" value (but this does not change how diff -mode works). *new-other-9.2* Other new features ~ ------------------ @@ -41582,7 +41570,9 @@ Support highlighting the matched text and the completion kind for insert-mode completion and command-line completion in |ins-completion-menu|, see |complete-items| -Support for the |Tuple| data type in Vim script and Vim9 script. +Include the "linematch" algorithm for the 'diffopt' setting. This aligns +changes between buffers on similar lines improving the diff highlighting in +Vim *changed-9.2* Changed~ @@ -41594,10 +41584,11 @@ Default values: ~ - the default 'backspace' option for Vim has been set to "indent,eol,start" and removed from |defaults.vim| - the default fontsize for the GTK builds of Vim (Windows and Unix) has been - increased to 12pt to accommodate modern high-dpi monitors + increased to 12pt to accomodate modern high-dpi monitors - the default value of the 'keyprotocol' option has been updated and support for the ghostty terminal emulator (using kitty protocol) has been added + Completion: ~ - allow to complete directories from 'cdpath' for |:cd| and similar commands, add the "cd_in_path" completion type for e.g. |:command-complete| and @@ -41613,20 +41604,10 @@ Completion: ~ - New option value for 'completeopt': "nosort" - do not sort completion results "preinsert" - highlight to be inserted values - "nearest" - sort completion results by distance to cursor -- handle multi-line completion items as expected +- handle multi-line completion as expected - improved commandline completion for the |:hi| command - New option value for 'wildmode': "noselect" - do not auto select an entry in the wildmenu -- New flags for 'complete': - "f{func}" - complete using given function - "f" - complete using 'completefunc' - "o" - complete using 'omnifunc' -- allow to limit matches for the 'complete' sources by using the - "{flag}^" notation -- add ":filetype" command completion -- add "filetypecmd" completion type for |getcompletion()| -- 'smartcase' applies to completion filtering Options: ~ - the default for 'commentstring' contains whitespace padding to have @@ -41639,10 +41620,6 @@ Options: ~ - 'rulerformat' now supports the |stl-%!| item - use 'smoothscroll' logic for CTRL-F / CTRL-B for pagewise scrolling and CTRL-D / CTRL-U for half-pagewise scrolling -- New option value for 'fillchars': - "trunc" - configure truncation indicator, 'pummaxwidth' - "truncrl" - like "trunc" but in 'rl' mode, 'pummaxwidth' -- adjust for GTK3 dropping some mouse cursors 'mouseshape' Ex commands: ~ - allow to specify a priority when defining a new sign |:sign-define| @@ -41689,8 +41666,6 @@ Functions: ~ |base64_encode()| encode a blob into a base64 string |blob2str()| convert a blob into a List of strings |bindtextdomain()| set message lookup translation base path -|cmdcomplete_info()| get current cmdline completion info -|complete_match()| get completion and trigger info |diff()| diff two Lists of strings |filecopy()| copy a file {from} to {to} |foreach()| apply function to List items @@ -41702,19 +41677,15 @@ Functions: ~ |getstacktrace()| get current stack trace of Vim scripts |id()| get unique identifier for a Dict, List, Object, Channel or Blob variable -|list2tuple()| turn a List of items into a Tuple |matchbufline()| all the matches of a pattern in a buffer |matchstrlist()| all the matches of a pattern in a List of strings |ngettext()| lookup single/plural message translation |popup_setbuf()| switch to a different buffer in a popup |str2blob()| convert a List of strings into a blob -|test_null_tuple()| return a null tuple -|tuple2list()| turn a Tuple of items into a List Autocommands: ~ -|CmdlineLeavePre| before preparing to leave the command line |CursorMovedC| after the cursor was moved in the command-line |KeyInputPre| before processing any key event in any mode |SessionWritePost| after writing the session file |:mksession| @@ -41726,8 +41697,7 @@ Autocommands: ~ Highlighting: ~ -|hl-ComplMatchIns| matched text of the currently inserted completion -|hl-DiffTextAdd| added text within a changed line +|hl-ComplMatchIns| matched text of the currently inserted completion. |hl-MsgArea| highlighting of the Command-line and messages area |hl-PmenuMatch| Popup menu: highlighting of matched text |hl-PmenuMatchSel| Popup menu: highlighting of matched text in selected @@ -41745,22 +41715,18 @@ Ex-Commands: ~ Options: ~ -'chistory' Size of the quickfix stack |quickfix-stack|. -'completefuzzycollect' Enable fuzzy collection of candidates for (some) +'completefuzzycollect' Enable fuzzy collection of candiates for (some) |ins-completion| modes 'completeitemalign' Order of |complete-items| in Insert mode completion popup 'eventignorewin' autocommand events that are ignored in a window 'findfunc' Vim function to obtain the results for a |:find| command -'isexpand' defines triggers for completion -'lhistory' Size of the location list stack |quickfix-stack|. 'messagesopt' configure |:messages| and |hit-enter| prompt -'pummaxwidth' maximum width for the completion popup menu +'winfixbuf' Keep buffer focused in a window 'tabclose' Which tab page to focus after closing a tab page 't_xo' Terminal uses XON/XOFF handshaking (e.g. vt420) 't_CF' Support for alternate font highlighting terminal code -'winfixbuf' Keep buffer focused in a window ============================================================================== INCOMPATIBLE CHANGES *incompatible-9.2* diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 46db57a4..b96f7790 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 9.1. Last change: 2025 Mar 28 +*vi_diff.txt* For Vim version 9.1. Last change: 2024 Nov 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -91,11 +91,8 @@ Maximum display width Unix and Win32: 1024 characters, otherwise 255 Maximum lhs of a mapping 50 characters. Number of different highlighting types: over 30000 Range of a Number variable: -2147483648 to 2147483647 (might be more on 64 - bit systems) See also: |v:numbermax|, - |v:numbermin| and |v:numbersize| + bit systems) Maximum length of a line in a tags file: 512 bytes. - *E1541* -Maximum value for |/\U| and |/\%U|: 2147483647 (for 32bit integer). Information for undo and text in registers is kept in memory, thus when making (big) changes the amount of (virtual) memory available limits the number of diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 0dae57de..bf500944 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 9.1. Last change: 2025 Apr 27 +*vim9.txt* For Vim version 9.1. Last change: 2025 Mar 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1001,7 +1001,6 @@ empty list and dict is falsy: string non-empty blob non-empty list non-empty (different from JavaScript) - tuple non-empty (different from JavaScript) dictionary non-empty (different from JavaScript) func when there is a function name special true or v:true @@ -1049,7 +1048,6 @@ In Vim9 script one can use the following predefined values: > null_function null_job null_list - null_tuple null_object null_partial null_string @@ -1467,19 +1465,17 @@ The following builtin types are supported: blob list<{type}> dict<{type}> - object<{type}> job channel - tuple<{type}> - tuple<{type}, {type}, ...> - tuple<...list<{type}>> - tuple<{type}, ...list<{type}>> func func: {type} func({type}, ...) func({type}, ...): {type} void +Not supported yet: + tuple + These types can be used in declarations, but no simple value will actually have the "void" type. Trying to use a void (e.g. a function without a return value) results in error *E1031* *E1186* . @@ -1487,32 +1483,6 @@ return value) results in error *E1031* *E1186* . There is no array type, use list<{type}> instead. For a list constant an efficient implementation is used that avoids allocating a lot of small pieces of memory. - *tuple-type* -A tuple type can be declared in more or less specific ways: -tuple a tuple with a single item of type |Number| -tuple a tuple with two items of type |Number| and - |String| -tuple a tuple with three items of type |Number|, - |Float| and |Boolean| -tuple<...list> a variadic tuple with zero or more items of - type |Number| -tuple> a tuple with an item of type |Number| followed - by zero or more items of type |String| - -Examples: > - var myTuple: tuple = (20,) - var myTuple: tuple = (30, 'vim') - var myTuple: tuple = (40, 1.1, true) - var myTuple: tuple<...list> = ('a', 'b', 'c') - var myTuple: tuple> = (3, 'a', 'b', 'c') -< - *variadic-tuple* *E1539* -A variadic tuple has zero or more items of the same type. The type of a -variadic tuple must end with a list type. Examples: > - var myTuple: tuple<...list> = (1, 2, 3) - var myTuple: tuple<...list> = ('a', 'b', 'c') - var myTuple: tuple<...list> = () -< *vim9-func-declaration* *E1005* *E1007* A partial and function can be declared in more or less specific ways: func any kind of function reference, no type @@ -1737,8 +1707,7 @@ argument type checking: > *E1211* *E1217* *E1218* *E1219* *E1220* *E1221* *E1222* *E1223* *E1224* *E1225* *E1226* *E1227* *E1228* *E1238* *E1250* *E1251* *E1252* *E1256* - *E1297* *E1298* *E1301* *E1528* *E1529* *E1530* - *E1531* *E1534* + *E1297* *E1298* *E1301* Types are checked for most builtin functions to make it easier to spot mistakes. @@ -1746,7 +1715,7 @@ Categories of variables, defaults and null handling ~ *variable-categories* *null-variables* There are categories of variables: primitive number, float, boolean - container string, blob, list, tuple, dict + container string, blob, list, dict specialized function, job, channel, user-defined-object When declaring a variable without an initializer, an explicit type must be @@ -1876,7 +1845,6 @@ An uninitialized variable is usually equal to null; it depends on its type: var s: string s == null var b: blob b != null *** var l: list l != null *** - var t: tuple t != null *** var d: dict d != null *** var f: func f == null var j: job j == null @@ -1887,7 +1855,6 @@ A variable initialized to empty equals null_; but not null: var s2: string = "" == null_string != null var b2: blob = 0z == null_blob != null var l2: list = [] == null_list != null - var t2: tuple = () == null_tuple != null var d2: dict = {} == null_dict != null NOTE: the specialized variables, like job, default to null value and have no @@ -2043,7 +2010,7 @@ The script name after `import` can be: If the name does not end in ".vim" then the use of "as name" is required. -Once a Vim9 script file has been imported, the result is cached and used the +Once a vim9 script file has been imported, the result is cached and used the next time the same script is imported. It will not be read again. It is not allowed to import the same script twice, also when using two @@ -2056,7 +2023,7 @@ line, there can be no line break: > echo that .name # Error! < *import-map* -When you've imported a function from one script into a Vim9 script you can +When you've imported a function from one script into a vim9 script you can refer to the imported function in a mapping by prefixing it with ||: > noremap ,a :call name.Function() diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt index d2f43aef..7ba91e7d 100644 --- a/runtime/doc/vim9class.txt +++ b/runtime/doc/vim9class.txt @@ -1,4 +1,4 @@ -*vim9class.txt* For Vim version 9.1. Last change: 2025 Apr 21 +*vim9class.txt* For Vim version 9.1. Last change: 2025 Feb 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -641,8 +641,8 @@ class, then the type of the variable is set. The following reserved keyword names cannot be used as an object or class variable name: "super", "this", "true", "false", "null", "null_blob", -"null_channel", "null_class", "null_dict", "null_function", "null_job", -"null_list", "null_object", "null_partial" and "null_string". +"null_dict", "null_function", "null_list", "null_partial", "null_string", +"null_channel" and "null_job". Extending a class ~ *extends* @@ -1067,21 +1067,6 @@ The above enum definition is equivalent to the following class definition: > public const ordinal: number endclass < -A enum can contain object variables and methods just like a regular class: > - - enum Color - Cyan([0, 255, 255]), - Magenta([255, 0, 255]), - Gray([128, 128, 128]) - - var rgb_values: list - - def Get_RGB(): list - return this.rgb_values - enddef - endenum - echo Color.Magenta.Get_RGB() -< ============================================================================== 9. Rationale diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 545a44b3..db24e519 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 9.1. Last change: 2025 Apr 30 +*windows.txt* For Vim version 9.1. Last change: 2025 Jan 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1289,9 +1289,7 @@ list of buffers. |unlisted-buffer| name also works, so long as it is unique in the list of buffers. Note that a buffer whose name is a number cannot be referenced - by that name; use the buffer number instead. Same is true if - the buffer name starts with a `+`, it will be interpreted as - the start of a |+cmd|. + by that name; use the buffer number instead. Insert a backslash before a space in a buffer name. See |:buffer-!| for [!]. This will also edit a buffer that is not in the buffer list, diff --git a/runtime/filetype.vim b/runtime/filetype.vim index a6f13c8b..d4ecfcb7 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2025 May 02 +" Last Change: 2025 Mar 18 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -53,7 +53,7 @@ endfunc " Vim help file, set ft explicitly, because 'modeline' might be off au BufNewFile,BufRead */doc/*.txt - \ if getline('$') =~ '\%(^\|\s\)vim:\%(.*\%(:\|\s\)\)\?\%(ft\|filetype\)=help\%(:\|\s\|$\)' + \ if getline('$') =~ '\(^\|\s\)vim:.*\<\(ft\|filetype\)=help\>' \| setf help \| endif @@ -429,15 +429,13 @@ if has("fname_case") au BufNewFile,BufRead *.C,*.H if !&fileignorecase | setf cpp | endif endif -" MS files (ixx: C++ module interface file, Microsoft Project file) -au BufNewFile,BufRead *.ixx,*.mpp setf cpp - " C++ 20 modules (clang) " https://clang.llvm.org/docs/StandardCPlusPlusModules.html#file-name-requirement au BufNewFile,BufRead *.cppm,*.ccm,*.cxxm,*.c++m setf cpp -" .h files can be C, C++, Ch, Objective-C, or Objective-C++. -" Set g_filetype_h to set a different filetype +" .h files can be C, Ch C++, ObjC or ObjC++. +" Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is +" detected automatically. au BufNewFile,BufRead *.h call dist#ft#FTheader() " Ch (CHscript) @@ -563,9 +561,6 @@ au BufNewFile,BufRead *.cu,*.cuh setf cuda " Cue au BufNewFile,BufRead *.cue setf cue -" DAX -au BufNewFile,BufRead *.dax setf dax - " Debian devscripts au BufNewFile,BufRead devscripts.conf,.devscripts setf sh @@ -1023,14 +1018,6 @@ au BufNewFile,BufRead *.gjs setf javascript.glimmer " Gnuplot scripts au BufNewFile,BufRead *.gpi,*.gnuplot,.gnuplot_history setf gnuplot -" GNU Radio Companion files -au BufNewFile,BufRead *.grc - \ if getline(1) =~# ':t') !~ g:ft_ignore_pat | call dist#ft#FTmake() | endif +au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make') " Ruby Makefile au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') diff --git a/runtime/ftplugin/abnf.vim b/runtime/ftplugin/abnf.vim deleted file mode 100644 index 4741d5f0..00000000 --- a/runtime/ftplugin/abnf.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Language: abnf -" Maintainer: A4-Tacks -" Last Change: 2025-05-02 -" Upstream: https://github.com/A4-Tacks/abnf.vim - -if exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -let b:undo_ftplugin = 'setlocal iskeyword< comments< commentstring<' - -setlocal iskeyword=@,48-57,_,-,192-255 -setlocal comments=:;;,:; -setlocal commentstring=;%s - -" vim:ts=8 diff --git a/runtime/ftplugin/dax.vim b/runtime/ftplugin/dax.vim deleted file mode 100644 index e5783f03..00000000 --- a/runtime/ftplugin/dax.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Vim filetype plugin -" Language: Data Analysis Expressions (DAX) -" Maintainer: Anarion Dunedain -" Last Change: 2025 Apr 2 - -if exists('b:did_ftplugin') - finish -endif - -let b:did_ftplugin = 1 - -setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// - -setlocal commentstring=//\ %s - -let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/fstab.vim b/runtime/ftplugin/fstab.vim index d340c4b8..0e7ffda4 100644 --- a/runtime/ftplugin/fstab.vim +++ b/runtime/ftplugin/fstab.vim @@ -2,12 +2,9 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim -" Last Change: 2025 Mar 31 -" Version: 1.0.1 -" -" Changelog: -" - 2024 May 23 by Riley Bruins ('commentstring') -" - 2025 Mar 31 added setlocal formatoptions-=t +" Last Change: 2021 Jan 02 +" 2024 May 23 by Riley Bruins ('commentstring') +" Version: 1.0 " " Credits: " Subhaditya Nath @@ -18,8 +15,6 @@ endif let b:did_ftplugin = 1 setlocal commentstring=#\ %s -setlocal formatoptions-=t - -let b:undo_ftplugin = "setlocal commentstring< formatoptions<" +let b:undo_ftplugin = "setlocal commentstring<" " vim: ts=8 ft=vim diff --git a/runtime/ftplugin/gleam.vim b/runtime/ftplugin/gleam.vim index 3ea68fa0..9ed607c4 100644 --- a/runtime/ftplugin/gleam.vim +++ b/runtime/ftplugin/gleam.vim @@ -1,33 +1,16 @@ " Vim filetype plugin file -" Language: Gleam -" Maintainer: Kirill Morozov -" Previous Maintainer: Trilowy (https://github.com/trilowy) -" Based On: https://github.com/gleam-lang/gleam.vim -" Last Change: 2025 Apr 21 +" Language: Gleam +" Maintainer: Trilowy (https://github.com/trilowy) +" Last Change: 2024 Oct 13 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -setlocal comments=:////,:///,:// +setlocal comments=://,:///,://// setlocal commentstring=//\ %s -setlocal formatprg=gleam\ format\ --stdin -setlocal suffixesadd=.gleam -let b:undo_ftplugin = "setlocal com< cms< fp< sua<" -if get(g:, "gleam_recommended_style", 1) - setlocal expandtab - setlocal shiftwidth=2 - setlocal smartindent - setlocal softtabstop=2 - setlocal tabstop=2 - let b:undo_ftplugin ..= " | setlocal et< sw< si< sts< ts<" -endif - -if !exists('current_compiler') - compiler gleam_build - let b:undo_ftplugin ..= "| compiler make" -endif +let b:undo_ftplugin = "setlocal comments< commentstring<" " vim: sw=2 sts=2 et diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim index f3cae020..57fc73cd 100644 --- a/runtime/ftplugin/go.vim +++ b/runtime/ftplugin/go.vim @@ -5,16 +5,12 @@ " 2024 Jul 16 by Vim Project (add recommended indent style) " 2025 Mar 07 by Vim Project (add formatprg and keywordprg option #16804) " 2025 Mar 18 by Vim Project (use :term for 'keywordprg' #16911) -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - setlocal formatoptions-=t setlocal formatprg=gofmt @@ -49,7 +45,4 @@ if !exists('*' .. expand('') .. 'GoKeywordPrg') endfunc endif -let &cpo = s:cpo_save -unlet s:cpo_save - " vim: sw=2 sts=2 et diff --git a/runtime/ftplugin/groff.vim b/runtime/ftplugin/groff.vim deleted file mode 100644 index 3ebfa03c..00000000 --- a/runtime/ftplugin/groff.vim +++ /dev/null @@ -1,15 +0,0 @@ -" Vim syntax file -" Language: groff(7) -" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) -" Last Change: 2025 Apr 24 - -if exists('b:did_ftplugin') - finish -endif - -let b:nroff_is_groff = 1 - -runtime! ftplugin/nroff.vim - -let b:undo_ftplugin .= '| unlet! b:nroff_is_groff' -let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/heex.vim b/runtime/ftplugin/heex.vim index 2f53d22e..becc071c 100644 --- a/runtime/ftplugin/heex.vim +++ b/runtime/ftplugin/heex.vim @@ -2,16 +2,12 @@ " Language: HEEx " Maintainer: Mitchell Hanberg " Last Change: 2022 Sep 21 -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - setlocal shiftwidth=2 softtabstop=2 expandtab setlocal comments=:<%!-- @@ -29,6 +25,3 @@ if exists("loaded_matchit") && !exists("b:match_words") \ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim index 0109c175..b619a757 100644 --- a/runtime/ftplugin/help.vim +++ b/runtime/ftplugin/help.vim @@ -1,8 +1,7 @@ " Vim filetype plugin file " Language: Vim help file " Previous Maintainer: Nikolai Weibull -" Last Change: 2025 Apr 08 -" 2025 Apr 08 by Vim project (set 'omnifunc' and 'iskeyword', #17073) +" Latest Revision: 2018-12-29 if exists("b:did_ftplugin") finish @@ -12,33 +11,12 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc<" +let b:undo_ftplugin = "setl fo< tw< cole< cocu< keywordprg<" -setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help omnifunc=s:HelpComplete -let &l:iskeyword='!-~,^*,^|,^",192-255' +setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help if has("conceal") setlocal cole=2 cocu=nc endif -if !exists('*s:HelpComplete') - func s:HelpComplete(findstart, base) - if a:findstart - let colnr = col('.') - 1 " Get the column number before the cursor - let line = getline('.') - for i in range(colnr - 1, 0, -1) - if line[i] ==# '|' - return i + 1 " Don't include the `|` in base - elseif line[i] ==# "'" - return i " Include the `'` in base - endif - endfor - else - return taglist('^' .. a:base) - \ ->map({_, item -> #{word: item->get('name'), kind: item->get('kind')}}) - \ ->extend(getcompletion(a:base, 'help')) - endif - endfunc -endif - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 7736b5b0..5495f859 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -3,8 +3,7 @@ " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp " Last Change: 2024 Jan 14 -" 2024 May 24 update 'commentstring' option -" 2025 May 10 add expression folding #17141 +" 2024 May 24 by Riley Bruins ('commentstring') if exists("b:did_ftplugin") finish @@ -57,52 +56,5 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter b:html_set_browsefilter" endif -if has("folding") && get(g:, "html_expr_folding", 0) - function! HTMLTagFold() abort - if empty(get(b:, "foldsmap", {})) - if empty(get(b:, "current_syntax", '')) - return '0' - else - let b:foldsmap = htmlfold#MapBalancedTags() - endif - endif - - return get(b:foldsmap, v:lnum, '=') - endfunction - - setlocal foldexpr=HTMLTagFold() - setlocal foldmethod=expr - let b:undo_ftplugin ..= " | setlocal foldexpr< foldmethod<" - - if !get(g:, "html_expr_folding_without_recomputation", 0) - augroup htmltagfold - autocmd! htmltagfold - autocmd TextChanged,InsertLeave let b:foldsmap = {} - augroup END - - " XXX: Keep ":autocmd" last in "b:undo_ftplugin" (see ":help :bar"). - let b:undo_ftplugin ..= " | silent! autocmd! htmltagfold * " - endif -endif - let &cpo = s:save_cpo unlet s:save_cpo - -" See ":help vim9-mix". -if !has("vim9script") - finish -endif - -if exists("*g:HTMLTagFold") - def! g:HTMLTagFold(): string - if empty(get(b:, "foldsmap", {})) - if empty(get(b:, "current_syntax", '')) - return '0' - else - b:foldsmap = g:htmlfold#MapBalancedTags() - endif - endif - - return get(b:foldsmap, v:lnum, '=') - enddef -endif diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index 4a08c57d..cfd25bce 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -3,7 +3,9 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Dan Sharp " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2025 May 08 +" Last Change: 2024 Dec 25 +" 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins ('commentstring') " Make sure the continuation lines below do not cause problems in " compatibility mode. @@ -28,32 +30,6 @@ let b:did_ftplugin = 1 " extension. set suffixes+=.class -" Set up "&define" and "&include". -let s:peek = '' - -try - " Since v7.3.1037. - if 'ab' !~ 'a\@1' -let s:types = '\%(\%(abstract\|final\|non-sealed\|s\%(ealed\|tatic\|trictfp\)\)\s\+\)*' . - \ '\%(class\|enum\|@\=interface\|record\)\s\+\ze\K\k*\>' -let s:methods = '\%(\%(abstract\|default\|final\|native\|s\%(tatic\|trictfp\|ynchronized\)\)\s\+\)*' . - \ '\%(<.\{-1,}>\s\+\)\=\%(\K\k*\.\)*\K\k*\s*\%(<.\{-1,}>\%(\s\|\[\)\@=\)\=\s*\%(\[\]\s*\)*' . - \ '\s\+\ze\%(\<\%(assert\|case\|instanceof\|new\|return\|throw\|when\)\s\+\)\@' . - \ s:peek . ' -" URL: https://github.com/andis-sprinkis/lf-vim -" Last Change: 6 Apr 2025 - -if exists("b:did_ftplugin") | finish | endif - -let b:did_ftplugin = 1 - -let s:cpo = &cpo -set cpo&vim - -let b:undo_ftplugin = "setlocal comments< commentstring< formatoptions<" - -setlocal comments=:# -setlocal commentstring=#\ %s - -setlocal formatoptions-=t formatoptions+=rol - -let &cpo = s:cpo -unlet s:cpo diff --git a/runtime/ftplugin/lprolog.vim b/runtime/ftplugin/lprolog.vim index 07ffc527..1075a9c8 100644 --- a/runtime/ftplugin/lprolog.vim +++ b/runtime/ftplugin/lprolog.vim @@ -2,9 +2,7 @@ " Language: LambdaProlog (Teyjus) " Maintainer: Markus Mottl " URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim -" Last Change: 2025 Apr 16 -" 2025 Apr 16 - set 'cpoptions' for line continuation -" 2023 Aug 28 - added undo_ftplugin (Vim Project) +" Last Change: 2023 Aug 28 - added undo_ftplugin (Vim Project) " 2006 Feb 05 " 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM) " 2001 Sep 02 - initial release (MM) @@ -14,9 +12,6 @@ if exists("b:did_ftplugin") finish endif -let s:cpo_save = &cpo -set cpo&vim - " Don't do other file type settings for this buffer let b:did_ftplugin = 1 @@ -48,6 +43,3 @@ if !exists("no_plugin_maps") && !exists("no_lprolog_maps") vnoremap BUncomOn :'<,'>`0i/*`>o0i*/`< vnoremap BUncomOff :'<,'>`dd`< endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index e3bb3a5d..cc042c5d 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -1,5 +1,4 @@ " Vim filetype plugin file. - " Language: Lua " Maintainer: Doug Kearns " Previous Maintainer: Max Ischenko @@ -7,9 +6,7 @@ " C.D. MacEachern " Tyler Miller " Phạm Bình An -" @konfekt -" Last Change: 2025 Apr 04 -" 2025 May 06 by Vim Project update 'path' setting #17267 +" Last Change: 2025 Feb 27 if exists("b:did_ftplugin") finish @@ -32,7 +29,6 @@ set cpo&vim setlocal comments=:---,:-- setlocal commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql -setlocal path-=. " Lua doesn't support importing module in path related to current file like JS let &l:define = '\ 0 && line =~# foldlist[-1][1] call remove(foldlist, -1) - let end = 1 else let foldlist = [] endif break endif endfor - let prefix = "" - if open == 1 | let prefix = ">" | endif - if end == 1 | let prefix = "<" | endif - let b:lua_foldlists += [prefix..(len(foldlist) + end)] + call add(b:lua_foldlists, len(foldlist)) endfor - return b:lua_foldlists[v:lnum - 1] + return lua_foldlists[a:lnum - 1] endfunction -if !has('vim9script') - let &cpo = s:cpo_save - unlet s:cpo_save - - finish -endif - -delfunction! s:LuaFold -def s:LuaFold(): string - if b:lua_lasttick == b:changedtick - return b:lua_foldlists[v:lnum - 1] - endif - b:lua_lasttick = b:changedtick - - b:lua_foldlists = [] - var foldlist = [] - var buf = getline(1, "$") - for line in buf - var open = 0 - var end = 0 - for t in patterns - var tagopen = '\v^\s*' .. t[0] .. '\s*$' - var tagend = '\v^\s*' .. t[1] .. '\s*$' - if line =~# tagopen - add(foldlist, t) - open = 1 - break - elseif line =~# tagend - if len(foldlist) > 0 && line =~# foldlist[-1][1] - end = 1 - remove(foldlist, -1) - else - foldlist = [] - endif - break - endif - endfor - var prefix = "" - if open == 1 | prefix = ">" | endif - if end == 1 | prefix = "<" | endif - b:lua_foldlists += [prefix .. (len(foldlist) + end)] - endfor - return b:lua_foldlists[v:lnum - 1] -enddef - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/mbsync.vim b/runtime/ftplugin/mbsync.vim deleted file mode 100644 index f2d13eff..00000000 --- a/runtime/ftplugin/mbsync.vim +++ /dev/null @@ -1,13 +0,0 @@ -" Vim filetype plugin file -" Language: mbsync configuration file -" Maintainer: Pierrick Guillaume -" Last Change: 2025 Apr 13 - -if (exists('b:did_ftplugin')) - finish -endif -let b:did_ftplugin = 1 - -let b:undo_ftplugin = "setlocal commentstring<" - -setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/mediawiki.vim b/runtime/ftplugin/mediawiki.vim index 399de421..46182461 100644 --- a/runtime/ftplugin/mediawiki.vim +++ b/runtime/ftplugin/mediawiki.vim @@ -3,7 +3,6 @@ " Home: http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim " Last Change: 2024 Jul 14 " Credits: chikamichi -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) " if exists("b:did_ftplugin") @@ -11,9 +10,6 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - " Many MediaWiki wikis prefer line breaks only at the end of paragraphs " (like in a text processor), which results in long, wrapping lines. setlocal wrap linebreak @@ -44,6 +40,3 @@ setlocal foldmethod=expr let b:undo_ftplugin = "setl commentstring< comments< formatoptions< foldexpr< foldmethod<" let b:undo_ftplugin += " matchpairs< linebreak< wrap< textwidth<" - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/mojo.vim b/runtime/ftplugin/mojo.vim index c7f3b6b4..ff502299 100644 --- a/runtime/ftplugin/mojo.vim +++ b/runtime/ftplugin/mojo.vim @@ -2,16 +2,12 @@ " Language: Mojo " Maintainer: Riley Bruins " Last Change: 2024 Jul 07 -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - setlocal include=^\\s*\\(from\\\|import\\) setlocal define=^\\s*\\(\\(async\\s\\+\\)\\?def\\\|class\\) @@ -43,6 +39,3 @@ let b:undo_ftplugin = 'setlocal include<' \ . '|setlocal suffixesadd<' \ . '|setlocal comments<' \ . '|setlocal commentstring<' - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/nix.vim b/runtime/ftplugin/nix.vim index 311e00b4..d417cc78 100644 --- a/runtime/ftplugin/nix.vim +++ b/runtime/ftplugin/nix.vim @@ -2,7 +2,6 @@ " Language: nix " Maintainer: Keith Smiley " Last Change: 2023 Jul 22 -" 2025 Apr 18 by Vim Project (set 'iskeyword' and b:match_words #17154) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -12,10 +11,7 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl commentstring< comments< iskeyword< | unlet! b:match_words" - -let b:match_words = "\:\:\,\:\" +let b:undo_ftplugin = "setl commentstring< comments<" setlocal comments=:# setlocal commentstring=#\ %s -setlocal iskeyword+=- diff --git a/runtime/ftplugin/nroff.vim b/runtime/ftplugin/nroff.vim index cd2680ef..7d3d2a59 100644 --- a/runtime/ftplugin/nroff.vim +++ b/runtime/ftplugin/nroff.vim @@ -7,33 +7,18 @@ " Last Changes: " 2024 May 24 by Riley Bruins ('commentstring' #14843) " 2025 Feb 12 by Wu, Zhenyu (matchit configuration #16619) -" 2025 Apr 16 by Eisuke Kawashima (cpoptions #17121) -" 2025 Apr 24 by Eisuke Kawashima (move options from syntax to ftplugin #17174) if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - setlocal commentstring=.\\\"\ %s setlocal comments=:.\\\" setlocal sections+=Sh setlocal define=.\s*de -if get(b:, 'preprocs_as_sections') - setlocal sections=EQTSPS[\ G1GS -endif - -let b:undo_ftplugin = 'setlocal commentstring< comments< sections& define<' - -if get(b:, 'nroff_is_groff') - " groff_ms exdented paragraphs are not in the default paragraphs list. - setlocal paragraphs+=XP - let b:undo_ftplugin .= ' paragraphs&' -endif +let b:undo_ftplugin = 'setlocal commentstring< comments< sections< define<' if exists('loaded_matchit') let b:match_words = '^\.\s*ie\>:^\.\s*el\>' @@ -45,6 +30,3 @@ if exists('loaded_matchit') \ . ',^\.\s*FS\>:^\.\s*FE\>' let b:undo_ftplugin .= "| unlet b:match_words" endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/pq.vim b/runtime/ftplugin/pq.vim deleted file mode 100644 index 2ed2fa42..00000000 --- a/runtime/ftplugin/pq.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Vim filetype plugin -" Language: Power Query M -" Maintainer: Anarion Dunedain -" Last Change: 2025 Apr 3 - -if exists('b:did_ftplugin') - finish -endif - -let b:did_ftplugin = 1 - -setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// - -setlocal commentstring=//\ %s - -let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/remind.vim b/runtime/ftplugin/remind.vim deleted file mode 100644 index d6458459..00000000 --- a/runtime/ftplugin/remind.vim +++ /dev/null @@ -1,14 +0,0 @@ -" Vim filetype plugin file -" Language: Remind - a sophisticated calendar and alarm -" Maintainer: Joe Reynolds -" Latest Revision: 2025 April 08 -" License: Vim (see :h license) - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -setlocal comments=:# commentstring=#\ %s - -let b:undo_ftplugin = "setl cms< com<" diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index 53f7f833..3e2741f9 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -3,7 +3,6 @@ " Maintainer: Chris Morgan " Last Change: 2024 Mar 17 " 2024 May 23 by Riley Bruins - autocmd ShellFilterPost if v:shell_error | execute 'echom "shell filter returned error " . v:shell_error . ", undoing changes"' | undo | endif - augroup END - endif - - let &l:formatprg = get(g:, 'rustfmt_command', 'rustfmt') . ' ' . - \ get(g:, 'rustfmt_options', '') . ' ' . - \ rustfmt#RustfmtConfigOptions() -endif - if exists("g:ftplugin_rust_source_path") let &l:path=g:ftplugin_rust_source_path . ',' . &l:path endif @@ -163,7 +149,7 @@ endif let b:undo_ftplugin = " \ compiler make | - \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd< formatprg< + \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd< \|if exists('b:rust_set_style') \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< \|endif diff --git a/runtime/ftplugin/spajson.vim b/runtime/ftplugin/spajson.vim deleted file mode 100644 index d03d1d50..00000000 --- a/runtime/ftplugin/spajson.vim +++ /dev/null @@ -1,14 +0,0 @@ -" Vim filetype plugin -" Language: SPA JSON -" Maintainer: David Mandelberg -" Last Change: 2025 Mar 22 - -if exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -setlocal comments=:###,:##,:# -setlocal commentstring=#\ %s - -let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/ftplugin/svelte.vim b/runtime/ftplugin/svelte.vim index 5114de25..e0ec4e0a 100644 --- a/runtime/ftplugin/svelte.vim +++ b/runtime/ftplugin/svelte.vim @@ -1,40 +1,13 @@ " Vim filetype plugin " Language: svelte " Maintainer: Igor Lacerda -" Last Change: 2025 Apr 06 +" Last Change: 2024 Jun 09 if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -let s:cpo_sav = &cpo -set cpo&vim +setl commentstring= -setlocal matchpairs+=<:> -setlocal commentstring= -setlocal comments=s: - -let b:undo_ftplugin = 'setlocal comments< commentstring< matchpairs<' - -if exists('&omnifunc') - setlocal omnifunc=htmlcomplete#CompleteTags - call htmlcomplete#DetectOmniFlavor() - let b:undo_ftplugin ..= " | setlocal omnifunc<" -endif - -if exists("loaded_matchit") && !exists("b:match_words") - let b:match_ignorecase = 1 - let b:match_words = '<:>,' . - \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . - \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . - \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' . - \ '{#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' . - \ '{#await[^}]*}:{\:then[^}]*}:{\:catch[^}]*}:{\/await},' . - \ '{#snippet[^}]*}:{\/snippet},' . - \ '{#key[^}]*}:{\/key}' - let b:html_set_match_words = 1 - let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words" -endif -let &cpo = s:cpo_sav -unlet! s:cpo_sav +let b:undo_ftplugin = 'setl cms<' diff --git a/runtime/ftplugin/tera.vim b/runtime/ftplugin/tera.vim index ce4134ae..65bae700 100644 --- a/runtime/ftplugin/tera.vim +++ b/runtime/ftplugin/tera.vim @@ -2,16 +2,12 @@ " Language: Tera " Maintainer: Muntasir Mahmud " Last Change: 2025 Mar 08 -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - setlocal autoindent setlocal commentstring={#\ %s\ #} @@ -32,6 +28,3 @@ setlocal softtabstop=2 let b:undo_ftplugin = "setlocal autoindent< commentstring< comments< " .. \ "includeexpr< suffixesadd< expandtab< shiftwidth< softtabstop<" let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words" - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/tutor.vim b/runtime/ftplugin/tutor.vim index 92bca8d1..30783d97 100644 --- a/runtime/ftplugin/tutor.vim +++ b/runtime/ftplugin/tutor.vim @@ -1,18 +1,19 @@ -" Tutor filetype plugin -" Language: Tutor (the new tutor plugin) -" Maintainer: This runtime file is looking for a new maintainer. -" Last Change: 2025 May 10 -" Contributors: Phạm Bình An -" Original Author: Felipe Morales -" Last Change: -" 2025 May 10 set b:undo_ftplugin -" 2025 May 12 update b:undo_ftplugin +" vim: fdm=marker " Base: {{{1 call tutor#SetupVim() " Buffer Settings: {{{1 setlocal noreadonly +if !exists('g:tutor_debug') || g:tutor_debug == 0 + setlocal buftype=nofile + setlocal concealcursor+=inv + setlocal conceallevel=2 +else + setlocal buftype= + setlocal concealcursor& + setlocal conceallevel=0 +endif setlocal noundofile setlocal keywordprg=:help @@ -38,7 +39,7 @@ call tutor#SetNormalMappings() sign define tutorok text=✓ texthl=tutorOK sign define tutorbad text=✗ texthl=tutorX -let b:undo_ftplugin = "setl foldmethod< foldexpr< foldlevel< undofile< keywordprg< iskeyword< |" - \ . "call tutor#EnableInteractive(v:false) |" - -" vim: fdm=marker +if !exists('g:tutor_debug') || g:tutor_debug == 0 + call tutor#ApplyMarks() + autocmd! TextChanged,TextChangedI call tutor#ApplyMarksOnChanged() +endif diff --git a/runtime/ftplugin/yaml.vim b/runtime/ftplugin/yaml.vim index 12036a86..4e12350c 100644 --- a/runtime/ftplugin/yaml.vim +++ b/runtime/ftplugin/yaml.vim @@ -1,8 +1,7 @@ " Vim filetype plugin file " Language: YAML (YAML Ain't Markup Language) " Previous Maintainer: Nikolai Weibull (inactive) -" Last Change: 2024 Oct 04 -" 2025 Apr 22 by Vim project re-order b:undo_ftplugin (#17179) +" Last Change: 2024 Oct 04 if exists("b:did_ftplugin") finish @@ -17,25 +16,20 @@ let b:undo_ftplugin = "setl com< cms< et< fo<" setlocal comments=:# commentstring=#\ %s expandtab setlocal formatoptions-=t formatoptions+=croql -if get(g:, "yaml_recommended_style",1) - let b:undo_ftplugin ..= " sw< sts<" - setlocal shiftwidth=2 softtabstop=2 -endif - -" rime input method engine(https://rime.im/) -" uses `*.custom.yaml` as its config files +" rime input method engine uses `*.custom.yaml` as its config files if expand('%:r:e') ==# 'custom' - " `__include` command in `*.custom.yaml` - " see: https://github.com/rime/home/wiki/Configuration#%E5%8C%85%E5%90%AB - setlocal include=__include:\\s* - let b:undo_ftplugin ..= " inc<" - if !exists('current_compiler') compiler rime_deployer - let b:undo_ftplugin ..= " | compiler make" + let b:undo_ftplugin ..= "| compiler make" endif + setlocal include=__include:\\s* + let b:undo_ftplugin ..= " inc<" endif +if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0 + let b:undo_ftplugin ..= " sw< sts<" + setlocal shiftwidth=2 softtabstop=2 +endif let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/indent/cucumber.vim b/runtime/indent/cucumber.vim index 33d4cc73..5d144e42 100644 --- a/runtime/indent/cucumber.vim +++ b/runtime/indent/cucumber.vim @@ -2,14 +2,11 @@ " Language: Cucumber " Maintainer: Tim Pope " Last Change: 2023 Dec 28 -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists("b:did_indent") finish endif let b:did_indent = 1 -let s:cpo_save = &cpo -set cpo&vim setlocal autoindent setlocal indentexpr=GetCucumberIndent() @@ -98,7 +95,4 @@ function! GetCucumberIndent(...) abort return prev.indent < 0 ? 0 : prev.indent endfunction -let &cpo = s:cpo_save -unlet s:cpo_save - " vim:set sts=2 sw=2: diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index 671a4d19..2fa10cc9 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -1,7 +1,7 @@ " Vim indent script for HTML " Maintainer: The Vim Project " Original Author: Andy Wokula -" Last Change: 2025 Apr 13 +" Last Change: 2023 Aug 13 " Version: 1.0 "{{{ " Description: HTML indent script with cached state for faster indenting on a " range of lines. @@ -868,9 +868,7 @@ func HtmlIndent_FindTagStart(lnum) let idx = match(getline(a:lnum), '\S>\s*$') if idx > 0 call cursor(a:lnum, idx) - " VIM_INDENT_TEST_TRACE_START let lnum = searchpair('<\w', '' , '\S>', 'bW', '', max([a:lnum - b:html_indent_line_limit, 0])) - " VIM_INDENT_TEST_TRACE_END HtmlIndent_FindTagStart if lnum > 0 return [lnum, 1] endif @@ -905,9 +903,7 @@ func HtmlIndent_FindTagEnd() call search('--\zs>') elseif s:get_tag('/' . tagname) != 0 " tag with a closing tag, find matching "" - " VIM_INDENT_TEST_TRACE_START call searchpair('<' . tagname, '', '', 'W', '', line('.') + b:html_indent_line_limit) - " VIM_INDENT_TEST_TRACE_END HtmlIndent_FindTagEnd else " self-closing tag, find the ">" call search('\S\zs>') diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index 6537d3f2..8077442e 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -2,7 +2,7 @@ " Language: Javascript " Maintainer: Chris Paul ( https://github.com/bounceme ) " URL: https://github.com/pangloss/vim-javascript -" Last Change: 2025 Apr 13 +" Last Change: December 4, 2017 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -69,9 +69,7 @@ let s:rel = has('reltime') " searchpair() wrapper if s:rel function s:GetPair(start,end,flags,skip) - " VIM_INDENT_TEST_TRACE_START return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200) - " VIM_INDENT_TEST_TRACE_END s:GetPair endfunction else function s:GetPair(start,end,flags,skip) diff --git a/runtime/indent/make.vim b/runtime/indent/make.vim index aeea4de7..4d1838b3 100644 --- a/runtime/indent/make.vim +++ b/runtime/indent/make.vim @@ -3,7 +3,6 @@ " Maintainer: Doug Kearns " Previous Maintainer: Nikolai Weibull " Last Change: 2022 Apr 06 -" 2025 Apr 22 by Vim Project: do not indent after special targets #17183 if exists("b:did_indent") finish @@ -22,8 +21,6 @@ endif let s:comment_rx = '^\s*#' let s:rule_rx = '^[^ \t#:][^#:]*:\{1,2}\%([^=:]\|$\)' -" .PHONY, .DELETE_ON_ERROR, etc -let s:rule_special = '^\.[A-Z_]\+\s*:' let s:continued_rule_rx = '^[^#:]*:\{1,2}\%([^=:]\|$\)' let s:continuation_rx = '\\$' let s:assignment_rx = '^\s*\h\w*\s*[+:?]\==\s*\zs.*\\$' @@ -53,7 +50,7 @@ function GetMakeIndent() if prev_line =~ s:continuation_rx if prev_prev_line =~ s:continuation_rx return indent(prev_lnum) - elseif prev_line =~ s:rule_rx && prev_line !~ s:rule_special + elseif prev_line =~ s:rule_rx return shiftwidth() elseif prev_line =~ s:assignment_rx call cursor(prev_lnum, 1) @@ -84,15 +81,15 @@ function GetMakeIndent() let line = getline(lnum) endwhile let folded_lnum = lnum + 1 - if folded_line =~ s:rule_rx && prev_line !~ s:rule_special - if getline(v:lnum) =~ s:rule_rx && prev_line !~ s:rule_special + if folded_line =~ s:rule_rx + if getline(v:lnum) =~ s:rule_rx return 0 else return &ts endif else " elseif folded_line =~ s:folded_assignment_rx - if getline(v:lnum) =~ s:rule_rx && prev_line !~ s:rule_special + if getline(v:lnum) =~ s:rule_rx return 0 else return indent(folded_lnum) @@ -101,8 +98,8 @@ function GetMakeIndent() " " TODO: ? " return indent(prev_lnum) endif - elseif prev_line =~ s:rule_rx && prev_line !~ s:rule_special - if getline(v:lnum) =~ s:rule_rx && prev_line !~ s:rule_special + elseif prev_line =~ s:rule_rx + if getline(v:lnum) =~ s:rule_rx return 0 else return &ts diff --git a/runtime/indent/spajson.vim b/runtime/indent/spajson.vim deleted file mode 100644 index e644a5ee..00000000 --- a/runtime/indent/spajson.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Vim indent file -" Language: SPA JSON -" Maintainer: David Mandelberg -" Last Change: 2025 Mar 22 - -runtime! indent/json.vim diff --git a/runtime/indent/testdir/README.txt b/runtime/indent/testdir/README.txt index 7454210e..65975605 100644 --- a/runtime/indent/testdir/README.txt +++ b/runtime/indent/testdir/README.txt @@ -36,9 +36,6 @@ First of all, create a FILETYPE.in file. It should contain: \ 'string' " END_INDENT - When an indent script utilises timed "search*()"es and supports related - timeout configuration, consider setting a generous timeout value from - INDENT_EXE lines (look at "g:vim_indent" in "testdir/vim.in" for details). Note that the command is not undone, you may need to reverse the effect for the next block of lines. diff --git a/runtime/indent/testdir/bitbake.in b/runtime/indent/testdir/bitbake.in index 97b760fc..afd19be1 100644 --- a/runtime/indent/testdir/bitbake.in +++ b/runtime/indent/testdir/bitbake.in @@ -1,8 +1,6 @@ # vim: set filetype=bitbake : # START_INDENT -# INDENT_EXE let g:pyindent_searchpair_timeout = 64 -# INDENT_EXE runtime autoload/python.vim FOO = " \ bar \ baz \ diff --git a/runtime/indent/testdir/bitbake.ok b/runtime/indent/testdir/bitbake.ok index 000ef508..1bc5a18c 100644 --- a/runtime/indent/testdir/bitbake.ok +++ b/runtime/indent/testdir/bitbake.ok @@ -1,8 +1,6 @@ # vim: set filetype=bitbake : # START_INDENT -# INDENT_EXE let g:pyindent_searchpair_timeout = 64 -# INDENT_EXE runtime autoload/python.vim FOO = " \ bar \ baz \ diff --git a/runtime/indent/testdir/html.in b/runtime/indent/testdir/html.in index 72a38b93..4783a096 100644 --- a/runtime/indent/testdir/html.in +++ b/runtime/indent/testdir/html.in @@ -2,7 +2,6 @@ % START_INDENT -% INDENT_EXE let b:html_indent_line_limit = 64 - - - -



-

An H2 header

-



-
- -

Paragraph #1. -

- -

Paragraph #2. - -

- - -

Paragraph #1. -

    -
  • Item a.
  • Item b.
  • -
  • Item c. -
-

Paragraph #2. -

-
- -
-
A quick brown fox jumps over the lazy dog -
Woof! -
-
A quick brown fox jumps over the lazy dog -
Woof! -
-
- -
Thread #1 -
Thread #2 -
-
- -

- - -

- - - -- - -
Some Caption
Header #1Header #2Header #3 -
Column #1Column #2Column #3 -
Column #1Column #2Column #3 -
Column #1Column #2Column #3 -
Column #1Column #2Column #3 -
- -
-
	
-<div class="block">
-<blockquote><pre><code>
-</code></pre></blockquote></div>
-
- -

Paragraph #3.

Paragraph #4.

Paragraph #5. - -

Paragraph #6.

Paragraph #7.

Paragraph #8.

Paragraph #9.

- -

Paragraph #10. -

- -

Paragraph #11.

Paragraph #12.

Paragraph #13.

Paragraph #14.

- -

Paragraph #15. -

Paragraph #16. - - diff --git a/runtime/syntax/testdir/input/html_fold_syntax.html b/runtime/syntax/testdir/input/html_fold_syntax.html deleted file mode 100644 index 73579aa9..00000000 --- a/runtime/syntax/testdir/input/html_fold_syntax.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - -A folding syntax test - - - -



-

An H2 header

-



-
- -

Paragraph #1. -

- -

Paragraph #2.

- -
- - -

Paragraph #1.

-
    -
  • Item a.
  • Item b.
  • -
  • Item c.
  • -
-

Paragraph #2. -

-
- -
-
A quick brown fox jumps over the lazy dog
-
Woof! -
-
A quick brown fox jumps over the lazy dog
-
Woof!
-
-
- -
Thread #1 -
Thread #2 -
-
- -

- - -

- - - - - - - - - - - -
Some Caption
Header #1Header #2Header #3
Column #1Column #2Column #3
Column #1Column #2Column #3
Column #1Column #2Column #3
Column #1Column #2Column #3
- -
-
	
-<div class="block">
-<blockquote><pre><code>
-</code></pre></blockquote></div>
-
- -

Paragraph #3.

Paragraph #4.

Paragraph #5.

- -

Paragraph #6.

Paragraph #7.

Paragraph #8.

Paragraph #9.

- -

Paragraph #10. -

- -

Paragraph #11.

Paragraph #12.

Paragraph #13.

Paragraph #14.

- -

Paragraph #15. -

Paragraph #16. - - diff --git a/runtime/syntax/testdir/input/java_comments_html.java b/runtime/syntax/testdir/input/java_comments_html.java index 15d4a2fa..eeffef5b 100644 --- a/runtime/syntax/testdir/input/java_comments_html.java +++ b/runtime/syntax/testdir/input/java_comments_html.java @@ -1,8 +1,8 @@ // VIM_TEST_SETUP unlet! g:java_no_tab_space_error g:java_ignore_javadoc // VIM_TEST_SETUP unlet! g:java_no_trail_space_error -// VIM_TEST_SETUP unlet! g:java_consent_to_html_syntax_folding -// VIM_TEST_SETUP let[g:java_space_errors,g:java_comment_strings]=[1,1] -// VIM_TEST_SETUP let[g:java_ignore_markdown,g:html_syntax_folding]=[1,1] +// VIM_TEST_SETUP let [g:java_space_errors,g:java_comment_strings]=[1,1] +// VIM_TEST_SETUP let g:java_ignore_markdown = 1 + diff --git a/runtime/syntax/testdir/input/java_comments_markdown.java b/runtime/syntax/testdir/input/java_comments_markdown.java index a34af8f3..fa369719 100644 --- a/runtime/syntax/testdir/input/java_comments_markdown.java +++ b/runtime/syntax/testdir/input/java_comments_markdown.java @@ -2,8 +2,8 @@ // VIM_TEST_SETUP unlet! g:java_no_trail_space_error // VIM_TEST_SETUP let[g:java_space_errors,g:java_comment_strings]=[1,1] // VIM_TEST_SETUP let[g:java_ignore_html,g:markdown_syntax_conceal]=[1,1] -// VIM_TEST_SETUP let g:html_syntax_folding = 1 -// VIM_TEST_SETUP let g:java_consent_to_html_syntax_folding = 1 + + diff --git a/runtime/syntax/testdir/input/java_previews_455.java b/runtime/syntax/testdir/input/java_previews_455.java index ed6430f5..b9c2070e 100644 --- a/runtime/syntax/testdir/input/java_previews_455.java +++ b/runtime/syntax/testdir/input/java_previews_455.java @@ -1,4 +1,4 @@ -// VIM_TEST_SETUP let g:java_syntax_previews = [455, 488] +// VIM_TEST_SETUP let g:java_syntax_previews = [455] diff --git a/runtime/syntax/testdir/input/setup/html_fold_expr.vim b/runtime/syntax/testdir/input/setup/html_fold_expr.vim deleted file mode 100644 index e8daae0e..00000000 --- a/runtime/syntax/testdir/input/setup/html_fold_expr.vim +++ /dev/null @@ -1,2 +0,0 @@ -let g:html_expr_folding = 1 -filetype plugin on diff --git a/runtime/syntax/testdir/input/setup/java_module_info.vim b/runtime/syntax/testdir/input/setup/java_module_info.vim index 15dbdc80..b7b818f8 100644 --- a/runtime/syntax/testdir/input/setup/java_module_info.vim +++ b/runtime/syntax/testdir/input/setup/java_module_info.vim @@ -29,4 +29,4 @@ autocmd_add([{ once: true, }]) -g:java_syntax_previews = [476, 494] +g:java_syntax_previews = [476] diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim b/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim deleted file mode 100644 index ebd90ede..00000000 --- a/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim +++ /dev/null @@ -1 +0,0 @@ -hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim b/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim deleted file mode 100644 index ebd90ede..00000000 --- a/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim +++ /dev/null @@ -1 +0,0 @@ -hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim_ex_redir.vim b/runtime/syntax/testdir/input/setup/vim_ex_redir.vim deleted file mode 100644 index 6193cc4e..00000000 --- a/runtime/syntax/testdir/input/setup/vim_ex_redir.vim +++ /dev/null @@ -1,2 +0,0 @@ -highlight link vimVar Identifier -highlight link vimRedirFile String diff --git a/runtime/syntax/testdir/input/sh_13.sh b/runtime/syntax/testdir/input/sh_13.sh deleted file mode 100644 index 18fd0d13..00000000 --- a/runtime/syntax/testdir/input/sh_13.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/dash -# Issue #17026 (bash highlighting requires space after $()) -# https://github.com/vim/vim/issues/17026#issuecomment-2774112284 - -_comp_compgen_split -l -- "$( - tmux list-commands -F "#{command_list_name}" - tmux list-commands -F "#{command_list_alias}" -)" - diff --git a/runtime/syntax/testdir/input/sh_14.sh b/runtime/syntax/testdir/input/sh_14.sh deleted file mode 100644 index bfa3d93a..00000000 --- a/runtime/syntax/testdir/input/sh_14.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Issue #17221 (sh syntax: escaped square brackets don't work in [[ ]]) - -[[ foo == [bar] ]] -[[ foo == \[bar\] ]] - -echo [foo] -echo \[foo\] diff --git a/runtime/syntax/testdir/input/sh_ksh_array.sh b/runtime/syntax/testdir/input/sh_ksh_array.sh deleted file mode 100755 index 22806ffc..00000000 --- a/runtime/syntax/testdir/input/sh_ksh_array.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/ksh - -foo=( - ( 00 01 ) - ( 10 11 ) -) - -bar=( - [0]=( - [0]=00 - [1]=01 - ) - [1]=( - [0]=10 - [1]=11 - ) -) - - -echo ${foo[1][1]} # => 11 -echo ${bar[1][1]} # => 11 diff --git a/runtime/syntax/testdir/input/sh_quoting.sh b/runtime/syntax/testdir/input/sh_quoting.sh deleted file mode 100644 index dc6a5152..00000000 --- a/runtime/syntax/testdir/input/sh_quoting.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/dash - -echo ${foo:-'string \'} - diff --git a/runtime/syntax/testdir/input/vim9_comment.vim b/runtime/syntax/testdir/input/vim9_comment.vim index 590ddd86..fd6a5d2a 100644 --- a/runtime/syntax/testdir/input/vim9_comment.vim +++ b/runtime/syntax/testdir/input/vim9_comment.vim @@ -34,10 +34,6 @@ autocmd BufNewFile * { \ continuing comment \ continuing comment -var foo = 42 # commment - \ continuing comment - \ continuing comment - # :Foo \ arg1 #\ comment @@ -55,18 +51,6 @@ echo "TOP" \ arg2 -# Expression comments - -var foo = { # comment - # comment - bar: 42, # comment - # comment - # comment - baz: 42 # comment - # comment -} # comment - - # Issue: #13047 if !exists(":DiffOrig") @@ -78,15 +62,3 @@ endif # Issue: #11307 and #11560 # This is what we call " blah - - -# PR: #14975 -# https://github.com/vim/vim/pull/14975#issuecomment-2832643115 - -var d = { - a: 0, -# a ' quote {{{ -#}}} -b: 0, -} - diff --git a/runtime/syntax/testdir/input/vim9_constructor.vim b/runtime/syntax/testdir/input/vim9_constructor.vim deleted file mode 100644 index 71a2ea42..00000000 --- a/runtime/syntax/testdir/input/vim9_constructor.vim +++ /dev/null @@ -1,19 +0,0 @@ -vim9script - -# Vim9 constructor - - -class A - static var _instance: A - var str: string - def _new(str: string) - this.str = str - enddef - static def GetInstance(str: string): A - if _instance == null - _instance = A._new(str) - endif - return _instance - enddef -endclass - diff --git a/runtime/syntax/testdir/input/vim9_ex_enum.vim b/runtime/syntax/testdir/input/vim9_ex_enum.vim deleted file mode 100644 index 8529deda..00000000 --- a/runtime/syntax/testdir/input/vim9_ex_enum.vim +++ /dev/null @@ -1,111 +0,0 @@ -vim9script -# Vim :enum command -# VIM_TEST_SETUP hi link vim9EnumValue Todo - - -interface Interface1 - def Def1() -endinterface -interface Interface2 -endinterface - -# enum-implements clause with interspersed comments - -enum Enum1 implements Interface1, Interface2 - Value1 - def Def1() - enddef -endenum - -enum Enum2 - \ implements Interface1, Interface2 - Value1 - def Def1() - enddef -endenum - -enum Enum3 # comment - \ implements Interface1, Interface2 - Value1 -endenum - -enum Enum4 - # comment - \ implements Interface1, Interface2 - Value1 -endenum - -enum Enum5 - \ implements Interface1, Interface2 # comment - Value1 - def Def1() - enddef -endenum - -enum Enum6 - #\ comment - \ implements Interface1, Interface2 - Value1 - def Def1() - enddef -endenum - -# [enum Enum7.Value1 {name: 'Value1', ordinal: 0, val1: 0, val2: 0}, enum Enum7.Value2 {name: 'Value2', ordinal: 1, val1: 1, val2: 0}, enum Enum7.Value3 {name: 'Value3', ordinal: 2, val1: 2, val2: 0}] -# comment -enum Enum7 - \ - #\ comment - \ - #\ comment - \ implements Interface1, Interface2 # comment - # comment - # comment - Value1, # comment - # comment - # comment - Value2(1 + 0), # comment - # comment - # comment - Value3( # comment - # comment - 1 # comment - # comment - + # comment - # comment - 1 # comment - ) # comment - # comment - var val1: number # comment - # comment - def Def1() - enddef - # comment - static def Def2() # comment - # comment - enddef # comment - # comment - public var val2: number # comment -endenum - -# [enum Enum8.implements {name: 'implements', ordinal: 0}] -enum Enum8 implements Interface1, Interface2 - implements - def Def1() - enddef -endenum - -# [enum Enum9.Value1 {name: 'Value1', ordinal: 0, implements: 0}] -enum Enum9 implements Interface1, Interface2 - Value1 - var implements: number - def Def1() - enddef -endenum - -# [enum Enum10.implements {name: 'implements', ordinal: 0}] -enum Enum10 implements Interface1, Interface2 - implements - def Def1() - enddef -endenum - diff --git a/runtime/syntax/testdir/input/vim9_ex_enum2.vim b/runtime/syntax/testdir/input/vim9_ex_enum2.vim deleted file mode 100644 index e3b3d2dc..00000000 --- a/runtime/syntax/testdir/input/vim9_ex_enum2.vim +++ /dev/null @@ -1,32 +0,0 @@ -vim9script -# Vim :enum command -# VIM_TEST_SETUP hi link vim9EnumValue Todo - - -# See: https://github.com/vim/vim/pull/16365#issuecomment-2571420551 - -enum Letter - # - ######################################### - A("(\" # not a comment NOR_ANOTHER_VALUE, - \ "), B(")\""), C($"'') - \('"), D($'""(),"'), E, - F( - ")" .. # FA, - "(" # FB, - ), G - #enum NotSupported - #endenum - - def new(this.value = v:none) - return - enddef - const value: string -endenum - -for letter in Letter.values - echo letter -endfor - -echo Letter.D - diff --git a/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim b/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim index b6dfc4ea..0656907e 100644 --- a/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim +++ b/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim @@ -2,8 +2,6 @@ vim9script # Vim :enum command # VIM_TEST_SETUP let g:vimsyn_folding = 'ef' # VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax -# VIM_TEST_SETUP hi link vim9EnumValue Todo - interface Interface1 endinterface @@ -31,20 +29,11 @@ enum Enum4 endenum enum Enum5 implements Interface1, Interface2 - Value1, - Value2, - Value3 - def Method1() - def Nested() + Value1, + Value2, + Value3 + def Method1() + def Nested() + enddef enddef - enddef endenum - -enum Enum6 - #\ comment - \ implements Interface1, Interface2 - Value1, - Value2, - Value3 -endenum - diff --git a/runtime/syntax/testdir/input/vim9_expr.vim b/runtime/syntax/testdir/input/vim9_expr.vim index e291309e..fc94abd5 100644 --- a/runtime/syntax/testdir/input/vim9_expr.vim +++ b/runtime/syntax/testdir/input/vim9_expr.vim @@ -2,22 +2,6 @@ vim9script # Vim9-script expressions -# Number - -# ' separated - -echo 1'000'000 -echo 1'000'000.00 -echo -1'000'000 -echo -1'000'000.00 - -echo 0b1000'0000 -echo 0o1000'0000 -echo 0x1000'0000 -echo -0b1000'0000 -echo -0o1000'0000 -echo -0x1000'0000 - # Dictionary echo {} @@ -165,7 +149,7 @@ def Foo() enddef -# Issue #16227 (Vim script ternary expression highlighting) +# Issue #16227 (Vimscript ternary expression highlighting) var foo = 'foo' # comment var bar = foo == 'foo' ? 'bar' : 'baz' diff --git a/runtime/syntax/testdir/input/vim9_function_calls.vim b/runtime/syntax/testdir/input/vim9_function_calls.vim index 0b9f4c25..aecfc114 100644 --- a/runtime/syntax/testdir/input/vim9_function_calls.vim +++ b/runtime/syntax/testdir/input/vim9_function_calls.vim @@ -7,7 +7,7 @@ clearmatches() echo "Foo" | clearmatches() -# Issue 16721 (Vim script highlight of builtin function after |) +# Issue 16721 (vimscript highlight of builtin function after |) &directory = $'{$MYVIMDIR}/.data/swap/' &backupdir = $'{$MYVIMDIR}/.data/backup//' diff --git a/runtime/syntax/testdir/input/vim9_lambda.vim b/runtime/syntax/testdir/input/vim9_lambda.vim index 81d9dc27..4340eb09 100644 --- a/runtime/syntax/testdir/input/vim9_lambda.vim +++ b/runtime/syntax/testdir/input/vim9_lambda.vim @@ -1,7 +1,4 @@ vim9script -# VIM_TEST_SETUP hi link vim9LambdaOperator Todo -# VIM_TEST_SETUP hi link vim9LambdaParen Todo - # Vim 9 lambda expressions @@ -9,7 +6,6 @@ var Foo: func var expr = 0 # without return type - Foo = () => expr Foo = (_) => expr Foo = (x) => expr @@ -30,7 +26,6 @@ Foo = (x: number, ...y: list) => expr Foo = (x: number, y: number) => expr # with return type - Foo = (): number => expr Foo = (_): number => expr Foo = (x): number => expr @@ -50,27 +45,6 @@ Foo = (x: number, ...y: list): number => expr Foo = (x: number, y: number): number => expr -# with compound return type - -Foo = (): list => expr -Foo = (_): list => expr -Foo = (x): list => expr - -Foo = (...y): list => expr -Foo = (_, ...y): list => expr -Foo = (x, ...y): list => expr - -Foo = (x, y): list => expr - -Foo = (_: number): list => expr -Foo = (x: number): list => expr - -Foo = (...y: list): list => expr -Foo = (_: number, ...y: list): list => expr -Foo = (x: number, ...y: list): list => expr - -Foo = (x: number, y: number): list => expr - # post operator comments @@ -88,29 +62,15 @@ Foo = () => # line continuations -Foo = (x: string, - \ y: number, - \ z: bool) => expr - -Foo = (x: string, - \ y: number, - \ z: bool) - \ => expr - Foo = (x: string, \ y: number, \ z: bool): number => expr - +# FIXME Foo = (x: string, \ y: number, \ z: bool): number \ => expr -Foo = (x: string, - \ y: number, - \ z: bool): - \ number => expr - # funcref call @@ -154,9 +114,3 @@ def Op(): func(func(number, number): number): func(number, Digit): number (x: number, y: Digit): number => F(x, y.value) enddef ####################### ^ vimCommand? - -# Issue #16965 (vim syntax: wrong highlight with lambda, autoload, and false keyword) - -autocmd BufRead * timer_start(0, (_) => f#a(false, false)) -autocmd - diff --git a/runtime/syntax/testdir/input/vim9_shebang.vim b/runtime/syntax/testdir/input/vim9_shebang.vim old mode 100644 new mode 100755 diff --git a/runtime/syntax/testdir/input/vim9_tuple.vim b/runtime/syntax/testdir/input/vim9_tuple.vim deleted file mode 100644 index 99370a55..00000000 --- a/runtime/syntax/testdir/input/vim9_tuple.vim +++ /dev/null @@ -1,26 +0,0 @@ -vim9script - -# Vim9 tuples - - -# https://github.com/vim/vim/pull/16935#issuecomment-2738310273 - -function LegacyMakeEntry(key, value) abort - return (a:key, a:value) -endfunction - -def MakeEntry(key: string, value: any): tuple - return (key, value) -enddef - -function LegacyMakeLazyList(e1, e2) abort - return ({e1_, e2_ -> {-> [e1_, e2_]}}(a:e1, a:e2)) -endfunction - -def MakeLazyList(e1: any, e2: any): func(): list - return (((e1_: any, e2_: any) => () => [e1_, e2_])(e1, e2)) -enddef - -echo MakeEntry('key', 'value') == list2tuple(MakeLazyList('key', 'value')()) -echo LegacyMakeEntry('key', 'value') == list2tuple(LegacyMakeLazyList('key', 'value')()) - diff --git a/runtime/syntax/testdir/input/vim9_variables.vim b/runtime/syntax/testdir/input/vim9_variables.vim index 35210452..14b1d1dd 100644 --- a/runtime/syntax/testdir/input/vim9_variables.vim +++ b/runtime/syntax/testdir/input/vim9_variables.vim @@ -47,24 +47,6 @@ var foo =<< eval trim END ... END -# Typed declarations - -var foo: tuple = expr -var foo: tuple = expr -var foo: tuple = expr -var foo: tuple<...list> = expr -var foo: tuple<...list> = expr -var foo: tuple> = expr - -var foo: tuple< - #\ comment - \number, - #\ comment - \string, - #\ comment - \bool - \> - # Assignments foo = expr diff --git a/runtime/syntax/testdir/input/vim_comment.vim b/runtime/syntax/testdir/input/vim_comment.vim index 2ca67875..f382f8df 100644 --- a/runtime/syntax/testdir/input/vim_comment.vim +++ b/runtime/syntax/testdir/input/vim_comment.vim @@ -31,10 +31,6 @@ autocmd BufNewFile * { \ continuing comment \ continuing comment -let foo = 42 " commment - \ continuing comment - \ continuing comment - " :Foo \ arg1 "\ comment diff --git a/runtime/syntax/testdir/input/vim_ex_augroup.vim b/runtime/syntax/testdir/input/vim_ex_augroup.vim index 7f7f3463..2dae59dd 100644 --- a/runtime/syntax/testdir/input/vim_ex_augroup.vim +++ b/runtime/syntax/testdir/input/vim_ex_augroup.vim @@ -1,62 +1,19 @@ " Vim :augroup command -" VIM_TEST_SETUP let g:vimsyn_folding = "a" -" VIM_TEST_SETUP setl fdc=2 fdl=999 fdm=syntax -" VIM_TEST_SETUP highlight link vimAugroupName Todo - augroup foo - autocmd! - autocmd BufRead * echo "Foo" + autocmd BufRead * echomsg "Foo" augroup END -augroup foo | autocmd! | augroup END +augroup foo | autocmd! | augroup END augroup! foo augroup !@#$%^&*()_+ autocmd BufRead * echomsg "Foo" augroup END -augroup !@#$%^&*()_+ | autocmd! | augroup END -augroup! !@#$%^&*()_+ - -augroup !@#$%^&*()_+ | autocmd! | augroup END +augroup !@#$%^&*()_+ | autocmd! | augroup END augroup! !@#$%^&*()_+ -augroup no\|echo | autocmd! | augroup END -augroup! no\|echo - -augroup no\"echo | autocmd! | augroup END -augroup! no\"echo - -augroup \|echo\| | autocmd! | augroup END -augroup! \|echo\| - -augroup \"echo\" | autocmd! | augroup END -augroup! \"echo\" - -augroup \|\" | autocmd! | augroup END -augroup! \|\" - -augroup \"\| | autocmd! | augroup END -augroup! \"\| - - -augroup foo"comment - au! - au BufRead * echo "Foo" -augroup END"comment - -augroup foo|echo "Foo" - au! - au BufRead * echo "Foo" -augroup END|echo "Foo" - -augroup! foo"comment -augroup! foo|echo "Foo" - - " list groups augroup -augroup | echo "Foo" -augroup " comment diff --git a/runtime/syntax/testdir/input/vim_ex_autocmd.vim b/runtime/syntax/testdir/input/vim_ex_autocmd.vim deleted file mode 100644 index 162f9337..00000000 --- a/runtime/syntax/testdir/input/vim_ex_autocmd.vim +++ /dev/null @@ -1,264 +0,0 @@ -" Vim :autocmd command -" VIM_TEST_SETUP highlight vimAutoCmdGroup Todo -" VIM_TEST_SETUP highlight vimUserAutoEvent Title - - -" Define - -autocmd foogroup BufRead *.txt echo "Foo" | echo "Bar" -autocmd BufRead *.txt echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile *.txt echo "Foo" | echo "Bar" -autocmd User FooEvent *.txt echo "Foo" | echo "Bar" - -autocmd foogroup BufRead *.txt ++once echo "Foo" | echo "Bar" -autocmd BufRead *.txt ++once echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile *.txt ++once echo "Foo" | echo "Bar" -autocmd User FooEvent *.txt ++once echo "Foo" | echo "Bar" - -autocmd foogroup BufRead *.txt ++nested echo "Foo" | echo "Bar" -autocmd BufRead *.txt ++nested echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile *.txt ++nested echo "Foo" | echo "Bar" -autocmd User FooEvent *.txt ++nested echo "Foo" | echo "Bar" - -autocmd foogroup BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile *.txt ++once ++nested echo "Foo" | echo "Bar" -autocmd User FooEvent *.txt ++once ++nested echo "Foo" | echo "Bar" - -autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" -autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" -autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" -autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" -autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" -autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" -autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" - -autocmd foogroup BufRead foo ++once ++nested echo "Foo" | echo "Bar" - -autocmd BufRead *.txt { - echo "Foo" - echo "Bar" -} -autocmd BufRead,BufNewFile *.txt { - echo "Foo" - echo "Bar" -} -autocmd User FooEvent *.txt { - echo "Foo" - echo "Bar" -} -autocmd foogroup BufRead *.txt { - echo "Foo" - echo "Bar" -} - - -" Multiline {cmd} arg - -autocmd BufRead *.txt echo "Foo" - \| echo "Bar" - \| echo "Baz" - -autocmd BufRead *.txt echo "Foo" | - \ echo "Bar" | - \ echo "Baz" - -autocmd BufRead *.txt - "\ comment - \ echo "Foo" | - "\ comment - \ echo "Bar" - "\ comment - \| echo "Baz" - -autocmd BufRead,BufNewFile *.txt - "\ comment - \ echo "Foo" | - "\ comment - \ echo "Bar" - "\ comment - \| echo "Baz" -autocmd User FooEvent *.txt - "\ comment - \ echo "Foo" | - "\ comment - \ echo "Bar" - "\ comment - \| echo "Baz" -autocmd foogroup BufRead *.txt - "\ comment - \ echo "Foo" | - "\ comment - \ echo "Bar" - "\ comment - \| echo "Baz" - - -" Multiple patterns - -autocmd BufRead *.txt,*.vim,*.c echo "Foo" | echo "Bar" -autocmd BufRead ,*.vim,*.c echo "Foo" | echo "Bar" -autocmd BufRead *.txt,,*.c echo "Foo" | echo "Bar" -autocmd BufRead *.txt,*.vim, echo "Foo" | echo "Bar" - -autocmd BufRead ,, echo "Foo" | echo "Bar" - - -" FIXME: "BufRead" and "*" are valid group names, however, :help :augroup -" explicitly directs the user NOT to shadow event names with group names -autocmd BufRead BufRead *.txt ++once ++nested echo "Foo" -autocmd * BufRead *.txt ++once ++nested echo "Foo" - - -" Remove - -autocmd! foogroup BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" -autocmd! BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" -autocmd! foogroup User FooEvent *.txt ++once ++nested echo "Foo" | echo "Bar" -autocmd! User FooEvent *.txt ++once ++nested echo "Foo" | echo "Bar" - -autocmd! foogroup BufRead *.txt -autocmd! BufRead *.txt -autocmd! foogroup User FooEvent *.txt -autocmd! User FooEvent *.txt - -autocmd! foogroup * *.txt -autocmd! * *.txt - -autocmd! foogroup BufRead -autocmd! BufRead -autocmd! foogroup User FooEvent -autocmd! User FooEvent - -autocmd! foogroup -autocmd! - -" command -> bang -> group "!foogroup!" -autocmd!!foogroup! -" command -> bang -> group "foogroup" -autocmd!foogroup -" command -> bang -> event -autocmd!BufRead -" command -> bang -> user event -autocmd!User FooEvent - -" FIXME: "*" and "BufRead" are valid group names, however, :help :augroup -" explicitly directs the user NOT to shadow event names -" command -> group "*" -> event glob -> pattern -autocmd!* * *.txt -" command -> group "BufRead" -> event "BufRead" -> pattern -autocmd!BufRead BufRead *.txt - - -" List - -autocmd foogroup BufRead *.txt -autocmd BufRead *.txt -autocmd foogroup User FooEvent *.txt -autocmd User FooEvent *.txt - -autocmd foogroup * *.txt -autocmd * *.txt - -autocmd foogroup BufRead -autocmd BufRead -autocmd foogroup User FooEvent -autocmd User FooEvent - -autocmd foogroup -autocmd - - -" :doautoall - -doautoall BufRead - -doautoall BufRead *.txt -doautoall foogroup BufRead -doautoall BufRead - -doautoall foogroup BufRead *.txt - -doautoall User FooEvent - -doautoall User FooEvent *.txt -doautoall foogroup User FooEvent -doautoall User FooEvent - -doautoall foogroup User FooEvent *.txt - -doautoall foogroup BufRead *.txt | echo "Foo" -doautoall foogroup BufRead *.txt " comment - - -" :doautocmd - -doautocmd BufRead - -doautocmd BufRead *.txt -doautocmd foogroup BufRead -doautocmd BufRead - -doautocmd foogroup BufRead *.txt - -doautocmd User FooEvent - -doautocmd User FooEvent *.txt -doautocmd foogroup User FooEvent -doautocmd User FooEvent - -doautocmd foogroup User FooEvent *.txt - -doautocmd foogroup BufRead *.txt | echo "Foo" -doautocmd foogroup BufRead *.txt | " comment - - -" patterns - -au BufRead */*.txt - -au BufRead */*.* -au BufRead */*.??? -au BufRead */*.[t][x]t - -au BufRead */*.[a-z][a-z]t -au BufRead */*.[[:alpha:][:alpha:]]t - -au BufRead */*.[tx]\\\{2\}t -au BufRead */*.[a-z]\\\{2\}t -au BufRead */*.[[:alpha:]]\\\{2\}t -au BufRead */*.[^[:punct:]]\\\{2\}t - -au BufRead */*.[]]xt -au BufRead */*.[^]]xt - -au BufRead */*.[t\]]xt -au BufRead */*.[^t\]]xt - -au BufRead */*.[[]xt -au BufRead */*.[^[]xt - -au BufRead */*.[-]xt -au BufRead */*.[^-]xt - -au BufRead */*.[-t-]xt -au BufRead */*.[^-t-]xt - -au BufRead */*.[\^]xt -au BufRead */*.[^^]xt - -au BufRead */*.txt,*/*.vim -au BufRead */*.{txt,vim} -au BufRead */*.{t{x,t},v{i,m}} - -" literal -au BufRead */*.[]xt -au BufRead */*.[\]xt -au BufRead */*.[^]xt -au BufRead */*.[^\]xt - diff --git a/runtime/syntax/testdir/input/vim_ex_command.vim b/runtime/syntax/testdir/input/vim_ex_command.vim index 4679b08e..0873648c 100644 --- a/runtime/syntax/testdir/input/vim_ex_command.vim +++ b/runtime/syntax/testdir/input/vim_ex_command.vim @@ -1,6 +1,4 @@ " Vim :command, :delcommand and :comclear commands -" VIM_TEST_SETUP highlight link vimUserCmdName Todo -" VIM_TEST_SETUP highlight link vimDelcommandName Todo " list @@ -8,12 +6,10 @@ command command F - " define command Foo echo "Foo" command! Foo echo "Foo" - command! Foo echo "Foo" | echo "Bar" command! Foo { @@ -22,27 +18,11 @@ command! Foo { echo "Baz" } -command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo echo "Foo" - -command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo - \ echo "Foo" - -command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register - \ Foo - \ echo "Foo" - command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo - "\ comment \ echo "Foo" -command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register - "\ comment - \ Foo - "\ comment - \ echo "Foo" - -command! -complete=custom,s:Completer1 Foo echo "Foo" -command! -complete=customlist,s:Completer2 Foo echo "Foo" +command! -complete=custom,Completer1 Foo echo "Foo" +command! -complete=customlist,Completer2 Foo echo "Foo" function Foo() command! Foo echo "Foo (defined in :function)" @@ -52,93 +32,43 @@ def Foo2() command! Foo echo "Foo (defined in :def)" enddef - " multiline define -command! -addr=lines - \ -bang - \ -bar - \ -buffer - \ -complete=buffer - \ -count - \ -nargs=* - \ -range - \ -register - \ -keepscript - \ Foo - \ echo "Foo" | - \ echo "Bar" - -command! - \ -addr=lines - \ -bang - \ -bar - \ -buffer - \ -complete=buffer - \ -count - \ -nargs=* - \ -range - \ -register - \ -keepscript - \ Foo - \ echo "Foo" | - \ echo "Bar" - -command! - "\ comment - \ -addr=lines - \ -bang - "\ comment - "\ comment - \ -bar - \ -buffer - "\ comment - \ -complete=buffer - "\ comment - \ -count - "\ comment - \ -nargs=* - "\ comment - \ -range - "\ comment - \ -register - "\ comment - \ -keepscript - "\ comment - \ Foo - "\ comment - \ echo "Foo" | - "\ comment - \ echo "Bar" - +" command! +" \ -addr=lines +" \ -bang +" \ -bar +" \ -buffer +" \ -complete=buffer +" \ -count +" \ -nargs=* +" \ -range +" \ -register +" \ -keepscript +" \ Foo +" \ echo "FOO" " errors command! -badattr=arguments -bang -badattr -nargs=* Foo echo "Foo" - " delete delcommand Foo delcommand -buffer Foo -delcommand Foo | echo "Foo" -delcommand -buffer Foo | echo "Foo" +delcommand Foo | echo "..." +delcommand -buffer Foo | echo "..." delcommand Foo " comment delcommand -buffer Foo " comment comclear comclear " comment -comclear | echo "Foo" +comclear | echo "..." -" Issue #14135 (vim.vim syntax highlighting broken wrt system()) +" Issue #14135 com Foo call system('ls') - -" Issue #17001 (Wrong vimUserCmdAttrError highlighting in vim.vim) - -command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ - diff --git a/runtime/syntax/testdir/input/vim_ex_def.vim b/runtime/syntax/testdir/input/vim_ex_def.vim index 819a1ada..d379d8f4 100644 --- a/runtime/syntax/testdir/input/vim_ex_def.vim +++ b/runtime/syntax/testdir/input/vim_ex_def.vim @@ -99,7 +99,7 @@ def Foo( z: string = "zed") enddef -" Issue #16243 (Vim script def parameters syntax highlight is wrong) +" Issue #16243 (vimscript def parameters syntax highlight is wrong) def Test(lines: list = [line('.'), line('.')]): void enddef diff --git a/runtime/syntax/testdir/input/vim_ex_filter.vim b/runtime/syntax/testdir/input/vim_ex_filter.vim deleted file mode 100644 index baf28a1e..00000000 --- a/runtime/syntax/testdir/input/vim_ex_filter.vim +++ /dev/null @@ -1,13 +0,0 @@ -" Vim :filter command -" VIM_TEST_SETUP highlight link vimCmdSep Operator - - -filter pa\%(tt\)ern oldfiles -filter! pa\%(tt\)ern oldfiles - -filter /pa\%(tt\)ern/ oldfiles -filter! /pa\%(tt\)ern/ oldfiles - -filter /pa\%(t|t\)ern/ oldfiles | echo "Foo" -filter! /pa\%(t|t\)ern/ oldfiles | echo "Foo" - diff --git a/runtime/syntax/testdir/input/vim_ex_function.vim b/runtime/syntax/testdir/input/vim_ex_function.vim index 95cf4586..c09019e0 100644 --- a/runtime/syntax/testdir/input/vim_ex_function.vim +++ b/runtime/syntax/testdir/input/vim_ex_function.vim @@ -177,7 +177,7 @@ function Foo(...) endfunction -" Issue #16243 (Vim script def parameters syntax highlight is wrong) +" Issue #16243 (vimscript def parameters syntax highlight is wrong) function Test(lines = [line('.'), line('.')]) endfunction diff --git a/runtime/syntax/testdir/input/vim_ex_grep.vim b/runtime/syntax/testdir/input/vim_ex_grep.vim deleted file mode 100644 index 234f2d96..00000000 --- a/runtime/syntax/testdir/input/vim_ex_grep.vim +++ /dev/null @@ -1,47 +0,0 @@ -" Vim :*grep and :*grepadd commands -" VIM_TEST_SETUP hi link vimCmdSep Operator -" VIM_TEST_SETUP hi link vimGrepBarEscape Special - - -grep 'pat\|tern' foo.txt -lgrep 'pat\|tern' foo.txt - -grep! 'pat\|tern' foo.txt -lgrep! 'pat\|tern' foo.txt - -grepadd 'pat\|tern' foo.txt -lgrepadd 'pat\|tern' foo.txt - -grepadd! 'pat\|tern' foo.txt -lgrepadd! 'pat\|tern' foo.txt - - -" special filename characters - -grep 'pat\|tern' % -lgrep 'pat\|tern' % - -grep! 'pat\|tern' % -lgrep! 'pat\|tern' % - -grepadd! 'pat\|tern' % -lgrepadd! 'pat\|tern' % - -grepadd! 'pat\|tern' % -lgrepadd! 'pat\|tern' % - - -" trailing bar, no tail comment - -grep 'pat\|tern' foo.txt | echo "Foo" -lgrep 'pat\|tern' foo.txt | echo "Foo" - -grep! 'pat\|tern' foo.txt | echo "Foo" -lgrep! 'pat\|tern' foo.txt | echo "Foo" - -grepadd 'pat\|tern' foo.txt | echo "Foo" -lgrepadd 'pat\|tern' foo.txt | echo "Foo" - -grepadd! 'pat\|tern' foo.txt | echo "Foo" -lgrepadd! 'pat\|tern' foo.txt | echo "Foo" - diff --git a/runtime/syntax/testdir/input/vim_ex_helpgrep.vim b/runtime/syntax/testdir/input/vim_ex_helpgrep.vim deleted file mode 100644 index aeef4501..00000000 --- a/runtime/syntax/testdir/input/vim_ex_helpgrep.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Vim :helpgrep command - - -helpgrep :help -helpgrep :help@en -helpgrep :h\%(elp\)\= - -lhelpgrep :help -lhelpgrep :help@en -lhelpgrep :h\%(elp\)\= - diff --git a/runtime/syntax/testdir/input/vim_ex_make.vim b/runtime/syntax/testdir/input/vim_ex_make.vim deleted file mode 100644 index 7ce87f2e..00000000 --- a/runtime/syntax/testdir/input/vim_ex_make.vim +++ /dev/null @@ -1,38 +0,0 @@ -" Vim :*make commands -" VIM_TEST_SETUP highlight link vimCmdSep Operator -" VIM_TEST_SETUP highlight link vimMakeBarEscape Special - - -make -lmake - -make! -lmake! - -make -options target -lmake -options target - -make! -options target -lmake! -options target - - -" special filename characters - -make % -lmake % - - -" trailing bar, no tail comment - -make tar\|get | echo "Foo" -lmake tar\|get | echo "Foo" - -make! tar\|get | echo "Foo" -lmake! tar\|get | echo "Foo" - -make | echo "Foo" -lmake | echo "Foo" - -make! | echo "Foo" -lmake! | echo "Foo" - diff --git a/runtime/syntax/testdir/input/vim_ex_redir.vim b/runtime/syntax/testdir/input/vim_ex_redir.vim deleted file mode 100644 index 1deb113f..00000000 --- a/runtime/syntax/testdir/input/vim_ex_redir.vim +++ /dev/null @@ -1,46 +0,0 @@ -" Vim :redir command - - -redir > filename -redir! > filename -redir > file name -redir! > file name - -redir >> filename -redir! >> filename -redir >> file name -redir! >> file name - -redir > filename " comment -redir > filename | echo "Foo" -redir > file name " comment -redir > file name | echo "Foo" - -redir >> filename " comment -redir >> filename | echo "Foo" -redir >> file name " comment -redir >> file name | echo "Foo" - -redir @a -redir @A - -redir @a> -redir @A> - -redir @a>> -redir @A>> - -redir @*> -redir @+> - -redir @*>> -redir @+>> - -redir @"> -redir @">> - -redir => var -redir =>> var - -redir END - diff --git a/runtime/syntax/testdir/input/vim_ex_set.vim b/runtime/syntax/testdir/input/vim_ex_set.vim index e1bfc0f9..0b1d0101 100644 --- a/runtime/syntax/testdir/input/vim_ex_set.vim +++ b/runtime/syntax/testdir/input/vim_ex_set.vim @@ -93,7 +93,7 @@ set path= \abc,def -" :CompilerSet +" CompilerSet CompilerSet makeprg=ant CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m, @@ -111,14 +111,3 @@ echo "Foo" set quoteescape=\ echo "Foo" - -" Issue #16913 (vim syntax: set langmap may have wrong highlight) - -set langmap+=ФЫВÐПРОЛДЖЭÐ;ASDFGHJKL\\:\\"\\| -set langmap+=ЯЧСМИТЬБЮ;ZXCVBNM<> - -set langmap+=ФЫВÐПРОЛДЖЭÐ;ASDFGHJKL\\:\\"\\| - \ langmap+=ЯЧСМИТЬБЮ;ZXCVBNM<> - -set langmap+=ФЫВÐПРОЛДЖЭÐ;ASDFGHJKL\\:\\"\\| langmap+=ЯЧСМИТЬБЮ;ZXCVBNM<> - diff --git a/runtime/syntax/testdir/input/vim_ex_set_backslash.vim b/runtime/syntax/testdir/input/vim_ex_set_backslash.vim deleted file mode 100644 index 53851a76..00000000 --- a/runtime/syntax/testdir/input/vim_ex_set_backslash.vim +++ /dev/null @@ -1,79 +0,0 @@ -" Vim :set command (escaped characters) -" VIM_TEST_SETUP hi link vimSetEscape DiffAdd -" VIM_TEST_SETUP hi link vimSetBarEscape DiffDelete -" VIM_TEST_SETUP hi link vimSetQuoteEscape DiffDelete -" VIM_TEST_SETUP hi link vimSetEqual DiffChange - - -echo "-- 1 --" -set titlestring=\afoo\abar\a " comment -echo &titlestring -set titlestring=\afoo\abar\a -echo &titlestring -set titlestring=\ foo\ bar\ " comment -echo &titlestring -set titlestring=\ foo\ bar\ -echo &titlestring -set titlestring=\|foo\|bar\| " comment -echo &titlestring -set titlestring=\|foo\|bar\| -echo &titlestring -set titlestring=\"foo\"bar\" " comment -echo &titlestring -set titlestring=\"foo\"bar\" -echo &titlestring - -echo "-- 2 --" -set titlestring=\\afoo\\abar\\a " comment -echo &titlestring -set titlestring=\\afoo\\abar\\a -echo &titlestring -set titlestring=\\ foo\\ bar\\ " comment -echo &titlestring -set titlestring=\\ foo\\ bar\\ -echo &titlestring -set titlestring=\\|foo\\|bar\\| " comment -echo &titlestring -set titlestring=\\|foo\\|bar\\| -echo &titlestring -set titlestring=\\"foo\\"bar\\" " comment -echo &titlestring -set titlestring=\\"foo\\"bar\\" -echo &titlestring - -echo "-- 3 --" -set titlestring=\\\afoo\\\abar\\\a " comment -echo &titlestring -set titlestring=\\\afoo\\\abar\\\a -echo &titlestring -set titlestring=\\\ foo\\\ bar\\\ " comment -echo &titlestring -set titlestring=\\\ foo\\\ bar\\\ -echo &titlestring -set titlestring=\\\|foo\\\|bar\\\| " comment -echo &titlestring -set titlestring=\\\|foo\\\|bar\\\| -echo &titlestring -set titlestring=\\\"foo\\\"bar\\\" " comment -echo &titlestring -set titlestring=\\\"foo\\\"bar\\\" -echo &titlestring - -echo "-- 4 --" -set titlestring=\\\\afoo\\\\abar\\\\a " comment -echo &titlestring -set titlestring=\\\\afoo\\\\abar\\\\a -echo &titlestring -set titlestring=\\\\ foo\\\\ bar\\\\ " comment -echo &titlestring -set titlestring=\\\\ foo\\\\ bar\\\\ -echo &titlestring -set titlestring=\\\\|foo\\\\|bar\\\\| " comment -echo &titlestring -set titlestring=\\\\|foo\\\\|bar\\\\| -echo &titlestring -set titlestring=\\\\"foo\\\\"bar\\\\" " comment -echo &titlestring -set titlestring=foo\\\\"\\\\"bar\\\\" -echo &titlestring - diff --git a/runtime/syntax/testdir/input/vim_ex_sort.vim b/runtime/syntax/testdir/input/vim_ex_sort.vim deleted file mode 100644 index eb957060..00000000 --- a/runtime/syntax/testdir/input/vim_ex_sort.vim +++ /dev/null @@ -1,55 +0,0 @@ -" Vim :sort command -" VIM_TEST_SETUP highlight link vimCmdSep Operator - - -sort -sort! - -sort ilu -sort! ilu - -sort /pa\%(tt\)ern/ ilu -sort! /pa\%(tt\)ern/ ilu - -sort /pa\%(tt\)ern/ rilu -sort! /pa\%(tt\)ern/ rilu - -sort nilu -sort! nilu -sort filu -sort! filu -sort xilu -sort! xilu -sort oilu -sort! oilu -sort bilu -sort! bilu - -sort /pa\%(tt\)ern/ nilu -sort! /pa\%(tt\)ern/ nilu -sort /pa\%(tt\)ern/ filu -sort! /pa\%(tt\)ern/ filu -sort /pa\%(tt\)ern/ xilu -sort! /pa\%(tt\)ern/ xilu -sort /pa\%(tt\)ern/ oilu -sort! /pa\%(tt\)ern/ oilu -sort /pa\%(tt\)ern/ bilu -sort! /pa\%(tt\)ern/ bilu - -sort /pa\%(tt\)ern/ rnilu -sort! /pa\%(tt\)ern/ rnilu -sort /pa\%(tt\)ern/ rfilu -sort! /pa\%(tt\)ern/ rfilu -sort /pa\%(tt\)ern/ rxilu -sort! /pa\%(tt\)ern/ rxilu -sort /pa\%(tt\)ern/ roilu -sort! /pa\%(tt\)ern/ roilu -sort /pa\%(tt\)ern/ rbilu -sort! /pa\%(tt\)ern/ rbilu - -sort | echo "Foo" -sort! | echo "Foo" - -sort /pa\%(t|t\)ern/ rilu | echo "Foo" -sort! /pa\%(t|t\)ern/ rilu | echo "Foo" - diff --git a/runtime/syntax/testdir/input/vim_ex_substitute.vim b/runtime/syntax/testdir/input/vim_ex_substitute.vim index 7ffd16dd..021060a0 100644 --- a/runtime/syntax/testdir/input/vim_ex_substitute.vim +++ b/runtime/syntax/testdir/input/vim_ex_substitute.vim @@ -124,6 +124,7 @@ s \&{string}& " Trailing comment and bar +" FIXME: trailing comment, no whitespace s" comment s| echo "Foo" diff --git a/runtime/syntax/testdir/input/vim_ex_vimgrep.vim b/runtime/syntax/testdir/input/vim_ex_vimgrep.vim deleted file mode 100644 index 97b9b86f..00000000 --- a/runtime/syntax/testdir/input/vim_ex_vimgrep.vim +++ /dev/null @@ -1,69 +0,0 @@ -" Vim :*vimgrep and :*vimgrepadd commands -" VIM_TEST_SETUP highlight link vimVimgrepFile Todo -" VIM_TEST_SETUP highlight link vimCmdSep Operator -" VIM_TEST_SETUP highlight link vimVimgrepBarEscape Special - - -vimgrep pa\%(tt\)ern foo.txt -vimgrep /pa\%(tt\)ern/ foo.txt - -vimgrep! pa\%(tt\)ern foo.txt -vimgrep! /pa\%(tt\)ern/ foo.txt - -vimgrep /pa\%(tt\)ern/gjf foo.txt - -" trailing bar, no tail comment -vimgrep /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" -vimgrep /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" - -vimgrepadd pa\%(tt\)ern foo.txt -vimgrepadd /pa\%(tt\)ern/ foo.txt - -vimgrepadd! pa\%(tt\)ern foo.txt -vimgrepadd! /pa\%(tt\)ern/ foo.txt - -vimgrepadd /pa\%(tt\)ern/gjf foo.txt - -" trailing bar, no tail comment -vimgrepadd /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" -vimgrepadd /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" - -lvimgrep pa\%(tt\)ern foo.txt -lvimgrep /pa\%(tt\)ern/ foo.txt - -lvimgrep! pa\%(tt\)ern foo.txt -lvimgrep! /pa\%(tt\)ern/ foo.txt - -lvimgrep /pa\%(tt\)ern/gjf foo.txt - -" trailing bar, no tail comment -lvimgrep /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" -lvimgrep /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" - -lvimgrepadd pa\%(tt\)ern foo.txt -lvimgrepadd /pa\%(tt\)ern/ foo.txt - -lvimgrepadd! pa\%(tt\)ern foo.txt -lvimgrepadd! /pa\%(tt\)ern/ foo.txt - -lvimgrepadd /pa\%(tt\)ern/gjf foo.txt - -" trailing bar, no tail comment -lvimgrepadd /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" -lvimgrepadd /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" - - -" file args - -" multiple files -vimgrep pa\%(tt\)ern foo.txt bar.txt -vimgrep /pa\%(tt\)ern/ foo.txt bar.txt - -" wildcard patterns -vimgrep pa\%(tt\)ern **/*.txt -vimgrep /pa\%(tt\)ern/ **/*.txt - -" special filename characters -vimgrep pa\%(tt\)ern % -vimgrep /pa\%(tt\)ern/ % - diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index e58450e0..9786ff8c 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -4,15 +4,6 @@ echo 'It''s a string' echo 'tab: \t, new line: \n, backslash: \\' echo "tab: \t, new line: \n, backslash: \\" -" string starts immediately after line continuation character - tests a -" comment/string distinguishing implementation quirk -echo "foo" - \"bar" - \ "baz" -echo 'foo' - \'bar' - \ 'baz' - " String escape sequences echo "\316 - \31 - \3 - \x1f - \xf - \X1F - \XF - \u02a4 - \U000002a4 - \b - \e - \f - \n - \r - \t - \\ - \" - \" @@ -30,13 +21,6 @@ echo "\<*C->>" echo "\>>" echo "\<*C->>>" -echo "" -echo "\"" -echo "foo\"" -echo "\"foo" -echo "foo\"bar" - -echo '' echo '''' echo '''foo' echo 'foo''' @@ -46,7 +30,6 @@ echo 'foo''bar' " https://github.com/tpope/vim-unimpaired/blob/6d44a6dc2ec34607c41ec78acf81657248580bf1/plugin/unimpaired.vim#L232 let cmd = 'put!=repeat(nr2char(10), v:count1)|silent '']+' - " String interpolation echo 'Don''t highlight interpolation: {{ {1 + 2} }}' @@ -56,61 +39,10 @@ echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" - -" Continued string - -let s = " - "\ comment - \ part 1 - "\ comment - \ part 2 - "\ comment - \" " tail comment - -let s = "\" - \\" part 1 \" - "\ escape sequence - \ \"part 2\" - \\"" " tail comment - -let s = ' - "\ comment - \ part 1 - "\ comment - \ part 2 - "\ comment - \' " tail comment - -let s = ''' - \'' part 1 '' - "\ escape sequence - \ ''part 2'' - \''' " tail comment - -let s = $" - "\ comment - \ part 1 - "\ comment - \ part 2 - "\ comment - \" " tail comment - -let s = $' - "\ comment - \ part 1 - "\ comment - \ part 2 - "\ comment - \' " tail comment - -call strlen("part 1 - "\ comment - \ part 2") - -call append(0, "part 1 - "\ comment - \ part 2") - +echo $'''' +echo $'''foo' +echo $'foo''' +echo $'foo''bar' " Number @@ -241,21 +173,6 @@ echo #{ " match as keys not scope dictionaries echo #{ b: 42, w: 42, t: 42, g: 42, l: 42, s: 42, a: 42, v: 42 } -" Tuple - -echo () -echo (42,) -echo ((11, 12), (21, 22), (31, 32)) -echo (1, - \ 2, - \ 3, - \ 4 - \) -echo (1, 'two', 1 + 2, "fo" .. "ur") - -echo foo + (42, 87) -echo (42, 87) + foo - " Register echo @" @@ -369,17 +286,12 @@ let foo = foo + \ bar + \ "baz" -let foo = foo + - "\ "comment string" - \ bar - " Function calls call Foo(v:true, v:false, v:null) " Issue #16221 (vimString becomes vimVar when preceded by !) - let bar = !'g:bar'->exists() diff --git a/runtime/syntax/testdir/input/vim_lambda.vim b/runtime/syntax/testdir/input/vim_lambda.vim index d08509c9..73a221b7 100644 --- a/runtime/syntax/testdir/input/vim_lambda.vim +++ b/runtime/syntax/testdir/input/vim_lambda.vim @@ -1,7 +1,4 @@ " Vim lambda expressions -" VIM_TEST_SETUP hi link vimLambdaOperator Todo -" VIM_TEST_SETUP hi link vimLambdaBrace Todo -" VIM_TEST_SETUP hi link vimFuncParam Identifier let expr = 42 @@ -59,17 +56,12 @@ let Foo = {x, \ z -> expr} let Foo = { - "\ comment \ x, - "\ comment \ y, - "\ comment \ z - "\ comment \ -> "\ comment \ expr - "\ comment \ } let Foo = {-> [ @@ -102,7 +94,6 @@ let Foo = {-> {-> #{ \ b: 83 \}}} - " :help lambda :let F = {arg1, arg2 -> arg1 - arg2} diff --git a/runtime/syntax/testdir/input/vim_shebang.vim b/runtime/syntax/testdir/input/vim_shebang.vim old mode 100644 new mode 100755 diff --git a/runtime/syntax/testdir/runtest.vim b/runtime/syntax/testdir/runtest.vim index 767510cb..4152702c 100644 --- a/runtime/syntax/testdir/runtest.vim +++ b/runtime/syntax/testdir/runtest.vim @@ -389,21 +389,18 @@ func RunTest() \ : {} lockvar DUMP_OPTS MAX_FAILED_COUNT XTESTSCRIPT let ok_count = 0 - let disused_pages = [] let failed_tests = [] let skipped_count = 0 let last_test_status = 'invalid' - let filter = '' " Create a map of setup configuration filenames with their basenames as keys. let setup = glob('input/setup/*.vim', 1, 1) \ ->reduce({d, f -> extend(d, {fnamemodify(f, ':t:r'): f})}, {}) " Turn a subset of filenames etc. requested for testing into a pattern. - if filereadable('../testdir/Xfilter') - let filter = readfile('../testdir/Xfilter') - \ ->map({_, v -> '^' .. escape(substitute(v, '_$', '', ''), '.')}) + let filter = filereadable('../testdir/Xfilter') + \ ? readfile('../testdir/Xfilter') + \ ->map({_, v -> '^' .. substitute(v, '_$', '', '')}) \ ->join('\|') - call delete('../testdir/Xfilter') - endif + \ : '' " Treat "^self-testing" as a string NOT as a regexp. if filter ==# '^self-testing' @@ -433,8 +430,8 @@ func RunTest() let filetype = substitute(root, '\([^_.]*\)[_.].*', '\1', '') let failed_root = 'failed/' .. root - for pagename in glob(failed_root .. '_\d*\.dump', 1, 1) - call delete(pagename) + for dumpname in glob(failed_root .. '_\d*\.dump', 1, 1) + call delete(dumpname) endfor call delete('done/' .. root) call writefile(XTESTSCRIPT, 'Xtestscript') @@ -480,11 +477,11 @@ func RunTest() call ch_log('First screendump for ' .. in_name_and_out_name) " Make a screendump at the start of the file: failed/root_00.dump let fail = VerifyScreenDump(buf, root_00, DUMP_OPTS) - let nr = 0 " Accommodate the next code block to "buf"'s contingency for self " wipe-out. try + let nr = 0 let keys_a = ":call ScrollToSecondPage((18 * 75 + 1), 19, 5) | redraw!\" let keys_b = ":call ScrollToNextPage((18 * 75 + 1), 19, 5) | redraw!\" while s:CannotSeeLastLine(ruler) @@ -506,15 +503,6 @@ func RunTest() call delete('Xtestscript') endtry - let nr += 1 - let pagename = printf('dumps/%s_%02d.dump', root, nr) - - while filereadable(pagename) - call add(disused_pages, pagename) - let nr += 1 - let pagename = printf('dumps/%s_%02d.dump', root, nr) - endwhile - " redraw here to avoid the following messages to get mixed up with screen " output. redraw @@ -585,10 +573,6 @@ func RunTest() call Message('FAILED: ' .. len(failed_tests) .. ': ' .. string(failed_tests)) call Message('skipped: ' .. skipped_count) - for pagename in disused_pages - call Message(printf('No input page found for "%s"', pagename)) - endfor - if !empty(failed_tests) call Message('') call Message('View generated screendumps with "../../src/vim --clean -S testdir/viewdumps.vim"') diff --git a/runtime/syntax/tutor.vim b/runtime/syntax/tutor.vim index 7d0cd31c..83ca547f 100644 --- a/runtime/syntax/tutor.vim +++ b/runtime/syntax/tutor.vim @@ -1,14 +1,7 @@ -" Language: Vim Tutor -" Maintainer: Vim Project -" Last Change: 2025 Apr 16 - if exists("b:current_syntax") finish endif -let s:cpo_save = &cpo -set cpo&vim - syn include @VIM syntax/vim.vim unlet b:current_syntax syn include @TUTORSHELL syntax/sh.vim @@ -82,5 +75,3 @@ hi def link tutorInlineX tutorX hi def link tutorShellPrompt Delimiter let b:current_syntax = "tutor" -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/syntax/typst.vim b/runtime/syntax/typst.vim index 686f7c3f..b1f05ec8 100644 --- a/runtime/syntax/typst.vim +++ b/runtime/syntax/typst.vim @@ -1,18 +1,14 @@ " Vim syntax file " Language: Typst -" Maintainer: Luca Saccarola " Previous Maintainer: Gregory Anders -" Based On: https://github.com/kaarmu/typst.vim +" Maintainer: Luca Saccarola " Last Change: 2024 Dec 09 -" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) +" Based on: https://github.com/kaarmu/typst.vim if exists('b:current_syntax') finish endif -let s:cpo_save = &cpo -set cpo&vim - syntax sync fromstart syntax spell toplevel @@ -474,7 +470,4 @@ highlight default typstMarkupBoldItalic term=bold,italic let b:current_syntax = 'typst' -let &cpo = s:cpo_save -unlet s:cpo_save - " }}}1 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index e144a9f2..6a21c5f2 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 May 04 +" Last Change: 2025 Mar 18 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -34,11 +34,11 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 " GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang' syn keyword vimCommand contained abo[veleft] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] nextgroup=vimBang -syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] ip[ut] is[earch] isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] nextgroup=vimBang -syn keyword vimCommand contained keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lw[indow] ls m[ove] ma[rk] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] nextgroup=vimBang -syn keyword vimCommand contained p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] nextgroup=vimBang -syn keyword vimCommand contained scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] nextgroup=vimBang -syn keyword vimCommand contained up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang +syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] ip[ut] is[earch] nextgroup=vimBang +syn keyword vimCommand contained isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nextgroup=vimBang +syn keyword vimCommand contained nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] nextgroup=vimBang +syn keyword vimCommand contained sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] nextgroup=vimBang +syn keyword vimCommand contained tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang " Lower priority for _new_ to distinguish constructors from the command. syn match vimCommand contained "\(\@!" @@ -47,15 +47,14 @@ syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue Di " vimOptions are caught only when contained in a vimSet {{{2 " GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod' -syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc skipwhite nextgroup=vimSetEqual,vimSetMod syn keyword vimOption contained cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding skipwhite nextgroup=vimSetEqual,vimSetMod syn keyword vimOption contained fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt msm mkspellmem ml modeline skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod " vimOptions: These are the turn-off setting variants {{{2 " GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR='' @@ -86,15 +85,15 @@ syn match vimOption contained "t_k;" " vimOptions: These are the variable names {{{2 " GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword vimOptionVarName contained', END_STR='' -syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete -syn keyword vimOptionVarName contained cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab -syn keyword vimOptionVarName contained ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase -syn keyword vimOptionVarName contained imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern -syn keyword vimOptionVarName contained mmt maxmemtot mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth -syn keyword vimOptionVarName contained pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode -syn keyword vimOptionVarName contained stal showtabline ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc -syn keyword vimOptionVarName contained top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin -syn keyword vimOptionVarName contained ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes +syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc +syn keyword vimOptionVarName contained cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding +syn keyword vimOptionVarName contained fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc +syn keyword vimOptionVarName contained imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt +syn keyword vimOptionVarName contained msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion +syn keyword vimOptionVarName contained qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff scl signcolumn +syn keyword vimOptionVarName contained scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold +syn keyword vimOptionVarName contained titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay +syn keyword vimOptionVarName contained xtermcodes " GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword vimOptionVarName contained', END_STR='' syn keyword vimOptionVarName contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo syn keyword vimOptionVarName contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD 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_ku @@ -115,38 +114,34 @@ syn keyword vimErrSetting contained invakm invaltkeymap invanti invantialias inv " AutoCmd Events {{{2 syn case ignore -" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern' -syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdlineLeavePre CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern -syn keyword vimAutoEvent contained FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern -syn keyword vimAutoEvent contained WinScrolled skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern - -syn keyword vimAutoEvent contained User skipwhite nextgroup=vimUserAutoEvent -syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern +" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='' +syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost +syn keyword vimAutoEvent contained FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized WinScrolled " Highlight commonly used Groupnames {{{2 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo " Default highlighting groups {{{2 " GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR='' -syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow +syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow syn match vimHLGroup contained "\" syn case match " Function Names {{{2 " GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR='' syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr -syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches cmdcomplete_info col complete complete_add complete_check complete_info complete_match confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect -syn keyword vimFuncName contained get getbufinfo getbufline getbufoneline getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget -syn keyword vimFuncName contained histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank -syn keyword vimFuncName contained ngettext nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime -syn keyword vimFuncName contained reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent -syn keyword vimFuncName contained sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill -syn keyword vimFuncName contained term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid -syn keyword vimFuncName contained win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor +syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline +syn keyword vimFuncName contained getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlID hlexists hlget hlset hostname +syn keyword vimFuncName contained iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank ngettext nr2char or pathshorten perleval popup_atcursor +syn keyword vimFuncName contained popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground +syn keyword vimFuncName contained remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword +syn keyword vimFuncName contained spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait +syn keyword vimFuncName contained terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos +syn keyword vimFuncName contained win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor " Predefined variable names {{{2 " GEN_SYN_VIM: vimVarName, START_STR='syn keyword vimVimVarName contained', END_STR='' syn keyword vimVimVarName contained count count1 prevcount errmsg warningmsg statusmsg shell_error this_session version lnum termresponse fname lang lc_time ctype charconvert_from charconvert_to fname_in fname_out fname_new fname_diff cmdarg foldstart foldend folddashes foldlevel progname servername dying exception throwpoint register cmdbang insertmode val key profiling fcs_reason fcs_choice beval_bufnr beval_winnr beval_winid beval_lnum beval_col beval_text scrollstart swapname swapchoice swapcommand char mouse_win mouse_winid mouse_lnum mouse_col operator searchforward hlsearch oldfiles windowid progpath completed_item option_new option_old option_oldlocal option_oldglobal option_command option_type errors false true none null numbermax numbermin numbersize -syn keyword vimVimVarName contained vim_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace t_tuple +syn keyword vimVimVarName contained vim_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace "--- syntax here and above generated by runtime/syntax/generator/gen_syntax_vim.vim --- @@ -275,24 +270,23 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber "\<\d\+\%('\d\+\)*" skipwhite nextgroup=@vimComment,vimSubscript,vimGlobal,vimSubst1 -syn match vimNumber "\<\d\+\%('\d\+\)*\.\d\+\%(e[+-]\=\d\+\)\=" skipwhite nextgroup=@vimComment -syn match vimNumber "\<0b[01]\+\%('[01]\+\)*" skipwhite nextgroup=@vimComment,vimSubscript -syn match vimNumber "\<0o\=\o\+\%('\o\+\)*" skipwhite nextgroup=@vimComment,vimSubscript -syn match vimNumber "\<0x\x\+\%('\x\+\)*" skipwhite nextgroup=@vimComment,vimSubscript -syn match vimNumber '\<0z\>' skipwhite nextgroup=@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vimComment,vimSubscript +syn match vimNumber '\<\d\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript +syn match vimNumber '\<\d\+\.\d\+\%(e[+-]\=\d\+\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimFor,vimFunction,vimFuncFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimLockvar,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "\\\@1" nextgroup=vimBang contains=vimCommand syn match vimBang contained "!" -syn match vimWhitespace contained "\s\+" syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList @@ -375,45 +369,34 @@ syn keyword vimFTOption contained detect indent off on plugin " Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 " ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue - -" define -VimFolda syn region vimAugroup - \ start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" - \ matchgroup=vimAugroupKey - \ end="\\ze\s\+[eE][nN][dD]\>" - \ skipwhite nextgroup=vimAugroupEnd - \ contains=vimAutocmd,@vimAugroupList,vimAugroupkey +syn match vimAugroup "\" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup +if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' + syn region vimAugroup fold start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd +else + syn region vimAugroup start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd +endif if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror") - syn match vimAugroupError "\\s\+[eE][nN][dD]\>" + syn match vimAugroupError "\\s\+[eE][nN][dD]\>" endif -" TODO: Vim9 comment -syn match vimAugroupName contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" - \ skipwhite nextgroup=vimCmdSep,vimComment -syn match vimAugroupEnd contained "\c\" skipwhite nextgroup=vimCmdSep,vimComment -syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAugroupName -syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAugroupName,vimAugroupEnd - -" remove -syn match vimAugroup "\\ze\s*\%(["|]\|$\)" skipwhite nextgroup=vimCmdSep,vimComment contains=vimAugroupKey -Vim9 syn match vimAugroup "\\ze\s*\%([#|]\|$\)" skipwhite nextgroup=vimCmdSep,vim9Comment contains=vimAugroupKey +syn match vimAutoCmdGroup contained "\S\+" +syn match vimAugroupEnd contained "\c\" +syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoCmdGroup +syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup,vimAugroupEnd " Operators: {{{2 " ========= -syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString +syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile -syn match vimOper "\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile -syn match vimOper "\=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile +syn match vimOper "\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=@vimExprList -syn region vimLambda contained - \ matchgroup=vimLambdaBrace - \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+ - \ skip=+\n\s*\%(\\\|"\\ \)+ - \ end="}" end="$" - \ contains=@vimContinue,@vimExprList,vimLambdaParams -syn match vimLambdaParams contained "\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=@vimContinue,vimFuncParam - -syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment -syn match vim9LambdaParen contained "[()]" -syn match vim9LambdaParams contained - \ "(\%(\" - \ skipwhite nextgroup=vim9LambdaOperator - \ contains=@vim9Continue,vimDefParam,vim9LambdaParen,vim9LambdaReturnType -syn region vim9LambdaReturnType contained start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@vim9Continue,@vimType transparent -syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList +syn region vimLambda contained matchgroup=Delimiter start="{\ze[[:space:][:alnum:]_.,]*->" end="}" end="$" skip=+\s*\n\s*\\\|\s*\n\s*"\\ + contains=@vimContinue,@vimExprList,vimLambdaParams +syn match vimLambdaParams contained "{\@1<=.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=vimFuncParam + +syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment +syn match vim9LambdaParamsParen contained "[()]" +syn region vim9LambdaParams contained + \ matchgroup=vim9LambdaParamsParen + \ start="(\ze\s*\(\.\.\.\)\=\h\w*[,:]\%(\s\|$\)" + \ start="(\ze\s*\n + "\ line continuations + \\%(\s*\%(#\\ .*\|\\\s*\)\n\)*\s*\\\s* + "\ parameter names + \\(\.\.\.\)\=\h\w*[,:]\%(\s\|$\)" + \ end=")\ze\%(:\s\|\s\+=>\)" + \ matchgroup=vimContinue + \ end="^\s*\\\ze\s\+=>" + \ skipwhite nextgroup=vim9LambdaReturnType,vim9LambdaOperator + \ contains=@vim9Continue,vimDefParam,vim9LambdaParamsParen +syn match vim9LambdaParams contained "(\s*)\|(\s*\(\.\.\.\)\=\h\w*\s*)\ze\%(:\s\|\s\+=>\)" skipwhite nextgroup=vim9LambdaReturnType,vim9LambdaOperator contains=vimDefParam,vim9LambdaParamsParen + +syn region vim9LambdaReturnType contained start=":\s" end="$" end="\ze#" end="\ze=>" skipwhite skipempty nextgroup=vim9LambdaOperator,vim9LamdaOperatorComment contains=vimTypeSep transparent +syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment @@ -499,6 +488,8 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' syn region vimDefFold start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="\" contains=vimDef fold keepend extend transparent endif +syn match vimFuncBlank contained "\s\+" + " Types: {{{2 " ===== @@ -516,10 +507,9 @@ syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType conta syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType syn keyword vimType contained any blob bool channel float job number string void -syn match vimType contained "\<\%(func\)\>" -syn region vimCompoundType contained matchgroup=vimType start="\" +syn region vimCompoundType contained matchgroup=vimType start="\" syn cluster vimType contains=vimType,vimCompoundType,vimUserType @@ -528,7 +518,6 @@ syn cluster vimType contains=vimType,vimCompoundType,vimUserType " ============================= if s:vim9script - " Methods {{{3 syn match vim9MethodDef contained "\" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName @@ -537,7 +526,7 @@ if s:vim9script \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError \ contains=vimDefParam,vim9Comment,vimFuncParamEquals - syn match vim9ConstructorDefName contained "\<_\=new\w*\>" + syn match vim9ConstructorDefName contained "\" \ nextgroup=vim9ConstructorDefParams \ contains=@vim9MethodName syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>" @@ -574,14 +563,14 @@ if s:vim9script if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") syn match vim9MethodNameError contained "\<[a-z0-9]\i\>" endif - syn match vim9MethodName contained "\<_\=new\w*\>" + syn match vim9MethodName contained "\" syn keyword vim9MethodName contained empty len string syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' syn region vim9MethodDefFold contained start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent - syn region vim9MethodDefFold contained start="^\s*:\=def\s\+_\=new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent + syn region vim9MethodDefFold contained start="^\s*:\=def\s\+new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent endif syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold @@ -608,48 +597,10 @@ if s:vim9script VimFoldc syn region vim9ClassBody start="\" matchgroup=vimCommand end="\" contains=@vim9ClassBodyList transparent " Enums {{{3 - syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,@vimExprList,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Var - - syn match vim9Enum contained "\" skipwhite nextgroup=vim9EnumName - - syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipempty nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements - syn match vim9EnumNameTrailing contained "\S.*" - syn region vim9EnumNameComment contained - \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" - \ skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue - \ contains=@vimCommentGroup,vimCommentString - " vim9EnumName's "skipempty" should only apply to comments and enum values and not implements clauses - syn match vim9EnumNameEmpty contained "^" skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue - " allow line continuation between enum name and "implements" - syn match vim9EnumNameContinue contained - \ "^\s*\\" - \ skipwhite skipnl nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements - \ contains=vimWhitespace - syn match vim9EnumNameContinueComment contained - \ "^\s*#\\ .*" - \ skipwhite skipnl nextgroup=vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue - \ contains=vimWhitespace - syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment - - " enforce enum value list location - syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment - syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment - syn region vim9EnumValueListCommaComment contained - \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" - \ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue - \ contains=@vimCommentGroup,vimCommentString - syn region vim9EnumValueArgList contained - \ matchgroup=vimParenSep start="(" end=")" - \ nextgroup=vim9EnumValueListComma - \ contains=@vimExprList,vimContinueString,vim9Comment - - syn keyword vim9EnumImplements contained implements skipwhite nextgroup=vim9EnumImplementedInterface - syn match vim9EnumImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9EnumInterfaceListComma,vim9EnumImplementedInterfaceComment,vim9EnumValue - syn match vim9EnumInterfaceListComma contained "," skipwhite nextgroup=vim9EnumImplementedInterface - syn region vim9EnumImplementedInterfaceComment contained - \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" - \ skipwhite skipempty nextgroup=vim9EnumImplementedInterfaceComment,vim9EnumValue - \ contains=@vimCommentGroup,vimCommentString + syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,vim9Implements,@vim9MethodDef,vim9Const,vim9Final,vim9Var + + syn match vim9Enum contained "\" skipwhite nextgroup=vim9EnumName + syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements VimFolde syn region vim9EnumBody start="\" matchgroup=vimCommand end="\" contains=@vim9EnumBodyList transparent @@ -718,30 +669,22 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange - -syn match vimUserCmd "\!\=" skipwhite nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang -syn match vimUserCmd +\!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang - -syn region vimUserCmdAttrs contained - \ start="-\l" - \ start=+^\s*\%(\\\|["#]\\ \)+ - \ end="\ze\s\u" - \ skipwhite nextgroup=vimUserCmdName - \ contains=@vimContinue,vimUserCmdAttr,vimUserCmdAttrError - \ transparent -syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)" -syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr -syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrComplete,vimUserCmdError -syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber -syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs -syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange -syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey +syn keyword vimUserCmdKey contained com[mand] +syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock +syn match vimUserCmd "\!\=.*$" contains=vimUserCmdKey,vimBang,vimUserCmdAttr,vimUserCmdAttrError,vimUserCmdName,@vimUserCmdList,vimComFilter +syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)" +syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr +syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrCmplt,vimUserCmdError +syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber +syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs +syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange +syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey syn match vimUserCmdAttrNargs contained "[01*?+]" syn match vimUserCmdAttrRange contained "%" @@ -752,36 +695,19 @@ endif syn case ignore syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister] - -" GEN_SYN_VIM: vimUserCmdAttrComplete, START_STR='syn keyword vimUserCmdAttrComplete contained', END_STR='' -syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype filetypecmd function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var -syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var -syn keyword vimUserCmdAttrComplete contained custom customlist nextgroup=vimUserCmdAttrCompleteFunc,vimUserCmdError -syn match vimUserCmdAttrCompleteFunc contained ",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=vimUserCmdError contains=vimVarScope,vimFuncSID - +" GEN_SYN_VIM: vimUserCmdAttrCmplt, START_STR='syn keyword vimUserCmdAttrCmplt contained', END_STR='' +syn keyword vimUserCmdAttrCmplt contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var +syn keyword vimUserCmdAttrCmplt contained custom customlist nextgroup=vimUserCmdAttrCmpltFunc,vimUserCmdError +syn match vimUserCmdAttrCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError " GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR='' syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win -syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win -syn match vimUserCmdAttrAddr contained "?" +syn match vimUserCmdAttrAddr contained "?" syn case match -syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock,vimUserCmdReplacement -syn match vimUserCmdName contained +\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdBlock,vimUserCmdReplacement -syn region vimUserCmdReplacement contained - \ start="\S" - \ start=+^\s*\%(\\\|["#]\\ \)+ - \ skip=+\n\s*\%(\\\|["#]\\ \)+ - \ end="$" - \ contains=@vimContinue,@vimUserCmdList,vimComFilter -syn region vimUserCmdBlock contained - \ matchgroup=vimSep - \ start="{" - \ end="^\s*\zs}" - \ contains=@vimDefBodyList +syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList -syn match vimDelcommand "\" skipwhite nextgroup=vimDelcommandAttr,vimDelcommandName -syn match vimDelcommandAttr contained "-buffer\>" skipwhite nextgroup=vimDelcommandName -syn match vimDelcommandName contained "\<\u[[:alnum:]]*\>" +syn match vimDelcommand "\" skipwhite nextgroup=vimDelcommandAttr +syn match vimDelcommandAttr contained "-buffer\>" " Lower Priority Comments: after some vim commands... {{{2 " ======================= @@ -795,20 +721,17 @@ else syn cluster vimComment contains=vimComment endif -VimL syn region vimComment - \ excludenl - \ start=+"+ - \ skip=+\n\s*\%(\\\|"\\ \)+ - \ end="$" - \ contains=@vimCommentGroup,vimCommentString - \ extend -Vim9 syn region vim9Comment - \ excludenl - \ start="\%#=1\s\@1<=#\%({\@!\|{{\)" - \ skip="\n\s*\%(\\\|#\\ \)" - \ end="$" - \ contains=@vimCommentGroup,vimCommentString - \ extend +VimL syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend +VimL syn match vimComment +\]*>\=>" syn match vimQuoteEscape contained "''" -syn region vimString oneline matchgroup=vimString start=+$'+ end=+'+ nextgroup=vimSubscript contains=@vimStringInterpolation,vimQuoteEscape extend -syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringInterpolation,@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace -syn region vimContinueString contained matchgroup=vimContinueString start=+"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringGroup -syn region vimContinueString contained matchgroup=vimContinueString start=+'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,vimQuoteEscape -syn region vimContinueString contained matchgroup=vimContinueString start=+$"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,@vimStringGroup -syn region vimContinueString contained matchgroup=vimContinueString start=+$'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,vimQuoteEscape - " Substitutions: {{{2 " ============= syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation @@ -910,31 +828,12 @@ syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetArgs -syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend -syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc -syn match vimSetEscape contained "\\\%(\\[|"]\|.\)" -syn match vimSetBarEscape contained "\\|" -syn match vimSetQuoteEscape contained +\\"+ -syn region vimSetArgs contained - \ start="\S" - \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ + - \ end=+\ze\\\@1" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap +syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap syn keyword vimSetAll contained all nextgroup=vimSetMod syn keyword vimSetTermcap contained termcap +syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)" @@ -1004,83 +903,16 @@ syn keyword vimAbb ab[breviate] ca[bbrev] cnorea[bbrev] cuna[bbrev] ia[bbrev] in " GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod' syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod -" Filename Patterns: {{{2 -" ================= - -syn match vimWildcardQuestion contained "?" -syn match vimWildcardStar contained "*" - -syn match vimWildcardBraceComma contained "," -syn region vimWildcardBrace contained - \ matchgroup=vimWildcard - \ start="{" - \ end="}" - \ contains=vimWildcardEscape,vimWildcardBrace,vimWildcardBraceComma,vimWildcardQuestion,vimWildcardStar,vimWildcardBracket - \ oneline - -syn match vimWildcardIntervalNumber contained "\d\+" -syn match vimWildcardInterval contained "\\\\\\{\d\+\%(,\d\+\)\=\\}" contains=vimWildcardIntervalNumber - - -syn match vimWildcardBracket contained "\[\%(\^\=]\=\%(\\.\|\[\([:.=]\)[^:.=]\+\1]\|[^][:space:]]\)*\)\@>]" - \ contains=vimWildcardBracketStart,vimWildcardEscape - -syn match vimWildcardBracketCharacter contained "." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd -syn match vimWildcardBracketRightBracket contained "]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd -syn match vimWildcardBracketHyphen contained "-]\@!" nextgroup=@vimWildcardBracketCharacter -syn match vimWildcardBracketEscape contained "\\." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd -syn match vimWildcardBracketCharacterClass contained "\[:[^:]\+:]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd -syn match vimWildcardBracketEquivalenceClass contained "\[=[^=]\+=]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd -syn match vimWildcardBracketCollatingSymbol contained "\[\.[^.]\+\.]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd - -syn match vimWildcardBracketStart contained "\[" nextgroup=vimWildcardBracketCaret,vimWildcardBracketRightBracket,@vimWildcardBracketCharacter -syn match vimWildcardBracketCaret contained "\^" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketRightBracket -syn match vimWildcardBracketEnd contained "]" - -syn cluster vimWildcardBracketCharacter contains=vimWildcardBracketCharacter,vimWildcardBracketEscape,vimWildcardBracketCharacterClass,vimWildcardBracketEquivalenceClass,vimWildcardBracketCollatingSymbol - -syn match vimWildcardEscape contained "\\." - -syn cluster vimWildcard contains=vimWildcardQuestion,vimWildcardStar,vimWildcardBrace,vimWildcardBracket,vimWildcardInterval - -" Autocmd and Doauto{cmd,all}: {{{2 -" =========================== - -" TODO: explicitly match the {cmd} arg rather than bailing out to TOP -syn region vimAutocmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList - -syn match vimAutocmdGroup contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" skipwhite nextgroup=vimAutoEvent,vimAutoEventGlob -syn match vimAutocmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob - -" TODO: cleaner handling of | in pattern position -" : match pattern items in addition to wildcards -syn region vimAutocmdPattern contained - \ start="|\@!\S" - \ skip="\\\\\|\\[,[:space:]]" - \ end="\ze[,[:space:]]" - \ end="$" - \ skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock - \ contains=vimEnvvar,@vimWildcard,vimAutocmdPatternEscape -syn match vimAutocmdBufferPattern contained "" skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock -" trailing pattern separator comma allowed -syn match vimAutocmdPatternSep contained "," skipwhite nextgroup=@vimAutocmdPattern,vimAutocmdMod,vimAutocmdBlock -syn match vimAutocmdPatternEscape contained "\\." -syn cluster vimAutocmdPattern contains=vimAutocmdPattern,vimAutocmdBufferPattern - -" TODO: Vim9 requires '++' prefix -syn match vimAutocmdMod contained "\%(++\)\=\" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock -syn match vimAutocmdMod contained "++once\>" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock - -" higher priority than vimAutocmdGroup, assume no group is so named -syn match vimAutoEventGlob contained "*" skipwhite nextgroup=@vimAutocmdPattern -syn match vimAutoEventSep contained "\a\@1<=," nextgroup=vimAutoEvent - -syn match vimAutocmd "\" skipwhite nextgroup=vimAutocmdBang,vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob - - -syn match vimDoautocmdMod contained "" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent -syn match vimDoautocmd "\" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent -syn match vimDoautocmd "\" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent +" Autocmd: {{{2 +" ======= +syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList +syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace +syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock +syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList +syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock +syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList " Echo And Execute: -- prefer strings! {{{2 " ================ @@ -1106,93 +938,6 @@ syn cluster vimEcho contains=vimEcho,vimEchohl syn region vimExecute matchgroup=vimCommand start="\" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent -" Filter: {{{2 -" ====== -syn match vimExFilter "\" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern -syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern -syn region vimExFilterPattern contained - \ start="[[:ident:]]" - \ end="\ze[[:space:]\n]" - \ skipwhite nextgroup=@vimCmdList - \ contains=@vimSubstList - \ oneline -syn region vimExFilterPattern contained - \ matchgroup=Delimiter - \ start="\z([^[:space:][:ident:]|"]\)" - \ skip="\\\\\|\\\z1" - \ end="\z1" - \ skipwhite nextgroup=@vimCmdList - \ contains=@vimSubstList - \ oneline - -" Grep and Make: {{{2 -" ============= -" | is the command separator, escaped with \| all other backslashes are passed through literally, no tail comments -syn match vimGrep "\" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep -syn match vimGrepadd "\" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep -syn region vimGrepArgs contained - \ start="|\@!\S" - \ skip=+\n\s*\%(\\\|[#"]\\ \)+ - \ matchgroup=vimCmdSep - \ end="|" - \ end="$" - "\ TODO: include vimSpecFile - \ contains=vimGrepBarEscape -syn match vimGrepBarEscape contained "\\|" -syn match vimGrepBang contained "\a\@1<=!" skipwhite nextgroup=vimGrepArgs,vimCmdSep - -syn match vimMake "\" skipwhite nextgroup=vimMakeBang,vimMakeArgs,vimCmdSep -syn region vimMakeArgs contained - \ start="|\@!\S" - \ skip=+\n\s*\%(\\\|[#"]\\ \)+ - \ matchgroup=vimCmdSep - \ end="|" - \ end="$" - "\ TODO: include vimSpecFile - \ contains=vimMakeBarEscape -syn match vimMakeBarEscape contained "\\|" -syn match vimMakeBang contained "\a\@1<=!" skipwhite nextgroup=vimMakeArgs,vimCmdSep - -syn match vimHelpgrep "\" skipwhite nextgroup=vimHelpgrepBang,vimHelpgrepPattern -syn region vimHelpgrepPattern contained - \ start="\S" - \ matchgroup=Special - \ end="@\w\w\>" - \ end="$" - \ contains=@vimSubstList - \ oneline - -" Vimgrep: {{{2 -" ======= -syn match vimVimgrep "\" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern -syn match vimVimgrepadd "\" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern -syn match vimVimgrepBang contained "\a\@1<=!" skipwhite nextgroup=vimVimgrepPattern -syn region vimVimgrepPattern contained - \ start="[[:ident:]]" - \ end="\ze[[:space:]\n]" - \ skipwhite nextgroup=vimVimgrepFile,vimCmdSep - \ contains=@vimSubstList - \ oneline -syn region vimVimgrepPattern contained - \ matchgroup=Delimiter - \ start="\z([^[:space:][:ident:]|"]\)" - \ skip="\\\\\|\\\z1" - \ end="\z1" - \ skipwhite nextgroup=vimVimgrepFlags,vimVimgrepFile,vimCmdSep - \ contains=@vimSubstList - \ oneline -syn match vimVimgrepEscape contained "\\\%(\\|\|.\)" -syn match vimVimgrepBarEscape contained "\\|" -syn region vimVimgrepFile contained - \ start="|\@!\S" - \ matchgroup=vimCmdSep - \ end="|" - \ end="\ze\s" - \ end="$" - \ skipwhite nextgroup=vimVimgrepFile - \ contains=vimSpecFile,vimVimgrepEscape,vimVimgrepBarEscape -syn match vimVimgrepFlags contained "\<[gjf]\{,3\}\>" skipwhite nextgroup=vimVimgrepfile - " Maps: {{{2 " ==== " GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs' @@ -1259,7 +1004,7 @@ syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}scro syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket -" syn match vimNotation contained '\%(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket +syn match vimNotation contained '\%(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket syn match vimNotation contained '\%#=1\%(\\\|\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket @@ -1301,11 +1046,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") syn match vimBufnrWarn /\" skipwhite nextgroup=@vimExprList,vimNotation -syn match vimElse "\" skipwhite nextgroup=vimComment,vim9Comment -syn match vimEndif "\" skipwhite nextgroup=vimComment,vim9Comment " Match: {{{2 " ===== @@ -1321,47 +1062,12 @@ syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+, syn match vimNormal "\!\=" skipwhite nextgroup=vimNormalArg contains=vimBang syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue -" Redir: {{{2 -" ===== -syn match vimRedir "\" skipwhite nextgroup=vimRedirBang,vimRedirFileOperator,vimRedirVariableOperator,vimRedirRegister,vimRedirEnd -syn match vimRedirBang contained "\a\@1<=!" skipwhite nextgroup=vimRedirFileOperator - -syn match vimRedirFileOperator contained ">>\=" skipwhite nextgroup=vimRedirFile -syn region vimRedirFile contained - \ start="\S" - \ matchgroup=Normal - \ end="\s*$" - \ end="\s*\ze[|"]" - \ nextgroup=vimCmdSep,vimComment - \ contains=vimSpecFile -syn match vimRedirRegisterOperator contained ">>\=" -syn match vimRedirRegister contained "@[a-zA-Z*+"]" nextgroup=vimRedirRegisterOperator -syn match vimRedirVariableOperator contained "=>>\=" skipwhite nextgroup=vimVar -syn keyword vimRedirEnd contained END - " Sleep: {{{2 " ===== syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>" -" Sort: {{{2 -" ==== -syn match vimSort "\" skipwhite nextgroup=vimSortBang,@vimSortOptions,vimSortPattern,vimCmdSep -syn match vimSortBang contained "\a\@1<=!" skipwhite nextgroup=@vimSortOptions,vimSortPattern,vimCmdSep -syn match vimSortOptionsError contained "\a\+" -syn match vimSortOptions contained "\<[ilur]*[nfxob]\=[ilur]*\>" skipwhite nextgroup=vimSortPattern,vimCmdSep -syn region vimSortPattern contained - \ matchgroup=Delimiter - \ start="\z([^[:space:][:alpha:]|]\)" - \ skip="\\\\\|\\\z1" - \ end="\z1" - \ skipwhite nextgroup=@vimSortOptions,vimCmdSep - \ contains=@vimSubstList - \ oneline - -syn cluster vimSortOptions contains=vimSortOptions,vimSortOptionsError - " Syntax: {{{2 "======= syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial @@ -1568,9 +1274,7 @@ syn match vim9ContinueComment "^\s*\zs#\\ .*" extend syn cluster vimContinue contains=vimContinue,vimContinueComment syn cluster vim9Continue contains=vimContinue,vim9ContinueComment -syn region vimString start='^\s*\\"' end='"' oneline keepend contains=@vimStringGroup,vimContinue -syn region vimString start="^\s*\\'" end="'" oneline keepend contains=vimQuoteEscape,vimContinue - +syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained @@ -1583,7 +1287,7 @@ syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\`{normal} to show your location in a file and the file status. - Type `{count}G`{normal} to move to line {count} in the file. ** + Type `G`{normal} to move to a line in the file. ** NOTE: Read this entire lesson before executing any of the steps!! @@ -933,20 +933,11 @@ default. To start using more features you have to create a "vimrc" file. 3. Press ``{normal} and Vim will show a list of commands that start with "e". - 4. Press ``{normal} and Vim will show a menu with possible completions - (or complete the match, if the entered command is unique, e.g. - ":ed``{normal}" will be completed to ":edit"). + 4. Press ``{normal} and Vim will complete the command name to ":edit". - 5. Use ``{normal} or ``{normal} to go to the next match. Or use - ``{normal} or ``{normal} to go to the previous match. + 5. Now add a space and the start of an existing file name: `:edit FIL`{vim} - 6. Choose the entry `edit`{vim}. Now you can see that the word `edit`{vim} - have been automatically inserted to the command line. - - 7. Now add a space and the start of an existing file name: `:edit FIL`{vim} - - 8. Press ``{normal}. Vim will show a completion menu with list of file - names that start with `FIL` + 6. Press ``{normal}. Vim will complete the name (if it is unique). NOTE: Completion works for many commands. It is especially useful for `:help`{vim}. @@ -965,7 +956,7 @@ NOTE: Completion works for many commands. It is especially useful for 5. Create a vimrc startup script to keep your preferred settings. 6. While in command mode, press ``{normal} to see possible completions. - Press ``{normal} to use the completion menu and select a match. + Press ``{normal} to use one completion. # CONCLUSION diff --git a/runtime/tutor/sr/vim-01-beginner.tutor b/runtime/tutor/sr/vim-01-beginner.tutor index dfcf4580..06ca036f 100644 --- a/runtime/tutor/sr/vim-01-beginner.tutor +++ b/runtime/tutor/sr/vim-01-beginner.tutor @@ -912,17 +912,13 @@ Vim има много више могућноÑти него Vi, али је в иÑкључена. Да биÑте укључили још фукционалноÑти, морате да креирате „vimrc†фајл. - 1. Започните уређивање „vimrc†фајла. То завиÑи од вашег ÑиÑтема: - за UNIX ÑиÑтеме за Windows - `:e ~/.vimrc`{vim} `:e ~/_vimrc`{vim} + 1. Започните уређивање „vimrc†фајла. + `:call mkdir(stdpath('config'),'p')`{vim} + `:exe 'edit' stdpath('config').'/init.vim'`{vim} - 2. Сада учитајте Ñадржај „vimrc†фајла за пример: - `:r $VIMRUNTIME/vimrc_example.vim`{vim} - - 3. Сачувајте фајл Ñа: + 2. Сачувајте фајл Ñа: `:w`{vim} - Следећи пут када покренете Vim кориÑтиће Ñе иÑтицање ÑинтакÑе. У овај „vimrc†фајл можете додати Ñва подешавања која желите. За више информација откуцајте `:help vimrc-intro`{vim}. diff --git a/runtime/tutor/tutor.tutor b/runtime/tutor/tutor.tutor index cdef5d55..b46fcc48 100644 --- a/runtime/tutor/tutor.tutor +++ b/runtime/tutor/tutor.tutor @@ -17,8 +17,15 @@ Table of contents: ## SETTING UP *setting-up* -Create a new .tutor file (we will be practicing on this very file, so you don't -need to do this now): +First, you'll need to enable "debug" mode +~~~ cmd + :let g:tutor_debug = 1 +~~~ +This will allow saving changes to the tutor files and will disable conceals, so +you can more easily check your changes. + +After this, create a new .tutor file (we will be practicing on this very file, so you +don't need to do this now): ~~~ cmd :e new-tutorial.tutor ~~~ diff --git a/runtime/tutor/tutor1.gl b/runtime/tutor/tutor1.gl deleted file mode 100644 index 8816d341..00000000 --- a/runtime/tutor/tutor1.gl +++ /dev/null @@ -1,1048 +0,0 @@ -=============================================================================== -= B e n v i d o a o t u t o r d o V I M - Versión 1.7 = -=============================================================================== - - - Vim é un editor moi potente que dispón de moitos comandos, demasiados - para ser explicados nun tutor coma este. Este tutor está deseñado - para describir comandos dabondo para que vostede sexa capaz de - aprender fácilmente a usa-lo Vim como un editor de propósito xeral. - - O tempo necesario para completa-lo tutor é aproximadamente de 30 - minutos, dependendo de canto tempo se adique á experimentación. - - Os comandos destas leccións modificarán o texto. Faga unha copia deste - ficheiro para practicar (con «vimtutor», isto xa é unha copia). - - É importante lembrar que este tutor está pensado para ensinar coa - práctica. Isto significa que cómpre executa-los comandos para - aprendelos axeitadamente. Se únicamente le o texto, esqueceránselle - os comandos! - - Agora, asegúrese de que a tecla de bloqueo de maiúsculas NON está - activada e prema a tecla j para move-lo cursor, de xeito que o texto - da Lección 1.1.1 abranga completamente a pantalla. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.1: MOVE-LO CURSOR - - - ** Para move-lo cursor, prema as teclas h,j,k,l do xeito indicado. ** - ^ - k Indicación: A tecla h está á esquerda, e móveo á esquerda. - < h l > A tecla l está á dereita, e móveo á dereita. - j A tecla j semella unha frecha e apunta - v cara a embaixo. - - 1. Mova o cursor pola pantalla ata que sinta comodidade facendo a acción. - - 2. Manteña premida a tecla j ata que se repita automáticamente. - Agora xa sabe como chegar á lección seguinte. - - 3. Utilizando a tecla abaixo, vaia á lección 1.1.2. - -NOTA: Se alguna vez non está seguro sobre algo que tecleara, prema - para situarse no modo Normal. Logo, volva a teclear a orde que desexaba. - -NOTA: As teclas de movemento do cursor tamén funcionan. Pero usando hjkl - poderá moverse moito máis rápido unha vez que se acostume. - De verdade! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.2: SAÍR DO VIM - - -NOTA: Antes de executar algún dos seguintes pasos, lea primeiro a lección - enteira!! - - 1. Prema a tecla (para asegurarse de que está no modo Normal). - - 2. Escriba: :q! - Isto provoca a saída do editor REXEITANDO calquer cambio que fora feito. - - 3. Regrese eiquí executando o comando que o trouxo a este tutor. - Este puido ser: vimtutor - - 4. Se memorizou estes pasos, e se sinte con confianza, execute os - pasos do 1 ao 3 para saír e volver a entrar ao editor. - -NOTA: :q! descarta cualquer cambio que realizara. - En próximas leccións, aprenderá como garda-los cambios nun arquivo. - - 5. Mova o cursor ata a Lección 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.3: EDITAR TEXTO - BORRAR - - - ** Prema x para elimina-lo carácter baixo o cursor. ** - - 1. Mova o cursor á liña de embaixo sinalada con --->. - - 2. Para corrixi-los erros, mova o cursor ata que estea sobre o - carácter que vai ser borrado. - - 3. Prema a tecla x para elimina-lo carácter non desexado. - - 4. Repita os pasos 2 a 4 ata que a frase sexa a correcta. - ----> A vvaca saltooooou soobree aa lúúúúúúúa. - - 5. Agora que a liña está correcta, continúe coa Lección 1.1.4. - -NOTA: A medida que vaia avanzando neste tutor, non tente memorizar, - aprenda practicando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.4: EDITAR TEXTO - INSERIR - - - ** Prema i para inserir texto. ** - - 1. Mova o cursor á primeira liña de embaixo sinalada con --->. - - 2. Para facer que a primeira liña sexa igual ca segunda, mova o cursor - ata que estea sobre o carácter ANTES do texto que vai ser inserido. - - 3. Prema i e escriba os carácteres a engadir. - - 4. A medida que sexa corrixido cada erro, prema para volver ao modo - Normal. Repita os pasos 2 a 4 para corrixi-la frase. - ----> Flta texto nesta . ----> Falta algo de texto nesta liña. - - 5. Cuando se sinta con comodidade inserindo texto, pase á lección 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.5: EDITAR TEXTO - ENGADIR - - - ** Prema A para engadir texto. ** - - 1. Mova o cursor á primeira liña inferior marcada con --->. - Non importa sobre qué carácter estea o cursor nesta liña. - - 2. Prema A e escriba o texto necesario. - - 3. Cuando o texto estea engadido, prema para volver ao modo Normal. - - 4. Mova o cursor á segunda liña marcada con ---> e repita os pasos 2 e 3 - para corrixir esta frase. - ----> Falta algún texto nes - Falta algún texto nesta liña. ----> Tamén falta alg - Tamén falta algún texto eiquí. - - 5. Cuando se sinta con comodidade engadindo texto, pase á lección 1.1.6. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.6: EDITAR UN ARQUIVO - - - ** Use :wq para gardar un arquivo e saír ** - -NOTA: Antes de executar os seguintes pasos, lea a lección enteira!! - - 1. Se ten acceso a outra terminal, faga os seguintes puntos nela. - Se non é así, saia deste tutor como fixo na lección 1.1.2: :q! - - 2. No símbolo do sistema escriba este comando: vim arquivo.txt - 'vim' é o comando para arrincar o editor Vim, - 'arquivo.txt' é o nome do arquivo que quere editar. - Utilice o nome dun arquivo que poida cambiar. - - 3. Insira e elimine texto como xa aprendeu nas leccións anteriores. - - 4. Garde o arquivo cos cambios e saia do Vim con: :wq - - 5. Se xa saiu do vimtutor no paso 1, reinicie vimtutor e baixe ata - o seguinte resumo. - - 6. Despois de le-los pasos anteriores e telos entendido: fágaos. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.1 - - - 1. O cursor móvese utilizando as teclas das frechas ou as teclas hjkl. - h (esquerda) j (abaixo) k (arriba) l (dereita) - - 2. Para acceder ao Vim dende o símbolo do sistema escriba: - vim nome_arquivo - - 3. Para saír do Vim escriba: :q! para eliminar tódolos - cambios. - Ou escriba: :wq para garda-los cambios. - - 4. Para borrar un carácter baixo o cursor en modo Normal prema: x . - - 5. Para inserir ou engadir texto escriba: - i escriba o texto a inserir insire o texto antes do cursor - A escriba o texto a engadir engade o texto ao final da liña - -NOTA: Premendo tórnase ao modo Normal ou cancélase unha orde non - desexada ou incompleta. - - Agora continúe coa Lección 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.1: COMANDOS PARA BORRAR - - - ** Escriba dw para borrar unha palabra ** - - 1. Prema para asegurarse de que está no modo Normal. - - 2. Mova o cursor á liña inferior sinalada con --->. - - 3. Mova o cursor ao comezo dunha palabra que desexe borrar. - - 4. Prema dw para facer que a palabra desapareza. - -NOTA: A letra d aparecerá na última liña inferior dereita da pantalla - namentres a escribe. O Vim está esperando que escriba w . - Se ve outro carácter que non sexa d , é que escribiu algo mal. Prema - e comece de novo. - ----> Hai algunhas palabras pásao ben que non pertencen papel a esta frase. - - 5. Repita os pasos 3 e 4 ata que a frase sexa correcta e pase á - lección 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.2: MÁIS COMANDOS PARA BORRAR - - - ** Escriba d$ para borrar ata o final da liña. ** - - 1. Prema para asegurarse de que está no modo Normal. - - 2. Mova o cursor á liña inferior sinalada con --->. - - 3. Mova o cursor ao final da liña correcta (DESPOIS do primeiro . ). - - 4. Escriba d$ para borrar ata o final da liña. - ----> Alguén escribiu o final desta liña dúas veces. esta liña dúas veces. - - Pase á lección 1.2.3 para entender qué está pasando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.3: SOBRE OPERADORES E MOVEMENTOS - - - Moitos comandos que cambian texto están compostos por un operador e máis - un movemento. - O formato para o comando 'eliminar' co operador de borrado d é o - seguinte: - - d movemento - - Onde: - d - é o operador para borrar. - movemento - é o texto sobre o que o comando vai operar (lista inferior). - - Eiquí, unha lista resumida de movementos: - w - ata o comezo da seguinte palabra, EXCLUÍNDO o seu primero carácter. - e - ata o final da palabra actual, INCLUÍNDO o último carácter. - $ - ata o final da liña, INCLUÍNDO o último carácter. - - Polo tanto, ao escribir de borraráse dende a posición do cursor ata o - final da palabra. - -NOTA: Premendo únicamente o movemento, estando no modo Normal sen un - operador, moveráse o cursor como se especifica na lista anterior. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.4: UTILIZAR UN CONTADOR PARA UN MOVEMENTO - - - ** Ao escribir un número denantes dun movemento, repítise o movemento - o número de veces. ** - - 1. Mova o cursor ao comezo da liña marcada con --->. - - 2. Escriba 2w para mover o cursor dúas palabras cara a adiante. - - 3. Escriba 3e para mover o cursor ao final da terceira palabra cara a - adiante. - - 4. Escriba 0 (cero) para coloca-lo cursor ao inicio da liña. - - 5. Repita os pasos 2 e 3 con diferentes números. - ----> Isto é só unha liña con palabras onde poder moverse. - - Pase á lección 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.5: UTILIZAR UN CONTADOR PARA BORRAR MÁIS - - - ** Ao escribir un número cun operador, repítese ese número de veces. ** - - En combinación co operador de borrado e o movemento mencionado - anteriormente, engada un contador antes do movemento para eliminar máis: - d número movemento - - 1. Mova o cursor ao inicio da primeira palabra en MAIÚSCULAS na liña - marcada con --->. - - 2. Escriba d2w para elimina-las dúas palabras en MAIÚSCULAS. - - 3. Repita os pasos 1 e 2 con diferentes contadores para elimina-las - seguintes palabras en MAIÚSCULAS cun comando. - ----> Esta ABC DE cadea FGHI JK LMN OP de palabras foi Q RS TUV limpada. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.6: OPERACIÓN EN LIÑAS - - - ** Escriba dd para eliminar unha liña completa. ** - - Debido á frecuencia coa que se elimina unha liña completa, os deseñadores - do Vim decidiron que sería máis sinxelo simplemente escribir dúas letras - d para eliminar unha liña. - - 1. Mova o cursor á segunda liña do párrafo inferior. - - 2. Escriba dd para elimina-la liña. - - 3. Agora, móvase á cuarta liña. - - 4. Escriba 2dd para eliminar dúas liñas á vez. - ----> 1) As rosas son vermellas, ----> 2) o barro é divertido, ----> 3) a violeta é azul, ----> 4) teño un coche, ----> 5) os reloxos dan a hora, ----> 6) o azucere é dóce ----> 7) e ti tamén o es. - - A duplicación para borrar liñas tamén funcionan cos operadores - mencionados anteriormente. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.7: O COMANDO DESFACER - - - ** Prema u para desfacer os últimos comandos, - U para desfacer unha liña enteira. ** - - 1. Mova o cursor á liña inferior sinalada con ---> e sitúeo baixo o - primeiro erro. - - 2. Prema x para borra-lo primeiro carácter non desexado. - - 3. Prema agora u para desface-lo último comando executado. - - 4. Agora, corrixa tódolos erros da liña usando o comando x. - - 5. Prema agora U maiúsculo para devolver a liña ao seu estado orixinal. - - 6. Prema agora u unhas poucas veces máis para desface-lo feito por U e - mailos comandos previos. - - 7. Agora, prema CTRL-R (manteña pulsada a tecla CTRL e prema R) unhas - cantas veces para volver a executar os comandos (desface-lo desfeito). - ----> Corrrixa os erros dee esttta liña e vooolva ponelos coon desfacer. - - Estes son uns comandos moi útiles. Agora, vaiamos ao resumo da lección 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.2 - - - 1. Para borrar dende o cursor ata a seguinte palabra prema: dw - 2. Para borrar dende o cursor ata o final da palabra prema: de - 3. Para borrar dende o cursor ata o final dunha liña prema: d$ - 4. Para borrar unha liña enteira prema: dd - 5. Para repetir un movemento, antepoña un número: 2w - 6. O formato para un comando de cambio é: - operador [número] movemento - onde: - comando - é o que hai que facer, por exemplo, d para borrar - [número] - é un número opcional para repetir o movemento - movemento - móvese sobre o texto no que operar, como w (palabra), - $ (ata o final da liña), etc. - - 7. Para moverse ao inicio da liña utilice un cero: 0 - 8. Para desfacer acciones previas prema: u (u minúsculo) - Para desfacer tódolos cambios dunha liña prema: U (U mAIÚSCULO) - Para desface-lo desfeito prema: CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.1: O COMANDO «PUT» (PÓR) - - - ** Prema p para pór (pegar) despois do cursor o último que borrou. ** - - 1. Mova o cursor á primeira liña inferior marcada con --->. - - 2. Escriba dd para borra-la liña e almacenala nun rexistro do Vim. - - 3. Mova o cursor á liña c) por RIBA de onde debería esta-la liña - eliminada. - - 4. Prema p para pega-la liña borrada por BAIXO do cursor. - - 5. Repita os pasos 2 a 4 para por tódalas liñas na orde correcta. - ----> d) Podes aprendela ti? ----> b) A violeta é azul, ----> c) a intelixencia apréndese, ----> a) as rosas son vermellas. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.2: O COMANDO «REPLACE» (TROCAR) - - - ** Prema rx para troca-lo carácter baixo o cursor con x . ** - - 1. Mova o cursor á primeira liña inferior marcada con --->. - - 2. Mova o cursor para situalo sobre o primeiro erro. - - 3. Prema r e despois o carácter que debería ir aí. - - 4. Repita os pasos 2 e 3 ata que a primeira liña sexa igual á segunda. - ----> Cande esti lita fui escrita alguér premeu alginhas teclas equibocadas! ----> Cando esta liña foi escrita alguén premeu algunhas teclas equivocadas! - - 5. Agora pase á lección 1.3.3. - -NOTA: Lembre que debería aprender practicando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.3: O COMANDO CAMBIAR - - - ** Para cambiar ata o final dunha palabra, escriba ce . ** - - 1. Mova o cursor á primeria liña inferior marcada con --->. - - 2. Sitúe o cursor no u de lubrs. - - 3. Escriba ce e corrixa a palabra (neste caso, escriba 'iña'). - - 4. Prema e mova o cursor ao seguinte erro a cambiar. - - 5. Repita os pasos 3 e 4 ata que a primeira frase sexa igual á segunda. - ----> Esta lubrs ten unhas poucas pskavtad que corrixir co comando change. ----> Esta liña ten unhas poucas palabras que corrixir co comando cambiar. - - Teña en conta que ce elimina a palabra e entra no modo Inserir. - cc fai o mesmo para toda a liña. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.4: MÁIS CAMBIOS USANDO c - - - ** O operador cambio utilízase cos mesmos movementos que borrar. ** - - 1. O operador cambio funciona do mesmo xeito que borrar. O formato é: - - c [número] movemento - - 2. Os movementos son tamén os mesmos, como w (palabra) ou - $ (fin da liña). - - 3. Mova o cursor á primeira liña inferior sinalada con --->. - - 4. Mova o cursor ao primeiro erro. - - 5. Prema c$ e escriba o resto da liña para que sexa como a segunda, - e prema . - ----> O final desta liña necesita algunha axuda para que sexa como a segunda. ----> O final desta liña necesita ser corrixido usando o comando c$. - -NOTA: Pode utiliza-lo retorno de carro para corrixir erros mentres escribe. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.3 - - - 1. Para volver a pór ou pega-lo texto que acaba de borrarse, - escriba p . Isto pega o texto despois do cursor (se borrou unha - liña, ao pegala, esta situaráse na liña baixo do cursor). - - 2. Para troca-lo carácter baixo do cursor, prema r e logo o - carácter que quere que estea no seu lugar. - - 3. O operador cambio permítelle cambiar dende a posición do cursor - ata onde leve o movemento indicado. Por exemplo, prema ce - para cambiar dende o cursor ata o final da palabra, ou c$ - para cambiar ata o final da liña. - - 4. O formato para cambio é: - - c [número] movemento - - Pase agora á lección seguinte. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.1: UBICACIÓN DO CURSOR E ESTADO DO ARQUIVO - - - ** Prema CTRL-G para mostra-la súa situación no ficheiro e mailo estado. - Prema G para moverse a unha determinada liña do fichero. ** - -NOTA: Lea esta lección enteira antes de executar calquera dos pasos!! - - 1. Manteña premida a tecla Ctrl e prema g . Chamamos a isto CTRL-G. - Aparecerá unha mensaxe na parte inferior da páxina co nome do arquivo - e a posición do cursor no arquivo. - Lembre o número de liña para o paso 3. - -NOTA: Seica poida ve-la posición do cursor no recanto inferior da dereita - da pantalla. Isto acontece cando a opción 'ruler' (regra) está - habilitada (consulte :help 'ruler' ) - - 2. Prema G para move-lo cursor ata a parte inferior do arquivo. - Prema gg para move-lo cursor ao inicio do arquivo. - - 3. Escriba o número da liña na que estaba e despois G . Isto - tornaráo á liña na que estaba cuando pulsou CTRL-G. - - 4. Se se atopa con seguridade para poder facer isto, - execute os pasos 1 a 3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.2: O COMANDO «SEARCH» (BUSCAR) - - - ** Escriba / seguido dun texto para busca-lo texto. ** - - 1. En modo Normal, prema o carácter / . Fíxese que tanto o carácter / - como o cursor aparecen na derradeira liña da pantalla, o mesmo que - o comando : . - - 2. Escriba agora errroor . Esta é a palabra que quere buscar. - - 3. Para repeti-la busca do mesmo texto outra vez, simplemente prema n . - Para busca-lo mesmo texto na dirección oposta, prema N . - - 4. Se quere buscar un texto na dirección oposta (cara a enriba), - utilice o comando ? en troques de / . - - 5. Para regresar ao lugar de onde procedía, prema CTRL-O (manteña pulsado - Ctrl mentres pulsa a tecla o). Repita o proceso para voltar máis atrás. - CTRL-I vai cara a adiante. - ----> "errroor" non é o xeito correcto de escribir erro; errroor é un erro. - -NOTA: Cando a busca chega ao final do arquivo, continuará dende o comezo, - agás que a opción 'wrapscan' estea desactivada. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.3: BUSCA PARA COMPROBAR PARÉNTESES - - - ** Prema % para atopa-la paréntese correspondente a ),] ou } . ** - - 1. Sitúe o cursor en cualquera dos carácteres (, [ o { na liña inferior - sinalada con --->. - - 2. Prema agora o carácter % . - - 3. O cursor moveráse á parella de peche da paréntese, corchete - ou chave correspondente. - - 4. Prema % para move-lo cursor ata a outra parella do carácter. - - 5. Mova o cursor a outra (,),[,],{ o } e vexa o que fai % . - ----> Isto ( é unha liña de proba con (, [, ], {, e } nela. )) - -NOTA: Isto é moi útil na detección de erros nun programa con parénteses, - corchetes ou chaves sen parella. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.4: O COMANDO SUBSTITUÍR - - - ** Escriba :s/vello/novo/g para substituír 'vello' por 'novo'. ** - - 1. Mova o cursor á liña inferior sinalada con --->. - - 2. Escriba :s/aas/as/ . Teña en conta que este comando cambia - só o primeiro achado -na liña- da expresión que quere cambiar. - - 3. Agora escriba :s/aas/a/g . Ao engadir a opción g , o Vim fará - a substitución global na liña, cambiando tódo-los achados - do termo "aas" na liña. - ----> Coido que aas mellores épocas para aas frores son aas primaveras. - - 4. Para cambiar cada achado da cadea de carácteres entre dúas liñas: - Escriba :#,#s/vello/novo/g onde #,# son os números de liña do rango - de liñas onde se realizará a substitución. - Escriba :%s/vello/novo/g para cambiar cada achado en todo o arquivo. - Escriba :%s/vello/novo/gc para atopar cada achado en todo o arquivo, - pedindo confirmación para face-la - substitución ou non. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.4 - - - 1. CTRL-G mostra a posición do cursor no ficheiro e mailo seu estado. - G move o cursor ao final do arquivo. - número G move o cursor a ese número de liña. - gg move o cursor á primeira liña do arquivo. - - 2. Escribindo / seguido dun texto busca o texto cara a ADIANTE. - Escribindo ? seguido dun texto busca o texto cara a ATRÁS. - Despois dunha busca, prema n para atopar o achado. - - 3. Premendo % cando o cursor está sobre (,), [,], { o } localiza - a parella correspondente. - - 4. Para cambiar vello por novo no primeiro achado dunha liña escriba - :s/vello/novo - Para cambiar tódo-los vello por novo nunha liña escriba - :s/vello/novo/g - Para cambiar texto entre dous números de liña escriba - :#,#s/vello/novo/g - Para cambiar vello por novo en todo o fichero escriba - :%s/vello/novo/g - Para pedir confirmación en cada caso engada 'c' - :%s/vello/novo/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.1: CÓMO EXECUTAR UN COMANDO EXTERNO - - - ** Escriba :! seguido dun comando externo para executar ese comando. ** - - 1. Escriba o conocido comando : para situar o cursor ao final da - pantalla. Isto permitirálle introducir un comando. - - 2. Agora escriba o carácter ! (signo de admiración). Isto permitirálle - executar calquer mandato do sistema. - - 3. Como exemplo escriba ls despois do ! e logo prema . Isto - mostrarálle unha lista do seu directorio, igual que se estiviese no - símbolo do sistema. Se ls non funciona, utilice :!dir . - -NOTA: Deste xeito é posible executar cualquer comando externo, - tamén incluíndo argumentos. - -NOTA: Tódolos comandos : deben finalizarse premendo . - De agora en diante, non sempre se mencionará. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.2: MÁIS SOBRE GARDAR FICHEIROS - - - ** Para garda-los cambios feitos nun ficheiro, - escriba :w NOME_DE_FICHEIRO ** - - 1. Escriba :!dir ou :!ls para ver unha lista dos arquivos - do seu directorio. - Xa sabe que debe pulsar despois. - - 2. Elixa un nome de ficheiro que todavía non exista, como TEST. - - 3. Agora escriba :w TEST (onde TEST é o nome de ficheiro elixido). - - 4. Esta acción garda todo o ficheiro (Vim Tutor) baixo o nome TEST. - Para comprobalo, escriba :!dir ou :!ls de novo e vexa - o seu directorio. - -NOTA: Se saíra do Vim e volvera a entrar de novo con vim TEST , o - arquivo sería unha copia exacta do tutorial cuando o guardou. - - 5. Agora, elimine o arquivo escribindo (Windows): :!del TEST - ou (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.3: SELECCIONAR TEXTO PARA GARDAR - - - ** Para gardar parte do arquivo, escriba v movemento :w arquivo ** - - 1. Mova o cursor a esta liña. - - 2. Prema v e mova o cursor ata o quinto elemento inferior. Vexa que - o texto é salientado. - - 3. Prema o carácter : Na parte inferior da pantalla aparecerá - :'<,'> - - 4. Prema w TEST , onde TEST é un nome de arquivo que aínda non existe. - Verifique que ve :'<,'>w TEST antes de premer . - - 5. Vim escribirá as liñas seleccionadas no arquivo TEST. Utilice - :!dir o :!ls para velo. Non o elimine todavía! Utilizarémolo - na seguinte lección. - -NOTA: Ao pulsar v iniciá a selección visual. Pode move-lo cursor para - face-la selección máis grande ou pequena. Despois, pode utilizar un - operador para facer algo co texto. Por exemplo, d eliminará - o texto seleccionado. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.4: RECUPERANDO E MESTURANDO FICHEIROS - - - ** Para inseri-lo contido dun ficheiro escriba :r NOME_DO_FICHEIRO ** - - 1. Sitúe o cursor xusto por riba desta liña. - -NOTA: Despois de executar o paso 2 verá o texto da lección 1.5.3. Despois - DESCENDA ata ver de novo esta lección. - - 2. Agora recupere o arquivo TEST utilizando o comando :r TEST , onde - TEST é o nome que ven de utilizar. - O arquivo que recuperou colocaráse embaixo da liña onde se atope - o cursor. - - 3. Para verificar que se recuperou o arquivo, suba o cursor e - comprobe que agora hai dúas copias da lección 1.5.3, a orixinal e - maila versión do arquivo. - -NOTA: Tamén pode le-la saída dun comando externo. Por exemplo, - :r !ls le a saída do comando ls e pégao baixo da liña - onde se atopa o cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.5 - - - 1. :!comando executa un comando externo. - Alguns exemplos útiles son: - (Windows) (Unix) - :!dir :!ls - mostra o contido dun directorio. - :!del arquivo :!rm arquivo - borra o ficheiro arquivo. - - 2. :w arquivo escribe o arquivo actual no disco co nome de arquivo. - - 3. v movemento :w arquivo guarda as liñas seleccionadas visualmente - no arquivo arquivo. - - 4. :r arquivo recupera do disco o arquivo arquivo e pégao embaixo - da posición do cursor. - - 5. :r !dir le a saída do comando dir e pégao embaixo da - posición do cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.1: O COMANDO «OPEN» (ABRIR) - - - ** Prema o para abrir unha liña embaixo do cursor - e situarse no modo inserir ** - - 1. Mova o cursor á liña inferior sinalada con --->. - - 2. Prema a letra minúscula o para abrir unha liña por EMBAIXO do cursor - e situarse en modo Inserir. - - 3. Agora, escriba algún texto, e despois prema para saír do modo - Inserir. - ----> Despois de pulsar o , o cursor sitúase na liña aberta en modo Inserir. - - 4. Para abrir unha liña por RIBA do cursor, simplemente prema un O - MAIÚSCULO, en troques dun o minúsculo. Probe isto na liña seguinte. - ----> Abra unha liña sobre esta, pulsando O cuando o cursor estea nesta liña. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.2: O COMANDO «APPEND» (ENGADIR) - - - ** Prema a para inserir texto despois do cursor. ** - - 1. Mova o cursor ao inicio da primeira liña inferior sinalada con --->. - - 2. Escriba e ata que o cursor estea ao final de li . - - 3. Escriba un a (minúsculo) para engadir texto despois do cursor. - - 4. Complete a palabra coma na liña inferior. Prema para saír - do modo Inserir. - - 5. Utilice e para moverse ata a seguinte palabra incompleta e - repita os pasos 3 e 4. - ----> Esta li permit practi cómo enga texto a unha ----> Esta liña permitirálle practicar cómo engadir texto a unha liña. - -NOTA: a, i e A entran no modo Inserir; a única diferencia é - onde se colocan os carácteres inseridos. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.3: OUTRA VERSIÓN DE «REPLACE» (SUBSTITUÍR) - - - ** Prema un R MAIÚSCULO para substituír máis dun carácter. ** - - 1. Mova o cursor á primeira liña inferior sinalada con --->. - Mova o cursor ao inicio da primeira xxx . - - 2. Agora prema R e escriba o número que aparece na liña inferior. - Isto substituirá o texto xxx . - - 3. Prema para abandoa-lo modo Substituír. - Observe que o resto da liña fica sen modificacions. - - 4. Repita os pasos para substituí-lo texto xxx que queda. - ----> Sumar 123 a xxx da un resultado de xxx. ----> Sumar 123 a 456 da un resultado de 579. - -NOTA: O modo Substituír é como o modo Inserir, pero cada carácter escrito - elimina un carácter xa existente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.4: COPIAR E PEGAR TEXTO - - - ** Utilice o operador e para copiar texto e p para pegalo. ** - - 1. Mova o cursor á liña inferior marcada con ---> e posicione o - cursor despois de "a)". - - 2. Inicie o modo Visual con v - e mova o cursor xusto antes de "primeiro". - - 3. Prema e para copiar («yank») o texto salientado. - - 4. Mova o cursor ao final da seguinte liña mediante: j$ - - 5. Prema p para pór (pegar) o texto. Despois escriba: o segundo . - - 6. Utilice o modo visual para seleccionar " elemento.", e cópieo con y. - Mova o cursor ao final da seguinte liña con j$ e pegue o texto - xusto acabado de copiar con p . - ----> a) este é o primeiro elemento. - b) - -NOTA: Tamén pode utilizar e como un operador: yw copia unha palabra, - yy copia a liña completa onde está o cursor; despois p pegará - esa liña. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.5: ACTIVAR («SET») UNHA OPCIÓN - - - ** Active unha opción para buscar ou substituír ignorando - se o texto está en MAIÚSCULAS ou minúsculas ** - - 1. Busque a cadea de texto 'ignorar' escribindo: /ignorar - Repita a busca varias veces pulsando n . - - 2. Active a opción 'ic' ("Ignore case" ou ignorar maiúsculas e minúsculas) - mediante: :set ic - - 3. Agora, busque de novo 'ignorar' pulsando n . - Observe que agora tamén se acha Ignorar e IGNORAR. - - 4. Active as opcions 'hlsearch' e 'incsearch' escribindo: :set hls is - - 5. Agora escriba de novo o comando de busca - e vexa qué acontece: /ignore - - 6. Para inhabilitar ou ignorar a distinción entre MAIÚSCULAS e minúsculas - escriba: :set noic - -NOTA: Para elimina-lo salientado das coincidencias escriba: :nohlsearch -NOTA: Se quere ignora-las MAIÚSCULAS e minúsculas, só para un comando - de busca, utilice \c na frase: /ignorar\c - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.6 - - - 1. Escriba o para abrir unha liña por BAIXO da posición do cursor e - entrar en modo Inserir. - Escriba O para abrir unha liña por RIBA da posición do cursor e - entrar en modo Inserir - - 2. Escriba a para inserir texto despois do cursor. - Escriba A para inserir texto ao final da liña. - - 3. O comando e move o cursor ao final dunha palabra. - - 4. O operador e copia («yank») texto; p pégao (pon). - - 5. Ao escribir un R MAIÚSCULO, entra no modo Substituír ata que - se preme . - - 6. Ao escribir :set xxx , actívase a opción 'xxx'. - Algunas opcións son: - 'ic' 'ignorecase' ignorar maiúsculas/minúsculas ao buscar - 'is' 'incsearch' amosa-las coincidencias parciais para - a busca dunha frase - 'hls' 'hlsearch' salienta tódalas coincidencias da frases - - Pode utilizar tanto os nomes longos coma os curtos das opcions. - - 7. Engada "no" para inhabilitar unha opción: :set noic - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 7: OBTER AXUDA - - - ** Utilice o sistema de axuda en liña ** - - O Vim dispón dun sistema de axuda en liña. Para comezar, probe unha - destas tres formas: - - prema a tecla (se dispón dela) - - prema a tecla (se dispón dela) - - escriba :help - - Lea o texto na xanela de axuda para descubrir cómo funciona a axuda. - Escriba CTRL-W CTRL-W para chimpar dunha xanela a outra. - Escriba :q para pechar a xanela de axuda. - - Pode atopar axuda en case calquer tema engadindo un argumento ao - comando :help . Probe estes (non esqueza premer ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manua - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.7.2: CREAR UN SCRIPT DE INICIO - - - ** Habilitar funcionalidades no Vim ** - - O Vim ten moitas máis funcionalidades que o Vi, pero algunhas están - inhabilitadas de xeito predeterminado. - Para empezar a utilizar máis funcionalidades debería crear un arquivo - chamado "vimrc". - - 1. Comece a edita-lo arquivo "vimrc". Isto depende do seu sistema: - :e ~/.vimrc para Unix - :e ~/_vimrc para Windows - - 2. Agora lea o contenido do arquivo "vimrc" de exemplo: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Garde o arquivo mediante: - :w - - A próxima vez que inicie o Vim, este usará o salientado de sintaxe. - Pode engadir tódolos seus axustes preferidos a este arquivo "vimrc". - Para máis información escriba :help vimrc-intro - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.7.3: COMPLETADO - - - ** Completado da liña de comandos con CTRL-D ou . ** - - 1. Asegúrese de que o Vim non está no modo compatible: :set nocp - - 2. Vexa qué arquivos existen no directorio con: :!ls ou :!dir - - 3. Escriba o inicio dun comando: :e - - 4. Prema CTRL-D e o Vim mostrará a lista de comandos que empezan con "e". - - 5. Engada d e o Vim completará o nome do comando a ":edit". - - 6. Agora engada un espacio e o inicio do nome dun arquivo: :edit FIL - - 7. Prema . Vim completará o nome (se só hai un). - -NOTA: O completado funciona con moitos comandos. Só prema CTRL-D ou - . É especialmente útil para :help . - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.7 - - - 1. Escriba :help ou prema ou para abri-la xanela de axuda. - - 2. Escriba :help cmd para atopar axuda sobre cmd . - - 3. Escriba CTRL-W CTRL-W para chimpar a outra xanela. - - 4. Escriba :q para pecha-la xanela de axuda. - - 5. Cree un ficheiro vimrc de inicio para garda-los sus axustes preferidos. - - 6. Cuando escriba un comando : prema CTRL-D para ver posibles opcións. - Prema para utilizar unha das opcións de completado. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Aquí conclúe o tutor do Vim. Está pensado para dar unha visión breve do - editor Vim, suficiente para permitirlle usa-lo editor de forma bastante - sinxela. Está moi lonxe de estar completo pois o Vim ten moitísimos máis - comandos. Lea o seguinte manual de usuario: ":help user-manual". - - Para lecturas e estudos posteriores, recoméndase o libro: - Vim - Vi Improved - de Steve Oualline - Editado por: New Riders - o primeiro libro adicado completamente ao Vim. Especialmente útil para - principiantes. Ten moitos exemplos e imaxes. - Vexa https://iccf-holland.org/click5.html - - Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, - Colorado School of Mines utilizando ideas subministradas por Charles Smith, - Colorado State University. - E-mail: bware@mines.colorado.edu. - - Modificado para Vim por Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Traducido do inglés ao galego por Fernando Vilariño. - Correo electrónico: fernando@cvc.uab.es. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.gl.utf-8 b/runtime/tutor/tutor1.gl.utf-8 deleted file mode 100644 index 1828289e..00000000 --- a/runtime/tutor/tutor1.gl.utf-8 +++ /dev/null @@ -1,1049 +0,0 @@ - -=============================================================================== -= B e n v i d o a o t u t o r d o V I M - Versión 1.7 = -=============================================================================== - - - Vim é un editor moi potente que dispón de moitos comandos, demasiados - para ser explicados nun tutor coma este. Este tutor está deseñado - para describir comandos dabondo para que vostede sexa capaz de - aprender fácilmente a usa-lo Vim como un editor de propósito xeral. - - O tempo necesario para completa-lo tutor é aproximadamente de 30 - minutos, dependendo de canto tempo se adique á experimentación. - - Os comandos destas leccións modificarán o texto. Faga unha copia deste - ficheiro para practicar (con «vimtutor», isto xa é unha copia). - - É importante lembrar que este tutor está pensado para ensinar coa - práctica. Isto significa que cómpre executa-los comandos para - aprendelos axeitadamente. Se únicamente le o texto, esqueceránselle - os comandos! - - Agora, asegúrese de que a tecla de bloqueo de maiúsculas NON está - activada e prema a tecla j para move-lo cursor, de xeito que o texto - da Lección 1.1.1 abranga completamente a pantalla. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.1: MOVE-LO CURSOR - - - ** Para move-lo cursor, prema as teclas h,j,k,l do xeito indicado. ** - ^ - k Indicación: A tecla h está á esquerda, e móveo á esquerda. - < h l > A tecla l está á dereita, e móveo á dereita. - j A tecla j semella unha frecha e apunta - v cara a embaixo. - - 1. Mova o cursor pola pantalla ata que sinta comodidade facendo a acción. - - 2. Manteña premida a tecla j ata que se repita automáticamente. - Agora xa sabe como chegar á lección seguinte. - - 3. Utilizando a tecla abaixo, vaia á lección 1.1.2. - -NOTA: Se alguna vez non está seguro sobre algo que tecleara, prema - para situarse no modo Normal. Logo, volva a teclear a orde que desexaba. - -NOTA: As teclas de movemento do cursor tamén funcionan. Pero usando hjkl - poderá moverse moito máis rápido unha vez que se acostume. - De verdade! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.2: SAÃR DO VIM - - -NOTA: Antes de executar algún dos seguintes pasos, lea primeiro a lección - enteira!! - - 1. Prema a tecla (para asegurarse de que está no modo Normal). - - 2. Escriba: :q! - Isto provoca a saída do editor REXEITANDO calquer cambio que fora feito. - - 3. Regrese eiquí executando o comando que o trouxo a este tutor. - Este puido ser: vimtutor - - 4. Se memorizou estes pasos, e se sinte con confianza, execute os - pasos do 1 ao 3 para saír e volver a entrar ao editor. - -NOTA: :q! descarta cualquer cambio que realizara. - En próximas leccións, aprenderá como garda-los cambios nun arquivo. - - 5. Mova o cursor ata a Lección 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.3: EDITAR TEXTO - BORRAR - - - ** Prema x para elimina-lo carácter baixo o cursor. ** - - 1. Mova o cursor á liña de embaixo sinalada con --->. - - 2. Para corrixi-los erros, mova o cursor ata que estea sobre o - carácter que vai ser borrado. - - 3. Prema a tecla x para elimina-lo carácter non desexado. - - 4. Repita os pasos 2 a 4 ata que a frase sexa a correcta. - ----> A vvaca saltooooou soobree aa lúúúúúúúa. - - 5. Agora que a liña está correcta, continúe coa Lección 1.1.4. - -NOTA: A medida que vaia avanzando neste tutor, non tente memorizar, - aprenda practicando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.4: EDITAR TEXTO - INSERIR - - - ** Prema i para inserir texto. ** - - 1. Mova o cursor á primeira liña de embaixo sinalada con --->. - - 2. Para facer que a primeira liña sexa igual ca segunda, mova o cursor - ata que estea sobre o carácter ANTES do texto que vai ser inserido. - - 3. Prema i e escriba os carácteres a engadir. - - 4. A medida que sexa corrixido cada erro, prema para volver ao modo - Normal. Repita os pasos 2 a 4 para corrixi-la frase. - ----> Flta texto nesta . ----> Falta algo de texto nesta liña. - - 5. Cuando se sinta con comodidade inserindo texto, pase á lección 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.5: EDITAR TEXTO - ENGADIR - - - ** Prema A para engadir texto. ** - - 1. Mova o cursor á primeira liña inferior marcada con --->. - Non importa sobre qué carácter estea o cursor nesta liña. - - 2. Prema A e escriba o texto necesario. - - 3. Cuando o texto estea engadido, prema para volver ao modo Normal. - - 4. Mova o cursor á segunda liña marcada con ---> e repita os pasos 2 e 3 - para corrixir esta frase. - ----> Falta algún texto nes - Falta algún texto nesta liña. ----> Tamén falta alg - Tamén falta algún texto eiquí. - - 5. Cuando se sinta con comodidade engadindo texto, pase á lección 1.1.6. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.1.6: EDITAR UN ARQUIVO - - - ** Use :wq para gardar un arquivo e saír ** - -NOTA: Antes de executar os seguintes pasos, lea a lección enteira!! - - 1. Se ten acceso a outra terminal, faga os seguintes puntos nela. - Se non é así, saia deste tutor como fixo na lección 1.1.2: :q! - - 2. No símbolo do sistema escriba este comando: vim arquivo.txt - 'vim' é o comando para arrincar o editor Vim, - 'arquivo.txt' é o nome do arquivo que quere editar. - Utilice o nome dun arquivo que poida cambiar. - - 3. Insira e elimine texto como xa aprendeu nas leccións anteriores. - - 4. Garde o arquivo cos cambios e saia do Vim con: :wq - - 5. Se xa saiu do vimtutor no paso 1, reinicie vimtutor e baixe ata - o seguinte resumo. - - 6. Despois de le-los pasos anteriores e telos entendido: fágaos. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.1 - - - 1. O cursor móvese utilizando as teclas das frechas ou as teclas hjkl. - h (esquerda) j (abaixo) k (arriba) l (dereita) - - 2. Para acceder ao Vim dende o símbolo do sistema escriba: - vim nome_arquivo - - 3. Para saír do Vim escriba: :q! para eliminar tódolos - cambios. - Ou escriba: :wq para garda-los cambios. - - 4. Para borrar un carácter baixo o cursor en modo Normal prema: x . - - 5. Para inserir ou engadir texto escriba: - i escriba o texto a inserir insire o texto antes do cursor - A escriba o texto a engadir engade o texto ao final da liña - -NOTA: Premendo tórnase ao modo Normal ou cancélase unha orde non - desexada ou incompleta. - - Agora continúe coa Lección 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.1: COMANDOS PARA BORRAR - - - ** Escriba dw para borrar unha palabra ** - - 1. Prema para asegurarse de que está no modo Normal. - - 2. Mova o cursor á liña inferior sinalada con --->. - - 3. Mova o cursor ao comezo dunha palabra que desexe borrar. - - 4. Prema dw para facer que a palabra desapareza. - -NOTA: A letra d aparecerá na última liña inferior dereita da pantalla - namentres a escribe. O Vim está esperando que escriba w . - Se ve outro carácter que non sexa d , é que escribiu algo mal. Prema - e comece de novo. - ----> Hai algunhas palabras pásao ben que non pertencen papel a esta frase. - - 5. Repita os pasos 3 e 4 ata que a frase sexa correcta e pase á - lección 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.2: MÃIS COMANDOS PARA BORRAR - - - ** Escriba d$ para borrar ata o final da liña. ** - - 1. Prema para asegurarse de que está no modo Normal. - - 2. Mova o cursor á liña inferior sinalada con --->. - - 3. Mova o cursor ao final da liña correcta (DESPOIS do primeiro . ). - - 4. Escriba d$ para borrar ata o final da liña. - ----> Alguén escribiu o final desta liña dúas veces. esta liña dúas veces. - - Pase á lección 1.2.3 para entender qué está pasando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.3: SOBRE OPERADORES E MOVEMENTOS - - - Moitos comandos que cambian texto están compostos por un operador e máis - un movemento. - O formato para o comando 'eliminar' co operador de borrado d é o - seguinte: - - d movemento - - Onde: - d - é o operador para borrar. - movemento - é o texto sobre o que o comando vai operar (lista inferior). - - Eiquí, unha lista resumida de movementos: - w - ata o comezo da seguinte palabra, EXCLUÃNDO o seu primero carácter. - e - ata o final da palabra actual, INCLUÃNDO o último carácter. - $ - ata o final da liña, INCLUÃNDO o último carácter. - - Polo tanto, ao escribir de borraráse dende a posición do cursor ata o - final da palabra. - -NOTA: Premendo únicamente o movemento, estando no modo Normal sen un - operador, moveráse o cursor como se especifica na lista anterior. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.4: UTILIZAR UN CONTADOR PARA UN MOVEMENTO - - - ** Ao escribir un número denantes dun movemento, repítise o movemento - o número de veces. ** - - 1. Mova o cursor ao comezo da liña marcada con --->. - - 2. Escriba 2w para mover o cursor dúas palabras cara a adiante. - - 3. Escriba 3e para mover o cursor ao final da terceira palabra cara a - adiante. - - 4. Escriba 0 (cero) para coloca-lo cursor ao inicio da liña. - - 5. Repita os pasos 2 e 3 con diferentes números. - ----> Isto é só unha liña con palabras onde poder moverse. - - Pase á lección 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.5: UTILIZAR UN CONTADOR PARA BORRAR MÃIS - - - ** Ao escribir un número cun operador, repítese ese número de veces. ** - - En combinación co operador de borrado e o movemento mencionado - anteriormente, engada un contador antes do movemento para eliminar máis: - d número movemento - - 1. Mova o cursor ao inicio da primeira palabra en MAIÚSCULAS na liña - marcada con --->. - - 2. Escriba d2w para elimina-las dúas palabras en MAIÚSCULAS. - - 3. Repita os pasos 1 e 2 con diferentes contadores para elimina-las - seguintes palabras en MAIÚSCULAS cun comando. - ----> Esta ABC DE cadea FGHI JK LMN OP de palabras foi Q RS TUV limpada. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.6: OPERACIÓN EN LIÑAS - - - ** Escriba dd para eliminar unha liña completa. ** - - Debido á frecuencia coa que se elimina unha liña completa, os deseñadores - do Vim decidiron que sería máis sinxelo simplemente escribir dúas letras - d para eliminar unha liña. - - 1. Mova o cursor á segunda liña do párrafo inferior. - - 2. Escriba dd para elimina-la liña. - - 3. Agora, móvase á cuarta liña. - - 4. Escriba 2dd para eliminar dúas liñas á vez. - ----> 1) As rosas son vermellas, ----> 2) o barro é divertido, ----> 3) a violeta é azul, ----> 4) teño un coche, ----> 5) os reloxos dan a hora, ----> 6) o azucere é dóce ----> 7) e ti tamén o es. - - A duplicación para borrar liñas tamén funcionan cos operadores - mencionados anteriormente. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.2.7: O COMANDO DESFACER - - - ** Prema u para desfacer os últimos comandos, - U para desfacer unha liña enteira. ** - - 1. Mova o cursor á liña inferior sinalada con ---> e sitúeo baixo o - primeiro erro. - - 2. Prema x para borra-lo primeiro carácter non desexado. - - 3. Prema agora u para desface-lo último comando executado. - - 4. Agora, corrixa tódolos erros da liña usando o comando x. - - 5. Prema agora U maiúsculo para devolver a liña ao seu estado orixinal. - - 6. Prema agora u unhas poucas veces máis para desface-lo feito por U e - mailos comandos previos. - - 7. Agora, prema CTRL-R (manteña pulsada a tecla CTRL e prema R) unhas - cantas veces para volver a executar os comandos (desface-lo desfeito). - ----> Corrrixa os erros dee esttta liña e vooolva ponelos coon desfacer. - - Estes son uns comandos moi útiles. Agora, vaiamos ao resumo da lección 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.2 - - - 1. Para borrar dende o cursor ata a seguinte palabra prema: dw - 2. Para borrar dende o cursor ata o final da palabra prema: de - 3. Para borrar dende o cursor ata o final dunha liña prema: d$ - 4. Para borrar unha liña enteira prema: dd - 5. Para repetir un movemento, antepoña un número: 2w - 6. O formato para un comando de cambio é: - operador [número] movemento - onde: - comando - é o que hai que facer, por exemplo, d para borrar - [número] - é un número opcional para repetir o movemento - movemento - móvese sobre o texto no que operar, como w (palabra), - $ (ata o final da liña), etc. - - 7. Para moverse ao inicio da liña utilice un cero: 0 - 8. Para desfacer acciones previas prema: u (u minúsculo) - Para desfacer tódolos cambios dunha liña prema: U (U mAIÚSCULO) - Para desface-lo desfeito prema: CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.1: O COMANDO «PUT» (PÓR) - - - ** Prema p para pór (pegar) despois do cursor o último que borrou. ** - - 1. Mova o cursor á primeira liña inferior marcada con --->. - - 2. Escriba dd para borra-la liña e almacenala nun rexistro do Vim. - - 3. Mova o cursor á liña c) por RIBA de onde debería esta-la liña - eliminada. - - 4. Prema p para pega-la liña borrada por BAIXO do cursor. - - 5. Repita os pasos 2 a 4 para por tódalas liñas na orde correcta. - ----> d) Podes aprendela ti? ----> b) A violeta é azul, ----> c) a intelixencia apréndese, ----> a) as rosas son vermellas. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.2: O COMANDO «REPLACE» (TROCAR) - - - ** Prema rx para troca-lo carácter baixo o cursor con x . ** - - 1. Mova o cursor á primeira liña inferior marcada con --->. - - 2. Mova o cursor para situalo sobre o primeiro erro. - - 3. Prema r e despois o carácter que debería ir aí. - - 4. Repita os pasos 2 e 3 ata que a primeira liña sexa igual á segunda. - ----> Cande esti lita fui escrita alguér premeu alginhas teclas equibocadas! ----> Cando esta liña foi escrita alguén premeu algunhas teclas equivocadas! - - 5. Agora pase á lección 1.3.3. - -NOTA: Lembre que debería aprender practicando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.3: O COMANDO CAMBIAR - - - ** Para cambiar ata o final dunha palabra, escriba ce . ** - - 1. Mova o cursor á primeria liña inferior marcada con --->. - - 2. Sitúe o cursor no u de lubrs. - - 3. Escriba ce e corrixa a palabra (neste caso, escriba 'iña'). - - 4. Prema e mova o cursor ao seguinte erro a cambiar. - - 5. Repita os pasos 3 e 4 ata que a primeira frase sexa igual á segunda. - ----> Esta lubrs ten unhas poucas pskavtad que corrixir co comando change. ----> Esta liña ten unhas poucas palabras que corrixir co comando cambiar. - - Teña en conta que ce elimina a palabra e entra no modo Inserir. - cc fai o mesmo para toda a liña. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.3.4: MÃIS CAMBIOS USANDO c - - - ** O operador cambio utilízase cos mesmos movementos que borrar. ** - - 1. O operador cambio funciona do mesmo xeito que borrar. O formato é: - - c [número] movemento - - 2. Os movementos son tamén os mesmos, como w (palabra) ou - $ (fin da liña). - - 3. Mova o cursor á primeira liña inferior sinalada con --->. - - 4. Mova o cursor ao primeiro erro. - - 5. Prema c$ e escriba o resto da liña para que sexa como a segunda, - e prema . - ----> O final desta liña necesita algunha axuda para que sexa como a segunda. ----> O final desta liña necesita ser corrixido usando o comando c$. - -NOTA: Pode utiliza-lo retorno de carro para corrixir erros mentres escribe. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.3 - - - 1. Para volver a pór ou pega-lo texto que acaba de borrarse, - escriba p . Isto pega o texto despois do cursor (se borrou unha - liña, ao pegala, esta situaráse na liña baixo do cursor). - - 2. Para troca-lo carácter baixo do cursor, prema r e logo o - carácter que quere que estea no seu lugar. - - 3. O operador cambio permítelle cambiar dende a posición do cursor - ata onde leve o movemento indicado. Por exemplo, prema ce - para cambiar dende o cursor ata o final da palabra, ou c$ - para cambiar ata o final da liña. - - 4. O formato para cambio é: - - c [número] movemento - - Pase agora á lección seguinte. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.1: UBICACIÓN DO CURSOR E ESTADO DO ARQUIVO - - - ** Prema CTRL-G para mostra-la súa situación no ficheiro e mailo estado. - Prema G para moverse a unha determinada liña do fichero. ** - -NOTA: Lea esta lección enteira antes de executar calquera dos pasos!! - - 1. Manteña premida a tecla Ctrl e prema g . Chamamos a isto CTRL-G. - Aparecerá unha mensaxe na parte inferior da páxina co nome do arquivo - e a posición do cursor no arquivo. - Lembre o número de liña para o paso 3. - -NOTA: Seica poida ve-la posición do cursor no recanto inferior da dereita - da pantalla. Isto acontece cando a opción 'ruler' (regra) está - habilitada (consulte :help 'ruler' ) - - 2. Prema G para move-lo cursor ata a parte inferior do arquivo. - Prema gg para move-lo cursor ao inicio do arquivo. - - 3. Escriba o número da liña na que estaba e despois G . Isto - tornaráo á liña na que estaba cuando pulsou CTRL-G. - - 4. Se se atopa con seguridade para poder facer isto, - execute os pasos 1 a 3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.2: O COMANDO «SEARCH» (BUSCAR) - - - ** Escriba / seguido dun texto para busca-lo texto. ** - - 1. En modo Normal, prema o carácter / . Fíxese que tanto o carácter / - como o cursor aparecen na derradeira liña da pantalla, o mesmo que - o comando : . - - 2. Escriba agora errroor . Esta é a palabra que quere buscar. - - 3. Para repeti-la busca do mesmo texto outra vez, simplemente prema n . - Para busca-lo mesmo texto na dirección oposta, prema N . - - 4. Se quere buscar un texto na dirección oposta (cara a enriba), - utilice o comando ? en troques de / . - - 5. Para regresar ao lugar de onde procedía, prema CTRL-O (manteña pulsado - Ctrl mentres pulsa a tecla o). Repita o proceso para voltar máis atrás. - CTRL-I vai cara a adiante. - ----> "errroor" non é o xeito correcto de escribir erro; errroor é un erro. - -NOTA: Cando a busca chega ao final do arquivo, continuará dende o comezo, - agás que a opción 'wrapscan' estea desactivada. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.3: BUSCA PARA COMPROBAR PARÉNTESES - - - ** Prema % para atopa-la paréntese correspondente a ),] ou } . ** - - 1. Sitúe o cursor en cualquera dos carácteres (, [ o { na liña inferior - sinalada con --->. - - 2. Prema agora o carácter % . - - 3. O cursor moveráse á parella de peche da paréntese, corchete - ou chave correspondente. - - 4. Prema % para move-lo cursor ata a outra parella do carácter. - - 5. Mova o cursor a outra (,),[,],{ o } e vexa o que fai % . - ----> Isto ( é unha liña de proba con (, [, ], {, e } nela. )) - -NOTA: Isto é moi útil na detección de erros nun programa con parénteses, - corchetes ou chaves sen parella. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.4.4: O COMANDO SUBSTITUÃR - - - ** Escriba :s/vello/novo/g para substituír 'vello' por 'novo'. ** - - 1. Mova o cursor á liña inferior sinalada con --->. - - 2. Escriba :s/aas/as/ . Teña en conta que este comando cambia - só o primeiro achado -na liña- da expresión que quere cambiar. - - 3. Agora escriba :s/aas/a/g . Ao engadir a opción g , o Vim fará - a substitución global na liña, cambiando tódo-los achados - do termo "aas" na liña. - ----> Coido que aas mellores épocas para aas frores son aas primaveras. - - 4. Para cambiar cada achado da cadea de carácteres entre dúas liñas: - Escriba :#,#s/vello/novo/g onde #,# son os números de liña do rango - de liñas onde se realizará a substitución. - Escriba :%s/vello/novo/g para cambiar cada achado en todo o arquivo. - Escriba :%s/vello/novo/gc para atopar cada achado en todo o arquivo, - pedindo confirmación para face-la - substitución ou non. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.4 - - - 1. CTRL-G mostra a posición do cursor no ficheiro e mailo seu estado. - G move o cursor ao final do arquivo. - número G move o cursor a ese número de liña. - gg move o cursor á primeira liña do arquivo. - - 2. Escribindo / seguido dun texto busca o texto cara a ADIANTE. - Escribindo ? seguido dun texto busca o texto cara a ATRÃS. - Despois dunha busca, prema n para atopar o achado. - - 3. Premendo % cando o cursor está sobre (,), [,], { o } localiza - a parella correspondente. - - 4. Para cambiar vello por novo no primeiro achado dunha liña escriba - :s/vello/novo - Para cambiar tódo-los vello por novo nunha liña escriba - :s/vello/novo/g - Para cambiar texto entre dous números de liña escriba - :#,#s/vello/novo/g - Para cambiar vello por novo en todo o fichero escriba - :%s/vello/novo/g - Para pedir confirmación en cada caso engada 'c' - :%s/vello/novo/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.1: CÓMO EXECUTAR UN COMANDO EXTERNO - - - ** Escriba :! seguido dun comando externo para executar ese comando. ** - - 1. Escriba o conocido comando : para situar o cursor ao final da - pantalla. Isto permitirálle introducir un comando. - - 2. Agora escriba o carácter ! (signo de admiración). Isto permitirálle - executar calquer mandato do sistema. - - 3. Como exemplo escriba ls despois do ! e logo prema . Isto - mostrarálle unha lista do seu directorio, igual que se estiviese no - símbolo do sistema. Se ls non funciona, utilice :!dir . - -NOTA: Deste xeito é posible executar cualquer comando externo, - tamén incluíndo argumentos. - -NOTA: Tódolos comandos : deben finalizarse premendo . - De agora en diante, non sempre se mencionará. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.2: MÃIS SOBRE GARDAR FICHEIROS - - - ** Para garda-los cambios feitos nun ficheiro, - escriba :w NOME_DE_FICHEIRO ** - - 1. Escriba :!dir ou :!ls para ver unha lista dos arquivos - do seu directorio. - Xa sabe que debe pulsar despois. - - 2. Elixa un nome de ficheiro que todavía non exista, como TEST. - - 3. Agora escriba :w TEST (onde TEST é o nome de ficheiro elixido). - - 4. Esta acción garda todo o ficheiro (Vim Tutor) baixo o nome TEST. - Para comprobalo, escriba :!dir ou :!ls de novo e vexa - o seu directorio. - -NOTA: Se saíra do Vim e volvera a entrar de novo con vim TEST , o - arquivo sería unha copia exacta do tutorial cuando o guardou. - - 5. Agora, elimine o arquivo escribindo (Windows): :!del TEST - ou (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.3: SELECCIONAR TEXTO PARA GARDAR - - - ** Para gardar parte do arquivo, escriba v movemento :w arquivo ** - - 1. Mova o cursor a esta liña. - - 2. Prema v e mova o cursor ata o quinto elemento inferior. Vexa que - o texto é salientado. - - 3. Prema o carácter : Na parte inferior da pantalla aparecerá - :'<,'> - - 4. Prema w TEST , onde TEST é un nome de arquivo que aínda non existe. - Verifique que ve :'<,'>w TEST antes de premer . - - 5. Vim escribirá as liñas seleccionadas no arquivo TEST. Utilice - :!dir o :!ls para velo. Non o elimine todavía! Utilizarémolo - na seguinte lección. - -NOTA: Ao pulsar v iniciá a selección visual. Pode move-lo cursor para - face-la selección máis grande ou pequena. Despois, pode utilizar un - operador para facer algo co texto. Por exemplo, d eliminará - o texto seleccionado. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.5.4: RECUPERANDO E MESTURANDO FICHEIROS - - - ** Para inseri-lo contido dun ficheiro escriba :r NOME_DO_FICHEIRO ** - - 1. Sitúe o cursor xusto por riba desta liña. - -NOTA: Despois de executar o paso 2 verá o texto da lección 1.5.3. Despois - DESCENDA ata ver de novo esta lección. - - 2. Agora recupere o arquivo TEST utilizando o comando :r TEST , onde - TEST é o nome que ven de utilizar. - O arquivo que recuperou colocaráse embaixo da liña onde se atope - o cursor. - - 3. Para verificar que se recuperou o arquivo, suba o cursor e - comprobe que agora hai dúas copias da lección 1.5.3, a orixinal e - maila versión do arquivo. - -NOTA: Tamén pode le-la saída dun comando externo. Por exemplo, - :r !ls le a saída do comando ls e pégao baixo da liña - onde se atopa o cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.5 - - - 1. :!comando executa un comando externo. - Alguns exemplos útiles son: - (Windows) (Unix) - :!dir :!ls - mostra o contido dun directorio. - :!del arquivo :!rm arquivo - borra o ficheiro arquivo. - - 2. :w arquivo escribe o arquivo actual no disco co nome de arquivo. - - 3. v movemento :w arquivo guarda as liñas seleccionadas visualmente - no arquivo arquivo. - - 4. :r arquivo recupera do disco o arquivo arquivo e pégao embaixo - da posición do cursor. - - 5. :r !dir le a saída do comando dir e pégao embaixo da - posición do cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.1: O COMANDO «OPEN» (ABRIR) - - - ** Prema o para abrir unha liña embaixo do cursor - e situarse no modo inserir ** - - 1. Mova o cursor á liña inferior sinalada con --->. - - 2. Prema a letra minúscula o para abrir unha liña por EMBAIXO do cursor - e situarse en modo Inserir. - - 3. Agora, escriba algún texto, e despois prema para saír do modo - Inserir. - ----> Despois de pulsar o , o cursor sitúase na liña aberta en modo Inserir. - - 4. Para abrir unha liña por RIBA do cursor, simplemente prema un O - MAIÚSCULO, en troques dun o minúsculo. Probe isto na liña seguinte. - ----> Abra unha liña sobre esta, pulsando O cuando o cursor estea nesta liña. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.2: O COMANDO «APPEND» (ENGADIR) - - - ** Prema a para inserir texto despois do cursor. ** - - 1. Mova o cursor ao inicio da primeira liña inferior sinalada con --->. - - 2. Escriba e ata que o cursor estea ao final de li . - - 3. Escriba un a (minúsculo) para engadir texto despois do cursor. - - 4. Complete a palabra coma na liña inferior. Prema para saír - do modo Inserir. - - 5. Utilice e para moverse ata a seguinte palabra incompleta e - repita os pasos 3 e 4. - ----> Esta li permit practi cómo enga texto a unha ----> Esta liña permitirálle practicar cómo engadir texto a unha liña. - -NOTA: a, i e A entran no modo Inserir; a única diferencia é - onde se colocan os carácteres inseridos. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.3: OUTRA VERSIÓN DE «REPLACE» (SUBSTITUÃR) - - - ** Prema un R MAIÚSCULO para substituír máis dun carácter. ** - - 1. Mova o cursor á primeira liña inferior sinalada con --->. - Mova o cursor ao inicio da primeira xxx . - - 2. Agora prema R e escriba o número que aparece na liña inferior. - Isto substituirá o texto xxx . - - 3. Prema para abandoa-lo modo Substituír. - Observe que o resto da liña fica sen modificacions. - - 4. Repita os pasos para substituí-lo texto xxx que queda. - ----> Sumar 123 a xxx da un resultado de xxx. ----> Sumar 123 a 456 da un resultado de 579. - -NOTA: O modo Substituír é como o modo Inserir, pero cada carácter escrito - elimina un carácter xa existente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.4: COPIAR E PEGAR TEXTO - - - ** Utilice o operador e para copiar texto e p para pegalo. ** - - 1. Mova o cursor á liña inferior marcada con ---> e posicione o - cursor despois de "a)". - - 2. Inicie o modo Visual con v - e mova o cursor xusto antes de "primeiro". - - 3. Prema e para copiar («yank») o texto salientado. - - 4. Mova o cursor ao final da seguinte liña mediante: j$ - - 5. Prema p para pór (pegar) o texto. Despois escriba: o segundo . - - 6. Utilice o modo visual para seleccionar " elemento.", e cópieo con y. - Mova o cursor ao final da seguinte liña con j$ e pegue o texto - xusto acabado de copiar con p . - ----> a) este é o primeiro elemento. - b) - -NOTA: Tamén pode utilizar e como un operador: yw copia unha palabra, - yy copia a liña completa onde está o cursor; despois p pegará - esa liña. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.6.5: ACTIVAR («SET») UNHA OPCIÓN - - - ** Active unha opción para buscar ou substituír ignorando - se o texto está en MAIÚSCULAS ou minúsculas ** - - 1. Busque a cadea de texto 'ignorar' escribindo: /ignorar - Repita a busca varias veces pulsando n . - - 2. Active a opción 'ic' ("Ignore case" ou ignorar maiúsculas e minúsculas) - mediante: :set ic - - 3. Agora, busque de novo 'ignorar' pulsando n . - Observe que agora tamén se acha Ignorar e IGNORAR. - - 4. Active as opcions 'hlsearch' e 'incsearch' escribindo: :set hls is - - 5. Agora escriba de novo o comando de busca - e vexa qué acontece: /ignore - - 6. Para inhabilitar ou ignorar a distinción entre MAIÚSCULAS e minúsculas - escriba: :set noic - -NOTA: Para elimina-lo salientado das coincidencias escriba: :nohlsearch -NOTA: Se quere ignora-las MAIÚSCULAS e minúsculas, só para un comando - de busca, utilice \c na frase: /ignorar\c - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.6 - - - 1. Escriba o para abrir unha liña por BAIXO da posición do cursor e - entrar en modo Inserir. - Escriba O para abrir unha liña por RIBA da posición do cursor e - entrar en modo Inserir - - 2. Escriba a para inserir texto despois do cursor. - Escriba A para inserir texto ao final da liña. - - 3. O comando e move o cursor ao final dunha palabra. - - 4. O operador e copia («yank») texto; p pégao (pon). - - 5. Ao escribir un R MAIÚSCULO, entra no modo Substituír ata que - se preme . - - 6. Ao escribir :set xxx , actívase a opción 'xxx'. - Algunas opcións son: - 'ic' 'ignorecase' ignorar maiúsculas/minúsculas ao buscar - 'is' 'incsearch' amosa-las coincidencias parciais para - a busca dunha frase - 'hls' 'hlsearch' salienta tódalas coincidencias da frases - - Pode utilizar tanto os nomes longos coma os curtos das opcions. - - 7. Engada "no" para inhabilitar unha opción: :set noic - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 7: OBTER AXUDA - - - ** Utilice o sistema de axuda en liña ** - - O Vim dispón dun sistema de axuda en liña. Para comezar, probe unha - destas tres formas: - - prema a tecla (se dispón dela) - - prema a tecla (se dispón dela) - - escriba :help - - Lea o texto na xanela de axuda para descubrir cómo funciona a axuda. - Escriba CTRL-W CTRL-W para chimpar dunha xanela a outra. - Escriba :q para pechar a xanela de axuda. - - Pode atopar axuda en case calquer tema engadindo un argumento ao - comando :help . Probe estes (non esqueza premer ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manua - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.7.2: CREAR UN SCRIPT DE INICIO - - - ** Habilitar funcionalidades no Vim ** - - O Vim ten moitas máis funcionalidades que o Vi, pero algunhas están - inhabilitadas de xeito predeterminado. - Para empezar a utilizar máis funcionalidades debería crear un arquivo - chamado "vimrc". - - 1. Comece a edita-lo arquivo "vimrc". Isto depende do seu sistema: - :e ~/.vimrc para Unix - :e ~/_vimrc para Windows - - 2. Agora lea o contenido do arquivo "vimrc" de exemplo: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Garde o arquivo mediante: - :w - - A próxima vez que inicie o Vim, este usará o salientado de sintaxe. - Pode engadir tódolos seus axustes preferidos a este arquivo "vimrc". - Para máis información escriba :help vimrc-intro - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LECCIÓN 1.7.3: COMPLETADO - - - ** Completado da liña de comandos con CTRL-D ou . ** - - 1. Asegúrese de que o Vim non está no modo compatible: :set nocp - - 2. Vexa qué arquivos existen no directorio con: :!ls ou :!dir - - 3. Escriba o inicio dun comando: :e - - 4. Prema CTRL-D e o Vim mostrará a lista de comandos que empezan con "e". - - 5. Engada d e o Vim completará o nome do comando a ":edit". - - 6. Agora engada un espacio e o inicio do nome dun arquivo: :edit FIL - - 7. Prema . Vim completará o nome (se só hai un). - -NOTA: O completado funciona con moitos comandos. Só prema CTRL-D ou - . É especialmente útil para :help . - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LECCIÓN 1.7 - - - 1. Escriba :help ou prema ou para abri-la xanela de axuda. - - 2. Escriba :help cmd para atopar axuda sobre cmd . - - 3. Escriba CTRL-W CTRL-W para chimpar a outra xanela. - - 4. Escriba :q para pecha-la xanela de axuda. - - 5. Cree un ficheiro vimrc de inicio para garda-los sus axustes preferidos. - - 6. Cuando escriba un comando : prema CTRL-D para ver posibles opcións. - Prema para utilizar unha das opcións de completado. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Aquí conclúe o tutor do Vim. Está pensado para dar unha visión breve do - editor Vim, suficiente para permitirlle usa-lo editor de forma bastante - sinxela. Está moi lonxe de estar completo pois o Vim ten moitísimos máis - comandos. Lea o seguinte manual de usuario: ":help user-manual". - - Para lecturas e estudos posteriores, recoméndase o libro: - Vim - Vi Improved - de Steve Oualline - Editado por: New Riders - o primeiro libro adicado completamente ao Vim. Especialmente útil para - principiantes. Ten moitos exemplos e imaxes. - Vexa https://iccf-holland.org/click5.html - - Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, - Colorado School of Mines utilizando ideas subministradas por Charles Smith, - Colorado State University. - E-mail: bware@mines.colorado.edu. - - Modificado para Vim por Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Traducido do inglés ao galego por Fernando Vilariño. - Correo electrónico: fernando@cvc.uab.es. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.gl b/runtime/tutor/tutor2.gl deleted file mode 100644 index 90912613..00000000 --- a/runtime/tutor/tutor2.gl +++ /dev/null @@ -1,215 +0,0 @@ -=============================================================================== -= B e n v i d o a o t u t o r d o V I M - Versión 1.7 = -=============================================================================== -= C A P Í T U L O D O U S = -=============================================================================== - - Hic Sunt Dracones: se este é o súa primeira exposición ao vim, e - prefire iniciarse no capítulo introducturio, pode saír premendo - :q . - - O tempo aproximado requerido para completar este capítulo é de - 8-10 minutos, dependendo de canto tempo use na experimentación. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.1: OS REXISTROS CON NOME - - - ** Almacene dúas palabras copiadas de xeito consecutivo, e logo pégueas. ** - - 1. Mova o cursor ata a liña inferior sinalada con --->. - - 2. Navegue ata calquera carácter da palabra 'Xoán' e escriba "ayiw . - -NEMÓNICO: - dentro do rexistro(") - chamado (a) - pega (y)ank - o interior (i)nner - da palabra (w)ord - - 3. Navegue cara a adiante ata a palabra 'galetas' - ( fl ou 4fe ou $b ou /gal ) e teclee "byiw . - - 4. Navegue ata calquera carácter da palabra 'Uxío' e teclee - ciw a - -NEMÓNICO: - cambia (c)hange - o interior (i)nner - da palabra (w)ord - co - chamado (a) - - 5. Navegue ata calquera punto da palabra 'tartas' e teclee - ciwb - ----> a) De eiquí en adiante, Xoán ficará encarregado das racións de galetas. - b) Xa que logo, Uxío somentes terá poderes no que respecta ás tartas. - -NOTA: O borrado tamén funciona nos rexistros, é dicir: - "sdiw borrará a palabra baixo o cursor e ficaráa no rexistro s. - -REFERENCIAS: Rexistros :h registers - Rexistros con come: :h quotea - Movemento :h motion.txt /inner - CTRL-R :h insert /CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.2: O REXISTRO DE EXPRESIÓN - - - ** Insira o resultado dos cáculos sobre a marcha. ** - - 1. Mova o cursor ata a liña sinalada con --->. - - 2. Navegue ata calquera carácter do número que aparece na liña. - - 3. Teclee ciw=60*60*24 . - - 4. Na seguinte liña, entre no modo Inserir e engada a data de hoxe con: - =system('date') - -NOTA: Tódalas chamadas a sistema son dependentes do sistema operativo. - Por exemplo, en Windows pode usar: - system('date /t') ou :r!date /t - ----> Esquecín o número exacto de segundos que ten un día; son 84600? ----> A data de hoxe é: - -NOTA: O mesmo pódese obter con :pu=system('date') - ou, premendo menos teclas, con :r!date . - -REFERENCIAS: Rexistro de experesión :h quote= - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.3: OS REXISTROS NUMERADOS - - - ** Prema yy e mais dd para ve-lo seu efecto nos rexistros. ** - - 1. Mova o cursor ata a liña sinalada con --->. - - 2. Copie a liña 0, e logo inspeccione os rexitros con :reg . - - 3. Borre a liña 0 con "cdd, e logo inspeccione os rexistros. - (Onde espera que estea o contido da liña 0?) - - 4. Continúe borrando cada liña sucesivamente, inspeccionando os rexistros - sobre a marcha. - -NOTA: Debería decatarse de que as liñas borradas máis antigas móvense cara a - embaixo na lista, consonte se engaden as novas liñas borradas. - - 5. Agora, poña (p) os seguintes rexistros en orde: c, 7, 4, 8, 2. - Por exemplo, usando "7p . - ----> 0. Esta - 9. cambalear - 8. mensaxe - 7. é - 6. en - 5. eixo - 4. unha - 3. guerra - 2. secreta. - 1. tributo - -NOTA: O borrado de liñas enteiras (dd) permanece máis tempo nos rexistros - numerados có copiado de liñas enteiras ou de texto máis pequeno. - -REFERENCIAS: Rexistros numerados :h quote00 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.4: A BELEZA DAS MARCAS - - - ** Evitando conta-las liñas de código ** - -NOTA: Un problema frecuente que acontece cando se programa é o desprazamento - entre pedazos de código. A seguinte técnica axuda a evita-lo cálculo - de números de liña asociados a operacions coma "a147d ou - :945,1091d a ou, incluso peor, usando primeiro - =1091-945 . - - 1. Mova o cursor ata a liña sinalada con --->. - - 2. Vaia á primeira liña da función e márquea con ma . - -NOTA: A posición exacta na liña NON é importante! - - 3. Navegue ata a fin da liña, e deseguido ata a fin do bloque de código - con $% . - - 4. Borre o bloque e póñao no rexistro 'a' con "ad'a . - -NEMÓNICO: - Dentro do rexistro(") - con nome de rexistro (a) - pon o borrado (d)eletion - dende o cursor ata a liña que contén a marca(') - de nome de marca (a) - - 5. Pegue o bloque entre BBB e CCC con "ap . - -NOTA: Practique esta operación múltiples veces, - ata chegar a facelo fluidamente: ma$%"ad'a - ----> AAA - function itGotRealBigRealFast() { - if ( somethingIsTrue ) { - doIt() - } - // the taxonomy of our function has changed and it - // no longer makes alphabetical sense in its current position - - // imagine hundreds of lines of code - - // naively you could navigate to the start and end and record or - // remember each line number - } - BBB - CCC - -NOTA: As marcas e mailos rexistros non comparten un espazo común de nomes, - de xeito que un rexistro 'a' é completamente independente dunha - marca 'a'. En troques, isto non acontece entre os rexistros - e mailas macros. - -REFERENCIAS: Marcas :h marks - Movemento de marcas :h mark-motions (diferencia entre ' e `) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1 RESUMO - - 1. Gardar texto (por medio de copiar ou borrar), e recuperalo (pegar) dende - un total de 26 rexistros (a-z). - 2. Pegar unha palbra enteira dende calquer sitio dentro dunha palara: yiw - 3. Cambiar unha palabra enteira dende calquer punto de palabra: ciw - 4. Inserir texto directamente dende os rexistros en modo Inserir: (C-r)a - 5. Inseri-lo resultado de operacións aritméticas simples no modo - Inserir: (C-r)=60*60 - 6. Inseri-los resultados de chamadas ao sistema no modo Inserir: - (C-r)=system('ls -1') - 7. Inspecciona-los rexistros con :reg . - 8. Aprende-lo destino final do borrado de liñas enteiras (dd) nos - rexistros numerados, é dicir, descendendo dende o reistro 1 ao 9. - Decatarse de que o borrado de liñas enteiras presérvase nos rexistros - numerados máis tempo que calquera outra operación. - 9. Aprende-lo destino final de tódalas copias feitas nos rexistros - numerados e cómo son de efímeros. - 10. Situar marcas dende o modo de comandos m[a-zA-Z0-9] . - 11. Moverse a una liña cunha marca con ' . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Isto conclúe o capítulo dows do Vim Tutor. Este é traballo en progreso. - Este capítulo foi escrito por Paul D. Parker. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Traducido do inglés ao galego por Fernando Vilariño. - Correo electrónico: fernando@cvc.uab.es. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.gl.utf-8 b/runtime/tutor/tutor2.gl.utf-8 deleted file mode 100644 index 8c90b8fd..00000000 --- a/runtime/tutor/tutor2.gl.utf-8 +++ /dev/null @@ -1,215 +0,0 @@ -=============================================================================== -= B e n v i d o a o t u t o r d o V I M - Versión 1.7 = -=============================================================================== -= C A P à T U L O D O U S = -=============================================================================== - - Hic Sunt Dracones: se este é o súa primeira exposición ao vim, e - prefire iniciarse no capítulo introducturio, pode saír premendo - :q . - - O tempo aproximado requerido para completar este capítulo é de - 8-10 minutos, dependendo de canto tempo use na experimentación. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.1: OS REXISTROS CON NOME - - - ** Almacene dúas palabras copiadas de xeito consecutivo, e logo pégueas. ** - - 1. Mova o cursor ata a liña inferior sinalada con --->. - - 2. Navegue ata calquera carácter da palabra 'Xoán' e escriba "ayiw . - -NEMÓNICO: - dentro do rexistro(") - chamado (a) - pega (y)ank - o interior (i)nner - da palabra (w)ord - - 3. Navegue cara a adiante ata a palabra 'galetas' - ( fl ou 4fe ou $b ou /gal ) e teclee "byiw . - - 4. Navegue ata calquera carácter da palabra 'Uxío' e teclee - ciw a - -NEMÓNICO: - cambia (c)hange - o interior (i)nner - da palabra (w)ord - co - chamado (a) - - 5. Navegue ata calquera punto da palabra 'tartas' e teclee - ciwb - ----> a) De eiquí en adiante, Xoán ficará encarregado das racións de galetas. - b) Xa que logo, Uxío somentes terá poderes no que respecta ás tartas. - -NOTA: O borrado tamén funciona nos rexistros, é dicir: - "sdiw borrará a palabra baixo o cursor e ficaráa no rexistro s. - -REFERENCIAS: Rexistros :h registers - Rexistros con come: :h quotea - Movemento :h motion.txt /inner - CTRL-R :h insert /CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.2: O REXISTRO DE EXPRESIÓN - - - ** Insira o resultado dos cáculos sobre a marcha. ** - - 1. Mova o cursor ata a liña sinalada con --->. - - 2. Navegue ata calquera carácter do número que aparece na liña. - - 3. Teclee ciw=60*60*24 . - - 4. Na seguinte liña, entre no modo Inserir e engada a data de hoxe con: - =system('date') - -NOTA: Tódalas chamadas a sistema son dependentes do sistema operativo. - Por exemplo, en Windows pode usar: - system('date /t') ou :r!date /t - ----> Esquecín o número exacto de segundos que ten un día; son 84600? ----> A data de hoxe é: - -NOTA: O mesmo pódese obter con :pu=system('date') - ou, premendo menos teclas, con :r!date . - -REFERENCIAS: Rexistro de experesión :h quote= - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.3: OS REXISTROS NUMERADOS - - - ** Prema yy e mais dd para ve-lo seu efecto nos rexistros. ** - - 1. Mova o cursor ata a liña sinalada con --->. - - 2. Copie a liña 0, e logo inspeccione os rexitros con :reg . - - 3. Borre a liña 0 con "cdd, e logo inspeccione os rexistros. - (Onde espera que estea o contido da liña 0?) - - 4. Continúe borrando cada liña sucesivamente, inspeccionando os rexistros - sobre a marcha. - -NOTA: Debería decatarse de que as liñas borradas máis antigas móvense cara a - embaixo na lista, consonte se engaden as novas liñas borradas. - - 5. Agora, poña (p) os seguintes rexistros en orde: c, 7, 4, 8, 2. - Por exemplo, usando "7p . - ----> 0. Esta - 9. cambalear - 8. mensaxe - 7. é - 6. en - 5. eixo - 4. unha - 3. guerra - 2. secreta. - 1. tributo - -NOTA: O borrado de liñas enteiras (dd) permanece máis tempo nos rexistros - numerados có copiado de liñas enteiras ou de texto máis pequeno. - -REFERENCIAS: Rexistros numerados :h quote00 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1.4: A BELEZA DAS MARCAS - - - ** Evitando conta-las liñas de código ** - -NOTA: Un problema frecuente que acontece cando se programa é o desprazamento - entre pedazos de código. A seguinte técnica axuda a evita-lo cálculo - de números de liña asociados a operacions coma "a147d ou - :945,1091d a ou, incluso peor, usando primeiro - =1091-945 . - - 1. Mova o cursor ata a liña sinalada con --->. - - 2. Vaia á primeira liña da función e márquea con ma . - -NOTA: A posición exacta na liña NON é importante! - - 3. Navegue ata a fin da liña, e deseguido ata a fin do bloque de código - con $% . - - 4. Borre o bloque e póñao no rexistro 'a' con "ad'a . - -NEMÓNICO: - Dentro do rexistro(") - con nome de rexistro (a) - pon o borrado (d)eletion - dende o cursor ata a liña que contén a marca(') - de nome de marca (a) - - 5. Pegue o bloque entre BBB e CCC con "ap . - -NOTA: Practique esta operación múltiples veces, - ata chegar a facelo fluidamente: ma$%"ad'a - ----> AAA - function itGotRealBigRealFast() { - if ( somethingIsTrue ) { - doIt() - } - // the taxonomy of our function has changed and it - // no longer makes alphabetical sense in its current position - - // imagine hundreds of lines of code - - // naively you could navigate to the start and end and record or - // remember each line number - } - BBB - CCC - -NOTA: As marcas e mailos rexistros non comparten un espazo común de nomes, - de xeito que un rexistro 'a' é completamente independente dunha - marca 'a'. En troques, isto non acontece entre os rexistros - e mailas macros. - -REFERENCIAS: Marcas :h marks - Movemento de marcas :h mark-motions (diferencia entre ' e `) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 2.1 RESUMO - - 1. Gardar texto (por medio de copiar ou borrar), e recuperalo (pegar) dende - un total de 26 rexistros (a-z). - 2. Pegar unha palbra enteira dende calquer sitio dentro dunha palara: yiw - 3. Cambiar unha palabra enteira dende calquer punto de palabra: ciw - 4. Inserir texto directamente dende os rexistros en modo Inserir: (C-r)a - 5. Inseri-lo resultado de operacións aritméticas simples no modo - Inserir: (C-r)=60*60 - 6. Inseri-los resultados de chamadas ao sistema no modo Inserir: - (C-r)=system('ls -1') - 7. Inspecciona-los rexistros con :reg . - 8. Aprende-lo destino final do borrado de liñas enteiras (dd) nos - rexistros numerados, é dicir, descendendo dende o reistro 1 ao 9. - Decatarse de que o borrado de liñas enteiras presérvase nos rexistros - numerados máis tempo que calquera outra operación. - 9. Aprende-lo destino final de tódalas copias feitas nos rexistros - numerados e cómo son de efímeros. - 10. Situar marcas dende o modo de comandos m[a-zA-Z0-9] . - 11. Moverse a una liña cunha marca con ' . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Isto conclúe o capítulo dows do Vim Tutor. Este é traballo en progreso. - Este capítulo foi escrito por Paul D. Parker. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Traducido do inglés ao galego por Fernando Vilariño. - Correo electrónico: fernando@cvc.uab.es. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/Make_ami.mak b/src/Make_ami.mak index 4dc86ddc..c7799142 100644 --- a/src/Make_ami.mak +++ b/src/Make_ami.mak @@ -169,7 +169,6 @@ SRC += \ textobject.c \ textprop.c \ time.c \ - tuple.c \ typval.c \ ui.c \ undo.c \ diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index c8d2707a..3f2a6dab 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -865,7 +865,6 @@ OBJ = \ $(OUTDIR)/textobject.o \ $(OUTDIR)/textprop.o \ $(OUTDIR)/time.o \ - $(OUTDIR)/tuple.o \ $(OUTDIR)/typval.o \ $(OUTDIR)/ui.o \ $(OUTDIR)/undo.o \ @@ -1215,14 +1214,14 @@ endif $(MAKE) -C xxd -f Make_ming.mak clean $(MAKE) -C tee -f Make_ming.mak clean -# Run Vim script to generate the Ex command lookup table. +# 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. +# 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. diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index d6dbd2b7..c24f0af8 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -533,7 +533,7 @@ CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DHAVE_STDINT_H \ $(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) \ $(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \ - $(CHANNEL_DEFS) $(DEFINES) $(CI_CFLAGS) \ + $(CHANNEL_DEFS) $(DEFINES) \ -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ /source-charset:utf-8 @@ -786,7 +786,6 @@ OBJ = \ $(OUTDIR)\textobject.obj \ $(OUTDIR)\textprop.obj \ $(OUTDIR)\time.obj \ - $(OUTDIR)\tuple.obj \ $(OUTDIR)\typval.obj \ $(OUTDIR)\ui.obj \ $(OUTDIR)\undo.obj \ @@ -1430,14 +1429,14 @@ clean: testclean $(MAKE) /NOLOGO -f Make_mvc.mak clean cd .. -# Run Vim script to generate the Ex command lookup table. +# 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. +# 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. @@ -1792,8 +1791,6 @@ $(OUTDIR)/textprop.obj: $(OUTDIR) textprop.c $(INCL) $(OUTDIR)/time.obj: $(OUTDIR) time.c $(INCL) -$(OUTDIR)/tuple.obj: $(OUTDIR) tuple.c $(INCL) - $(OUTDIR)/typval.obj: $(OUTDIR) typval.c $(INCL) $(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL) @@ -2008,7 +2005,6 @@ proto.h: \ proto/textobject.pro \ proto/textprop.pro \ proto/time.pro \ - proto/tuple.pro \ proto/typval.pro \ proto/ui.pro \ proto/undo.pro \ diff --git a/src/Make_vms.mms b/src/Make_vms.mms index a30ed653..20630236 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -433,7 +433,6 @@ SRC = \ textobject.c \ textprop.c \ time.c \ - tuple.c \ typval.c \ ui.c \ undo.c \ @@ -568,7 +567,6 @@ OBJ = \ textobject.obj \ textprop.obj \ time.obj \ - tuple.obj \ typval.obj \ ui.obj \ undo.obj \ @@ -1171,9 +1169,6 @@ textprop.obj : textprop.c vim.h [.auto]config.h feature.h os_unix.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 -tuple.obj : tuple.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 diff --git a/src/Makefile b/src/Makefile index 962e47b0..d6c76b10 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1584,7 +1584,6 @@ BASIC_SRC = \ textobject.c \ textprop.c \ time.c \ - tuple.c \ typval.c \ ui.c \ undo.c \ @@ -1745,7 +1744,6 @@ OBJ_COMMON = \ objects/textobject.o \ objects/textprop.o \ objects/time.o \ - objects/tuple.o \ objects/typval.o \ objects/ui.o \ objects/undo.o \ @@ -1939,7 +1937,6 @@ PRO_AUTO = \ textobject.pro \ textprop.pro \ time.pro \ - tuple.pro \ typval.pro \ ui.pro \ undo.pro \ @@ -2037,7 +2034,7 @@ autoconf: -rm -rf autom4te.cache -rm -f auto/config.status auto/config.cache -# Run Vim script to generate the Ex command lookup table. +# 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. @@ -2045,7 +2042,7 @@ autoconf: cmdidxs: ex_cmds.h vim --clean -X --not-a-term -S create_cmdidxs.vim -c quit -# Run Vim script to generate the normal/visual mode command lookup table. +# 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. @@ -3571,9 +3568,6 @@ objects/textprop.o: textprop.c objects/time.o: time.c $(CCC) -o $@ time.c -objects/tuple.o: tuple.c - $(CCC) -o $@ tuple.c - objects/typval.o: typval.c $(CCC) -o $@ typval.c @@ -4254,11 +4248,6 @@ objects/time.o: time.c vim.h protodef.h auto/config.h feature.h os_unix.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/tuple.o: tuple.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 \ diff --git a/src/README.md b/src/README.md index a01f695d..40429886 100644 --- a/src/README.md +++ b/src/README.md @@ -35,7 +35,7 @@ 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 +debugger.c | vim script debugger diff.c | diff mode (vimdiff) drawline.c | drawing a window line drawscreen.c | drawing the windows @@ -70,7 +70,7 @@ option.c | options optionstr.c | handling string options popupmenu.c | popup menu popupwin.c | popup window -profiler.c | Vim script profiler +profiler.c | vim script profiler quickfix.c | quickfix commands (":make", ":cn") regexp.c | pattern matching register.c | handling registers @@ -91,7 +91,7 @@ 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 +typval.c | vim script type/value functions undo.c | undo and redo usercmd.c | user defined commands userfunc.c | user defined functions diff --git a/src/auto/configure b/src/auto/configure index 88d8d095..8e9f6ee3 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72. +# Generated by GNU Autoconf 2.71. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # @@ -15,6 +15,7 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -23,13 +24,12 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else case e in #( - e) case `(set -o) 2>/dev/null` in #( +else $as_nop + case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; -esac ;; esac fi @@ -101,7 +101,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as 'sh COMMAND' +# We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -131,14 +131,15 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed 'exec'. +# out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -146,13 +147,12 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else case e in #( - e) case \`(set -o) 2>/dev/null\` in #( +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; -esac ;; esac fi " @@ -170,9 +170,8 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else case e in #( - e) exitcode=1; echo positional parameters were not saved. ;; -esac +else \$as_nop + exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -186,15 +185,14 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else case e in #( - e) as_have_required=no ;; -esac +else $as_nop + as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else case e in #( - e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -227,13 +225,12 @@ IFS=$as_save_IFS if $as_found then : -else case e in #( - e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi ;; -esac +fi fi @@ -255,7 +252,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed 'exec'. +# out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -274,8 +271,7 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi ;; -esac +fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -314,6 +310,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -382,12 +386,11 @@ then : { eval $1+=\$2 }' -else case e in #( - e) as_fn_append () +else $as_nop + as_fn_append () { eval $1=\$$1\$2 - } ;; -esac + } fi # as_fn_append # as_fn_arith ARG... @@ -401,14 +404,21 @@ then : { as_val=$(( $* )) }' -else case e in #( - e) as_fn_arith () +else $as_nop + as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } ;; -esac + } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -482,8 +492,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' - t clear - :clear s/[$]LINENO.*/&-/ t lineno b @@ -532,6 +540,7 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -543,9 +552,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. - # In both cases, we have to default to 'cp -pR'. + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -570,12 +579,10 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -as_tr_sh="eval sed '$as_sed_sh'" # deprecated +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: '$ac_useropt'" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1021,7 +1026,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: '$ac_useropt'" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1234,7 +1239,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: '$ac_useropt'" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1250,7 +1255,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: '$ac_useropt'" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1280,8 +1285,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: '$ac_option' -Try '$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1289,7 +1294,7 @@ Try '$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: '$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1339,7 +1344,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: '$host' +# There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1407,7 +1412,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1435,7 +1440,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures this package to adapt to many kinds of systems. +\`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1449,11 +1454,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print 'checking ...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for '--cache-file=config.cache' + -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or '..'] + --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1461,10 +1466,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, 'make install' will install all the files in -'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify -an installation prefix other than '$ac_default_prefix' using '--prefix', -for instance '--prefix=\$HOME'. +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. For better control, use the options below. @@ -1548,7 +1553,6 @@ Optional Features: --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()). - --enable-year2038 support timestamps after 2038 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1593,7 +1597,7 @@ Some influential environment variables: CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System -Use these variables to override the choices made by 'configure' or to help +Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1661,9 +1665,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.72 +generated by GNU Autoconf 2.71 -Copyright (C) 2023 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1702,12 +1706,11 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 ;; -esac + ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1741,12 +1744,11 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 ;; -esac + ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1784,12 +1786,11 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 ;; -esac + ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1831,13 +1832,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status ;; -esac + ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1857,8 +1857,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1866,12 +1866,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else case e in #( - e) eval "$3=no" ;; -esac +else $as_nop + eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1891,15 +1889,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (void); below. */ + which can conflict with char $2 (); below. */ #include #undef $2 @@ -1910,7 +1908,7 @@ else case e in #( #ifdef __cplusplus extern "C" #endif -char $2 (void); +char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1929,13 +1927,11 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else case e in #( - e) eval "$3=no" ;; -esac +else $as_nop + eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1989,19 +1985,18 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break -else case e in #( - e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else $as_nop + as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; -esac + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2036,23 +2031,20 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break -else case e in #( - e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else $as_nop + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; -esac + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else case e in #( - e) ac_lo= ac_hi= ;; -esac +else $as_nop + ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. @@ -2075,9 +2067,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid -else case e in #( - e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; -esac +else $as_nop + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done @@ -2125,9 +2116,8 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else case e in #( - e) eval "$3=no" +else $as_nop + eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2182,14 +2172,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else case e in #( - e) eval "$3=yes" ;; -esac +else $as_nop + eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2210,8 +2198,8 @@ printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else case e in #( - e) eval "$3=no" +else $as_nop + eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ @@ -2243,12 +2231,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else case e in #( - e) break ;; -esac +else $as_nop + break fi - done ;; -esac + done fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2281,7 +2267,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.72. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2527,10 +2513,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2566,7 +2552,9 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (char **p, int i) +static char *e (p, i) + char **p; + int i; { return p[i]; } @@ -2580,21 +2568,6 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } -/* C89 style stringification. */ -#define noexpand_stringify(a) #a -const char *stringified = noexpand_stringify(arbitrary+token=sequence); - -/* C89 style token pasting. Exercises some of the corner cases that - e.g. old MSVC gets wrong, but not very hard. */ -#define noexpand_concat(a,b) a##b -#define expand_concat(a,b) noexpand_concat(a,b) -extern int vA; -extern int vbee; -#define aye A -#define bee B -int *pvA = &expand_concat(v,aye); -int *pvbee = &noexpand_concat(v,bee); - /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2622,19 +2595,16 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -/* Does the compiler advertise C99 conformance? */ +// Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif -// See if C++-style comments work. - #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); -extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2684,6 +2654,7 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { + // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2749,8 +2720,6 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; - // Work around memory leak warnings. - free (ia); // Check named initializers. struct named_init ni = { @@ -2772,7 +2741,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -/* Does the compiler advertise C11 conformance? */ +// Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2898,12 +2867,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2912,18 +2881,18 @@ printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2939,11 +2908,11 @@ printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2970,8 +2939,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat >conftest.make <<\_ACEOF +else $as_nop + cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -2983,8 +2952,7 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make ;; -esac +rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3019,8 +2987,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then +else $as_nop + if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3042,8 +3010,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3065,8 +3032,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CC"; then +else $as_nop + if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3088,8 +3055,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3124,8 +3090,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then +else $as_nop + if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3147,8 +3113,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3170,8 +3135,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then +else $as_nop + if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3210,8 +3175,7 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi ;; -esac +fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3235,8 +3199,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then +else $as_nop + if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3258,8 +3222,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3285,8 +3248,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CC"; then +else $as_nop + if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3308,8 +3271,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3347,8 +3309,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then +else $as_nop + if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3370,8 +3332,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3393,8 +3354,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CC"; then +else $as_nop + if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3416,8 +3377,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3446,10 +3406,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3521,8 +3481,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. -# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -3542,7 +3502,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an '-o' + # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -3553,9 +3513,8 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else case e in #( - e) ac_file='' ;; -esac +else $as_nop + ac_file='' fi if test -z "$ac_file" then : @@ -3564,14 +3523,13 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See 'config.log' for more details" "$LINENO" 5; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } ;; -esac +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -3595,10 +3553,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) -# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will -# work properly (i.e., refer to 'conftest.exe'), while it won't with -# 'rm'. + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3608,12 +3566,11 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See 'config.log' for more details" "$LINENO" 5; } ;; -esac +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3629,8 +3586,6 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); - if (!f) - return 1; return ferror (f) || fclose (f) != 0; ; @@ -3670,27 +3625,26 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use '--host'. -See 'config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext \ - conftest.o conftest.obj conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3722,18 +3676,16 @@ then : break;; esac done -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See 'config.log' for more details" "$LINENO" 5; } ;; -esac +See \`config.log' for more details" "$LINENO" 5; } fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; -esac +rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -3744,8 +3696,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3762,14 +3714,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else case e in #( - e) ac_compiler_gnu=no ;; -esac +else $as_nop + ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -3787,8 +3737,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_save_c_werror_flag=$ac_c_werror_flag +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3806,8 +3756,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else case e in #( - e) CFLAGS="" +else $as_nop + CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3822,8 +3772,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else case e in #( - e) ac_c_werror_flag=$ac_save_c_werror_flag +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3840,15 +3790,12 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag ;; -esac + ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -3875,8 +3822,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cc_c11=no +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3893,28 +3840,25 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC ;; -esac +CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cc_c11" = x +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" ;; -esac + CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 ;; -esac + ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno @@ -3924,8 +3868,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cc_c99=no +else $as_nop + ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3942,28 +3886,25 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC ;; -esac +CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cc_c99" = x +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" ;; -esac + CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 ;; -esac + ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno @@ -3973,8 +3914,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cc_c89=no +else $as_nop + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3991,28 +3932,25 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC ;; -esac +CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cc_c89" = x +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" ;; -esac + CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 ;; -esac + ac_prog_cc_stdc=c89 fi fi @@ -4036,8 +3974,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else case e in #( - e) # Double quotes because $CC needs to be expanded +else $as_nop + # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -4055,10 +3993,9 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else case e in #( - e) # Broken: fails on valid input. -continue ;; -esac +else $as_nop + # Broken: fails on valid input. +continue fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -4072,16 +4009,15 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else case e in #( - e) # Passes both tests. +else $as_nop + # Passes both tests. ac_preproc_ok=: -break ;; -esac +break fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -4090,8 +4026,7 @@ fi done ac_cv_prog_CPP=$CPP - ;; -esac + fi CPP=$ac_cv_prog_CPP else @@ -4114,10 +4049,9 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else case e in #( - e) # Broken: fails on valid input. -continue ;; -esac +else $as_nop + # Broken: fails on valid input. +continue fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -4131,26 +4065,24 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else case e in #( - e) # Passes both tests. +else $as_nop + # Passes both tests. ac_preproc_ok=: -break ;; -esac +break fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See 'config.log' for more details" "$LINENO" 5; } ;; -esac +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4163,8 +4095,8 @@ printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -z "$GREP"; then +else $as_nop + if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4183,10 +4115,9 @@ do as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in #( +case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -4221,8 +4152,7 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } @@ -4234,8 +4164,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -4257,10 +4187,9 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in #( +case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -4296,22 +4225,19 @@ else ac_cv_path_EGREP=$EGREP fi - fi ;; -esac + fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" - EGREP_TRADITIONAL=$EGREP - ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 +else $as_nop + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then @@ -4333,10 +4259,9 @@ do as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in #( +case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -4372,8 +4297,7 @@ else ac_cv_path_FGREP=$FGREP fi - fi ;; -esac + fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } @@ -4388,8 +4312,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$AWK"; then +else $as_nop + if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4411,8 +4335,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -4434,8 +4357,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$STRIP"; then +else $as_nop + if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4458,8 +4381,7 @@ done IFS=$as_save_IFS test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" -fi ;; -esac +fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -4480,8 +4402,8 @@ printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test ${ac_cv_header_sys_wait_h+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4505,12 +4427,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_sys_wait_h=yes -else case e in #( - e) ac_cv_header_sys_wait_h=no ;; -esac +else $as_nop + ac_cv_header_sys_wait_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } @@ -4529,8 +4449,8 @@ printf %s "checking for unsigned long long int... " >&6; } if test ${ac_cv_type_unsigned_long_long_int+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_type_unsigned_long_long_int=yes +else $as_nop + ac_cv_type_unsigned_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -4569,14 +4489,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else case e in #( - e) ac_cv_type_unsigned_long_long_int=no ;; -esac +else $as_nop + ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext;; - esac ;; -esac + esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } @@ -4593,8 +4511,8 @@ printf %s "checking for long long int... " >&6; } if test ${ac_cv_type_long_long_int+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_type_long_long_int=yes +else $as_nop + ac_cv_type_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -4603,12 +4521,12 @@ else case e in #( if test "$cross_compiling" = yes then : : -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX - # define HALF \\ + # define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif @@ -4633,18 +4551,15 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else case e in #( - e) ac_cv_type_long_long_int=no ;; -esac +else $as_nop + ac_cv_type_long_long_int=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi;; - esac ;; -esac + esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 printf "%s\n" "$ac_cv_type_long_long_int" >&6; } @@ -4655,10 +4570,10 @@ printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi if test "$ac_cv_type_long_long_int" = no; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Compiler does not support long long int -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler supports trailing commas" >&5 @@ -4682,17 +4597,16 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; trailing_commas=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$trailing_commas" = no; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Compiler does not support trailing comma in enum -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler supports C++ comments" >&5 @@ -4713,17 +4627,16 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; slash_comments=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$slash_comments" = no; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Compiler does not support C++ comments -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi @@ -4743,9 +4656,8 @@ printf %s "checking --enable-fail-if-missing argument... " >&6; } if test ${enable_fail_if_missing+y} then : enableval=$enable_fail_if_missing; fail_if_missing="yes" -else case e in #( - e) fail_if_missing="no" ;; -esac +else $as_nop + fail_if_missing="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fail_if_missing" >&5 @@ -4885,9 +4797,8 @@ printf %s "checking --disable-darwin argument... " >&6; } if test ${enable_darwin+y} then : enableval=$enable_darwin; -else case e in #( - e) enable_darwin="yes" ;; -esac +else $as_nop + enable_darwin="yes" fi if test "$enable_darwin" = "yes"; then @@ -4916,10 +4827,9 @@ if test ${with_mac_arch+y} then : withval=$with_mac_arch; MACARCH="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACARCH" >&5 printf "%s\n" "$MACARCH" >&6; } -else case e in #( - e) MACARCH="current"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to $MACARCH" >&5 -printf "%s\n" "defaulting to $MACARCH" >&6; } ;; -esac +else $as_nop + MACARCH="current"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to $MACARCH" >&5 +printf "%s\n" "defaulting to $MACARCH" >&6; } fi @@ -4931,10 +4841,9 @@ if test ${with_developer_dir+y} then : withval=$with_developer_dir; DEVELOPER_DIR="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEVELOPER_DIR" >&5 printf "%s\n" "$DEVELOPER_DIR" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not present" >&5 -printf "%s\n" "not present" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not present" >&5 +printf "%s\n" "not present" >&6; } fi @@ -4946,8 +4855,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XCODE_SELECT+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $XCODE_SELECT in +else $as_nop + case $XCODE_SELECT in [\\/]* | ?:[\\/]*) ac_cv_path_XCODE_SELECT="$XCODE_SELECT" # Let the user override the test with a path. ;; @@ -4972,7 +4881,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi XCODE_SELECT=$ac_cv_path_XCODE_SELECT @@ -5018,8 +4926,8 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } CFLAGS="$save_cflags" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Intel architecture is supported" >&5 @@ -5041,17 +4949,15 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; MACARCH="intel" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } MACARCH="ppc" CPPFLAGS="$save_cppflags -arch ppc" - LDFLAGS="$save_ldflags -arch ppc" ;; -esac + LDFLAGS="$save_ldflags -arch ppc" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -5151,13 +5057,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $local_dir" >&5 printf "%s\n" "$local_dir" >&6; } -else case e in #( - e) +else $as_nop + local_dir=/usr/local { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to $local_dir" >&5 printf "%s\n" "Defaulting to $local_dir" >&6; } - ;; -esac + fi if test "$GCC" = yes -a "$local_dir" != no; then @@ -5188,10 +5093,9 @@ if test ${with_vim_name+y} then : withval=$with_vim_name; VIMNAME="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIMNAME" >&5 printf "%s\n" "$VIMNAME" >&6; } -else case e in #( - e) VIMNAME="vim"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to $VIMNAME" >&5 -printf "%s\n" "Defaulting to $VIMNAME" >&6; } ;; -esac +else $as_nop + VIMNAME="vim"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to $VIMNAME" >&5 +printf "%s\n" "Defaulting to $VIMNAME" >&6; } fi @@ -5203,10 +5107,9 @@ if test ${with_ex_name+y} then : withval=$with_ex_name; EXNAME="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EXNAME" >&5 printf "%s\n" "$EXNAME" >&6; } -else case e in #( - e) EXNAME="ex"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to ex" >&5 -printf "%s\n" "Defaulting to ex" >&6; } ;; -esac +else $as_nop + EXNAME="ex"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to ex" >&5 +printf "%s\n" "Defaulting to ex" >&6; } fi @@ -5218,10 +5121,9 @@ if test ${with_view_name+y} then : withval=$with_view_name; VIEWNAME="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIEWNAME" >&5 printf "%s\n" "$VIEWNAME" >&6; } -else case e in #( - e) VIEWNAME="view"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to view" >&5 -printf "%s\n" "Defaulting to view" >&6; } ;; -esac +else $as_nop + VIEWNAME="view"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to view" >&5 +printf "%s\n" "Defaulting to view" >&6; } fi @@ -5234,10 +5136,9 @@ if test ${with_global_runtime+y} then : withval=$with_global_runtime; RUNTIME_GLOBAL="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5258,10 +5159,9 @@ then : withval=$with_modified_by; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; }; printf "%s\n" "#define MODIFIED_BY \"$withval\"" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5288,10 +5188,9 @@ if ac_fn_c_try_compile "$LINENO" then : # TryCompile action if true cf_cv_ebcdic=yes -else case e in #( - e) # TryCompile action if false -cf_cv_ebcdic=no ;; -esac +else $as_nop + # TryCompile action if false +cf_cv_ebcdic=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # end of TryCompile ]) @@ -5363,9 +5262,8 @@ printf %s "checking --disable-smack argument... " >&6; } if test ${enable_smack+y} then : enableval=$enable_smack; -else case e in #( - e) enable_smack="yes" ;; -esac +else $as_nop + enable_smack="yes" fi if test "$enable_smack" = "yes"; then @@ -5375,9 +5273,8 @@ printf "%s\n" "no" >&6; } if test "x$ac_cv_header_linux_xattr_h" = xyes then : true -else case e in #( - e) enable_smack="no" ;; -esac +else $as_nop + enable_smack="no" fi else @@ -5389,9 +5286,8 @@ if test "$enable_smack" = "yes"; then if test "x$ac_cv_header_sys_xattr_h" = xyes then : true -else case e in #( - e) enable_smack="no" ;; -esac +else $as_nop + enable_smack="no" fi fi @@ -5399,153 +5295,18 @@ if test "$enable_smack" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XATTR_NAME_SMACKEXEC in linux/xattr.h" >&5 printf %s "checking for XATTR_NAME_SMACKEXEC in linux/xattr.h... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 -printf %s "checking for egrep -e... " >&6; } -if test ${ac_cv_path_EGREP_TRADITIONAL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -z "$EGREP_TRADITIONAL"; then - ac_path_EGREP_TRADITIONAL_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue -# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. - # Check for GNU $ac_path_EGREP_TRADITIONAL -case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( -*GNU*) - ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; -#( -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" - "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" - ac_path_EGREP_TRADITIONAL_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_TRADITIONAL_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then - : - fi -else - ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL -fi - - if test "$ac_cv_path_EGREP_TRADITIONAL" -then : - ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" -else case e in #( - e) if test -z "$EGREP_TRADITIONAL"; then - ac_path_EGREP_TRADITIONAL_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue -# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. - # Check for GNU $ac_path_EGREP_TRADITIONAL -case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( -*GNU*) - ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; -#( -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" - "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" - ac_path_EGREP_TRADITIONAL_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_TRADITIONAL_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL -fi - ;; -esac -fi ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 -printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } - EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL - cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP_TRADITIONAL "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1 + $EGREP "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; enable_smack="no" ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; enable_smack="no" fi rm -rf conftest* @@ -5556,22 +5317,16 @@ printf %s "checking for setxattr in -lattr... " >&6; } if test ${ac_cv_lib_attr_setxattr+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char setxattr (void); + builtin and then its argument prototype would still apply. */ +char setxattr (); int main (void) { @@ -5583,14 +5338,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_attr_setxattr=yes -else case e in #( - e) ac_cv_lib_attr_setxattr=no ;; -esac +else $as_nop + ac_cv_lib_attr_setxattr=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_setxattr" >&5 printf "%s\n" "$ac_cv_lib_attr_setxattr" >&6; } @@ -5611,9 +5364,8 @@ printf %s "checking --disable-selinux argument... " >&6; } if test ${enable_selinux+y} then : enableval=$enable_selinux; -else case e in #( - e) enable_selinux="yes" ;; -esac +else $as_nop + enable_selinux="yes" fi if test "$enable_selinux" = "yes"; then @@ -5624,22 +5376,16 @@ printf %s "checking for is_selinux_enabled in -lselinux... " >&6; } if test ${ac_cv_lib_selinux_is_selinux_enabled+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lselinux $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char is_selinux_enabled (void); + builtin and then its argument prototype would still apply. */ +char is_selinux_enabled (); int main (void) { @@ -5651,14 +5397,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_selinux_is_selinux_enabled=yes -else case e in #( - e) ac_cv_lib_selinux_is_selinux_enabled=no ;; -esac +else $as_nop + ac_cv_lib_selinux_is_selinux_enabled=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 printf "%s\n" "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } @@ -5686,9 +5430,8 @@ printf %s "checking --enable-xattr argument... " >&6; } if test ${enable_xattr+y} then : enableval=$enable_xattr; -else case e in #( - e) enable_xattr="yes" ;; -esac +else $as_nop + enable_xattr="yes" fi if test "$enable_xattr" = "yes"; then @@ -5715,10 +5458,9 @@ if test ${with_features+y} then : withval=$with_features; features="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $features" >&5 printf "%s\n" "$features" >&6; } -else case e in #( - e) features="huge"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to huge" >&5 -printf "%s\n" "Defaulting to huge" >&6; } ;; -esac +else $as_nop + features="huge"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to huge" >&5 +printf "%s\n" "Defaulting to huge" >&6; } fi @@ -5759,10 +5501,9 @@ if test ${with_compiledby+y} then : withval=$with_compiledby; compiledby="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; } -else case e in #( - e) compiledby=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + compiledby=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5773,9 +5514,8 @@ printf %s "checking --disable-xsmp argument... " >&6; } if test ${enable_xsmp+y} then : enableval=$enable_xsmp; -else case e in #( - e) enable_xsmp="yes" ;; -esac +else $as_nop + enable_xsmp="yes" fi @@ -5788,9 +5528,8 @@ printf %s "checking --disable-xsmp-interact argument... " >&6; } if test ${enable_xsmp_interact+y} then : enableval=$enable_xsmp_interact; -else case e in #( - e) enable_xsmp_interact="yes" ;; -esac +else $as_nop + enable_xsmp_interact="yes" fi if test "$enable_xsmp_interact" = "yes"; then @@ -5827,9 +5566,8 @@ printf %s "checking --enable-luainterp argument... " >&6; } if test ${enable_luainterp+y} then : enableval=$enable_luainterp; -else case e in #( - e) enable_luainterp="no" ;; -esac +else $as_nop + enable_luainterp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_luainterp" >&5 @@ -5850,10 +5588,9 @@ if test ${with_lua_prefix+y} then : withval=$with_lua_prefix; with_lua_prefix="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_lua_prefix" >&5 printf "%s\n" "$with_lua_prefix" >&6; } -else case e in #( - e) with_lua_prefix="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + with_lua_prefix="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5880,9 +5617,8 @@ printf %s "checking --with-luajit... " >&6; } if test ${with_luajit+y} then : withval=$with_luajit; vi_cv_with_luajit="$withval" -else case e in #( - e) vi_cv_with_luajit="no" ;; -esac +else $as_nop + vi_cv_with_luajit="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_with_luajit" >&5 @@ -5898,8 +5634,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_luajit+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_luajit in +else $as_nop + case $vi_cv_path_luajit in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_luajit="$vi_cv_path_luajit" # Let the user override the test with a path. ;; @@ -5924,7 +5660,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_luajit=$ac_cv_path_vi_cv_path_luajit @@ -5943,9 +5678,8 @@ printf %s "checking LuaJIT version... " >&6; } if test ${vi_cv_version_luajit+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-*[a-z0-9]*\)* .*/\1/'` ;; -esac +else $as_nop + vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-*[a-z0-9]*\)* .*/\1/'` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_luajit" >&5 printf "%s\n" "$vi_cv_version_luajit" >&6; } @@ -5954,9 +5688,8 @@ printf %s "checking Lua version of LuaJIT... " >&6; } if test ${vi_cv_version_lua_luajit+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ;; -esac +else $as_nop + vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_lua_luajit" >&5 printf "%s\n" "$vi_cv_version_lua_luajit" >&6; } @@ -5971,8 +5704,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_plain_lua+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_plain_lua in +else $as_nop + case $vi_cv_path_plain_lua in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_plain_lua="$vi_cv_path_plain_lua" # Let the user override the test with a path. ;; @@ -5997,7 +5730,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_plain_lua=$ac_cv_path_vi_cv_path_plain_lua @@ -6016,9 +5748,8 @@ printf %s "checking Lua version... " >&6; } if test ${vi_cv_version_plain_lua+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ;; -esac +else $as_nop + vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_plain_lua" >&5 printf "%s\n" "$vi_cv_version_plain_lua" >&6; } @@ -6128,10 +5859,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; lua_ok="yes" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; lua_ok="no"; LUA_LIBS="" ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; lua_ok="no"; LUA_LIBS="" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6221,9 +5951,8 @@ printf %s "checking --enable-mzschemeinterp argument... " >&6; } if test ${enable_mzschemeinterp+y} then : enableval=$enable_mzschemeinterp; -else case e in #( - e) enable_mzschemeinterp="no" ;; -esac +else $as_nop + enable_mzschemeinterp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_mzschemeinterp" >&5 @@ -6240,10 +5969,9 @@ if test ${with_plthome+y} then : withval=$with_plthome; with_plthome="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_plthome" >&5 printf "%s\n" "$with_plthome" >&6; } -else case e in #( - e) with_plthome="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5 -printf "%s\n" "\"no\"" >&6; } ;; -esac +else $as_nop + with_plthome="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5 +printf "%s\n" "\"no\"" >&6; } fi @@ -6268,8 +5996,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_mzscheme+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_mzscheme in +else $as_nop + case $vi_cv_path_mzscheme in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_mzscheme="$vi_cv_path_mzscheme" # Let the user override the test with a path. ;; @@ -6294,7 +6022,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_mzscheme=$ac_cv_path_vi_cv_path_mzscheme @@ -6321,14 +6048,13 @@ printf %s "checking MzScheme install prefix... " >&6; } if test ${vi_cv_path_mzscheme_pfx+y} then : printf %s "(cached) " >&6 -else case e in #( - e) echo "(display (simplify-path \ +else $as_nop + echo "(display (simplify-path \ (build-path (call-with-values \ (lambda () (split-path (find-system-path (quote exec-file)))) \ (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ - sed -e 's+/$++'` ;; -esac + sed -e 's+/$++'` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_mzscheme_pfx" >&5 printf "%s\n" "$vi_cv_path_mzscheme_pfx" >&6; } @@ -6545,22 +6271,16 @@ printf %s "checking for ffi_type_void in -lffi... " >&6; } if test ${ac_cv_lib_ffi_ffi_type_void+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lffi $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char ffi_type_void (void); + builtin and then its argument prototype would still apply. */ +char ffi_type_void (); int main (void) { @@ -6572,14 +6292,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ffi_ffi_type_void=yes -else case e in #( - e) ac_cv_lib_ffi_ffi_type_void=no ;; -esac +else $as_nop + ac_cv_lib_ffi_ffi_type_void=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_type_void" >&5 printf "%s\n" "$ac_cv_lib_ffi_ffi_type_void" >&6; } @@ -6613,10 +6331,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; mzs_ok=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5 -printf "%s\n" "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5 +printf "%s\n" "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6651,9 +6368,8 @@ printf %s "checking --enable-perlinterp argument... " >&6; } if test ${enable_perlinterp+y} then : enableval=$enable_perlinterp; -else case e in #( - e) enable_perlinterp="no" ;; -esac +else $as_nop + enable_perlinterp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_perlinterp" >&5 @@ -6670,8 +6386,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_perl+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_perl in +else $as_nop + case $vi_cv_path_perl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_perl="$vi_cv_path_perl" # Let the user override the test with a path. ;; @@ -6696,7 +6412,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_perl=$ac_cv_path_vi_cv_path_perl @@ -6819,10 +6534,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; perl_ok=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PERL DISABLED" >&5 -printf "%s\n" "no: PERL DISABLED" >&6; }; perl_ok=no ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PERL DISABLED" >&5 +printf "%s\n" "no: PERL DISABLED" >&6; }; perl_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6900,9 +6614,8 @@ printf %s "checking --enable-pythoninterp argument... " >&6; } if test ${enable_pythoninterp+y} then : enableval=$enable_pythoninterp; -else case e in #( - e) enable_pythoninterp="no" ;; -esac +else $as_nop + enable_pythoninterp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_pythoninterp" >&5 @@ -6921,10 +6634,9 @@ if test ${with_python_command+y} then : withval=$with_python_command; vi_cv_path_python="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python" >&5 printf "%s\n" "$vi_cv_path_python" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6938,8 +6650,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_python+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_python in +else $as_nop + case $vi_cv_path_python in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_python="$vi_cv_path_python" # Let the user override the test with a path. ;; @@ -6964,7 +6676,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_python=$ac_cv_path_vi_cv_path_python @@ -6988,11 +6699,10 @@ printf %s "checking Python version... " >&6; } if test ${vi_cv_var_python_version+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_var_python_version=` +else $as_nop + vi_cv_var_python_version=` ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5 printf "%s\n" "$vi_cv_var_python_version" >&6; } @@ -7010,11 +6720,10 @@ printf %s "checking Python's install prefix... " >&6; } if test ${vi_cv_path_python_pfx+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python_pfx=` +else $as_nop + vi_cv_path_python_pfx=` ${vi_cv_path_python} -c \ - "import sys; print sys.prefix"` ;; -esac + "import sys; print sys.prefix"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_pfx" >&5 printf "%s\n" "$vi_cv_path_python_pfx" >&6; } @@ -7024,11 +6733,10 @@ printf %s "checking Python's execution prefix... " >&6; } if test ${vi_cv_path_python_epfx+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python_epfx=` +else $as_nop + vi_cv_path_python_epfx=` ${vi_cv_path_python} -c \ - "import sys; print sys.exec_prefix"` ;; -esac + "import sys; print sys.exec_prefix"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_epfx" >&5 printf "%s\n" "$vi_cv_path_python_epfx" >&6; } @@ -7037,12 +6745,11 @@ printf "%s\n" "$vi_cv_path_python_epfx" >&6; } if test ${vi_cv_path_pythonpath+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_pythonpath=` +else $as_nop + vi_cv_path_pythonpath=` unset PYTHONPATH; ${vi_cv_path_python} -c \ - "import sys, string; print string.join(sys.path,':')"` ;; -esac + "import sys, string; print string.join(sys.path,':')"` fi @@ -7060,8 +6767,8 @@ printf %s "checking Python's configuration directory... " >&6; } if test ${vi_cv_path_python_conf+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + vi_cv_path_python_conf= d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` if test -d "$d" && test -f "$d/config.c"; then @@ -7076,8 +6783,7 @@ else case e in #( done done fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_conf" >&5 printf "%s\n" "$vi_cv_path_python_conf" >&6; } @@ -7092,8 +6798,8 @@ printf "%s\n" "can't find it!" >&6; } if test ${vi_cv_path_python_plibs+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" @@ -7132,8 +6838,7 @@ eof vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Python's dll name" >&5 @@ -7141,15 +6846,14 @@ printf %s "checking Python's dll name... " >&6; } if test ${vi_cv_dll_name_python+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "X$python_DLLLIBRARY" != "X"; then vi_cv_dll_name_python="$python_DLLLIBRARY" else vi_cv_dll_name_python="$python_INSTSONAME" fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_dll_name_python" >&5 printf "%s\n" "$vi_cv_dll_name_python" >&6; } @@ -7201,11 +6905,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; LIBS=$libs_save_old - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7236,10 +6939,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; python_ok=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON DISABLED" >&5 -printf "%s\n" "no: PYTHON DISABLED" >&6; }; python_ok=no ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON DISABLED" >&5 +printf "%s\n" "no: PYTHON DISABLED" >&6; }; python_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7280,9 +6982,8 @@ printf %s "checking --enable-python3interp argument... " >&6; } if test ${enable_python3interp+y} then : enableval=$enable_python3interp; -else case e in #( - e) enable_python3interp="no" ;; -esac +else $as_nop + enable_python3interp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_python3interp" >&5 @@ -7301,10 +7002,9 @@ if test ${with_python3_command+y} then : withval=$with_python3_command; vi_cv_path_python3="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3" >&5 printf "%s\n" "$vi_cv_path_python3" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7318,8 +7018,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_python3+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_python3 in +else $as_nop + case $vi_cv_path_python3 in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_python3="$vi_cv_path_python3" # Let the user override the test with a path. ;; @@ -7344,7 +7044,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_python3=$ac_cv_path_vi_cv_path_python3 @@ -7368,11 +7067,10 @@ printf %s "checking Python version... " >&6; } if test ${vi_cv_var_python3_version+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_var_python3_version=` +else $as_nop + vi_cv_var_python3_version=` ${vi_cv_path_python3} -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'` - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 printf "%s\n" "$vi_cv_var_python3_version" >&6; } @@ -7401,22 +7099,20 @@ then : fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_stable_abi" >&5 printf "%s\n" "$vi_cv_var_python3_stable_abi" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "X$vi_cv_var_python3_stable_abi" != "X"; then if test ${vi_cv_var_python3_stable_abi_hex+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + vi_cv_var_python3_stable_abi_hex=` ${vi_cv_path_python3} -c \ - "major_minor='${vi_cv_var_python3_stable_abi}'.split('.'); print('0x{0:X}'.format( (int(major_minor.__getitem__(0))<<24) + (int(major_minor.__getitem__(1))<<16) ))"` ;; -esac + "major_minor='${vi_cv_var_python3_stable_abi}'.split('.'); print('0x{0:X}'.format( (int(major_minor.__getitem__(0))<<24) + (int(major_minor.__getitem__(1))<<16) ))"` fi if test "X$vi_cv_var_python3_stable_abi_hex" = "X"; then @@ -7429,16 +7125,15 @@ printf %s "checking Python's abiflags... " >&6; } if test ${vi_cv_var_python3_abiflags+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + vi_cv_var_python3_abiflags= 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 \ "import sys; print(sys.abiflags)"` - fi ;; -esac + fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5 printf "%s\n" "$vi_cv_var_python3_abiflags" >&6; } @@ -7448,11 +7143,10 @@ printf %s "checking Python's install prefix... " >&6; } if test ${vi_cv_path_python3_pfx+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python3_pfx=` +else $as_nop + vi_cv_path_python3_pfx=` ${vi_cv_path_python3} -c \ - "import sys; print(sys.prefix)"` ;; -esac + "import sys; print(sys.prefix)"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_pfx" >&5 printf "%s\n" "$vi_cv_path_python3_pfx" >&6; } @@ -7462,11 +7156,10 @@ printf %s "checking Python's execution prefix... " >&6; } if test ${vi_cv_path_python3_epfx+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python3_epfx=` +else $as_nop + vi_cv_path_python3_epfx=` ${vi_cv_path_python3} -c \ - "import sys; print(sys.exec_prefix)"` ;; -esac + "import sys; print(sys.exec_prefix)"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5 printf "%s\n" "$vi_cv_path_python3_epfx" >&6; } @@ -7476,11 +7169,10 @@ printf %s "checking Python's include path... " >&6; } if test ${vi_cv_path_python3_include+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python3_include=` +else $as_nop + vi_cv_path_python3_include=` ${vi_cv_path_python3} -c \ - "import sysconfig; print(sysconfig.get_path(\"include\"))"` ;; -esac + "import sysconfig; print(sysconfig.get_path(\"include\"))"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_include" >&5 printf "%s\n" "$vi_cv_path_python3_include" >&6; } @@ -7490,11 +7182,10 @@ printf %s "checking Python's include path... " >&6; } if test ${vi_cv_path_python3_platinclude+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python3_platinclude=` +else $as_nop + vi_cv_path_python3_platinclude=` ${vi_cv_path_python3} -c \ - "import sysconfig; print(sysconfig.get_path(\"platinclude\"))"` ;; -esac + "import sysconfig; print(sysconfig.get_path(\"platinclude\"))"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_platinclude" >&5 printf "%s\n" "$vi_cv_path_python3_platinclude" >&6; } @@ -7503,12 +7194,11 @@ printf "%s\n" "$vi_cv_path_python3_platinclude" >&6; } if test ${vi_cv_path_python3path+y} then : printf %s "(cached) " >&6 -else case e in #( - e) vi_cv_path_python3path=` +else $as_nop + vi_cv_path_python3path=` unset PYTHONPATH; ${vi_cv_path_python3} -c \ - "import sys, string; print(':'.join(sys.path))"` ;; -esac + "import sys, string; print(':'.join(sys.path))"` fi @@ -7526,8 +7216,8 @@ printf %s "checking Python's configuration directory... " >&6; } if test ${vi_cv_path_python3_conf+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + 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 sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null` @@ -7546,8 +7236,7 @@ else case e in #( done done fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 printf "%s\n" "$vi_cv_path_python3_conf" >&6; } @@ -7562,8 +7251,8 @@ printf "%s\n" "can't find it!" >&6; } if test ${vi_cv_path_python3_plibs+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" @@ -7581,8 +7270,7 @@ eof vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Python3's dll name" >&5 @@ -7590,8 +7278,8 @@ printf %s "checking Python3's dll name... " >&6; } if test ${vi_cv_dll_name_python3+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "X$python3_DLLLIBRARY" != "X"; then vi_cv_dll_name_python3="$python3_DLLLIBRARY" elif test "X$python3_PYTHONFRAMEWORKPREFIX" != "X"; then @@ -7599,8 +7287,7 @@ else case e in #( else vi_cv_dll_name_python3="$python3_INSTSONAME" fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_dll_name_python3" >&5 printf "%s\n" "$vi_cv_dll_name_python3" >&6; } @@ -7654,11 +7341,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; LIBS=$libs_save_old - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7689,10 +7375,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; python3_ok=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON3 DISABLED" >&5 -printf "%s\n" "no: PYTHON3 DISABLED" >&6; }; python3_ok=no ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON3 DISABLED" >&5 +printf "%s\n" "no: PYTHON3 DISABLED" >&6; }; python3_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7742,12 +7427,12 @@ printf %s "checking whether we can do without RTLD_GLOBAL for Python... " >&6; } LIBS="-ldl $LIBS" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See 'config.log' for more details" "$LINENO" 5; } -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7789,14 +7474,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; };printf "%s\n" "#define PY_NO_RTLD_GLOBAL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -7811,12 +7494,12 @@ printf %s "checking whether we can do without RTLD_GLOBAL for Python3... " >&6; LIBS="-ldl $LIBS" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See 'config.log' for more details" "$LINENO" 5; } -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7859,14 +7542,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; };printf "%s\n" "#define PY3_NO_RTLD_GLOBAL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -7910,10 +7591,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; fpie_ok=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; fpie_ok=no ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; fpie_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7955,10 +7635,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; fpie_ok=yes -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; fpie_ok=no ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; fpie_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7975,9 +7654,8 @@ printf %s "checking --enable-tclinterp argument... " >&6; } if test ${enable_tclinterp+y} then : enableval=$enable_tclinterp; -else case e in #( - e) enable_tclinterp="no" ;; -esac +else $as_nop + enable_tclinterp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_tclinterp" >&5 @@ -7993,10 +7671,9 @@ if test ${with_tclsh+y} then : withval=$with_tclsh; tclsh_name="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tclsh_name" >&5 printf "%s\n" "$tclsh_name" >&6; } -else case e in #( - e) tclsh_name="tclsh8.5"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + tclsh_name="tclsh8.5"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "$tclsh_name", so it can be a program name with args. @@ -8006,8 +7683,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_tcl in +else $as_nop + case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8032,7 +7709,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8056,8 +7732,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_tcl in +else $as_nop + case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8082,7 +7758,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8105,8 +7780,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_tcl in +else $as_nop + case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8131,7 +7806,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8154,8 +7828,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_tcl in +else $as_nop + case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8180,7 +7854,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8203,8 +7876,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_tcl in +else $as_nop + case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8229,7 +7902,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8366,9 +8038,8 @@ printf %s "checking --enable-rubyinterp argument... " >&6; } if test ${enable_rubyinterp+y} then : enableval=$enable_rubyinterp; -else case e in #( - e) enable_rubyinterp="no" ;; -esac +else $as_nop + enable_rubyinterp="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5 @@ -8387,10 +8058,9 @@ if test ${with_ruby_command+y} then : withval=$with_ruby_command; RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RUBY_CMD" >&5 printf "%s\n" "$RUBY_CMD" >&6; } -else case e in #( - e) RUBY_CMD="ruby"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to $RUBY_CMD" >&5 -printf "%s\n" "defaulting to $RUBY_CMD" >&6; } ;; -esac +else $as_nop + RUBY_CMD="ruby"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to $RUBY_CMD" >&5 +printf "%s\n" "defaulting to $RUBY_CMD" >&6; } fi # Extract the first word of "$RUBY_CMD", so it can be a program name with args. @@ -8400,8 +8070,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_ruby+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $vi_cv_path_ruby in +else $as_nop + case $vi_cv_path_ruby in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_ruby="$vi_cv_path_ruby" # Let the user override the test with a path. ;; @@ -8426,7 +8096,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi vi_cv_path_ruby=$ac_cv_path_vi_cv_path_ruby @@ -8533,9 +8202,8 @@ printf %s "checking --enable-cscope argument... " >&6; } if test ${enable_cscope+y} then : enableval=$enable_cscope; -else case e in #( - e) enable_cscope="no" ;; -esac +else $as_nop + enable_cscope="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_cscope" >&5 @@ -8551,9 +8219,8 @@ printf %s "checking --disable-netbeans argument... " >&6; } if test ${enable_netbeans+y} then : enableval=$enable_netbeans; -else case e in #( - e) enable_netbeans="yes" ;; -esac +else $as_nop + enable_netbeans="yes" fi if test "$enable_netbeans" = "yes"; then @@ -8576,9 +8243,8 @@ printf %s "checking --disable-channel argument... " >&6; } if test ${enable_channel+y} then : enableval=$enable_channel; -else case e in #( - e) enable_channel="yes" ;; -esac +else $as_nop + enable_channel="yes" fi if test "$enable_channel" = "yes"; then @@ -8608,22 +8274,16 @@ printf %s "checking for socket in -lnetwork... " >&6; } if test ${ac_cv_lib_network_socket+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char socket (void); + builtin and then its argument prototype would still apply. */ +char socket (); int main (void) { @@ -8635,14 +8295,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_network_socket=yes -else case e in #( - e) ac_cv_lib_network_socket=no ;; -esac +else $as_nop + ac_cv_lib_network_socket=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_socket" >&5 printf "%s\n" "$ac_cv_lib_network_socket" >&6; } @@ -8660,22 +8318,16 @@ printf %s "checking for socket in -lsocket... " >&6; } if test ${ac_cv_lib_socket_socket+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char socket (void); + builtin and then its argument prototype would still apply. */ +char socket (); int main (void) { @@ -8687,14 +8339,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_socket=yes -else case e in #( - e) ac_cv_lib_socket_socket=no ;; -esac +else $as_nop + ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } @@ -8713,8 +8363,8 @@ printf %s "checking whether compiling with IPv6 networking is possible... " >&6; if test ${vim_cv_ipv6_networking+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8753,13 +8403,11 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vim_cv_ipv6_networking="yes" -else case e in #( - e) vim_cv_ipv6_networking="no" ;; -esac +else $as_nop + vim_cv_ipv6_networking="no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv6_networking" >&5 printf "%s\n" "$vim_cv_ipv6_networking" >&6; } @@ -8780,22 +8428,16 @@ printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (void); + builtin and then its argument prototype would still apply. */ +char gethostbyname (); int main (void) { @@ -8807,14 +8449,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes -else case e in #( - e) ac_cv_lib_nsl_gethostbyname=no ;; -esac +else $as_nop + ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } @@ -8831,8 +8471,8 @@ printf %s "checking whether compiling with IPv4 networking is possible... " >&6; if test ${vim_cv_ipv4_networking+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8869,13 +8509,11 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vim_cv_ipv4_networking="yes" -else case e in #( - e) vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no" ;; -esac +else $as_nop + vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv4_networking" >&5 printf "%s\n" "$vim_cv_ipv4_networking" >&6; } @@ -8904,9 +8542,8 @@ printf %s "checking --enable-terminal argument... " >&6; } if test ${enable_terminal+y} then : enableval=$enable_terminal; -else case e in #( - e) enable_terminal="auto" ;; -esac +else $as_nop + enable_terminal="auto" fi if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then @@ -8951,9 +8588,8 @@ printf %s "checking --enable-autoservername argument... " >&6; } if test ${enable_autoservername+y} then : enableval=$enable_autoservername; -else case e in #( - e) enable_autoservername="no" ;; -esac +else $as_nop + enable_autoservername="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_autoservername" >&5 @@ -8969,9 +8605,8 @@ printf %s "checking --enable-multibyte argument... " >&6; } if test ${enable_multibyte+y} then : enableval=$enable_multibyte; -else case e in #( - e) enable_multibyte="yes" ;; -esac +else $as_nop + enable_multibyte="yes" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_multibyte" >&5 @@ -8987,9 +8622,8 @@ printf %s "checking --disable-rightleft argument... " >&6; } if test ${enable_rightleft+y} then : enableval=$enable_rightleft; -else case e in #( - e) enable_rightleft="yes" ;; -esac +else $as_nop + enable_rightleft="yes" fi if test "$enable_rightleft" = "yes"; then @@ -9008,9 +8642,8 @@ printf %s "checking --disable-arabic argument... " >&6; } if test ${enable_arabic+y} then : enableval=$enable_arabic; -else case e in #( - e) enable_arabic="yes" ;; -esac +else $as_nop + enable_arabic="yes" fi if test "$enable_arabic" = "yes"; then @@ -9037,10 +8670,9 @@ if test ${enable_xim+y} then : enableval=$enable_xim; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_xim" >&5 printf "%s\n" "$enable_xim" >&6; } -else case e in #( - e) enable_xim="auto"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to auto" >&5 -printf "%s\n" "defaulting to auto" >&6; } ;; -esac +else $as_nop + enable_xim="auto"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to auto" >&5 +printf "%s\n" "defaulting to auto" >&6; } fi @@ -9050,9 +8682,8 @@ printf %s "checking --enable-fontset argument... " >&6; } if test ${enable_fontset+y} then : enableval=$enable_fontset; -else case e in #( - e) enable_fontset="no" ;; -esac +else $as_nop + enable_fontset="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_fontset" >&5 @@ -9072,8 +8703,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_xmkmfpath+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $xmkmfpath in +else $as_nop + case $xmkmfpath in [\\/]* | ?:[\\/]*) ac_cv_path_xmkmfpath="$xmkmfpath" # Let the user override the test with a path. ;; @@ -9098,7 +8729,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi xmkmfpath=$ac_cv_path_xmkmfpath @@ -9122,7 +8752,7 @@ then : withval=$with_x; fi -# $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled @@ -9132,8 +8762,8 @@ else *,NONE | NONE,*) if test ${ac_cv_have_x+y} then : printf %s "(cached) " >&6 -else case e in #( - e) # One or both of the vars are not set, and there is no cached value. +else $as_nop + # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no # Do we need to do anything special at all? @@ -9256,14 +8886,13 @@ if ac_fn_c_try_cpp "$LINENO" then : # We can compile using X headers with no special include directory. ac_x_includes= -else case e in #( - e) for ac_dir in $ac_x_header_dirs; do +else $as_nop + for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi -done ;; -esac +done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no @@ -9290,8 +8919,8 @@ then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= -else case e in #( - e) LIBS=$ac_save_LIBS +else $as_nop + LIBS=$ac_save_LIBS for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! @@ -9301,8 +8930,7 @@ do break 2 fi done -done ;; -esac +done fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -9319,7 +8947,6 @@ case $ac_x_includes,$ac_x_libraries in #( ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" ;; -esac ;; esac fi ;; #( @@ -9381,8 +9008,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" -else case e in #( - e) LIBS="$ac_xsave_LIBS -R $x_libraries" +else $as_nop + LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9399,14 +9026,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -printf "%s\n" "neither works" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +printf "%s\n" "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -9430,14 +9055,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ /* 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XOpenDisplay (void); + builtin and then its argument prototype would still apply. */ +char XOpenDisplay (); int main (void) { @@ -9449,28 +9068,22 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 printf %s "checking for dnet_ntoa in -ldnet... " >&6; } if test ${ac_cv_lib_dnet_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char dnet_ntoa (void); + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); int main (void) { @@ -9482,14 +9095,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_dnet_ntoa=yes -else case e in #( - e) ac_cv_lib_dnet_dnet_ntoa=no ;; -esac +else $as_nop + ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } @@ -9504,22 +9115,16 @@ printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char dnet_ntoa (void); + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); int main (void) { @@ -9531,14 +9136,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_stub_dnet_ntoa=yes -else case e in #( - e) ac_cv_lib_dnet_stub_dnet_ntoa=no ;; -esac +else $as_nop + ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } @@ -9547,8 +9150,7 @@ then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi - fi ;; -esac + fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -9574,22 +9176,16 @@ printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (void); + builtin and then its argument prototype would still apply. */ +char gethostbyname (); int main (void) { @@ -9601,14 +9197,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes -else case e in #( - e) ac_cv_lib_nsl_gethostbyname=no ;; -esac +else $as_nop + ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } @@ -9623,22 +9217,16 @@ printf %s "checking for gethostbyname in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_gethostbyname+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (void); + builtin and then its argument prototype would still apply. */ +char gethostbyname (); int main (void) { @@ -9650,14 +9238,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_gethostbyname=yes -else case e in #( - e) ac_cv_lib_bsd_gethostbyname=no ;; -esac +else $as_nop + ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } @@ -9688,22 +9274,16 @@ printf %s "checking for connect in -lsocket... " >&6; } if test ${ac_cv_lib_socket_connect+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char connect (void); + builtin and then its argument prototype would still apply. */ +char connect (); int main (void) { @@ -9715,14 +9295,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_connect=yes -else case e in #( - e) ac_cv_lib_socket_connect=no ;; -esac +else $as_nop + ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } @@ -9746,22 +9324,16 @@ printf %s "checking for remove in -lposix... " >&6; } if test ${ac_cv_lib_posix_remove+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char remove (void); + builtin and then its argument prototype would still apply. */ +char remove (); int main (void) { @@ -9773,14 +9345,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix_remove=yes -else case e in #( - e) ac_cv_lib_posix_remove=no ;; -esac +else $as_nop + ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } @@ -9804,22 +9374,16 @@ printf %s "checking for shmat in -lipc... " >&6; } if test ${ac_cv_lib_ipc_shmat+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char shmat (void); + builtin and then its argument prototype would still apply. */ +char shmat (); int main (void) { @@ -9831,14 +9395,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ipc_shmat=yes -else case e in #( - e) ac_cv_lib_ipc_shmat=no ;; -esac +else $as_nop + ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } @@ -9864,22 +9426,16 @@ printf %s "checking for IceConnectionNumber in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceConnectionNumber+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char IceConnectionNumber (void); + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber (); int main (void) { @@ -9891,14 +9447,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceConnectionNumber=yes -else case e in #( - e) ac_cv_lib_ICE_IceConnectionNumber=no ;; -esac +else $as_nop + ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } @@ -9962,10 +9516,9 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; no_x=yes ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; no_x=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$cflags_save @@ -9986,22 +9539,16 @@ printf %s "checking for _XdmcpAuthDoIt in -lXdmcp... " >&6; } if test ${ac_cv_lib_Xdmcp__XdmcpAuthDoIt+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lXdmcp -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char _XdmcpAuthDoIt (void); + builtin and then its argument prototype would still apply. */ +char _XdmcpAuthDoIt (); int main (void) { @@ -10013,14 +9560,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xdmcp__XdmcpAuthDoIt=yes -else case e in #( - e) ac_cv_lib_Xdmcp__XdmcpAuthDoIt=no ;; -esac +else $as_nop + ac_cv_lib_Xdmcp__XdmcpAuthDoIt=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xdmcp__XdmcpAuthDoIt" >&5 printf "%s\n" "$ac_cv_lib_Xdmcp__XdmcpAuthDoIt" >&6; } @@ -10035,22 +9580,16 @@ printf %s "checking for IceOpenConnection in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceOpenConnection+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char IceOpenConnection (void); + builtin and then its argument prototype would still apply. */ +char IceOpenConnection (); int main (void) { @@ -10062,14 +9601,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceOpenConnection=yes -else case e in #( - e) ac_cv_lib_ICE_IceOpenConnection=no ;; -esac +else $as_nop + ac_cv_lib_ICE_IceOpenConnection=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceOpenConnection" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceOpenConnection" >&6; } @@ -10085,22 +9622,16 @@ printf %s "checking for XpmCreatePixmapFromData in -lXpm... " >&6; } if test ${ac_cv_lib_Xpm_XpmCreatePixmapFromData+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lXt $X_PRE_LIBS -lXpm -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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XpmCreatePixmapFromData (void); + builtin and then its argument prototype would still apply. */ +char XpmCreatePixmapFromData (); int main (void) { @@ -10112,14 +9643,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xpm_XpmCreatePixmapFromData=yes -else case e in #( - e) ac_cv_lib_Xpm_XpmCreatePixmapFromData=no ;; -esac +else $as_nop + ac_cv_lib_Xpm_XpmCreatePixmapFromData=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5 printf "%s\n" "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&6; } @@ -10152,8 +9681,8 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } -else case e in #( - e) CFLAGS="$CFLAGS -Wno-implicit-int" +else $as_nop + CFLAGS="$CFLAGS -Wno-implicit-int" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -10169,15 +9698,13 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; cflags_save="$cflags_save -Wno-implicit-int" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: test failed" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: test failed" >&5 printf "%s\n" "test failed" >&6; } - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$cflags_save @@ -10186,30 +9713,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam 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]];'. +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 printf %s "checking size of wchar_t... " >&6; } if test ${ac_cv_sizeof_wchar_t+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" then : -else case e in #( - e) if test "$ac_cv_type_wchar_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + if test "$ac_cv_type_wchar_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_wchar_t=0 - fi ;; -esac + fi fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 printf "%s\n" "$ac_cv_sizeof_wchar_t" >&6; } @@ -10239,9 +9764,8 @@ printf %s "checking --enable-gui argument... " >&6; } if test ${enable_gui+y} then : enableval=$enable_gui; -else case e in #( - e) enable_gui="auto" ;; -esac +else $as_nop + enable_gui="auto" fi @@ -10339,9 +9863,8 @@ printf %s "checking whether or not to look for GTK+ 2... " >&6; } if test ${enable_gtk2_check+y} then : enableval=$enable_gtk2_check; -else case e in #( - e) enable_gtk2_check="yes" ;; -esac +else $as_nop + enable_gtk2_check="yes" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gtk2_check" >&5 @@ -10359,9 +9882,8 @@ printf %s "checking whether or not to look for GNOME... " >&6; } if test ${enable_gnome_check+y} then : enableval=$enable_gnome_check; -else case e in #( - e) enable_gnome_check="no" ;; -esac +else $as_nop + enable_gnome_check="no" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gnome_check" >&5 @@ -10378,9 +9900,8 @@ printf %s "checking whether or not to look for GTK+ 3... " >&6; } if test ${enable_gtk3_check+y} then : enableval=$enable_gtk3_check; -else case e in #( - e) enable_gtk3_check="yes" ;; -esac +else $as_nop + enable_gtk3_check="yes" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gtk3_check" >&5 @@ -10397,9 +9918,8 @@ printf %s "checking whether or not to look for Motif... " >&6; } if test ${enable_motif_check+y} then : enableval=$enable_motif_check; -else case e in #( - e) enable_motif_check="yes" ;; -esac +else $as_nop + enable_motif_check="yes" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_motif_check" >&5 @@ -10424,8 +9944,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $PKG_CONFIG in +else $as_nop + case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; @@ -10450,7 +9970,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG @@ -10473,8 +9992,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $ac_pt_PKG_CONFIG in +else $as_nop + case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; @@ -10499,7 +10018,6 @@ done IFS=$as_save_IFS ;; -esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG @@ -10537,9 +10055,8 @@ printf %s "checking --disable-gtktest argument... " >&6; } if test ${enable_gtktest+y} then : enableval=$enable_gtktest; -else case e in #( - e) enable_gtktest=yes ;; -esac +else $as_nop + enable_gtktest=yes fi if test "x$enable_gtktest" = "xyes" ; then @@ -10607,8 +10124,8 @@ printf %s "checking for GTK -dev package... " >&6; } if test "$cross_compiling" = yes then : echo $ac_n "cross compiling; assumed OK... $ac_c" -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -10650,13 +10167,11 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else case e in #( - e) no_gtk=yes ;; -esac +else $as_nop + no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" @@ -10748,9 +10263,8 @@ then : gnome_prefix=$withval/lib fi fi -else case e in #( - e) want_gnome=yes ;; -esac +else $as_nop + want_gnome=yes fi @@ -10807,9 +10321,8 @@ printf %s "checking --disable-gtktest argument... " >&6; } if test ${enable_gtktest+y} then : enableval=$enable_gtktest; -else case e in #( - e) enable_gtktest=yes ;; -esac +else $as_nop + enable_gtktest=yes fi if test "x$enable_gtktest" = "xyes" ; then @@ -10877,8 +10390,8 @@ printf %s "checking for GTK -dev package... " >&6; } if test "$cross_compiling" = yes then : echo $ac_n "cross compiling; assumed OK... $ac_c" -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -10920,13 +10433,11 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else case e in #( - e) no_gtk=yes ;; -esac +else $as_nop + no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" @@ -10998,8 +10509,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GLIB_COMPILE_RESOURCES+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $GLIB_COMPILE_RESOURCES in +else $as_nop + case $GLIB_COMPILE_RESOURCES in [\\/]* | ?:[\\/]*) ac_cv_path_GLIB_COMPILE_RESOURCES="$GLIB_COMPILE_RESOURCES" # Let the user override the test with a path. ;; @@ -11025,7 +10536,6 @@ IFS=$as_save_IFS test -z "$ac_cv_path_GLIB_COMPILE_RESOURCES" && ac_cv_path_GLIB_COMPILE_RESOURCES="no" ;; -esac ;; esac fi GLIB_COMPILE_RESOURCES=$ac_cv_path_GLIB_COMPILE_RESOURCES @@ -11067,9 +10577,8 @@ printf %s "checking --disable-icon-cache-update argument... " >&6; } if test ${enable_icon_cache_update+y} then : enableval=$enable_icon_cache_update; -else case e in #( - e) enable_icon_cache_update="yes" ;; -esac +else $as_nop + enable_icon_cache_update="yes" fi if test "$enable_icon_cache_update" = "yes"; then @@ -11082,8 +10591,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GTK_UPDATE_ICON_CACHE+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $GTK_UPDATE_ICON_CACHE in +else $as_nop + case $GTK_UPDATE_ICON_CACHE in [\\/]* | ?:[\\/]*) ac_cv_path_GTK_UPDATE_ICON_CACHE="$GTK_UPDATE_ICON_CACHE" # Let the user override the test with a path. ;; @@ -11109,7 +10618,6 @@ IFS=$as_save_IFS test -z "$ac_cv_path_GTK_UPDATE_ICON_CACHE" && ac_cv_path_GTK_UPDATE_ICON_CACHE="no" ;; -esac ;; esac fi GTK_UPDATE_ICON_CACHE=$ac_cv_path_GTK_UPDATE_ICON_CACHE @@ -11137,9 +10645,8 @@ printf %s "checking --disable-desktop-database-update argument... " >&6; } if test ${enable_desktop_database_update+y} then : enableval=$enable_desktop_database_update; -else case e in #( - e) enable_desktop_database_update="yes" ;; -esac +else $as_nop + enable_desktop_database_update="yes" fi if test "$enable_desktop_database_update" = "yes"; then @@ -11152,8 +10659,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_UPDATE_DESKTOP_DATABASE+y} then : printf %s "(cached) " >&6 -else case e in #( - e) case $UPDATE_DESKTOP_DATABASE in +else $as_nop + case $UPDATE_DESKTOP_DATABASE in [\\/]* | ?:[\\/]*) ac_cv_path_UPDATE_DESKTOP_DATABASE="$UPDATE_DESKTOP_DATABASE" # Let the user override the test with a path. ;; @@ -11179,7 +10686,6 @@ IFS=$as_save_IFS test -z "$ac_cv_path_UPDATE_DESKTOP_DATABASE" && ac_cv_path_UPDATE_DESKTOP_DATABASE="no" ;; -esac ;; esac fi UPDATE_DESKTOP_DATABASE=$ac_cv_path_UPDATE_DESKTOP_DATABASE @@ -11317,22 +10823,16 @@ printf %s "checking for XShapeQueryExtension in -lXext... " >&6; } if test ${ac_cv_lib_Xext_XShapeQueryExtension+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XShapeQueryExtension (void); + builtin and then its argument prototype would still apply. */ +char XShapeQueryExtension (); int main (void) { @@ -11344,14 +10844,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xext_XShapeQueryExtension=yes -else case e in #( - e) ac_cv_lib_Xext_XShapeQueryExtension=no ;; -esac +else $as_nop + ac_cv_lib_Xext_XShapeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5 printf "%s\n" "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; } @@ -11365,22 +10863,16 @@ printf %s "checking for wslen in -lw... " >&6; } if test ${ac_cv_lib_w_wslen+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lw $GUI_X_LIBS -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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char wslen (void); + builtin and then its argument prototype would still apply. */ +char wslen (); int main (void) { @@ -11392,14 +10884,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_w_wslen=yes -else case e in #( - e) ac_cv_lib_w_wslen=no ;; -esac +else $as_nop + ac_cv_lib_w_wslen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_w_wslen" >&5 printf "%s\n" "$ac_cv_lib_w_wslen" >&6; } @@ -11413,22 +10903,16 @@ printf %s "checking for dlsym in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlsym+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $GUI_X_LIBS -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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char dlsym (void); + builtin and then its argument prototype would still apply. */ +char dlsym (); int main (void) { @@ -11440,14 +10924,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlsym=yes -else case e in #( - e) ac_cv_lib_dl_dlsym=no ;; -esac +else $as_nop + ac_cv_lib_dl_dlsym=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 printf "%s\n" "$ac_cv_lib_dl_dlsym" >&6; } @@ -11461,22 +10943,16 @@ printf %s "checking for XmuCreateStippledPixmap in -lXmu... " >&6; } if test ${ac_cv_lib_Xmu_XmuCreateStippledPixmap+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu $GUI_X_LIBS -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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XmuCreateStippledPixmap (void); + builtin and then its argument prototype would still apply. */ +char XmuCreateStippledPixmap (); int main (void) { @@ -11488,14 +10964,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xmu_XmuCreateStippledPixmap=yes -else case e in #( - e) ac_cv_lib_Xmu_XmuCreateStippledPixmap=no ;; -esac +else $as_nop + ac_cv_lib_Xmu_XmuCreateStippledPixmap=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuCreateStippledPixmap" >&5 printf "%s\n" "$ac_cv_lib_Xmu_XmuCreateStippledPixmap" >&6; } @@ -11510,22 +10984,16 @@ printf %s "checking for XpEndJob in -lXp... " >&6; } if test ${ac_cv_lib_Xp_XpEndJob+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lXp $GUI_X_LIBS -lXm -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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XpEndJob (void); + builtin and then its argument prototype would still apply. */ +char XpEndJob (); int main (void) { @@ -11537,14 +11005,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xp_XpEndJob=yes -else case e in #( - e) ac_cv_lib_Xp_XpEndJob=no ;; -esac +else $as_nop + ac_cv_lib_Xp_XpEndJob=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpEndJob" >&5 printf "%s\n" "$ac_cv_lib_Xp_XpEndJob" >&6; } @@ -11621,14 +11087,13 @@ printf %s "checking for XIMText in X11/Xlib.h... " >&6; } #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP_TRADITIONAL "XIMText" >/dev/null 2>&1 + $EGREP "XIMText" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; xim has been disabled" >&5 -printf "%s\n" "no; xim has been disabled" >&6; }; enable_xim="no" ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; xim has been disabled" >&5 +printf "%s\n" "no; xim has been disabled" >&6; }; enable_xim="no" fi rm -rf conftest* @@ -11666,10 +11131,9 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_X11_XMU_EDITRES_H 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS=$cppflags_save @@ -11751,12 +11215,11 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define XPMATTRIBUTES_TYPE XpmAttributes_21" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; printf "%s\n" "#define XPMATTRIBUTES_TYPE XpmAttributes" >>confdefs.h - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext else @@ -11860,8 +11323,8 @@ printf %s "checking whether toupper is broken... " >&6; } if test ${vim_cv_toupper_broken+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -11869,8 +11332,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_toupper_broken'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_toupper_broken'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -11887,18 +11350,15 @@ then : vim_cv_toupper_broken=yes -else case e in #( - e) +else $as_nop + vim_cv_toupper_broken=no - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_toupper_broken" >&5 printf "%s\n" "$vim_cv_toupper_broken" >&6; } @@ -11926,10 +11386,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DATE_TIME 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -11951,23 +11410,22 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -11984,12 +11442,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else case e in #( - e) eval "$as_ac_Header=no" ;; -esac +else $as_nop + eval "$as_ac_Header=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -11997,7 +11453,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -12011,21 +11467,15 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_func_search_save_LIBS=$LIBS +else $as_nop + ac_func_search_save_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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (void); + builtin and then its argument prototype would still apply. */ +char opendir (); int main (void) { @@ -12056,13 +11506,11 @@ done if test ${ac_cv_search_opendir+y} then : -else case e in #( - e) ac_cv_search_opendir=no ;; -esac +else $as_nop + ac_cv_search_opendir=no fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS ;; -esac +LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -12079,21 +11527,15 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_func_search_save_LIBS=$LIBS +else $as_nop + ac_func_search_save_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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (void); + builtin and then its argument prototype would still apply. */ +char opendir (); int main (void) { @@ -12124,13 +11566,11 @@ done if test ${ac_cv_search_opendir+y} then : -else case e in #( - e) ac_cv_search_opendir=no ;; -esac +else $as_nop + ac_cv_search_opendir=no fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS ;; -esac +LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -12166,10 +11606,9 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_UNION_WAIT 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12472,10 +11911,9 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -12524,25 +11962,68 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else case e in #( - e) printf "%s\n" "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h +else $as_nop + printf "%s\n" "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS=$cppflags_save fi +if test $ac_cv_c_compiler_gnu = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +printf %s "checking whether $CC needs -traditional... " >&6; } +if test ${ac_cv_prog_gcc_traditional+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : + ac_cv_prog_gcc_traditional=yes +else $as_nop + ac_cv_prog_gcc_traditional=no +fi +rm -rf conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : + ac_cv_prog_gcc_traditional=yes +fi +rm -rf conftest* + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12606,12 +12087,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else case e in #( - e) ac_cv_c_const=no ;; -esac +else $as_nop + ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -12626,8 +12105,8 @@ printf %s "checking for working volatile... " >&6; } if test ${ac_cv_c_volatile+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12644,12 +12123,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_volatile=yes -else case e in #( - e) ac_cv_c_volatile=no ;; -esac +else $as_nop + ac_cv_c_volatile=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 printf "%s\n" "$ac_cv_c_volatile" >&6; } @@ -12663,22 +12140,20 @@ ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : -else case e in #( - e) +else $as_nop + printf "%s\n" "#define mode_t int" >>confdefs.h - ;; -esac + fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else case e in #( - e) +else $as_nop + printf "%s\n" "#define off_t long int" >>confdefs.h - ;; -esac + fi @@ -12687,8 +12162,8 @@ fi if test "x$ac_cv_type_pid_t" = xyes then : -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ @@ -12707,16 +12182,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' -else case e in #( - e) ac_pid_type='__int64' ;; -esac +else $as_nop + ac_pid_type='__int64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - ;; -esac + fi @@ -12724,33 +12197,42 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else case e in #( - e) +else $as_nop + printf "%s\n" "#define size_t unsigned int" >>confdefs.h - ;; -esac + fi -ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" -if test "x$ac_cv_type_uid_t" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -else case e in #( - e) -printf "%s\n" "#define uid_t int" >>confdefs.h - ;; -esac +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1 +then : + ac_cv_type_uid_t=yes +else $as_nop + ac_cv_type_uid_t=no fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +printf "%s\n" "#define uid_t int" >>confdefs.h -ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" -if test "x$ac_cv_type_gid_t" = xyes -then : -else case e in #( - e) printf "%s\n" "#define gid_t int" >>confdefs.h - ;; -esac + fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" @@ -12773,22 +12255,20 @@ ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default" if test "x$ac_cv_type_ino_t" = xyes then : -else case e in #( - e) +else $as_nop + printf "%s\n" "#define ino_t long" >>confdefs.h - ;; -esac + fi ac_fn_c_check_type "$LINENO" "dev_t" "ac_cv_type_dev_t" "$ac_includes_default" if test "x$ac_cv_type_dev_t" = xyes then : -else case e in #( - e) +else $as_nop + printf "%s\n" "#define dev_t unsigned" >>confdefs.h - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 @@ -12796,8 +12276,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_c_bigendian=unknown +else $as_nop + ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12843,8 +12323,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif @@ -12875,9 +12355,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else case e in #( - e) ac_cv_c_bigendian=no ;; -esac +else $as_nop + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12921,9 +12400,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else case e in #( - e) ac_cv_c_bigendian=no ;; -esac +else $as_nop + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12950,23 +12428,22 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - int - main (int argc, char **argv) - { - /* Intimidate the compiler so that it does not - optimize the arrays away. */ - char *p = argv[0]; - ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; - ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; - return use_ascii (argc) == use_ebcdic (*p); - } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -12975,10 +12452,9 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -13001,17 +12477,14 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else case e in #( - e) ac_cv_c_bigendian=yes ;; -esac +else $as_nop + ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi ;; -esac + fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -13036,8 +12509,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_c_inline=no +else $as_nop + ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13055,8 +12528,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -13097,12 +12569,11 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP_TRADITIONAL "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1 + $EGREP "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1 then : ac_cv_type_rlim_t=yes -else case e in #( - e) ac_cv_type_rlim_t=no ;; -esac +else $as_nop + ac_cv_type_rlim_t=no fi rm -rf conftest* @@ -13133,12 +12604,11 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP_TRADITIONAL "stack_t" >/dev/null 2>&1 + $EGREP "stack_t" >/dev/null 2>&1 then : ac_cv_type_stack_t=yes -else case e in #( - e) ac_cv_type_stack_t=no ;; -esac +else $as_nop + ac_cv_type_stack_t=no fi rm -rf conftest* @@ -13177,10 +12647,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SS_BASE 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13215,9 +12684,8 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OK" >&5 printf "%s\n" "OK" >&6; } -else case e in #( - e) as_fn_error $? "FAILED" "$LINENO" 5 ;; -esac +else $as_nop + as_fn_error $? "FAILED" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13230,28 +12698,22 @@ printf "%s\n" "empty: automatic terminal library selection" >&6; } *) tlibs="tinfo ncurses termlib termcap curses";; esac for libname in $tlibs; do - as_ac_Lib=`printf "%s\n" "ac_cv_lib_${libname}""_tgetent" | sed "$as_sed_sh"` + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${libname}""_tgetent" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -l${libname}" >&5 printf %s "checking for tgetent in -l${libname}... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-l${libname} $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char tgetent (void); + builtin and then its argument prototype would still apply. */ +char tgetent (); int main (void) { @@ -13263,14 +12725,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" -else case e in #( - e) eval "$as_ac_Lib=no" ;; -esac +else $as_nop + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -13278,7 +12738,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIB${libname}" | sed "$as_sed_cpp"` 1 +#define `printf "%s\n" "HAVE_LIB${libname}" | $as_tr_cpp` 1 _ACEOF LIBS="-l${libname} $LIBS" @@ -13289,8 +12749,8 @@ fi if test "$cross_compiling" = yes then : res="OK" -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H @@ -13305,13 +12765,11 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : res="OK" -else case e in #( - e) res="FAIL" ;; -esac +else $as_nop + res="FAIL" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test "$res" = "OK"; then @@ -13346,12 +12804,11 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else case e in #( - e) as_fn_error $? "NOT FOUND! +else $as_nop + as_fn_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." "$LINENO" 5 ;; -esac + Or specify the name of the library with --with-tlib." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13362,8 +12819,8 @@ printf %s "checking whether we talk terminfo... " >&6; } if test ${vim_cv_terminfo+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -13371,8 +12828,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_terminfo'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_terminfo'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -13395,19 +12852,16 @@ then : vim_cv_terminfo=yes -else case e in #( - e) +else $as_nop + vim_cv_terminfo=no - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_terminfo" >&5 printf "%s\n" "$vim_cv_terminfo" >&6; } @@ -13422,8 +12876,8 @@ printf %s "checking what tgetent() returns for an unknown terminal... " >&6; } if test ${vim_cv_tgetent+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -13431,8 +12885,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_tgetent'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_tgetent'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -13452,19 +12906,16 @@ then : vim_cv_tgetent=zero -else case e in #( - e) +else $as_nop + vim_cv_tgetent=non-zero - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tgetent" >&5 printf "%s\n" "$vim_cv_tgetent" >&6; } @@ -13496,8 +12947,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_OSPEED 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ospeed can be extern" >&5 printf %s "checking whether ospeed can be extern... " >&6; } @@ -13522,15 +12973,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define OSPEED_EXTERN 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13557,8 +13006,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_UP_BC_PC 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UP, BC and PC can be extern" >&5 printf %s "checking whether UP, BC and PC can be extern... " >&6; } @@ -13583,15 +13032,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define UP_BC_PC_EXTERN 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - ;; -esac + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13618,10 +13065,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_OUTFUNTYPE 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13648,10 +13094,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DEL_CURTERM 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13678,10 +13123,9 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13724,10 +13168,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SVR4_PTYS 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13751,12 +13194,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 + $EGREP "yes" >/dev/null 2>&1 then : ptys=`echo /dev/ptyp??` -else case e in #( - e) ptys=`echo $pdir/pty??` ;; -esac +else $as_nop + ptys=`echo $pdir/pty??` fi rm -rf conftest* @@ -13801,10 +13243,9 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_SIGCONTEXT 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13813,8 +13254,8 @@ printf %s "checking getcwd implementation is broken... " >&6; } if test ${vim_cv_getcwd_broken+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -13822,8 +13263,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_getcwd_broken'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_getcwd_broken'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -13845,19 +13286,16 @@ then : vim_cv_getcwd_broken=no -else case e in #( - e) +else $as_nop + vim_cv_getcwd_broken=yes - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_getcwd_broken" >&5 printf "%s\n" "$vim_cv_getcwd_broken" >&6; } @@ -14219,8 +13657,8 @@ printf %s "checking types of arguments for select... " >&6; } if test ${ac_cv_func_select_args+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_func_select_args='int,int *,struct timeval *' +else $as_nop + ac_cv_func_select_args='int,int *,struct timeval *' for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do @@ -14252,8 +13690,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done done done - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 printf "%s\n" "$ac_cv_func_select_args" >&6; } @@ -14272,97 +13709,72 @@ printf "%s\n" "#define SELECT_TYPE_ARG5 ($3)" >>confdefs.h rm -rf conftest* -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declarations of fseeko and ftello" >&5 -printf %s "checking for declarations of fseeko and ftello... " >&6; } -if test ${ac_cv_func_fseeko_ftello+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_source+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#if defined __hpux && !defined _LARGEFILE_SOURCE -# include -# if LONG_MAX >> 31 == 0 -# error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" -# endif -#endif #include /* for off_t */ -#include - + #include int main (void) { - - int (*fp1) (FILE *, off_t, int) = fseeko; - off_t (*fp2) (FILE *) = ftello; - return fseeko (stdin, 0, 0) - && fp1 (stdin, 0, 0) - && ftello (stdin) >= 0 - && fp2 (stdin) >= 0; - +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - ac_cv_func_fseeko_ftello=yes -else case e in #( - e) ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE=1" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#if defined __hpux && !defined _LARGEFILE_SOURCE -# include -# if LONG_MAX >> 31 == 0 -# error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" -# endif -#endif +#define _LARGEFILE_SOURCE 1 #include /* for off_t */ -#include - + #include int main (void) { - - int (*fp1) (FILE *, off_t, int) = fseeko; - off_t (*fp2) (FILE *) = ftello; - return fseeko (stdin, 0, 0) - && fp1 (stdin, 0, 0) - && ftello (stdin) >= 0 - && fp2 (stdin) >= 0; - +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - ac_cv_func_fseeko_ftello="need _LARGEFILE_SOURCE" -else case e in #( - e) ac_cv_func_fseeko_ftello=no ;; -esac + ac_cv_sys_largefile_source=1; break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +printf "%s\n" "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h +;; esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fseeko_ftello" >&5 -printf "%s\n" "$ac_cv_func_fseeko_ftello" >&6; } -if test "$ac_cv_func_fseeko_ftello" != no -then : - -printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h +rm -rf conftest* -fi -if test "$ac_cv_func_fseeko_ftello" = "need _LARGEFILE_SOURCE" -then : +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then -printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h +printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h fi @@ -14372,34 +13784,31 @@ if test ${enable_largefile+y} then : enableval=$enable_largefile; fi -if test "$enable_largefile,$enable_year2038" != no,no -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 -printf %s "checking for $CC option to enable large file support... " >&6; } -if test ${ac_cv_sys_largefile_opts+y} + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CC="$CC" - ac_opt_found=no - for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do - if test x"$ac_opt" != x"none needed" -then : - CC="$ac_save_CC $ac_opt" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#ifndef FTYPE -# define FTYPE off_t -#endif - /* Check that FTYPE can represent 2**63 - 1 correctly. - We can't simply define LARGE_FTYPE to be 9223372036854775807, + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) - int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 - && LARGE_FTYPE % 2147483647 == 1) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) @@ -14409,88 +13818,142 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_opt" = x"none needed" -then : - # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. - CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : - -else case e in #( - e) CC="$CC -D_FILE_OFFSET_BITS=64" - if ac_fn_c_try_compile "$LINENO" -then : - ac_opt='-D_FILE_OFFSET_BITS=64' + break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi fi - ac_cv_sys_largefile_opts=$ac_opt - ac_opt_found=yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + 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)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - test $ac_opt_found = no || break - done - CC="$ac_save_CC" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + 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)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ - test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; -esac + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 -printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } - -ac_have_largefile=yes -case $ac_cv_sys_largefile_opts in #( - "none needed") : - ;; #( - "supported through gnulib") : - ;; #( - "support not detected") : - ac_have_largefile=no ;; #( - "-D_FILE_OFFSET_BITS=64") : - -printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h - ;; #( - "-D_LARGE_FILES=1") : - -printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h - ;; #( - "-n32") : - CC="$CC -n32" ;; #( - *) : - as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; esac - -if test "$enable_year2038" != no -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 -printf %s "checking for $CC option for timestamps after 2038... " >&6; } -if test ${ac_cv_sys_year2038_opts+y} +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CPPFLAGS="$CPPFLAGS" - ac_opt_found=no - for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do - if test x"$ac_opt" != x"none needed" +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + 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)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" then : - CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" + ac_cv_sys_large_files=no; break fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - #include - /* Check that time_t can represent 2**32 - 1 correctly. */ - #define LARGE_TIME_T \\ - ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) - int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 - && LARGE_TIME_T % 65537 == 0) - ? 1 : -1]; - +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + 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)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main (void) { @@ -14501,47 +13964,25 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_year2038_opts="$ac_opt" - ac_opt_found=yes + ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - test $ac_opt_found = no || break - done - CPPFLAGS="$ac_save_CPPFLAGS" - test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; -esac + ac_cv_sys_large_files=unknown + break +done fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 -printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } - -ac_have_year2038=yes -case $ac_cv_sys_year2038_opts in #( - "none needed") : - ;; #( - "support not detected") : - ac_have_year2038=no ;; #( - "-D_TIME_BITS=64") : - -printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h - ;; #( - "-D__MINGW_USE_VC2005_COMPAT") : - -printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h - ;; #( - "-U_USE_32_BIT_TIME_T"*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It -will stop working after mid-January 2038. Remove -_USE_32BIT_TIME_T from the compiler flags. -See 'config.log' for more details" "$LINENO" 5; } ;; #( - *) : - as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; esac - +rm -rf conftest* + fi fi -fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking --enable-canberra argument" >&5 printf %s "checking --enable-canberra argument... " >&6; } @@ -14549,9 +13990,8 @@ printf %s "checking --enable-canberra argument... " >&6; } if test ${enable_canberra+y} then : enableval=$enable_canberra; -else case e in #( - e) enable_canberra="maybe" ;; -esac +else $as_nop + enable_canberra="maybe" fi @@ -14612,10 +14052,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_CANBERRA 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libcanberra-dev" >&5 -printf "%s\n" "no; try installing libcanberra-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libcanberra-dev" >&5 +printf "%s\n" "no; try installing libcanberra-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14627,9 +14066,8 @@ printf %s "checking --enable-libsodium argument... " >&6; } if test ${enable_libsodium+y} then : enableval=$enable_libsodium; -else case e in #( - e) enable_libsodium="maybe" ;; -esac +else $as_nop + enable_libsodium="maybe" fi @@ -14681,10 +14119,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SODIUM 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5 -printf "%s\n" "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5 +printf "%s\n" "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14713,10 +14150,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ST_BLKSIZE 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14725,8 +14161,8 @@ printf %s "checking for timer_create without -lrt... " >&6; } if test ${vim_cv_timer_create+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14745,13 +14181,11 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : vim_cv_timer_create=yes -else case e in #( - e) vim_cv_timer_create=no - ;; -esac +else $as_nop + vim_cv_timer_create=no + fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create" >&5 printf "%s\n" "$vim_cv_timer_create" >&6; } @@ -14764,8 +14198,8 @@ printf %s "checking for timer_create with -lrt... " >&6; } if test ${vim_cv_timer_create_with_lrt+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14784,13 +14218,11 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : vim_cv_timer_create_with_lrt=yes -else case e in #( - e) vim_cv_timer_create_with_lrt=no - ;; -esac +else $as_nop + vim_cv_timer_create_with_lrt=no + fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create_with_lrt" >&5 printf "%s\n" "$vim_cv_timer_create_with_lrt" >&6; } @@ -14811,16 +14243,16 @@ printf %s "checking if timer_create works... " >&6; } if test ${vim_cv_timer_create_works+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : vim_cv_timer_create_works=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_timer_create_works'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_timer_create_works'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if STDC_HEADERS @@ -14851,16 +14283,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : vim_cv_timer_create_works=yes -else case e in #( - e) vim_cv_timer_create_works=no ;; -esac +else $as_nop + vim_cv_timer_create_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create_works" >&5 printf "%s\n" "$vim_cv_timer_create_works" >&6; } @@ -14878,8 +14307,8 @@ printf %s "checking whether stat() ignores a trailing slash... " >&6; } if test ${vim_cv_stat_ignores_slash+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -14887,8 +14316,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_stat_ignores_slash'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_stat_ignores_slash'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -14906,19 +14335,16 @@ then : vim_cv_stat_ignores_slash=yes -else case e in #( - e) +else $as_nop + vim_cv_stat_ignores_slash=no - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_stat_ignores_slash" >&5 printf "%s\n" "$vim_cv_stat_ignores_slash" >&6; } @@ -14933,8 +14359,8 @@ printf %s "checking for nanoseconds field of struct stat... " >&6; } if test ${ac_cv_struct_st_mtim_nsec+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CPPFLAGS="$CPPFLAGS" +else $as_nop + 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 @@ -14964,8 +14390,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CPPFLAGS="$ac_save_CPPFLAGS" - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_mtim_nsec" >&5 printf "%s\n" "$ac_cv_struct_st_mtim_nsec" >&6; } @@ -14999,8 +14424,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes; with -liconv" >&5 printf "%s\n" "yes; with -liconv" >&6; }; printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h -else case e in #( - e) LIBS="$save_LIBS" +else $as_nop + LIBS="$save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15021,14 +14446,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15056,10 +14479,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_NL_LANGINFO_CODESET 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15069,22 +14491,16 @@ printf %s "checking for strtod in -lm... " >&6; } if test ${ac_cv_lib_m_strtod+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char strtod (void); + builtin and then its argument prototype would still apply. */ +char strtod (); int main (void) { @@ -15096,14 +14512,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_strtod=yes -else case e in #( - e) ac_cv_lib_m_strtod=no ;; -esac +else $as_nop + ac_cv_lib_m_strtod=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_strtod" >&5 printf "%s\n" "$ac_cv_lib_m_strtod" >&6; } @@ -15142,10 +14556,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ISINF 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15176,10 +14589,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ISNAN 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15190,9 +14602,8 @@ printf %s "checking --disable-acl argument... " >&6; } if test ${enable_acl+y} then : enableval=$enable_acl; -else case e in #( - e) enable_acl="yes" ;; -esac +else $as_nop + enable_acl="yes" fi if test "$enable_acl" = "yes"; then @@ -15203,22 +14614,16 @@ printf %s "checking for acl_get_file in -lposix1e... " >&6; } if test ${ac_cv_lib_posix1e_acl_get_file+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lposix1e $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char acl_get_file (void); + builtin and then its argument prototype would still apply. */ +char acl_get_file (); int main (void) { @@ -15230,42 +14635,34 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix1e_acl_get_file=yes -else case e in #( - e) ac_cv_lib_posix1e_acl_get_file=no ;; -esac +else $as_nop + ac_cv_lib_posix1e_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix1e_acl_get_file" >&5 printf "%s\n" "$ac_cv_lib_posix1e_acl_get_file" >&6; } if test "x$ac_cv_lib_posix1e_acl_get_file" = xyes then : LIBS="$LIBS -lposix1e" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 printf %s "checking for acl_get_file in -lacl... " >&6; } if test ${ac_cv_lib_acl_acl_get_file+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char acl_get_file (void); + builtin and then its argument prototype would still apply. */ +char acl_get_file (); int main (void) { @@ -15277,14 +14674,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_acl_acl_get_file=yes -else case e in #( - e) ac_cv_lib_acl_acl_get_file=no ;; -esac +else $as_nop + ac_cv_lib_acl_acl_get_file=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_get_file" >&5 printf "%s\n" "$ac_cv_lib_acl_acl_get_file" >&6; } @@ -15296,22 +14691,16 @@ printf %s "checking for fgetxattr in -lattr... " >&6; } if test ${ac_cv_lib_attr_fgetxattr+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char fgetxattr (void); + builtin and then its argument prototype would still apply. */ +char fgetxattr (); int main (void) { @@ -15323,14 +14712,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_attr_fgetxattr=yes -else case e in #( - e) ac_cv_lib_attr_fgetxattr=no ;; -esac +else $as_nop + ac_cv_lib_attr_fgetxattr=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_fgetxattr" >&5 printf "%s\n" "$ac_cv_lib_attr_fgetxattr" >&6; } @@ -15340,8 +14727,7 @@ then : fi fi - ;; -esac + fi @@ -15370,10 +14756,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_POSIX_ACL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15383,22 +14768,16 @@ printf %s "checking for acl_get in -lsec... " >&6; } if test ${ac_cv_lib_sec_acl_get+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lsec $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char acl_get (void); + builtin and then its argument prototype would still apply. */ +char acl_get (); int main (void) { @@ -15410,14 +14789,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_sec_acl_get=yes -else case e in #( - e) ac_cv_lib_sec_acl_get=no ;; -esac +else $as_nop + ac_cv_lib_sec_acl_get=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_acl_get" >&5 printf "%s\n" "$ac_cv_lib_sec_acl_get" >&6; } @@ -15425,8 +14802,8 @@ if test "x$ac_cv_lib_sec_acl_get" = xyes then : LIBS="$LIBS -lsec"; printf "%s\n" "#define HAVE_SOLARIS_ZFS_ACL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5 printf %s "checking for Solaris ACL support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15448,14 +14825,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SOLARIS_ACL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi @@ -15496,10 +14871,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_AIX_ACL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15531,10 +14905,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_PANGO_SHAPE_FULL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15548,9 +14921,8 @@ printf %s "checking --enable-gpm argument... " >&6; } if test ${enable_gpm+y} then : enableval=$enable_gpm; -else case e in #( - e) enable_gpm="yes" ;; -esac +else $as_nop + enable_gpm="yes" fi @@ -15562,8 +14934,8 @@ printf %s "checking for gpm... " >&6; } if test ${vi_cv_have_gpm+y} then : printf %s "(cached) " >&6 -else case e in #( - e) olibs="$LIBS" ; LIBS="-lgpm" +else $as_nop + olibs="$LIBS" ; LIBS="-lgpm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15579,15 +14951,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vi_cv_have_gpm=yes -else case e in #( - e) vi_cv_have_gpm=no ;; -esac +else $as_nop + vi_cv_have_gpm=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$olibs" - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_gpm" >&5 printf "%s\n" "$vi_cv_have_gpm" >&6; } @@ -15612,9 +14982,8 @@ printf %s "checking --disable-sysmouse argument... " >&6; } if test ${enable_sysmouse+y} then : enableval=$enable_sysmouse; -else case e in #( - e) enable_sysmouse="yes" ;; -esac +else $as_nop + enable_sysmouse="yes" fi @@ -15626,8 +14995,8 @@ printf %s "checking for sysmouse... " >&6; } if test ${vi_cv_have_sysmouse+y} then : printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -15647,14 +15016,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vi_cv_have_sysmouse=yes -else case e in #( - e) vi_cv_have_sysmouse=no ;; -esac +else $as_nop + vi_cv_have_sysmouse=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_sysmouse" >&5 printf "%s\n" "$vi_cv_have_sysmouse" >&6; } @@ -15687,10 +15054,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_FD_CLOEXEC 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15712,10 +15078,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_RENAME 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15739,10 +15104,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15765,10 +15129,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15799,10 +15162,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSCTL 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15830,10 +15192,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSINFO 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15859,10 +15220,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSINFO_MEM_UNIT 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15890,10 +15250,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSINFO_UPTIME 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15917,10 +15276,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15943,39 +15301,36 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSCONF_SIGSTKSZ 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam 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]];'. +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : -else case e in #( - e) if test "$ac_cv_type_int" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + if test "$ac_cv_type_int" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 - fi ;; -esac + fi fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } @@ -15987,30 +15342,28 @@ printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # 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]];'. +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : -else case e in #( - e) if test "$ac_cv_type_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 - fi ;; -esac + fi fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } @@ -16022,30 +15375,28 @@ printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # 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]];'. +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 printf %s "checking size of time_t... " >&6; } if test ${ac_cv_sizeof_time_t+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" then : -else case e in #( - e) if test "$ac_cv_type_time_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + if test "$ac_cv_type_time_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 - fi ;; -esac + fi fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } @@ -16057,30 +15408,28 @@ printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h # 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]];'. +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 printf %s "checking size of off_t... " >&6; } if test ${ac_cv_sizeof_off_t+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" then : -else case e in #( - e) if test "$ac_cv_type_off_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +else $as_nop + if test "$ac_cv_type_off_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) -See 'config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 - fi ;; -esac + fi fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } @@ -16102,8 +15451,8 @@ if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: assuming uint32_t is correct when cross-compiling" >&5 printf "%s\n" "$as_me: WARNING: assuming uint32_t is correct when cross-compiling" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDINT_H @@ -16123,13 +15472,11 @@ if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } -else case e in #( - e) as_fn_error $? "WRONG! uint32_t not defined correctly." "$LINENO" 5 ;; -esac +else $as_nop + as_fn_error $? "WRONG! uint32_t not defined correctly." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -16161,8 +15508,8 @@ printf %s "checking whether memmove handles overlaps... " >&6; } if test ${vim_cv_memmove_handles_overlap+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -16170,8 +15517,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_memmove_handles_overlap'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_memmove_handles_overlap'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog _ACEOF @@ -16180,19 +15527,16 @@ then : vim_cv_memmove_handles_overlap=yes -else case e in #( - e) +else $as_nop + vim_cv_memmove_handles_overlap=no - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_memmove_handles_overlap" >&5 printf "%s\n" "$vim_cv_memmove_handles_overlap" >&6; } @@ -16206,8 +15550,8 @@ printf %s "checking whether bcopy handles overlaps... " >&6; } if test ${vim_cv_bcopy_handles_overlap+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -16215,8 +15559,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_bcopy_handles_overlap'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_bcopy_handles_overlap'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog _ACEOF @@ -16225,19 +15569,16 @@ then : vim_cv_bcopy_handles_overlap=yes -else case e in #( - e) +else $as_nop + vim_cv_bcopy_handles_overlap=no - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_bcopy_handles_overlap" >&5 printf "%s\n" "$vim_cv_bcopy_handles_overlap" >&6; } @@ -16251,8 +15592,8 @@ printf %s "checking whether memcpy handles overlaps... " >&6; } if test ${vim_cv_memcpy_handles_overlap+y} then : printf %s "(cached) " >&6 -else case e in #( - e) +else $as_nop + if test "$cross_compiling" = yes then : @@ -16260,8 +15601,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_memcpy_handles_overlap'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_memcpy_handles_overlap'" >&2;} -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog _ACEOF @@ -16270,19 +15611,16 @@ then : vim_cv_memcpy_handles_overlap=yes -else case e in #( - e) +else $as_nop + vim_cv_memcpy_handles_overlap=no - ;; -esac + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ;; -esac + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_memcpy_handles_overlap" >&5 printf "%s\n" "$vim_cv_memcpy_handles_overlap" >&6; } @@ -16321,14 +15659,8 @@ then : /* 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char _Xsetlocale (void); + builtin and then its argument prototype would still apply. */ +char _Xsetlocale (); int main (void) { @@ -16343,17 +15675,15 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define X_LOCALE 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -16364,14 +15694,8 @@ printf %s "checking whether Xutf8SetWMProperties() can be used... " >&6; } /* 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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char Xutf8SetWMProperties (void); + builtin and then its argument prototype would still apply. */ +char Xutf8SetWMProperties (); int main (void) { @@ -16386,10 +15710,9 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_XUTF8SETWMPROPERTIES 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16403,22 +15726,16 @@ printf %s "checking for _xpg4_setrunelocale in -lxpg4... " >&6; } if test ${ac_cv_lib_xpg4__xpg4_setrunelocale+y} then : printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS +else $as_nop + ac_check_lib_save_LIBS=$LIBS LIBS="-lxpg4 $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. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char _xpg4_setrunelocale (void); + builtin and then its argument prototype would still apply. */ +char _xpg4_setrunelocale (); int main (void) { @@ -16430,14 +15747,12 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_xpg4__xpg4_setrunelocale=yes -else case e in #( - e) ac_cv_lib_xpg4__xpg4_setrunelocale=no ;; -esac +else $as_nop + ac_cv_lib_xpg4__xpg4_setrunelocale=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac +LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xpg4__xpg4_setrunelocale" >&5 printf "%s\n" "$ac_cv_lib_xpg4__xpg4_setrunelocale" >&6; } @@ -16487,9 +15802,8 @@ printf %s "checking --disable-nls argument... " >&6; } if test ${enable_nls+y} then : enableval=$enable_nls; -else case e in #( - e) enable_nls="yes" ;; -esac +else $as_nop + enable_nls="yes" fi @@ -16509,8 +15823,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MSGFMT+y} then : printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$MSGFMT"; then +else $as_nop + if test -n "$MSGFMT"; then ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -16532,8 +15846,7 @@ done done IFS=$as_save_IFS -fi ;; -esac +fi fi MSGFMT=$ac_cv_prog_MSGFMT if test -n "$MSGFMT"; then @@ -16567,8 +15880,8 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() works" >&5 printf "%s\n" "gettext() works" >&6; }; have_gettext="yes"; LIBS=$olibs -else case e in #( - e) LIBS="-lintl" +else $as_nop + LIBS="-lintl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -16585,15 +15898,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() works with -lintl" >&5 printf "%s\n" "gettext() works with -lintl" >&6; }; have_gettext="yes"; LIBS="$olibs -lintl" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() doesn't work" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() doesn't work" >&5 printf "%s\n" "gettext() doesn't work" >&6; }; - LIBS=$olibs ;; -esac + LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16631,12 +15942,11 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DGETTEXT 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dngettext" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dngettext" >&5 printf %s "checking for dngettext... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16656,10 +15966,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DNGETTEXT 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16682,10 +15991,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_NL_MSG_CAT_CNTR 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16732,14 +16040,13 @@ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_inc if test "x$ac_cv_header_dlfcn_h" = xyes then : DLL=dlfcn.h -else case e in #( - e) ac_fn_c_check_header_compile "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" +else $as_nop + ac_fn_c_check_header_compile "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" if test "x$ac_cv_header_dl_h" = xyes then : DLL=dl.h fi - ;; -esac + fi if test x${DLL} = xdlfcn.h; then @@ -16769,8 +16076,8 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLOPEN 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen() in -ldl" >&5 printf %s "checking for dlopen() in -ldl... " >&6; } @@ -16797,15 +16104,13 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLOPEN 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; - LIBS=$olibs ;; -esac + LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16832,8 +16137,8 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLSYM 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlsym() in -ldl" >&5 printf %s "checking for dlsym() in -ldl... " >&6; } @@ -16860,15 +16165,13 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLSYM 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; - LIBS=$olibs ;; -esac + LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16899,8 +16202,8 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SHL_LOAD 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load() in -ldld" >&5 printf %s "checking for shl_load() in -ldld... " >&6; } @@ -16927,15 +16230,13 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SHL_LOAD 1" >>confdefs.h -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; - LIBS=$olibs ;; -esac + LIBS=$olibs fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac + conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -17057,8 +16358,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# 'ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* 'ac_cv_foo' will be assigned the +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF @@ -17088,14 +16389,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # 'set' does not quote correctly, so add quotes: double-quote + # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # 'set' quotes correctly as required by POSIX, so do not add quotes. + # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -17157,12 +16458,6 @@ LTLIBOBJS=$ac_ltlibobjs -# Check whether --enable-year2038 was given. -if test ${enable_year2038+y} -then : - enableval=$enable_year2038; -fi - : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -17192,6 +16487,7 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -17200,13 +16496,12 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else case e in #( - e) case `(set -o) 2>/dev/null` in #( +else $as_nop + case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; -esac ;; esac fi @@ -17278,7 +16573,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as 'sh COMMAND' +# We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -17307,6 +16602,7 @@ as_fn_error () } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -17346,12 +16642,11 @@ then : { eval $1+=\$2 }' -else case e in #( - e) as_fn_append () +else $as_nop + as_fn_append () { eval $1=\$$1\$2 - } ;; -esac + } fi # as_fn_append # as_fn_arith ARG... @@ -17365,12 +16660,11 @@ then : { as_val=$(( $* )) }' -else case e in #( - e) as_fn_arith () +else $as_nop + as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } ;; -esac + } fi # as_fn_arith @@ -17453,9 +16747,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. - # In both cases, we have to default to 'cp -pR'. + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -17536,12 +16830,10 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -as_tr_sh="eval sed '$as_sed_sh'" # deprecated +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 @@ -17557,7 +16849,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.72. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -17588,7 +16880,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -'$as_me' instantiates files and other configuration actions +\`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -17621,10 +16913,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.72, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2023 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -17684,8 +16976,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: '$1' -Try '$0 --help' for more information.";; + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -17693,8 +16985,8 @@ Try '$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: '$1' -Try '$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -17745,7 +17037,7 @@ do "auto/config.h") CONFIG_HEADERS="$CONFIG_HEADERS auto/config.h:config.h.in" ;; "auto/config.mk") CONFIG_FILES="$CONFIG_FILES auto/config.mk:config.mk.in" ;; - *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -17764,7 +17056,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to '$tmp'. +# after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= @@ -17788,7 +17080,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with './config.status config.h'. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -17946,13 +17238,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with './config.status Makefile'. +# This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script 'defines.awk', embedded as +# Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -18062,7 +17354,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -18084,19 +17376,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain ':'. + # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is 'configure' which instantiates (i.e., don't + # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -18220,7 +17512,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when '$srcdir' = '.'. +# Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -18249,9 +17541,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/src/autocmd.c b/src/autocmd.c index 3d21a937..39216826 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -110,7 +110,6 @@ static keyvalue_T event_tab[NUM_EVENTS] = { KEYVALUE_ENTRY(EVENT_CMDLINECHANGED, "CmdlineChanged"), KEYVALUE_ENTRY(EVENT_CMDLINEENTER, "CmdlineEnter"), KEYVALUE_ENTRY(EVENT_CMDLINELEAVE, "CmdlineLeave"), - KEYVALUE_ENTRY(EVENT_CMDLINELEAVEPRE, "CmdlineLeavePre"), KEYVALUE_ENTRY(EVENT_CMDUNDEFINED, "CmdUndefined"), KEYVALUE_ENTRY(EVENT_CMDWINENTER, "CmdwinEnter"), KEYVALUE_ENTRY(EVENT_CMDWINLEAVE, "CmdwinLeave"), @@ -2135,24 +2134,16 @@ apply_autocmds_group( if (event_ignored(event, p_ei)) goto BYPASS_AU; + wininfo_T *wip; int win_ignore = FALSE; // If event is allowed in 'eventignorewin', check if curwin or all windows // into "buf" are ignoring the event. if (buf == curbuf && event_tab[event].key <= 0) win_ignore = event_ignored(event, curwin->w_p_eiw); - else if (buf != NULL && event_tab[event].key <= 0 && buf->b_nwindows > 0) - { - tabpage_T *tp; - win_T *wp; - - win_ignore = TRUE; - FOR_ALL_TAB_WINDOWS(tp, wp) - if (wp->w_buffer == buf && !event_ignored(event, wp->w_p_eiw)) - { - win_ignore = FALSE; - break; - } - } + else if (buf != NULL && event_tab[event].key <= 0) + FOR_ALL_BUF_WININFO(buf, wip) + if (wip->wi_win != NULL && wip->wi_win->w_buffer == buf) + win_ignore = event_ignored(event, wip->wi_win->w_p_eiw); if (win_ignore) goto BYPASS_AU; @@ -2262,7 +2253,6 @@ apply_autocmds_group( || event == EVENT_SYNTAX || event == EVENT_CMDLINECHANGED || event == EVENT_CMDLINEENTER - || event == EVENT_CMDLINELEAVEPRE || event == EVENT_CMDLINELEAVE || event == EVENT_CURSORMOVEDC || event == EVENT_CMDWINENTER diff --git a/src/buffer.c b/src/buffer.c index b4481b2f..68388db0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -45,7 +45,7 @@ static int buf_same_ino(buf_T *buf, stat_T *stp); static int otherfile_buf(buf_T *buf, char_u *ffname); #endif static int value_changed(char_u *str, char_u **last); -static int append_arg_number(win_T *wp, char_u *buf, size_t buflen, int add_file); +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); static int bt_nofileread(buf_T *buf); @@ -72,33 +72,6 @@ static int buf_free_count = 0; static int top_file_num = 1; // highest file number static garray_T buf_reuse = GA_EMPTY; // file numbers to recycle - static void -trigger_undo_ftplugin(buf_T *buf, win_T *win) -{ - window_layout_lock(); - buf->b_locked++; - win->w_locked = TRUE; - // b:undo_ftplugin may be set, undo it - do_cmdline_cmd((char_u*)"if exists('b:undo_ftplugin') | :legacy :exe \ - b:undo_ftplugin | endif"); - buf->b_locked--; - win->w_locked = FALSE; - window_layout_unlock(); -} - -/* - * Calculate the percentage that `part` is of the `whole`. - */ - static int -calc_percentage(long part, long whole) -{ - // With 32 bit longs and more than 21,474,836 lines multiplying by 100 - // causes an overflow, thus for large numbers divide instead. - return (part > 1000000L) - ? (int)(part / (whole / 100L)) - : (int)((part * 100L) / whole); -} - /* * Return the highest possible buffer number. */ @@ -481,7 +454,7 @@ static hashtab_T buf_hashtab; static void buf_hashtab_add(buf_T *buf) { - vim_snprintf((char *)buf->b_key, sizeof(buf->b_key), "%x", buf->b_fnum); + sprintf((char *)buf->b_key, "%x", buf->b_fnum); if (hash_add(&buf_hashtab, buf->b_key, "create buffer") == FAIL) emsg(_(e_buffer_cannot_be_registered)); } @@ -526,6 +499,12 @@ can_unload_buffer(buf_T *buf) return can_unload; } + int +buf_locked(buf_T *buf) +{ + return buf->b_locked || buf->b_locked_split; +} + /* * Close the link to a buffer. * "action" is used when there is no longer a window for the buffer. @@ -1426,19 +1405,12 @@ do_buffer_ext( if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) && !bt_terminal(buf)) return OK; #endif - if (action == DOBUF_GOTO && buf != curbuf) - { - if (!check_can_set_curbuf_forceit((flags & DOBUF_FORCEIT) != 0)) - // disallow navigating to another buffer when 'winfixbuf' is applied - return FAIL; - if (buf->b_locked_split) - { - // disallow navigating to a closing buffer, which like splitting, - // can result in more windows displaying it - emsg(_(e_cannot_switch_to_a_closing_buffer)); - return FAIL; - } - } + if ( + action == DOBUF_GOTO + && buf != curbuf + && !check_can_set_curbuf_forceit((flags & DOBUF_FORCEIT) ? TRUE : FALSE)) + // disallow navigating to another buffer when 'winfixbuf' is applied + return FAIL; if ((action == DOBUF_GOTO || action == DOBUF_SPLIT) && (buf->b_flags & BF_DUMMY)) @@ -2221,7 +2193,6 @@ buflist_new( if ((flags & BLN_CURBUF) && curbuf_reusable()) { buf = curbuf; - trigger_undo_ftplugin(buf, curwin); // 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); @@ -2495,7 +2466,6 @@ free_buf_options( clear_string_option(&buf->b_p_cinw); clear_string_option(&buf->b_p_cot); clear_string_option(&buf->b_p_cpt); - clear_string_option(&buf->b_p_ise); #ifdef FEAT_COMPL_FUNC clear_string_option(&buf->b_p_cfu); free_callback(&buf->b_cfu_cb); @@ -2956,8 +2926,6 @@ ExpandBufnames( p = home_replace_save(buf, p); else p = vim_strsave(p); - if (p == NULL) - return FAIL; if (!fuzzy) { @@ -3118,7 +3086,7 @@ buflist_findnr(int nr) if (nr == 0) nr = curwin->w_alt_fnum; - vim_snprintf((char *)key, sizeof(key), "%x", nr); + sprintf((char *)key, "%x", nr); hi = hash_find(&buf_hashtab, key); if (!HASHITEM_EMPTY(hi)) @@ -3415,8 +3383,6 @@ buflist_list(exarg_T *eap) for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) #endif { - char_u *name; - #ifdef FEAT_TERMINAL job_running = term_job_running(buf->b_term); job_none_open = term_none_open(buf->b_term); @@ -3445,9 +3411,8 @@ buflist_list(exarg_T *eap) || (vim_strchr(eap->arg, '#') && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum))) continue; - name = buf_spname(buf); - if (name != NULL) - vim_strncpy(NameBuff, name, MAXPATHL - 1); + if (buf_spname(buf) != NULL) + vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1); else home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); if (message_filtered(NameBuff)) @@ -3472,7 +3437,7 @@ buflist_list(exarg_T *eap) ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '); msg_putchar('\n'); - len = (int)vim_snprintf_safelen((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", + len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", buf->b_fnum, buf->b_p_bl ? ' ' : 'u', buf == curbuf ? '%' : @@ -3482,6 +3447,8 @@ buflist_list(exarg_T *eap) ro_char, changed_char, NameBuff); + if (len > IOSIZE - 20) + len = IOSIZE - 20; // put "line 999" in column 40 or after the file name i = 40 - vim_strsize(IObuff); @@ -3881,81 +3848,83 @@ fileinfo( int dont_truncate) { char_u *name; + int n; + char *p; char *buffer; - size_t bufferlen = 0; + size_t len; buffer = alloc(IOSIZE); if (buffer == NULL) return; if (fullname > 1) // 2 CTRL-G: include buffer number - bufferlen = vim_snprintf_safelen(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); - - buffer[bufferlen++] = '"'; + { + vim_snprintf(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); + p = buffer + STRLEN(buffer); + } + else + p = buffer; - name = buf_spname(curbuf); - if (name != NULL) - bufferlen += vim_snprintf_safelen(buffer + bufferlen, - IOSIZE - bufferlen, "%s", name); + *p++ = '"'; + if (buf_spname(curbuf) != NULL) + vim_strncpy((char_u *)p, buf_spname(curbuf), IOSIZE - (p - buffer) - 1); else { if (!fullname && curbuf->b_fname != NULL) name = curbuf->b_fname; else name = curbuf->b_ffname; - home_replace(shorthelp ? curbuf : NULL, name, (char_u *)buffer + bufferlen, - IOSIZE - (int)bufferlen, TRUE); - bufferlen += STRLEN(buffer + bufferlen); + home_replace(shorthelp ? curbuf : NULL, name, (char_u *)p, + (int)(IOSIZE - (p - buffer)), TRUE); } - bufferlen += vim_snprintf_safelen( - buffer + bufferlen, - IOSIZE - bufferlen, - "\"%s%s%s%s%s%s", - curbufIsChanged() ? (shortmess(SHM_MOD) - ? " [+]" : _(" [Modified]")) : " ", - (curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf) - ? _("[Not edited]") : "", - (curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf) - ? 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) - ? " " : ""); - + vim_snprintf_add(buffer, IOSIZE, "\"%s%s%s%s%s%s", + curbufIsChanged() ? (shortmess(SHM_MOD) + ? " [+]" : _(" [Modified]")) : " ", + (curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf) + ? _("[Not edited]") : "", + (curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf) + ? 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. + if (curwin->w_cursor.lnum > 1000000L) + n = (int)(((long)curwin->w_cursor.lnum) / + ((long)curbuf->b_ml.ml_line_count / 100L)); + else + n = (int)(((long)curwin->w_cursor.lnum * 100L) / + (long)curbuf->b_ml.ml_line_count); if (curbuf->b_ml.ml_flags & ML_EMPTY) - bufferlen += vim_snprintf_safelen(buffer + bufferlen, - IOSIZE - bufferlen, "%s", _(no_lines_msg)); + vim_snprintf_add(buffer, IOSIZE, "%s", _(no_lines_msg)); else if (p_ru) // Current line and column are already on the screen -- webb - bufferlen += vim_snprintf_safelen( - buffer + bufferlen, - IOSIZE - bufferlen, - NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--", curbuf->b_ml.ml_line_count), - (long)curbuf->b_ml.ml_line_count, - calc_percentage(curwin->w_cursor.lnum, curbuf->b_ml.ml_line_count)); + vim_snprintf_add(buffer, IOSIZE, + NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--", + curbuf->b_ml.ml_line_count), + (long)curbuf->b_ml.ml_line_count, n); else { - bufferlen += vim_snprintf_safelen( - buffer + bufferlen, - IOSIZE - bufferlen, - _("line %ld of %ld --%d%%-- col "), - (long)curwin->w_cursor.lnum, - (long)curbuf->b_ml.ml_line_count, - calc_percentage(curwin->w_cursor.lnum, curbuf->b_ml.ml_line_count)); - + vim_snprintf_add(buffer, IOSIZE, + _("line %ld of %ld --%d%%-- col "), + (long)curwin->w_cursor.lnum, + (long)curbuf->b_ml.ml_line_count, + n); validate_virtcol(); - bufferlen += col_print((char_u *)buffer + bufferlen, IOSIZE - bufferlen, + len = STRLEN(buffer); + (void)col_print((char_u *)buffer + len, IOSIZE - len, (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1); } - (void)append_arg_number(curwin, (char_u *)buffer + bufferlen, - IOSIZE - bufferlen, !shortmess(SHM_FILE)); + (void)append_arg_number(curwin, (char_u *)buffer, IOSIZE, + !shortmess(SHM_FILE)); if (dont_truncate) { - int n; - // Temporarily set msg_scroll to avoid the message being truncated. // First call msg_start() to get the message in the right place. msg_start(); @@ -3966,7 +3935,7 @@ fileinfo( } else { - char *p = 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 @@ -3987,9 +3956,9 @@ col_print( int vcol) { if (col == vcol) - return (int)vim_snprintf_safelen((char *)buf, buflen, "%d", col); + return vim_snprintf((char *)buf, buflen, "%d", col); - return (int)vim_snprintf_safelen((char *)buf, buflen, "%d-%d", col, vcol); + return vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); } static char_u *lasttitle = NULL; @@ -4001,11 +3970,14 @@ static char_u *lasticon = NULL; void maketitle(void) { + char_u *p; char_u *title_str = NULL; char_u *icon_str = NULL; + int maxlen = 0; + int len; int mustset; char_u buf[IOSIZE]; - size_t buflen = 0; + int off; if (!redrawing()) { @@ -4020,8 +3992,6 @@ maketitle(void) if (p_title) { - int maxlen = 0; - if (p_titlelen > 0) { maxlen = p_titlelen * Columns / 100; @@ -4040,90 +4010,46 @@ maketitle(void) else #endif title_str = p_titlestring; - buflen = STRLEN(title_str); } else { - char_u *p; + // format: "fname + (path) (1 of 2) - VIM" - // format: " [flags] <(path)> [argument info] <- servername>" - // example: - // buffer.c + (/home/vim/src) (1 of 2) - VIM - - // reserve some space for different parts of the title. - // use sizeof() to introduce 'size_t' so we don't have to - // cast sizes to it. -#define SPACE_FOR_FNAME (sizeof(buf) - 100) -#define SPACE_FOR_DIR (sizeof(buf) - 20) -#define SPACE_FOR_ARGNR (sizeof(buf) - 10) // at least room for " - VIM" - - // file name +#define SPACE_FOR_FNAME (IOSIZE - 100) +#define SPACE_FOR_DIR (IOSIZE - 20) +#define SPACE_FOR_ARGNR (IOSIZE - 10) // at least room for " - VIM" if (curbuf->b_fname == NULL) - buflen = vim_snprintf_safelen((char *)buf, - SPACE_FOR_FNAME, "%s", _("[No Name]")); + vim_strncpy(buf, (char_u *)_("[No Name]"), SPACE_FOR_FNAME); #ifdef FEAT_TERMINAL else if (curbuf->b_term != NULL) - buflen = vim_snprintf_safelen((char *)buf, - SPACE_FOR_FNAME, "%s", - term_get_status_text(curbuf->b_term)); + { + vim_strncpy(buf, term_get_status_text(curbuf->b_term), + SPACE_FOR_FNAME); + } #endif else { - buflen = vim_snprintf_safelen((char *)buf, - SPACE_FOR_FNAME, "%s", - ((p = transstr(gettail(curbuf->b_fname))) != NULL) - ? p - : (char_u *)""); + p = transstr(gettail(curbuf->b_fname)); + vim_strncpy(buf, p, SPACE_FOR_FNAME); vim_free(p); } - // flags #ifdef FEAT_TERMINAL if (curbuf->b_term == NULL) #endif - { switch (bufIsChanged(curbuf) + (curbuf->b_p_ro * 2) + (!curbuf->b_p_ma * 4)) { - case 1: - // file was modified - buflen += vim_snprintf_safelen( - (char *)buf + buflen, - sizeof(buf) - buflen, " +"); - break; - case 2: - // file is readonly - buflen += vim_snprintf_safelen( - (char *)buf + buflen, - sizeof(buf) - buflen, " ="); - break; - case 3: - // file was modified and is readonly - buflen += vim_snprintf_safelen( - (char *)buf + buflen, - sizeof(buf) - buflen, " =+"); - break; + case 1: STRCAT(buf, " +"); break; + case 2: STRCAT(buf, " ="); break; + case 3: STRCAT(buf, " =+"); break; case 4: - case 6: - // file cannot be modified - buflen += vim_snprintf_safelen( - (char *)buf + buflen, - sizeof(buf) - buflen, " -"); - break; + case 6: STRCAT(buf, " -"); break; case 5: - case 7: - // file cannot be modified but was modified - buflen += vim_snprintf_safelen( - (char *)buf + buflen, - sizeof(buf) - buflen, " -+"); - break; - default: - break; + case 7: STRCAT(buf, " -+"); break; } - } - // path (surrounded by '()') if (curbuf->b_fname != NULL #ifdef FEAT_TERMINAL && curbuf->b_term == NULL @@ -4131,69 +4057,61 @@ maketitle(void) ) { // Get path of file, replace home dir with ~ - buflen += vim_snprintf_safelen((char *)buf + buflen, - sizeof(buf) - buflen, " ("); - + off = (int)STRLEN(buf); + buf[off++] = ' '; + buf[off++] = '('; home_replace(curbuf, curbuf->b_ffname, - buf + buflen, (int)(SPACE_FOR_DIR - buflen), TRUE); - + buf + off, SPACE_FOR_DIR - off, TRUE); #ifdef BACKSLASH_IN_FILENAME // avoid "c:/name" to be reduced to "c" - if (SAFE_isalpha(buf[buflen]) && buf[buflen + 1] == ':') - buflen += 2; // step over "c:" + if (SAFE_isalpha(buf[off]) && buf[off + 1] == ':') + off += 2; #endif + // remove the file name + p = gettail_sep(buf + off); + if (p == buf + off) + { + // must be a help buffer + vim_strncpy(buf + off, (char_u *)_("help"), + (size_t)(SPACE_FOR_DIR - off - 1)); + } + else + *p = NUL; - // determine if we have a help or normal buffer - p = gettail_sep(buf + buflen); - if (p == buf + buflen) + // 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) { - // help buffer - buflen += vim_snprintf_safelen((char *)buf + buflen, - SPACE_FOR_DIR - buflen, "%s)", _("help")); + p = transstr(buf + off); + vim_strncpy(buf + off, p, (size_t)(SPACE_FOR_DIR - off)); + vim_free(p); } else { - // normal buffer - - // Translate unprintable chars and concatenate. Keep some - // room for the server name. When there is no room (very long - // file name) use (...). - if (buflen < SPACE_FOR_DIR) - { - // remove the file name - *p = NUL; - - buflen += vim_snprintf_safelen((char *)buf + buflen, - SPACE_FOR_DIR - buflen, "%s)", - ((p = transstr(buf + buflen)) != NULL) - ? p - : (char_u *)""); - vim_free(p); - } - else - buflen += vim_snprintf_safelen((char *)buf + buflen, - SPACE_FOR_ARGNR - buflen, "...)"); + vim_strncpy(buf + off, (char_u *)"...", + (size_t)(SPACE_FOR_ARGNR - off)); } + STRCAT(buf, ")"); } - // argument info - buflen += append_arg_number(curwin, buf + buflen, - SPACE_FOR_ARGNR - buflen, FALSE); + append_arg_number(curwin, buf, SPACE_FOR_ARGNR, FALSE); - // servername - buflen += vim_snprintf_safelen((char *)buf + buflen, - sizeof(buf) - buflen, " - %s", #if defined(FEAT_CLIENTSERVER) - (serverName != NULL) - ? serverName : + if (serverName != NULL) + { + STRCAT(buf, " - "); + vim_strcat(buf, serverName, IOSIZE); + } + else #endif - (char_u *)"VIM"); + STRCAT(buf, " - VIM"); if (maxlen > 0) { // make it shorter by removing a bit in the middle if (vim_strsize(buf) > maxlen) - trunc_string(buf, buf, maxlen, sizeof(buf)); + trunc_string(buf, buf, maxlen, IOSIZE); } } } @@ -4214,23 +4132,22 @@ maketitle(void) } else { - char_u *name; - int namelen; - - name = buf_spname(curbuf); - if (name == NULL) - name = gettail(curbuf->b_ffname); + if (buf_spname(curbuf) != NULL) + p = buf_spname(curbuf); + else // use file name only in icon + p = gettail(curbuf->b_ffname); + *icon_str = NUL; // Truncate name at 100 bytes. - namelen = (int)STRLEN(name); - if (namelen > 100) + len = (int)STRLEN(p); + if (len > 100) { - namelen -= 100; + len -= 100; if (has_mbyte) - namelen += (*mb_tail_off)(name, name + namelen) + 1; - name += namelen; + len += (*mb_tail_off)(p, p + len) + 1; + p += len; } - STRCPY(buf, name); - trans_characters(buf, sizeof(buf)); + STRCPY(icon_str, p); + trans_characters(icon_str, IOSIZE); } } @@ -4343,15 +4260,18 @@ build_stl_str_hl( { linenr_T lnum; colnr_T len; - size_t outputlen; // length of out[] used (excluding the NUL) char_u *p; char_u *s; + char_u *t; int byteval; #ifdef FEAT_EVAL int use_sandbox; + win_T *save_curwin; + buf_T *save_curbuf; int save_VIsual_active; #endif int empty_line; + colnr_T virtcol; long l; long n; int prevchar_isflag; @@ -4363,6 +4283,8 @@ build_stl_str_hl( int width; int itemcnt; int curitem; + int group_end_userhl; + int group_start_userhl; int groupdepth; #ifdef FEAT_EVAL int evaldepth; @@ -4374,6 +4296,7 @@ build_stl_str_hl( char_u opt; #define TMPLEN 70 char_u buf_tmp[TMPLEN]; + char_u win_tmp[TMPLEN]; char_u *usefmt = fmt; stl_hlrec_T *sp; int save_redraw_not_allowed = redraw_not_allowed; @@ -4496,7 +4419,7 @@ build_stl_str_hl( sizeof(int) * new_len); if (new_separator_locs == NULL) break; - stl_separator_locations = new_separator_locs; + stl_separator_locations = new_separator_locs;; stl_items_len = new_len; } @@ -4545,8 +4468,6 @@ build_stl_str_hl( } if (*s == ')') { - char_u *t; - s++; if (groupdepth < 1) continue; @@ -4558,11 +4479,9 @@ build_stl_str_hl( if (curitem > stl_groupitem[groupdepth] + 1 && stl_items[stl_groupitem[groupdepth]].stl_minwid == 0) { - int group_start_userhl = 0; - int group_end_userhl = 0; - // remove group if all items are empty and highlight group // doesn't change + group_start_userhl = group_end_userhl = 0; for (n = stl_groupitem[groupdepth] - 1; n >= 0; n--) { if (stl_items[n].stl_type == Highlight) @@ -4764,16 +4683,12 @@ build_stl_str_hl( case STL_FILEPATH: case STL_FULLPATH: case STL_FILENAME: - { - char_u *name; - fillable = FALSE; // don't change ' ' to fillchar - name = buf_spname(wp->w_buffer); - if (name != NULL) - vim_strncpy(NameBuff, name, MAXPATHL - 1); + if (buf_spname(wp->w_buffer) != NULL) + vim_strncpy(NameBuff, buf_spname(wp->w_buffer), MAXPATHL - 1); else { - char_u *t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname + t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname : wp->w_buffer->b_fname; home_replace(wp->w_buffer, t, NameBuff, MAXPATHL, TRUE); } @@ -4783,17 +4698,13 @@ build_stl_str_hl( else str = gettail(NameBuff); break; - } case STL_VIM_EXPR: // '{' { #ifdef FEAT_EVAL - char_u *block_start = s - 1; + char_u *block_start = s - 1; #endif - int reevaluate = (*s == '%'); - char_u *t; - buf_T *save_curbuf; - win_T *save_curwin; + int reevaluate = (*s == '%'); if (reevaluate) s++; @@ -4806,16 +4717,16 @@ build_stl_str_hl( break; s++; if (reevaluate) - p[-1] = NUL; // remove the % at the end of %{% expr %} + p[-1] = 0; // remove the % at the end of %{% expr %} else - *p = NUL; + *p = 0; p = t; #ifdef FEAT_EVAL vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), "%d", curbuf->b_fnum); set_internal_string_var((char_u *)"g:actual_curbuf", buf_tmp); - vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), "%d", curwin->w_id); - set_internal_string_var((char_u *)"g:actual_curwin", buf_tmp); + vim_snprintf((char *)win_tmp, sizeof(win_tmp), "%d", curwin->w_id); + set_internal_string_var((char_u *)"g:actual_curwin", win_tmp); save_curbuf = curbuf; save_curwin = curwin; @@ -4834,7 +4745,7 @@ build_stl_str_hl( do_unlet((char_u *)"g:actual_curbuf", TRUE); do_unlet((char_u *)"g:actual_curwin", TRUE); - if (str != NULL && *str != NUL) + if (str != NULL && *str != 0) { if (*skipdigits(str) == NUL) { @@ -4846,7 +4757,7 @@ build_stl_str_hl( // If the output of the expression needs to be evaluated // replace the %{} block with the result of evaluation - if (reevaluate && str != NULL && *str != NUL + if (reevaluate && str != NULL && *str != 0 && strchr((const char *)str, '%') != NULL && evaldepth < MAX_STL_EVAL_DEPTH) { @@ -4856,29 +4767,25 @@ build_stl_str_hl( 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)); - - if (new_fmt != NULL) - { - 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; - } + 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; @@ -4899,9 +4806,7 @@ build_stl_str_hl( case STL_VIRTCOL: case STL_VIRTCOL_ALT: - { - colnr_T virtcol = wp->w_virtcol + 1; - + 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 & MODE_INSERT) == 0 @@ -4909,10 +4814,10 @@ build_stl_str_hl( break; num = (long)virtcol; break; - } case STL_PERCENTAGE: - num = calc_percentage((long)wp->w_cursor.lnum, (long)wp->w_buffer->b_ml.ml_line_count); + num = (int)(((long)wp->w_cursor.lnum * 100L) / + (long)wp->w_buffer->b_ml.ml_line_count); break; case STL_ALTPERCENT: @@ -4927,8 +4832,8 @@ build_stl_str_hl( case STL_ARGLISTSTAT: fillable = FALSE; - buf_tmp[0] = NUL; - if (append_arg_number(wp, buf_tmp, sizeof(buf_tmp), FALSE) > 0) + buf_tmp[0] = 0; + if (append_arg_number(wp, buf_tmp, (int)sizeof(buf_tmp), FALSE)) str = buf_tmp; break; @@ -5002,8 +4907,6 @@ build_stl_str_hl( if (*wp->w_buffer->b_p_ft != NUL && STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 2) { - char_u *t; - vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), ",%s", wp->w_buffer->b_p_ft); for (t = buf_tmp; *t != 0; t++) @@ -5046,30 +4949,26 @@ build_stl_str_hl( break; case STL_HIGHLIGHT: + t = s; + while (*s != '#' && *s != NUL) + ++s; + if (*s == '#') { - char_u *t = s; - - while (*s != '#' && *s != NUL) - ++s; - if (*s == '#') - { - 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) - ++s; - continue; + 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) + ++s; + continue; } stl_items[curitem].stl_start = p; stl_items[curitem].stl_type = Normal; if (str != NULL && *str) { - char_u *t = str; - + t = str; if (itemisflag) { if ((t[0] && t[1]) @@ -5124,13 +5023,13 @@ build_stl_str_hl( } else if (num >= 0) { - int nbase = (base == 'D' ? 10 : (base == 'O' ? 8 : 16)); - char_u nstr[20]; - char_u *t = nstr; + int nbase = (base == 'D' ? 10 : (base == 'O' ? 8 : 16)); + char_u nstr[20]; if (p + 20 >= out + outlen) break; // not sufficient space prevchar_isitem = TRUE; + t = nstr; if (opt == STL_VIRTCOL_ALT) { *t++ = '-'; @@ -5141,13 +5040,12 @@ build_stl_str_hl( *t++ = '0'; *t++ = '*'; *t++ = nbase == 16 ? base : (char_u)(nbase == 8 ? 'o' : 'd'); - *t = NUL; + *t = 0; for (n = num, l = 1; n >= nbase; n /= nbase) l++; if (opt == STL_VIRTCOL_ALT) l++; - if (l > maxwid) { l += 2; @@ -5157,13 +5055,14 @@ build_stl_str_hl( *t++ = '>'; *t++ = '%'; *t = t[-3]; - *++t = NUL; - p += vim_snprintf_safelen((char *)p, outlen - (p - out), - (char *)nstr, 0, num, n); + *++t = 0; + vim_snprintf((char *)p, outlen - (p - out), (char *)nstr, + 0, num, n); } else - p += vim_snprintf_safelen((char *)p, outlen - (p - out), - (char *)nstr, minwid, num); + vim_snprintf((char *)p, outlen - (p - out), (char *)nstr, + minwid, num); + p += STRLEN(p); } else stl_items[curitem].stl_type = Empty; @@ -5176,7 +5075,6 @@ build_stl_str_hl( curitem++; } *p = NUL; - outputlen = (size_t)(p - out); itemcnt = curitem; #ifdef FEAT_EVAL @@ -5233,12 +5131,10 @@ build_stl_str_hl( break; itemcnt = l; *s++ = '>'; - *s = NUL; + *s = 0; } else { - char_u *end = out + outputlen; - if (has_mbyte) { n = 0; @@ -5251,8 +5147,7 @@ build_stl_str_hl( else n = width - maxwidth + 1; p = s + n; - mch_memmove(s + 1, p, (size_t)(end - p) + 1); // +1 for NUL - end -= (size_t)(p - (s + 1)); + STRMOVE(s + 1, p); *s = '<'; --n; // count the '<' @@ -5267,15 +5162,14 @@ build_stl_str_hl( // Fill up for half a double-wide character. while (++width < maxwidth) { - s = end; + s = s + STRLEN(s); MB_CHAR2BYTES(fillchar, s); *s = NUL; - end = s; } } width = maxwidth; } - else if (width < maxwidth && outputlen + maxwidth - width + 1 < outlen) + else if (width < maxwidth && STRLEN(out) + maxwidth - width + 1 < outlen) { // Find how many separators there are, which we will use when // figuring out how many groups there are. @@ -5376,7 +5270,7 @@ build_stl_str_hl( #endif // FEAT_STL_OPT /* - * Get relative cursor position in window into "buf[]", in the localized + * Get relative cursor position in window into "buf[buflen]", in the localized * percentage form like %99, 99%; using "Top", "Bot" or "All" when appropriate. */ int @@ -5387,6 +5281,7 @@ get_rel_pos( { long above; // number of lines above window long below; // number of lines below window + int len; if (buflen < 3) // need at least 3 chars for writing return 0; @@ -5400,31 +5295,42 @@ get_rel_pos( #endif below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; if (below <= 0) - return (int)vim_snprintf_safelen((char *)buf, buflen, - "%s", (above == 0) ? _("All") : _("Bot")); + len = vim_snprintf((char *)buf, buflen, "%s", (above == 0) ? _("All") : _("Bot")); + else if (above <= 0) + len = vim_snprintf((char *)buf, buflen, "%s", _("Top")); + else + { + int perc = (above > 1000000L) + ? (int)(above / ((above + below) / 100L)) + : (int)(above * 100L / (above + below)); - if (above <= 0) - return (int)vim_snprintf_safelen((char *)buf, buflen, - "%s", _("Top")); + // localized percentage value + len = vim_snprintf((char *)buf, buflen, _("%s%d%%"), (perc < 10) ? " " : "", perc); + } + if (len < 0) + { + buf[0] = NUL; + len = 0; + } + else if (len > buflen - 1) + len = buflen - 1; - // localized percentage value - return (int)vim_snprintf_safelen((char *)buf, buflen, - _("%2d%%"), calc_percentage(above, above + below)); + return len; } /* - * Append (file 2 of 8) to "buf[]", if editing more than one file. - * Return the number of characters appended. + * Append (file 2 of 8) to "buf[buflen]", if editing more than one file. + * Return TRUE if it was appended. */ static int append_arg_number( win_T *wp, char_u *buf, - size_t buflen, + int buflen, int add_file) // Add "file" before the arg number { if (ARGCOUNT <= 1) // nothing to do - return 0; + return FALSE; char *msg; switch ((wp->w_arg_idx_invalid ? 1 : 0) + (add_file ? 2 : 0)) @@ -5435,8 +5341,10 @@ append_arg_number( case 3: msg = _(" (file (%d) of %d)"); break; } - return (int)vim_snprintf_safelen((char *)buf, buflen, msg, + char_u *p = buf + STRLEN(buf); // go to the end of the buffer + vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), msg, wp->w_arg_idx + 1, ARGCOUNT); + return TRUE; } /* @@ -5776,16 +5684,17 @@ chk_modeline( int flags) // Same as for do_modelines(). { char_u *s; - char_u *line_end; // point to the end of the line char_u *e; + char_u *linecopy; // local copy of any modeline found int prev; + int vers; + int end; int retval = OK; + sctx_T save_current_sctx; ESTACK_CHECK_DECLARATION; prev = -1; - s = ml_get(lnum); - line_end = s + ml_get_len(lnum); - for (; *s != NUL; ++s) + for (s = ml_get(lnum); *s != NUL; ++s) { if (prev == -1 || vim_isspace(prev)) { @@ -5795,8 +5704,6 @@ chk_modeline( // Accept both "vim" and "Vim". if ((s[0] == 'v' || s[0] == 'V') && s[1] == 'i' && s[2] == 'm') { - int vers; - if (s[3] == '<' || s[3] == '=' || s[3] == '>') e = s + 4; else @@ -5818,23 +5725,14 @@ chk_modeline( if (*s) { - size_t len; - char_u *linecopy; // local copy of any modeline found - int end; - do // skip over "ex:", "vi:" or "vim:" ++s; while (s[-1] != ':'); - len = (size_t)(line_end - s); // remember the line length - // so we can restore 'line_end' - // after the copy - s = linecopy = vim_strnsave(s, len); // copy the line, it will change + s = linecopy = vim_strsave(s); // copy the line, it will change if (linecopy == NULL) return FAIL; - line_end = s + len; // restore 'line_end' - // prepare for emsg() estack_push(ETYPE_MODELINE, (char_u *)"modelines", lnum); ESTACK_CHECK_SETUP; @@ -5852,10 +5750,7 @@ chk_modeline( */ for (e = s; *e != ':' && *e != NUL; ++e) if (e[0] == '\\' && e[1] == ':') - { - mch_memmove(e, e + 1, (size_t)(line_end - (e + 1)) + 1); // +1 for NUL - --line_end; - } + STRMOVE(e, e + 1); if (*e == NUL) end = TRUE; @@ -5872,15 +5767,15 @@ chk_modeline( if (*e != ':') // no terminating ':'? break; end = TRUE; - s += (*(s + 2) == ' ') ? 3 : 4; + s = vim_strchr(s, ' ') + 1; } *e = NUL; // truncate the set command if (*s != NUL) // skip over an empty "::" { int secure_save = secure; - sctx_T save_current_sctx = current_sctx; + save_current_sctx = current_sctx; current_sctx.sc_version = 1; #ifdef FEAT_EVAL current_sctx.sc_sid = SID_MODELINE; @@ -5898,8 +5793,7 @@ chk_modeline( if (retval == FAIL) // stop if error found break; } - s = (e == line_end) ? e : e + 1; // advance to next part - // careful not to go off the end + s = e + 1; // advance to next part } ESTACK_CHECK_NOW; diff --git a/src/change.c b/src/change.c index c48d2549..05a6247f 100644 --- a/src/change.c +++ b/src/change.c @@ -476,10 +476,7 @@ changed_common( #endif #ifdef FEAT_DIFF if (curwin->w_p_diff && diff_internal()) - { curtab->tp_diff_update = TRUE; - diff_update_line(lnum); - } #endif // set the '. mark @@ -1203,8 +1200,8 @@ ins_str(char_u *s, size_t slen) mch_memmove(newp + col, s, slen); mch_memmove(newp + col + slen, oldp + col, (size_t)(oldlen - col + 1)); ml_replace(lnum, newp, FALSE); - inserted_bytes(lnum, col, (int)slen); - curwin->w_cursor.col += (colnr_T)slen; + inserted_bytes(lnum, col, slen); + curwin->w_cursor.col += slen; } /* diff --git a/src/channel.c b/src/channel.c index a369c716..69bbff24 100644 --- a/src/channel.c +++ b/src/channel.c @@ -5004,7 +5004,7 @@ set_ref_in_channel(int copyID) { tv.v_type = VAR_CHANNEL; tv.vval.v_channel = channel; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); } return abort; } diff --git a/src/cindent.c b/src/cindent.c index e1f74467..2414b3fa 100644 --- a/src/cindent.c +++ b/src/cindent.c @@ -406,10 +406,10 @@ cin_islabel_skip(char_u **s) while (vim_isIDc(**s)) { - if (has_mbyte) - (*s) += (*mb_ptr2len)(*s); - else - (*s)++; + if (has_mbyte) + (*s) += (*mb_ptr2len)(*s); + else + (*s)++; } *s = cin_skipcomment(*s); @@ -590,7 +590,7 @@ cin_isdefault(char_u *s) /* * Recognize a switch label: "case .*:" or "default:". */ - static int + static int cin_iscase( char_u *s, int strict) // Allow relaxed check of case statement for JS @@ -1296,7 +1296,7 @@ cin_isfuncdecl( static int cin_isif(char_u *p) { - return (STRNCMP(p, "if", 2) == 0 && !vim_isIDc(p[2])); + return (STRNCMP(p, "if", 2) == 0 && !vim_isIDc(p[2])); } static int @@ -2415,15 +2415,15 @@ get_c_indent(void) && trypos->lnum == our_paren_pos.lnum && trypos->col == our_paren_pos.col) { - amount = get_indent_lnum(lnum); // XXX + amount = get_indent_lnum(lnum); // XXX - if (theline[0] == ')') - { - if (our_paren_pos.lnum != lnum - && cur_amount > amount) - cur_amount = amount; - amount = -1; - } + if (theline[0] == ')') + { + if (our_paren_pos.lnum != lnum + && cur_amount > amount) + cur_amount = amount; + amount = -1; + } break; } } @@ -2447,8 +2447,7 @@ get_c_indent(void) char_u *line; trypos = &our_paren_pos; - do - { + do { outermost = *trypos; curwin->w_cursor.lnum = outermost.lnum; curwin->w_cursor.col = outermost.col; @@ -3962,7 +3961,7 @@ in_cinkeys( { case '*': try_match = (*look == '*'); break; case '!': try_match = (*look == '!'); break; - default: try_match = (*look != '*'); break; + default: try_match = (*look != '*'); break; } if (*look == '*' || *look == '!') ++look; diff --git a/src/clipboard.c b/src/clipboard.c index fb967dc4..75e0f4f3 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -2221,7 +2221,7 @@ adjust_clip_reg(int *rp) && clip_plus.available) ? '+' : '*'; } if ((!clip_star.available && *rp == '*') || - (!clip_plus.available && *rp == '+')) + (!clip_plus.available && *rp == '+')) { msg_warn_missing_clipboard(); *rp = 0; diff --git a/src/cmdexpand.c b/src/cmdexpand.c index f7d3ac8c..85422b80 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -32,8 +32,6 @@ static int compl_match_arraysize; // First column in cmdline of the matched item for completion. static int compl_startcol; static int compl_selected; -// cmdline before expansion -static char_u *cmdline_orig = NULL; #define SHOW_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m]) @@ -53,7 +51,6 @@ cmdline_fuzzy_completion_supported(expand_T *xp) && xp->xp_context != EXPAND_FILES && xp->xp_context != EXPAND_FILES_IN_PATH && xp->xp_context != EXPAND_FILETYPE - && xp->xp_context != EXPAND_FILETYPECMD && xp->xp_context != EXPAND_FINDFUNC && xp->xp_context != EXPAND_HELP && xp->xp_context != EXPAND_KEYMAP @@ -383,7 +380,7 @@ cmdline_pum_create( } // Compute the popup menu starting column - compl_startcol = ccline == NULL ? 0 : vim_strsize(ccline->cmdbuff) + 1; + compl_startcol = vim_strsize(ccline->cmdbuff) + 1; columns = vim_strsize(xp->xp_pattern); if (showtail) { @@ -435,7 +432,6 @@ cmdline_pum_remove(cmdline_info_T *cclp UNUSED) pum_undisplay(); VIM_CLEAR(compl_match_array); - compl_match_arraysize = 0; p_lz = FALSE; // avoid the popup menu hanging around update_screen(0); p_lz = save_p_lz; @@ -1132,12 +1128,6 @@ ExpandCleanup(expand_T *xp) VIM_CLEAR(xp->xp_orig); } - void -clear_cmdline_orig(void) -{ - VIM_CLEAR(cmdline_orig); -} - /* * Display one line of completion matches. Multiple matches are displayed in * each line (used by wildmode=list and CTRL-D) @@ -1248,13 +1238,6 @@ showmatches(expand_T *xp, int wildmenu UNUSED) int attr; int showtail; - // Save cmdline before expansion - if (ccline->cmdbuff != NULL) - { - vim_free(cmdline_orig); - cmdline_orig = vim_strnsave(ccline->cmdbuff, ccline->cmdlen); - } - if (xp->xp_numfiles == -1) { set_expand_context(xp); @@ -2059,18 +2042,6 @@ set_context_in_lang_cmd(expand_T *xp, char_u *arg) } #endif -static enum -{ - EXP_FILETYPECMD_ALL, // expand all :filetype values - EXP_FILETYPECMD_PLUGIN, // expand plugin on off - EXP_FILETYPECMD_INDENT, // expand indent on off - EXP_FILETYPECMD_ONOFF, // expand on off -} filetype_expand_what; - -#define EXPAND_FILETYPECMD_PLUGIN 0x01 -#define EXPAND_FILETYPECMD_INDENT 0x02 -#define EXPAND_FILETYPECMD_ONOFF 0x04 - #ifdef FEAT_EVAL static enum { @@ -2156,53 +2127,6 @@ set_context_in_scriptnames_cmd(expand_T *xp, char_u *arg) } #endif -/* - * Set the completion context for the :filetype command. Always returns NULL. - */ - static char_u * -set_context_in_filetype_cmd(expand_T *xp, char_u *arg) -{ - char_u *p; - int val = 0; - - xp->xp_context = EXPAND_FILETYPECMD; - xp->xp_pattern = arg; - filetype_expand_what = EXP_FILETYPECMD_ALL; - - p = skipwhite(arg); - if (*p == NUL) - return NULL; - - for (;;) - { - if (STRNCMP(p, "plugin", 6) == 0) - { - val |= EXPAND_FILETYPECMD_PLUGIN; - p = skipwhite(p + 6); - continue; - } - if (STRNCMP(p, "indent", 6) == 0) - { - val |= EXPAND_FILETYPECMD_INDENT; - p = skipwhite(p + 6); - continue; - } - break; - } - - if ((val & EXPAND_FILETYPECMD_PLUGIN) && (val & EXPAND_FILETYPECMD_INDENT)) - filetype_expand_what = EXP_FILETYPECMD_ONOFF; - else if ((val & EXPAND_FILETYPECMD_PLUGIN)) - filetype_expand_what = EXP_FILETYPECMD_INDENT; - else if ((val & EXPAND_FILETYPECMD_INDENT)) - filetype_expand_what = EXP_FILETYPECMD_PLUGIN; - - xp->xp_pattern = p; - - return NULL; -} - - /* * 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'. @@ -2575,8 +2499,6 @@ set_context_by_cmdname( case CMD_scriptnames: return set_context_in_scriptnames_cmd(xp, arg); #endif - case CMD_filetype: - return set_context_in_filetype_cmd(xp, arg); default: break; @@ -3011,29 +2933,6 @@ get_behave_arg(expand_T *xp UNUSED, int idx) return NULL; } -/* - * Function given to ExpandGeneric() to obtain the possible arguments of the - * ":filetype {plugin,indent}" command. - */ - static char_u * -get_filetypecmd_arg(expand_T *xp UNUSED, int idx) -{ - char *opts_all[] = {"indent", "plugin", "on", "off"}; - char *opts_plugin[] = {"plugin", "on", "off"}; - char *opts_indent[] = {"indent", "on", "off"}; - char *opts_onoff[] = {"on", "off"}; - - if (filetype_expand_what == EXP_FILETYPECMD_ALL && idx < 4) - return (char_u *)opts_all[idx]; - if (filetype_expand_what == EXP_FILETYPECMD_PLUGIN && idx < 3) - return (char_u *)opts_plugin[idx]; - if (filetype_expand_what == EXP_FILETYPECMD_INDENT && idx < 3) - return (char_u *)opts_indent[idx]; - if (filetype_expand_what == EXP_FILETYPECMD_ONOFF && idx < 2) - return (char_u *)opts_onoff[idx]; - return NULL; -} - #ifdef FEAT_EVAL /* * Function given to ExpandGeneric() to obtain the possible arguments of the @@ -3125,7 +3024,6 @@ ExpandOther( { {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, - {EXPAND_FILETYPECMD, get_filetypecmd_arg, TRUE, TRUE}, {EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE}, {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE}, {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, @@ -4381,8 +4279,6 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) &context); xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); } - if (xpc.xp_context == EXPAND_FILETYPECMD) - filetype_expand_what = EXP_FILETYPECMD_ALL; } if (cmdline_fuzzy_completion_supported(&xpc)) @@ -4403,36 +4299,4 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) vim_free(pat); ExpandCleanup(&xpc); } - -/* - * "cmdcomplete_info()" function - */ - void -f_cmdcomplete_info(typval_T *argvars UNUSED, typval_T *rettv) -{ - cmdline_info_T *ccline = get_cmdline_info(); - dict_T *retdict; - list_T *li; - int idx; - int ret = OK; - - if (rettv_dict_alloc(rettv) == FAIL || ccline == NULL - || ccline->xpc == NULL || ccline->xpc->xp_files == NULL) - return; - retdict = rettv->vval.v_dict; - ret = dict_add_string(retdict, "cmdline_orig", cmdline_orig); - if (ret == OK) - ret = dict_add_number(retdict, "pum_visible", pum_visible()); - if (ret == OK) - ret = dict_add_number(retdict, "selected", ccline->xpc->xp_selected); - if (ret == OK) - { - li = list_alloc(); - if (li == NULL) - return; - ret = dict_add_list(retdict, "matches", li); - for (idx = 0; ret == OK && idx < ccline->xpc->xp_numfiles; idx++) - list_append_string(li, ccline->xpc->xp_files[idx], -1); - } -} #endif // FEAT_EVAL diff --git a/src/dict.c b/src/dict.c index d43ca863..7975904d 100644 --- a/src/dict.c +++ b/src/dict.c @@ -1554,7 +1554,7 @@ dict2list(typval_T *argvars, typval_T *rettv, dict2list_T what) return; if ((what == DICT2LIST_ITEMS - ? check_for_string_list_tuple_or_dict_arg(argvars, 0) + ? check_for_string_or_list_or_dict_arg(argvars, 0) : check_for_dict_arg(argvars, 0)) == FAIL) return; @@ -1617,8 +1617,6 @@ f_items(typval_T *argvars, typval_T *rettv) string2items(argvars, rettv); else if (argvars[0].v_type == VAR_LIST) list2items(argvars, rettv); - else if (argvars[0].v_type == VAR_TUPLE) - tuple2items(argvars, rettv); else dict2list(argvars, rettv, DICT2LIST_ITEMS); } diff --git a/src/diff.c b/src/diff.c index ec108e98..6e5097e4 100644 --- a/src/diff.c +++ b/src/diff.c @@ -38,13 +38,7 @@ static int diff_need_update = FALSE; // ex_diffupdate needs to be called #define DIFF_CLOSE_OFF 0x400 // diffoff when closing window #define DIFF_FOLLOWWRAP 0x800 // follow the wrap option #define DIFF_LINEMATCH 0x1000 // match most similar lines within diff -#define DIFF_INLINE_NONE 0x2000 // no inline highlight -#define DIFF_INLINE_SIMPLE 0x4000 // inline highlight with simple algorithm -#define DIFF_INLINE_CHAR 0x8000 // inline highlight with character diff -#define DIFF_INLINE_WORD 0x10000 // inline highlight with word diff #define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL) -#define ALL_INLINE (DIFF_INLINE_NONE | DIFF_INLINE_SIMPLE | DIFF_INLINE_CHAR | DIFF_INLINE_WORD) -#define ALL_INLINE_DIFF (DIFF_INLINE_CHAR | DIFF_INLINE_WORD) static int diff_flags = DIFF_INTERNAL | DIFF_FILLER | DIFF_CLOSE_OFF; static long diff_algorithm = 0; @@ -117,13 +111,6 @@ static int xdiff_out_unified(void *priv, mmbuffer_t *mb, int nbuf); #define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \ for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next) - static void -clear_diffblock(diff_T *dp) -{ - ga_clear(&dp->df_changes); - vim_free(dp); -} - /* * Called when deleting or unloading a buffer: No longer make a diff with it. */ @@ -524,7 +511,7 @@ diff_mark_adjust_tp( if (tp->tp_diffbuf[i] != NULL) dprev->df_count[i] += dp->df_count[i]; dprev->df_next = dp->df_next; - clear_diffblock(dp); + vim_free(dp); dp = dprev->df_next; } else @@ -546,7 +533,7 @@ diff_mark_adjust_tp( if (i == DB_COUNT) { dnext = dp->df_next; - clear_diffblock(dp); + vim_free(dp); dp = dnext; if (dprev == NULL) tp->tp_first_diff = dnext; @@ -582,7 +569,7 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) { diff_T *dnew; - dnew = ALLOC_CLEAR_ONE(diff_T); + dnew = ALLOC_ONE(diff_T); if (dnew == NULL) return NULL; @@ -592,9 +579,6 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) tp->tp_first_diff = dnew; else dprev->df_next = dnew; - - dnew->has_changes = FALSE; - ga_init2(&dnew->df_changes, sizeof(diffline_change_T), 20); return dnew; } @@ -821,7 +805,6 @@ diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) { int c; int orig_len; - int c_len = 1; char_u cbuf[MB_MAXBYTES + 1]; if (*s == NL) @@ -830,24 +813,14 @@ diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) { // xdiff doesn't support ignoring case, fold-case the text. c = PTR2CHAR(s); - c_len = MB_CHAR2LEN(c); c = MB_CASEFOLD(c); } orig_len = mb_ptr2len(s); - if (mb_char2bytes(c, cbuf) != c_len) - // TODO: handle byte length difference. - // One example is â„« (3 bytes) and Ã¥ (2 bytes). + if (mb_char2bytes(c, cbuf) != orig_len) + // TODO: handle byte length difference mch_memmove(ptr + len, s, orig_len); else - { - mch_memmove(ptr + len, cbuf, c_len); - if (orig_len > c_len) - { - // Copy remaining composing characters - mch_memmove(ptr + len + c_len, s + c_len, - orig_len - c_len); - } - } + mch_memmove(ptr + len, cbuf, orig_len); s += orig_len; len += orig_len; @@ -1690,7 +1663,7 @@ diff_read( diffio_T *dio) // diff output { FILE *fd = NULL; - int line_hunk_idx = 0; // line or hunk index + int line_idx = 0; diff_T *dprev = NULL; diff_T *dp = curtab->tp_first_diff; diff_T *dn, *dpl; @@ -1737,17 +1710,17 @@ diff_read( { if (dio->dio_internal) { - if (line_hunk_idx >= dout->dout_ga.ga_len) - break; // did last hunk - hunk = ((diffhunk_T **)dout->dout_ga.ga_data)[line_hunk_idx++]; + if (line_idx >= dout->dout_ga.ga_len) + break; // did last line + hunk = ((diffhunk_T **)dout->dout_ga.ga_data)[line_idx++]; } else { if (fd == NULL) { - if (line_hunk_idx >= dout->dout_ga.ga_len) + if (line_idx >= dout->dout_ga.ga_len) break; // did last line - line = ((char_u **)dout->dout_ga.ga_data)[line_hunk_idx++]; + line = ((char_u **)dout->dout_ga.ga_data)[line_idx++]; } else { @@ -1869,6 +1842,10 @@ diff_read( - (dp->df_lnum[idx_new] + dp->df_count[idx_new]); if (off > 0) dp->df_count[idx_new] += off; + if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1) + > curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count) + dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count + - dp->df_lnum[idx_new] + 1; } // Adjust the size of the block to include all the lines to the @@ -1887,6 +1864,10 @@ diff_read( // overlap later. dp->df_count[idx_new] += -off; } + if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1) + > curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count) + dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count + - dp->df_lnum[idx_new] + 1; off = 0; } for (i = idx_orig; i < idx_new; ++i) @@ -1900,7 +1881,7 @@ diff_read( while (dn != dp->df_next) { dpl = dn->df_next; - clear_diffblock(dn); + vim_free(dn); dn = dpl; } } @@ -1976,7 +1957,7 @@ diff_clear(tabpage_T *tp) for (p = tp->tp_first_diff; p != NULL; p = next_p) { next_p = p->df_next; - clear_diffblock(p); + vim_free(p); } tp->tp_first_diff = NULL; } @@ -2837,37 +2818,6 @@ diffopt_changed(void) else return FAIL; } - else if (STRNCMP(p, "inline:", 7) == 0) - { - // Note: Keep this in sync with p_dip_inline_values. - p += 7; - if (STRNCMP(p, "none", 4) == 0) - { - p += 4; - diff_flags_new &= ~(ALL_INLINE); - diff_flags_new |= DIFF_INLINE_NONE; - } - else if (STRNCMP(p, "simple", 6) == 0) - { - p += 6; - diff_flags_new &= ~(ALL_INLINE); - diff_flags_new |= DIFF_INLINE_SIMPLE; - } - else if (STRNCMP(p, "char", 4) == 0) - { - p += 4; - diff_flags_new &= ~(ALL_INLINE); - diff_flags_new |= DIFF_INLINE_CHAR; - } - else if (STRNCMP(p, "word", 4) == 0) - { - p += 4; - diff_flags_new &= ~(ALL_INLINE); - diff_flags_new |= DIFF_INLINE_WORD; - } - else - return FAIL; - } else if (STRNCMP(p, "linematch:", 10) == 0 && VIM_ISDIGIT(p[10])) { p += 10; @@ -2936,97 +2886,13 @@ diffopt_closeoff(void) } /* - * Called when a line has been updated. Used for updating inline diff in Insert - * mode without waiting for global diff update later. - */ - void -diff_update_line(linenr_T lnum) -{ - int idx; - diff_T *dp; - - if (!(diff_flags & ALL_INLINE_DIFF)) - // We only care if we are doing inline-diff where we cache the diff results - return; - - idx = diff_buf_idx(curbuf); - if (idx == DB_COUNT) - return; - FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) - if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) - break; - - // clear the inline change cache as it's invalid - if (dp != NULL) - { - dp->has_changes = FALSE; - dp->df_changes.ga_len = 0; - } -} - -static diffline_change_T simple_diffline_change; // used for simple inline diff algorithm - -/* - * Parse a diffline struct and returns the [start,end] byte offsets - * - * Returns TRUE if this change was added, no other buffer has it. - */ - int -diff_change_parse( - diffline_T *diffline, - diffline_change_T *change, - int *change_start, - int *change_end) -{ - if (change->dc_start_lnum_off[diffline->bufidx] < diffline->lineoff) - *change_start = 0; - else - *change_start = change->dc_start[diffline->bufidx]; - if (change->dc_end_lnum_off[diffline->bufidx] > diffline->lineoff) - *change_end = INT_MAX; - else - *change_end = change->dc_end[diffline->bufidx]; - - if (change == &simple_diffline_change) - { - // This is what we returned from simple inline diff. We always consider - // the range to be changed, rather than added for now. - return FALSE; - } - - // Find out whether this is an addition. Note that for multi buffer diff, - // to tell whether lines are additions we check whether all the other diff - // lines are identical (in diff_check_with_linestatus). If so, we mark them - // as add. We don't do that for inline diff here for simplicity. - for (int i = 0; i < DB_COUNT; i++) - { - if (i == diffline->bufidx) - continue; - if (change->dc_start[i] != change->dc_end[i] - || change->dc_end_lnum_off[i] != change->dc_start_lnum_off[i]) - { - return FALSE; - } - } - return TRUE; -} - -/* - * Find the difference within a changed line and returns [startp,endp] byte - * positions. Performs a simple algorithm by finding a single range in the - * middle. - * - * If diffopt has DIFF_INLINE_NONE set, then this will only calculate the return - * value (added or changed), but startp/endp will not be calculated. - * + * Find the difference within a changed line. * Returns TRUE if the line was added, no other buffer has it. */ - static int -diff_find_change_simple( + int +diff_find_change( win_T *wp, linenr_T lnum, - diff_T *dp, - int idx, int *startp, // first char of the change int *endp) // last char of the change { @@ -3035,22 +2901,40 @@ diff_find_change_simple( int i; int si_org, si_new; int ei_org, ei_new; + diff_T *dp; + int idx; int off; int added = TRUE; char_u *p1, *p2; int l; - if (diff_flags & DIFF_INLINE_NONE) + // 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 { - // We only care about the return value, not the actual string comparisons. - line_org = NULL; + vim_free(line_org); + return FALSE; } - else + + // 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->is_linematched) { - // 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; + while (dp && dp->df_next + && lnum == dp->df_count[idx] + dp->df_lnum[idx] + && dp->df_next->df_lnum[idx] == lnum) + dp = dp->df_next; + } + if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL) + { + vim_free(line_org); + return FALSE; } off = lnum - dp->df_lnum[idx]; @@ -3062,9 +2946,6 @@ diff_find_change_simple( if (off >= dp->df_count[i]) continue; added = FALSE; - if (diff_flags & DIFF_INLINE_NONE) - break; // early terminate as we only care about the return value - line_new = ml_get_buf(curtab->tp_diffbuf[i], dp->df_lnum[i] + off, FALSE); @@ -3144,534 +3025,6 @@ diff_find_change_simple( return added; } -/* - * Mapping used for mapping from temporary mmfile created for inline diff back - * to original buffer's line/col. - */ -typedef struct -{ - long byte_start; - long num_bytes; - int lineoff; -} linemap_entry_T; - -/* - * Refine inline character-wise diff blocks to create a more human readable - * highlight. Otherwise a naive diff under existing algorithms tends to create - * a messy output with lots of small gaps. - * It does this by merging adjacent long diff blocks if they are only separated - * by a couple characters. - * These are done by heuristics and can be further tuned. - */ - static void -diff_refine_inline_char_highlight(diff_T *dp_orig, garray_T *linemap, int idx1) -{ - // Perform multiple passes so that newly merged blocks will now be long - // enough which may cause other previously unmerged gaps to be merged as - // well. - int pass = 1; - do - { - int has_unmerged_gaps = FALSE; - int has_merged_gaps = FALSE; - diff_T *dp = dp_orig; - while (dp!= NULL && dp->df_next != NULL) - { - // Only use first buffer to calculate the gap because the gap is - // unchanged text, which would be the same in all buffers. - if (dp->df_lnum[idx1] + dp->df_count[idx1] - 1 >= linemap[idx1].ga_len - || dp->df_next->df_lnum[idx1] - 1 >= linemap[idx1].ga_len) - { - dp = dp->df_next; - continue; - } - - // If the gap occurs over different lines, don't consider it - linemap_entry_T *entry1 = &((linemap_entry_T*)linemap[idx1].ga_data)[dp->df_lnum[idx1] + dp->df_count[idx1] - 1]; - linemap_entry_T *entry2 = &((linemap_entry_T*)linemap[idx1].ga_data)[dp->df_next->df_lnum[idx1] - 1]; - if (entry1->lineoff != entry2->lineoff) - { - dp = dp->df_next; - continue; - } - - linenr_T gap = dp->df_next->df_lnum[idx1] - (dp->df_lnum[idx1] + dp->df_count[idx1]); - if (gap <= 3) - { - linenr_T max_df_count = 0; - for (int i = 0; i < DB_COUNT; i++) - max_df_count = MAX(max_df_count, dp->df_count[i] + dp->df_next->df_count[i]); - - if (max_df_count >= gap * 4) - { - // Merge current block with the next one. Don't advance the - // pointer so we try the same merged block against the next - // one. - for (int i = 0; i < DB_COUNT; i++) - { - dp->df_count[i] = dp->df_next->df_lnum[i] - + dp->df_next->df_count[i] - dp->df_lnum[i]; - } - diff_T *dp_next = dp->df_next; - dp->df_next = dp_next->df_next; - clear_diffblock(dp_next); - has_merged_gaps = TRUE; - continue; - } - else - has_unmerged_gaps = TRUE; - } - dp = dp->df_next; - } - if (!has_unmerged_gaps || !has_merged_gaps) - break; - } while (pass++ < 4); // use limited number of passes to avoid excessive looping -} - -/* - * Find the inline difference within a diff block among different buffers. Do - * this by splitting each block's content into characters or words, and then - * use internal xdiff to calculate the per-character/word diff. The result is - * stored in dp instead of returned by the function. - */ - static void -diff_find_change_inline_diff( - diff_T *dp) -{ - diffio_T dio; - garray_T linemap[DB_COUNT]; - garray_T file1_str; - garray_T file2_str; - int file1_idx = -1; - - long save_diff_algorithm = diff_algorithm; - - CLEAR_FIELD(dio); - ga_init2(&dio.dio_diff.dout_ga, sizeof(char *), 1000); - - // inline diff only supports internal algo - dio.dio_internal = TRUE; - - // always use indent-heuristics to slide diff splits along - // whitespace - diff_algorithm |= XDF_INDENT_HEURISTIC; - - // diff_read() has an implicit dependency on curtab->tp_first_diff - diff_T *orig_diff = curtab->tp_first_diff; - curtab->tp_first_diff = NULL; - - // Buffers to populate mmfile 1/2 that would be passed to xdiff as memory - // files. Use a grow array as it is not obvious how much exact space we - // need. - ga_init2(&file1_str, 1, 1024); - ga_init2(&file2_str, 1, 1024); - - // Line map to map from generated mmfiles' line numbers back to original - // diff blocks' locations. Need this even for char diff because not all - // characters are 1-byte long / ASCII. - for (int i = 0; i < DB_COUNT; i++) - ga_init2(&linemap[i], sizeof(linemap_entry_T), 128); - - for (int i = 0; i < DB_COUNT; i++) - { - dio.dio_diff.dout_ga.ga_len = 0; - - buf_T *buf = curtab->tp_diffbuf[i]; - if (buf == NULL || buf->b_ml.ml_mfp == NULL) - continue; // skip buffer that isn't loaded - - if (dp->df_count[i] == 0) - continue; // skip buffer that don't have any texts in this block - - if (file1_idx == -1) - file1_idx = i; - - garray_T *curstr = (file1_idx != i) ? &file2_str : &file1_str; - - linenr_T numlines = 0; - curstr->ga_len = 0; - - // Split each line into chars/words and populate fake file buffer as - // newline-delimited tokens as that's what xdiff requires. - for (int off = 0; off < dp->df_count[i]; off++) - { - char_u *curline = ml_get_buf(curtab->tp_diffbuf[i], - dp->df_lnum[i] + off, FALSE); - - int in_keyword = FALSE; - - // iwhiteeol support vars - int last_white = FALSE; - int eol_ga_len = -1; - int eol_linemap_len = -1; - int eol_numlines = -1; - - char_u *s; - for (s = curline; *s != NUL;) - { - int new_in_keyword = FALSE; - if (diff_flags & DIFF_INLINE_WORD) - { - // Always use the first buffer's 'iskeyword' to have a - // consistent diff. - // For multibyte chars, only treat alphanumeric chars - // (class 2) as "word", as other classes such as emojis and - // CJK ideographs do not usually benefit from word diff as - // Vim doesn't have a good way to segment them. - new_in_keyword = (mb_get_class_buf(s, curtab->tp_diffbuf[file1_idx]) == 2); - } - if (in_keyword && !new_in_keyword) - { - ga_append(curstr, NL); - numlines++; - } - - if (VIM_ISWHITE(*s)) - { - if (diff_flags & DIFF_IWHITEALL) - { - in_keyword = FALSE; - s = skipwhite(s); - continue; - } - else if ((diff_flags & DIFF_IWHITEEOL) || (diff_flags & DIFF_IWHITE)) - { - if (!last_white) - { - eol_ga_len = curstr->ga_len; - eol_linemap_len = linemap[i].ga_len; - eol_numlines = numlines; - last_white = TRUE; - } - } - } - else - { - if ((diff_flags & DIFF_IWHITEEOL) || (diff_flags & DIFF_IWHITE)) - { - last_white = FALSE; - eol_ga_len = -1; - eol_linemap_len = -1; - eol_numlines = -1; - } - } - - int char_len = 1; - if (*s == NL) - // NL is internal substitute for NUL - ga_append(curstr, NUL); - else - { - char_len = mb_ptr2len(s); - - if (VIM_ISWHITE(*s) && (diff_flags & DIFF_IWHITE)) - // Treat the entire white space span as a single char. - char_len = skipwhite(s) - s; - - if (diff_flags & DIFF_ICASE) - { - int c; - char_u cbuf[MB_MAXBYTES + 1]; - // xdiff doesn't support ignoring case, fold-case the text manually. - c = PTR2CHAR(s); - int c_len = MB_CHAR2LEN(c); - c = MB_CASEFOLD(c); - int c_fold_len = mb_char2bytes(c, cbuf); - ga_concat_len(curstr, cbuf, c_fold_len); - if (char_len > c_len) - { - // There may be remaining composing characters. Write those back in. - // Composing characters don't need case folding. - ga_concat_len(curstr, s + c_len, char_len - c_len); - } - } - else - ga_concat_len(curstr, s, char_len); - } - - if (!new_in_keyword) - { - ga_append(curstr, NL); - numlines++; - } - - if (!new_in_keyword || (new_in_keyword && !in_keyword)) - { - // create a new mapping entry from the xdiff mmfile back to - // original line/col. - linemap_entry_T linemap_entry; - linemap_entry.lineoff = off; - linemap_entry.byte_start = s - curline; - linemap_entry.num_bytes = char_len; - if (ga_grow(&linemap[i], 1) != OK) - goto done; - ((linemap_entry_T*)(linemap[i].ga_data))[linemap[i].ga_len] - = linemap_entry; - linemap[i].ga_len += 1; - } - else - { - // Still inside a keyword. Just increment byte count but - // don't make a new entry. - // linemap always has at least one entry here - ((linemap_entry_T*)linemap[i].ga_data)[linemap[i].ga_len-1].num_bytes - += char_len; - } - - in_keyword = new_in_keyword; - s += char_len; - } - if (in_keyword) - { - ga_append(curstr, NL); - numlines++; - } - - if ((diff_flags & DIFF_IWHITEEOL) || (diff_flags & DIFF_IWHITE)) - { - // Need to trim trailing whitespace. Do this simply by - // resetting arrays back to before we encountered them. - if (eol_ga_len != -1) - { - curstr->ga_len = eol_ga_len; - linemap[i].ga_len = eol_linemap_len; - numlines = eol_numlines; - } - } - - if (!(diff_flags & DIFF_IWHITEALL)) - { - // Add an empty line token mapped to the end-of-line in the - // original file. This helps diff newline differences among - // files, which will be visualized when using 'list' as the eol - // listchar will be highlighted. - ga_append(curstr, NL); - numlines++; - - linemap_entry_T linemap_entry; - linemap_entry.lineoff = off; - linemap_entry.byte_start = s - curline; - linemap_entry.num_bytes = sizeof(NL); - if (ga_grow(&linemap[i], 1) != OK) - goto done; - ((linemap_entry_T*)(linemap[i].ga_data))[linemap[i].ga_len] - = linemap_entry; - linemap[i].ga_len += 1; - } - } - - if (file1_idx != i) - { - dio.dio_new.din_mmfile.ptr = (char *)curstr->ga_data; - dio.dio_new.din_mmfile.size = curstr->ga_len; - } - else - { - dio.dio_orig.din_mmfile.ptr = (char *)curstr->ga_data; - dio.dio_orig.din_mmfile.size = curstr->ga_len; - } - if (file1_idx != i) - { - // Perform diff with first file and read the results - int diff_status = diff_file_internal(&dio); - if (diff_status == FAIL) - goto done; - - diff_read(0, i, &dio); - clear_diffout(&dio.dio_diff); - } - } - diff_T *new_diff = curtab->tp_first_diff; - - if (diff_flags & DIFF_INLINE_CHAR && file1_idx != -1) - diff_refine_inline_char_highlight(new_diff, linemap, file1_idx); - - // After the diff, use the linemap to obtain the original line/col of the - // changes and cache them in dp. - dp->df_changes.ga_len = 0; // this should already be zero - for (; new_diff != NULL; new_diff = new_diff->df_next) - { - diffline_change_T change; - CLEAR_FIELD(change); - for (int i = 0; i < DB_COUNT; i++) - { - if (new_diff->df_lnum[i] == 0) - continue; - linenr_T diff_lnum = new_diff->df_lnum[i] - 1; // use zero-index - linenr_T diff_lnum_end = diff_lnum + new_diff->df_count[i]; - - if (diff_lnum >= linemap[i].ga_len) - { - change.dc_start[i] = MAXCOL; - change.dc_start_lnum_off[i] = INT_MAX; - } - else - { - change.dc_start[i] = ((linemap_entry_T*)linemap[i].ga_data)[diff_lnum].byte_start; - change.dc_start_lnum_off[i] = ((linemap_entry_T*)linemap[i].ga_data)[diff_lnum].lineoff; - } - - if (diff_lnum == diff_lnum_end) - { - change.dc_end[i] = change.dc_start[i]; - change.dc_end_lnum_off[i] = change.dc_start_lnum_off[i]; - } - else if (diff_lnum_end - 1 >= linemap[i].ga_len) - { - change.dc_end[i] = MAXCOL; - change.dc_end_lnum_off[i] = INT_MAX; - } - else - { - change.dc_end[i] = ((linemap_entry_T*)linemap[i].ga_data)[diff_lnum_end-1].byte_start + - ((linemap_entry_T*)linemap[i].ga_data)[diff_lnum_end-1].num_bytes; - change.dc_end_lnum_off[i] = ((linemap_entry_T*)linemap[i].ga_data)[diff_lnum_end-1].lineoff; - } - } - if (ga_grow(&dp->df_changes, 1) != OK) - { - dp->df_changes.ga_len = 0; - goto done; - } - ((diffline_change_T*)(dp->df_changes.ga_data))[dp->df_changes.ga_len] = change; - dp->df_changes.ga_len += 1; - } - -done: - diff_algorithm = save_diff_algorithm; - - dp->has_changes = TRUE; - - diff_clear(curtab); - curtab->tp_first_diff = orig_diff; - - ga_clear(&file1_str); - ga_clear(&file2_str); - // No need to clear dio.dio_orig/dio_new because they were referencing - // strings that are now cleared. - clear_diffout(&dio.dio_diff); - for (int i = 0; i < DB_COUNT; i++) - ga_clear(&linemap[i]); -} - -/* - * Find the difference within a changed line. - * Returns TRUE if the line was added, no other buffer has it. - */ - int -diff_find_change( - win_T *wp, - linenr_T lnum, - diffline_T *diffline) -{ - diff_T *dp; - int idx; - int off; - - idx = diff_buf_idx(wp->w_buffer); - if (idx == DB_COUNT) // cannot happen - return FALSE; - - // 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->is_linematched) - { - while (dp && dp->df_next - && lnum == dp->df_count[idx] + dp->df_lnum[idx] - && dp->df_next->df_lnum[idx] == lnum) - dp = dp->df_next; - } - if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL) - return FALSE; - - if (lnum - dp->df_lnum[idx] > INT_MAX) - // Integer overflow protection - return FALSE; - off = lnum - dp->df_lnum[idx]; - - if (!(diff_flags & ALL_INLINE_DIFF) || diff_internal_failed()) - { - // Use simple algorithm - int change_start = MAXCOL; // first col of changed area - int change_end = -1; // last col of changed area - int ret; - - ret = diff_find_change_simple(wp, lnum, dp, idx, &change_start, &change_end); - - // convert from inclusive end to exclusive end per diffline's contract - change_end += 1; - - // Create a mock diffline struct. We always only have one so no need to - // allocate memory. - CLEAR_FIELD(simple_diffline_change); - diffline->changes = &simple_diffline_change; - diffline->num_changes = 1; - diffline->bufidx = idx; - diffline->lineoff = lnum - dp->df_lnum[idx]; - - simple_diffline_change.dc_start[idx] = change_start; - simple_diffline_change.dc_end[idx] = change_end; - simple_diffline_change.dc_start_lnum_off[idx] = off; - simple_diffline_change.dc_end_lnum_off[idx] = off; - return ret; - } - - // Use inline diff algorithm. - // The diff changes are usually cached so we check that first. - if (!dp->has_changes) - diff_find_change_inline_diff(dp); - - garray_T *changes = &dp->df_changes; - - // Use linear search to find the first change for this line. We could - // optimize this to use binary search, but there should usually be a - // limited number of inline changes per diff block, and limited number of - // diff blocks shown on screen, so it is not necessary. - int num_changes = 0; - int change_idx = 0; - diffline->changes = NULL; - for (change_idx = 0; change_idx < changes->ga_len; change_idx++) - { - diffline_change_T *change = &((diffline_change_T*)dp->df_changes.ga_data)[change_idx]; - if (change->dc_end_lnum_off[idx] < off) - continue; - if (change->dc_start_lnum_off[idx] > off) - break; - if (diffline->changes == NULL) - diffline->changes = change; - num_changes++; - } - diffline->num_changes = num_changes; - diffline->bufidx = idx; - diffline->lineoff = off; - - // Detect simple cases of added lines in the end within a diff block. This - // has to be the last change of this diff block, and all other buffers are - // considering this to be an addition past their last line. Other scenarios - // will be considered a changed line instead. - int added = FALSE; - if (num_changes == 1 && change_idx == dp->df_changes.ga_len) - { - added = TRUE; - for (int i = 0; i < DB_COUNT; i++) - { - if (idx == i) - continue; - if (curtab->tp_diffbuf[i] == NULL) - continue; - diffline_change_T *change = &((diffline_change_T*)dp->df_changes.ga_data)[dp->df_changes.ga_len-1]; - if (change->dc_start_lnum_off[i] != INT_MAX) - { - added = FALSE; - break; - } - } - } - return added; -} - #if defined(FEAT_FOLDING) || defined(PROTO) /* * Return TRUE if line "lnum" is not close to a diff block, this line should @@ -4065,7 +3418,7 @@ ex_diffgetput(exarg_T *eap) #ifdef FEAT_FOLDING diff_fold_update(dfree, idx_to); #endif - clear_diffblock(dfree); + vim_free(dfree); } // mark_adjust() may have made "dp" invalid. We don't know where @@ -4528,38 +3881,23 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) static linenr_T prev_lnum = 0; static varnumber_T changedtick = 0; static int fnum = 0; - static int prev_diff_flags = 0; static int change_start = 0; static int change_end = 0; static hlf_T hlID = (hlf_T)0; - int cache_results = TRUE; int filler_lines; int col; - diffline_T diffline; - - CLEAR_FIELD(diffline); if (in_vim9script() && (check_for_lnum_arg(argvars,0) == FAIL || check_for_number_arg(argvars, 1) == FAIL)) return; - if (diff_flags & ALL_INLINE_DIFF) - { - // Remember the results if using simple since it's recalculated per - // call. Otherwise just call diff_find_change() every time since - // internally the result is cached internally. - cache_results = FALSE; - } - lnum = tv_get_lnum(argvars); if (lnum < 0) // ignore type error in {lnum} arg lnum = 0; - if (!cache_results - || lnum != prev_lnum + if (lnum != prev_lnum || changedtick != CHANGEDTICK(curbuf) - || fnum != curbuf->b_fnum - || diff_flags != prev_diff_flags) + || fnum != curbuf->b_fnum) { // New line, buffer, change: need to get the values. int linestatus = 0; @@ -4570,60 +3908,28 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { change_start = MAXCOL; change_end = -1; - if (diff_find_change(curwin, lnum, &diffline)) + if (diff_find_change(curwin, lnum, &change_start, &change_end)) hlID = HLF_ADD; // added line else - { hlID = HLF_CHD; // changed line - if (diffline.num_changes > 0 && cache_results) - { - change_start = diffline.changes[0].dc_start[diffline.bufidx]; - change_end = diffline.changes[0].dc_end[diffline.bufidx]; - } - } } else hlID = HLF_ADD; // added line } else hlID = (hlf_T)0; - - if (cache_results) - { - prev_lnum = lnum; - changedtick = CHANGEDTICK(curbuf); - fnum = curbuf->b_fnum; - prev_diff_flags = diff_flags; - } + prev_lnum = lnum; + changedtick = CHANGEDTICK(curbuf); + fnum = curbuf->b_fnum; } if (hlID == HLF_CHD || hlID == HLF_TXD) { col = tv_get_number(&argvars[1]) - 1; // ignore type error in {col} - if (cache_results) - { - if (col >= change_start && col < change_end) - hlID = HLF_TXD; // changed text - else - hlID = HLF_CHD; // changed line - } + if (col >= change_start && col <= change_end) + hlID = HLF_TXD; // changed text else - { - hlID = HLF_CHD; - for (int i = 0; i < diffline.num_changes; i++) - { - int added = diff_change_parse(&diffline, &diffline.changes[i], - &change_start, &change_end); - if (col >= change_start && col < change_end) - { - hlID = added ? HLF_TXA : HLF_TXD; - break; - } - if (col < change_start) - // the remaining changes are past this column and not relevant - break; - } - } + hlID = HLF_CHD; // changed line } rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID; # endif @@ -4702,7 +4008,7 @@ list_to_diffin(list_T *l, diffin_T *din, int icase) listitem_T *li; char_u *str; - ga_init2(&ga, 1, 2048); + ga_init2(&ga, 512, 4); FOR_ALL_LIST_ITEMS(l, li) { @@ -4714,10 +4020,12 @@ list_to_diffin(list_T *l, diffin_T *din, int icase) continue; } ga_concat(&ga, str); - ga_append(&ga, NL); + ga_concat(&ga, (char_u *)NL_STR); if (icase) vim_free(str); } + if (ga.ga_len > 0) + ((char *)ga.ga_data)[ga.ga_len] = NUL; din->din_mmfile.ptr = (char *)ga.ga_data; din->din_mmfile.size = ga.ga_len; diff --git a/src/drawline.c b/src/drawline.c index 57ee9a5f..764d0fba 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -388,8 +388,7 @@ handle_lnum_col( // If 'signcolumn' is set to 'number' and a sign is present // in 'lnum', then display the sign instead of the line // number. - if ((*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') && sign_present - && wlv->sattr.sat_text != NULL) + if ((*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') && sign_present) get_sign_display_info(TRUE, wp, wlv); else #endif @@ -1224,8 +1223,6 @@ win_line( #ifdef FEAT_DIFF int change_start = MAXCOL; // first col of changed area int change_end = -1; // last col of changed area - diffline_T line_changes; - int change_index = -1; #endif colnr_T trailcol = MAXCOL; // start of trailing spaces colnr_T leadcol = 0; // start of leading spaces @@ -1474,37 +1471,16 @@ win_line( int linestatus = 0; wlv.filler_lines = diff_check_with_linestatus(wp, lnum, &linestatus); - CLEAR_FIELD(line_changes); - if (wlv.filler_lines < 0 || linestatus < 0) { if (wlv.filler_lines == -1 || linestatus == -1) { - if (diff_find_change(wp, lnum, &line_changes)) - { + if (diff_find_change(wp, lnum, &change_start, &change_end)) wlv.diff_hlf = HLF_ADD; // added line - } - else if (line_changes.num_changes > 0) - { - int added = diff_change_parse( - &line_changes, &line_changes.changes[0], - &change_start, &change_end); - if (change_start == 0) - { - if (added) - wlv.diff_hlf = HLF_TXA; // added text on changed line - else - wlv.diff_hlf = HLF_TXD; // changed text on changed line - } - else - wlv.diff_hlf = HLF_CHD; // unchanged text on changed line - change_index = 0; - } + else if (change_start == 0) + wlv.diff_hlf = HLF_TXD; // changed text else - { wlv.diff_hlf = HLF_CHD; // changed line - change_index = 0; - } } else wlv.diff_hlf = HLF_ADD; @@ -2462,28 +2438,13 @@ win_line( #ifdef FEAT_DIFF if (wlv.diff_hlf != (hlf_T)0) { - if (line_changes.num_changes > 0 - && change_index >= 0 - && change_index < line_changes.num_changes - 1) - { - if (ptr - line >= line_changes.changes[change_index+1].dc_start[line_changes.bufidx]) - change_index += 1; - } - int added = FALSE; - if (line_changes.num_changes > 0 && change_index >= 0 && change_index < line_changes.num_changes) - { - added = diff_change_parse(&line_changes, - &line_changes.changes[change_index], - &change_start, - &change_end); - } // When there is extra text (e.g. virtual text) it gets the // diff highlighting for the line, but not for changed text. if (wlv.diff_hlf == HLF_CHD && ptr - line >= change_start && wlv.n_extra == 0) - wlv.diff_hlf = added ? HLF_TXA : HLF_TXD; // added/changed text - if ((wlv.diff_hlf == HLF_TXD || wlv.diff_hlf == HLF_TXA) - && ((ptr - line >= change_end && wlv.n_extra == 0) + wlv.diff_hlf = HLF_TXD; // changed text + if (wlv.diff_hlf == HLF_TXD + && ((ptr - line > change_end && wlv.n_extra == 0) || (wlv.n_extra > 0 && wlv.extra_for_textprop))) wlv.diff_hlf = HLF_CHD; // changed line wlv.line_attr = HL_ATTR(wlv.diff_hlf); @@ -3541,7 +3502,7 @@ win_line( wlv.char_attr = wlv.sattr.sat_linehl; #endif # ifdef FEAT_DIFF - if (wlv.diff_hlf == HLF_TXD || wlv.diff_hlf == HLF_TXA) + if (wlv.diff_hlf == HLF_TXD) { wlv.diff_hlf = HLF_CHD; if (vi_attr == 0 || wlv.char_attr != vi_attr) diff --git a/src/edit.c b/src/edit.c index 3c98bb8b..a2a004c1 100644 --- a/src/edit.c +++ b/src/edit.c @@ -608,16 +608,7 @@ edit( if (c != K_IGNORE && c != K_NOP) vungetc(c); count = 0; - - if (!bt_prompt(curwin->w_buffer) -#ifdef FEAT_TERMINAL - && !bt_terminal(curwin->w_buffer) -#endif - && stop_insert_mode) - // :stopinsert command via callback or via server command - nomove = FALSE; - else - nomove = TRUE; + nomove = TRUE; ins_compl_prep(ESC); goto doESCkey; } @@ -1411,11 +1402,6 @@ edit( ) did_cursorhold = FALSE; - // Check if we need to cancel completion mode because the window - // or tab page was changed - if (ins_compl_active() && !ins_compl_win_active(curwin)) - ins_compl_cancel(); - // If the cursor was moved we didn't just insert a space if (arrow_used) inserted_space = FALSE; @@ -2976,7 +2962,7 @@ stuff_inserted( do { - stuffReadbuffLen(insert.string, (long)insert.length); + stuffReadbuffLen(insert.string, insert.length); // a trailing "0" is inserted as "048", "^" as "^" switch (last) { @@ -3036,7 +3022,7 @@ get_last_insert_save(void) return NULL; if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing ESC - s[--insert.length] = NUL; + s[insert.length - 1] = NUL; return s; } @@ -5482,7 +5468,7 @@ do_insert_char_pre(int c) // Lock the text to avoid weird things from happening. ++textlock; - set_vim_var_string(VV_CHAR, buf, (int)buflen); // set v:char + set_vim_var_string(VV_CHAR, buf, buflen); // set v:char res = NULL; if (ins_apply_autocmds(EVENT_INSERTCHARPRE)) diff --git a/src/errors.h b/src/errors.h index d718507e..ca5ec850 100644 --- a/src/errors.h +++ b/src/errors.h @@ -2932,8 +2932,8 @@ 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_or_tuples[] - INIT(= N_("E1140: :for argument must be a sequence of lists or tuples")); +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[] @@ -3146,8 +3146,8 @@ 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_tuple_or_dict_required_for_argument_nr[] - INIT(= N_("E1225: String, List, Tuple or Dictionary 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[] @@ -3218,12 +3218,10 @@ EXTERN char e_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_tuple_dict_blob_or_string_required_for_argument_nr[] - INIT(= N_("E1251: List, Tuple, Dictionary, Blob or String required for argument %d")); +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_list_tuple_or_blob_required_for_argument_nr[] - INIT(= N_("E1253: String, List, Tuple or Blob required for argument %d")); // E1253 unused EXTERN char e_cannot_use_script_variable_in_for_loop[] INIT(= N_("E1254: Cannot use script variable in for loop")); @@ -3353,8 +3351,8 @@ EXTERN char e_window_unexpectedly_close_while_searching_for_tags[] #ifdef FEAT_EVAL EXTERN char e_cannot_use_partial_with_dictionary_for_defer[] INIT(= N_("E1300: Cannot use a partial with dictionary for :defer")); -EXTERN char e_repeatable_type_required_for_argument_nr[] - INIT(= N_("E1301: String, Number, List, Tuple or Blob required for argument %d")); +EXTERN char e_string_number_list_or_blob_required_for_argument_nr[] + INIT(= N_("E1301: String, Number, List or Blob required for argument %d")); EXTERN char e_script_variable_was_deleted[] INIT(= N_("E1302: Script variable was deleted")); EXTERN char e_custom_list_completion_function_does_not_return_list_but_str[] @@ -3666,67 +3664,3 @@ EXTERN char e_str_encoding_from_failed[] INIT(= N_("E1515: Unable to convert from '%s' encoding")); EXTERN char e_str_encoding_to_failed[] INIT(= N_("E1516: Unable to convert to '%s' encoding")); -#ifdef FEAT_EVAL -EXTERN char e_can_only_compare_tuple_with_tuple[] - INIT(= N_("E1517: Can only compare Tuple with Tuple")); -EXTERN char e_invalid_operation_for_tuple[] - INIT(= N_("E1518: Invalid operation for Tuple")); -EXTERN char e_tuple_index_out_of_range_nr[] - INIT(= N_("E1519: Tuple index out of range: %ld")); -EXTERN char e_using_tuple_as_number[] - INIT(= N_("E1520: Using a Tuple as a Number")); -EXTERN char e_using_tuple_as_float[] - INIT(= N_("E1521: Using a Tuple as a Float")); -EXTERN char e_using_tuple_as_string[] - INIT(= N_("E1522: Using a Tuple as a String")); -EXTERN char e_string_list_tuple_or_blob_required[] - INIT(= N_("E1523: String, List, Tuple or Blob required")); -EXTERN char e_cannot_use_tuple_with_function_str[] - INIT(= N_("E1524: Cannot use a tuple with function %s")); -EXTERN char e_argument_of_str_must_be_list_tuple_string_dictionary_or_blob[] - INIT(= N_("E1525: Argument of %s must be a List, Tuple, String, Dictionary or Blob")); -EXTERN char e_missing_end_of_tuple_rsp_str[] - INIT(= N_("E1526: Missing end of Tuple ')': %s")); -EXTERN char e_missing_comma_in_tuple_str[] - INIT(= N_("E1527: Missing comma in Tuple: %s")); -EXTERN char e_list_or_tuple_or_blob_required_for_argument_nr[] - INIT(= N_("E1528: List or Tuple or Blob required for argument %d")); -EXTERN char e_list_or_tuple_required_for_argument_nr[] - INIT(= N_("E1529: List or Tuple required for argument %d")); -EXTERN char e_list_or_tuple_or_dict_required_for_argument_nr[] - INIT(= N_("E1530: List or Tuple or Dictionary required for argument %d")); -EXTERN char e_argument_of_str_must_be_list_tuple_dictionary_or_blob[] - INIT(= N_("E1531: Argument of %s must be a List, Tuple, Dictionary or Blob")); -EXTERN char e_tuple_is_immutable[] - INIT(= N_("E1532: Cannot modify a tuple")); -EXTERN char e_cannot_slice_tuple[] - INIT(= N_("E1533: Cannot slice a tuple")); -EXTERN char e_tuple_required_for_argument_nr[] - INIT(= N_("E1534: Tuple required for argument %d")); -EXTERN char e_list_or_tuple_required[] - INIT(= N_("E1535: List or Tuple required")); -EXTERN char e_tuple_required[] - INIT(= N_("E1536: Tuple required")); -EXTERN char e_less_targets_than_tuple_items[] - INIT(= N_("E1537: Less targets than Tuple items")); -EXTERN char e_more_targets_than_tuple_items[] - INIT(= N_("E1538: More targets than Tuple items")); -EXTERN char e_variadic_tuple_must_end_with_list_type_str[] - INIT(= N_("E1539: Variadic tuple must end with a list type: %s")); -EXTERN char e_cannot_use_variadic_tuple_in_concatenation[] - INIT(= N_("E1540: Cannot use a variadic tuple in concatenation")); -#endif -EXTERN char e_unicode_val_too_large[] - INIT(= N_("E1541: Value too large, max Unicode codepoint is U+10FFFF")); -#ifdef FEAT_QUICKFIX -EXTERN char e_cannot_have_negative_or_zero_number_of_quickfix[] - INIT(= N_("E1542: Cannot have a negative or zero number of quickfix/location lists")); -EXTERN char e_cannot_have_more_than_hundred_quickfix[] - INIT(= N_("E1543: Cannot have more than a hundred quickfix/location lists")); -EXTERN char e_failed_resizing_quickfix_stack[] - INIT(= N_("E1544: Failed resizing the quickfix/location list stack")); -EXTERN char e_no_quickfix_stack[] - INIT(= N_("E1545: Quickfix list stack unavailable")); -#endif -EXTERN char e_cannot_switch_to_a_closing_buffer[] - INIT(= N_("E1546: Cannot switch to a closing buffer")); diff --git a/src/eval.c b/src/eval.c index 530cc95f..9a140c16 100644 --- a/src/eval.c +++ b/src/eval.c @@ -107,7 +107,7 @@ eval_clear(void) // autoloaded script names free_autoload_scriptnames(); - // unreferenced lists, tuples and dicts + // unreferenced lists and dicts (void)garbage_collect(FALSE); // functions not garbage collected @@ -620,48 +620,28 @@ skip_expr_concatenate( /* * Convert "tv" to a string. - * When "join_list" is TRUE convert a List or a Tuple into a sequence of lines. + * When "join_list" is TRUE convert a List into a sequence of lines. * Returns an allocated string (NULL when out of memory). */ char_u * typval2string(typval_T *tv, int join_list) { garray_T ga; - char_u *retval = NULL; + char_u *retval; - if (join_list && (tv->v_type == VAR_LIST || tv->v_type == VAR_TUPLE)) + if (join_list && tv->v_type == VAR_LIST) { - if (tv->v_type == VAR_LIST) + ga_init2(&ga, sizeof(char), 80); + if (tv->vval.v_list != NULL) { - ga_init2(&ga, sizeof(char), 80); - if (tv->vval.v_list != NULL) - { - list_join(&ga, tv->vval.v_list, (char_u *)"\n", TRUE, FALSE, - 0); - if (tv->vval.v_list->lv_len > 0) - ga_append(&ga, NL); - } - ga_append(&ga, NUL); - retval = (char_u *)ga.ga_data; - } - else - { - // tuple - ga_init2(&ga, sizeof(char), 80); - if (tv->vval.v_tuple != NULL) - { - tuple_join(&ga, tv->vval.v_tuple, (char_u *)"\n", TRUE, FALSE, - 0); - if (TUPLE_LEN(tv->vval.v_tuple) > 0) - ga_append(&ga, NL); - } - ga_append(&ga, NUL); - retval = (char_u *)ga.ga_data; + list_join(&ga, tv->vval.v_list, (char_u *)"\n", TRUE, FALSE, 0); + if (tv->vval.v_list->lv_len > 0) + ga_append(&ga, NL); } + ga_append(&ga, NUL); + retval = (char_u *)ga.ga_data; } - else if (tv->v_type == VAR_LIST - || tv->v_type == VAR_TUPLE - || tv->v_type == VAR_DICT) + else if (tv->v_type == VAR_LIST || tv->v_type == VAR_DICT) { char_u *tofree; char_u numbuf[NUMBUFLEN]; @@ -679,8 +659,7 @@ typval2string(typval_T *tv, int join_list) /* * Top level evaluation function, returning a string. Does not handle line * breaks. - * When "join_list" is TRUE convert a List and a Tuple into a sequence of - * lines. + * When "join_list" is TRUE convert a List into a sequence of lines. * Return pointer to allocated memory, or NULL for failure. */ char_u * @@ -1116,7 +1095,7 @@ flag_string_T glv_flag_strings[] = { * * This is typically called with "lval_root" as "root". For a class, find * the name from lp in the class from root, fill in lval_T if found. For a - * complex type, list/tuple/dict use it as the result; just put the root into + * complex type, list/dict use it as the result; just put the root into * ll_tv. * * "lval_root" is a hack used during run-time/instr-execution to provide the @@ -1343,11 +1322,8 @@ get_lval_dict_item( return GLV_FAIL; } lp->ll_list = NULL; - lp->ll_list = NULL; - lp->ll_blob = NULL; lp->ll_object = NULL; lp->ll_class = NULL; - lp->ll_tuple = NULL; // a NULL dict is equivalent with an empty dict if (lp->ll_tv->vval.v_dict == NULL) @@ -1449,13 +1425,7 @@ get_lval_blob( { long bloblen = blob_len(lp->ll_tv->vval.v_blob); - lp->ll_list = NULL; - lp->ll_dict = NULL; - lp->ll_object = NULL; - lp->ll_class = NULL; - lp->ll_tuple = NULL; - - // Get the number and item for the only or first index of a List or Tuple. + // Get the number and item for the only or first index of the List. if (empty1) lp->ll_n1 = 0; else @@ -1514,7 +1484,6 @@ get_lval_list( lp->ll_dict = NULL; lp->ll_object = NULL; lp->ll_class = NULL; - lp->ll_tuple = NULL; lp->ll_list = lp->ll_tv->vval.v_list; lp->ll_li = check_range_index_one(lp->ll_list, &lp->ll_n1, (flags & GLV_ASSIGN_WITH_OP) == 0, quiet); @@ -1554,64 +1523,6 @@ get_lval_list( return OK; } -/* - * Get a tuple lval variable that can be assigned a value to: "name", - * "na{me}", "name[expr]", "name[expr][expr]", etc. - * - * 'idx' specifies the tuple index. - * If 'quiet' is TRUE, then error messages are not displayed for an invalid - * index. - * - * The typval is returned in 'lp'. Returns GLV_OK on success and GLV_FAIL on - * failure. - */ - static int -get_lval_tuple( - lval_T *lp, - typval_T *idx, - int quiet) -{ - // is number or string - lp->ll_n1 = (long)tv_get_number(idx); - - lp->ll_list = NULL; - lp->ll_dict = NULL; - lp->ll_blob = NULL; - lp->ll_object = NULL; - lp->ll_class = NULL; - - lp->ll_tuple = lp->ll_tv->vval.v_tuple; - lp->ll_tv = tuple_find(lp->ll_tuple, lp->ll_n1); - if (lp->ll_tv == NULL) - { - if (!quiet) - semsg(_(e_tuple_index_out_of_range_nr), lp->ll_n1); - return GLV_FAIL; - } - - // use the type of the member - if (lp->ll_valtype != NULL) - { - if (lp->ll_valtype != NULL - && lp->ll_valtype->tt_type == VAR_TUPLE - && lp->ll_valtype->tt_argcount == 1) - { - // a variadic tuple or a single item tuple - if (lp->ll_valtype->tt_flags & TTFLAG_VARARGS) - lp->ll_valtype = lp->ll_valtype->tt_args[0]->tt_member; - else - lp->ll_valtype = lp->ll_valtype->tt_args[0]; - } - else - // If the LHS member type is not known (VAR_ANY), then get it from - // the tuple item (after indexing) - lp->ll_valtype = typval2type(lp->ll_tv, get_copyID(), - &lp->ll_type_list, TVTT_DO_MEMBER); - } - - return GLV_OK; -} - /* * Get a class or object lval method in class "cl". The 'key' argument points * to the method name and 'key_end' points to the character after 'key'. @@ -1719,7 +1630,6 @@ get_lval_class_or_obj( { lp->ll_dict = NULL; lp->ll_list = NULL; - lp->ll_tuple = NULL; class_T *cl; if (v_type == VAR_OBJECT) @@ -1787,8 +1697,8 @@ dot_allowed_after_type(char_u *name, vartype_T v_type, int quiet) /* * Check whether left bracket ("[") is allowed after the variable "name" with - * type "v_type". Only Dict, List, Tuple and Blob types support a bracket - * after the variable name. Returns TRUE if bracket is allowed after the name. + * type "v_type". Only Dict, List and Blob types support a bracket after the + * variable name. Returns TRUE if bracket is allowed after the name. */ static int bracket_allowed_after_type(char_u *name, vartype_T v_type, int quiet) @@ -1806,18 +1716,14 @@ bracket_allowed_after_type(char_u *name, vartype_T v_type, int quiet) /* * Check whether the variable "name" with type "v_type" can be followed by an - * index. Only Dict, List, Tuple, Blob, Object and Class types support - * indexing. Returns TRUE if indexing is allowed after the name. + * index. Only Dict, List, Blob, Object and Class types support indexing. + * Returns TRUE if indexing is allowed after the name. */ static int index_allowed_after_type(char_u *name, vartype_T v_type, int quiet) { - if (v_type != VAR_LIST - && v_type != VAR_TUPLE - && v_type != VAR_DICT - && v_type != VAR_BLOB - && v_type != VAR_OBJECT - && v_type != VAR_CLASS) + if (v_type != VAR_LIST && v_type != VAR_DICT && v_type != VAR_BLOB && + v_type != VAR_OBJECT && v_type != VAR_CLASS) { if (!quiet) semsg(_(e_index_not_allowed_after_str_str), @@ -1829,8 +1735,8 @@ index_allowed_after_type(char_u *name, vartype_T v_type, int quiet) } /* - * Get the lval of a list/tuple/dict/blob/object/class subitem starting at "p". - * Loop until no more [idx] or .key is following. + * Get the lval of a list/dict/blob/object/class subitem starting at "p". Loop + * until no more [idx] or .key is following. * * If "rettv" is not NULL it points to the value to be assigned. * "unlet" is TRUE for ":unlet". @@ -1957,12 +1863,6 @@ get_lval_subscript( emsg(_(e_cannot_slice_dictionary)); goto done; } - if (v_type == VAR_TUPLE) - { - if (!quiet) - emsg(_(e_cannot_slice_tuple)); - goto done; - } if (rettv != NULL && !(rettv->v_type == VAR_LIST && rettv->vval.v_list != NULL) @@ -2032,11 +1932,6 @@ get_lval_subscript( if (get_lval_list(lp, &var1, &var2, empty1, flags, quiet) == FAIL) goto done; } - else if (v_type == VAR_TUPLE) - { - if (get_lval_tuple(lp, &var1, quiet) == FAIL) - goto done; - } else // v_type == VAR_CLASS || v_type == VAR_OBJECT { if (get_lval_class_or_obj(lp, key, p, v_type, cl_exec, flags, @@ -2050,13 +1945,6 @@ get_lval_subscript( var2.v_type = VAR_UNKNOWN; } - if (lp->ll_tuple != NULL && (flags & GLV_READ_ONLY) == 0) - { - if (!quiet) - emsg(_(e_tuple_is_immutable)); - goto done; - } - rc = OK; done: @@ -2284,7 +2172,7 @@ get_lval( { where_T where = WHERE_INIT; - // In a Vim9 script, do type check and make sure the variable is + // In a vim9 script, do type check and make sure the variable is // writable. if (check_typval_type(lp->ll_valtype, rettv, where) == FAIL) return NULL; @@ -2373,7 +2261,7 @@ set_var_lval( // handle +=, -=, *=, /=, %= and .= di = NULL; - if (eval_variable(lp->ll_name, (int)STRLEN(lp->ll_name), + if (eval_variable(lp->ll_name, (int)(lp->ll_name_end - lp->ll_name), lp->ll_sid, &tv, &di, EVAL_VAR_VERBOSE) == OK) { if (di != NULL && check_typval_is_value(&di->di_tv) == FAIL) @@ -2687,7 +2575,6 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op) case VAR_OBJECT: case VAR_CLASS: case VAR_TYPEALIAS: - case VAR_TUPLE: break; case VAR_BLOB: @@ -2732,7 +2619,6 @@ eval_for_line( char_u *expr; typval_T tv; list_T *l; - tuple_T *tuple; int skip = !(evalarg->eval_flags & EVAL_EVALUATE); *errp = TRUE; // default: there is an error @@ -2785,22 +2671,6 @@ eval_for_line( fi->fi_lw.lw_item = l->lv_first; } } - else if (tv.v_type == VAR_TUPLE) - { - tuple = tv.vval.v_tuple; - if (tuple == NULL) - { - // a null tuple is like an empty tuple: do nothing - clear_tv(&tv); - } - else - { - // No need to increment the refcount, it's already set for - // the tuple being used in "tv". - fi->fi_tuple = tuple; - fi->fi_tuple_idx = 0; - } - } else if (tv.v_type == VAR_BLOB) { fi->fi_bi = 0; @@ -2825,7 +2695,7 @@ eval_for_line( } else { - emsg(_(e_string_list_tuple_or_blob_required)); + emsg(_(e_string_list_or_blob_required)); clear_tv(&tv); } } @@ -2910,22 +2780,6 @@ next_for_item(void *fi_void, char_u *arg) return result; } - if (fi->fi_tuple != NULL) - { - typval_T tv; - - if (fi->fi_tuple_idx >= TUPLE_LEN(fi->fi_tuple)) - return FALSE; - - copy_tv(TUPLE_ITEM(fi->fi_tuple, fi->fi_tuple_idx), &tv); - ++fi->fi_tuple_idx; - ++fi->fi_bi; - if (skip_assign) - return TRUE; - return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon, - fi->fi_varcount, flag, NULL) == OK; - } - item = fi->fi_lw.lw_item; if (item == NULL) result = FALSE; @@ -2959,8 +2813,6 @@ free_for_info(void *fi_void) } else if (fi->fi_blob != NULL) blob_unref(fi->fi_blob); - else if (fi->fi_tuple != NULL) - tuple_unref(fi->fi_tuple); else vim_free(fi->fi_string); vim_free(fi); @@ -4107,36 +3959,6 @@ eval_addlist(typval_T *tv1, typval_T *tv2) return OK; } -/* - * Make a copy of tuple "tv1" and append tuple "tv2". - */ - int -eval_addtuple(typval_T *tv1, typval_T *tv2) -{ - int vim9script = in_vim9script(); - typval_T var3; - - if (vim9script && tv1->vval.v_tuple != NULL && tv2->vval.v_tuple != NULL - && tv1->vval.v_tuple->tv_type != NULL - && tv2->vval.v_tuple->tv_type != NULL) - { - if (!check_tuples_addable(tv1->vval.v_tuple->tv_type, - tv2->vval.v_tuple->tv_type)) - return FAIL; - } - - // concatenate tuples - if (tuple_concat(tv1->vval.v_tuple, tv2->vval.v_tuple, &var3) == FAIL) - { - clear_tv(tv1); - clear_tv(tv2); - return FAIL; - } - clear_tv(tv1); - *tv1 = var3; - return OK; -} - /* * Left or right shift the number "tv1" by the number "tv2" and store the * result in "tv1". @@ -4409,7 +4231,6 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg) int concat; typval_T var2; int vim9script = in_vim9script(); - long op_lnum = SOURCING_LNUM; // "." is only string concatenation when scriptversion is 1 // "+=", "-=" and "..=" are assignments @@ -4438,8 +4259,7 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg) *arg = p; } if ((op != '+' || (rettv->v_type != VAR_LIST - && rettv->v_type != VAR_TUPLE - && rettv->v_type != VAR_BLOB)) + && rettv->v_type != VAR_BLOB)) && (op == '.' || rettv->v_type != VAR_FLOAT) && evaluate) { @@ -4482,8 +4302,6 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg) /* * Compute the result. */ - // use the line of the operation for messages - SOURCING_LNUM = op_lnum; if (op == '.') { if (eval_concat_str(rettv, &var2) == FAIL) @@ -4498,12 +4316,6 @@ eval6(char_u **arg, typval_T *rettv, evalarg_T *evalarg) if (eval_addlist(rettv, &var2) == FAIL) return FAIL; } - else if (op == '+' && rettv->v_type == VAR_TUPLE - && var2.v_type == VAR_TUPLE) - { - if (eval_addtuple(rettv, &var2) == FAIL) - return FAIL; - } else { if (eval_addsub_number(rettv, &var2, op) == FAIL) @@ -4869,23 +4681,13 @@ handle_predefined(char_u *s, int len, typval_T *rettv) return OK; } break; - case 10: - if (STRNCMP(s, "null_", 5) != 0) - break; - // null_class - if (STRNCMP(s + 5, "class", 5) == 0) + case 10: if (STRNCMP(s, "null_class", 10) == 0) { rettv->v_type = VAR_CLASS; rettv->vval.v_class = NULL; return OK; } - if (STRNCMP(s + 5, "tuple", 5) == 0) - { - rettv->v_type = VAR_TUPLE; - rettv->vval.v_tuple = NULL; - return OK; - } - break; + break; case 11: if (STRNCMP(s, "null_string", 11) == 0) { rettv->v_type = VAR_STRING; @@ -4994,26 +4796,16 @@ eval9_nested_expr( if (ret == NOTDONE) { *arg = skipwhite_and_linebreak(*arg + 1, evalarg); + ret = eval1(arg, rettv, evalarg); // recursive! + + *arg = skipwhite_and_linebreak(*arg, evalarg); if (**arg == ')') - // empty tuple - ret = eval_tuple(arg, rettv, evalarg, TRUE); - else + ++*arg; + else if (ret == OK) { - ret = eval1(arg, rettv, evalarg); // recursive! - - *arg = skipwhite_and_linebreak(*arg, evalarg); - - if (**arg == ',') - // tuple - ret = eval_tuple(arg, rettv, evalarg, TRUE); - else if (**arg == ')') - ++*arg; - else if (ret == OK) - { - emsg(_(e_missing_closing_paren)); - clear_tv(rettv); - ret = FAIL; - } + emsg(_(e_missing_closing_paren)); + clear_tv(rettv); + ret = FAIL; } } @@ -5104,7 +4896,6 @@ eval9_var_func_name( * $VAR environment variable * (expression) nested expression * [expr, expr] List - * (expr, expr) Tuple * {arg, arg -> expr} Lambda * {key: val, key: val} Dictionary * #{key: val, key: val} Dictionary with literal keys @@ -5113,7 +4904,7 @@ eval9_var_func_name( * ! in front logical NOT * - in front unary minus * + in front unary plus (ignored) - * trailing [] subscript in String or List or Tuple + * trailing [] subscript in String or List * trailing .name entry in Dictionary * trailing ->name() method call * @@ -5258,7 +5049,6 @@ eval9( /* * nested expression: (expression). * or lambda: (arg) => expr - * or tuple */ case '(': ret = eval9_nested_expr(arg, rettv, evalarg, evaluate); break; @@ -5694,8 +5484,7 @@ eval_index( var1.v_type = VAR_STRING; } - if (vim9script && (rettv->v_type == VAR_LIST - || rettv->v_type == VAR_TUPLE)) + if (vim9script && rettv->v_type == VAR_LIST) tv_get_number_chk(&var1, &error); else error = tv_get_string_chk(&var1) == NULL; @@ -5814,7 +5603,6 @@ check_can_index(typval_T *rettv, int evaluate, int verbose) case VAR_STRING: case VAR_LIST: - case VAR_TUPLE: case VAR_DICT: case VAR_BLOB: break; @@ -5947,16 +5735,6 @@ eval_index_inner( return FAIL; break; - case VAR_TUPLE: - if (var1 == NULL) - n1 = 0; - if (var2 == NULL) - n2 = VARNUM_MAX; - if (tuple_slice_or_index(rettv->vval.v_tuple, - is_range, n1, n2, exclusive, rettv, verbose) == FAIL) - return FAIL; - break; - case VAR_DICT: { dictitem_T *item; @@ -6301,51 +6079,6 @@ list_tv2string( return r; } -/* - * Return a textual representation of a Tuple in "tv". - * If the memory is allocated "tofree" is set to it, otherwise NULL. - * When "copyID" is not zero replace recursive lists with "...". When - * "restore_copyID" is FALSE, repeated items in tuples are replaced with "...". - * May return NULL. - */ - static char_u * -tuple_tv2string( - typval_T *tv, - char_u **tofree, - int copyID, - int restore_copyID) -{ - tuple_T *tuple = tv->vval.v_tuple; - char_u *r = NULL; - - if (tuple == NULL) - { - // NULL tuple is equivalent to an empty tuple. - *tofree = NULL; - r = (char_u *)"()"; - } - else if (copyID != 0 && tuple->tv_copyID == copyID - && tuple->tv_items.ga_len > 0) - { - *tofree = NULL; - r = (char_u *)"(...)"; - } - else - { - int old_copyID; - if (restore_copyID) - old_copyID = tuple->tv_copyID; - - tuple->tv_copyID = copyID; - *tofree = tuple2string(tv, copyID, restore_copyID); - if (restore_copyID) - tuple->tv_copyID = old_copyID; - r = *tofree; - } - - return r; -} - /* * Return a textual representation of a Dict in "tv". * If the memory is allocated "tofree" is set to it, otherwise NULL. @@ -6583,10 +6316,6 @@ echo_string_core( r = list_tv2string(tv, tofree, copyID, restore_copyID); break; - case VAR_TUPLE: - r = tuple_tv2string(tv, tofree, copyID, restore_copyID); - break; - case VAR_DICT: r = dict_tv2string(tv, tofree, copyID, restore_copyID); break; @@ -7528,23 +7257,6 @@ item_copy( if (to->vval.v_list == NULL) ret = FAIL; break; - case VAR_TUPLE: - to->v_type = VAR_TUPLE; - to->v_lock = 0; - if (from->vval.v_tuple == NULL) - to->vval.v_tuple = NULL; - else if (copyID != 0 && from->vval.v_tuple->tv_copyID == copyID) - { - // use the copy made earlier - to->vval.v_tuple = from->vval.v_tuple->tv_copytuple; - ++to->vval.v_tuple->tv_refcount; - } - else - to->vval.v_tuple = tuple_copy(from->vval.v_tuple, - deep, top, copyID); - if (to->vval.v_tuple == NULL) - ret = FAIL; - break; case VAR_BLOB: ret = blob_copy(from->vval.v_blob, to); break; diff --git a/src/evalfunc.c b/src/evalfunc.c index 74afd9dc..55924710 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -308,7 +308,7 @@ arg_object(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) if (type->tt_type == VAR_OBJECT || type_any_or_unknown(type)) return OK; - arg_type_mismatch(&t_object_any, type, context->arg_idx + 1); + arg_type_mismatch(&t_object, type, context->arg_idx + 1); return FAIL; } @@ -360,15 +360,6 @@ arg_list_string(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) return check_arg_type(&t_list_string, type, context); } -/* - * Check "type" is a tuple of 'any'. - */ - static int -arg_tuple_any(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) -{ - return check_arg_type(&t_tuple_any, type, context); -} - /* * Check "type" is a string. */ @@ -438,42 +429,6 @@ arg_list_or_blob_mod( return arg_type_modifiable(type, context->arg_idx + 1); } -/* - * Check "type" is a list of 'any' or a tuple. - */ - static int -arg_list_or_tuple( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) -{ - if (type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE - || type_any_or_unknown(type)) - return OK; - arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); - return FAIL; -} - - -/* - * Check "type" is a list of 'any', a tuple or a blob. - */ - static int -arg_list_or_tuple_or_blob( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) -{ - if (type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE - || type->tt_type == VAR_BLOB - || type_any_or_unknown(type)) - return OK; - arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); - return FAIL; -} - /* * Check "type" is a string or a number */ @@ -506,10 +461,7 @@ arg_buffer(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) * Check "type" is a buffer or a dict of any */ static int -arg_buffer_or_dict_any( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_buffer_or_dict_any(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_NUMBER @@ -538,10 +490,7 @@ arg_lnum(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) * Check "type" is a string or a list of strings. */ static int -arg_string_or_list_string( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_or_list_string(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type_any_or_unknown(type)) @@ -563,10 +512,7 @@ arg_string_or_list_string( * Check "type" is a string or a list of 'any' */ static int -arg_string_or_list_any( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_or_list_any(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_LIST @@ -580,10 +526,7 @@ arg_string_or_list_any( * Check "type" is a string or a dict of 'any' */ static int -arg_string_or_dict_any( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_or_dict_any(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_DICT @@ -597,10 +540,7 @@ arg_string_or_dict_any( * Check "type" is a string or a blob */ static int -arg_string_or_blob( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_or_blob(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_BLOB @@ -639,25 +579,7 @@ arg_list_or_dict_mod( } /* - * Check "type" is a list of 'any', a tuple of 'any' or dict of 'any'. - */ - static int -arg_list_or_tuple_or_dict( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) -{ - if (type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE - || type->tt_type == VAR_DICT - || type_any_or_unknown(type)) - return OK; - arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); - return FAIL; -} - -/* - * Check "type" is a list of 'any', a dict of 'any' or a blob. + * Check "type" is a list of 'any' or a dict of 'any' or a blob. * Also check if "type" is modifiable. */ static int @@ -679,10 +601,7 @@ arg_list_or_dict_or_blob_mod( * Check "type" is a list of 'any' or a dict of 'any' or a blob or a string. */ static int -arg_list_or_dict_or_blob_or_string( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_list_or_dict_or_blob_or_string(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_LIST || type->tt_type == VAR_DICT @@ -709,36 +628,12 @@ arg_list_or_dict_or_blob_or_string_mod( return arg_type_modifiable(type, context->arg_idx + 1); } -/* - * Check "type" is a list of 'any', a tuple of 'any', a dict of 'any', a blob - * or a string. - */ - static int -arg_list_tuple_dict_blob_or_string( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) -{ - if (type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE - || type->tt_type == VAR_DICT - || type->tt_type == VAR_BLOB - || type->tt_type == VAR_STRING - || type_any_or_unknown(type)) - return OK; - arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); - return FAIL; -} - - /* * Check second argument of map(), filter(), foreach(). */ static int -check_map_filter_arg2( - type_T *type, - argcontext_T *context, - filtermap_T filtermap) +check_map_filter_arg2(type_T *type, argcontext_T *context, + filtermap_T filtermap) { type_T *expected_member = NULL; type_T *(args[2]); @@ -906,10 +801,7 @@ arg_sort_how(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) * Also accept a number, one and zero are accepted. */ static int -arg_string_or_func( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_or_func(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_PARTIAL @@ -943,16 +835,12 @@ varargs_class(type_T *type UNUSED, } /* - * Check "type" is a list of 'any', a tuple, a blob or a string. + * Check "type" is a list of 'any' or a blob or a string. */ static int -arg_string_list_tuple_or_blob( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_list_or_blob(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE || type->tt_type == VAR_BLOB || type->tt_type == VAR_STRING || type_any_or_unknown(type)) @@ -962,12 +850,12 @@ arg_string_list_tuple_or_blob( } /* - * Check "type" is a tuple or a modifiable list of 'any' or a blob or a string. + * Check "type" is a modifiable list of 'any' or a blob or a string. */ static int -arg_reverse(type_T *type, type_T *decl_type, argcontext_T *context) +arg_string_list_or_blob_mod(type_T *type, type_T *decl_type, argcontext_T *context) { - if (arg_string_list_tuple_or_blob(type, decl_type, context) == FAIL) + if (arg_string_list_or_blob(type, decl_type, context) == FAIL) return FAIL; return arg_type_modifiable(type, context->arg_idx + 1); } @@ -1013,10 +901,7 @@ arg_same_as_prev(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) * Must not be used for the first argcheck_T entry. */ static int -arg_same_struct_as_prev( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_same_struct_as_prev(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { type_T *prev_type = context->arg_types[context->arg_idx - 1].type_curr; @@ -1050,10 +935,7 @@ arg_item_of_prev(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) * Check "type" is a string or a number or a list */ static int -arg_str_or_nr_or_list( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_str_or_nr_or_list(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_NUMBER @@ -1068,10 +950,7 @@ arg_str_or_nr_or_list( * Check "type" is a dict of 'any' or a string */ static int -arg_dict_any_or_string( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_dict_any_or_string(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_DICT || type->tt_type == VAR_STRING @@ -1098,15 +977,14 @@ arg_extend3(type_T *type, type_T *decl_type, argcontext_T *context) } /* - * Check "type" which is the first argument of get() (a blob, a list, a tuple, - * a dict or a funcref) + * Check "type" which is the first argument of get() (blob or list or dict or + * funcref) */ static int arg_get1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_BLOB || type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE || type->tt_type == VAR_DICT || type->tt_type == VAR_FUNC || type->tt_type == VAR_PARTIAL @@ -1118,8 +996,8 @@ arg_get1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) } /* - * Check "type" which is the first argument of len() (a string, a number, a - * blob, a list, a tuple, a dict or an object) + * Check "type" which is the first argument of len() (number or string or + * blob or list or dict) */ static int arg_len1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) @@ -1128,7 +1006,6 @@ arg_len1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) || type->tt_type == VAR_NUMBER || type->tt_type == VAR_BLOB || type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE || type->tt_type == VAR_DICT || type->tt_type == VAR_OBJECT || type_any_or_unknown(type)) @@ -1155,8 +1032,8 @@ arg_remove2(type_T *type, type_T *decl_type, argcontext_T *context) } /* - * Check "type" which is the first argument of repeat() (a string, a number, a - * blob, a list, a tuple or any) + * Check "type" which is the first argument of repeat() (string or number or + * list or any) */ static int arg_repeat1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) @@ -1165,7 +1042,6 @@ arg_repeat1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) || type->tt_type == VAR_NUMBER || type->tt_type == VAR_BLOB || type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE || type_any_or_unknown(type)) return OK; @@ -1174,14 +1050,13 @@ arg_repeat1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) } /* - * Check "type" which is the first argument of slice() (a list, a tuple, a - * blob, a string or any) + * Check "type" which is the first argument of slice() (list or blob or string + * or any) */ static int arg_slice1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE || type->tt_type == VAR_BLOB || type->tt_type == VAR_STRING || type_any_or_unknown(type)) @@ -1192,23 +1067,19 @@ arg_slice1(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) } /* - * Check "type" which is the first argument of count() (a string, a list, a - * tuple, a dict or any) + * Check "type" which is the first argument of count() (string or list or dict + * or any) */ static int -arg_string_list_tuple_or_dict( - type_T *type, - type_T *decl_type UNUSED, - argcontext_T *context) +arg_string_or_list_or_dict(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { if (type->tt_type == VAR_STRING || type->tt_type == VAR_LIST - || type->tt_type == VAR_TUPLE || type->tt_type == VAR_DICT || type_any_or_unknown(type)) return OK; - semsg(_(e_string_list_tuple_or_dict_required_for_argument_nr), + semsg(_(e_string_list_or_dict_required_for_argument_nr), context->arg_idx + 1); return FAIL; } @@ -1243,12 +1114,11 @@ static argcheck_T arg1_dict_or_string[] = {arg_dict_any_or_string}; static argcheck_T arg1_float_or_nr[] = {arg_float_or_nr}; static argcheck_T arg1_job[] = {arg_job}; static argcheck_T arg1_list_any[] = {arg_list_any}; -static argcheck_T arg1_tuple_any[] = {arg_tuple_any}; static argcheck_T arg1_list_number[] = {arg_list_number}; -static argcheck_T arg1_reverse[] = {arg_reverse}; -static argcheck_T arg1_list_or_tuple_or_dict[] = {arg_list_or_tuple_or_dict}; +static argcheck_T arg1_string_or_list_or_blob_mod[] = {arg_string_list_or_blob_mod}; +static argcheck_T arg1_list_or_dict[] = {arg_list_or_dict}; static argcheck_T arg1_list_string[] = {arg_list_string}; -static argcheck_T arg1_string_list_tuple_or_dict[] = {arg_string_list_tuple_or_dict}; +static argcheck_T arg1_string_or_list_or_dict[] = {arg_string_or_list_or_dict}; static argcheck_T arg1_lnum[] = {arg_lnum}; static argcheck_T arg1_number[] = {arg_number}; static argcheck_T arg1_string[] = {arg_string}; @@ -1271,6 +1141,7 @@ static argcheck_T arg2_float_or_nr[] = {arg_float_or_nr, arg_float_or_nr}; static argcheck_T arg2_job_dict[] = {arg_job, arg_dict_any}; static argcheck_T arg2_job_string_or_number[] = {arg_job, arg_string_or_nr}; static argcheck_T arg2_list_any_number[] = {arg_list_any, arg_number}; +static argcheck_T arg2_list_any_string[] = {arg_list_any, arg_string}; static argcheck_T arg2_list_number[] = {arg_list_number, arg_list_number}; static argcheck_T arg2_list_number_bool[] = {arg_list_number, arg_bool}; static argcheck_T arg2_list_string_dict[] = {arg_list_string, arg_dict_any}; @@ -1297,7 +1168,6 @@ static argcheck_T arg2_string_or_list_dict[] = {arg_string_or_list_any, arg_dict static argcheck_T arg2_string_or_list_number[] = {arg_string_or_list_any, arg_number}; static argcheck_T arg2_string_string_or_number[] = {arg_string, arg_string_or_nr}; static argcheck_T arg2_blob_dict[] = {arg_blob, arg_dict_any}; -static argcheck_T arg2_list_or_tuple_string[] = {arg_list_or_tuple, arg_string}; static argcheck_T arg3_any_list_dict[] = {arg_any, arg_list_any, arg_dict_any}; static argcheck_T arg3_buffer_lnum_lnum[] = {arg_buffer, arg_lnum, arg_lnum}; static argcheck_T arg3_buffer_number_number[] = {arg_buffer, arg_number, arg_number}; @@ -1335,7 +1205,7 @@ static argcheck_T arg34_assert_inrange[] = {arg_float_or_nr, arg_float_or_nr, ar static argcheck_T arg4_browse[] = {arg_bool, arg_string, arg_string, arg_string}; static argcheck_T arg23_chanexpr[] = {arg_chan_or_job, arg_any, arg_dict_any}; static argcheck_T arg23_chanraw[] = {arg_chan_or_job, arg_string_or_blob, arg_dict_any}; -static argcheck_T arg24_count[] = {arg_string_list_tuple_or_dict, arg_any, arg_bool, arg_number}; +static argcheck_T arg24_count[] = {arg_string_or_list_or_dict, arg_any, arg_bool, arg_number}; static argcheck_T arg13_cursor[] = {arg_cursor1, arg_number, arg_number}; static argcheck_T arg12_deepcopy[] = {arg_any, arg_bool}; static argcheck_T arg12_execute[] = {arg_string_or_list_string, arg_string}; @@ -1345,14 +1215,14 @@ static argcheck_T arg23_extendnew[] = {arg_list_or_dict, arg_same_struct_as_prev static argcheck_T arg23_get[] = {arg_get1, arg_string_or_nr, arg_any}; static argcheck_T arg14_glob[] = {arg_string, arg_bool, arg_bool, arg_bool}; static argcheck_T arg25_globpath[] = {arg_string, arg_string, arg_bool, arg_bool, arg_bool}; -static argcheck_T arg24_index[] = {arg_list_or_tuple_or_blob, arg_item_of_prev, arg_number, arg_bool}; -static argcheck_T arg23_index[] = {arg_list_or_tuple_or_blob, arg_filter_func, arg_dict_any}; +static argcheck_T arg24_index[] = {arg_list_or_blob, arg_item_of_prev, arg_number, arg_bool}; +static argcheck_T arg23_index[] = {arg_list_or_blob, arg_filter_func, arg_dict_any}; static argcheck_T arg23_insert[] = {arg_list_or_blob, arg_item_of_prev, arg_number}; static argcheck_T arg1_len[] = {arg_len1}; static argcheck_T arg3_libcall[] = {arg_string, arg_string, arg_string_or_nr}; static argcheck_T arg14_maparg[] = {arg_string, arg_string, arg_bool, arg_bool}; static argcheck_T arg2_filter[] = {arg_list_or_dict_or_blob_or_string_mod, arg_filter_func}; -static argcheck_T arg2_foreach[] = {arg_list_tuple_dict_blob_or_string, arg_foreach_func}; +static argcheck_T arg2_foreach[] = {arg_list_or_dict_or_blob_or_string, arg_foreach_func}; static argcheck_T arg2_instanceof[] = {arg_object, varargs_class, NULL }; static argcheck_T arg2_map[] = {arg_list_or_dict_or_blob_or_string_mod, arg_map_func}; static argcheck_T arg2_mapnew[] = {arg_list_or_dict_or_blob_or_string, arg_any}; @@ -1361,7 +1231,7 @@ static argcheck_T arg25_matchaddpos[] = {arg_string, arg_list_any, arg_number, a static argcheck_T arg23_matchstrlist[] = {arg_list_string, arg_string, arg_dict_any}; static argcheck_T arg45_matchbufline[] = {arg_buffer, arg_string, arg_lnum, arg_lnum, arg_dict_any}; static argcheck_T arg119_printf[] = {arg_string_or_nr, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any, arg_any}; -static argcheck_T arg23_reduce[] = {arg_string_list_tuple_or_blob, arg_any, arg_any}; +static argcheck_T arg23_reduce[] = {arg_string_list_or_blob, arg_any, arg_any}; static argcheck_T arg24_remote_expr[] = {arg_string, arg_string, arg_string, arg_number}; static argcheck_T arg23_remove[] = {arg_list_or_dict_or_blob_mod, arg_remove2, arg_number}; static argcheck_T arg2_repeat[] = {arg_repeat1, arg_number}; @@ -1494,13 +1364,6 @@ ret_list_regionpos(int argcount UNUSED, return &t_list_list_list_number; } static type_T * -ret_tuple_any(int argcount UNUSED, - type2_T *argtypes UNUSED, - type_T **decl_type UNUSED) -{ - return &t_tuple_any; -} - static type_T * ret_dict_any(int argcount UNUSED, type2_T *argtypes UNUSED, type_T **decl_type UNUSED) @@ -1594,7 +1457,6 @@ ret_slice(int argcount, case VAR_STRING: *decl_type = &t_string; break; case VAR_BLOB: *decl_type = &t_blob; break; case VAR_LIST: *decl_type = &t_list_any; break; - case VAR_TUPLE: *decl_type = &t_tuple_any; break; default: break; } } @@ -2092,8 +1954,6 @@ static funcentry_T global_functions[] = ret_number, f_cindent}, {"clearmatches", 0, 1, FEARG_1, arg1_number, ret_void, f_clearmatches}, - {"cmdcomplete_info",0, 0, 0, NULL, - ret_dict_any, f_cmdcomplete_info}, {"col", 1, 2, FEARG_1, arg2_string_or_list_number, ret_number, f_col}, {"complete", 2, 2, FEARG_2, arg2_number_list, @@ -2104,8 +1964,6 @@ static funcentry_T global_functions[] = ret_number_bool, f_complete_check}, {"complete_info", 0, 1, FEARG_1, arg1_list_string, ret_dict_any, f_complete_info}, - {"complete_match", 0, 2, 0, NULL, - ret_list_any, f_complete_match}, {"confirm", 1, 4, FEARG_1, arg4_string_string_number_string, ret_number, f_confirm}, {"copy", 1, 1, FEARG_1, NULL, @@ -2430,7 +2288,7 @@ static funcentry_T global_functions[] = ret_number_bool, f_islocked}, {"isnan", 1, 1, FEARG_1, arg1_float_or_nr, ret_number_bool, MATH_FUNC(f_isnan)}, - {"items", 1, 1, FEARG_1, arg1_string_list_tuple_or_dict, + {"items", 1, 1, FEARG_1, arg1_string_or_list_or_dict, ret_list_items, f_items}, {"job_getchannel", 1, 1, FEARG_1, arg1_job, ret_channel, JOB_FUNC(f_job_getchannel)}, @@ -2444,7 +2302,7 @@ static funcentry_T global_functions[] = ret_string, JOB_FUNC(f_job_status)}, {"job_stop", 1, 2, FEARG_1, arg2_job_string_or_number, ret_number_bool, JOB_FUNC(f_job_stop)}, - {"join", 1, 2, FEARG_1, arg2_list_or_tuple_string, + {"join", 1, 2, FEARG_1, arg2_list_any_string, ret_string, f_join}, {"js_decode", 1, 1, FEARG_1, arg1_string, ret_any, f_js_decode}, @@ -2476,8 +2334,6 @@ static funcentry_T global_functions[] = ret_blob, f_list2blob}, {"list2str", 1, 2, FEARG_1, arg2_list_number_bool, ret_string, f_list2str}, - {"list2tuple", 1, 1, FEARG_1, arg1_list_any, - ret_tuple_any, f_list2tuple}, {"listener_add", 1, 2, FEARG_2, arg2_any_buffer, ret_number, f_listener_add}, {"listener_flush", 0, 1, FEARG_1, arg1_buffer, @@ -2536,7 +2392,7 @@ static funcentry_T global_functions[] = ret_list_any, f_matchstrlist}, {"matchstrpos", 2, 4, FEARG_1, arg24_match_func, ret_list_any, f_matchstrpos}, - {"max", 1, 1, FEARG_1, arg1_list_or_tuple_or_dict, + {"max", 1, 1, FEARG_1, arg1_list_or_dict, ret_number, f_max}, {"menu_info", 1, 2, FEARG_1, arg2_string, ret_dict_any, @@ -2546,7 +2402,7 @@ static funcentry_T global_functions[] = NULL #endif }, - {"min", 1, 1, FEARG_1, arg1_list_or_tuple_or_dict, + {"min", 1, 1, FEARG_1, arg1_list_or_dict, ret_number, f_min}, {"mkdir", 1, 3, FEARG_1, arg3_string_string_number, ret_number_bool, f_mkdir}, @@ -2732,7 +2588,7 @@ static funcentry_T global_functions[] = ret_repeat, f_repeat}, {"resolve", 1, 1, FEARG_1, arg1_string, ret_string, f_resolve}, - {"reverse", 1, 1, FEARG_1, arg1_reverse, + {"reverse", 1, 1, FEARG_1, arg1_string_or_list_or_blob_mod, ret_first_arg, f_reverse}, {"round", 1, 1, FEARG_1, arg1_float_or_nr, ret_float, f_round}, @@ -3062,8 +2918,6 @@ static funcentry_T global_functions[] = ret_func_any, f_test_null_partial}, {"test_null_string", 0, 0, 0, NULL, ret_string, f_test_null_string}, - {"test_null_tuple", 0, 0, 0, NULL, - ret_tuple_any, f_test_null_tuple}, {"test_option_not_set", 1, 1, FEARG_1, arg1_string, ret_void, f_test_option_not_set}, {"test_override", 2, 2, FEARG_2, arg2_string_number, @@ -3100,8 +2954,6 @@ static funcentry_T global_functions[] = ret_string, f_trim}, {"trunc", 1, 1, FEARG_1, arg1_float_or_nr, ret_float, f_trunc}, - {"tuple2list", 1, 1, FEARG_1, arg1_tuple_any, - ret_list_any, f_tuple2list}, {"type", 1, 1, FEARG_1|FE_X, NULL, ret_number, f_type}, {"typename", 1, 1, FEARG_1|FE_X, NULL, @@ -4374,9 +4226,6 @@ f_empty(typval_T *argvars, typval_T *rettv) n = argvars[0].vval.v_list == NULL || argvars[0].vval.v_list->lv_len == 0; break; - case VAR_TUPLE: - n = tuple_len(argvars[0].vval.v_tuple) == 0; - break; case VAR_DICT: n = argvars[0].vval.v_dict == NULL || argvars[0].vval.v_dict->dv_hashtab.ht_used == 0; @@ -5414,7 +5263,6 @@ f_get(typval_T *argvars, typval_T *rettv) { listitem_T *li; list_T *l; - tuple_T *tuple; dictitem_T *di; dict_T *d; typval_T *tv = NULL; @@ -5450,18 +5298,6 @@ f_get(typval_T *argvars, typval_T *rettv) tv = &li->li_tv; } } - else if (argvars[0].v_type == VAR_TUPLE) - { - if ((tuple = argvars[0].vval.v_tuple) != NULL) - { - int error = FALSE; - long idx; - - idx = (long)tv_get_number_chk(&argvars[1], &error); - if (!error) - tv = tuple_find(tuple, idx); - } - } else if (argvars[0].v_type == VAR_DICT) { if ((d = argvars[0].vval.v_dict) != NULL) @@ -5564,7 +5400,7 @@ f_get(typval_T *argvars, typval_T *rettv) } } else - semsg(_(e_argument_of_str_must_be_list_tuple_dictionary_or_blob), "get()"); + semsg(_(e_argument_of_str_must_be_list_dictionary_or_blob), "get()"); if (tv == NULL) { @@ -5582,34 +5418,34 @@ f_get(typval_T *argvars, typval_T *rettv) f_getcellpixels(typval_T *argvars UNUSED, typval_T *rettv) { if (rettv_list_alloc(rettv) == FAIL) - return; + return; #if defined(FEAT_GUI) if (gui.in_use) { - // success pixel size and no gui. - list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_width); - list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_height); + // success pixel size and no gui. + list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_width); + list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_height); } else #endif { - struct cellsize cs; + struct cellsize cs; #if defined(UNIX) - mch_calc_cell_size(&cs); + mch_calc_cell_size(&cs); #else - // Non-Unix CUIs are not supported, so set this to -1x-1. - cs.cs_xpixel = -1; - cs.cs_ypixel = -1; + // Non-Unix CUIs are not supported, so set this to -1x-1. + cs.cs_xpixel = -1; + cs.cs_ypixel = -1; #endif - // failed get pixel size. - if (cs.cs_xpixel == -1) - return; + // failed get pixel size. + if (cs.cs_xpixel == -1) + return; - // success pixel size and no gui. - list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_xpixel); - list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_ypixel); + // success pixel size and no gui. + list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_xpixel); + list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_ypixel); } } @@ -7975,7 +7811,6 @@ f_id(typval_T *argvars, typval_T *rettv) switch (argvars[0].v_type) { case VAR_LIST: - case VAR_TUPLE: case VAR_DICT: case VAR_OBJECT: case VAR_JOB: @@ -8002,85 +7837,68 @@ f_id(typval_T *argvars, typval_T *rettv) } /* - * index() function for a blob + * "index()" function */ static void -index_func_blob(typval_T *argvars, typval_T *rettv) +f_index(typval_T *argvars, typval_T *rettv) { - typval_T tv; + list_T *l; + listitem_T *item; blob_T *b; - int start = 0; - int error = FALSE; + long idx = 0; int ic = FALSE; + int error = FALSE; - b = argvars[0].vval.v_blob; - if (b == NULL) - return; + rettv->vval.v_number = -1; - if (argvars[2].v_type != VAR_UNKNOWN) - { - start = tv_get_number_chk(&argvars[2], &error); - if (error) - return; - } + if (in_vim9script() + && (check_for_list_or_blob_arg(argvars, 0) == FAIL + || (argvars[0].v_type == VAR_BLOB + && check_for_number_arg(argvars, 1) == FAIL) + || check_for_opt_number_arg(argvars, 2) == FAIL + || (argvars[2].v_type != VAR_UNKNOWN + && check_for_opt_bool_arg(argvars, 3) == FAIL))) + return; - if (start < 0) + if (argvars[0].v_type == VAR_BLOB) { - start = blob_len(b) + start; - if (start < 0) - start = 0; - } + typval_T tv; + int start = 0; - for (int idx = start; idx < blob_len(b); ++idx) - { - tv.v_type = VAR_NUMBER; - tv.vval.v_number = blob_get(b, idx); - if (tv_equal(&tv, &argvars[1], ic)) + if (argvars[2].v_type != VAR_UNKNOWN) { - rettv->vval.v_number = idx; + start = tv_get_number_chk(&argvars[2], &error); + if (error) + return; + } + b = argvars[0].vval.v_blob; + if (b == NULL) return; + if (start < 0) + { + start = blob_len(b) + start; + if (start < 0) + start = 0; } - } -} -/* - * index() function for a tuple - */ - static void -index_func_tuple(typval_T *argvars, typval_T *rettv) -{ - tuple_T *tuple = argvars[0].vval.v_tuple; - int ic = FALSE; - int error = FALSE; - - if (tuple == NULL) + for (idx = start; idx < blob_len(b); ++idx) + { + tv.v_type = VAR_NUMBER; + tv.vval.v_number = blob_get(b, idx); + if (tv_equal(&tv, &argvars[1], ic)) + { + rettv->vval.v_number = idx; + return; + } + } return; - - int start_idx = 0; - if (argvars[2].v_type != VAR_UNKNOWN) + } + else if (argvars[0].v_type != VAR_LIST) { - start_idx = tv_get_number_chk(&argvars[2], &error); - if (!error && argvars[3].v_type != VAR_UNKNOWN) - ic = (int)tv_get_bool_chk(&argvars[3], &error); - if (error) - return; + emsg(_(e_list_or_blob_required)); + return; } - rettv->vval.v_number = index_tuple(tuple, &argvars[1], start_idx, ic); -} - -/* - * index() function for a list - */ - static void -index_func_list(typval_T *argvars, typval_T *rettv) -{ - list_T *l; - listitem_T *item; - long idx = 0; - int ic = FALSE; - int error = FALSE; - l = argvars[0].vval.v_list; if (l == NULL) return; @@ -8107,39 +7925,12 @@ index_func_list(typval_T *argvars, typval_T *rettv) } } -/* - * "index()" function - */ - static void -f_index(typval_T *argvars, typval_T *rettv) -{ - rettv->vval.v_number = -1; - - if (in_vim9script() - && (check_for_list_or_tuple_or_blob_arg(argvars, 0) == FAIL - || (argvars[0].v_type == VAR_BLOB - && check_for_number_arg(argvars, 1) == FAIL) - || check_for_opt_number_arg(argvars, 2) == FAIL - || (argvars[2].v_type != VAR_UNKNOWN - && check_for_opt_bool_arg(argvars, 3) == FAIL))) - return; - - if (argvars[0].v_type == VAR_BLOB) - index_func_blob(argvars, rettv); - else if (argvars[0].v_type == VAR_TUPLE) - index_func_tuple(argvars, rettv); - else if (argvars[0].v_type == VAR_LIST) - index_func_list(argvars, rettv); - else - emsg(_(e_list_or_blob_required)); -} - /* * Evaluate 'expr' with the v:key and v:val arguments and return the result. * The expression is expected to return a boolean value. The caller should set * the VV_KEY and VV_VAL vim variables before calling this function. */ - int + static int indexof_eval_expr(typval_T *expr) { typval_T argv[3]; @@ -8262,7 +8053,7 @@ f_indexof(typval_T *argvars, typval_T *rettv) rettv->vval.v_number = -1; - if (check_for_list_or_tuple_or_blob_arg(argvars, 0) == FAIL + if (check_for_list_or_blob_arg(argvars, 0) == FAIL || check_for_string_or_func_arg(argvars, 1) == FAIL || check_for_opt_dict_arg(argvars, 2) == FAIL) return; @@ -8288,9 +8079,6 @@ f_indexof(typval_T *argvars, typval_T *rettv) if (argvars[0].v_type == VAR_BLOB) rettv->vval.v_number = indexof_blob(argvars[0].vval.v_blob, startidx, &argvars[1]); - else if (argvars[0].v_type == VAR_TUPLE) - rettv->vval.v_number = indexof_tuple(argvars[0].vval.v_tuple, startidx, - &argvars[1]); else rettv->vval.v_number = indexof_list(argvars[0].vval.v_list, startidx, &argvars[1]); @@ -8636,9 +8424,6 @@ f_islocked(typval_T *argvars, typval_T *rettv) else if (lv.ll_list != NULL) // List item. rettv->vval.v_number = tv_islocked(&lv.ll_li->li_tv); - else if (lv.ll_tuple != NULL) - // Tuple item. - rettv->vval.v_number = tv_islocked(lv.ll_tv); else // Dictionary item. rettv->vval.v_number = tv_islocked(&lv.ll_di->di_tv); @@ -8703,9 +8488,6 @@ f_len(typval_T *argvars, typval_T *rettv) case VAR_LIST: rettv->vval.v_number = list_len(argvars[0].vval.v_list); break; - case VAR_TUPLE: - rettv->vval.v_number = tuple_len(argvars[0].vval.v_tuple); - break; case VAR_DICT: rettv->vval.v_number = dict_len(argvars[0].vval.v_dict); break; @@ -9168,7 +8950,7 @@ get_matches_in_str( if (d == NULL) return FAIL; if (list_append_dict(mlist, d) == FAIL) - return FAIL; + return FAIL;; if (dict_add_number(d, matchbuf ? "lnum" : "idx", idx) == FAIL) return FAIL; @@ -9447,8 +9229,7 @@ max_min(typval_T *argvars, typval_T *rettv, int domax) varnumber_T i; int error = FALSE; - if (in_vim9script() && - check_for_list_or_tuple_or_dict_arg(argvars, 0) == FAIL) + if (in_vim9script() && check_for_list_or_dict_arg(argvars, 0) == FAIL) return; if (argvars[0].v_type == VAR_LIST) @@ -9490,12 +9271,6 @@ max_min(typval_T *argvars, typval_T *rettv, int domax) } } } - else if (argvars[0].v_type == VAR_TUPLE) - { - n = tuple_max_min(argvars[0].vval.v_tuple, domax, &error); - if (error) - return; - } else if (argvars[0].v_type == VAR_DICT) { dict_T *d; @@ -10301,114 +10076,83 @@ f_rename(typval_T *argvars, typval_T *rettv) } /* - * Repeat the list "l" "n" times and set "rettv" to the new list. - */ - static void -repeat_list(list_T *l, int n, typval_T *rettv) -{ - if (rettv_list_alloc(rettv) == FAIL - || l == NULL - || n <= 0) - return; - - while (n-- > 0) - if (list_extend(rettv->vval.v_list, l, NULL) == FAIL) - break; -} - -/* - * Repeat the blob "b" "n" times and set "rettv" to the new blob. + * "repeat()" function */ static void -repeat_blob(typval_T *blob_tv, int n, typval_T *rettv) +f_repeat(typval_T *argvars, typval_T *rettv) { + char_u *p; + varnumber_T n; int slen; int len; + char_u *r; int i; - blob_T *blob = blob_tv->vval.v_blob; - - if (rettv_blob_alloc(rettv) == FAIL - || blob == NULL - || n <= 0) - return; - - slen = blob->bv_ga.ga_len; - len = (int)slen * n; - if (len <= 0) - return; - - if (ga_grow(&rettv->vval.v_blob->bv_ga, len) == FAIL) - return; - - rettv->vval.v_blob->bv_ga.ga_len = len; - for (i = 0; i < slen; ++i) - if (blob_get(blob, i) != 0) - break; - - if (i == slen) - // No need to copy since all bytes are already zero + if (in_vim9script() + && (check_for_string_or_number_or_list_or_blob_arg(argvars, 0) + == FAIL + || check_for_number_arg(argvars, 1) == FAIL)) return; - for (i = 0; i < n; ++i) - blob_set_range(rettv->vval.v_blob, - (long)i * slen, ((long)i + 1) * slen - 1, blob_tv); -} + n = tv_get_number(&argvars[1]); + if (argvars[0].v_type == VAR_LIST) + { + if (rettv_list_alloc(rettv) == OK && argvars[0].vval.v_list != NULL) + while (n-- > 0) + if (list_extend(rettv->vval.v_list, + argvars[0].vval.v_list, NULL) == FAIL) + break; + } + else if (argvars[0].v_type == VAR_BLOB) + { + if (rettv_blob_alloc(rettv) == FAIL + || argvars[0].vval.v_blob == NULL + || n <= 0) + return; -/* - * Repeat the string "str" "n" times and set "rettv" to the new string. - */ - static void -repeat_string(typval_T *str_tv, int n, typval_T *rettv) -{ - char_u *p; - int slen; - int len; - char_u *r; - int i; + slen = argvars[0].vval.v_blob->bv_ga.ga_len; + len = (int)slen * n; + if (len <= 0) + return; - p = tv_get_string(str_tv); - rettv->v_type = VAR_STRING; - rettv->vval.v_string = NULL; + if (ga_grow(&rettv->vval.v_blob->bv_ga, len) == FAIL) + return; - slen = (int)STRLEN(p); - len = slen * n; - if (len <= 0) - return; + rettv->vval.v_blob->bv_ga.ga_len = len; - r = alloc(len + 1); - if (r == NULL) - return; + for (i = 0; i < slen; ++i) + if (blob_get(argvars[0].vval.v_blob, i) != 0) + break; - for (i = 0; i < n; i++) - mch_memmove(r + i * slen, p, (size_t)slen); - r[len] = NUL; + if (i == slen) + // No need to copy since all bytes are already zero + return; - rettv->vval.v_string = r; -} + for (i = 0; i < n; ++i) + blob_set_range(rettv->vval.v_blob, + (long)i * slen, ((long)i + 1) * slen - 1, argvars); + } + else + { + p = tv_get_string(&argvars[0]); + rettv->v_type = VAR_STRING; + rettv->vval.v_string = NULL; -/* - * "repeat()" function - */ - static void -f_repeat(typval_T *argvars, typval_T *rettv) -{ - varnumber_T n; + slen = (int)STRLEN(p); + len = slen * n; + if (len <= 0) + return; - if (in_vim9script() - && (check_for_repeat_func_arg(argvars, 0) == FAIL - || check_for_number_arg(argvars, 1) == FAIL)) - return; + r = alloc(len + 1); + if (r != NULL) + { + for (i = 0; i < n; i++) + mch_memmove(r + i * slen, p, (size_t)slen); + r[len] = NUL; + } - n = tv_get_number(&argvars[1]); - if (argvars[0].v_type == VAR_LIST) - repeat_list(argvars[0].vval.v_list, n, rettv); - else if (argvars[0].v_type == VAR_TUPLE) - tuple_repeat(argvars[0].vval.v_tuple, n, rettv); - else if (argvars[0].v_type == VAR_BLOB) - repeat_blob(&argvars[0], n, rettv); - else - repeat_string(&argvars[0], n, rettv); + rettv->vval.v_string = r; + } } #define SP_NOMOVE 0x01 // don't move cursor @@ -12447,7 +12191,6 @@ f_type(typval_T *argvars, typval_T *rettv) case VAR_PARTIAL: case VAR_FUNC: n = VAR_TYPE_FUNC; break; case VAR_LIST: n = VAR_TYPE_LIST; break; - case VAR_TUPLE: n = VAR_TYPE_TUPLE; break; case VAR_DICT: n = VAR_TYPE_DICT; break; case VAR_FLOAT: n = VAR_TYPE_FLOAT; break; case VAR_BOOL: n = VAR_TYPE_BOOL; break; diff --git a/src/evalvars.c b/src/evalvars.c index 9382842f..2745ac27 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -162,7 +162,6 @@ static struct vimvar {VV_NAME("t_enum", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("t_enumvalue", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("stacktrace", VAR_LIST), &t_list_dict_any, VV_RO}, - {VV_NAME("t_tuple", VAR_NUMBER), NULL, VV_RO}, }; // shorthand @@ -266,9 +265,8 @@ evalvars_init(void) set_vim_var_nr(VV_TYPE_CLASS, VAR_TYPE_CLASS); set_vim_var_nr(VV_TYPE_OBJECT, VAR_TYPE_OBJECT); set_vim_var_nr(VV_TYPE_TYPEALIAS, VAR_TYPE_TYPEALIAS); - set_vim_var_nr(VV_TYPE_ENUM, VAR_TYPE_ENUM); + set_vim_var_nr(VV_TYPE_ENUM, VAR_TYPE_ENUM); set_vim_var_nr(VV_TYPE_ENUMVALUE, VAR_TYPE_ENUMVALUE); - set_vim_var_nr(VV_TYPE_TUPLE, VAR_TYPE_TUPLE); set_vim_var_nr(VV_ECHOSPACE, sc_col - 1); @@ -323,13 +321,13 @@ evalvars_clear(void) int garbage_collect_globvars(int copyID) { - return set_ref_in_ht(&globvarht, copyID, NULL, NULL); + return set_ref_in_ht(&globvarht, copyID, NULL); } int garbage_collect_vimvars(int copyID) { - return set_ref_in_ht(&vimvarht, copyID, NULL, NULL); + return set_ref_in_ht(&vimvarht, copyID, NULL); } int @@ -342,7 +340,7 @@ garbage_collect_scriptvars(int copyID) for (i = 1; i <= script_items.ga_len; ++i) { - abort = abort || set_ref_in_ht(&SCRIPT_VARS(i), copyID, NULL, NULL); + abort = abort || set_ref_in_ht(&SCRIPT_VARS(i), copyID, NULL); si = SCRIPT_ITEM(i); for (idx = 0; idx < si->sn_var_vals.ga_len; ++idx) @@ -350,7 +348,7 @@ garbage_collect_scriptvars(int copyID) svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx; if (sv->sv_name != NULL) - abort = abort || set_ref_in_item(sv->sv_tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(sv->sv_tv, copyID, NULL, NULL); } } @@ -1236,13 +1234,10 @@ ex_let_vars( { char_u *arg = arg_start; list_T *l; - tuple_T *tuple = NULL; int i; int var_idx = 0; - listitem_T *item = NULL; + listitem_T *item; typval_T ltv; - int is_list = tv->v_type == VAR_LIST; - int idx; if (tv->v_type == VAR_VOID) { @@ -1258,121 +1253,58 @@ ex_let_vars( } // ":let [v1, v2] = list" or ":for [v1, v2] in listlist" - // or - // ":let [v1, v2] = tuple" or ":for [v1, v2] in tupletuple" - if (tv->v_type != VAR_LIST && tv->v_type != VAR_TUPLE) + if (tv->v_type != VAR_LIST || (l = tv->vval.v_list) == NULL) { - emsg(_(e_list_or_tuple_required)); + emsg(_(e_list_required)); return FAIL; } - if (is_list) - { - l = tv->vval.v_list; - if (l == NULL) - { - emsg(_(e_list_required)); - return FAIL; - } - i = list_len(l); - } - else - { - tuple = tv->vval.v_tuple; - if (tuple == NULL) - { - emsg(_(e_tuple_required)); - return FAIL; - } - i = tuple_len(tuple); - } + i = list_len(l); if (semicolon == 0 && var_count < i) { - emsg(_(is_list ? e_less_targets_than_list_items - : e_less_targets_than_tuple_items)); + emsg(_(e_less_targets_than_list_items)); return FAIL; } if (var_count - semicolon > i) { - emsg(_(is_list ? e_more_targets_than_list_items - : e_more_targets_than_tuple_items)); + emsg(_(e_more_targets_than_list_items)); return FAIL; } - if (is_list) - { - CHECK_LIST_MATERIALIZE(l); - item = l->lv_first; - } - else - idx = 0; - + CHECK_LIST_MATERIALIZE(l); + item = l->lv_first; while (*arg != ']') { arg = skipwhite(arg + 1); ++var_idx; - arg = ex_let_one(arg, is_list ? &item->li_tv : TUPLE_ITEM(tuple, idx), - TRUE, flags | ASSIGN_UNPACK, (char_u *)",;]", op, - var_idx); - if (is_list) - item = item->li_next; - else - idx++; + arg = ex_let_one(arg, &item->li_tv, TRUE, + flags | ASSIGN_UNPACK, (char_u *)",;]", op, var_idx); + item = item->li_next; if (arg == NULL) return FAIL; arg = skipwhite(arg); if (*arg == ';') { - // Put the rest of the list or tuple (may be empty) in the var - // after ';'. Create a new list or tuple for this. - if (is_list) - { - // Put the rest of the list (may be empty) in the var - // after ';'. Create a new list for this. - l = list_alloc(); - if (l == NULL) - return FAIL; - - // list - while (item != NULL) - { - list_append_tv(l, &item->li_tv); - item = item->li_next; - } - - ltv.v_type = VAR_LIST; - ltv.v_lock = 0; - ltv.vval.v_list = l; - l->lv_refcount = 1; - } - else + // Put the rest of the list (may be empty) in the var after ';'. + // Create a new list for this. + l = list_alloc(); + if (l == NULL) + return FAIL; + while (item != NULL) { - tuple_T *new_tuple = tuple_alloc(); - if (new_tuple == NULL) - return FAIL; - - // Put the rest of the tuple (may be empty) in the var - // after ';'. Create a new tuple for this. - while (idx < TUPLE_LEN(tuple)) - { - typval_T new_tv; - - copy_tv(TUPLE_ITEM(tuple, idx), &new_tv); - if (tuple_append_tv(new_tuple, &new_tv) == FAIL) - return FAIL; - idx++; - } - - ltv.v_type = VAR_TUPLE; - ltv.v_lock = 0; - ltv.vval.v_tuple = new_tuple; - new_tuple->tv_refcount = 1; + list_append_tv(l, &item->li_tv); + item = item->li_next; } + ltv.v_type = VAR_LIST; + ltv.v_lock = 0; + ltv.vval.v_list = l; + l->lv_refcount = 1; ++var_idx; + arg = ex_let_one(skipwhite(arg + 1), <v, FALSE, - flags | ASSIGN_UNPACK, (char_u *)"]", op, var_idx); + flags | ASSIGN_UNPACK, (char_u *)"]", op, var_idx); clear_tv(<v); if (arg == NULL) return FAIL; @@ -2486,9 +2418,6 @@ item_lock(typval_T *tv, int deep, int lock, int check_refcount) } } break; - case VAR_TUPLE: - tuple_lock(tv->vval.v_tuple, deep, lock, check_refcount); - break; case VAR_DICT: if ((d = tv->vval.v_dict) != NULL && !(check_refcount && d->dv_refcount > 1)) @@ -3260,9 +3189,9 @@ eval_variable( } } - // If a list or tuple or dict variable wasn't initialized and has - // meaningful type, do it now. Not for global variables, they are - // not declared. + // If a list or dict variable wasn't initialized and has meaningful + // type, do it now. Not for global variables, they are not + // declared. if (ht != &globvarht) { if (tv->v_type == VAR_DICT && tv->vval.v_dict == NULL @@ -3291,19 +3220,6 @@ eval_variable( sv->sv_flags |= SVFLAG_ASSIGNED; } } - else if (tv->v_type == VAR_TUPLE && tv->vval.v_tuple == NULL - && ((type != NULL && !was_assigned) - || !in_vim9script())) - { - tv->vval.v_tuple = tuple_alloc(); - if (tv->vval.v_tuple != NULL) - { - ++tv->vval.v_tuple->tv_refcount; - tv->vval.v_tuple->tv_type = alloc_type(type); - if (sv != NULL) - sv->sv_flags |= SVFLAG_ASSIGNED; - } - } else if (tv->v_type == VAR_BLOB && tv->vval.v_blob == NULL && ((type != NULL && !was_assigned) || !in_vim9script())) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 4eb67e31..e1e6c4ee 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2743,9 +2743,9 @@ do_ecmd( } if (buf == NULL) goto theend; - // autocommands try to edit a closing buffer, which like splitting, can - // result in more windows displaying it; abort - if (buf->b_locked_split) + // autocommands try to edit a file that is going to be removed, + // abort + if (buf_locked(buf)) { // window was split, but not editing the new buffer, // reset b_nwindows again @@ -2753,7 +2753,6 @@ do_ecmd( && curwin->w_buffer != NULL && curwin->w_buffer->b_nwindows > 1) --curwin->w_buffer->b_nwindows; - emsg(_(e_cannot_switch_to_a_closing_buffer)); goto theend; } if (curwin->w_alt_fnum == buf->b_fnum && prev_alt_fnum != 0) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 0dad7b13..bda20f54 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -289,6 +289,7 @@ static void ex_tag_cmd(exarg_T *eap, char_u *name); # define ex_endif ex_ni # define ex_endtry ex_ni # define ex_endwhile ex_ni +# define ex_enum ex_ni # define ex_eval ex_ni # define ex_execute ex_ni # define ex_finally ex_ni @@ -3798,12 +3799,8 @@ find_ex_command( if (eq != NULL) { eq = skipwhite(eq); - if (vim_strchr((char_u *)"+-*/%.", *eq) != NULL) - { - if (eq[0] == '.' && eq[1] == '.') - ++eq; + if (vim_strchr((char_u *)"+-*/%", *eq) != NULL) ++eq; - } } if (p == NULL || p == eap->cmd || *eq != '=') { @@ -5975,7 +5972,7 @@ get_command_name(expand_T *xp UNUSED, int idx) return expand_user_command_name(idx); // the following are no real commands if (STRNCMP(cmdnames[idx].cmd_name, "{", 1) == 0 || - STRNCMP(cmdnames[idx].cmd_name, "}", 1) == 0) + STRNCMP(cmdnames[idx].cmd_name, "}", 1) == 0) return (char_u *)""; return cmdnames[idx].cmd_name; } @@ -9326,12 +9323,6 @@ ex_stopinsert(exarg_T *eap UNUSED) { restart_edit = 0; stop_insert_mode = TRUE; -#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) - // when called from remote_expr in insert mode, make sure insert mode is - // ended by adding K_NOP to the typeahead buffer - if (vgetc_busy) - ins_char_typebuf(K_NOP, 0); -#endif clearmode(); } diff --git a/src/ex_getln.c b/src/ex_getln.c index bbfe1e59..c4b0a009 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1620,7 +1620,6 @@ getcmdline_int( int did_save_ccline = FALSE; int cmdline_type; int wild_type = 0; - int event_cmdlineleavepre_triggered = FALSE; // one recursion level deeper ++depth; @@ -1664,7 +1663,6 @@ getcmdline_int( ExpandInit(&xpc); ccline.xpc = &xpc; - clear_cmdline_orig(); #ifdef FEAT_RIGHTLEFT if (curwin->w_p_rl && *curwin->w_p_rlc == 's' @@ -1917,17 +1915,6 @@ getcmdline_int( } } - // Trigger CmdlineLeavePre autocommand - if (KeyTyped && (c == '\n' || c == '\r' || c == K_KENTER || c == ESC -#ifdef UNIX - || c == intr_char -#endif - || c == Ctrl_C)) - { - trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVEPRE); - event_cmdlineleavepre_triggered = TRUE; - } - // The wildmenu is cleared if the pressed key is not used for // navigating the wild menu (i.e. the key is not 'wildchar' or // 'wildcharm' or Ctrl-N or Ctrl-P or Ctrl-A or Ctrl-L). @@ -2560,9 +2547,6 @@ getcmdline_int( } returncmd: - // Trigger CmdlineLeavePre autocommands if not already triggered. - if (!event_cmdlineleavepre_triggered) - trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVEPRE); #ifdef FEAT_RIGHTLEFT cmdmsg_rl = FALSE; @@ -2579,7 +2563,6 @@ getcmdline_int( ExpandCleanup(&xpc); ccline.xpc = NULL; - clear_cmdline_orig(); #ifdef FEAT_SEARCH_EXTRA finish_incsearch_highlighting(gotesc, &is_state, FALSE); diff --git a/src/feature.h b/src/feature.h index 703a72fc..bcfc4a40 100644 --- a/src/feature.h +++ b/src/feature.h @@ -1015,19 +1015,18 @@ * +tgetent */ - /* - * The +channel feature requires +eval. + * The Netbeans feature requires +eval. */ -#if !defined(FEAT_EVAL) && defined(FEAT_JOB_CHANNEL) -# undef FEAT_JOB_CHANNEL +#if !defined(FEAT_EVAL) && defined(FEAT_NETBEANS_INTG) +# undef FEAT_NETBEANS_INTG #endif /* - * The Netbeans feature requires +eval and +job_channel + * The +channel feature requires +eval. */ -#if (!defined(FEAT_EVAL) || !defined(FEAT_JOB_CHANNEL)) && defined(FEAT_NETBEANS_INTG) -# undef FEAT_NETBEANS_INTG +#if !defined(FEAT_EVAL) && defined(FEAT_JOB_CHANNEL) +# undef FEAT_JOB_CHANNEL #endif /* diff --git a/src/fileio.c b/src/fileio.c index f6e35ab7..0ccfd2d9 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5476,8 +5476,6 @@ vim_tempname( // "sh". NOTE: This also checks 'shellcmdflag' to help those people who // didn't set 'shellslash' but only if not using PowerShell. retval = utf16_to_enc(itmp, NULL); - if (retval == NULL) - return NULL; shname = gettail(p_sh); if ((*p_shcf == '-' && !(strstr((char *)shname, "powershell") != NULL || strstr((char *)shname, "pwsh") != NULL )) diff --git a/src/findfile.c b/src/findfile.c index fd2d69f2..2bd1e7eb 100644 --- a/src/findfile.c +++ b/src/findfile.c @@ -1166,8 +1166,7 @@ vim_findfile(void *search_ctx_arg) if (*suf == NUL) break; file_path.length = len + copy_option_part(&suf, - file_path.string + len, - (int)(MAXPATHL - len), ","); + file_path.string + len, MAXPATHL - len, ","); } } } diff --git a/src/float.c b/src/float.c index 4c8e5fe1..9e8074de 100644 --- a/src/float.c +++ b/src/float.c @@ -41,7 +41,7 @@ string2float( *value = INFINITY; return 3; } - if (STRNICMP(text, "-inf", 4) == 0) + if (STRNICMP(text, "-inf", 3) == 0) { *value = -INFINITY; return 4; diff --git a/src/fold.c b/src/fold.c index 4824a807..b165dc9b 100644 --- a/src/fold.c +++ b/src/fold.c @@ -3576,7 +3576,7 @@ put_folds_recurse(FILE *fd, garray_T *gap, linenr_T off) // Do nested folds first, they will be created closed. if (put_folds_recurse(fd, &fp->fd_nested, off + fp->fd_top) == FAIL) return FAIL; - if (fprintf(fd, "sil! %ld,%ldfold", fp->fd_top + off, + if (fprintf(fd, "%ld,%ldfold", fp->fd_top + off, fp->fd_top + off + fp->fd_len - 1) < 0 || put_eol(fd) == FAIL) return FAIL; @@ -3609,10 +3609,9 @@ put_foldopen_recurse( if (fp->fd_nested.ga_len > 0) { // open nested folds while this fold is open - // ignore errors if (fprintf(fd, "%ld", fp->fd_top + off) < 0 || put_eol(fd) == FAIL - || put_line(fd, "sil! normal! zo") == FAIL) + || put_line(fd, "normal! zo") == FAIL) return FAIL; if (put_foldopen_recurse(fd, wp, &fp->fd_nested, off + fp->fd_top) @@ -3653,7 +3652,7 @@ put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off) { if (fprintf(fd, "%ld", fp->fd_top + off) < 0 || put_eol(fd) == FAIL - || fprintf(fd, "sil! normal! z%c", + || fprintf(fd, "normal! z%c", fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0 || put_eol(fd) == FAIL) return FAIL; diff --git a/src/gc.c b/src/gc.c index c8aa5faa..54c74448 100644 --- a/src/gc.c +++ b/src/gc.c @@ -122,31 +122,31 @@ garbage_collect(int testing) // buffer-local variables FOR_ALL_BUFFERS(buf) abort = abort || set_ref_in_item(&buf->b_bufvar.di_tv, copyID, - NULL, NULL, NULL); + NULL, NULL); // window-local variables FOR_ALL_TAB_WINDOWS(tp, wp) abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID, - NULL, NULL, NULL); + NULL, NULL); // window-local variables in autocmd windows for (int i = 0; i < AUCMD_WIN_COUNT; ++i) if (aucmd_win[i].auc_win != NULL) abort = abort || set_ref_in_item( - &aucmd_win[i].auc_win->w_winvar.di_tv, copyID, NULL, NULL, NULL); + &aucmd_win[i].auc_win->w_winvar.di_tv, copyID, NULL, NULL); #ifdef FEAT_PROP_POPUP FOR_ALL_POPUPWINS(wp) abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID, - NULL, NULL, NULL); + NULL, NULL); FOR_ALL_TABPAGES(tp) FOR_ALL_POPUPWINS_IN_TAB(tp, wp) abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID, - NULL, NULL, NULL); + NULL, NULL); #endif // tabpage-local variables FOR_ALL_TABPAGES(tp) abort = abort || set_ref_in_item(&tp->tp_winvar.di_tv, copyID, - NULL, NULL, NULL); + NULL, NULL); // global variables abort = abort || garbage_collect_globvars(copyID); @@ -269,9 +269,6 @@ free_unref_items(int copyID) // Go through the list of lists and free items without this copyID. did_free |= list_free_nonref(copyID); - // Go through the list of tuples and free items without this copyID. - did_free |= tuple_free_nonref(copyID); - // Go through the list of objects and free items without this copyID. did_free |= object_free_nonref(copyID); @@ -294,7 +291,6 @@ free_unref_items(int copyID) object_free_items(copyID); dict_free_items(copyID); list_free_items(copyID); - tuple_free_items(copyID); #ifdef FEAT_JOB_CHANNEL // Go through the list of jobs and free items without the copyID. This @@ -318,11 +314,7 @@ free_unref_items(int copyID) * Returns TRUE if setting references failed somehow. */ int -set_ref_in_ht( - hashtab_T *ht, - int copyID, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) +set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack) { int todo; int abort = FALSE; @@ -344,9 +336,8 @@ set_ref_in_ht( if (!HASHITEM_EMPTY(hi)) { --todo; - abort = abort - || set_ref_in_item(&HI2DI(hi)->di_tv, copyID, - &ht_stack, list_stack, tuple_stack); + abort = abort || set_ref_in_item(&HI2DI(hi)->di_tv, copyID, + &ht_stack, list_stack); } } @@ -375,7 +366,7 @@ set_ref_in_dict(dict_T *d, int copyID) if (d != NULL && d->dv_copyID != copyID) { d->dv_copyID = copyID; - return set_ref_in_ht(&d->dv_hashtab, copyID, NULL, NULL); + return set_ref_in_ht(&d->dv_hashtab, copyID, NULL); } return FALSE; } @@ -391,7 +382,7 @@ set_ref_in_list(list_T *ll, int copyID) if (ll != NULL && ll->lv_copyID != copyID) { ll->lv_copyID = copyID; - return set_ref_in_list_items(ll, copyID, NULL, NULL); + return set_ref_in_list_items(ll, copyID, NULL); } return FALSE; } @@ -403,11 +394,7 @@ set_ref_in_list(list_T *ll, int copyID) * Returns TRUE if setting references failed somehow. */ int -set_ref_in_list_items( - list_T *l, - int copyID, - ht_stack_T **ht_stack, - tuple_stack_T **tuple_stack) +set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack) { listitem_T *li; int abort = FALSE; @@ -424,7 +411,7 @@ set_ref_in_list_items( // list_stack. for (li = cur_l->lv_first; !abort && li != NULL; li = li->li_next) abort = abort || set_ref_in_item(&li->li_tv, copyID, - ht_stack, &list_stack, tuple_stack); + ht_stack, &list_stack); if (list_stack == NULL) break; @@ -438,65 +425,6 @@ set_ref_in_list_items( return abort; } -/* - * Mark a tuple and its items with "copyID". - * Returns TRUE if setting references failed somehow. - */ - int -set_ref_in_tuple(tuple_T *tuple, int copyID) -{ - if (tuple != NULL && tuple->tv_copyID != copyID) - { - tuple->tv_copyID = copyID; - return set_ref_in_tuple_items(tuple, copyID, NULL, NULL); - } - return FALSE; -} - -/* - * Mark all lists and dicts referenced through tuple "t" with "copyID". - * "ht_stack" is used to add hashtabs to be marked. Can be NULL. - * - * Returns TRUE if setting references failed somehow. - */ - int -set_ref_in_tuple_items( - tuple_T *tuple, - int copyID, - ht_stack_T **ht_stack, - list_stack_T **list_stack) -{ - int abort = FALSE; - tuple_T *cur_t; - tuple_stack_T *tuple_stack = NULL; - tuple_stack_T *tempitem; - - cur_t = tuple; - for (;;) - { - // Mark each item in the tuple. If the item contains a hashtab - // it is added to ht_stack, if it contains a list it is added to - // list_stack. - for (int i = 0; i < cur_t->tv_items.ga_len; i++) - { - typval_T *tv = ((typval_T *)cur_t->tv_items.ga_data) + i; - abort = abort - || set_ref_in_item(tv, copyID, - ht_stack, list_stack, &tuple_stack); - } - if (tuple_stack == NULL) - break; - - // take an item from the stack - cur_t = tuple_stack->tuple; - tempitem = tuple_stack; - tuple_stack = tuple_stack->prev; - free(tempitem); - } - - return abort; -} - /* * Mark the partial in callback 'cb' with "copyID". */ @@ -510,7 +438,7 @@ set_ref_in_callback(callback_T *cb, int copyID) tv.v_type = VAR_PARTIAL; tv.vval.v_partial = cb->cb_partial; - return set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + return set_ref_in_item(&tv, copyID, NULL, NULL); } /* @@ -522,8 +450,7 @@ set_ref_in_item_dict( dict_T *dd, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { if (dd == NULL || dd->dv_copyID == copyID) return FALSE; @@ -531,7 +458,7 @@ set_ref_in_item_dict( // Didn't see this dict yet. dd->dv_copyID = copyID; if (ht_stack == NULL) - return set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack, tuple_stack); + return set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack); ht_stack_T *newitem = ALLOC_ONE(ht_stack_T); if (newitem == NULL) @@ -553,8 +480,7 @@ set_ref_in_item_list( list_T *ll, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { if (ll == NULL || ll->lv_copyID == copyID) return FALSE; @@ -562,7 +488,7 @@ set_ref_in_item_list( // Didn't see this list yet. ll->lv_copyID = copyID; if (list_stack == NULL) - return set_ref_in_list_items(ll, copyID, ht_stack, tuple_stack); + return set_ref_in_list_items(ll, copyID, ht_stack); list_stack_T *newitem = ALLOC_ONE(list_stack_T); if (newitem == NULL) @@ -575,37 +501,6 @@ set_ref_in_item_list( return FALSE; } -/* - * Mark the tuple "tt" with "copyID". - * Also see set_ref_in_item(). - */ - static int -set_ref_in_item_tuple( - tuple_T *tt, - int copyID, - ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) -{ - if (tt == NULL || tt->tv_copyID == copyID) - return FALSE; - - // Didn't see this tuple yet. - tt->tv_copyID = copyID; - if (tuple_stack == NULL) - return set_ref_in_tuple_items(tt, copyID, ht_stack, list_stack); - - tuple_stack_T *newitem = ALLOC_ONE(tuple_stack_T); - if (newitem == NULL) - return TRUE; - - newitem->tuple = tt; - newitem->prev = *tuple_stack; - *tuple_stack = newitem; - - return FALSE; -} - /* * Mark the partial "pt" with "copyID". * Also see set_ref_in_item(). @@ -615,8 +510,7 @@ set_ref_in_item_partial( partial_T *pt, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { if (pt == NULL || pt->pt_copyID == copyID) return FALSE; @@ -632,7 +526,7 @@ set_ref_in_item_partial( dtv.v_type = VAR_DICT; dtv.vval.v_dict = pt->pt_dict; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } if (pt->pt_obj != NULL) @@ -641,12 +535,12 @@ set_ref_in_item_partial( objtv.v_type = VAR_OBJECT; objtv.vval.v_object = pt->pt_obj; - set_ref_in_item(&objtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&objtv, copyID, ht_stack, list_stack); } for (int i = 0; i < pt->pt_argc; ++i) abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); // pt_funcstack is handled in set_ref_in_funcstacks() // pt_loopvars is handled in set_ref_in_loopvars() @@ -663,8 +557,7 @@ set_ref_in_item_job( job_T *job, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { typval_T dtv; @@ -676,13 +569,13 @@ set_ref_in_item_job( { dtv.v_type = VAR_CHANNEL; dtv.vval.v_channel = job->jv_channel; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } if (job->jv_exit_cb.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; dtv.vval.v_partial = job->jv_exit_cb.cb_partial; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } return FALSE; @@ -697,8 +590,7 @@ set_ref_in_item_channel( channel_T *ch, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { typval_T dtv; @@ -710,33 +602,33 @@ set_ref_in_item_channel( { for (jsonq_T *jq = ch->ch_part[part].ch_json_head.jq_next; jq != NULL; jq = jq->jq_next) - set_ref_in_item(jq->jq_value, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(jq->jq_value, copyID, ht_stack, list_stack); for (cbq_T *cq = ch->ch_part[part].ch_cb_head.cq_next; cq != NULL; cq = cq->cq_next) if (cq->cq_callback.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; dtv.vval.v_partial = cq->cq_callback.cb_partial; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } if (ch->ch_part[part].ch_callback.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; dtv.vval.v_partial = ch->ch_part[part].ch_callback.cb_partial; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } } if (ch->ch_callback.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; dtv.vval.v_partial = ch->ch_callback.cb_partial; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } if (ch->ch_close_cb.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; dtv.vval.v_partial = ch->ch_close_cb.cb_partial; - set_ref_in_item(&dtv, copyID, ht_stack, list_stack, tuple_stack); + set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } return FALSE; @@ -752,8 +644,7 @@ set_ref_in_item_class( class_T *cl, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { int abort = FALSE; @@ -768,7 +659,7 @@ set_ref_in_item_class( for (int i = 0; !abort && i < cl->class_class_member_count; ++i) abort = abort || set_ref_in_item( &cl->class_members_tv[i], - copyID, ht_stack, list_stack, tuple_stack); + copyID, ht_stack, list_stack); } for (int i = 0; !abort && i < cl->class_class_function_count; ++i) @@ -791,8 +682,7 @@ set_ref_in_item_object( object_T *obj, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { int abort = FALSE; @@ -806,7 +696,7 @@ set_ref_in_item_object( for (int i = 0; !abort && i < obj->obj_class->class_obj_member_count; ++i) abort = abort || set_ref_in_item(mtv + i, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); return abort; } @@ -824,8 +714,7 @@ set_ref_in_item( typval_T *tv, int copyID, ht_stack_T **ht_stack, - list_stack_T **list_stack, - tuple_stack_T **tuple_stack) + list_stack_T **list_stack) { int abort = FALSE; @@ -833,15 +722,12 @@ set_ref_in_item( { case VAR_DICT: return set_ref_in_item_dict(tv->vval.v_dict, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); case VAR_LIST: return set_ref_in_item_list(tv->vval.v_list, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); - case VAR_TUPLE: - return set_ref_in_item_tuple(tv->vval.v_tuple, copyID, - ht_stack, list_stack, tuple_stack); case VAR_FUNC: { abort = set_ref_in_func(tv->vval.v_string, NULL, copyID); @@ -850,12 +736,12 @@ set_ref_in_item( case VAR_PARTIAL: return set_ref_in_item_partial(tv->vval.v_partial, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); case VAR_JOB: #ifdef FEAT_JOB_CHANNEL return set_ref_in_item_job(tv->vval.v_job, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); #else break; #endif @@ -863,18 +749,18 @@ set_ref_in_item( case VAR_CHANNEL: #ifdef FEAT_JOB_CHANNEL return set_ref_in_item_channel(tv->vval.v_channel, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); #else break; #endif case VAR_CLASS: return set_ref_in_item_class(tv->vval.v_class, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); case VAR_OBJECT: return set_ref_in_item_object(tv->vval.v_object, copyID, - ht_stack, list_stack, tuple_stack); + ht_stack, list_stack); case VAR_UNKNOWN: case VAR_ANY: diff --git a/src/globals.h b/src/globals.h index 7006364b..ef78b443 100644 --- a/src/globals.h +++ b/src/globals.h @@ -540,8 +540,8 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE); #define t_super (static_types[84]) #define t_const_super (static_types[85]) -#define t_object_any (static_types[86]) -#define t_const_object_any (static_types[87]) +#define t_object (static_types[86]) +#define t_const_object (static_types[87]) #define t_class (static_types[88]) #define t_const_class (static_types[89]) @@ -549,14 +549,7 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE); #define t_typealias (static_types[90]) #define t_const_typealias (static_types[91]) -#define t_tuple_any (static_types[92]) -#define t_const_tuple_any (static_types[93]) - -#define t_tuple_empty (static_types[94]) -#define t_const_tuple_empty (static_types[95]) - - -EXTERN type_T static_types[96] +EXTERN type_T static_types[92] #ifdef DO_INIT = { // 0: t_unknown @@ -731,7 +724,7 @@ EXTERN type_T static_types[96] {VAR_CLASS, 0, 0, TTFLAG_STATIC, &t_bool, NULL, NULL}, {VAR_CLASS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, &t_bool, NULL, NULL}, - // 86: t_object_any + // 86: t_object {VAR_OBJECT, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL}, {VAR_OBJECT, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, @@ -742,14 +735,6 @@ EXTERN type_T static_types[96] // 90: t_typealias {VAR_TYPEALIAS, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL}, {VAR_TYPEALIAS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, - - // 92: t_tuple_any - {VAR_TUPLE, -1, 0, TTFLAG_STATIC, NULL, NULL, NULL}, - {VAR_TUPLE, -1, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, - - // 94: t_tuple_empty - {VAR_TUPLE, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL}, - {VAR_TUPLE, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, } #endif ; @@ -1012,10 +997,9 @@ EXTERN win_T *curwin; // currently active window #define AUCMD_WIN_COUNT 5 typedef struct { - // Window used in aucmd_prepbuf(). When not NULL the window has been - // allocated. - win_T *auc_win; - int auc_win_used; // This auc_win is being used. + win_T *auc_win; // Window used in aucmd_prepbuf(). When not NULL the + // window has been allocated. + int auc_win_used; // This auc_win is being used. } aucmdwin_T; EXTERN aucmdwin_T aucmd_win[AUCMD_WIN_COUNT]; diff --git a/src/gui.c b/src/gui.c index 7b613812..0b9e3289 100644 --- a/src/gui.c +++ b/src/gui.c @@ -357,7 +357,7 @@ gui_read_child_pipe(int fd) if (bytes_read < 0) return GUI_CHILD_IO_ERROR; buffer[bytes_read] = NUL; - if (STRCMP(buffer, "ok") == 0) + if (strcmp(buffer, "ok") == 0) return GUI_CHILD_OK; return GUI_CHILD_FAILED; } @@ -2330,8 +2330,6 @@ gui_outstr_nowrap( # endif ) { - size_t slen = 2; // 2 spaces by default - # ifdef FEAT_NETBEANS_INTG if (*s == MULTISIGN_BYTE) multi_sign = TRUE; @@ -2340,16 +2338,14 @@ gui_outstr_nowrap( if (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) == 'u' && (curwin->w_p_nu || curwin->w_p_rnu)) { - int n = number_width(curwin); - - slen = MIN(n, (int)sizeof(extra) - 1); + sprintf((char *)extra, "%*c ", number_width(curwin), ' '); + s = extra; } - vim_memset(extra, ' ', slen); - extra[slen] = NUL; - s = extra; + else + s = (char_u *)" "; if (len == 1 && col > 0) --col; - len = (int)slen; + len = (int)STRLEN(s); if (len > 2) // right align sign icon in the number column signcol = col + len - 3; @@ -3760,6 +3756,10 @@ get_tabline_label( tabpage_T *tp, int tooltip) // TRUE: get tooltip { + int modified = FALSE; + char_u buf[40]; + int wincount; + win_T *wp; char_u **opt; // Use 'guitablabel' or 'guitabtooltip' if it's set. @@ -3805,42 +3805,26 @@ get_tabline_label( // use a default label. if (**opt == NUL || *NameBuff == NUL) { - win_T *wp; - int wincount = 0; - int modified = FALSE; - // Get the buffer name into NameBuff[] and shorten it. get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer); if (!tooltip) shorten_dir(NameBuff); - FOR_ALL_WINDOWS_IN_TAB(tp, wp) - { - ++wincount; + wp = (tp == curtab) ? firstwin : tp->tp_firstwin; + for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) if (bufIsChanged(wp->w_buffer)) modified = TRUE; - } - if (modified || wincount > 1) { - char_u buf[40] = "+ "; // Tentatively assume modified only - size_t buflen = 2; - size_t NameBufflen = STRLEN(NameBuff); - if (wincount > 1) - buflen = vim_snprintf_safelen( - (char *)buf, - sizeof(buf), - "%d%s ", - wincount, - modified ? "+" : ""); - - // Make sure resulting NameBuff will not exceed its bounds. - if (NameBufflen + buflen < MAXPATHL) - { - mch_memmove(NameBuff + buflen, NameBuff, NameBufflen + 1); // +1 for NUL - mch_memmove(NameBuff, buf, buflen); - } + vim_snprintf((char *)buf, sizeof(buf), "%d", wincount); + else + buf[0] = NUL; + if (modified) + STRCAT(buf, "+"); + STRCAT(buf, " "); + STRMOVE(NameBuff + STRLEN(buf), NameBuff); + mch_memmove(NameBuff, buf, STRLEN(buf)); } } } @@ -5174,11 +5158,10 @@ get_find_dialog_text( text = arg; if (text != NULL) { - int len = (int)STRLEN(text); - - text = vim_strnsave(text, len); + text = vim_strsave(text); if (text != NULL) { + int len = (int)STRLEN(text); int i; // Remove "\V" diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index c000a118..f9d593f9 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -2767,19 +2767,57 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED) static GdkCursor * create_blank_pointer(void) { + GdkWindow *root_window = NULL; +#if GTK_CHECK_VERSION(3,0,0) + GdkPixbuf *blank_mask; +#else + GdkPixmap *blank_mask; +#endif GdkCursor *cursor; - #if GTK_CHECK_VERSION(3,0,0) - GdkDisplay *disp = gtk_widget_get_display(gui.mainwin); - cursor = gdk_cursor_new_from_name(disp, "none"); + GdkRGBA color = { 0.0, 0.0, 0.0, 0.0 }; #else - // Create a pseudo blank pointer, which is in fact one pixel by one pixel - // in size. - GdkWindow *root_window = NULL; GdkColor color = { 0, 0, 0, 0 }; - GdkPixmap *blank_mask; char blank_data[] = { 0x0 }; +#endif + +#if GTK_CHECK_VERSION(3,12,0) + { + GdkWindow * const win = gtk_widget_get_window(gui.mainwin); + GdkScreen * const scrn = gdk_window_get_screen(win); + root_window = gdk_screen_get_root_window(scrn); + } +#else root_window = gtk_widget_get_root_window(gui.mainwin); +#endif + + // Create a pseudo blank pointer, which is in fact one pixel by one pixel + // in size. +#if GTK_CHECK_VERSION(3,0,0) + { + cairo_surface_t *surf; + cairo_t *cr; + + surf = cairo_image_surface_create(CAIRO_FORMAT_A1, 1, 1); + cr = cairo_create(surf); + + cairo_set_source_rgba(cr, + color.red, + color.green, + color.blue, + color.alpha); + cairo_rectangle(cr, 0, 0, 1, 1); + cairo_fill(cr); + cairo_destroy(cr); + + blank_mask = gdk_pixbuf_get_from_surface(surf, 0, 0, 1, 1); + cairo_surface_destroy(surf); + + cursor = gdk_cursor_new_from_pixbuf(gdk_window_get_display(root_window), + blank_mask, 0, 0); + g_object_unref(blank_mask); + } +#else blank_mask = gdk_bitmap_create_from_data(root_window, blank_data, 1, 1); cursor = gdk_cursor_new_from_pixmap(blank_mask, blank_mask, &color, &color, 0, 0); @@ -4531,7 +4569,6 @@ gui_mch_open(void) pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width); pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height); - // For GTK2 changing the size of the form widget doesn't cause window // resizing. if (gtk_socket_id == 0) @@ -7205,28 +7242,6 @@ gui_mch_mousehide(int hide) #if defined(FEAT_MOUSESHAPE) || defined(PROTO) -# if GTK_CHECK_VERSION(3,0,0) -static const char * mshape_css_names[] = -{ - "default", // arrow aka GDK_LEFT_PTR - "blank", // blank aka GDK_CURSOR_IS_PIXMAP - "text", // beam aka GDK_XTERM - "ns-resize", // updown aka GDK_SB_V_DOUBLE_ARROW - "nwse-resize", // udsizing aka GDK_SIZING - "ew-resize", // leftright aka GDK_SB_H_DOUBLE_ARROW - "ew-resize", // lrsizing aka GDK_SIZING - "progress", // busy aka GDK_WATCH - "not-allowed", // no aka GDK_X_CURSOR - "crosshair", // crosshair aka GDK_CROSSHAIR - "pointer", // hand1 aka GDK_HAND1 - "pointer", // hand2 aka GDK_HAND2 - "default", // pencil aka GDK_PENCIL (no css analogue) - "help", // question aka GDK_QUESTION_ARROW - "default", // right-arrow aka GDK_RIGHT_PTR (no css analogue) - "default", // up-arrow aka GDK_CENTER_PTR (no css analogue) - "default" // GDK_LEFT_PTR (no css analogue) -}; -# else // Table for shape IDs. Keep in sync with the mshape_names[] table in // misc2.c! static const int mshape_ids[] = @@ -7249,17 +7264,12 @@ static const int mshape_ids[] = GDK_CENTER_PTR, // up-arrow GDK_LEFT_PTR // last one }; -# endif // GTK_CHECK_VERSION(3,0,0) void mch_set_mouse_shape(int shape) { + int id; GdkCursor *c; - int id; // Only id or css_name is used. -# if GTK_CHECK_VERSION(3,0,0) - const char *css_name = "default"; - GdkDisplay *disp; -# endif if (gtk_widget_get_window(gui.drawarea) == NULL) return; @@ -7277,22 +7287,12 @@ mch_set_mouse_shape(int shape) else id &= ~1; // they are always even (why?) } -# if GTK_CHECK_VERSION(3,0,0) - else if (shape < (int)ARRAY_LENGTH(mshape_css_names)) - css_name = mshape_css_names[shape]; -# else else if (shape < (int)ARRAY_LENGTH(mshape_ids)) id = mshape_ids[shape]; -# endif else return; -# if GTK_CHECK_VERSION(3,0,0) - disp = gtk_widget_get_display(gui.drawarea); - c = gdk_cursor_new_from_name(disp, css_name); -# else c = gdk_cursor_new_for_display( gtk_widget_get_display(gui.drawarea), (GdkCursorType)id); -# endif gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea), c); # if GTK_CHECK_VERSION(3,0,0) g_object_unref(G_OBJECT(c)); diff --git a/src/gui_haiku.cc b/src/gui_haiku.cc index 748f97e5..d0832265 100644 --- a/src/gui_haiku.cc +++ b/src/gui_haiku.cc @@ -2091,8 +2091,7 @@ VimDialog::VimDialog(int type, const char *title, const char *message, float buttonsHeight = 0; BString strButtons(buttons); strButtons.RemoveAll("&"); - do - { + do { int32 end = strButtons.FindFirst('\n'); if (end != B_ERROR) strButtons.SetByteAt(end, '\0'); diff --git a/src/gui_w32.c b/src/gui_w32.c index a29fa91b..78f252a8 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -2157,8 +2157,7 @@ static void process_message_usual_key(UINT vk, const MSG *pmsg) * Experimental implementation, introduced in v8.2.4807 * "processing key event in Win32 GUI is not ideal" */ - static void -process_message_usual_key_experimental(UINT vk, const MSG *pmsg) +static void process_message_usual_key_experimental(UINT vk, const MSG *pmsg) { WCHAR ch[8]; int len; @@ -2238,8 +2237,7 @@ process_message_usual_key_experimental(UINT vk, const MSG *pmsg) /* * "Classic" implementation, existing prior to v8.2.4807 */ - static void -process_message_usual_key_classic(UINT vk, const MSG *pmsg) +static void process_message_usual_key_classic(UINT vk, const MSG *pmsg) { char_u string[40]; @@ -3675,11 +3673,12 @@ gui_mch_exit(int rc UNUSED) static char_u * logfont2name(LOGFONTW lf) { + char *p; + char *res; char *charset_name; char *quality_name; char *font_name; - size_t res_size; - char *res; + int points; font_name = (char *)utf16_to_enc(lf.lfFaceName, NULL); if (font_name == NULL) @@ -3687,48 +3686,43 @@ logfont2name(LOGFONTW lf) charset_name = charset_id2name((int)lf.lfCharSet); quality_name = quality_id2name((int)lf.lfQuality); - res_size = STRLEN(font_name) + 30 - + (charset_name == NULL ? 0 : STRLEN(charset_name) + 2) - + (quality_name == NULL ? 0 : STRLEN(quality_name) + 2); - res = alloc(res_size); + res = alloc(strlen(font_name) + 30 + + (charset_name == NULL ? 0 : strlen(charset_name) + 2) + + (quality_name == NULL ? 0 : strlen(quality_name) + 2)); if (res != NULL) { - char *p; - int points; - size_t res_len; - - // replace spaces in font_name with underscores. - for (p = font_name; *p != NUL; ++p) - { - if (isspace(*p)) - *p = '_'; - } - + p = res; // make a normal font string out of the lf thing: points = pixels_to_points( lf.lfHeight < 0 ? -lf.lfHeight : lf.lfHeight, TRUE); if (lf.lfWeight == FW_NORMAL || lf.lfWeight == FW_BOLD) - res_len = vim_snprintf_safelen( - (char *)res, res_size, "%s:h%d", font_name, points); + sprintf((char *)p, "%s:h%d", font_name, points); else - res_len = vim_snprintf_safelen( - (char *)res, res_size, "%s:h%d:W%ld", font_name, points, lf.lfWeight); - - res_len += vim_snprintf_safelen( - (char *)res + res_len, - res_size - res_len, - "%s%s%s%s", - lf.lfItalic ? ":i" : "", - lf.lfWeight ? ":b" : "", - lf.lfUnderline ? ":u" : "", - lf.lfStrikeOut ? ":s" : ""); - + sprintf((char *)p, "%s:h%d:W%ld", font_name, points, lf.lfWeight); + while (*p) + { + if (*p == ' ') + *p = '_'; + ++p; + } + if (lf.lfItalic) + STRCAT(p, ":i"); + if (lf.lfWeight == FW_BOLD) + STRCAT(p, ":b"); + if (lf.lfUnderline) + STRCAT(p, ":u"); + if (lf.lfStrikeOut) + STRCAT(p, ":s"); if (charset_name != NULL) - res_len += vim_snprintf_safelen((char *)res + res_len, - res_size - res_len, ":c%s", charset_name); + { + STRCAT(p, ":c"); + STRCAT(p, charset_name); + } if (quality_name != NULL) - vim_snprintf((char *)res + res_len, - res_size - res_len, ":q%s", quality_name); + { + STRCAT(p, ":q"); + STRCAT(p, quality_name); + } } vim_free(font_name); @@ -4981,10 +4975,9 @@ _OnNotify(HWND hwnd, UINT id, NMHDR *hdr) else { LPNMTTDISPINFO lpdi = (LPNMTTDISPINFO)hdr; - size_t len = STRLEN(str); - if (len < sizeof(lpdi->szText) - || ((tt_text = vim_strnsave(str, len)) == NULL)) + if (STRLEN(str) < sizeof(lpdi->szText) + || ((tt_text = vim_strsave(str)) == NULL)) vim_strncpy((char_u *)lpdi->szText, str, sizeof(lpdi->szText) - 1); else @@ -5027,6 +5020,7 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) == MF_HILITE && (State & MODE_CMDLINE) == 0) { + UINT idButton; vimmenu_T *pMenu; static int did_menu_tip = FALSE; @@ -5038,23 +5032,17 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) did_menu_tip = FALSE; } - pMenu = gui_mswin_find_menu(root_menu, (UINT)LOWORD(wParam)); - if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != NULL) + idButton = (UINT)LOWORD(wParam); + pMenu = gui_mswin_find_menu(root_menu, idButton); + if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != 0 + && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1) { - MENUITEMINFO menuinfo; - - menuinfo.cbSize = sizeof(MENUITEMINFO); - menuinfo.fMask = MIIM_ID; // We only want to check if the menu item exists, - // so retrieve something simple. - if (GetMenuItemInfo(s_menuBar, pMenu->id, FALSE, &menuinfo)) - { - ++msg_hist_off; - msg((char *)pMenu->strings[MENU_INDEX_TIP]); - --msg_hist_off; - setcursor(); - out_flush(); - did_menu_tip = TRUE; - } + ++msg_hist_off; + msg((char *)pMenu->strings[MENU_INDEX_TIP]); + --msg_hist_off; + setcursor(); + out_flush(); + did_menu_tip = TRUE; } return 0L; } @@ -5063,7 +5051,7 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) #endif static BOOL -_OnGetDpiScaledSize(HWND hwnd UNUSED, UINT dpi, SIZE *size) +_OnGetDpiScaledSize(HWND hwnd, UINT dpi, SIZE *size) { int old_width, old_height; int new_width, new_height; @@ -5384,11 +5372,13 @@ gui_mch_do_spawn(char_u *arg) { if (*p == L'"') { - // Skip quoted strings - while (*++p && *p != L'"'); + while (*p && *p != L'"') + ++p; + if (*p) + ++p; } - - ++p; + else + ++p; } cmd = p; } @@ -5404,12 +5394,7 @@ gui_mch_do_spawn(char_u *arg) if (session == NULL) goto error; savebg = p_bg; - p_bg = vim_strnsave((char_u *)"light", 5); // Set 'bg' to "light". - if (p_bg == NULL) - { - p_bg = savebg; - goto error; - } + p_bg = vim_strsave((char_u *)"light"); // Set 'bg' to "light". ret = write_session_file(session); vim_free(p_bg); p_bg = savebg; @@ -7142,11 +7127,8 @@ dialog_callback( GetDlgItemTextW(hwnd, DLG_NONBUTTON_CONTROL + 2, wp, IOSIZE); p = utf16_to_enc(wp, NULL); - if (p != NULL) - { - vim_strncpy(s_textfield, p, IOSIZE); - vim_free(p); - } + vim_strncpy(s_textfield, p, IOSIZE); + vim_free(p); vim_free(wp); } @@ -9075,7 +9057,7 @@ test_gui_w32_sendevent_mouse(dict_T *args) if (dict_get_bool(args, "cell", FALSE)) { // calculate the middle of the character cell - // Note: Cell coordinates are 1-based from Vim script + // Note: Cell coordinates are 1-based from vimscript int pY = (row - 1) * gui.char_height + gui.char_height / 2; int pX = (col - 1) * gui.char_width + gui.char_width / 2; gui_mouse_moved(pX, pY); diff --git a/src/highlight.c b/src/highlight.c index 65670350..755d75f4 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -241,7 +241,6 @@ static char *(highlight_init_both[]) = { #ifdef FEAT_DIFF CENT("DiffText term=reverse cterm=bold ctermbg=Red", "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red"), - "default link DiffTextAdd DiffText", #endif CENT("PmenuSbar ctermbg=Grey", "PmenuSbar ctermbg=Grey guibg=Grey"), diff --git a/src/if_py_both.h b/src/if_py_both.h index ed66254f..a679be54 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -152,15 +152,14 @@ static PyObject* Vim_PyObject_New(PyTypeObject *type, size_t objsize) # define PyList_GET_ITEM(list, i) PyList_GetItem(list, i) # define PyList_GET_SIZE(o) PyList_Size(o) +# define PyTuple_GET_ITEM(o, pos) PyTuple_GetItem(o, pos) +# define PyTuple_GET_SIZE(o) PyTuple_Size(o) // PyList_SET_ITEM and PyList_SetItem have slightly different behaviors. The // former will leave the old item dangling, and the latter will decref on it. // Since we only use this on new lists, this difference doesn't matter. # define PyList_SET_ITEM(list, i, item) PyList_SetItem(list, i, item) -# define PyTuple_GET_ITEM(o, pos) PyTuple_GetItem(o, pos) -# define PyTuple_GET_SIZE(o) PyTuple_Size(o) - # if Py_LIMITED_API < 0x03080000 // PyIter_check only became part of stable ABI in 3.8, and there is no easy way // to check for it in the API. We simply return false as a compromise. This @@ -1015,14 +1014,11 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict) // Check if we run into a recursive loop. The item must be in lookup_dict // then and we can use it again. if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL) - || (our_tv->v_type == VAR_TUPLE && our_tv->vval.v_tuple != NULL) || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL)) { sprintf(ptrBuf, "%p", our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list - : our_tv->v_type == VAR_TUPLE ? - (void *)our_tv->vval.v_tuple - : (void *)our_tv->vval.v_dict); + : (void *)our_tv->vval.v_dict); if ((ret = PyDict_GetItemString(lookup_dict, ptrBuf))) { @@ -1083,39 +1079,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict) Py_DECREF(newObj); } } - else if (our_tv->v_type == VAR_TUPLE) - { - tuple_T *tuple = our_tv->vval.v_tuple; - int len; - - if (tuple == NULL) - return NULL; - - len = TUPLE_LEN(tuple); - - ret = PyTuple_New(len); - if (ret == NULL) - return NULL; - - for (int idx = 0; idx < len; idx++) - { - typval_T *item_tv = TUPLE_ITEM(tuple, idx); - - newObj = VimToPython(item_tv, depth + 1, lookup_dict); - if (!newObj) - { - Py_DECREF(ret); - return NULL; - } - PyTuple_SetItem(ret, idx, newObj); - } - - if (PyDict_SetItemString(lookup_dict, ptrBuf, ret)) - { - Py_DECREF(ret); - return NULL; - } - } else if (our_tv->v_type == VAR_DICT) { @@ -1837,7 +1800,6 @@ typedef struct pylinkedlist_S { static pylinkedlist_T *lastdict = NULL; static pylinkedlist_T *lastlist = NULL; -static pylinkedlist_T *lasttuple = NULL; static pylinkedlist_T *lastfunc = NULL; static void @@ -3254,355 +3216,6 @@ static struct PyMethodDef ListMethods[] = { { NULL, NULL, 0, NULL} }; -DEFINE_PY_TYPE_OBJECT(TupleType); - -typedef struct -{ - PyObject_HEAD - tuple_T *tuple; - pylinkedlist_T ref; -} TupleObject; - -#define NEW_TUPLE(tuple) TupleNew(TupleTypePtr, tuple) - - static PyObject * -TupleNew(PyTypeObject *subtype, tuple_T *tuple) -{ - TupleObject *self; - - if (tuple == NULL) - return NULL; - - self = (TupleObject *) Py_TYPE_GET_TP_ALLOC(subtype)(subtype, 0); - if (self == NULL) - return NULL; - self->tuple = tuple; - ++tuple->tv_refcount; - - pyll_add((PyObject *)(self), &self->ref, &lasttuple); - - return (PyObject *)(self); -} - - static tuple_T * -py_tuple_alloc(void) -{ - tuple_T *ret; - - if (!(ret = tuple_alloc())) - { - PyErr_NoMemory(); - return NULL; - } - ++ret->tv_refcount; - - return ret; -} - - static int -tuple_py_concat(tuple_T *t, PyObject *obj, PyObject *lookup_dict) -{ - PyObject *iterator; - PyObject *item; - - if (!(iterator = PyObject_GetIter(obj))) - return -1; - - while ((item = PyIter_Next(iterator))) - { - typval_T new_tv; - - if (_ConvertFromPyObject(item, &new_tv, lookup_dict) == -1) - { - Py_DECREF(item); - Py_DECREF(iterator); - return -1; - } - - Py_DECREF(item); - - if (tuple_append_tv(t, &new_tv) == FAIL) - { - Py_DECREF(iterator); - return -1; - } - } - - Py_DECREF(iterator); - - // Iterator may have finished due to an exception - if (PyErr_Occurred()) - return -1; - - return 0; -} - - static PyObject * -TupleConstructor(PyTypeObject *subtype, PyObject *args, PyObject *kwargs) -{ - tuple_T *tuple; - PyObject *obj = NULL; - - if (kwargs) - { - PyErr_SET_STRING(PyExc_TypeError, - N_("tuple constructor does not accept keyword arguments")); - return NULL; - } - - if (!PyArg_ParseTuple(args, "|O", &obj)) - return NULL; - - if (!(tuple = py_tuple_alloc())) - return NULL; - - if (obj) - { - PyObject *lookup_dict; - - if (!(lookup_dict = PyDict_New())) - { - tuple_unref(tuple); - return NULL; - } - - if (tuple_py_concat(tuple, obj, lookup_dict) == -1) - { - Py_DECREF(lookup_dict); - tuple_unref(tuple); - return NULL; - } - - Py_DECREF(lookup_dict); - } - - return TupleNew(subtype, tuple); -} - - static void -TupleDestructor(PyObject *self_obj) -{ - TupleObject *self = (TupleObject *)self_obj; - pyll_remove(&self->ref, &lasttuple); - tuple_unref(self->tuple); - - DESTRUCTOR_FINISH(self); -} - - static PyInt -TupleLength(TupleObject *self) -{ - return ((PyInt)(tuple_len(self->tuple))); -} - - static PyObject * -TupleIndex(TupleObject *self, Py_ssize_t index) -{ - PyInt len = TupleLength(self); - - if (index < 0) - index = len + index; - - if (index < 0 || index >= len) - { - PyErr_SET_STRING(PyExc_IndexError, N_("tuple index out of range")); - return NULL; - } - return ConvertToPyObject(TUPLE_ITEM(self->tuple, index)); -} - -/* - * Return a new tuple object for the tuple slice starting from the index - * "first" and of length "slicelen" skipping "step" items. - */ - static PyObject * -TupleSlice( - TupleObject *self, - Py_ssize_t first, - Py_ssize_t step, - Py_ssize_t slicelen) -{ - PyInt i; - PyObject *tuple; - - tuple = PyTuple_New(slicelen); - if (tuple == NULL) - return NULL; - - for (i = 0; i < slicelen; ++i) - { - PyObject *item; - - item = TupleIndex(self, first + i * step); - if (item == NULL) - { - Py_DECREF(tuple); - return NULL; - } - - PyTuple_SetItem(tuple, i, item); - } - - return tuple; -} - - static PyObject * -TupleItem(TupleObject *self, PyObject* idx) -{ -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(idx)) - { - long _idx = PyInt_AsLong(idx); - return TupleIndex(self, _idx); - } - else -#endif - if (PyLong_Check(idx)) - { - long _idx = PyLong_AsLong(idx); - return TupleIndex(self, _idx); - } - else if (PySlice_Check(idx)) - { - Py_ssize_t start, stop, step, slicelen; - - if (PySlice_GetIndicesEx((PySliceObject_T *)idx, TupleLength(self), - &start, &stop, &step, &slicelen) < 0) - return NULL; - return TupleSlice(self, start, step, slicelen); - } - else - { - RAISE_INVALID_INDEX_TYPE(idx); - return NULL; - } -} - -typedef struct -{ - tuple_T *tuple; - int index; -} tupleiterinfo_T; - - static void -TupleIterDestruct(void *arg) -{ - tupleiterinfo_T *tii = (tupleiterinfo_T*)arg; - tuple_unref(tii->tuple); - PyMem_Free(tii); -} - - static PyObject * -TupleIterNext(void **arg) -{ - PyObject *ret; - tupleiterinfo_T **tii = (tupleiterinfo_T**)arg; - - if ((*tii)->index >= TUPLE_LEN((*tii)->tuple)) - return NULL; - - if (!(ret = ConvertToPyObject(TUPLE_ITEM((*tii)->tuple, (*tii)->index)))) - return NULL; - - (*tii)->index++; - - return ret; -} - - static PyObject * -TupleIter(PyObject *self_obj) -{ - TupleObject *self = (TupleObject*)self_obj; - tupleiterinfo_T *tii; - tuple_T *t = self->tuple; - - if (!(tii = PyMem_New(tupleiterinfo_T, 1))) - { - PyErr_NoMemory(); - return NULL; - } - - tii->tuple = t; - tii->index = 0; - ++t->tv_refcount; - - return IterNew(tii, - TupleIterDestruct, TupleIterNext, - NULL, NULL, (PyObject *)self); -} - -static char *TupleAttrs[] = { - "locked", - NULL -}; - - static PyObject * -TupleDir(PyObject *self, PyObject *args UNUSED) -{ - return ObjectDir(self, TupleAttrs); -} - - static int -TupleSetattr(PyObject *self_obj, char *name, PyObject *valObject) -{ - TupleObject *self = (TupleObject*)self_obj; - if (valObject == NULL) - { - PyErr_SET_STRING(PyExc_AttributeError, - N_("cannot delete vim.Tuple attributes")); - return -1; - } - - if (strcmp(name, "locked") == 0) - { - if (self->tuple->tv_lock == VAR_FIXED) - { - PyErr_SET_STRING(PyExc_TypeError, N_("cannot modify fixed tuple")); - return -1; - } - else - { - int istrue = PyObject_IsTrue(valObject); - if (istrue == -1) - return -1; - else if (istrue) - self->tuple->tv_lock = VAR_LOCKED; - else - self->tuple->tv_lock = 0; - } - return 0; - } - else - { - PyErr_FORMAT(PyExc_AttributeError, N_("cannot set attribute %s"), name); - return -1; - } -} - -static PySequenceMethods TupleAsSeq = { - (lenfunc) TupleLength, // sq_length, len(x) - (binaryfunc) 0, // RangeConcat, sq_concat, x+y - 0, // RangeRepeat, sq_repeat, x*n - (PyIntArgFunc) TupleIndex, // sq_item, x[i] - 0, // was_sq_slice, x[i:j] - (PyIntObjArgProc) 0, // sq_as_item, x[i]=v - 0, // was_sq_ass_slice, x[i:j]=v - 0, // sq_contains - (binaryfunc) 0, // sq_inplace_concat - 0, // sq_inplace_repeat -}; - -static PyMappingMethods TupleAsMapping = { - /* mp_length */ (lenfunc) TupleLength, - /* mp_subscript */ (binaryfunc) TupleItem, - /* mp_ass_subscript */ (objobjargproc) 0, -}; - -static struct PyMethodDef TupleMethods[] = { - {"__dir__", (PyCFunction)TupleDir, METH_NOARGS, ""}, - { NULL, NULL, 0, NULL} -}; - typedef struct { PyObject_HEAD @@ -6606,7 +6219,6 @@ set_ref_in_py(const int copyID) { pylinkedlist_T *cur; list_T *ll; - tuple_T *tt; int i; int abort = FALSE; FunctionObject *func; @@ -6627,15 +6239,6 @@ set_ref_in_py(const int copyID) } } - if (lasttuple != NULL) - { - for (cur = lasttuple ; !abort && cur != NULL ; cur = cur->pll_prev) - { - tt = ((TupleObject *) (cur->pll_obj))->tuple; - abort = set_ref_in_tuple(tt, copyID); - } - } - if (lastfunc != NULL) { for (cur = lastfunc ; !abort && cur != NULL ; cur = cur->pll_prev) @@ -6645,7 +6248,7 @@ set_ref_in_py(const int copyID) if (func->argc) for (i = 0; !abort && i < func->argc; ++i) abort = abort - || set_ref_in_item(&func->argv[i], copyID, NULL, NULL, NULL); + || set_ref_in_item(&func->argv[i], copyID, NULL, NULL); } } @@ -6858,27 +6461,6 @@ pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) return 0; } - static int -pytuple_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) -{ - tuple_T *t; - - if (!(t = py_tuple_alloc())) - return -1; - - tv->v_type = VAR_TUPLE; - tv->vval.v_tuple = t; - - if (tuple_py_concat(t, obj, lookup_dict) == -1) - { - tuple_unref(t); - return -1; - } - - --t->tv_refcount; - return 0; -} - typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *); static int @@ -6922,8 +6504,6 @@ convert_dl(PyObject *obj, typval_T *tv, ++tv->vval.v_dict->dv_refcount; else if (tv->v_type == VAR_LIST) ++tv->vval.v_list->lv_refcount; - else if (tv->v_type == VAR_TUPLE) - ++tv->vval.v_tuple->tv_refcount; } else { @@ -7027,12 +6607,6 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookup_dict) tv->vval.v_list = (((ListObject *)(obj))->list); ++tv->vval.v_list->lv_refcount; } - else if (PyType_IsSubtype(obj->ob_type, TupleTypePtr)) - { - tv->v_type = VAR_TUPLE; - tv->vval.v_tuple = (((TupleObject *)(obj))->tuple); - ++tv->vval.v_tuple->tv_refcount; - } else if (PyType_IsSubtype(obj->ob_type, FunctionTypePtr)) { FunctionObject *func = (FunctionObject *) obj; @@ -7106,8 +6680,6 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookup_dict) if (PyErr_Occurred()) return -1; } - else if (PyTuple_Check(obj)) - return convert_dl(obj, tv, pytuple_to_tv, lookup_dict); else if (PyDict_Check(obj)) return convert_dl(obj, tv, pydict_to_tv, lookup_dict); else if (PyFloat_Check(obj)) @@ -7170,8 +6742,6 @@ ConvertToPyObject(typval_T *tv) return PyFloat_FromDouble((double) tv->vval.v_float); case VAR_LIST: return NEW_LIST(tv->vval.v_list); - case VAR_TUPLE: - return NEW_TUPLE(tv->vval.v_tuple); case VAR_DICT: return NEW_DICTIONARY(tv->vval.v_dict); case VAR_FUNC: @@ -7431,27 +7001,6 @@ init_structs(void) ListType.tp_setattr = ListSetattr; #endif - // Tuple type - CLEAR_FIELD(TupleType); - TupleType.tp_name = "vim.tuple"; - TupleType.tp_dealloc = TupleDestructor; - TupleType.tp_basicsize = sizeof(TupleObject); - TupleType.tp_as_sequence = &TupleAsSeq; - TupleType.tp_as_mapping = &TupleAsMapping; - TupleType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE; - TupleType.tp_doc = "tuple pushing modifications to Vim structure"; - TupleType.tp_methods = TupleMethods; - TupleType.tp_iter = TupleIter; - TupleType.tp_new = TupleConstructor; - TupleType.tp_alloc = PyType_GenericAlloc; -#if PY_MAJOR_VERSION >= 3 - TupleType.tp_getattro = TupleGetattro; - TupleType.tp_setattro = TupleSetattro; -#else - TupleType.tp_getattr = TupleGetattr; - TupleType.tp_setattr = TupleSetattr; -#endif - CLEAR_FIELD(FunctionType); FunctionType.tp_name = "vim.function"; FunctionType.tp_basicsize = sizeof(FunctionObject); @@ -7514,7 +7063,6 @@ init_types(void) PYTYPE_READY(CurrentType); PYTYPE_READY(DictionaryType); PYTYPE_READY(ListType); - PYTYPE_READY(TupleType); PYTYPE_READY(FunctionType); PYTYPE_READY(OptionsType); PYTYPE_READY(OutputType); @@ -7552,7 +7100,6 @@ shutdown_types(void) PYTYPE_CLEANUP(CurrentType); PYTYPE_CLEANUP(DictionaryType); PYTYPE_CLEANUP(ListType); - PYTYPE_CLEANUP(TupleType); PYTYPE_CLEANUP(FunctionType); PYTYPE_CLEANUP(OptionsType); PYTYPE_CLEANUP(OutputType); @@ -7691,7 +7238,6 @@ populate_module(PyObject *m) {"TabPage", (PyObject *)TabPageTypePtr}, {"Dictionary", (PyObject *)DictionaryTypePtr}, {"List", (PyObject *)ListTypePtr}, - {"Tuple", (PyObject *)TupleTypePtr}, {"Function", (PyObject *)FunctionTypePtr}, {"Options", (PyObject *)OptionsTypePtr}, #if PY_VERSION_HEX < 0x030700f0 diff --git a/src/if_python.c b/src/if_python.c index aa496f23..577807c4 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -201,15 +201,13 @@ struct PyMethodDef { Py_ssize_t a; }; # define PyList_SetItem dll_PyList_SetItem # define PyList_Size dll_PyList_Size # define PyList_Type (*dll_PyList_Type) -# define PyTuple_GetItem dll_PyTuple_GetItem -# define PyTuple_SetItem dll_PyTuple_SetItem -# define PyTuple_New dll_PyTuple_New -# define PyTuple_Size dll_PyTuple_Size -# define PyTuple_Type (*dll_PyTuple_Type) # define PySequence_Check dll_PySequence_Check # define PySequence_Size dll_PySequence_Size # define PySequence_GetItem dll_PySequence_GetItem # define PySequence_Fast dll_PySequence_Fast +# define PyTuple_Size dll_PyTuple_Size +# define PyTuple_GetItem dll_PyTuple_GetItem +# define PyTuple_Type (*dll_PyTuple_Type) # define PySlice_GetIndicesEx dll_PySlice_GetIndicesEx # define PyImport_ImportModule dll_PyImport_ImportModule # define PyDict_New dll_PyDict_New @@ -354,15 +352,13 @@ static PyObject*(*dll_PyList_New)(PyInt size); static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *); static PyInt(*dll_PyList_Size)(PyObject *); static PyTypeObject* dll_PyList_Type; -static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt); -static int(*dll_PyTuple_SetItem)(PyObject *, PyInt, PyObject *); -static PyObject*(*dll_PyTuple_New)(PyInt size); -static PyInt(*dll_PyTuple_Size)(PyObject *); -static PyTypeObject* dll_PyTuple_Type; static int (*dll_PySequence_Check)(PyObject *); static PyInt(*dll_PySequence_Size)(PyObject *); static PyObject*(*dll_PySequence_GetItem)(PyObject *, PyInt); static PyObject*(*dll_PySequence_Fast)(PyObject *, const char *); +static PyInt(*dll_PyTuple_Size)(PyObject *); +static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt); +static PyTypeObject* dll_PyTuple_Type; static int (*dll_PySlice_GetIndicesEx)(PySliceObject *r, PyInt length, PyInt *start, PyInt *stop, PyInt *step, PyInt *slicelen); @@ -544,15 +540,13 @@ static struct {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem}, {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size}, {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type}, - {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, - {"PyTuple_SetItem", (PYTHON_PROC*)&dll_PyTuple_SetItem}, - {"PyTuple_New", (PYTHON_PROC*)&dll_PyTuple_New}, - {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, - {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, {"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size}, {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check}, {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, {"PySequence_Fast", (PYTHON_PROC*)&dll_PySequence_Fast}, + {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, + {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, + {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, {"PySlice_GetIndicesEx", (PYTHON_PROC*)&dll_PySlice_GetIndicesEx}, {"PyImport_ImportModule", (PYTHON_PROC*)&dll_PyImport_ImportModule}, {"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString}, @@ -792,7 +786,6 @@ static PyObject *TabPageGetattr(PyObject *, char *); static PyObject *RangeGetattr(PyObject *, char *); static PyObject *DictionaryGetattr(PyObject *, char*); static PyObject *ListGetattr(PyObject *, char *); -static PyObject *TupleGetattr(PyObject *, char *); static PyObject *FunctionGetattr(PyObject *, char *); #ifndef Py_VISIT @@ -1517,17 +1510,6 @@ ListGetattr(PyObject *self, char *name) return Py_FindMethod(ListMethods, self, name); } - static PyObject * -TupleGetattr(PyObject *self, char *name) -{ - if (strcmp(name, "locked") == 0) - return PyInt_FromLong(((TupleObject *)(self))->tuple->tv_lock); - else if (strcmp(name, "__members__") == 0) - return ObjectDir(NULL, TupleAttrs); - - return Py_FindMethod(TupleMethods, self, name); -} - static PyObject * FunctionGetattr(PyObject *self, char *name) { diff --git a/src/if_python3.c b/src/if_python3.c index 8b94e073..aa934cb7 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -187,14 +187,12 @@ static HINSTANCE hinstPy3 = 0; // Instance of python.dll # define PyList_New py3_PyList_New # define PyList_SetItem py3_PyList_SetItem # define PyList_Size py3_PyList_Size -# define PyTuple_New py3_PyTuple_New -# define PyTuple_GetItem py3_PyTuple_GetItem -# define PyTuple_SetItem py3_PyTuple_SetItem -# define PyTuple_Size py3_PyTuple_Size # define PySequence_Check py3_PySequence_Check # define PySequence_Size py3_PySequence_Size # define PySequence_GetItem py3_PySequence_GetItem # define PySequence_Fast py3_PySequence_Fast +# define PyTuple_Size py3_PyTuple_Size +# define PyTuple_GetItem py3_PyTuple_GetItem # if PY_VERSION_HEX >= 0x030601f0 # define PySlice_AdjustIndices py3_PySlice_AdjustIndices # define PySlice_Unpack py3_PySlice_Unpack @@ -373,13 +371,11 @@ static PyObject* (*py3_PySys_GetObject)(char *); static int (*py3_PyList_Append)(PyObject *, PyObject *); static int (*py3_PyList_Insert)(PyObject *, int, PyObject *); static Py_ssize_t (*py3_PyList_Size)(PyObject *); -static PyObject* (*py3_PyTuple_New)(Py_ssize_t size); -static int (*py3_PyTuple_SetItem)(PyObject *, Py_ssize_t, PyObject *); -static Py_ssize_t (*py3_PyTuple_Size)(PyObject *); static int (*py3_PySequence_Check)(PyObject *); static Py_ssize_t (*py3_PySequence_Size)(PyObject *); static PyObject* (*py3_PySequence_GetItem)(PyObject *, Py_ssize_t); static PyObject* (*py3_PySequence_Fast)(PyObject *, const char *); +static Py_ssize_t (*py3_PyTuple_Size)(PyObject *); static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t); static int (*py3_PyMapping_Check)(PyObject *); static PyObject* (*py3_PyMapping_Keys)(PyObject *); @@ -589,14 +585,12 @@ static struct {"PyList_Append", (PYTHON_PROC*)&py3_PyList_Append}, {"PyList_Insert", (PYTHON_PROC*)&py3_PyList_Insert}, {"PyList_Size", (PYTHON_PROC*)&py3_PyList_Size}, - {"PyTuple_New", (PYTHON_PROC*)&py3_PyTuple_New}, - {"PyTuple_GetItem", (PYTHON_PROC*)&py3_PyTuple_GetItem}, - {"PyTuple_SetItem", (PYTHON_PROC*)&py3_PyTuple_SetItem}, - {"PyTuple_Size", (PYTHON_PROC*)&py3_PyTuple_Size}, {"PySequence_Check", (PYTHON_PROC*)&py3_PySequence_Check}, {"PySequence_Size", (PYTHON_PROC*)&py3_PySequence_Size}, {"PySequence_GetItem", (PYTHON_PROC*)&py3_PySequence_GetItem}, {"PySequence_Fast", (PYTHON_PROC*)&py3_PySequence_Fast}, + {"PyTuple_Size", (PYTHON_PROC*)&py3_PyTuple_Size}, + {"PyTuple_GetItem", (PYTHON_PROC*)&py3_PyTuple_GetItem}, # if PY_VERSION_HEX >= 0x030601f0 {"PySlice_AdjustIndices", (PYTHON_PROC*)&py3_PySlice_AdjustIndices}, {"PySlice_Unpack", (PYTHON_PROC*)&py3_PySlice_Unpack}, @@ -1119,8 +1113,6 @@ static PyObject *DictionaryGetattro(PyObject *, PyObject *); static int DictionarySetattro(PyObject *, PyObject *, PyObject *); static PyObject *ListGetattro(PyObject *, PyObject *); static int ListSetattro(PyObject *, PyObject *, PyObject *); -static PyObject *TupleGetattro(PyObject *, PyObject *); -static int TupleSetattro(PyObject *, PyObject *, PyObject *); static PyObject *FunctionGetattro(PyObject *, PyObject *); static struct PyModuleDef vimmodule; @@ -2036,26 +2028,6 @@ ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val) return ListSetattr(self, name, val); } -// Tuple object - Definitions - - static PyObject * -TupleGetattro(PyObject *self, PyObject *nameobj) -{ - GET_ATTR_STRING(name, nameobj); - - if (strcmp(name, "locked") == 0) - return PyLong_FromLong(((TupleObject *) (self))->tuple->tv_lock); - - return PyObject_GenericGetAttr(self, nameobj); -} - - static int -TupleSetattro(PyObject *self, PyObject *nameobj, PyObject *val) -{ - GET_ATTR_STRING(name, nameobj); - return TupleSetattr(self, name, val); -} - // Function object - Definitions static PyObject * diff --git a/src/if_ruby.c b/src/if_ruby.c index b769adfa..a018dcde 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -107,10 +107,7 @@ # undef SIZEOF_TIME_T #endif -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" #include -#pragma GCC diagnostic pop #include // See above. @@ -389,12 +386,12 @@ static void (*dll_rb_debug_rstring_null_ptr) (const char*); # endif static VALUE (*dll_rb_define_class_under) (VALUE, const char*, VALUE); static void (*dll_rb_define_const) (VALUE,const char*,VALUE); -static void (*dll_rb_define_global_function) (const char*,VALUE(*)(int,VALUE*,VALUE),int); -static void (*dll_rb_define_method) (VALUE,const char*,VALUE(*)(ANYARGS),int); +static void (*dll_rb_define_global_function) (const char*,VALUE(*)(),int); +static void (*dll_rb_define_method) (VALUE,const char*,VALUE(*)(),int); static VALUE (*dll_rb_define_module) (const char*); -static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(VALUE,VALUE),int); -static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(ANYARGS),int); -static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(ID,VALUE*),void(*)()); +static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int); +static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int); +static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)()); static VALUE *dll_rb_stdout; static VALUE *dll_rb_stderr; static VALUE *dll_rb_eArgError; @@ -1723,10 +1720,10 @@ ruby_io_init(void) rb_stdout = rb_obj_alloc(rb_cObject); rb_stderr = rb_obj_alloc(rb_cObject); - rb_define_singleton_method(rb_stdout, "write", (void*)vim_message, 1); - rb_define_singleton_method(rb_stdout, "flush", (void*)f_nop, 0); - rb_define_singleton_method(rb_stderr, "write", (void*)vim_message, 1); - rb_define_singleton_method(rb_stderr, "flush", (void*)f_nop, 0); + rb_define_singleton_method(rb_stdout, "write", vim_message, 1); + rb_define_singleton_method(rb_stdout, "flush", f_nop, 0); + rb_define_singleton_method(rb_stderr, "write", vim_message, 1); + rb_define_singleton_method(rb_stderr, "flush", f_nop, 0); rb_define_global_function("p", f_p, -1); } @@ -1760,36 +1757,36 @@ ruby_vim_init(void) rb_eStandardError); cBuffer = rb_define_class_under(mVIM, "Buffer", rb_cObject); - rb_define_singleton_method(cBuffer, "current", (void*)buffer_s_current, 0); - rb_define_singleton_method(cBuffer, "count", (void*)buffer_s_count, 0); - rb_define_singleton_method(cBuffer, "[]", (void*)buffer_s_aref, 1); - rb_define_method(cBuffer, "name", (void*)buffer_name, 0); - rb_define_method(cBuffer, "number", (void*)buffer_number, 0); - rb_define_method(cBuffer, "count", (void*)buffer_count, 0); - rb_define_method(cBuffer, "length", (void*)buffer_count, 0); - rb_define_method(cBuffer, "[]", (void*)buffer_aref, 1); - rb_define_method(cBuffer, "[]=", (void*)buffer_aset, 2); - rb_define_method(cBuffer, "delete", (void*)buffer_delete, 1); - rb_define_method(cBuffer, "append", (void*)buffer_append, 2); + rb_define_singleton_method(cBuffer, "current", buffer_s_current, 0); + rb_define_singleton_method(cBuffer, "count", buffer_s_count, 0); + rb_define_singleton_method(cBuffer, "[]", buffer_s_aref, 1); + rb_define_method(cBuffer, "name", buffer_name, 0); + rb_define_method(cBuffer, "number", buffer_number, 0); + rb_define_method(cBuffer, "count", buffer_count, 0); + rb_define_method(cBuffer, "length", buffer_count, 0); + rb_define_method(cBuffer, "[]", buffer_aref, 1); + rb_define_method(cBuffer, "[]=", buffer_aset, 2); + rb_define_method(cBuffer, "delete", buffer_delete, 1); + rb_define_method(cBuffer, "append", buffer_append, 2); // Added line manipulation functions // SegPhault - 03/07/05 - rb_define_method(cBuffer, "line_number", (void*)current_line_number, 0); - rb_define_method(cBuffer, "line", (void*)line_s_current, 0); - rb_define_method(cBuffer, "line=", (void*)set_current_line, 1); + rb_define_method(cBuffer, "line_number", current_line_number, 0); + rb_define_method(cBuffer, "line", line_s_current, 0); + rb_define_method(cBuffer, "line=", set_current_line, 1); cVimWindow = rb_define_class_under(mVIM, "Window", rb_cObject); - rb_define_singleton_method(cVimWindow, "current", (void*)window_s_current, 0); - rb_define_singleton_method(cVimWindow, "count", (void*)window_s_count, 0); - rb_define_singleton_method(cVimWindow, "[]", (void*)window_s_aref, 1); - rb_define_method(cVimWindow, "buffer", (void*)window_buffer, 0); - rb_define_method(cVimWindow, "height", (void*)window_height, 0); - rb_define_method(cVimWindow, "height=", (void*)window_set_height, 1); - rb_define_method(cVimWindow, "width", (void*)window_width, 0); - rb_define_method(cVimWindow, "width=", (void*)window_set_width, 1); - rb_define_method(cVimWindow, "cursor", (void*)window_cursor, 0); - rb_define_method(cVimWindow, "cursor=", (void*)window_set_cursor, 1); + rb_define_singleton_method(cVimWindow, "current", window_s_current, 0); + rb_define_singleton_method(cVimWindow, "count", window_s_count, 0); + rb_define_singleton_method(cVimWindow, "[]", window_s_aref, 1); + rb_define_method(cVimWindow, "buffer", window_buffer, 0); + rb_define_method(cVimWindow, "height", window_height, 0); + rb_define_method(cVimWindow, "height=", window_set_height, 1); + rb_define_method(cVimWindow, "width", window_width, 0); + rb_define_method(cVimWindow, "width=", window_set_width, 1); + rb_define_method(cVimWindow, "cursor", window_cursor, 0); + rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1); rb_define_virtual_variable("$curbuf", buffer_s_current_getter, 0); rb_define_virtual_variable("$curwin", window_s_current_getter, 0); diff --git a/src/indent.c b/src/indent.c index b2861e96..6951cfcd 100644 --- a/src/indent.c +++ b/src/indent.c @@ -524,7 +524,7 @@ set_indent( char_u *s; int todo; int ind_len; // measured in characters - int line_len; // size of the line (including the NUL) + int line_len; int doit = FALSE; int ind_done = 0; // measured in spaces #ifdef FEAT_VARTABS @@ -540,7 +540,6 @@ set_indent( todo = size; ind_len = 0; p = oldline = ml_get_curline(); - line_len = ml_get_curline_len() + 1; // Calculate the buffer size for the new indent, and check to see if it // isn't already set @@ -661,10 +660,8 @@ set_indent( if (flags & SIN_INSERT) p = oldline; else - { p = skipwhite(p); - line_len -= (int)(p - oldline); - } + line_len = (int)STRLEN(p) + 1; // If 'preserveindent' and 'expandtab' are both set keep the original // characters and allocate accordingly. We will fill the rest with spaces @@ -1333,7 +1330,7 @@ change_indent( // MODE_VREPLACE state needs to know what the line was like before changing if (State & VREPLACE_FLAG) { - orig_line = vim_strnsave(ml_get_curline(), ml_get_curline_len()); // Deal with NULL below + orig_line = vim_strsave(ml_get_curline()); // Deal with NULL below orig_col = curwin->w_cursor.col; } @@ -1511,7 +1508,7 @@ change_indent( return; // Save new line - new_line = vim_strnsave(ml_get_curline(), ml_get_curline_len()); + new_line = vim_strsave(ml_get_curline()); if (new_line == NULL) return; @@ -1761,7 +1758,6 @@ ex_retab(exarg_T *eap) for (lnum = eap->line1; !got_int && lnum <= eap->line2; ++lnum) { ptr = ml_get(lnum); - old_len = ml_get_len(lnum); col = 0; vcol = 0; did_undo = FALSE; @@ -1825,6 +1821,7 @@ ex_retab(exarg_T *eap) // len is actual number of white characters used len = num_spaces + num_tabs; + old_len = (long)STRLEN(ptr); new_len = old_len - col + start_col + len + 1; if (new_len <= 0 || new_len >= MAXCOL) { @@ -1848,7 +1845,6 @@ ex_retab(exarg_T *eap) first_line = lnum; last_line = lnum; ptr = new_line; - old_len = new_len - 1; col = start_col + len; } } @@ -2004,7 +2000,8 @@ lisp_match(char_u *p) while (*word != NUL) { - len = copy_option_part(&word, buf, LSIZE, ","); + (void)copy_option_part(&word, buf, LSIZE, ","); + len = (int)STRLEN(buf); if (STRNCMP(buf, p, len) == 0 && IS_WHITE_OR_NUL(p[len])) return TRUE; } diff --git a/src/insexpand.c b/src/insexpand.c index 5f5a5b90..41aa3f99 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -66,24 +66,24 @@ static char *ctrl_x_msgs[] = #if defined(FEAT_COMPL_FUNC) || defined(FEAT_EVAL) static char *ctrl_x_mode_names[] = { - "keyword", - "ctrl_x", - "scroll", - "whole_line", - "files", - "tags", - "path_patterns", - "path_defines", - "unknown", // CTRL_X_FINISHED - "dictionary", - "thesaurus", - "cmdline", - "function", - "omni", - "spell", - NULL, // CTRL_X_LOCAL_MSG only used in "ctrl_x_msgs" - "eval", - "cmdline", + "keyword", + "ctrl_x", + "scroll", + "whole_line", + "files", + "tags", + "path_patterns", + "path_defines", + "unknown", // CTRL_X_FINISHED + "dictionary", + "thesaurus", + "cmdline", + "function", + "omni", + "spell", + NULL, // CTRL_X_LOCAL_MSG only used in "ctrl_x_msgs" + "eval", + "cmdline", }; #endif @@ -105,11 +105,10 @@ struct compl_S // cp_flags has CP_FREE_FNAME int cp_flags; // CP_ values int cp_number; // sequence number - int cp_score; // fuzzy match score or proximity score + int cp_score; // fuzzy match score int cp_in_match_array; // collected by compl_match_array int cp_user_abbr_hlattr; // highlight attribute for abbr int cp_user_kind_hlattr; // highlight attribute for kind - int cp_cpt_source_idx; // index of this match's source in 'cpt' option }; // values for cp_flags @@ -125,7 +124,7 @@ struct compl_S * "compl_first_match" points to the start of the list. * "compl_curr_match" points to the currently selected entry. * "compl_shown_match" is different from compl_curr_match during - * ins_compl_get_exp(), when new matches are added to the list. + * ins_compl_get_exp(). * "compl_old_match" points to previous "compl_curr_match". */ static compl_T *compl_first_match = NULL; @@ -172,10 +171,7 @@ static int compl_started = FALSE; static int ctrl_x_mode = CTRL_X_NORMAL; static int compl_matches = 0; // number of completion matches -static string_T compl_pattern = {NULL, 0}; // search pattern for matching items -#ifdef FEAT_COMPL_FUNC -static string_T cpt_compl_pattern = {NULL, 0}; // pattern returned by func in 'cpt' -#endif +static string_T compl_pattern = {NULL, 0}; static int compl_direction = FORWARD; static int compl_shows_dir = FORWARD; static int compl_pending = 0; // > 1 for postponed CTRL-N @@ -192,9 +188,6 @@ static string_T compl_orig_text = {NULL, 0}; // text as it was before static int compl_cont_mode = 0; static expand_T compl_xp; -static win_T *compl_curr_win = NULL; // win where completion is active -static buf_T *compl_curr_buf = NULL; // buf where completion is active - // List of flags for method of completion. static int compl_cont_status = 0; # define CONT_ADDING 1 // "normal" or "adding" expansion @@ -215,17 +208,6 @@ static int compl_selected_item = -1; static int *compl_fuzzy_scores; -// Define the structure for completion source (in 'cpt' option) information -typedef struct cpt_source_T -{ - int refresh_always; // Flag array to indicate which 'cpt' functions have 'refresh:always' set - int max_matches; // Maximum number of items to display in the menu from the source -} cpt_source_T; - -static cpt_source_T *cpt_sources_array; // Pointer to the array of completion sources -static int cpt_sources_count; // Total number of completion sources specified in the 'cpt' option -static int cpt_sources_index; // Index of the current completion source being expanded - // "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; @@ -245,14 +227,7 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg); # if defined(FEAT_COMPL_FUNC) || defined(FEAT_EVAL) static void ins_compl_add_list(list_T *list); static void ins_compl_add_dict(dict_T *dict); -static int get_userdefined_compl_info(colnr_T curs_col, callback_T *cb, int *startcol); -static void get_cpt_func_completion_matches(callback_T *cb); -static callback_T *get_cpt_func_callback(char_u *funcname); # endif -static int cpt_sources_init(void); -static int is_cpt_func_refresh_always(void); -static void cpt_sources_clear(void); -static void cpt_compl_refresh(void); static int ins_compl_key2dir(int c); static int ins_compl_pum_key(int c); static int ins_compl_key2count(int c); @@ -574,11 +549,11 @@ ins_compl_accept_char(int c) */ static char_u * ins_compl_infercase_gettext( - char_u *str, - int char_len, - int compl_char_len, - int min_len, - char_u **tofree) + char_u *str, + int char_len, + int compl_char_len, + int min_len, + char_u **tofree) { int *wca; // Wide character array. char_u *p; @@ -799,86 +774,6 @@ cfc_has_mode(void) return FALSE; } -/* - * Returns TRUE if matches should be sorted based on proximity to the cursor. - */ - static int -is_nearest_active(void) -{ - return (get_cot_flags() & (COT_NEAREST | COT_FUZZY)) == COT_NEAREST; -} - -/* - * Repositions a match in the completion list based on its proximity score. - * If the match is at the head and has a higher score than the next node, - * or if it's in the middle/tail and has a lower score than the previous node, - * it is moved to the correct position while maintaining ascending order. - */ - static void -reposition_match(compl_T *match) -{ - compl_T *insert_before = NULL; - compl_T *insert_after = NULL; - - // Node is at head and score is too big - if (!match->cp_prev) - { - if (match->cp_next && match->cp_next->cp_score > 0 && - match->cp_next->cp_score < match->cp_score) - { - // : compl_first_match is at head and newly inserted node - compl_first_match = compl_curr_match = match->cp_next; - // Find the correct position in ascending order - insert_before = match->cp_next; - do - { - insert_after = insert_before; - insert_before = insert_before->cp_next; - } while (insert_before && insert_before->cp_score > 0 && - insert_before->cp_score < match->cp_score); - } - else - return; - } - // Node is at tail or in the middle but score is too small - else - { - if (match->cp_prev->cp_score > 0 && match->cp_prev->cp_score > match->cp_score) - { - // : compl_curr_match (and newly inserted match) is at tail - if (!match->cp_next) - compl_curr_match = compl_curr_match->cp_prev; - // Find the correct position in ascending order - insert_after = match->cp_prev; - do - { - insert_before = insert_after; - insert_after = insert_after->cp_prev; - } while (insert_after && insert_after->cp_score > 0 && - insert_after->cp_score > match->cp_score); - } - else - return; - } - - if (insert_after) - { - // Remove the match from its current position - if (match->cp_prev) - match->cp_prev->cp_next = match->cp_next; - else - compl_first_match = match->cp_next; - if (match->cp_next) - match->cp_next->cp_prev = match->cp_prev; - - // Insert the match at the correct position - match->cp_next = insert_before; - match->cp_prev = insert_after; - insert_after->cp_next = match; - insert_before->cp_prev = match; - } -} - /* * Add a match to the list of matches. The arguments are: * str - text of the match to add @@ -936,14 +831,7 @@ ins_compl_add( && STRNCMP(match->cp_str.string, str, len) == 0 && ((int)match->cp_str.length <= len || match->cp_str.string[len] == NUL)) - { - if (is_nearest_active() && score > 0 && score < match->cp_score) - { - match->cp_score = score; - reposition_match(match); - } return NOTDONE; - } match = match->cp_next; } while (match != NULL && !is_first_match(match)); } @@ -985,11 +873,12 @@ ins_compl_add( match->cp_user_abbr_hlattr = user_hl ? user_hl[0] : -1; match->cp_user_kind_hlattr = user_hl ? user_hl[1] : -1; match->cp_score = score; - match->cp_cpt_source_idx = cpt_sources_index; if (cptext != NULL) { - for (int i = 0; i < CPT_COUNT; ++i) + int i; + + for (i = 0; i < CPT_COUNT; ++i) { if (cptext[i] != NULL && *cptext[i] != NUL) match->cp_text[i] = vim_strsave(cptext[i]); @@ -1016,13 +905,13 @@ ins_compl_add( { if (current->cp_score < score) { - match->cp_next = current; - match->cp_prev = current->cp_prev; - if (current->cp_prev) + match->cp_next = current; + match->cp_prev = current->cp_prev; + if (current->cp_prev) current->cp_prev->cp_next = match; - current->cp_prev = match; - inserted = TRUE; - break; + current->cp_prev = match; + inserted = TRUE; + break; } prev = current; current = current->cp_next; @@ -1053,9 +942,6 @@ ins_compl_add( compl_first_match = match; compl_curr_match = match; - if (is_nearest_active() && score > 0) - reposition_match(match); - // Find the longest common string if still doing that. if (compl_get_longest && (flags & CP_ORIGINAL_TEXT) == 0 && !cfc_has_mode()) ins_compl_longest_match(match); @@ -1228,10 +1114,11 @@ ins_compl_add_matches( char_u **matches, int icase) { + int i; int add_r = OK; int dir = compl_direction; - for (int i = 0; i < num_matches && add_r != FAIL; i++) + for (i = 0; i < num_matches && add_r != FAIL; i++) { add_r = ins_compl_add(matches[i], -1, NULL, NULL, NULL, dir, CP_FAST | (icase ? CP_ICASE : 0), FALSE, NULL, 0); @@ -1304,10 +1191,12 @@ get_cot_flags(void) static void ins_compl_upd_pum(void) { + int h; + if (compl_match_array == NULL) return; - int h = curwin->w_cline_height; + h = curwin->w_cline_height; // Update the screen later, before drawing the popup menu over it. pum_call_update_screen(); if (h != curwin->w_cline_height) @@ -1463,14 +1352,10 @@ ins_compl_build_pum(void) int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; int fuzzy_filter = (cur_cot_flags & COT_FUZZY) != 0; int fuzzy_sort = fuzzy_filter && !(cur_cot_flags & COT_NOSORT); + compl_T *match_head = NULL; compl_T *match_tail = NULL; compl_T *match_next = NULL; - int update_shown_match = fuzzy_filter; - int match_count = 0; - int cur_source = -1; - int max_matches_found = FALSE; - int is_forward = compl_shows_dir_forward() && !fuzzy_filter; // Need to build the popup menu list. compl_match_arraysize = 0; @@ -1481,10 +1366,6 @@ ins_compl_build_pum(void) if (match_at_original_text(compl_shown_match)) shown_match_ok = TRUE; - if (fuzzy_filter && ctrl_x_mode_normal() && compl_leader.string == NULL - && compl_shown_match->cp_score > 0) - update_shown_match = FALSE; - if (compl_leader.string != NULL && STRCMP(compl_leader.string, compl_orig_text.string) == 0 && shown_match_ok == FALSE) @@ -1499,32 +1380,9 @@ ins_compl_build_pum(void) if (fuzzy_filter && compl_leader.string != NULL && compl_leader.length > 0) compl->cp_score = fuzzy_match_str(compl->cp_str.string, compl_leader.string); - if (is_forward && compl->cp_cpt_source_idx != -1) - { - if (cur_source != compl->cp_cpt_source_idx) - { - cur_source = compl->cp_cpt_source_idx; - match_count = 1; - max_matches_found = FALSE; - } - else if (cpt_sources_array != NULL && !max_matches_found) - { - int max_matches = cpt_sources_array[cur_source].max_matches; - if (max_matches > 0 && match_count > max_matches) - max_matches_found = TRUE; - } - } - - // Apply 'smartcase' behavior during normal mode - if (ctrl_x_mode_normal() && !p_inf && compl_leader.string - && !ignorecase(compl_leader.string) && !fuzzy_filter) - compl->cp_flags &= ~CP_ICASE; - if (!match_at_original_text(compl) - && !max_matches_found && (compl_leader.string == NULL - || ins_compl_equal(compl, compl_leader.string, - (int)compl_leader.length) + || ins_compl_equal(compl, compl_leader.string, (int)compl_leader.length) || (fuzzy_filter && compl->cp_score > 0))) { ++compl_match_arraysize; @@ -1557,8 +1415,7 @@ ins_compl_build_pum(void) shown_compl = compl; // Update the maximum fuzzy score and the shown match // if the current item's score is higher - if (fuzzy_sort && compl->cp_score > max_fuzzy_score - && update_shown_match) + if (fuzzy_sort && compl->cp_score > max_fuzzy_score) { did_find_shown_match = TRUE; max_fuzzy_score = compl->cp_score; @@ -1572,8 +1429,6 @@ ins_compl_build_pum(void) shown_match_ok = TRUE; } } - if (is_forward && compl->cp_cpt_source_idx != -1) - match_count++; i++; } @@ -1669,7 +1524,6 @@ ins_compl_show_pum(void) { // popup menu already exists, only need to find the current item. for (i = 0; i < compl_match_arraysize; ++i) - { if (compl_match_array[i].pum_text == compl_shown_match->cp_str.string || compl_match_array[i].pum_text == compl_shown_match->cp_text[CPT_ABBR]) @@ -1677,7 +1531,6 @@ ins_compl_show_pum(void) cur = i; break; } - } } if (compl_match_array == NULL) @@ -1780,10 +1633,11 @@ ins_compl_dictionaries( if (ctrl_x_mode_line_or_eval()) { char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\"); + size_t len; if (pat_esc == NULL) goto theend; - size_t len = STRLEN(pat_esc) + 10; + len = STRLEN(pat_esc) + 10; ptr = alloc(len); if (ptr == NULL) { @@ -1865,10 +1719,10 @@ ins_compl_dictionaries( */ static int thesaurus_add_words_in_line( - char_u *fname, - char_u **buf_arg, - int dir, - char_u *skip_word) + char_u *fname, + char_u **buf_arg, + int dir, + char_u *skip_word) { int status = OK; char_u *ptr; @@ -1943,7 +1797,7 @@ ins_compl_files( if (in_fuzzy_collect) { leader = ins_compl_leader(); - leader_len = (int)ins_compl_leader_len(); + leader_len = ins_compl_leader_len(); } for (i = 0; i < count && !got_int && !compl_interrupted; i++) @@ -2029,15 +1883,11 @@ ins_compl_files( find_word_start(char_u *ptr) { if (has_mbyte) - { while (*ptr != NUL && *ptr != '\n' && mb_get_class(ptr) <= 1) ptr += (*mb_ptr2len)(ptr); - } else - { while (*ptr != NUL && *ptr != '\n' && !vim_iswordc(*ptr)) ++ptr; - } return ptr; } @@ -2048,9 +1898,11 @@ find_word_start(char_u *ptr) char_u * find_word_end(char_u *ptr) { + int start_class; + if (has_mbyte) { - int start_class = mb_get_class(ptr); + start_class = mb_get_class(ptr); if (start_class > 1) while (*ptr != NUL) { @@ -2072,30 +1924,14 @@ find_word_end(char_u *ptr) char_u * find_line_end(char_u *ptr) { - char_u *s = ptr + STRLEN(ptr); + char_u *s; + + s = ptr + STRLEN(ptr); while (s > ptr && (s[-1] == CAR || s[-1] == NL)) --s; return s; } -/* - * Free a completion item in the list - */ - static void -ins_compl_item_free(compl_T *match) -{ - VIM_CLEAR_STRING(match->cp_str); - // several entries may use the same fname, free it just once. - if (match->cp_flags & CP_FREE_FNAME) - vim_free(match->cp_fname); - for (int i = 0; i < CPT_COUNT; ++i) - vim_free(match->cp_text[i]); -#ifdef FEAT_EVAL - clear_tv(&match->cp_user_data); -#endif - vim_free(match); -} - /* * Free the list of completions */ @@ -2103,6 +1939,7 @@ ins_compl_item_free(compl_T *match) ins_compl_free(void) { compl_T *match; + int i; VIM_CLEAR_STRING(compl_pattern); VIM_CLEAR_STRING(compl_leader); @@ -2118,7 +1955,16 @@ ins_compl_free(void) { match = compl_curr_match; compl_curr_match = compl_curr_match->cp_next; - ins_compl_item_free(match); + VIM_CLEAR_STRING(match->cp_str); + // several entries may use the same fname, free it just once. + if (match->cp_flags & CP_FREE_FNAME) + vim_free(match->cp_fname); + for (i = 0; i < CPT_COUNT; ++i) + vim_free(match->cp_text[i]); +#ifdef FEAT_EVAL + clear_tv(&match->cp_user_data); +#endif + vim_free(match); } while (compl_curr_match != NULL && !is_first_match(compl_curr_match)); compl_first_match = compl_curr_match = NULL; compl_shown_match = NULL; @@ -2137,14 +1983,11 @@ ins_compl_clear(void) compl_matches = 0; compl_selected_item = -1; compl_ins_end_col = 0; - compl_curr_win = NULL; - compl_curr_buf = NULL; VIM_CLEAR_STRING(compl_pattern); VIM_CLEAR_STRING(compl_leader); edit_submode_extra = NULL; VIM_CLEAR_STRING(compl_orig_text); compl_enter_selects = FALSE; - cpt_sources_clear(); #ifdef FEAT_EVAL // clear v:completed_item set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc_lock(VAR_FIXED)); @@ -2164,15 +2007,22 @@ ins_compl_active(void) * Return True when wp is the actual completion window */ int -ins_compl_win_active(win_T *wp) +ins_compl_win_active(win_T *wp UNUSED) { - return ins_compl_active() && wp == compl_curr_win - && wp->w_buffer == compl_curr_buf; + return ins_compl_active() +#if defined(FEAT_QUICKFIX) + && (!wp->w_p_pvw +# ifdef FEAT_PROP_POPUP + && !(wp->w_popup_flags & POPF_INFO) +# endif + ) +#endif + ; } /* - * Selected one of the matches. When FALSE, the match was either edited or - * using the longest common string. + * Selected one of the matches. When FALSE the match was edited or using the + * longest common string. */ int ins_compl_used_match(void) @@ -2330,11 +2180,7 @@ ins_compl_new_leader(void) compl_used_match = FALSE; if (compl_started) - { ins_compl_set_original_text(compl_leader.string, compl_leader.length); - if (is_cpt_func_refresh_always()) - cpt_compl_refresh(); - } else { #ifdef FEAT_SPELL @@ -2388,7 +2234,7 @@ get_compl_len(void) void ins_compl_addleader(int c) { - int cc; + int cc; if (ins_compl_preinsert_effect()) ins_compl_delete(); @@ -2447,7 +2293,6 @@ ins_compl_restart(void) compl_matches = 0; compl_cont_status = 0; compl_cont_mode = 0; - cpt_sources_clear(); } /* @@ -2697,7 +2542,7 @@ ins_compl_stop(int c, int prev_mode, int retval) char_u *word = NULL; // Remove pre-inserted text when present. - if (ins_compl_preinsert_effect() && ins_compl_win_active(curwin)) + if (ins_compl_preinsert_effect()) ins_compl_delete(); // Get here when we have finished typing a sequence of ^N and @@ -2785,6 +2630,9 @@ ins_compl_stop(int c, int prev_mode, int retval) retval = TRUE; } + if ((c == Ctrl_W || c == Ctrl_U) && ins_compl_preinsert_effect()) + ins_compl_delete(); + auto_format(FALSE, TRUE); // Trigger the CompleteDonePre event to give scripts a chance to @@ -2821,15 +2669,6 @@ ins_compl_stop(int c, int prev_mode, int retval) return retval; } -/* - * Cancel completion. - */ - int -ins_compl_cancel(void) -{ - return ins_compl_stop(' ', ctrl_x_mode, TRUE); -} - /* * Prepare for Insert mode completion, or stop it. * Called just after typing a character in Insert mode. @@ -2838,8 +2677,8 @@ ins_compl_cancel(void) int ins_compl_prep(int c) { - int retval = FALSE; - int prev_mode = ctrl_x_mode; + int retval = FALSE; + int prev_mode = ctrl_x_mode; // Forget any previous 'special' messages if this is actually // a ^X mode key - bar ^R, in which case we wait to see what it gives us. @@ -3005,8 +2844,8 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg) static buf_T * ins_compl_next_buf(buf_T *buf, int flag) { - static win_T *wp = NULL; - int skip_buffer; + static win_T *wp = NULL; + int skip_buffer; if (flag == 'w') // just windows { @@ -3016,11 +2855,11 @@ ins_compl_next_buf(buf_T *buf, int flag) while (TRUE) { - // Move to next window (wrap to first window if at the end) - wp = (wp->w_next != NULL) ? wp->w_next : firstwin; - // Break if we're back at start or found an unscanned buffer - if (wp == curwin || !wp->w_buffer->b_scanned) - break; + // Move to next window (wrap to first window if at the end) + wp = (wp->w_next != NULL) ? wp->w_next : firstwin; + // Break if we're back at start or found an unscanned buffer + if (wp == curwin || !wp->w_buffer->b_scanned) + break; } buf = wp->w_buffer; } @@ -3162,7 +3001,9 @@ did_set_thesaurusfunc(optset_T *args UNUSED) int set_ref_in_insexpand_funcs(int copyID) { - int abort = set_ref_in_callback(&cfu_cb, copyID); + int abort = FALSE; + + abort = set_ref_in_callback(&cfu_cb, copyID); abort = abort || set_ref_in_callback(&ofu_cb, copyID); abort = abort || set_ref_in_callback(&tsrfu_cb, copyID); @@ -3205,30 +3046,24 @@ get_insert_callback(int type) /* * Execute user defined complete function 'completefunc', 'omnifunc' or * 'thesaurusfunc', and get matches in "matches". - * "type" can be one of CTRL_X_OMNI, CTRL_X_FUNCTION, or CTRL_X_THESAURUS. - * Callback function "cb" is set if triggered by a function in the 'cpt' - * option; otherwise, it is NULL. + * "type" is either CTRL_X_OMNI or CTRL_X_FUNCTION or CTRL_X_THESAURUS. */ static void -expand_by_function(int type, char_u *base, callback_T *cb) +expand_by_function(int type, char_u *base) { list_T *matchlist = NULL; dict_T *matchdict = NULL; typval_T args[3]; char_u *funcname; pos_T pos; + callback_T *cb; typval_T rettv; int save_State = State; int retval; - int is_cpt_function = (cb != NULL); - if (!is_cpt_function) - { - funcname = get_complete_funcname(type); - if (*funcname == NUL) - return; - cb = get_insert_callback(type); - } + funcname = get_complete_funcname(type); + if (*funcname == NUL) + return; // Call 'completefunc' to obtain the list of matches. args[0].v_type = VAR_NUMBER; @@ -3243,6 +3078,7 @@ expand_by_function(int type, char_u *base, callback_T *cb) // Insert mode in another buffer. ++textlock; + cb = get_insert_callback(type); retval = call_callback(cb, 0, &rettv, 2, args); // Call a function, which returns a list or dict. @@ -3299,7 +3135,7 @@ expand_by_function(int type, char_u *base, callback_T *cb) get_user_highlight_attr(char_u *hlname) { if (hlname != NULL && *hlname != NUL) - return syn_name2attr(hlname); + return syn_name2attr(hlname); return -1; } /* @@ -3455,8 +3291,8 @@ set_completion(colnr_T startcol, list_T *list) } compl_orig_text.length = (size_t)compl_length; if (ins_compl_add(compl_orig_text.string, - (int)compl_orig_text.length, NULL, NULL, NULL, 0, - flags | CP_FAST, FALSE, NULL, 0) != OK) + (int)compl_orig_text.length, NULL, NULL, NULL, 0, + flags | CP_FAST, FALSE, NULL, 0) != OK) return; ctrl_x_mode = CTRL_X_EVAL; @@ -3493,6 +3329,8 @@ set_completion(colnr_T startcol, list_T *list) void f_complete(typval_T *argvars, typval_T *rettv UNUSED) { + int startcol; + if (in_vim9script() && (check_for_number_arg(argvars, 0) == FAIL || check_for_list_arg(argvars, 1) == FAIL)) @@ -3511,7 +3349,7 @@ f_complete(typval_T *argvars, typval_T *rettv UNUSED) if (check_for_nonnull_list_arg(argvars, 1) != FAIL) { - int startcol = (int)tv_get_number_chk(&argvars[0], NULL); + startcol = (int)tv_get_number_chk(&argvars[0], NULL); if (startcol > 0) set_completion(startcol - 1, argvars[1].vval.v_list); } @@ -3544,155 +3382,6 @@ f_complete_check(typval_T *argvars UNUSED, typval_T *rettv) RedrawingDisabled = save_RedrawingDisabled; } -/* - * Add match item to the return list. - * Returns FAIL if out of memory, OK otherwise. - */ - static int -add_match_to_list( - typval_T *rettv, - char_u *str, - int len, - int pos) -{ - list_T *match; - int ret; - - match = list_alloc(); - if (match == NULL) - return FAIL; - - if ((ret = list_append_number(match, pos + 1)) == FAIL - || (ret = list_append_string(match, str, len)) == FAIL - || (ret = list_append_list(rettv->vval.v_list, match)) == FAIL) - { - vim_free(match); - return FAIL; - } - - return OK; -} - -/* - * "complete_match()" function - */ - void -f_complete_match(typval_T *argvars, typval_T *rettv) -{ - linenr_T lnum; - colnr_T col; - char_u *line = NULL; - char_u *ise = NULL; - regmatch_T regmatch; - char_u *before_cursor = NULL; - char_u *cur_end = NULL; - int bytepos = 0; - char_u part[MAXPATHL]; - int ret; - - if (rettv_list_alloc(rettv) == FAIL) - return; - - ise = curbuf->b_p_ise[0] != NUL ? curbuf->b_p_ise : p_ise; - - if (argvars[0].v_type == VAR_UNKNOWN) - { - lnum = curwin->w_cursor.lnum; - col = curwin->w_cursor.col; - } - else if (argvars[1].v_type == VAR_UNKNOWN) - { - emsg(_(e_invalid_argument)); - return; - } - else - { - lnum = (linenr_T)tv_get_number(&argvars[0]); - col = (colnr_T)tv_get_number(&argvars[1]); - if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) - { - semsg(_(e_invalid_line_number_nr), lnum); - return; - } - if (col < 1 || col > ml_get_buf_len(curbuf, lnum)) - { - semsg(_(e_invalid_column_number_nr), col + 1); - return; - } - } - - line = ml_get_buf(curbuf, lnum, FALSE); - if (line == NULL) - return; - - before_cursor = vim_strnsave(line, col); - if (before_cursor == NULL) - return; - - if (ise == NULL || *ise == NUL) - { - regmatch.regprog = vim_regcomp((char_u *)"\\k\\+$", RE_MAGIC); - if (regmatch.regprog != NULL) - { - if (vim_regexec_nl(®match, before_cursor, (colnr_T)0)) - { - char_u *trig = vim_strnsave(regmatch.startp[0], - regmatch.endp[0] - regmatch.startp[0]); - if (trig == NULL) - { - vim_free(before_cursor); - vim_regfree(regmatch.regprog); - return; - } - - bytepos = (int)(regmatch.startp[0] - before_cursor); - ret = add_match_to_list(rettv, trig, -1, bytepos); - vim_free(trig); - if (ret == FAIL) - { - vim_free(before_cursor); - vim_regfree(regmatch.regprog); - return; - } - } - vim_regfree(regmatch.regprog); - } - } - else - { - char_u *p = ise; - cur_end = before_cursor + (int)STRLEN(before_cursor); - - while (*p != NUL) - { - int len = 0; - if (*p == ',' && *(p+1) == ' ' && (*(p+2) == ',' || *(p+2) == NUL)) - { - part[0] = ' '; - len = 1; - p++; - } - else - len = copy_option_part(&p, part, MAXPATHL, ","); - - if (len > 0 && len <= col) - { - if (STRNCMP(cur_end - len, part, len) == 0) - { - bytepos = col - len; - if (add_match_to_list(rettv, part, len, bytepos) == FAIL) - { - vim_free(before_cursor); - return; - } - } - } - } - } - - vim_free(before_cursor); -} - /* * Return Insert completion mode name string */ @@ -3771,12 +3460,12 @@ fill_complete_info_dict(dict_T *di, compl_T *match, int add_match) dict_add_string(di, "kind", match->cp_text[CPT_KIND]); dict_add_string(di, "info", match->cp_text[CPT_INFO]); if (add_match) - dict_add_bool(di, "match", match->cp_in_match_array); + dict_add_bool(di, "match", match->cp_in_match_array); if (match->cp_user_data.v_type == VAR_UNKNOWN) - // Add an empty string for backwards compatibility - dict_add_string(di, "user_data", (char_u *)""); + // Add an empty string for backwards compatibility + dict_add_string(di, "user_data", (char_u *)""); else - dict_add_tv(di, "user_data", &match->cp_user_data); + dict_add_tv(di, "user_data", &match->cp_user_data); } /* @@ -3795,7 +3484,6 @@ get_complete_info(list_T *what_list, dict_T *retdict) #define CI_WHAT_MATCHES 0x20 #define CI_WHAT_ALL 0xff int what_flag; - int compl_fuzzy_match = (get_cot_flags() & COT_FUZZY) != 0; if (what_list == NULL) what_flag = CI_WHAT_ALL & ~(CI_WHAT_MATCHES | CI_WHAT_COMPLETED); @@ -3872,8 +3560,7 @@ get_complete_info(list_T *what_list, dict_T *retdict) if (compl_curr_match != NULL && compl_curr_match->cp_number == match->cp_number) selected_idx = list_idx; - if (compl_fuzzy_match || match->cp_in_match_array) - list_idx += 1; + list_idx += 1; } match = match->cp_next; } @@ -3958,7 +3645,6 @@ typedef struct int found_all; // found all matches of a certain type. char_u *dict; // dictionary file to search int dict_f; // "dict" is an exact file name or not - callback_T *func_cb; // callback of function in 'cpt' option } ins_compl_next_state_T; /* @@ -4072,19 +3758,6 @@ process_next_cpt_value( st->dict_f = DICT_FIRST; } } -#ifdef FEAT_COMPL_FUNC - else if (*st->e_cpt == 'f' || *st->e_cpt == 'o') - { - compl_type = CTRL_X_FUNCTION; - if (*st->e_cpt == 'o') - st->func_cb = &curbuf->b_ofu_cb; - else - st->func_cb = (*++st->e_cpt != ',' && *st->e_cpt != NUL) - ? get_cpt_func_callback(st->e_cpt) : &curbuf->b_cfu_cb; - if (!st->func_cb) - compl_type = -1; - } -#endif #ifdef FEAT_FIND_ID else if (*st->e_cpt == 'i') compl_type = CTRL_X_PATH_PATTERNS; @@ -4143,7 +3816,7 @@ get_next_dict_tsr_completion(int compl_type, char_u *dict, int dict_f) { #ifdef FEAT_COMPL_FUNC if (thesaurus_func_complete(compl_type)) - expand_by_function(compl_type, compl_pattern.string, NULL); + expand_by_function(compl_type, compl_pattern.string); else #endif ins_compl_dictionaries( @@ -4228,7 +3901,7 @@ fuzzy_longest_match(void) compl_T *nn_compl = NULL; if (compl_num_bests == 0) - return; + return; nn_compl = compl_first_match->cp_next->cp_next; if (nn_compl && nn_compl != compl_first_match) @@ -4250,12 +3923,12 @@ fuzzy_longest_match(void) compl_best_matches = (compl_T **)alloc(compl_num_bests * sizeof(compl_T *)); if (compl_best_matches == NULL) - return; + return; while (compl != NULL && i < compl_num_bests) { - compl_best_matches[i] = compl; - compl = compl->cp_next; - i++; + compl_best_matches[i] = compl; + compl = compl->cp_next; + i++; } prefix = compl_best_matches[0]->cp_str.string; @@ -4264,9 +3937,9 @@ fuzzy_longest_match(void) for (i = 1; i < compl_num_bests; i++) { match_str = compl_best_matches[i]->cp_str.string; - prefix_ptr = prefix; - match_ptr = match_str; - j = 0; + prefix_ptr = prefix; + match_ptr = match_str; + j = 0; while (j < prefix_len && *match_ptr != NUL && *prefix_ptr != NUL) { @@ -4439,11 +4112,11 @@ get_next_filename_completion(void) for (i = 0; i < fuzzy_indices.ga_len; ++i) { - match = matches[fuzzy_indices_data[i]]; + match = matches[fuzzy_indices_data[i]]; current_score = compl_fuzzy_scores[fuzzy_indices_data[i]]; if (ins_compl_add(match, -1, NULL, NULL, NULL, dir, - CP_FAST | ((p_fic || p_wic) ? CP_ICASE : 0), - FALSE, NULL, current_score) == OK) + CP_FAST | ((p_fic || p_wic) ? CP_ICASE : 0), + FALSE, NULL, current_score) == OK) dir = FORWARD; if (need_collect_bests) @@ -4631,7 +4304,6 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) int in_collect = (cfc_has_mode() && compl_length > 0); char_u *leader = ins_compl_leader(); int score = 0; - int in_curbuf = st->ins_buf == curbuf; // If 'infercase' is set, don't use 'smartcase' here save_p_scs = p_scs; @@ -4643,7 +4315,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) // buffer is a good idea, on the other hand, we always set // wrapscan for curbuf to avoid missing matches -- Acevedo,Webb save_p_ws = p_ws; - if (!in_curbuf) + if (st->ins_buf != curbuf) p_ws = FALSE; else if (*st->e_cpt == '.') p_ws = TRUE; @@ -4656,7 +4328,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) if (in_collect) { - found_new_match = search_for_fuzzy_match(st->ins_buf, + found_new_match = search_for_fuzzy_match(st->ins_buf, st->cur_match_pos, leader, compl_direction, start_pos, &len, &ptr, &score); } @@ -4708,7 +4380,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) break; // when ADDING, the text before the cursor matches, skip it - if (compl_status_adding() && in_curbuf + if (compl_status_adding() && st->ins_buf == curbuf && start_pos->lnum == st->cur_match_pos->lnum && start_pos->col == st->cur_match_pos->col) continue; @@ -4719,16 +4391,8 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) if (ptr == NULL || (ins_compl_has_preinsert() && STRCMP(ptr, compl_pattern.string) == 0)) continue; - if (is_nearest_active() && in_curbuf) - { - score = st->cur_match_pos->lnum - curwin->w_cursor.lnum; - if (score < 0) - score = -score; - score++; - } - if (ins_compl_add_infercase(ptr, len, p_ic, - in_curbuf ? NULL : st->ins_buf->b_sfname, + st->ins_buf == curbuf ? NULL : st->ins_buf->b_sfname, 0, cont_s_ipos, score) != NOTDONE) { if (in_collect && score == compl_first_match->cp_next->cp_score) @@ -4743,38 +4407,6 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) return found_new_match; } -/* - * Return the callback function associated with "funcname". - */ -#ifdef FEAT_COMPL_FUNC - static callback_T * -get_cpt_func_callback(char_u *funcname) -{ - static callback_T cb; - char_u buf[LSIZE]; - int slen; - - slen = copy_option_part(&funcname, buf, LSIZE, ","); - if (slen > 0 && option_set_callback_func(buf, &cb)) - return &cb; - return NULL; -} - -/* - * Retrieve new completion matches by invoking callback "cb". - */ - static void -expand_cpt_function(callback_T *cb) -{ - // Re-insert the text removed by ins_compl_delete(). - ins_compl_insert_bytes(compl_orig_text.string + get_compl_len(), -1); - // Get matches - get_cpt_func_completion_matches(cb); - // Undo insertion - ins_compl_delete(); -} -#endif - /* * get the next set of completion matches for "type". * Returns TRUE if a new match is found. Otherwise returns FALSE. @@ -4816,13 +4448,8 @@ get_next_completion_match(int type, ins_compl_next_state_T *st, pos_T *ini) #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: - if (ctrl_x_mode_normal()) // Invoked by a func in 'cpt' option - expand_cpt_function(st->func_cb); - else - expand_by_function(type, compl_pattern.string, NULL); - break; case CTRL_X_OMNI: - expand_by_function(type, compl_pattern.string, NULL); + expand_by_function(type, compl_pattern.string); break; #endif @@ -4844,39 +4471,6 @@ get_next_completion_match(int type, ins_compl_next_state_T *st, pos_T *ini) return found_new_match; } -/* - * Strips carets followed by numbers. This suffix typically represents the - * max_matches setting. - */ - static void -strip_caret_numbers_in_place(char_u *str) -{ - char_u *read = str, *write = str, *p; - - if (str == NULL) - return; - - while (*read) - { - if (*read == '^') - { - p = read + 1; - while (vim_isdigit(*p)) - p++; - if ((*p == ',' || *p == '\0') && p != read + 1) - { - read = p; - continue; - } - else - *write++ = *read++; - } - else - *write++ = *read++; - } - *write = '\0'; -} - /* * Get the next expansion(s), using "compl_pattern". * The search starts at position "ini" in curbuf and in the direction @@ -4912,13 +4506,8 @@ ins_compl_get_exp(pos_T *ini) // Make a copy of 'complete', in case the buffer is wiped out. st.e_cpt_copy = vim_strsave((compl_cont_status & CONT_LOCAL) ? (char_u *)"." : curbuf->b_p_cpt); - strip_caret_numbers_in_place(st.e_cpt_copy); st.e_cpt = st.e_cpt_copy == NULL ? (char_u *)"" : st.e_cpt_copy; st.last_match_pos = st.first_match_pos = *ini; - - if ((ctrl_x_mode_normal() || ctrl_x_mode_line_or_eval()) - && !cpt_sources_init()) - return FAIL; } else if (st.ins_buf != curbuf && !buf_valid(st.ins_buf)) st.ins_buf = curbuf; // In case the buffer was wiped out. @@ -4928,7 +4517,7 @@ ins_compl_get_exp(pos_T *ini) ? &st.last_match_pos : &st.first_match_pos; // For ^N/^P loop over all the flags/windows/buffers in 'complete'. - for (cpt_sources_index = 0;;) + for (;;) { found_new_match = FAIL; st.set_match_pos = FALSE; @@ -4944,10 +4533,7 @@ ins_compl_get_exp(pos_T *ini) if (status == INS_COMPL_CPT_END) break; if (status == INS_COMPL_CPT_CONT) - { - cpt_sources_index++; continue; - } } // If complete() was called then compl_pattern has been reset. The @@ -4958,9 +4544,6 @@ ins_compl_get_exp(pos_T *ini) // get the next set of completion matches found_new_match = get_next_completion_match(type, &st, ini); - if (type > 0) - cpt_sources_index++; - // break the loop for specialized modes (use 'complete' just for the // generic ctrl_x_mode == CTRL_X_NORMAL) or when we've found a new // match @@ -4987,7 +4570,6 @@ ins_compl_get_exp(pos_T *ini) compl_started = FALSE; } } - cpt_sources_index = -1; compl_started = TRUE; if ((ctrl_x_mode_normal() || ctrl_x_mode_line_or_eval()) @@ -5060,7 +4642,7 @@ ins_compl_delete(void) int has_preinsert = ins_compl_preinsert_effect(); if (has_preinsert) { - col += (int)ins_compl_leader_len(); + col += ins_compl_leader_len(); curwin->w_cursor.col = compl_ins_end_col; } @@ -5244,48 +4826,28 @@ find_comp_when_fuzzy(void) if ((is_forward && compl_selected_item == compl_match_arraysize - 1) || (is_backward && compl_selected_item == 0)) - return match_at_original_text(compl_first_match) - ? compl_first_match : compl_first_match->cp_prev; + return compl_first_match != compl_shown_match ? compl_first_match : + (compl_first_match->cp_prev ? compl_first_match->cp_prev : NULL); if (is_forward) target_idx = compl_selected_item + 1; else if (is_backward) - target_idx = compl_selected_item == -1 ? compl_match_arraysize - 1 + target_idx = compl_selected_item == -1 ? compl_match_arraysize - 1 : compl_selected_item - 1; score = compl_match_array[target_idx].pum_score; str = compl_match_array[target_idx].pum_text; comp = compl_first_match; - do - { - if (comp->cp_score == score && (str == comp->cp_str.string || str == comp->cp_text[CPT_ABBR])) - return comp; - comp = comp->cp_next; + do { + if (comp->cp_score == score && (str == comp->cp_str.string || str == comp->cp_text[CPT_ABBR])) + return comp; + comp = comp->cp_next; } while (comp != NULL && !is_first_match(comp)); return NULL; } -/* - * Find the appropriate completion item when 'complete' ('cpt') includes - * a 'max_matches' postfix. In this case, we search for a match where - * 'cp_in_match_array' is set, indicating that the match is also present - * in 'compl_match_array'. - */ - static compl_T * -find_comp_when_cpt_sources(void) -{ - int is_forward = compl_shows_dir_forward(); - compl_T *match = compl_shown_match; - - do - match = is_forward ? match->cp_next : match->cp_prev; - while (match->cp_next && !match->cp_in_match_array - && !match_at_original_text(match)); - return match; -} - /* * Find the next set of matches for completion. Repeat the completion "todo" * times. The number of matches found is returned in 'num_matches'. @@ -5311,18 +4873,13 @@ find_next_completion_match( unsigned int cur_cot_flags = get_cot_flags(); int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; int compl_fuzzy_match = (cur_cot_flags & COT_FUZZY) != 0; - int cpt_sources_active = compl_match_array && cpt_sources_array; while (--todo >= 0) { if (compl_shows_dir_forward() && compl_shown_match->cp_next != NULL) { - if (compl_match_array != NULL && compl_fuzzy_match) - compl_shown_match = find_comp_when_fuzzy(); - else if (cpt_sources_active) - compl_shown_match = find_comp_when_cpt_sources(); - else - compl_shown_match = compl_shown_match->cp_next; + compl_shown_match = compl_fuzzy_match && compl_match_array != NULL + ? find_comp_when_fuzzy() : compl_shown_match->cp_next; found_end = (compl_first_match != NULL && (is_first_match(compl_shown_match->cp_next) || is_first_match(compl_shown_match))); @@ -5331,12 +4888,8 @@ find_next_completion_match( && compl_shown_match->cp_prev != NULL) { found_end = is_first_match(compl_shown_match); - if (compl_match_array != NULL && compl_fuzzy_match) - compl_shown_match = find_comp_when_fuzzy(); - else if (cpt_sources_active) - compl_shown_match = find_comp_when_cpt_sources(); - else - compl_shown_match = compl_shown_match->cp_prev; + compl_shown_match = compl_fuzzy_match && compl_match_array != NULL + ? find_comp_when_fuzzy() : compl_shown_match->cp_prev; found_end |= is_first_match(compl_shown_match); } else @@ -5636,9 +5189,11 @@ ins_compl_pum_key(int c) static int ins_compl_key2count(int c) { + int h; + if (ins_compl_pum_key(c) && c != K_UP && c != K_DOWN) { - int h = pum_get_height(); + h = pum_get_height(); if (h > 3) h -= 2; // keep some context return h; @@ -5772,11 +5327,8 @@ get_normal_compl_info(char_u *line, int startcol, colnr_T curs_col) } } else - { while (--startcol >= 0 && vim_iswordc(line[startcol])) ; - } - compl_col += ++startcol; compl_length = (int)curs_col - startcol; if (compl_length == 1) @@ -5920,43 +5472,31 @@ get_cmdline_compl_info(char_u *line, colnr_T curs_col) * 'completefunc' and 'thesaurusfunc') * Sets the global variables: compl_col, compl_length and compl_pattern. * Uses the global variable: spell_bad_len - * Callback function "cb" is set if triggered by a function in the 'cpt' - * option; otherwise, it is NULL. - * "startcol", when not NULL, contains the column returned by function. */ static int -get_userdefined_compl_info( - colnr_T curs_col UNUSED, - callback_T *cb UNUSED, - int *startcol UNUSED) +get_userdefined_compl_info(colnr_T curs_col UNUSED) { int ret = FAIL; #ifdef FEAT_COMPL_FUNC // Call user defined function 'completefunc' with "a:findstart" // set to 1 to obtain the length of text to use for completion. - char_u *line = NULL; + char_u *line; typval_T args[3]; int col; - char_u *funcname = NULL; + char_u *funcname; pos_T pos; int save_State = State; - int len; - string_T *compl_pat = NULL; - int is_cpt_function = (cb != NULL); + callback_T *cb; - if (!is_cpt_function) + // Call 'completefunc' or 'omnifunc' or 'thesaurusfunc' and get pattern + // length as a string + funcname = get_complete_funcname(ctrl_x_mode); + if (*funcname == NUL) { - // Call 'completefunc' or 'omnifunc' or 'thesaurusfunc' and get pattern - // length as a string - funcname = get_complete_funcname(ctrl_x_mode); - if (*funcname == NUL) - { - semsg(_(e_option_str_is_not_set), ctrl_x_mode_function() - ? "completefunc" : "omnifunc"); - return FAIL; - } - cb = get_insert_callback(ctrl_x_mode); + semsg(_(e_option_str_is_not_set), ctrl_x_mode_function() + ? "completefunc" : "omnifunc"); + return FAIL; } args[0].v_type = VAR_NUMBER; @@ -5966,6 +5506,7 @@ get_userdefined_compl_info( args[2].v_type = VAR_UNKNOWN; pos = curwin->w_cursor; ++textlock; + cb = get_insert_callback(ctrl_x_mode); col = call_callback_retnr(cb, 2, args); --textlock; @@ -5979,20 +5520,14 @@ get_userdefined_compl_info( return FAIL; } - if (startcol != NULL) - *startcol = col; - // Return value -2 means the user complete function wants to cancel the // complete without an error, do the same if the function did not execute // successfully. if (col == -2 || aborting()) return FAIL; - // Return value -3 does the same as -2 and leaves CTRL-X mode. if (col == -3) { - if (is_cpt_function) - return FAIL; ctrl_x_mode = CTRL_X_NORMAL; edit_submode = NULL; if (!shortmess(SHM_COMPLETIONMENU)) @@ -6005,27 +5540,24 @@ get_userdefined_compl_info( compl_opt_refresh_always = FALSE; compl_opt_suppress_empty = FALSE; - if (col < 0 || col > curs_col) + if (col < 0) col = curs_col; + compl_col = col; + if (compl_col > curs_col) + compl_col = curs_col; // Setup variables for completion. Need to obtain "line" again, // it may have become invalid. line = ml_get(curwin->w_cursor.lnum); - len = curs_col - col; - compl_pat = is_cpt_function ? &cpt_compl_pattern : &compl_pattern; - compl_pat->string = vim_strnsave(line + col, (size_t)len); - if (compl_pat->string == NULL) + compl_length = curs_col - compl_col; + compl_pattern.string = vim_strnsave(line + compl_col, (size_t)compl_length); + if (compl_pattern.string == NULL) { - compl_pat->length = 0; + compl_pattern.length = 0; return FAIL; } - compl_pat->length = (size_t)compl_length; - if (!is_cpt_function) - { - compl_col = col; - compl_length = len; - } + compl_pattern.length = (size_t)compl_length; ret = OK; #endif @@ -6042,13 +5574,12 @@ get_spell_compl_info(int startcol UNUSED, colnr_T curs_col UNUSED) { int ret = FAIL; #ifdef FEAT_SPELL - char_u *line = NULL; + char_u *line; if (spell_bad_len > 0) compl_col = curs_col - spell_bad_len; else compl_col = spell_word_start(startcol); - if (compl_col >= (colnr_T)startcol) { compl_length = 0; @@ -6107,7 +5638,7 @@ compl_get_info(char_u *line, int startcol, colnr_T curs_col, int *line_invalid) else if (ctrl_x_mode_function() || ctrl_x_mode_omni() || thesaurus_func_complete(ctrl_x_mode)) { - if (get_userdefined_compl_info(curs_col, NULL, NULL) != OK) + if (get_userdefined_compl_info(curs_col) == FAIL) return FAIL; *line_invalid = TRUE; // "line" may have become invalid } @@ -6195,7 +5726,7 @@ ins_compl_continue_search(char_u *line) static int ins_compl_start(void) { - char_u *line = NULL; + char_u *line; int startcol = 0; // column where searched text starts colnr_T curs_col; // cursor column int line_invalid = FALSE; @@ -6203,6 +5734,7 @@ ins_compl_start(void) int flags = CP_ORIGINAL_TEXT; // First time we hit ^N or ^P (in a row, I mean) + did_ai = FALSE; did_si = FALSE; can_si = FALSE; @@ -6248,6 +5780,7 @@ ins_compl_start(void) if (line_invalid) line = ml_get(curwin->w_cursor.lnum); + int in_fuzzy = get_cot_flags() & COT_FUZZY; if (compl_status_adding()) { edit_submode_pre = (char_u *)_(" Adding"); @@ -6265,7 +5798,7 @@ ins_compl_start(void) compl_col = curwin->w_cursor.col; compl_lnum = curwin->w_cursor.lnum; } - else if (ctrl_x_mode_normal() && cfc_has_mode()) + else if (ctrl_x_mode_normal() && in_fuzzy) { compl_startpos = curwin->w_cursor; compl_cont_status &= CONT_S_IPOS; @@ -6425,8 +5958,6 @@ ins_complete(int c, int enable_pum) else if (insert_match && stop_arrow() == FAIL) return FAIL; - compl_curr_win = curwin; - compl_curr_buf = curwin->w_buffer; compl_shown_match = compl_curr_match; compl_shows_dir = compl_direction; @@ -6546,9 +6077,11 @@ quote_meta(char_u *dest, char_u *src, int len) // Copy remaining bytes of a multibyte character. if (has_mbyte) { - int mb_len = (*mb_ptr2len)(src) - 1; + int i, mb_len; + + mb_len = (*mb_ptr2len)(src) - 1; if (mb_len > 0 && len >= mb_len) - for (int i = 0; i < mb_len; ++i) + for (i = 0; i < mb_len; ++i) { --len; ++src; @@ -6591,244 +6124,3 @@ spell_back_to_badword(void) start_arrow(&tpos); } #endif - -/* - * Reset the info associated with completion sources. - */ - static void -cpt_sources_clear(void) -{ - VIM_CLEAR(cpt_sources_array); - cpt_sources_index = -1; - cpt_sources_count = 0; -} - -/* - * Initialize the info associated with completion sources. - */ - static int -cpt_sources_init(void) -{ - char_u buf[LSIZE]; - int slen; - int count = 0; - char_u *p; - - for (p = curbuf->b_p_cpt; *p;) - { - while (*p == ',' || *p == ' ') // Skip delimiters - p++; - if (*p) // If not end of string, count this segment - { - (void)copy_option_part(&p, buf, LSIZE, ","); // Advance p - count++; - } - } - cpt_sources_clear(); - cpt_sources_count = count; - if (count > 0) - { - cpt_sources_array = ALLOC_CLEAR_MULT(cpt_source_T, count); - if (cpt_sources_array == NULL) - { - cpt_sources_count = 0; - return FAIL; - } - count = 0; - for (p = curbuf->b_p_cpt; *p;) - { - while (*p == ',' || *p == ' ') // Skip delimiters - p++; - if (*p) // If not end of string, count this segment - { - char_u *t; - - vim_memset(buf, 0, LSIZE); - slen = copy_option_part(&p, buf, LSIZE, ","); // Advance p - if (slen > 0 && (t = vim_strchr(buf, '^')) != NULL) - cpt_sources_array[count].max_matches = atoi((char *)t + 1); - count++; - } - } - } - return OK; -} - -/* - * Return TRUE if any of the completion sources have 'refresh' set to 'always'. - */ - static int -is_cpt_func_refresh_always(void) -{ -#ifdef FEAT_COMPL_FUNC - for (int i = 0; i < cpt_sources_count; i++) - if (cpt_sources_array[i].refresh_always) - return TRUE; -#endif - return FALSE; -} - -/* - * Make the completion list non-cyclic. - */ -#ifdef FEAT_COMPL_FUNC - static void -ins_compl_make_linear(void) -{ - compl_T *m; - - if (compl_first_match == NULL || compl_first_match->cp_prev == NULL) - return; - m = compl_first_match->cp_prev; - m->cp_next = NULL; - compl_first_match->cp_prev = NULL; -} -#endif - -/* - * Remove the matches linked to the current completion source (as indicated by - * cpt_sources_index) from the completion list. - */ -#ifdef FEAT_COMPL_FUNC - static compl_T * -remove_old_matches(void) -{ - compl_T *sublist_start = NULL, *sublist_end = NULL, *insert_at = NULL; - compl_T *current, *next; - int compl_shown_removed = FALSE; - int forward = (compl_first_match->cp_cpt_source_idx < 0); - - compl_direction = forward ? FORWARD : BACKWARD; - compl_shows_dir = compl_direction; - - // Identify the sublist of old matches that needs removal - for (current = compl_first_match; current != NULL; current = current->cp_next) - { - if (current->cp_cpt_source_idx < cpt_sources_index && - (forward || (!forward && !insert_at))) - insert_at = current; - - if (current->cp_cpt_source_idx == cpt_sources_index) - { - if (!sublist_start) - sublist_start = current; - sublist_end = current; - if (!compl_shown_removed && compl_shown_match == current) - compl_shown_removed = TRUE; - } - - if ((forward && current->cp_cpt_source_idx > cpt_sources_index) - || (!forward && insert_at)) - break; - } - - // Re-assign compl_shown_match if necessary - if (compl_shown_removed) - { - if (forward) - compl_shown_match = compl_first_match; - else - { // Last node will have the prefix that is being completed - for (current = compl_first_match; current->cp_next != NULL; - current = current->cp_next) - ; - compl_shown_match = current; - } - } - - if (!sublist_start) // No nodes to remove - return insert_at; - - // Update links to remove sublist - if (sublist_start->cp_prev) - sublist_start->cp_prev->cp_next = sublist_end->cp_next; - else - compl_first_match = sublist_end->cp_next; - - if (sublist_end->cp_next) - sublist_end->cp_next->cp_prev = sublist_start->cp_prev; - - // Free all nodes in the sublist - sublist_end->cp_next = NULL; - for (current = sublist_start; current != NULL; current = next) - { - next = current->cp_next; - ins_compl_item_free(current); - } - - return insert_at; -} -#endif - -/* - * Retrieve completion matches using the callback function "cb" and store the - * 'refresh:always' flag. - */ -#ifdef FEAT_COMPL_FUNC - static void -get_cpt_func_completion_matches(callback_T *cb UNUSED) -{ - int ret; - int startcol; - - VIM_CLEAR_STRING(cpt_compl_pattern); - ret = get_userdefined_compl_info(curwin->w_cursor.col, cb, &startcol); - if (ret == FAIL && startcol == -3) - cpt_sources_array[cpt_sources_index].refresh_always = FALSE; - else if (ret == OK) - { - expand_by_function(0, cpt_compl_pattern.string, cb); - cpt_sources_array[cpt_sources_index].refresh_always = - compl_opt_refresh_always; - compl_opt_refresh_always = FALSE; - } -} -#endif - -/* - * Retrieve completion matches from functions in the 'cpt' option where the - * 'refresh:always' flag is set. - */ - static void -cpt_compl_refresh(void) -{ -#ifdef FEAT_COMPL_FUNC - char_u *cpt; - char_u *p; - callback_T *cb = NULL; - - // Make the completion list linear (non-cyclic) - ins_compl_make_linear(); - // Make a copy of 'cpt' in case the buffer gets wiped out - cpt = vim_strsave(curbuf->b_p_cpt); - strip_caret_numbers_in_place(cpt); - - cpt_sources_index = 0; - for (p = cpt; *p; cpt_sources_index++) - { - while (*p == ',' || *p == ' ') // Skip delimiters - p++; - - if (cpt_sources_array[cpt_sources_index].refresh_always) - { - if (*p == 'o') - cb = &curbuf->b_ofu_cb; - else if (*p == 'f') - cb = (*(p + 1) != ',' && *(p + 1) != NUL) - ? get_cpt_func_callback(p + 1) : &curbuf->b_cfu_cb; - if (cb) - { - compl_curr_match = remove_old_matches(); - get_cpt_func_completion_matches(cb); - } - } - - copy_option_part(&p, IObuff, IOSIZE, ","); // Advance p - } - cpt_sources_index = -1; - - vim_free(cpt); - // Make the list cyclic - compl_matches = ins_compl_make_cyclic(); -#endif -} diff --git a/src/job.c b/src/job.c index 9d6c8628..2a2e5310 100644 --- a/src/job.c +++ b/src/job.c @@ -1087,7 +1087,7 @@ set_ref_in_job(int copyID) { tv.v_type = VAR_JOB; tv.vval.v_job = job; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); } return abort; } diff --git a/src/json.c b/src/json.c index faa35e57..66b8bf9d 100644 --- a/src/json.c +++ b/src/json.c @@ -267,7 +267,6 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options) char_u *res; blob_T *b; list_T *l; - tuple_T *tuple; dict_T *d; int i; @@ -370,42 +369,6 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options) } break; - case VAR_TUPLE: - tuple = val->vval.v_tuple; - if (tuple == NULL) - ga_concat(gap, (char_u *)"[]"); - else - { - if (tuple->tv_copyID == copyID) - ga_concat(gap, (char_u *)"[]"); - else - { - int len = TUPLE_LEN(tuple); - - tuple->tv_copyID = copyID; - ga_append(gap, '['); - for (i = 0; i < len && !got_int; i++) - { - typval_T *t_item = TUPLE_ITEM(tuple, i); - if (json_encode_item(gap, t_item, copyID, - options & JSON_JS) == FAIL) - return FAIL; - - if ((options & JSON_JS) - && i == len - 1 - && t_item->v_type == VAR_SPECIAL - && t_item->vval.v_number == VVAL_NONE) - // add an extra comma if the last item is v:none - ga_append(gap, ','); - if (i <= len - 2) - ga_append(gap, ','); - } - ga_append(gap, ']'); - tuple->tv_copyID = 0; - } - } - break; - case VAR_DICT: d = val->vval.v_dict; if (d == NULL) diff --git a/src/linematch.c b/src/linematch.c index 1fab2827..17e932d0 100644 --- a/src/linematch.c +++ b/src/linematch.c @@ -410,16 +410,12 @@ linematch_nbuffers( // create the flattened path matrix diffcmppath_T *diffcmppath = lalloc(sizeof(diffcmppath_T) * memsize, TRUE); - if (diffcmppath == NULL) - return 0; - // allocate memory here - size_t n = (size_t)pow(2.0, (double)ndiffs); for (size_t i = 0; i < memsize; i++) { diffcmppath[i].df_lev_score = 0; diffcmppath[i].df_path_n = 0; - for (size_t j = 0; j < n; j++) + for (size_t j = 0; j < (size_t)pow(2, (double)ndiffs); j++) diffcmppath[i].df_choice_mem[j] = -1; } @@ -432,12 +428,6 @@ linematch_nbuffers( diffcmppath_T *startNode = &diffcmppath[u]; *decisions = lalloc(sizeof(int) * memsize_decisions, TRUE); - if (*decisions == NULL) - { - vim_free(diffcmppath); - return 0; - } - size_t n_optimal = 0; test_charmatch_paths(startNode, 0); while (startNode->df_path_n > 0) diff --git a/src/list.c b/src/list.c index c48c7515..36ce494d 100644 --- a/src/list.c +++ b/src/list.c @@ -1520,13 +1520,15 @@ f_join(typval_T *argvars, typval_T *rettv) rettv->v_type = VAR_STRING; - if (check_for_list_or_tuple_arg(argvars, 0) == FAIL - || check_for_opt_string_arg(argvars, 1) == FAIL) + if (in_vim9script() + && (check_for_list_arg(argvars, 0) == FAIL + || check_for_opt_string_arg(argvars, 1) == FAIL)) + return; + + if (check_for_list_arg(argvars, 0) == FAIL) return; - if ((argvars[0].v_type == VAR_LIST && argvars[0].vval.v_list == NULL) - || (argvars[0].v_type == VAR_TUPLE - && argvars[0].vval.v_tuple == NULL)) + if (argvars[0].vval.v_list == NULL) return; if (argvars[1].v_type == VAR_UNKNOWN) @@ -1537,10 +1539,7 @@ f_join(typval_T *argvars, typval_T *rettv) if (sep != NULL) { ga_init2(&ga, sizeof(char), 80); - if (argvars[0].v_type == VAR_LIST) - list_join(&ga, argvars[0].vval.v_list, sep, TRUE, FALSE, 0); - else - tuple_join(&ga, argvars[0].vval.v_tuple, sep, TRUE, FALSE, 0); + list_join(&ga, argvars[0].vval.v_list, sep, TRUE, FALSE, 0); ga_append(&ga, NUL); rettv->vval.v_string = (char_u *)ga.ga_data; } @@ -1778,63 +1777,6 @@ f_list2str(typval_T *argvars, typval_T *rettv) rettv->vval.v_string = ga.ga_data; } -/* - * "list2tuple()" function - */ - void -f_list2tuple(typval_T *argvars, typval_T *rettv) -{ - list_T *l; - listitem_T *li; - tuple_T *tuple; - - rettv->v_type = VAR_TUPLE; - rettv->vval.v_tuple = NULL; - - if (check_for_list_arg(argvars, 0) == FAIL) - return; - - l = argvars[0].vval.v_list; - if (l == NULL) - return; // empty list results in empty tuple - - CHECK_LIST_MATERIALIZE(l); - - if (rettv_tuple_set_with_items(rettv, list_len(l)) == FAIL) - return; - - tuple = rettv->vval.v_tuple; - FOR_ALL_LIST_ITEMS(l, li) - { - copy_tv(&li->li_tv, TUPLE_ITEM(tuple, TUPLE_LEN(tuple))); - tuple->tv_items.ga_len++; - } -} - -/* - * "tuple2list()" function - */ - void -f_tuple2list(typval_T *argvars, typval_T *rettv) -{ - list_T *l; - tuple_T *tuple; - - if (rettv_list_alloc(rettv) == FAIL) - return; - - if (check_for_tuple_arg(argvars, 0) == FAIL) - return; - - tuple = argvars[0].vval.v_tuple; - if (tuple == NULL) - return; // empty tuple results in empty list - - l = rettv->vval.v_list; - for (int i = 0; i < tuple_len(tuple); i++) - list_append_tv(l, TUPLE_ITEM(tuple, i)); -} - /* * Remove item argvars[1] from List argvars[0]. If argvars[2] is supplied, then * remove the range of items from argvars[1] to argvars[2] (inclusive). @@ -2618,16 +2560,10 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap) copy_tv(&argvars[0], rettv); if (in_vim9script() - && (check_for_list_tuple_dict_blob_or_string_arg(argvars, 0) + && (check_for_list_or_dict_or_blob_or_string_arg(argvars, 0) == FAIL)) return; - if (argvars[0].v_type == VAR_TUPLE && filtermap != FILTERMAP_FOREACH) - { - semsg(_(e_cannot_use_tuple_with_function_str), func_name); - return; - } - if (filtermap == FILTERMAP_MAP && in_vim9script()) { // Check that map() does not change the declared type of the list or @@ -2641,17 +2577,11 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap) if (argvars[0].v_type != VAR_BLOB && argvars[0].v_type != VAR_LIST - && argvars[0].v_type != VAR_TUPLE && argvars[0].v_type != VAR_DICT && argvars[0].v_type != VAR_STRING) { - char *msg; - - if (filtermap == FILTERMAP_FOREACH) - msg = e_argument_of_str_must_be_list_tuple_string_dictionary_or_blob; - else - msg = e_argument_of_str_must_be_list_string_dictionary_or_blob; - semsg(_(msg), func_name); + semsg(_(e_argument_of_str_must_be_list_string_dictionary_or_blob), + func_name); return; } @@ -2681,8 +2611,6 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap) arg_errmsg, rettv); else if (argvars[0].v_type == VAR_STRING) string_filter_map(tv_get_string(&argvars[0]), filtermap, expr, rettv); - else if (argvars[0].v_type == VAR_TUPLE) - tuple_foreach(argvars[0].vval.v_tuple, filtermap, expr); else // argvars[0].v_type == VAR_LIST list_filter_map(argvars[0].vval.v_list, filtermap, type, func_name, arg_errmsg, expr, rettv); @@ -2815,7 +2743,7 @@ f_count(typval_T *argvars, typval_T *rettv) int error = FALSE; if (in_vim9script() - && (check_for_string_list_tuple_or_dict_arg(argvars, 0) == FAIL + && (check_for_string_or_list_or_dict_arg(argvars, 0) == FAIL || check_for_opt_bool_arg(argvars, 2) == FAIL || (argvars[2].v_type != VAR_UNKNOWN && check_for_opt_number_arg(argvars, 3) == FAIL))) @@ -2837,16 +2765,6 @@ f_count(typval_T *argvars, typval_T *rettv) if (!error) n = list_count(argvars[0].vval.v_list, &argvars[1], idx, ic); } - else if (!error && argvars[0].v_type == VAR_TUPLE) - { - long idx = 0; - - if (argvars[2].v_type != VAR_UNKNOWN - && argvars[3].v_type != VAR_UNKNOWN) - idx = (long)tv_get_number_chk(&argvars[3], &error); - if (!error) - n = tuple_count(argvars[0].vval.v_tuple, &argvars[1], idx, ic); - } else if (!error && argvars[0].v_type == VAR_DICT) { if (argvars[2].v_type != VAR_UNKNOWN @@ -3115,7 +3033,7 @@ list_reverse(list_T *l, typval_T *rettv) void f_reverse(typval_T *argvars, typval_T *rettv) { - if (check_for_string_or_list_or_tuple_or_blob_arg(argvars, 0) == FAIL) + if (check_for_string_or_list_or_blob_arg(argvars, 0) == FAIL) return; if (argvars[0].v_type == VAR_BLOB) @@ -3130,8 +3048,6 @@ f_reverse(typval_T *argvars, typval_T *rettv) } else if (argvars[0].v_type == VAR_LIST) list_reverse(argvars[0].vval.v_list, rettv); - else if (argvars[0].v_type == VAR_TUPLE) - tuple_reverse(argvars[0].vval.v_tuple, rettv); } /* @@ -3237,7 +3153,6 @@ list_reduce( /* * "reduce(list, { accumulator, element -> value } [, initial])" function - * "reduce(tuple, { accumulator, element -> value } [, initial])" function * "reduce(blob, { accumulator, element -> value } [, initial])" * "reduce(string, { accumulator, element -> value } [, initial])" */ @@ -3246,9 +3161,18 @@ f_reduce(typval_T *argvars, typval_T *rettv) { char_u *func_name; - if (check_for_string_or_list_or_tuple_or_blob_arg(argvars, 0) == FAIL) + if (in_vim9script() + && check_for_string_or_list_or_blob_arg(argvars, 0) == FAIL) return; + if (argvars[0].v_type != VAR_STRING + && argvars[0].v_type != VAR_LIST + && argvars[0].v_type != VAR_BLOB) + { + emsg(_(e_string_list_or_blob_required)); + return; + } + if (argvars[1].v_type == VAR_FUNC) func_name = argvars[1].vval.v_string; else if (argvars[1].v_type == VAR_PARTIAL) @@ -3263,8 +3187,6 @@ f_reduce(typval_T *argvars, typval_T *rettv) if (argvars[0].v_type == VAR_LIST) list_reduce(argvars, &argvars[1], rettv); - else if (argvars[0].v_type == VAR_TUPLE) - tuple_reduce(argvars, &argvars[1], rettv); else if (argvars[0].v_type == VAR_STRING) string_reduce(argvars, &argvars[1], rettv); else @@ -3280,7 +3202,6 @@ f_slice(typval_T *argvars, typval_T *rettv) if (in_vim9script() && ((argvars[0].v_type != VAR_STRING && argvars[0].v_type != VAR_LIST - && argvars[0].v_type != VAR_TUPLE && argvars[0].v_type != VAR_BLOB && check_for_list_arg(argvars, 0) == FAIL) || check_for_number_arg(argvars, 1) == FAIL diff --git a/src/macros.h b/src/macros.h index c11bfa5f..6c2931a2 100644 --- a/src/macros.h +++ b/src/macros.h @@ -487,7 +487,3 @@ // Iterate over all the items in a hash table #define FOR_ALL_HASHTAB_ITEMS(ht, hi, todo) \ for ((hi) = (ht)->ht_array; (todo) > 0; ++(hi)) - -#define TUPLE_LEN(t) (t->tv_items.ga_len) -#define TUPLE_ITEM(t, i) \ - (((typval_T *)t->tv_items.ga_data) + i) diff --git a/src/main.c b/src/main.c index 31494e3e..f603a52a 100644 --- a/src/main.c +++ b/src/main.c @@ -449,35 +449,6 @@ main #endif // NO_VIM_MAIN #endif // PROTO -#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) -/* - * Restore the state after a fatal X error. - */ - static void -x_restore_state(void) -{ - State = MODE_NORMAL; - VIsual_active = FALSE; - got_int = TRUE; - need_wait_return = FALSE; - global_busy = FALSE; - exmode_active = 0; - skip_redraw = FALSE; - RedrawingDisabled = 0; - no_wait_return = 0; - vgetc_busy = 0; -# ifdef FEAT_EVAL - emsg_skip = 0; -# endif - emsg_off = 0; - setmouse(); - settmode(TMODE_RAW); - starttermcap(); - scroll_start(); - redraw_later_clear(); -} -#endif - /* * vim_main2() is needed for FEAT_MZSCHEME, but we define it always to keep * things simple. @@ -689,7 +660,7 @@ vim_main2(void) #if defined(UNIX) || defined(VMS) // When switching screens and something caused a message from a vimrc // script, need to output an extra newline on exit. - if ((did_emsg || msg_didout) && *T_TI != NUL && params.edit_type != EDIT_STDIN) + if ((did_emsg || msg_didout) && *T_TI != NUL) newline_on_exit = TRUE; #endif @@ -819,28 +790,9 @@ vim_main2(void) getout(1); } -#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) - // Temporarily set x_jump_env to here in case there is an X11 IO error, - // because x_jump_env is only actually set in main_loop(), before - // exe_commands(). May not be the best solution since commands passed via - // the command line can be very broad like sourcing a file, in which case - // an X IO error results in the command being partially done. In theory we - // could use SETJMP in RealWaitForChar(), but the stack frame for that may - // possibly exit and then LONGJMP is called on it. - int jump_result = SETJMP(x_jump_env); - - if (jump_result == 0) - { -#endif - // Execute any "+", "-c" and "-S" arguments. - if (params.n_commands > 0) - exe_commands(¶ms); -#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) - } - else - // Restore state and continue just like what main_loop() does. - x_restore_state(); -#endif + // Execute any "+", "-c" and "-S" arguments. + if (params.n_commands > 0) + exe_commands(¶ms); // Must come before the may_req_ calls. starting = 0; @@ -1072,13 +1024,6 @@ common_init_2(mparm_T *paramp) #ifdef FEAT_SIGNS init_signs(); #endif - -#ifdef FEAT_QUICKFIX - // initialize quickfix list - // don't send an error message when memory allocation fails - // do it when the user tries to access the quickfix list - qf_init_stack(); -#endif } /* @@ -1290,10 +1235,30 @@ main_loop( #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) // Setup to catch a terminating error from the X server. Just ignore // it, restore the state and continue. This might not always work - // properly, but at least we hopefully don't exit unexpectedly when the X - // server exits while Vim is running in a console. + // properly, but at least we don't exit unexpectedly when the X server + // exits while Vim is running in a console. if (!cmdwin && !noexmode && SETJMP(x_jump_env)) - x_restore_state(); + { + State = MODE_NORMAL; + VIsual_active = FALSE; + got_int = TRUE; + need_wait_return = FALSE; + global_busy = FALSE; + exmode_active = 0; + skip_redraw = FALSE; + RedrawingDisabled = 0; + no_wait_return = 0; + vgetc_busy = 0; +# ifdef FEAT_EVAL + emsg_skip = 0; +# endif + emsg_off = 0; + setmouse(); + settmode(TMODE_RAW); + starttermcap(); + scroll_start(); + redraw_later_clear(); + } #endif clear_oparg(&oa); diff --git a/src/mbyte.c b/src/mbyte.c index cc8d628e..a38ab24f 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -828,8 +828,8 @@ remove_bom(char_u *s) * Get class of pointer: * 0 for blank or NUL * 1 for punctuation - * 2 for an alphanumeric word character - * >2 for other word characters, including CJK and emoji + * 2 for an (ASCII) word character + * >2 for other word characters */ int mb_get_class(char_u *p) diff --git a/src/message.c b/src/message.c index 376119e1..99fe675d 100644 --- a/src/message.c +++ b/src/message.c @@ -1127,17 +1127,17 @@ messagesopt_changed(void) // Either "wait" or "hit-enter" is required if (!(messages_flags_new & (MESSAGES_HIT_ENTER | MESSAGES_WAIT))) - return FAIL; + return FAIL; // "history" must be set if (!(messages_flags_new & MESSAGES_HISTORY)) - return FAIL; + return FAIL; if (messages_history_new < 0 || messages_history_new > 10000) - return FAIL; + return FAIL; if (messages_wait_new < 0 || messages_wait_new > 10000) - return FAIL; + return FAIL; msg_flags = messages_flags_new; msg_wait = messages_wait_new; @@ -3508,6 +3508,7 @@ do_more_prompt(int typed_char) static void mch_errmsg_c(char *str) { + int len = (int)STRLEN(str); DWORD nwrite = 0; DWORD mode = 0; HANDLE h = GetStdHandle(STD_ERROR_HANDLE); @@ -3515,14 +3516,10 @@ mch_errmsg_c(char *str) if (GetConsoleMode(h, &mode) && enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage) { - int len = (int)STRLEN(str); WCHAR *w = enc_to_utf16((char_u *)str, &len); - if (w != NULL) - { - WriteConsoleW(h, w, len, &nwrite, NULL); - vim_free(w); - } + WriteConsoleW(h, w, len, &nwrite, NULL); + vim_free(w); } else { @@ -3617,21 +3614,19 @@ mch_errmsg(char *str) static void mch_msg_c(char *str) { + int len = (int)STRLEN(str); DWORD nwrite = 0; DWORD mode; HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); + if (GetConsoleMode(h, &mode) && enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage) { - int len = (int)STRLEN(str); WCHAR *w = enc_to_utf16((char_u *)str, &len); - if (w != NULL) - { - WriteConsoleW(h, w, len, &nwrite, NULL); - vim_free(w); - } + WriteConsoleW(h, w, len, &nwrite, NULL); + vim_free(w); } else { diff --git a/src/message_test.c b/src/message_test.c index 884a7a9c..83767ece 100644 --- a/src/message_test.c +++ b/src/message_test.c @@ -34,7 +34,7 @@ // - warning: format ‘%S’ expects argument of type ‘wchar_t *’, but argument 4 has type ‘char *’ // - warning: unknown conversion type character ‘b’ in format // -// These formats are in practise only used from Vim script printf() +// These formats are in practise only used from vim script printf() // function and never as literals in C code. char *fmt_012p = "%012p"; char *fmt_5S = "%5S"; @@ -158,12 +158,12 @@ test_trunc_string_mbyte(void) /* * Test vim_snprintf() with a focus on checking that truncation is * correct when buffer is small, since it cannot be tested from - * Vim script tests. Check that: + * vim script tests. Check that: * - no buffer overflows happens (with valgrind or asan) * - output string is always NUL terminated. * * Not all formats of vim_snprintf() are checked here. They are - * checked more exhaustively in Test_printf*() Vim script tests. + * checked more exhaustively in Test_printf*() vim script tests. */ static void test_vim_snprintf(void) @@ -290,7 +290,7 @@ test_vim_snprintf(void) assert(bsize == 0 || STRNCMP(buf, "\x01\x02", bsize_int) == 0); assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0'); - // %p format is not tested in Vim script tests Test_printf*() + // %p format is not tested in vim script tests Test_printf*() // as it only makes sense in C code. // NOTE: SunOS libc doesn't use the prefix "0x" on %p. #ifdef SUN_SYSTEM diff --git a/src/misc2.c b/src/misc2.c index 909812ca..75fd13bc 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -921,6 +921,16 @@ static char_u modifier_keys_table[] = NUL }; +// Indexes into the key_names_table array +// Must be kept in sync with the array! +#define IDX_KEYNAME_BS 2 +#define IDX_KEYNAME_CAR 5 +#define IDX_KEYNAME_DEL 9 +#define IDX_KEYNAME_INS 59 +#define IDX_KEYNAME_NL 101 +#define IDX_KEYNAME_SWD 115 +#define IDX_KEYNAME_SWU 118 + #define STRING_INIT(s) \ {(char_u *)(s), STRLEN_LITERAL(s)} static struct key_name_entry @@ -928,199 +938,210 @@ static struct key_name_entry int enabled; // is this entry available (TRUE/FALSE)? int key; // special key code or ascii value string_T name; // name of key - int is_alt; // is an alternative name + string_T *pref_name; // pointer to preferred key name + // (may be NULL or point to the name in another entry) } key_names_table[] = // Must be sorted by the 'name.string' field in ascending order because it is used by bsearch()! { - {TRUE, K_BS, STRING_INIT("BackSpace"), TRUE}, - {TRUE, '|', STRING_INIT("Bar"), FALSE}, - {TRUE, K_BS, STRING_INIT("BS"), FALSE}, - {TRUE, '\\', STRING_INIT("Bslash"), FALSE}, - {TRUE, K_COMMAND, STRING_INIT("Cmd"), FALSE}, - {TRUE, CAR, STRING_INIT("CR"), FALSE}, - {TRUE, CSI, STRING_INIT("CSI"), FALSE}, - {TRUE, K_CURSORHOLD, STRING_INIT("CursorHold"), FALSE}, + {TRUE, K_BS, STRING_INIT("BackSpace"), + &key_names_table[IDX_KEYNAME_BS].name}, // Alternative name + {TRUE, '|', STRING_INIT("Bar"), NULL}, + {TRUE, K_BS, STRING_INIT("BS"), NULL}, + {TRUE, '\\', STRING_INIT("Bslash"), NULL}, + {TRUE, K_COMMAND, STRING_INIT("Cmd"), NULL}, + {TRUE, CAR, STRING_INIT("CR"), NULL}, + {TRUE, CSI, STRING_INIT("CSI"), NULL}, + {TRUE, K_CURSORHOLD, STRING_INIT("CursorHold"), NULL}, { #ifdef FEAT_MOUSE_DEC TRUE, #else FALSE, #endif - K_DEC_MOUSE, STRING_INIT("DecMouse"), FALSE}, - {TRUE, K_DEL, STRING_INIT("Del"), FALSE}, - {TRUE, K_DEL, STRING_INIT("Delete"), TRUE}, - {TRUE, K_DOWN, STRING_INIT("Down"), FALSE}, - {TRUE, K_DROP, STRING_INIT("Drop"), FALSE}, - {TRUE, K_END, STRING_INIT("End"), FALSE}, - {TRUE, CAR, STRING_INIT("Enter"), TRUE}, - {TRUE, ESC, STRING_INIT("Esc"), FALSE}, - - {TRUE, K_F1, STRING_INIT("F1"), FALSE}, - {TRUE, K_F10, STRING_INIT("F10"), FALSE}, - {TRUE, K_F11, STRING_INIT("F11"), FALSE}, - {TRUE, K_F12, STRING_INIT("F12"), FALSE}, - {TRUE, K_F13, STRING_INIT("F13"), FALSE}, - {TRUE, K_F14, STRING_INIT("F14"), FALSE}, - {TRUE, K_F15, STRING_INIT("F15"), FALSE}, - {TRUE, K_F16, STRING_INIT("F16"), FALSE}, - {TRUE, K_F17, STRING_INIT("F17"), FALSE}, - {TRUE, K_F18, STRING_INIT("F18"), FALSE}, - {TRUE, K_F19, STRING_INIT("F19"), FALSE}, - - {TRUE, K_F2, STRING_INIT("F2"), FALSE}, - {TRUE, K_F20, STRING_INIT("F20"), FALSE}, - {TRUE, K_F21, STRING_INIT("F21"), FALSE}, - {TRUE, K_F22, STRING_INIT("F22"), FALSE}, - {TRUE, K_F23, STRING_INIT("F23"), FALSE}, - {TRUE, K_F24, STRING_INIT("F24"), FALSE}, - {TRUE, K_F25, STRING_INIT("F25"), FALSE}, - {TRUE, K_F26, STRING_INIT("F26"), FALSE}, - {TRUE, K_F27, STRING_INIT("F27"), FALSE}, - {TRUE, K_F28, STRING_INIT("F28"), FALSE}, - {TRUE, K_F29, STRING_INIT("F29"), FALSE}, - - {TRUE, K_F3, STRING_INIT("F3"), FALSE}, - {TRUE, K_F30, STRING_INIT("F30"), FALSE}, - {TRUE, K_F31, STRING_INIT("F31"), FALSE}, - {TRUE, K_F32, STRING_INIT("F32"), FALSE}, - {TRUE, K_F33, STRING_INIT("F33"), FALSE}, - {TRUE, K_F34, STRING_INIT("F34"), FALSE}, - {TRUE, K_F35, STRING_INIT("F35"), FALSE}, - {TRUE, K_F36, STRING_INIT("F36"), FALSE}, - {TRUE, K_F37, STRING_INIT("F37"), FALSE}, - - {TRUE, K_F4, STRING_INIT("F4"), FALSE}, - {TRUE, K_F5, STRING_INIT("F5"), FALSE}, - {TRUE, K_F6, STRING_INIT("F6"), FALSE}, - {TRUE, K_F7, STRING_INIT("F7"), FALSE}, - {TRUE, K_F8, STRING_INIT("F8"), FALSE}, - {TRUE, K_F9, STRING_INIT("F9"), FALSE}, - - {TRUE, K_FOCUSGAINED, STRING_INIT("FocusGained"), FALSE}, - {TRUE, K_FOCUSLOST, STRING_INIT("FocusLost"), FALSE}, - {TRUE, K_HELP, STRING_INIT("Help"), FALSE}, - {TRUE, K_HOME, STRING_INIT("Home"), FALSE}, - {TRUE, K_IGNORE, STRING_INIT("Ignore"), FALSE}, - {TRUE, K_INS, STRING_INIT("Ins"), TRUE}, - {TRUE, K_INS, STRING_INIT("Insert"), FALSE}, + K_DEC_MOUSE, STRING_INIT("DecMouse"), NULL}, + {TRUE, K_DEL, STRING_INIT("Del"), NULL}, + {TRUE, K_DEL, STRING_INIT("Delete"), + &key_names_table[IDX_KEYNAME_DEL].name}, // Alternative name + {TRUE, K_DOWN, STRING_INIT("Down"), NULL}, + {TRUE, K_DROP, STRING_INIT("Drop"), NULL}, + {TRUE, K_END, STRING_INIT("End"), NULL}, + {TRUE, CAR, STRING_INIT("Enter"), + &key_names_table[IDX_KEYNAME_CAR].name}, // Alternative name + {TRUE, ESC, STRING_INIT("Esc"), NULL}, + + {TRUE, K_F1, STRING_INIT("F1"), NULL}, + {TRUE, K_F10, STRING_INIT("F10"), NULL}, + {TRUE, K_F11, STRING_INIT("F11"), NULL}, + {TRUE, K_F12, STRING_INIT("F12"), NULL}, + {TRUE, K_F13, STRING_INIT("F13"), NULL}, + {TRUE, K_F14, STRING_INIT("F14"), NULL}, + {TRUE, K_F15, STRING_INIT("F15"), NULL}, + {TRUE, K_F16, STRING_INIT("F16"), NULL}, + {TRUE, K_F17, STRING_INIT("F17"), NULL}, + {TRUE, K_F18, STRING_INIT("F18"), NULL}, + {TRUE, K_F19, STRING_INIT("F19"), NULL}, + + {TRUE, K_F2, STRING_INIT("F2"), NULL}, + {TRUE, K_F20, STRING_INIT("F20"), NULL}, + {TRUE, K_F21, STRING_INIT("F21"), NULL}, + {TRUE, K_F22, STRING_INIT("F22"), NULL}, + {TRUE, K_F23, STRING_INIT("F23"), NULL}, + {TRUE, K_F24, STRING_INIT("F24"), NULL}, + {TRUE, K_F25, STRING_INIT("F25"), NULL}, + {TRUE, K_F26, STRING_INIT("F26"), NULL}, + {TRUE, K_F27, STRING_INIT("F27"), NULL}, + {TRUE, K_F28, STRING_INIT("F28"), NULL}, + {TRUE, K_F29, STRING_INIT("F29"), NULL}, + + {TRUE, K_F3, STRING_INIT("F3"), NULL}, + {TRUE, K_F30, STRING_INIT("F30"), NULL}, + {TRUE, K_F31, STRING_INIT("F31"), NULL}, + {TRUE, K_F32, STRING_INIT("F32"), NULL}, + {TRUE, K_F33, STRING_INIT("F33"), NULL}, + {TRUE, K_F34, STRING_INIT("F34"), NULL}, + {TRUE, K_F35, STRING_INIT("F35"), NULL}, + {TRUE, K_F36, STRING_INIT("F36"), NULL}, + {TRUE, K_F37, STRING_INIT("F37"), NULL}, + + {TRUE, K_F4, STRING_INIT("F4"), NULL}, + {TRUE, K_F5, STRING_INIT("F5"), NULL}, + {TRUE, K_F6, STRING_INIT("F6"), NULL}, + {TRUE, K_F7, STRING_INIT("F7"), NULL}, + {TRUE, K_F8, STRING_INIT("F8"), NULL}, + {TRUE, K_F9, STRING_INIT("F9"), NULL}, + + {TRUE, K_FOCUSGAINED, STRING_INIT("FocusGained"), NULL}, + {TRUE, K_FOCUSLOST, STRING_INIT("FocusLost"), NULL}, + {TRUE, K_HELP, STRING_INIT("Help"), NULL}, + {TRUE, K_HOME, STRING_INIT("Home"), NULL}, + {TRUE, K_IGNORE, STRING_INIT("Ignore"), NULL}, + {TRUE, K_INS, STRING_INIT("Ins"), + &key_names_table[IDX_KEYNAME_INS].name}, // Alternative name + {TRUE, K_INS, STRING_INIT("Insert"), NULL}, { #ifdef FEAT_MOUSE_JSB TRUE, #else FALSE, #endif - K_JSBTERM_MOUSE, STRING_INIT("JsbMouse"), FALSE}, - {TRUE, K_K0, STRING_INIT("k0"), FALSE}, - {TRUE, K_K1, STRING_INIT("k1"), FALSE}, - {TRUE, K_K2, STRING_INIT("k2"), FALSE}, - {TRUE, K_K3, STRING_INIT("k3"), FALSE}, - {TRUE, K_K4, STRING_INIT("k4"), FALSE}, - {TRUE, K_K5, STRING_INIT("k5"), FALSE}, - {TRUE, K_K6, STRING_INIT("k6"), FALSE}, - {TRUE, K_K7, STRING_INIT("k7"), FALSE}, - {TRUE, K_K8, STRING_INIT("k8"), FALSE}, - {TRUE, K_K9, STRING_INIT("k9"), FALSE}, - - {TRUE, K_KDEL, STRING_INIT("kDel"), FALSE}, - {TRUE, K_KDIVIDE, STRING_INIT("kDivide"), FALSE}, - {TRUE, K_KEND, STRING_INIT("kEnd"), FALSE}, - {TRUE, K_KENTER, STRING_INIT("kEnter"), FALSE}, - {TRUE, K_KHOME, STRING_INIT("kHome"), FALSE}, - {TRUE, K_KINS, STRING_INIT("kInsert"), FALSE}, - {TRUE, K_KMINUS, STRING_INIT("kMinus"), FALSE}, - {TRUE, K_KMULTIPLY, STRING_INIT("kMultiply"), FALSE}, - {TRUE, K_KPAGEDOWN, STRING_INIT("kPageDown"), FALSE}, - {TRUE, K_KPAGEUP, STRING_INIT("kPageUp"), FALSE}, - {TRUE, K_KPLUS, STRING_INIT("kPlus"), FALSE}, - {TRUE, K_KPOINT, STRING_INIT("kPoint"), FALSE}, - {TRUE, K_LEFT, STRING_INIT("Left"), FALSE}, - {TRUE, K_LEFTDRAG, STRING_INIT("LeftDrag"), FALSE}, - {TRUE, K_LEFTMOUSE, STRING_INIT("LeftMouse"), FALSE}, - {TRUE, K_LEFTMOUSE_NM, STRING_INIT("LeftMouseNM"), FALSE}, - {TRUE, K_LEFTRELEASE, STRING_INIT("LeftRelease"), FALSE}, - {TRUE, K_LEFTRELEASE_NM, STRING_INIT("LeftReleaseNM"), FALSE}, - {TRUE, NL, STRING_INIT("LF"), TRUE}, - {TRUE, NL, STRING_INIT("LineFeed"), TRUE}, - {TRUE, '<', STRING_INIT("lt"), FALSE}, - {TRUE, K_MIDDLEDRAG, STRING_INIT("MiddleDrag"), FALSE}, - {TRUE, K_MIDDLEMOUSE, STRING_INIT("MiddleMouse"), FALSE}, - {TRUE, K_MIDDLERELEASE, STRING_INIT("MiddleRelease"), FALSE}, - {TRUE, K_MOUSE, STRING_INIT("Mouse"), FALSE}, - {TRUE, K_MOUSEDOWN, STRING_INIT("MouseDown"), TRUE}, - {TRUE, K_MOUSEMOVE, STRING_INIT("MouseMove"), FALSE}, - {TRUE, K_MOUSEUP, STRING_INIT("MouseUp"), TRUE}, + K_JSBTERM_MOUSE, STRING_INIT("JsbMouse"), NULL}, + {TRUE, K_K0, STRING_INIT("k0"), NULL}, + {TRUE, K_K1, STRING_INIT("k1"), NULL}, + {TRUE, K_K2, STRING_INIT("k2"), NULL}, + {TRUE, K_K3, STRING_INIT("k3"), NULL}, + {TRUE, K_K4, STRING_INIT("k4"), NULL}, + {TRUE, K_K5, STRING_INIT("k5"), NULL}, + {TRUE, K_K6, STRING_INIT("k6"), NULL}, + {TRUE, K_K7, STRING_INIT("k7"), NULL}, + {TRUE, K_K8, STRING_INIT("k8"), NULL}, + {TRUE, K_K9, STRING_INIT("k9"), NULL}, + + {TRUE, K_KDEL, STRING_INIT("kDel"), NULL}, + {TRUE, K_KDIVIDE, STRING_INIT("kDivide"), NULL}, + {TRUE, K_KEND, STRING_INIT("kEnd"), NULL}, + {TRUE, K_KENTER, STRING_INIT("kEnter"), NULL}, + {TRUE, K_KHOME, STRING_INIT("kHome"), NULL}, + {TRUE, K_KINS, STRING_INIT("kInsert"), NULL}, + {TRUE, K_KMINUS, STRING_INIT("kMinus"), NULL}, + {TRUE, K_KMULTIPLY, STRING_INIT("kMultiply"), NULL}, + {TRUE, K_KPAGEDOWN, STRING_INIT("kPageDown"), NULL}, + {TRUE, K_KPAGEUP, STRING_INIT("kPageUp"), NULL}, + {TRUE, K_KPLUS, STRING_INIT("kPlus"), NULL}, + {TRUE, K_KPOINT, STRING_INIT("kPoint"), NULL}, + {TRUE, K_LEFT, STRING_INIT("Left"), NULL}, + {TRUE, K_LEFTDRAG, STRING_INIT("LeftDrag"), NULL}, + {TRUE, K_LEFTMOUSE, STRING_INIT("LeftMouse"), NULL}, + {TRUE, K_LEFTMOUSE_NM, STRING_INIT("LeftMouseNM"), NULL}, + {TRUE, K_LEFTRELEASE, STRING_INIT("LeftRelease"), NULL}, + {TRUE, K_LEFTRELEASE_NM, STRING_INIT("LeftReleaseNM"), NULL}, + {TRUE, NL, STRING_INIT("LF"), + &key_names_table[IDX_KEYNAME_NL].name}, // Alternative name + {TRUE, NL, STRING_INIT("LineFeed"), + &key_names_table[IDX_KEYNAME_NL].name}, // Alternative name + {TRUE, '<', STRING_INIT("lt"), NULL}, + {TRUE, K_MIDDLEDRAG, STRING_INIT("MiddleDrag"), NULL}, + {TRUE, K_MIDDLEMOUSE, STRING_INIT("MiddleMouse"), NULL}, + {TRUE, K_MIDDLERELEASE, STRING_INIT("MiddleRelease"), NULL}, + {TRUE, K_MOUSE, STRING_INIT("Mouse"), NULL}, + {TRUE, K_MOUSEDOWN, STRING_INIT("MouseDown"), + &key_names_table[IDX_KEYNAME_SWU].name}, // OBSOLETE: Use ScrollWheelUp instead + {TRUE, K_MOUSEMOVE, STRING_INIT("MouseMove"), NULL}, + {TRUE, K_MOUSEUP, STRING_INIT("MouseUp"), + &key_names_table[IDX_KEYNAME_SWD].name}, // OBSELETE: Use ScrollWheelDown instead { #ifdef FEAT_MOUSE_NET TRUE, #else FALSE, #endif - K_NETTERM_MOUSE, STRING_INIT("NetMouse"), FALSE}, - {TRUE, NL, STRING_INIT("NewLine"), TRUE}, - {TRUE, NL, STRING_INIT("NL"), FALSE}, - {TRUE, K_ZERO, STRING_INIT("Nul"), FALSE}, - {TRUE, K_PAGEDOWN, STRING_INIT("PageDown"), FALSE}, - {TRUE, K_PAGEUP, STRING_INIT("PageUp"), FALSE}, - {TRUE, K_PE, STRING_INIT("PasteEnd"), FALSE}, - {TRUE, K_PS, STRING_INIT("PasteStart"), FALSE}, - {TRUE, K_PLUG, STRING_INIT("Plug"), FALSE}, + K_NETTERM_MOUSE, STRING_INIT("NetMouse"), NULL}, + {TRUE, NL, STRING_INIT("NewLine"), + &key_names_table[IDX_KEYNAME_NL].name}, // Alternative name + {TRUE, NL, STRING_INIT("NL"), NULL}, + {TRUE, K_ZERO, STRING_INIT("Nul"), NULL}, + {TRUE, K_PAGEDOWN, STRING_INIT("PageDown"), NULL}, + {TRUE, K_PAGEUP, STRING_INIT("PageUp"), NULL}, + {TRUE, K_PE, STRING_INIT("PasteEnd"), NULL}, + {TRUE, K_PS, STRING_INIT("PasteStart"), NULL}, + {TRUE, K_PLUG, STRING_INIT("Plug"), NULL}, { #ifdef FEAT_MOUSE_PTERM TRUE, #else FALSE, #endif - K_PTERM_MOUSE, STRING_INIT("PtermMouse"), FALSE}, - {TRUE, CAR, STRING_INIT("Return"), TRUE}, - {TRUE, K_RIGHT, STRING_INIT("Right"), FALSE}, - {TRUE, K_RIGHTDRAG, STRING_INIT("RightDrag"), FALSE}, - {TRUE, K_RIGHTMOUSE, STRING_INIT("RightMouse"), FALSE}, - {TRUE, K_RIGHTRELEASE, STRING_INIT("RightRelease"), FALSE}, - {TRUE, K_SCRIPT_COMMAND, STRING_INIT("ScriptCmd"), FALSE}, - {TRUE, K_MOUSEUP, STRING_INIT("ScrollWheelDown"), FALSE}, - {TRUE, K_MOUSERIGHT, STRING_INIT("ScrollWheelLeft"), FALSE}, - {TRUE, K_MOUSELEFT, STRING_INIT("ScrollWheelRight"), FALSE}, - {TRUE, K_MOUSEDOWN, STRING_INIT("ScrollWheelUp"), FALSE}, - {TRUE, K_SGR_MOUSE, STRING_INIT("SgrMouse"), FALSE}, - {TRUE, K_SGR_MOUSERELEASE, STRING_INIT("SgrMouseRelease"), FALSE}, + K_PTERM_MOUSE, STRING_INIT("PtermMouse"), NULL}, + {TRUE, CAR, STRING_INIT("Return"), + &key_names_table[IDX_KEYNAME_CAR].name}, // Alternative name + {TRUE, K_RIGHT, STRING_INIT("Right"), NULL}, + {TRUE, K_RIGHTDRAG, STRING_INIT("RightDrag"), NULL}, + {TRUE, K_RIGHTMOUSE, STRING_INIT("RightMouse"), NULL}, + {TRUE, K_RIGHTRELEASE, STRING_INIT("RightRelease"), NULL}, + {TRUE, K_SCRIPT_COMMAND, STRING_INIT("ScriptCmd"), NULL}, + {TRUE, K_MOUSEUP, STRING_INIT("ScrollWheelDown"), NULL}, + {TRUE, K_MOUSERIGHT, STRING_INIT("ScrollWheelLeft"), NULL}, + {TRUE, K_MOUSELEFT, STRING_INIT("ScrollWheelRight"), NULL}, + {TRUE, K_MOUSEDOWN, STRING_INIT("ScrollWheelUp"), NULL}, + {TRUE, K_SGR_MOUSE, STRING_INIT("SgrMouse"), NULL}, + {TRUE, K_SGR_MOUSERELEASE, STRING_INIT("SgrMouseRelease"), NULL}, { #ifdef FEAT_EVAL TRUE, #else FALSE, #endif - K_SNR, STRING_INIT("SNR"), FALSE}, - {TRUE, ' ', STRING_INIT("Space"), FALSE}, - {TRUE, TAB, STRING_INIT("Tab"), FALSE}, - {TRUE, K_TAB, STRING_INIT("Tab"), FALSE}, - {TRUE, K_UNDO, STRING_INIT("Undo"), FALSE}, - {TRUE, K_UP, STRING_INIT("Up"), FALSE}, + K_SNR, STRING_INIT("SNR"), NULL}, + {TRUE, ' ', STRING_INIT("Space"), NULL}, + {TRUE, TAB, STRING_INIT("Tab"), NULL}, + {TRUE, K_TAB, STRING_INIT("Tab"), NULL}, + {TRUE, K_UNDO, STRING_INIT("Undo"), NULL}, + {TRUE, K_UP, STRING_INIT("Up"), NULL}, { #ifdef FEAT_MOUSE_URXVT TRUE, #else FALSE, #endif - K_URXVT_MOUSE, STRING_INIT("UrxvtMouse"), FALSE}, - {TRUE, K_X1DRAG, STRING_INIT("X1Drag"), FALSE}, - {TRUE, K_X1MOUSE, STRING_INIT("X1Mouse"), FALSE}, - {TRUE, K_X1RELEASE, STRING_INIT("X1Release"), FALSE}, - {TRUE, K_X2DRAG, STRING_INIT("X2Drag"), FALSE}, - {TRUE, K_X2MOUSE, STRING_INIT("X2Mouse"), FALSE}, - {TRUE, K_X2RELEASE, STRING_INIT("X2Release"), FALSE}, - {TRUE, K_CSI, STRING_INIT("xCSI"), FALSE}, - {TRUE, K_XDOWN, STRING_INIT("xDown"), FALSE}, - {TRUE, K_XEND, STRING_INIT("xEnd"), FALSE}, - {TRUE, K_XF1, STRING_INIT("xF1"), FALSE}, - {TRUE, K_XF2, STRING_INIT("xF2"), FALSE}, - {TRUE, K_XF3, STRING_INIT("xF3"), FALSE}, - {TRUE, K_XF4, STRING_INIT("xF4"), FALSE}, - {TRUE, K_XHOME, STRING_INIT("xHome"), FALSE}, - {TRUE, K_XLEFT, STRING_INIT("xLeft"), FALSE}, - {TRUE, K_XRIGHT, STRING_INIT("xRight"), FALSE}, - {TRUE, K_XUP, STRING_INIT("xUp"), FALSE}, - {TRUE, K_ZEND, STRING_INIT("zEnd"), FALSE}, - {TRUE, K_ZHOME, STRING_INIT("zHome"), FALSE} + K_URXVT_MOUSE, STRING_INIT("UrxvtMouse"), NULL}, + {TRUE, K_X1DRAG, STRING_INIT("X1Drag"), NULL}, + {TRUE, K_X1MOUSE, STRING_INIT("X1Mouse"), NULL}, + {TRUE, K_X1RELEASE, STRING_INIT("X1Release"), NULL}, + {TRUE, K_X2DRAG, STRING_INIT("X2Drag"), NULL}, + {TRUE, K_X2MOUSE, STRING_INIT("X2Mouse"), NULL}, + {TRUE, K_X2RELEASE, STRING_INIT("X2Release"), NULL}, + {TRUE, K_CSI, STRING_INIT("xCSI"), NULL}, + {TRUE, K_XDOWN, STRING_INIT("xDown"), NULL}, + {TRUE, K_XEND, STRING_INIT("xEnd"), NULL}, + {TRUE, K_XF1, STRING_INIT("xF1"), NULL}, + {TRUE, K_XF2, STRING_INIT("xF2"), NULL}, + {TRUE, K_XF3, STRING_INIT("xF3"), NULL}, + {TRUE, K_XF4, STRING_INIT("xF4"), NULL}, + {TRUE, K_XHOME, STRING_INIT("xHome"), NULL}, + {TRUE, K_XLEFT, STRING_INIT("xLeft"), NULL}, + {TRUE, K_XRIGHT, STRING_INIT("xRight"), NULL}, + {TRUE, K_XUP, STRING_INIT("xUp"), NULL}, + {TRUE, K_ZEND, STRING_INIT("zEnd"), NULL}, + {TRUE, K_ZHOME, STRING_INIT("zHome"), NULL} // NOTE: When adding a long name update MAX_KEY_NAME_LEN. }; #undef STRING_INIT @@ -1302,7 +1323,10 @@ get_special_key_name(int c, int modifiers) { string_T *s; - s = &key_names_table[table_idx].name; + if (key_names_table[table_idx].pref_name != NULL) + s = key_names_table[table_idx].pref_name; + else + s = &key_names_table[table_idx].name; if (s->length + idx + 2 <= MAX_KEY_NAME_LEN) { @@ -1693,7 +1717,7 @@ find_special_key_in_table(int c) int i; for (i = 0; i < (int)ARRAY_LENGTH(key_names_table); i++) - if (c == key_names_table[i].key && !key_names_table[i].is_alt) + if (c == key_names_table[i].key) return key_names_table[i].enabled ? i : -1; return -1; @@ -1775,6 +1799,7 @@ get_special_key_code(char_u *name) target.key = 0; target.name.string = name; target.name.length = 0; + target.pref_name = NULL; entry = (struct key_name_entry *)bsearch( &target, @@ -1800,7 +1825,9 @@ get_key_name(int i) if (i < 0 || i >= (int)ARRAY_LENGTH(key_names_table)) return NULL; - return key_names_table[i].name.string; + return (key_names_table[i].pref_name != NULL) ? + key_names_table[i].pref_name->string : + key_names_table[i].name.string; } /* diff --git a/src/mouse.c b/src/mouse.c index 4e10e723..3bdb1025 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1902,6 +1902,16 @@ jump_to_mouse( // Drag the status line count = row - W_WINROW(dragwin) - dragwin->w_height + 1 - on_status_line; +#ifdef FEAT_TERMINAL + if (bt_terminal(dragwin->w_buffer)) + { + win_T *curwin_save = curwin; + curwin = dragwin; + update_topline(); + validate_cursor(); + curwin = curwin_save; + } +#endif win_drag_status_line(dragwin, count); did_drag |= count; } diff --git a/src/move.c b/src/move.c index 1c1eddee..5d34947a 100644 --- a/src/move.c +++ b/src/move.c @@ -3120,7 +3120,6 @@ cursor_correct(void) ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW); } } - check_cursor_moved(curwin); curwin->w_valid |= VALID_TOPLINE; } @@ -3212,15 +3211,12 @@ static int scroll_with_sms(int dir, long count, long *curscount) // extra for scrolling backward so that consuming skipcol is symmetric. if (labs(curwin->w_topline - prev_topline) > (dir == BACKWARD)) fixdir = dir * -1; - - int width1 = curwin->w_width - curwin_col_off(); - int width2 = width1 + curwin_col_off2(); - count = 1 + (curwin->w_skipcol - width1) / width2; - if (fixdir == FORWARD) - count = 2 + (linetabsize_eol(curwin, curwin->w_topline) - - curwin->w_skipcol - width1) / width2; - scroll_redraw(fixdir == FORWARD, count); - *curscount += count * (fixdir == dir ? 1 : -1); + while (curwin->w_skipcol > 0 + && curwin->w_topline < curbuf->b_ml.ml_line_count) + { + scroll_redraw(fixdir == FORWARD, 1); + *curscount += (fixdir == dir ? 1 : -1); + } } curwin->w_p_sms = prev_sms; diff --git a/src/netbeans.c b/src/netbeans.c index 5cbbab78..781caa89 100644 --- a/src/netbeans.c +++ b/src/netbeans.c @@ -2561,7 +2561,7 @@ set_ref_in_nb_channel(int copyID) tv.v_type = VAR_CHANNEL; tv.vval.v_channel = nb_channel; - abort = set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = set_ref_in_item(&tv, copyID, NULL, NULL); return abort; } #endif diff --git a/src/normal.c b/src/normal.c index 9231a4c2..e7915d6f 100644 --- a/src/normal.c +++ b/src/normal.c @@ -2786,7 +2786,7 @@ nv_zet(cmdarg_T *cap) } break; - // "zp", "zP" in block mode put without adding trailing spaces + // "zp", "zP" in block mode put without addind trailing spaces case 'P': case 'p': nv_put(cap); break; @@ -3074,10 +3074,10 @@ handle_tabmenu(void) { case TABLINE_MENU_CLOSE: if (current_tab == 0) - do_cmdline_cmd((char_u *)"confirm tabclose"); + do_cmdline_cmd((char_u *)"tabclose"); else { - vim_snprintf((char *)IObuff, IOSIZE, "confirm tabclose %d", + vim_snprintf((char *)IObuff, IOSIZE, "tabclose %d", current_tab); do_cmdline_cmd(IObuff); } @@ -3579,7 +3579,7 @@ nv_ident(cmdarg_T *cap) aux_ptr = (char_u *)(magic_isset() ? "/?.*~[^$\\" : "/?^$\\"); else if (tag_cmd) { - if (STRCMP(curbuf->b_p_ft, "help") == 0) + if (curbuf->b_help) // ":help" handles unescaped argument aux_ptr = (char_u *)""; else diff --git a/src/ops.c b/src/ops.c index b4b59de2..0e3711eb 100644 --- a/src/ops.c +++ b/src/ops.c @@ -248,11 +248,11 @@ get_vts_sum(int *vts_array, int index) int sum = 0; int i; - // Perform the summation for indices within the actual array. + // Perform the summation for indeces within the actual array. for (i = 1; i <= index && i <= vts_array[0]; i++) sum += vts_array[i]; - // Add tabstops whose indices exceed the actual array. + // Add topstops whose indeces exceed the actual array. if (i <= index) sum += vts_array[vts_array[0]] * (index - vts_array[0]); diff --git a/src/option.c b/src/option.c index ab9ee66c..f61d7269 100644 --- a/src/option.c +++ b/src/option.c @@ -4735,44 +4735,6 @@ did_set_wrap(optset_T *args UNUSED) return NULL; } -#ifdef FEAT_QUICKFIX -/* - * Process the new 'chistory' or 'lhistory' option value. 'chistory' will - * be used if args->os_varp is the same as p_chi, else 'lhistory'. - */ - char * -did_set_xhistory(optset_T *args) -{ - int is_p_chi = (long*)args->os_varp == &p_chi; - int err; - long *arg = (is_p_chi) ? &p_chi :(long*)args->os_varp; - - // cannot have zero or negative number of quickfix lists in a stack - if (*arg < 1) - { - *arg = args->os_oldval.number; - return e_cannot_have_negative_or_zero_number_of_quickfix; - } - - // cannot have more than 100 quickfix lists in a stack - if (*arg > 100) - { - *arg = args->os_oldval.number; - return e_cannot_have_more_than_hundred_quickfix; - } - - if (is_p_chi) - err = qf_resize_stack(*arg); - else - err = ll_resize_stack(curwin, *arg); - - if (err == FAIL) - return e_failed_resizing_quickfix_stack; - - return NULL; -} -#endif - /* * Set the value of a boolean option, and take care of side effects. * Returns NULL for success, or an error message for an error. @@ -6400,9 +6362,6 @@ unset_global_local_option(char_u *name, void *from) clear_string_option(&buf->b_p_cot); buf->b_cot_flags = 0; break; - case PV_ISE: - clear_string_option(&buf->b_p_ise); - break; case PV_DICT: clear_string_option(&buf->b_p_dict); break; @@ -6521,7 +6480,6 @@ get_varp_scope(struct vimoption *p, int scope) case PV_INC: return (char_u *)&(curbuf->b_p_inc); #endif case PV_COT: return (char_u *)&(curbuf->b_p_cot); - case PV_ISE: return (char_u *)&(curbuf->b_p_ise); case PV_DICT: return (char_u *)&(curbuf->b_p_dict); case PV_TSR: return (char_u *)&(curbuf->b_p_tsr); #ifdef FEAT_COMPL_FUNC @@ -6604,8 +6562,6 @@ get_varp(struct vimoption *p) #endif case PV_COT: return *curbuf->b_p_cot != NUL ? (char_u *)&(curbuf->b_p_cot) : p->var; - case PV_ISE: return *curbuf->b_p_ise != NUL - ? (char_u *)&(curbuf->b_p_ise) : p->var; case PV_DICT: return *curbuf->b_p_dict != NUL ? (char_u *)&(curbuf->b_p_dict) : p->var; case PV_TSR: return *curbuf->b_p_tsr != NUL @@ -6697,7 +6653,6 @@ get_varp(struct vimoption *p) case PV_WFW: return (char_u *)&(curwin->w_p_wfw); #if defined(FEAT_QUICKFIX) case PV_PVW: return (char_u *)&(curwin->w_p_pvw); - case PV_LHI: return (char_u *)&(curwin->w_p_lhi); #endif #ifdef FEAT_RIGHTLEFT case PV_RL: return (char_u *)&(curwin->w_p_rl); @@ -7018,9 +6973,6 @@ copy_winopt(winopt_T *from, winopt_T *to) #ifdef FEAT_SIGNS to->wo_scl = copy_option_val(from->wo_scl); #endif -#ifdef FEAT_QUICKFIX - to->wo_lhi = from->wo_lhi; -#endif #ifdef FEAT_EVAL // Copy the script context so that we know where the value was last set. @@ -7437,7 +7389,6 @@ buf_copy_options(buf_T *buf, int flags) buf->b_cot_flags = 0; buf->b_p_dict = empty_option; buf->b_p_tsr = empty_option; - buf->b_p_ise = empty_option; #ifdef FEAT_COMPL_FUNC buf->b_p_tsrfu = empty_option; #endif diff --git a/src/option.h b/src/option.h index bb1226e4..5714e0c4 100644 --- a/src/option.h +++ b/src/option.h @@ -535,7 +535,6 @@ EXTERN unsigned cot_flags; // flags from 'completeopt' #define COT_FUZZY 0x100 // TRUE: fuzzy match enabled #define COT_NOSORT 0x200 // TRUE: fuzzy match without qsort score #define COT_PREINSERT 0x400 // TRUE: preinsert -#define COT_NEAREST 0x800 // TRUE: prioritize matches close to cursor #define CFC_KEYWORD 0x001 #define CFC_FILES 0x002 @@ -546,7 +545,6 @@ EXTERN char_u *p_csl; // 'completeslash' #endif EXTERN long p_ph; // 'pumheight' EXTERN long p_pw; // 'pumwidth' -EXTERN long p_pmw; // 'pummaxwidth' EXTERN char_u *p_com; // 'comments' EXTERN char_u *p_cpo; // 'cpoptions' #ifdef FEAT_CSCOPE @@ -731,7 +729,6 @@ EXTERN char_u *p_inde; // 'indentexpr' EXTERN char_u *p_indk; // 'indentkeys' #endif EXTERN int p_im; // 'insertmode' -EXTERN char_u *p_ise; // 'isexpand' EXTERN char_u *p_isf; // 'isfname' EXTERN char_u *p_isi; // 'isident' EXTERN char_u *p_isk; // 'iskeyword' @@ -861,7 +858,6 @@ EXTERN char_u *p_rop; // 'renderoptions' EXTERN long p_report; // 'report' #if defined(FEAT_QUICKFIX) EXTERN long p_pvh; // 'previewheight' -EXTERN long p_chi; // 'chistory' #endif #ifdef MSWIN EXTERN int p_rs; // 'restorescreen' @@ -1206,7 +1202,6 @@ enum , BV_INEX #endif , BV_INF - , BV_ISE , BV_ISK #ifdef FEAT_CRYPT , BV_KEY @@ -1327,7 +1322,6 @@ enum #endif #if defined(FEAT_QUICKFIX) , WV_PVW - , WV_LHI #endif #ifdef FEAT_RIGHTLEFT , WV_RL diff --git a/src/optiondefs.h b/src/optiondefs.h index f0351044..38e871c8 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -90,7 +90,6 @@ # define PV_INEX OPT_BUF(BV_INEX) #endif #define PV_INF OPT_BUF(BV_INF) -#define PV_ISE OPT_BOTH(OPT_BUF(BV_ISE)) #define PV_ISK OPT_BUF(BV_ISK) #ifdef FEAT_CRYPT # define PV_KEY OPT_BUF(BV_KEY) @@ -193,7 +192,6 @@ #endif #if defined(FEAT_QUICKFIX) # define PV_PVW OPT_WIN(WV_PVW) -# define PV_LHI OPT_WIN(WV_LHI) #endif #ifdef FEAT_RIGHTLEFT # define PV_RL OPT_WIN(WV_RL) @@ -305,7 +303,7 @@ struct vimoption # define ISP_LATIN1 (char_u *)"@,161-255" #endif -# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,E:DiffTextAdd,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns" +# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns" // Default python version for pyx* commands #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) @@ -575,15 +573,6 @@ static struct vimoption options[] = #else (char_u *)NULL, PV_NONE, NULL, NULL, {(char_u *)0L, (char_u *)0L} -#endif - SCTX_INIT}, - {"chistory", "chi", P_NUM|P_VI_DEF, -#ifdef FEAT_QUICKFIX - (char_u *)&p_chi, PV_NONE, did_set_xhistory, NULL, - {(char_u *)10L, (char_u *)0L} -#else - (char_u *)NULL, PV_NONE, NULL, NULL, - {(char_u *)0L, (char_u *)0L} #endif SCTX_INIT}, {"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM, @@ -856,7 +845,7 @@ static struct vimoption options[] = |P_NODUP, #ifdef FEAT_DIFF (char_u *)&p_dip, PV_NONE, did_set_diffopt, expand_set_diffopt, - {(char_u *)"internal,filler,closeoff,inline:simple", + {(char_u *)"internal,filler,closeoff", (char_u *)NULL} #else (char_u *)NULL, PV_NONE, NULL, NULL, @@ -1459,10 +1448,6 @@ static struct vimoption options[] = {"insertmode", "im", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_im, PV_NONE, did_set_insertmode, NULL, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, - {"isexpand", "ise", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, - (char_u *)&p_ise, PV_ISE, did_set_isexpand, NULL, - {(char_u *)"", (char_u *)0L} - SCTX_INIT}, {"isfname", "isf", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_isf, PV_NONE, did_set_isopt, NULL, { @@ -1588,15 +1573,6 @@ static struct vimoption options[] = {"lazyredraw", "lz", P_BOOL|P_VI_DEF, (char_u *)&p_lz, PV_NONE, NULL, NULL, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, - {"lhistory", "lhi", P_NUM|P_VI_DEF, -#ifdef FEAT_QUICKFIX - (char_u *)VAR_WIN, PV_LHI, did_set_xhistory, NULL, - {(char_u *)10L, (char_u *)0L} -#else - (char_u *)NULL, PV_NONE, NULL, NULL, - {(char_u *)0L, (char_u *)0L} -#endif - SCTX_INIT}, {"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_LINEBREAK (char_u *)VAR_WIN, PV_LBR, NULL, NULL, @@ -2045,9 +2021,6 @@ static struct vimoption options[] = {"pumheight", "ph", P_NUM|P_VI_DEF, (char_u *)&p_ph, PV_NONE, NULL, NULL, {(char_u *)0L, (char_u *)0L} SCTX_INIT}, - {"pummaxwidth", "pmw", P_NUM|P_VI_DEF, - (char_u *)&p_pmw, PV_NONE, NULL, NULL, - {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"pumwidth", "pw", P_NUM|P_VI_DEF, (char_u *)&p_pw, PV_NONE, NULL, NULL, {(char_u *)15L, (char_u *)15L} SCTX_INIT}, diff --git a/src/optionstr.c b/src/optionstr.c index f60957eb..517a8358 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -30,9 +30,8 @@ static char *(p_briopt_values[]) = {"shift:", "min:", "sbr", "list:", "column:", #endif #if defined(FEAT_DIFF) // Note: Keep this in sync with diffopt_changed() -static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", "inline:", "linematch:", NULL}; +static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", "linematch:", NULL}; static char *(p_dip_algorithm_values[]) = {"myers", "minimal", "patience", "histogram", NULL}; -static char *(p_dip_inline_values[]) = {"none", "simple", "char", "word", NULL}; #endif static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", "unsigned", "blank", NULL}; static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL}; @@ -122,7 +121,7 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax", static char *(p_fcl_values[]) = {"all", NULL}; #endif static char *(p_cfc_values[]) = {"keyword", "files", "whole_line", NULL}; -static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", "preinsert", "nearest", NULL}; +static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", "preinsert", NULL}; #ifdef BACKSLASH_IN_FILENAME static char *(p_csl_values[]) = {"slash", "backslash", NULL}; #endif @@ -310,7 +309,6 @@ check_buf_options(buf_T *buf) check_string_option(&buf->b_p_cinw); check_string_option(&buf->b_p_cot); check_string_option(&buf->b_p_cpt); - check_string_option(&buf->b_p_ise); #ifdef FEAT_COMPL_FUNC check_string_option(&buf->b_p_cfu); check_string_option(&buf->b_p_ofu); @@ -1553,82 +1551,48 @@ did_set_commentstring(optset_T *args) #endif /* - * Check if value for 'complete' is valid when 'complete' option is changed. + * The 'complete' option is changed. */ char * did_set_complete(optset_T *args) { char_u **varp = (char_u **)args->os_varp; - char_u *p, *t; - char_u buffer[LSIZE]; - char_u *buf_ptr; - char_u char_before = NUL; - int escape; + char_u *s; - for (p = *varp; *p; ) + // check if it is a valid value for 'complete' -- Acevedo + for (s = *varp; *s;) { - vim_memset(buffer, 0, LSIZE); - buf_ptr = buffer; - escape = 0; - - // Extract substring while handling escaped commas - while (*p && (*p != ',' || escape) && buf_ptr < (buffer + LSIZE - 1)) + while (*s == ',' || *s == ' ') + s++; + if (!*s) + break; + if (vim_strchr((char_u *)".wbuksid]tU", *s) == NULL) + return illegal_char(args->os_errbuf, args->os_errbuflen, *s); + if (*++s != NUL && *s != ',' && *s != ' ') { - if (*p == '\\' && *(p + 1) == ',') + if (s[-1] == 'k' || s[-1] == 's') { - escape = 1; // Mark escape mode - p++; // Skip '\' + // skip optional filename after 'k' and 's' + while (*s && *s != ',' && *s != ' ') + { + if (*s == '\\' && s[1] != NUL) + ++s; + ++s; + } } else { - escape = 0; - *buf_ptr++ = *p; - } - p++; - } - *buf_ptr = NUL; - - if (vim_strchr((char_u *)".wbuksid]tUfo", *buffer) == NULL) - return illegal_char(args->os_errbuf, args->os_errbuflen, *buffer); - - if (vim_strchr((char_u *)"ksf", *buffer) == NULL && *(buffer + 1) != NUL - && *(buffer + 1) != '^') - char_before = *buffer; - else - { - // Test for a number after '^' - if ((t = vim_strchr(buffer, '^')) != NULL) - { - *t++ = NUL; - if (!*t) - char_before = '^'; - else + if (args->os_errbuf != NULL) { - for (; *t; t++) - { - if (!vim_isdigit(*t)) - { - char_before = '^'; - break; - } - } + vim_snprintf((char *)args->os_errbuf, args->os_errbuflen, + _(e_illegal_character_after_chr), *--s); + return args->os_errbuf; } + return ""; } } - if (char_before != NUL) - { - if (args->os_errbuf) - { - vim_snprintf((char *)args->os_errbuf, args->os_errbuflen, - _(e_illegal_character_after_chr), char_before); - return args->os_errbuf; - } - return NULL; - } - // Skip comma and spaces - while (*p == ',' || *p == ' ') - p++; } + return NULL; } @@ -1636,7 +1600,7 @@ did_set_complete(optset_T *args) expand_set_complete(optexpand_T *args, int *numMatches, char_u ***matches) { static char *(p_cpt_values[]) = { - ".", "w", "b", "u", "k", "kspell", "s", "i", "d", "]", "t", "U", "f", "o", + ".", "w", "b", "u", "k", "kspell", "s", "i", "d", "]", "t", "U", NULL}; return expand_set_opt_string( args, @@ -2053,18 +2017,6 @@ expand_set_diffopt(optexpand_T *args, int *numMatches, char_u ***matches) numMatches, matches); } - // Within "inline:", we have a subgroup of possible options. - int inline_len = (int)STRLEN("inline:"); - if (xp->xp_pattern - args->oe_set_arg >= inline_len && - STRNCMP(xp->xp_pattern - inline_len, "inline:", inline_len) == 0) - { - return expand_set_opt_string( - args, - p_dip_inline_values, - ARRAY_LENGTH(p_dip_inline_values) - 1, - numMatches, - matches); - } return FAIL; } @@ -2865,48 +2817,6 @@ did_set_imactivatekey(optset_T *args UNUSED) } #endif -/* - * The 'isexpand' option is changed. - */ - char * -did_set_isexpand(optset_T *args) -{ - char_u *ise = p_ise; - char_u *p; - int last_was_comma = FALSE; - - if (args->os_flags & OPT_LOCAL) - ise = curbuf->b_p_ise; - - for (p = ise; *p != NUL;) - { - if (*p == '\\' && p[1] == ',') - { - p += 2; - last_was_comma = FALSE; - continue; - } - - if (*p == ',') - { - if (last_was_comma) - return e_invalid_argument; - last_was_comma = TRUE; - p++; - continue; - } - - last_was_comma = FALSE; - MB_PTR_ADV(p); - } - - if (last_was_comma) - return e_invalid_argument; - - return NULL; -} - - /* * The 'iskeyword' option is changed. */ diff --git a/src/os_mswin.c b/src/os_mswin.c index 7a323f32..485ee20a 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -513,23 +513,18 @@ stat_impl(const char *name, stat_T *stp, const int resolve) // means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is // UTF-8. char_u buf[_MAX_PATH * 3 + 1]; - size_t buflen; char_u *p; WCHAR *wp; int n; vim_strncpy((char_u *)buf, (char_u *)name, sizeof(buf) - 1); - buflen = STRLEN(buf); - p = buf + buflen; + p = buf + STRLEN(buf); if (p > buf) MB_PTR_BACK(buf, p); // Remove trailing '\\' except root path. if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':') - { *p = NUL; - buflen = (size_t)(p - buf); - } if ((buf[0] == '\\' && buf[1] == '\\') || (buf[0] == '/' && buf[1] == '/')) { @@ -539,7 +534,7 @@ stat_impl(const char *name, stat_T *stp, const int resolve) { p = vim_strpbrk(p + 1, (char_u *)"\\/"); if (p == NULL) - STRCPY(buf + buflen, "\\"); + STRCAT(buf, "\\"); } } @@ -764,9 +759,9 @@ mch_check_messages(void) * and returns an allocated string. * Return OK if it worked, FAIL if not. */ -typedef char_u *(*MYSTRPROCSTR)(char_u *); -typedef int (*MYSTRPROCINT)(char_u *); -typedef char_u *(*MYINTPROCSTR)(int); +typedef LPTSTR (*MYSTRPROCSTR)(LPTSTR); +typedef LPTSTR (*MYINTPROCSTR)(int); +typedef int (*MYSTRPROCINT)(LPTSTR); typedef int (*MYINTPROCINT)(int); /* @@ -879,6 +874,11 @@ mch_libcall( int *number_result) { HINSTANCE hinstLib; + MYSTRPROCSTR ProcAdd; + MYINTPROCSTR ProcAddI; + char_u *retval_str = NULL; + int retval_int = 0; + size_t len; BOOL fRunTimeLinkSuccess = FALSE; @@ -888,10 +888,6 @@ mch_libcall( // If the handle is valid, try to get the function address. if (hinstLib != NULL) { - char_u *retval_str = NULL; - int retval_int = 0; - size_t len; - # ifdef HAVE_TRY_EXCEPT __try { @@ -899,53 +895,25 @@ mch_libcall( if (argstring != NULL) { // Call with string argument - if (string_result != NULL) + ProcAdd = (MYSTRPROCSTR)GetProcAddress(hinstLib, (LPCSTR)funcname); + if ((fRunTimeLinkSuccess = (ProcAdd != NULL)) != 0) { - MYSTRPROCSTR proc; - - proc = (MYSTRPROCSTR)GetProcAddress(hinstLib, (LPCSTR)funcname); - if (proc != NULL) - { - fRunTimeLinkSuccess = TRUE; - retval_str = proc(argstring); - } - } - else - { - MYSTRPROCINT proc; - - proc = (MYSTRPROCINT)GetProcAddress(hinstLib, (LPCSTR)funcname); - if (proc != NULL) - { - fRunTimeLinkSuccess = TRUE; - retval_int = proc(argstring); - } + if (string_result == NULL) + retval_int = ((MYSTRPROCINT)ProcAdd)((LPSTR)argstring); + else + retval_str = (char_u *)(ProcAdd)((LPSTR)argstring); } } else { // Call with number argument - if (string_result != NULL) + ProcAddI = (MYINTPROCSTR) GetProcAddress(hinstLib, (LPCSTR)funcname); + if ((fRunTimeLinkSuccess = (ProcAddI != NULL)) != 0) { - MYINTPROCSTR proc; - - proc = (MYINTPROCSTR)GetProcAddress(hinstLib, (LPCSTR)funcname); - if (proc != NULL) - { - fRunTimeLinkSuccess = TRUE; - retval_str = proc(argint); - } - } - else - { - MYINTPROCINT proc; - - proc = (MYINTPROCINT)GetProcAddress(hinstLib, (LPCSTR)funcname); - if (proc != NULL) - { - fRunTimeLinkSuccess = TRUE; - retval_int = proc(argint); - } + if (string_result == NULL) + retval_int = ((MYINTPROCINT)ProcAddI)(argint); + else + retval_str = (char_u *)(ProcAddI)(argint); } } @@ -967,7 +935,7 @@ mch_libcall( { if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW) _resetstkoflw(); - fRunTimeLinkSuccess = FALSE; + fRunTimeLinkSuccess = 0; } # endif @@ -2109,18 +2077,13 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) res = alloc(len); if (res != NULL) - reply.cbData = (DWORD)vim_snprintf_safelen( - (char *)res, len, "%s: \"%s\"", err, str); - else - reply.cbData = 0; + vim_snprintf((char *)res, len, "%s: \"%s\"", err, str); reply.dwData = COPYDATA_ERROR_RESULT; } else - { - reply.cbData = (DWORD)STRLEN(res) + 1; reply.dwData = COPYDATA_RESULT; - } reply.lpData = res; + reply.cbData = (DWORD)STRLEN(res) + 1; if (serverSendEnc(sender) < 0) retval = -1; @@ -2263,16 +2226,12 @@ enumWindowsGetServer(HWND hwnd, LPARAM lparam) } // If we are looking for an alternate server, remember this name. - if (altname_buf_ptr != NULL) + if (altname_buf_ptr != NULL + && STRNICMP(server, id->name, STRLEN(id->name)) == 0 + && vim_isdigit(server[STRLEN(id->name)])) { - size_t namelen = STRLEN(id->name); - - if (STRNICMP(server, id->name, namelen) == 0 - && vim_isdigit(server[namelen])) - { - STRCPY(altname_buf_ptr, server); - altname_buf_ptr = NULL; // don't use another name - } + STRCPY(altname_buf_ptr, server); + altname_buf_ptr = NULL; // don't use another name } // Otherwise, keep looking @@ -2348,20 +2307,16 @@ findServer(char_u *name) void serverSetName(char_u *name) { - size_t namelen; char_u *ok_name; HWND hwnd = 0; int i = 0; char_u *p; // Leave enough space for a 9-digit suffix to ensure uniqueness! - namelen = STRLEN(name); - ok_name = alloc(namelen + 10); - if (ok_name == NULL) - return; + ok_name = alloc(STRLEN(name) + 10); STRCPY(ok_name, name); - p = ok_name + namelen; + p = ok_name + STRLEN(name); for (;;) { @@ -2454,7 +2409,6 @@ serverSendToVim( int timeout, // timeout in seconds or zero int silent) // don't complain about no server { - size_t namelen; HWND target; COPYDATASTRUCT data; char_u *retval = NULL; @@ -2468,8 +2422,7 @@ serverSendToVim( // If the server name does not end in a digit then we look for an // alternate name. e.g. when "name" is GVIM then we may find GVIM2. - namelen = STRLEN(name); - if (namelen > 1 && !vim_isdigit(name[namelen - 1])) + if (STRLEN(name) > 1 && !vim_isdigit(name[STRLEN(name) - 1])) altname_buf_ptr = altname_buf; altname_buf[0] = NUL; target = findServer(name); @@ -2687,65 +2640,63 @@ serverProcessPendingMessages(void) struct charset_pair { - string_T name; + char *name; BYTE charset; }; -#define STRING_INIT(s) \ - {(char_u *)(s), STRLEN_LITERAL(s)} static struct charset_pair charset_pairs[] = { - {STRING_INIT("ANSI"), ANSI_CHARSET}, - {STRING_INIT("CHINESEBIG5"), CHINESEBIG5_CHARSET}, - {STRING_INIT("DEFAULT"), DEFAULT_CHARSET}, - {STRING_INIT("HANGEUL"), HANGEUL_CHARSET}, - {STRING_INIT("OEM"), OEM_CHARSET}, - {STRING_INIT("SHIFTJIS"), SHIFTJIS_CHARSET}, - {STRING_INIT("SYMBOL"), SYMBOL_CHARSET}, - {STRING_INIT("ARABIC"), ARABIC_CHARSET}, - {STRING_INIT("BALTIC"), BALTIC_CHARSET}, - {STRING_INIT("EASTEUROPE"), EASTEUROPE_CHARSET}, - {STRING_INIT("GB2312"), GB2312_CHARSET}, - {STRING_INIT("GREEK"), GREEK_CHARSET}, - {STRING_INIT("HEBREW"), HEBREW_CHARSET}, - {STRING_INIT("JOHAB"), JOHAB_CHARSET}, - {STRING_INIT("MAC"), MAC_CHARSET}, - {STRING_INIT("RUSSIAN"), RUSSIAN_CHARSET}, - {STRING_INIT("THAI"), THAI_CHARSET}, - {STRING_INIT("TURKISH"), TURKISH_CHARSET} + {"ANSI", ANSI_CHARSET}, + {"CHINESEBIG5", CHINESEBIG5_CHARSET}, + {"DEFAULT", DEFAULT_CHARSET}, + {"HANGEUL", HANGEUL_CHARSET}, + {"OEM", OEM_CHARSET}, + {"SHIFTJIS", SHIFTJIS_CHARSET}, + {"SYMBOL", SYMBOL_CHARSET}, + {"ARABIC", ARABIC_CHARSET}, + {"BALTIC", BALTIC_CHARSET}, + {"EASTEUROPE", EASTEUROPE_CHARSET}, + {"GB2312", GB2312_CHARSET}, + {"GREEK", GREEK_CHARSET}, + {"HEBREW", HEBREW_CHARSET}, + {"JOHAB", JOHAB_CHARSET}, + {"MAC", MAC_CHARSET}, + {"RUSSIAN", RUSSIAN_CHARSET}, + {"THAI", THAI_CHARSET}, + {"TURKISH", TURKISH_CHARSET}, # ifdef VIETNAMESE_CHARSET - , - {STRING_INIT("VIETNAMESE"), VIETNAMESE_CHARSET} + {"VIETNAMESE", VIETNAMESE_CHARSET}, # endif + {NULL, 0} }; struct quality_pair { - string_T name; + char *name; DWORD quality; }; static struct quality_pair quality_pairs[] = { # ifdef CLEARTYPE_QUALITY - {STRING_INIT("CLEARTYPE"), CLEARTYPE_QUALITY}, + {"CLEARTYPE", CLEARTYPE_QUALITY}, # endif # ifdef ANTIALIASED_QUALITY - {STRING_INIT("ANTIALIASED"), ANTIALIASED_QUALITY}, + {"ANTIALIASED", ANTIALIASED_QUALITY}, # endif # ifdef NONANTIALIASED_QUALITY - {STRING_INIT("NONANTIALIASED"), NONANTIALIASED_QUALITY}, + {"NONANTIALIASED", NONANTIALIASED_QUALITY}, # endif # ifdef PROOF_QUALITY - {STRING_INIT("PROOF"), PROOF_QUALITY}, + {"PROOF", PROOF_QUALITY}, # endif # ifdef DRAFT_QUALITY - {STRING_INIT("DRAFT"), DRAFT_QUALITY}, + {"DRAFT", DRAFT_QUALITY}, # endif - {STRING_INIT("DEFAULT"), DEFAULT_QUALITY} + {"DEFAULT", DEFAULT_QUALITY}, + {NULL, 0} }; -#undef STRING_INIT /* * Convert a charset ID to a name. @@ -2754,15 +2705,12 @@ quality_pairs[] = { char * charset_id2name(int id) { - int i; - - for (i = 0; i < (int)ARRAY_LENGTH(charset_pairs); ++i) - { - if ((BYTE)id == charset_pairs[i].charset) - return (char *)charset_pairs[i].name.string; - } + struct charset_pair *cp; - return NULL; + for (cp = charset_pairs; cp->name != NULL; ++cp) + if ((BYTE)id == cp->charset) + break; + return cp->name; } /* @@ -2772,15 +2720,12 @@ charset_id2name(int id) char * quality_id2name(DWORD id) { - int i; + struct quality_pair *qp; - for (i = 0; i < (int)ARRAY_LENGTH(quality_pairs); ++i) - { - if (id == quality_pairs[i].quality) - return (char *)quality_pairs[i].name.string; - } - - return NULL; + for (qp = quality_pairs; qp->name != NULL; ++qp) + if (id == qp->quality) + break; + return qp->name; } // The default font height in 100% scaling (96dpi). @@ -3007,7 +2952,6 @@ gui_mch_expand_font(optexpand_T *args, void *param UNUSED, int (*add_match)(char if (xp->xp_pattern > args->oe_set_arg && *(xp->xp_pattern-1) == ':') { char buf[30]; - int i; // Always fill in with the current font size as first option for // convenience. We simply round to the closest integer for simplicity. @@ -3020,18 +2964,19 @@ gui_mch_expand_font(optexpand_T *args, void *param UNUSED, int (*add_match)(char // 'q' as we fill in all the values below. static char *(p_gfn_win_opt_values[]) = { "h" , "w" , "W" , "b" , "i" , "u" , "s"}; - for (i = 0; i < (int)ARRAY_LENGTH(p_gfn_win_opt_values); i++) + for (size_t i = 0; i < ARRAY_LENGTH(p_gfn_win_opt_values); i++) add_match((char_u *)p_gfn_win_opt_values[i]); - for (i = 0; i < (int)ARRAY_LENGTH(charset_pairs); ++i) + struct charset_pair *cp; + for (cp = charset_pairs; cp->name != NULL; ++cp) { - vim_snprintf(buf, sizeof(buf), "c%s", charset_pairs[i].name.string); + vim_snprintf(buf, ARRAY_LENGTH(buf), "c%s", cp->name); add_match((char_u *)buf); } - - for (i = 0; i < (int)ARRAY_LENGTH(quality_pairs); ++i) + struct quality_pair *qp; + for (qp = quality_pairs; qp->name != NULL; ++qp) { - vim_snprintf(buf, sizeof(buf), "q%s", quality_pairs[i].name.string); + vim_snprintf(buf, ARRAY_LENGTH(buf), "q%s", qp->name); add_match((char_u *)buf); } return; @@ -3090,7 +3035,7 @@ set_default_logfont(LOGFONTW *lf) const char *defaultfontname = N_("DefaultFontNameForWindows"); char *fontname = _(defaultfontname); - if (STRCMP(fontname, defaultfontname) == 0) + if (strcmp(fontname, defaultfontname) == 0) fontname = "Consolas"; *lf = s_lfDefault; @@ -3218,51 +3163,48 @@ get_logfont( lf->lfStrikeOut = TRUE; break; case L'c': - for (i = 0; i < (int)ARRAY_LENGTH(charset_pairs); ++i) { - if (utf16ascncmp(p, (char *)charset_pairs[i].name.string, - charset_pairs[i].name.length) == 0) + struct charset_pair *cp; + + for (cp = charset_pairs; cp->name != NULL; ++cp) + if (utf16ascncmp(p, cp->name, strlen(cp->name)) == 0) + { + lf->lfCharSet = cp->charset; + p += strlen(cp->name); + break; + } + if (cp->name == NULL && verbose) { - lf->lfCharSet = charset_pairs[i].charset; - p += charset_pairs[i].name.length; - break; - } - } + char_u *s = utf16_to_enc(p, NULL); - if (i == (int)ARRAY_LENGTH(charset_pairs) && verbose) - { - char_u *s = utf16_to_enc(p, NULL); - if (s != NULL) - { semsg(_(e_illegal_str_name_str_in_font_name_str), "charset", s, name); vim_free(s); - } - } - break; - case L'q': - for (i = 0; i < (int)ARRAY_LENGTH(quality_pairs); ++i) - { - if (utf16ascncmp(p, (char *)quality_pairs[i].name.string, - quality_pairs[i].name.length) == 0) - { - lf->lfQuality = quality_pairs[i].quality; - p += quality_pairs[i].name.length; break; } + break; } - - if (i == (int)ARRAY_LENGTH(quality_pairs) && verbose) + case L'q': { - char_u *s = utf16_to_enc(p, NULL); - if (s != NULL) + struct quality_pair *qp; + + for (qp = quality_pairs; qp->name != NULL; ++qp) + if (utf16ascncmp(p, qp->name, strlen(qp->name)) == 0) + { + lf->lfQuality = qp->quality; + p += strlen(qp->name); + break; + } + if (qp->name == NULL && verbose) { + char_u *s = utf16_to_enc(p, NULL); semsg(_(e_illegal_str_name_str_in_font_name_str), "quality", s, name); vim_free(s); + break; } + break; } - break; default: if (verbose) semsg(_(e_illegal_char_nr_in_font_name_str), p[-1], name); diff --git a/src/os_unix.c b/src/os_unix.c index 714f203d..95b21d29 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4434,20 +4434,20 @@ mch_report_winsize(int fd, int rows, int cols) ws.ws_col = cols; ws.ws_row = rows; - // calculate and set tty pixel size + // calcurate and set tty pixel size struct cellsize cs; mch_calc_cell_size(&cs); if (cs.cs_xpixel == -1) { - // failed get pixel size. - ws.ws_xpixel = 0; - ws.ws_ypixel = 0; + // failed get pixel size. + ws.ws_xpixel = 0; + ws.ws_ypixel = 0; } else { - ws.ws_xpixel = cols * cs.cs_xpixel; - ws.ws_ypixel = rows * cs.cs_ypixel; + ws.ws_xpixel = cols * cs.cs_xpixel; + ws.ws_ypixel = rows * cs.cs_ypixel; } retval = ioctl(tty_fd, TIOCSWINSZ, &ws); @@ -5260,13 +5260,14 @@ mch_call_shell_fork( else if (wpid == 0) // child { linenr_T lnum = curbuf->b_op_start.lnum; - size_t written = 0; + int written = 0; char_u *lp = ml_get(lnum); size_t lplen = (size_t)ml_get_len(lnum); close(fromshell_fd); for (;;) { + lplen -= written; if (lplen == 0) len = 0; else if (lp[written] == NL) @@ -5277,10 +5278,10 @@ mch_call_shell_fork( char_u *s = vim_strchr(lp + written, NL); len = write(toshell_fd, (char *)lp + written, - s == NULL ? lplen - written + s == NULL ? lplen : (size_t)(s - (lp + written))); } - if (len == (int)(lplen - written)) + if (len == (int)lplen) { // Finished a line, add a NL, unless this line // should not have one. @@ -5304,7 +5305,7 @@ mch_call_shell_fork( written = 0; } else if (len > 0) - written += (size_t)len; + written += len; } _exit(0); } diff --git a/src/os_win32.c b/src/os_win32.c index 0b6fecd7..0ba4eedb 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -971,7 +971,7 @@ PlatformId(void) ovi.dwOSVersionInfoSize = sizeof(ovi); if (!GetVersionEx(&ovi)) - return; + return; #ifdef FEAT_EVAL vim_snprintf(windowsVersion, sizeof(windowsVersion), "%d.%d", @@ -988,7 +988,7 @@ PlatformId(void) #ifdef HAVE_ACL // Enable privilege for getting or setting SACLs. if (!win32_enable_privilege(SE_SECURITY_NAME)) - return; + return; #endif } #ifdef _MSC_VER @@ -3810,13 +3810,10 @@ mch_dirname( if (GetLongPathNameW(wbuf, wcbuf, _MAX_PATH) != 0) { p = utf16_to_enc(wcbuf, NULL); - if (p != NULL) + if (STRLEN(p) >= (size_t)len) { - if (STRLEN(p) >= (size_t)len) - { - // long path name is too long, fall back to short one - VIM_CLEAR(p); - } + // long path name is too long, fall back to short one + VIM_CLEAR(p); } } if (p == NULL) @@ -6349,7 +6346,7 @@ termcap_mode_end(void) // Switch back to main screen buffer. if (exiting && use_alternate_screen_buffer) - vtp_printf("\033[?1049l"); + vtp_printf("\033[?1049l"); if (!USE_WT && (p_rs || exiting)) { diff --git a/src/po/ru.cp1251.po b/src/po/ru.cp1251.po index c69326a5..d2beb830 100644 --- a/src/po/ru.cp1251.po +++ b/src/po/ru.cp1251.po @@ -22,10 +22,10 @@ # msgid "" msgstr "" -"Project-Id-Version: RuVim_0.9011270.030425\n" +"Project-Id-Version: RuVim_0.9010898.301124\n" "Report-Msgid-Bugs-To: The Vim Project, \n" -"POT-Creation-Date: 2025-04-03 17:45+0300\n" -"PO-Revision-Date: 2025-04-03 19:22+0300\n" +"POT-Creation-Date: 2024-11-30 20:11+0300\n" +"PO-Revision-Date: 2024-11-30 20:26+0300\n" "Last-Translator: Restorer, \n" "Language-Team: RuVim, https://github.com/RestorerZ/RuVim\n" "Language: ru_RU\n" @@ -211,8 +211,8 @@ msgstr " # #Restorer: ëîêàëèçóåìîå çíà÷åíèå ïðîöåíòà #, c-format -msgid "%s%d%%" -msgstr "%s%d %%" +msgid "%d%%" +msgstr "%d %%" # #Restorer: âûâîäèòñÿ â çàãîëîâêå îêíà, ñòðîêå ñîñòîÿíèÿ, êîìíäíîé ñòðîêå ïðè # #Restorer: ðåäàêòèðîâàíèè íåñêîëüêèõ ôàéëîâ @@ -1061,12 +1061,13 @@ msgid "[unix format]" msgstr "[â ôîðìàòå unix]" # #Restorer: äîáàâëÿåòñÿ ê ñîîáùåíèþ â êîìàíäíîé ñòðîêå ïðè îïåðàöèÿõ ñ ôàéëîì +# ~!: earlier #, c-format -msgid "%s%ld line, " -msgid_plural "%s%ld lines, " -msgstr[0] "%s%ld ñòðîêà, " -msgstr[1] "%s%ld ñòðîêè, " -msgstr[2] "%s%ld ñòðîê, " +msgid "%ld line, " +msgid_plural "%ld lines, " +msgstr[0] "%ld ñòðîêà, " +msgstr[1] "%ld ñòðîêè, " +msgstr[2] "%ld ñòðîê, " # #Restorer: äîáàâëÿåòñÿ ê ñîîáùåíèþ â êîìàíäíîé ñòðîêå ïðè îïåðàöèÿõ ñ ôàéëîì #, c-format @@ -2026,7 +2027,7 @@ msgstr "-g\t\t\t msgid "-f or --nofork\tForeground: Don't fork when starting GUI" msgstr "" -"-f èëè --nofork\tÍå îòêëþ÷àòüñÿ îò àêòèâíîé çàäà÷è ïðè çàïóñêå ÃÈÏ" +"-f èëè --nofork\tÏðè çàïóñêå ÃÈÏ èç àêòèâíîé çàäà÷è íå îòêëþ÷àòüñÿ îò íå¸" msgid "-v\t\t\tVi mode (like \"vi\")" msgstr "-v\t\t\tÇàïóñê ïðîãðàììû â ðåæèìå Vi (êàê \"vi\")" @@ -2134,13 +2135,13 @@ msgstr "--noplugin\t\t # \n\t\t.. äëÿ óìåùåíèÿ â 80 ñòîëáöîâ (Ñ. Àë¸øèí) msgid "-p[N]\t\tOpen N tab pages (default: one for each file)" msgstr "" -"-p[N]\t\tÑîçäàòü N âêëàäîê äëÿ ôàéëîâ (ïî óìîë÷àíèþ ñîçäà¸òñÿ\n" +"-p[N]\t\tÑîçäàòü âêëàäêè äëÿ N ôàéëîâ (ïî óìîë÷àíèþ ñîçäà¸òñÿ\n" "\t\t\t ïî îäíîé âêëàäêå íà êàæäûé ôàéë)" # \n\t\t.. äëÿ óìåùåíèÿ â 80 ñòîëáöîâ (Ñ. Àë¸øèí) msgid "-o[N]\t\tOpen N windows (default: one for each file)" msgstr "" -"-o[N]\t\tÑîçäàòü N îêîí äëÿ ôàéëîâ (ïî óìîë÷àíèþ ñîçäà¸òñÿ\n" +"-o[N]\t\tÑîçäàíèå îêîí äëÿ N ôàéëîâ (ïî óìîë÷àíèþ ñîçäà¸òñÿ\n" "\t\t\t ïî îäíîìó îêíó íà êàæäûé ôàéë)" msgid "-O[N]\t\tLike -o but split vertically" @@ -2834,10 +2835,10 @@ msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " SPACE/d/j - âíèç, b/u/k - ââåðõ íà ýêðàí/ñòðàíèöó/ñòðîêó; q - îòáîé " msgid "W23: Clipboard register not available, using register 0" -msgstr "W23: Ðåãèñòð áóôåðà îáìåíà íåäîñòóïåí. Áóäåò èñïîëüçîâàí ðåãèñòð 0" +msgstr "W23: Ðåãèñòð áóôåðà îáìåíà íå äîñòóïåí. Áóäåò èñïîëüçîâàí ðåãèñò 0" msgid "W24: Clipboard register not available. See :h W24" -msgstr "W24: Ðåãèñòð áóôåðà îáìåíà íåäîñòóïåí. Ïîäðîáíåå ñì. :h W24" +msgstr "W24: Ðåãèñòð áóôåðà îáìåíà íå äîñòóïåí. Ïîäðîáíåå ñì. :h W24" # #Restorer: çàãîëîâîê îêíà msgid "Question" @@ -5315,7 +5316,8 @@ msgstr "E131: msgid "E132: Function call depth is higher than 'maxfuncdepth'" msgstr "" -"E132: Êîëè÷åñòâî âûçîâîâ ôóíêöèé ïðåâûøàåò çíà÷åíèå ïàðàìåòðà 'maxfuncdepth'" +"E132: Êîëè÷åñòâî âûçîâîâ ôóíêöèé ïðåâûøàåò çíà÷åíèå â ïàðàìåòðå " +"'maxfuncdepth'" msgid "E133: :return not inside a function" msgstr "E133: Êîìàíäà :return óêàçàííà âíå òåëà ôóíêöèè" @@ -6769,7 +6771,7 @@ msgid "E523: Not allowed here" msgstr "E523:  öåëÿõ áåçîïàñíîñòè äàííûå äåéñòâèÿ çàïðåùåíû" msgid "E524: Missing colon" -msgstr "E524: Íå óêàçàí ñèìâîë äâîåòî÷èå, êàê ðàçäåëèòåëü ôëàãà è çíà÷åíèÿ" +msgstr "E524: Íå óêàçàí ñèìâîë äâîåòî÷èÿ, êàê ðàçäåëèòåëü ôëàãà è çíà÷åíèÿ" msgid "E525: Zero length string" msgstr "E525: Íå äîïóñêàåòñÿ óñòàíîâêà ïóñòîãî çíà÷åíèÿ äëÿ" @@ -6779,7 +6781,7 @@ msgid "E526: Missing number after <%s>" msgstr "E526: Íå óêàçàíî ÷èñëîâîå çíà÷åíèå ïîñëå ñèìâîëà <%s>" msgid "E527: Missing comma" -msgstr "E527: Íå óêàçàí ñèìâîë çàïÿòàÿ, êàê ðàçäåëèòåëü çíà÷åíèé" +msgstr "E527: Íå óêàçàí ñèìâîë çàïÿòîé, êàê ðàçäåëèòåëü çíà÷åíèé" msgid "E528: Must specify a ' value" msgstr "E528: Òðåáóåòñÿ óêàçàòü çíà÷åíèå äëÿ ôëàãà ' " @@ -6808,7 +6810,7 @@ msgid "E535: Illegal character after <%c>" msgstr "E535: Íåäîïóñòèìûé ñèìâîë ïîñëå ôëàãà <%c> â" msgid "E536: Comma required" -msgstr "E536: Íå óêàçàí ñèìâîë çàïÿòàÿ, êàê ðàçäåëèòåëü ìàðêåðîâ â" +msgstr "E536: Íå óêàçàí ñèìâîë çàïÿòîé, êàê ðàçäåëèòåëü ìàðêåðîâ â" #, c-format msgid "E537: 'commentstring' must be empty or contain %s" @@ -6838,7 +6840,7 @@ msgid "E544: Keymap file not found" msgstr "E544: Íå íàéäåí ôàéë ñ îïèñàíèåì ðàñêëàäêè êëàâèàòóðû" msgid "E545: Missing colon" -msgstr "E545: Íå óêàçàí ñèìâîë äâîåòî÷èå, êàê ðàçäåëèòåëü ðåæèìà è ïàðàìåòðà" +msgstr "E545: Íå óêàçàí ñèìâîë äâîåòî÷èÿ, êàê ðàçäåëèòåëü ðåæèìà è ïàðàìåòðà" msgid "E546: Illegal mode" msgstr "" @@ -6854,7 +6856,7 @@ msgid "E549: Illegal percentage" msgstr "E549: Íåäîïóñòèìîå çíà÷åíèå âåëè÷èíû ïðîöåíòà" msgid "E550: Missing colon" -msgstr "E550: Íå óêàçàí ñèìâîë äâîåòî÷èå, êàê ðàçäåëèòåëü ôëàãà è åãî çíà÷åíèÿ" +msgstr "E550: Íå óêàçàí ñèìâîë äâîåòî÷èÿ, êàê ðàçäåëèòåëü ôëàãà è åãî çíà÷åíèÿ" msgid "E551: Illegal component" msgstr "E551: Íåäîïóñòèìîå êîëè÷åñòâî êîìïîíåíòîâ äëÿ ïàðàìåòðà" @@ -7092,8 +7094,7 @@ msgstr "E619: #, c-format msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "" -"E620: Ïðè âûâîäå íà ïå÷àòü íå óäàëîñü âûïîëíèòü èçìåíåíèå êîäèðîâêè \"%s\"" +msgstr "E620: Ïðè âûâîäå íà ïå÷àòü íå óäàëîñü ïðåîáðàçîâàòü â êîäèðîâêó \"%s\"" #, c-format msgid "E621: \"%s\" resource file has wrong version" @@ -7278,7 +7279,7 @@ msgstr "" "êîäèðîâêè" msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Íå çàäàí øðèôò äëÿ ïå÷àòè â ìíîãîáàéòîâîé êîäèðîâêå" +msgstr "E675: Íå çàäàí øðèôò ïî óìîë÷àíèþ ïðè ïå÷àòè â ìíîãîáàéòîâîé êîäèðîâêå" #, c-format msgid "E676: No matching autocommands for buftype=%s buffer" @@ -7360,7 +7361,7 @@ msgstr "E695: #, c-format msgid "E696: Missing comma in List: %s" msgstr "" -"E696:  äàííûõ òèï List íå óêàçàí ñèìâîë çàïÿòàÿ, êàê ðàçäåëèòåëü ýëåìåíòîâ " +"E696:  äàííûõ òèï List íå óêàçàí ñèìâîë çàïÿòîé, êàê ðàçäåëèòåëü ýëåìåíòîâ " "%s" #, c-format @@ -8477,7 +8478,8 @@ msgstr "" "E987: Ôóíêöèÿ, çàäàííàÿ â ïàðàìåòðå 'tagfunc', âåðíóëà íåäîïóñòèìûå äàííûå" msgid "E988: GUI cannot be used. Cannot execute gvim.exe." -msgstr "E988: Ñáîé çàïóñêà ôàéëà gvim.exe. Ãðàôè÷åñêèé èíòåðôåéñ íåäîñòóïåí" +msgstr "" +"E988: Íå óäàëîñü çàïóñòèòü ãðàôè÷åñêèé èíòåðôåéñ. Ñáîé çàïóñêà ôàéëà gvim.exe" msgid "E989: Non-default argument follows default argument" msgstr "" @@ -8702,8 +8704,8 @@ msgstr "" msgid "E1040: Cannot use :scriptversion after :vim9script" msgstr "" -"E1040: Íå äîïóñêàåòñÿ óêàçàíèå êîìàíäû :scriptversion ïîñëå " -"êîìàíäû :vim9script" +"E1040: Íå äîïóñêàåòñÿ óêàçàíèå êîìàíäû :scriptversion ïîñëå êîìàíäû :" +"vim9script" #, c-format msgid "E1041: Redefining script item: \"%s\"" @@ -8851,7 +8853,7 @@ msgstr "E1083: #, c-format msgid "E1084: Cannot delete Vim9 script function %s" -msgstr "E1084: Íå äîïóñêàåòñÿ óäàëåíèå ôóíêöèè Vim9 %s" +msgstr "E1084: Íå äîïóñêàåòñÿ óäàëåíèå ôóíêöèé Vim9 %s" #, c-format msgid "E1085: Not a callable type: %s" @@ -9051,17 +9053,16 @@ msgstr "E1138: msgid "E1139: Missing matching bracket after dict key" msgstr "E1139: Íå óêàçàíà çàêðûâàþùàÿ ïðÿìîóãîëüíàÿ ñêîáêà ïîñëå êëþ÷à ñëîâàðÿ" -msgid "E1140: :for argument must be a sequence of lists or tuples" -msgstr "" -"E1140: Ïàðàìåòð êîìàíäû :for äîëæåí áûòü âëîæåííûì ñïèñêîì èëè êîðòåæåì" +msgid "E1140: :for argument must be a sequence of lists" +msgstr "E1140: Ïàðàìåòð êîìàíäû :for äîëæåí áûòü â âèäå âëîæåííîãî ñïèñêà" msgid "E1141: Indexable type required" msgstr "E1141: Òðåáóåòñÿ òèï äàííûõ äîïóñêàþùèõ èíäåêñàöèþ" msgid "E1142: Calling test_garbagecollect_now() while v:testing is not set" msgstr "" -"E1142: Ïðè âûçîâå ôóíêöèè test_garbagecollect_now() íå çàäàíà ïåðåìåííàÿ " -"v:testing" +"E1142: Ïðè âûçîâå ôóíêöèè test_garbagecollect_now() íå çàäàíà ïåðåìåííàÿ v:" +"testing" #, c-format msgid "E1143: Empty expression: \"%s\"" @@ -9167,7 +9168,7 @@ msgstr "E1168: #, c-format msgid "E1169: Expression too recursive: %s" -msgstr "E1169: Ìíîãîêðàòíàÿ âëîæåííîñòü âûðàæåíèÿ %s" +msgstr "E1169: Áîëüøàÿ ðåêóðñèâíîñòü âûðàæåíèÿ %s" msgid "E1170: Cannot use #{ to start a comment" msgstr "E1170: Íå äîïóñêàåòñÿ èñïîëüçîâàíèå ñèìâîëîâ #{ êàê íà÷àëî êîììåíòàðèÿ" @@ -9385,10 +9386,9 @@ msgstr "" "E1224: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, Number èëè List" #, c-format -msgid "E1225: String, List, Tuple or Dictionary required for argument %d" +msgid "E1225: String, List or Dictionary required for argument %d" msgstr "" -"E1225: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, List, Tuple èëè " -"Dictionary" +"E1225: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, List èëè Dictionary" #, c-format msgid "E1226: List or Blob required for argument %d" @@ -9430,10 +9430,6 @@ msgstr "" msgid "E1234: legacy must be followed by a command" msgstr "E1234: Ïîñëå êîìàíäû :legacy äîëæíà áûòü óêàçàíà ïîñëåäóþùàÿ êîìàíäà" -#, c-format -msgid "E1235: Bool or Number required for argument %d" -msgstr "E1235: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü Number èëè Bool" - #, c-format msgid "E1236: Cannot use %s itself, it is imported" msgstr "E1236: Íå äîïóñêàåòñÿ îáðàùåíèå ê %s. Ýòî èìïîðòèðîâàííûé êîìïîíåíò" @@ -9487,25 +9483,18 @@ msgstr "E1249: #, c-format msgid "E1250: Argument of %s must be a List, String, Dictionary or Blob" -msgstr "" -"E1250:  ôóíêöèè %s òèï àðãóìåíòà äîëæåí áûòü List, String, Dictionary èëè " -"BLOB" +msgstr "E1250:  ôóíêöèè %s òèï àðãóìåíòà äîëæåí áûòü List, String èëè BLOB" #, c-format -msgid "E1251: List, Tuple, Dictionary, Blob or String required for argument %d" +msgid "E1251: List, Dictionary, Blob or String required for argument %d" msgstr "" -"E1251: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü List, Tuple, Dictionary, " -"BLOB èëè String" +"E1251: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü List, Dictionary, BLOB èëè " +"String" #, c-format msgid "E1252: String, List or Blob required for argument %d" msgstr "E1252: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, List èëè BLOB" -#, c-format -msgid "E1253: String, List, Tuple or Blob required for argument %d" -msgstr "" -"E1253: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, List, Tuple èëè BLOB" - msgid "E1254: Cannot use script variable in for loop" msgstr "" "E1254: Íå äîïóñêàåòñÿ óêàçàíèå ëîêàëüíûõ ïåðåìåííûõ â êîìàíäå öèêëà :for" @@ -9536,11 +9525,12 @@ msgid "E1260: Cannot unlet an imported item: %s" msgstr "E1260: Íå äîïóñêàåòñÿ óäàëåíèå êîìïîíåíòà â èìïîðòèðîâàííûõ äàííûõ %s" msgid "E1261: Cannot import .vim without using \"as\"" -msgstr "E1261: Èìïîðò êîìàíäíîãî ôàéëà áåç óêàçàíèÿ êëþ÷åâîãî ñëîâà \"as\"" +msgstr "" +"E1261: Èìïîðòèðîâàíèå êîìàíäíîãî ôàéëà áåç óêàçàíèÿ êëþ÷åâîãî ñëîâà \"as\"" #, c-format msgid "E1262: Cannot import the same script twice: %s" -msgstr "E1262: Íå äîïóñêàåòñÿ ïîâòîðíûé èìïîðò êîìàíäíîãî ôàéëà %s" +msgstr "E1262: Íå äîïóñêàåòñÿ ïîâòîðíîå èìïîðòèðîâàíèå êîìàíäíîãî ôàéëà %s" msgid "E1263: Cannot use name with # in Vim9 script, use export instead" msgstr "" @@ -9697,10 +9687,10 @@ msgstr "" "E1300: Íå äîïóñêàåòñÿ óêàçàíèå êîìàíäû :defer äëÿ ÷àñòè÷íîé ñëîâàðíîé ôóíêöèè" #, c-format -msgid "E1301: String, Number, List, Tuple or Blob required for argument %d" +msgid "E1301: String, Number, List or Blob required for argument %d" msgstr "" -"E1301: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, Number, List, Tuple " -"èëè BLOB" +"E1301: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü String, Number, List èëè " +"BLOB" msgid "E1302: Script variable was deleted" msgstr "E1302: Ïåðåìåííàÿ êîìàíäíîãî ôàéëà áûëà óäàëåíà" @@ -10052,9 +10042,6 @@ msgstr "E1393: msgid "E1394: Type name must start with an uppercase letter: %s" msgstr "E1394: Íàèìåíîâàíèå òèïà äîëæíî íà÷èíàòüñÿ ñ ïðîïèñíîé áóêâû %s" -msgid "E1395: Using a null class" -msgstr "E1395: Îáíàðóæåí íåèíèöèàëèçèðîâàííûé òèï äàííûõ Class" - #, c-format msgid "E1396: Type alias \"%s\" already exists" msgstr "E1396: Ïñåâäîíèì òèïà óæå ñóùåñòâóåò \"%s\"" @@ -10172,17 +10159,6 @@ msgstr "" "E1429: Òèï äàííûõ Class ìîæåò áûòü îïðåäåë¸í òîëüêî íà óðîâíå êîìàíäíîãî " "ôàéëà" -#, c-format -msgid "E1430: Uninitialized object variable '%s' referenced" -msgstr "E1430: Ññûëêà íà íåèíèöèàëèçèðîâàííóþ îáúåêòíóþ ïåðåìåííóþ '%s'" - -#, c-format -msgid "" -"E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly" -msgstr "" -"E1431: Íå äîïóñêàåòñÿ ïðÿìîå îáðàùåíèå ê àáñòðàêòíîìó ìåòîäó \"%s\" êëàññà " -"\"%s\"" - #, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Óêàçàíû êàê ïîçèöèîííûå, òàê è íå ïîçèöèîííûå ñïåöèôèêàòîðû %s" @@ -10247,110 +10223,6 @@ msgid "E1514: 'findfunc' did not return a List type" msgstr "" "E1514: Ïîëó÷åííûå îò ïàðàìåòðà 'findfunc' äàííûå íå ÿâëÿþòñÿ òèïîì List" -#, c-format -msgid "E1515: Unable to convert from '%s' encoding" -msgstr "E1515: Íå óäàëîñü âûïîëíèòü ïðåîáðàçîâàíèå äëÿ êîäèðîâêè '%s'" - -#, c-format -msgid "E1516: Unable to convert to '%s' encoding" -msgstr "E1516: Íå óäàëîñü âûïîëíèòü ïðåîáðàçîâàíèå èç êîäèðîâêè '%s'" - -msgid "E1517: Can only compare Tuple with Tuple" -msgstr "" -"E1517: Îïåðàöèè ñðàâíåíèÿ äëÿ òèïà Tuple äîïóñòèìû òîëüêî ñ òèïîì Tuple" - -msgid "E1518: Invalid operation for Tuple" -msgstr "E1518: Íåäîïóñòèìàÿ îïåðàöèÿ äëÿ Tuple" - -#, c-format -msgid "E1519: Tuple index out of range: %ld" -msgstr "E1519: Âûõîä çà ãðàíèöû äèàïàçîíà äàííûõ òèï Tuple äëÿ èíäåêñà %ld" - -msgid "E1520: Using a Tuple as a Number" -msgstr "E1520: Îæèäàëñÿ òèï äàííûõ Tuple, à ïîëó÷åí Number" - -msgid "E1521: Using a Tuple as a Float" -msgstr "E1521: Îæèäàëñÿ òèï äàííûõ Tuple, à ïîëó÷åí Float" - -msgid "E1522: Using a Tuple as a String" -msgstr "E1522: Îæèäàëñÿ òèï äàííûõ Tuple, à ïîëó÷åí String" - -msgid "E1523: String, List, Tuple or Blob required" -msgstr "E1523: Òèï äàííûõ äîëæåí áûòü String, List, Tuple èëè BLOB" - -#, c-format -msgid "E1524: Cannot use a tuple with function %s" -msgstr "E1524: Íå äîïóñêàåòñÿ èñïîëüçîâàòü êîðòåæè â ôóíêöèè %s" - -#, c-format -msgid "E1525: Argument of %s must be a List, Tuple, String, Dictionary or Blob" -msgstr "" -"E1525:  ôóíêöèè %s òèï àðãóìåíòà äîëæåí áûòü List, Tuple, String, Dictionary" -" èëè BLOB" - -#, c-format -msgid "E1526: Missing end of Tuple ')': %s" -msgstr "E1526: Íå óêàçàíà çàêðûâàþùàÿ êðóãëàÿ ñêîáêà â äàííûõ òèï Tuple %s" - -#, c-format -msgid "E1527: Missing comma in Tuple: %s" -msgstr "" -"E1527:  äàííûõ òèï Tuple íå óêàçàí ñèìâîë çàïÿòàÿ, êàê ðàçäåëèòåëü " -"ýëåìåíòîâ %s" - -#, c-format -msgid "E1528: List or Tuple or Blob required for argument %d" -msgstr "E1528: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü List, Tuple èëè BLOB" - -#, c-format -msgid "E1529: List or Tuple required for argument %d" -msgstr "E1529: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü List èëè Tuple" - -#, c-format -msgid "E1530: List or Tuple or Dictionary required for argument %d" -msgstr "" -"E1530: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü List, Tuple èëè Dictionary" - -#, c-format -msgid "E1531: Argument of %s must be a List, Tuple, Dictionary or Blob" -msgstr "" -"E1531:  ôóíêöèè %s òèï àðãóìåíòà äîëæåí áûòü List, Tuple, Dictionary èëè " -"BLOB" - -msgid "E1532: Cannot modify a tuple" -msgstr "E1532: Íå äîïóñêàåòñÿ èçìåíåíèå êîðòåæåé" - -msgid "E1533: Cannot slice a tuple" -msgstr "E1533: Íå äîïóñêàåòñÿ óêàçàíèå äèàïàçîíà äëÿ êîðòåæåé" - -#, c-format -msgid "E1534: Tuple required for argument %d" -msgstr "E1534: Òèï äàííûõ àðãóìåíòà íîìåð %d äîëæåí áûòü Tuple" - -msgid "E1535: List or Tuple required" -msgstr "E1535: Òèï äàííûõ äîëæåí áûòü List èëè Tuple" - -msgid "E1536: Tuple required" -msgstr "E1536: Òèï äàííûõ äîëæåí áûòü Tuple" - -msgid "E1537: Less targets than Tuple items" -msgstr "E1537: Êîëè÷åñòâî ïåðåìåííûõ ìåíüøå êîëè÷åñòâà ýëåìåíòîâ êîðòåæà" - -msgid "E1538: More targets than Tuple items" -msgstr "E1538: Êîëè÷åñòâî ïåðåìåííûõ áîëüøå êîëè÷åñòâà ýëåìåíòîâ êîðòåæà" - -#, c-format -msgid "E1539: Variadic tuple must end with a list type: %s" -msgstr "E1539: Âàðèàöèîííûé êîðòåæ äîëæåí çàêàí÷èâàòüñÿ òèïîì äàííûõ List %s" - -msgid "E1540: Cannot use a variadic tuple in concatenation" -msgstr "E1540: Íå äîïóñêàåòñÿ îáúåäèíåíèå âàðèàöèîííûõ êîðòåæåé" - -msgid "E1541: Value too large, max Unicode codepoint is U+10FFFF" -msgstr "" -"E1541: Çíà÷åíèå ïðåâûøàåò äîïóñòèìóþ âåëè÷èíó êîäîâîé ïîçèöèè Þíèêîäà " -"U+10FFFF" - # #Restorer: âûâîäèòñÿ, íàïðèìåð, ïî êîìàíäå `CTRL+g`, `g CTRL+g` è ò. ï. msgid "--No lines in buffer--" msgstr "-- Áóôåð íå ñîäåðæèò òåêñò --" @@ -10465,18 +10337,19 @@ msgstr " #, c-format msgid "expected 3-tuple as imp.find_module() result, but got %s" msgstr "" -"ðåçóëüòàò ôóíêöèè imp.find_module() êîðòåæ èç òð¸õ ýëåìåíòîâ, à ïîëó÷åí %s" +"ðåçóëüòàò ôóíêöèè imp.find_module() íåèçìåíÿåìûé ñïèñîê èç òð¸õ ýëåìåíòîâ, à " +"ïîëó÷åí %s" #, c-format msgid "expected 3-tuple as imp.find_module() result, but got tuple of size %d" msgstr "" -"ðåçóëüòàò ôóíêöèè imp.find_module() êîðòåæ èç òð¸õ ýëåìåíòîâ, à ïîëó÷åíî " -"ýëåìåíòîâ %d" +"ðåçóëüòàò ôóíêöèè imp.find_module() íåèçìåíÿåìûé ñïèñîê èç òð¸õ ýëåìåíòîâ, à " +"ïîëó÷åíî ýëåìåíòîâ %d" msgid "internal error: imp.find_module returned tuple with NULL" msgstr "" -"âíóòðåííÿÿ îøèáêà. Ðåçóëüòàò ôóíêöèè imp.find_module() êîðòåæ ñ íóëåâûì " -"êîëè÷åñòâîì ýëåìåíòîâ" +"âíóòðåííÿÿ îøèáêà. Ðåçóëüòàò ôóíêöèè imp.find_module() íåèçìåíÿåìûé ñïèñîê " +"áåç ýëåìåíòîâ" msgid "cannot delete vim.Dictionary attributes" msgstr "ñâîéñòâà îáúåêòà vim.Dictionary íå ìîãóò áûòü óäàëåíû" @@ -10540,19 +10413,6 @@ msgstr " msgid "cannot modify fixed list" msgstr "ñîñòîÿíèå áëîêèðîâêè îáúåêòà íå ìîæåò áûòü èçìåíåíî" -msgid "tuple constructor does not accept keyword arguments" -msgstr "" -"íå äîïóñêàåòñÿ èñïîëüçîâàòü â êîíñòðóêòîðå êîðòåæà çàðåçåðâèðîâàííûå ñëîâà" - -msgid "tuple index out of range" -msgstr "èíäåêñ êîðòåæà âûõîäèò çà ãðàíèöû äèàïàçîíà" - -msgid "cannot delete vim.Tuple attributes" -msgstr "ñâîéñòâà îáúåêòà vim.Tuple íå ìîãóò áûòü óäàëåíû" - -msgid "cannot modify fixed tuple" -msgstr "íå äîïóñêàåòñÿ èçìåíåíèå ôèêñèðîâàííîãî êîðòåæà" - #, c-format msgid "unnamed function %s does not exist" msgstr "íå ñóùåñòâóåò áåçûìÿííîé ôóíêöèè %s" @@ -10842,7 +10702,7 @@ msgid "nroff macro names that separate sections" msgstr "ðàçäåëèòåëü ïàðàãðàôîâ â òåðìèíàõ ìàêðîÿçûêà nroff" msgid "list of directory names used for file searching" -msgstr "êàòàëîãè â êîòîðûõ âûïîëíÿåòñÿ ïîèñê ôàéëîâ" +msgstr "êàòàëîãè, â êîòîðûõ âûïîëíÿåòñÿ ïîèñê ôàéëîâ" msgid ":cd without argument goes to the home directory" msgstr "" @@ -10905,7 +10765,7 @@ msgid "tags" msgstr "Èíäåêñèðîâàíèå" msgid "use binary searching in tags files" -msgstr "èñïîëüçîâàòü äëÿ ôàéëîâ èíäåêñîâ áèíàðíûé ïîèñê" +msgstr "èñïîëüçîâàòü äëÿ ïîèñêà â ôàéëàõ èíäåêñîâ áèíàðíûé ïîèñê" msgid "number of significant characters in a tag name or zero" msgstr "" @@ -10982,13 +10842,13 @@ msgstr "" "ïàðàìåòðå 'breakat'" msgid "preserve indentation in wrapped text" -msgstr "ñîõðàíåíèå îòñòóïîâ ïðè ïåðåíîñå äëèííûõ ñòðîê" +msgstr "ïðè ðàçáèâêå äëèííûõ ñòðîê ñîõðàíèòü îòñòóïû" msgid "adjust breakindent behaviour" msgstr "íàñòðîéêè, èñïîëüçóåìûå äëÿ ïàðàìåòðà 'breakindent'" msgid "which characters might cause a line break" -msgstr "ñèìâîëû, ïîñëå êîòîðûõ ìîæåò âûïîëíÿòüñÿ ðàçáèâêà ñòðîê" +msgstr "ñèìâîëû, ïîñëå êîòîðûõ âûïîëíÿåòñÿ ðàçáèâêà äëèííûõ ñòðîê" msgid "string to put before wrapped screen lines" msgstr "" @@ -11092,10 +10952,10 @@ msgid "use GUI colors for the terminal" msgstr "èñïîëüçîâàòü ãðóïïû ïîäñâåòêè ÃÈÏ äëÿ òåðìèíàëà" msgid "highlight the screen column of the cursor" -msgstr "ïîäñâåòêà ñòîëáöà ýêðàíà â êîòîðîì íàõîäèòñÿ êàðåòêà" +msgstr "ïîäñâåòêà ñòîëáöà â ïîçèöèè êàðåòêè" msgid "highlight the screen line of the cursor" -msgstr "ïîäñâåòêà ñòðîêè ýêðàíà â êîòîðîé íàõîäèòñÿ êàðåòêà" +msgstr "ïîäñâåòêà ñòðîêè â ïîçèöèè êàðåòêè" msgid "specifies which area 'cursorline' highlights" msgstr "îáëàñòü ïîäñâåòêè, èñïîëüçóåìàÿ ïðè âêëþ÷¸ííîì 'cursorline'" @@ -11107,7 +10967,7 @@ msgid "highlight spelling mistakes" msgstr "ïîäñâå÷èâàòü ñëîâà ñ îøèáêàìè íàïèñàíèÿ" msgid "list of accepted languages" -msgstr "ÿçûêè äëÿ êîòîðûõ áóäåò âûïîëíÿòüñÿ ïðîâåðêà ïðàâîïèñàíèÿ" +msgstr "ÿçûêè, äëÿ êîòîðûõ áóäåò âûïîëíÿòüñÿ ïðîâåðêà ïðàâîïèñàíèÿ" msgid "file that \"zg\" adds good words to" msgstr "ñëîâàðü ïîëüçîâàòåëÿ, èñïîëüçóåìûé äëÿ êîìàíäû `zg`" @@ -11271,11 +11131,11 @@ msgid "terminal connection is fast" msgstr "ñîåäèíåíèå ñ òåðìèíàëîì ÿâëÿåòñÿ âûñîêîñêîðîñòíûì" msgid "request terminal key codes when an xterm is detected" -msgstr "çàïðîñ äåéñòâóþùèõ ïàðàìåòðîâ òåðìèíàëà ïðè îáíàðóæåíèè xterm" +msgstr "çàïðîñ êîäîâ êëàâèø ïðè îáíàðóæåíèè òåðìèíàëà xterm" # ~!: Matvey Tarasov msgid "terminal that requires extra redrawing" -msgstr "òåðìèíàë, òðåáóþùèé äîïîëíèòåëüíóþ ïðîðèñîâêó òåêñòà" +msgstr "òåðìèíàë, òðåáóþùèé äîïîëíèòåëüíóþ îòðèñîâêó òåêñòà" msgid "what keyboard protocol to use for which terminal" msgstr "èñïîëüçóåìûé òåðìèíàëîì ïðîòîêîë îáìåíà äàííûõ ñ êëàâèàòóðîé" @@ -11336,7 +11196,7 @@ msgstr "" "óêàçàòåëü «ìûøè»" msgid "hide the mouse pointer while typing" -msgstr "ñêðûâàòü óêàçàòåëü «ìûøè» ïðè íàáîðå òåêñòà" +msgstr "ñêðûòü óêàçàòåëü «ìûøè» ïðè íàáîðå òåêñòà" msgid "report mouse movement events" msgstr "àêòèâèðîâàòü îïîâåùåíèå ïî ñîáûòèþ ïåðåìåùåíèÿ óêàçàòåëÿ «ìûøè»" @@ -11363,13 +11223,13 @@ msgid "GUI" msgstr "Ãðàôè÷åñêèé èíòåðôåéñ ïîëüçîâàòåëÿ" msgid "list of font names to be used in the GUI" -msgstr "øðèôòû èñïîëüçóåìûå â ãðàôè÷åñêîì èíòåðôåéñå" +msgstr "øðèôòû, èñïîëüçóåìûå â ãðàôè÷åñêîì èíòåðôåéñå" msgid "pair of fonts to be used, for multibyte editing" -msgstr "ïàðû øðèôòîâ èñïîëüçóåìûå ïðè ìíîãîáàéòîâîé êîäèðîâêå" +msgstr "ïàðû øðèôòîâ, èñïîëüçóåìûå ïðè ìíîãîáàéòîâîé êîäèðîâêå" msgid "list of font names to be used for double-wide characters" -msgstr "øðèôòû èñïîëüçóåìûå ïðè îòîáðàæåíèè ñèìâîëîâ äâîéíîé øèðèíû" +msgstr "øðèôòû, èñïîëüçóåìûå ïðè îòîáðàæåíèè ñèìâîëîâ äâîéíîé øèðèíû" msgid "use smooth, antialiased fonts" msgstr "èñïîëüçîâàòü øðèôòû ñî «ñãëàæèâàíèåì»" @@ -11386,7 +11246,7 @@ msgid "size of toolbar icons" msgstr "ðàçìåð çíà÷êîâ íà ïàíåëè èíñòðóìåíòîâ" msgid "room (in pixels) left above/below the window" -msgstr "îáëàñòü ýêðàíà (â ïèêñåëÿõ), îñòàþùàÿñÿ íå çàíÿòîé îêíîì ïðîãðàììû" +msgstr "îáëàñòü ýêðàíà, îñòàþùàÿñÿ íå çàíÿòîé îêíîì ïðîãðàììû (â ïèêñåëÿõ)" msgid "list of ASCII characters that can be combined into complex shapes" msgstr "ïåðå÷åíü ñèìâîëîâ êîäèðîâêè ASCII, èñïîëüçóåìûõ â ñîñòàâíûõ ñèìâîëàõ" @@ -11424,10 +11284,10 @@ msgid "delay in milliseconds before a balloon may pop up" msgstr "çàäåðæêà â ìñ ïåðåä îòîáðàæåíèåì âñïëûâàþùåé âûíîñêè" msgid "use balloon evaluation in the GUI" -msgstr "âêëþ÷åíèå âñïëûâàþùèõ âûíîñîê â ãðàôè÷åñêîì èíòåðôåéñå" +msgstr "èñïîëüçîâàòü âñïëûâàþùèå âûíîñêè â ãðàôè÷åñêîì èíòåðôåéñå" msgid "use balloon evaluation in the terminal" -msgstr "âêëþ÷åíèå âñïëûâàþùèõ âûíîñîê â îêíå òåðìèíàëà" +msgstr "èñïîëüçîâàòü âñïëûâàþùèå âûíîñêè â îêíå òåðìèíàëà" msgid "expression to show in balloon eval" msgstr "ôóíêöèÿ, èñïîëüçóåìàÿ äëÿ ñîçäàíèÿ âñïëûâàþùåé âûíîñêè" @@ -11457,7 +11317,7 @@ msgid "the CJK character set to be used for CJK output from :hardcopy" msgstr "íàáîð ñèìâîëîâ, èñïîëüçóåìûé ïðè ïå÷àòè ÊÊß ÿçûêîâ" msgid "list of font names to be used for CJK output from :hardcopy" -msgstr "øðèôòû èñïîëüçóåìûå ïðè ïå÷àòè ÊÊß ÿçûêîâ" +msgstr "øðèôòû, èñïîëüçóåìûå ïðè ïå÷àòè ÊÊß ÿçûêîâ" msgid "messages and info" msgstr "Îòîáðàæåíèå èíôîðìàöèè è ñîîáùåíèé ïðîãðàììû" @@ -11468,14 +11328,14 @@ msgstr "" "(íå ñîîáùàòü î äîñòèæåíèè ãðàíèö äîêóìåíòà ïðè ïîèñêå)" msgid "list of flags to make messages shorter" -msgstr "ôëàãè, çàäàþùèå êîëè÷åñòâî îòîáðàæàåìûõ ñîîáùåíèé ïðîãðàììû" +msgstr "ôëàãè, óïðàâëÿþùèå êîëè÷åñòâîì îòîáðàæàåìûõ ñîîáùåíèé ïðîãðàììû" -msgid "options for outputting messages" -msgstr "íàñòðîéêè, èñïîëüçóåìûå äëÿ âûâîäà ñîîáùåíèé" +msgid "how many messages are remembered" +msgstr "êîëè÷åñòâî çàïîìèíàåìûõ ñîîáùåíèé" msgid "show (partial) command keys in location given by 'showcmdloc'" msgstr "" -"îòîáðàæàòü íàáèðàåìûå êîìàíäû â ìåñòå êîòîðîå óêàçàííî â ïàðàìåòðå\n" +"îòîáðàæåíèå íàáðàííûõ êîìàíä òàì, ãäå óêàçàííî â ïàðàìåòðå\n" "'showcmdloc'" msgid "location where to show the (partial) command keys for 'showcmd'" @@ -11598,11 +11458,6 @@ msgstr " msgid "specifies how Insert mode completion works for CTRL-N and CTRL-P" msgstr "ðàáîòà êîìàíä CTRL+N è CTRL+P ïðè ïîäñòàíîâêå â ðåæèìå âñòàâêè" -msgid "use fuzzy collection for specific completion modes" -msgstr "" -" \n" -"èñïîëüçîâàòü íåïîëíûå êîëëåêöèè äëÿ óêàçàííûõ ðåæèìîâ ïîäñòàíîâêè" - msgid "whether to use a popup menu for Insert mode completion" msgstr "èñïîëüçîâàòü âñïëûâàþùåå ìåíþ ïðè ïîäñòàíîâêå â ðåæèìå âñòàâêè" @@ -11618,9 +11473,6 @@ msgstr " msgid "minimum width of the popup menu" msgstr "ìèíèìàëüíàÿ øèðèíà âñïëûâàþùåãî ìåíþ ïðè ïîäñòàíîâêå" -msgid "maximum width of the popup menu" -msgstr "ìàêñèìàëüíàÿ øèðèíà âñïëûâàþùåãî ìåíþ ïðè ïîäñòàíîâêå" - msgid "user defined function for Insert mode completion" msgstr "ïîëüçîâàòåëüñêàÿ ôóíêöèÿ ïðè ïîäñòàíîâêå â ðåæèìå âñòàâêè" @@ -11828,7 +11680,7 @@ msgid "options for using diff mode" msgstr "íàñòðîéêè, èñïîëüçóåìûå äëÿ ðåæèìà ñâåðêè ðàçëè÷èé" msgid "expression used to obtain a diff file" -msgstr "ôóíêöèÿ, èñïîëüçóåìàÿ äëÿ ñîçäàíèÿ ôàéëà ðàçëè÷èé" +msgstr "ôóíêöèÿ, èñïîëüçóåìàÿ äëÿ ïîëó÷åíèÿ ôàéëà ðàçëè÷èé" msgid "expression used to patch a file" msgstr "ôóíêöèÿ, èñïîëüçóåìàÿ äëÿ âíåñåíèÿ èñïðàâëåíèé â ôàéë" @@ -11906,13 +11758,13 @@ msgstr " msgid "patterns that specify for which files a backup is not made" msgstr "" -"íå ñîçäàâàòü ðåçåðâíûå êîïèè äëÿ ôàéëîâ, êîòîðûå ñîîòâåòñòâóþò\n" -"çàäàííûì øàáëîíàì" +"øàáëîíû, óêàçûâàþùèå, äëÿ êàêèõ ôàéëîâ íå ñîçäàâàòü ðåçåðâíûå\n" +"êîïèè" msgid "whether to make the backup as a copy or rename the existing file" msgstr "" -"ìåòîä ñîçäàíèÿ ðåçåðâíîé êîïèè — èëè êîïèðîâàíèåì,\n" -"èëè ïåðåèìåíîâàíèåì ôàéëà" +"ìåòîä ñîçäàíèÿ ðåçåðâíîé êîïèè — èëè êîïèðîâàíèåì, èëè ïåðåèìåíîâàíèåì\n" +"ôàéëà" msgid "list of directories to put backup files in" msgstr "êàòàëîãè, â êîòîðûõ ìîãóò ðàçìåùàòüñÿ ðåçåðâíûå êîïèè ôàéëà" @@ -12130,7 +11982,7 @@ msgid "specifies printable characters" msgstr "çàäà¸ò ïå÷àòàåìûå ñèìâîëû" msgid "specifies escape characters in a string" -msgstr "çàäà¸ò ýêðàíèðóþùèå ñèìâîëû èñïîëüçóåìûå â ñòðîêå" +msgstr "çàäà¸ò ýêðàíèðóþùèå ñèìâîëû, èñïîëüçóåìûå â ñòðîêå" msgid "display the buffer right-to-left" msgstr "îòîáðàæàòü ñîäåðæèìîå áóôåðà ñïðàâà íàëåâî" @@ -12254,11 +12106,6 @@ msgstr "" msgid "list of autocommand events which are to be ignored" msgstr "ïåðå÷åíü ñîáûòèé, äëÿ êîòîðûõ íå áóäóò èñïîëíÿòüñÿ àâòîêîìàíäû" -msgid "list of autocommand events which are to be ignored in a window" -msgstr "" -"ïåðå÷åíü ñîáûòèé, äëÿ êîòîðûõ íå áóäóò èñïîëíÿòüñÿ àâòîêîìàíäû\n" -"â óêàçàííîì îêíå áóôåðà" - msgid "load plugin scripts when starting up" msgstr "çàãðóæàòü ïîäêëþ÷àåìûå ìîäóëè ïðè çàïóñêå ïðîãðàììû" diff --git a/src/po/ru.po b/src/po/ru.po index f2b81bf2..e2b5f042 100644 --- a/src/po/ru.po +++ b/src/po/ru.po @@ -22,10 +22,10 @@ # msgid "" msgstr "" -"Project-Id-Version: RuVim_0.9011270.030425\n" +"Project-Id-Version: RuVim_0.9010898.301124\n" "Report-Msgid-Bugs-To: The Vim Project, \n" -"POT-Creation-Date: 2025-04-03 17:45+0300\n" -"PO-Revision-Date: 2025-04-03 19:22+0300\n" +"POT-Creation-Date: 2024-11-30 20:11+0300\n" +"PO-Revision-Date: 2024-11-30 20:26+0300\n" "Last-Translator: Restorer, \n" "Language-Team: RuVim, https://github.com/RestorerZ/RuVim\n" "Language: ru_RU\n" @@ -211,8 +211,8 @@ msgstr "Ðачало" # #Restorer: локализуемое значение процента #, c-format -msgid "%s%d%%" -msgstr "%s%d %%" +msgid "%d%%" +msgstr "%d %%" # #Restorer: выводитÑÑ Ð² заголовке окна, Ñтроке ÑоÑтоÑниÑ, комндной Ñтроке при # #Restorer: редактировании неÑкольких файлов @@ -1061,12 +1061,13 @@ msgid "[unix format]" msgstr "[в формате unix]" # #Restorer: добавлÑетÑÑ Ðº Ñообщению в командной Ñтроке при операциÑÑ… Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð¼ +# ~!: earlier #, c-format -msgid "%s%ld line, " -msgid_plural "%s%ld lines, " -msgstr[0] "%s%ld Ñтрока, " -msgstr[1] "%s%ld Ñтроки, " -msgstr[2] "%s%ld Ñтрок, " +msgid "%ld line, " +msgid_plural "%ld lines, " +msgstr[0] "%ld Ñтрока, " +msgstr[1] "%ld Ñтроки, " +msgstr[2] "%ld Ñтрок, " # #Restorer: добавлÑетÑÑ Ðº Ñообщению в командной Ñтроке при операциÑÑ… Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð¼ #, c-format @@ -2026,7 +2027,7 @@ msgstr "-g\t\t\tЗапуÑк программы Ñ Ð³Ñ€Ð°Ñ„Ð¸Ñ‡ÐµÑким инт msgid "-f or --nofork\tForeground: Don't fork when starting GUI" msgstr "" -"-f или --nofork\tÐе отключатьÑÑ Ð¾Ñ‚ активной задачи при запуÑке ГИП" +"-f или --nofork\tПри запуÑке ГИП из активной задачи не отключатьÑÑ Ð¾Ñ‚ неё" msgid "-v\t\t\tVi mode (like \"vi\")" msgstr "-v\t\t\tЗапуÑк программы в режиме Vi (как \"vi\")" @@ -2134,13 +2135,13 @@ msgstr "--noplugin\t\tЗапуÑк программы без внешних по # \n\t\t.. Ð´Ð»Ñ ÑƒÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð² 80 Ñтолбцов (С. Ðлёшин) msgid "-p[N]\t\tOpen N tab pages (default: one for each file)" msgstr "" -"-p[N]\t\tСоздать N вкладок Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² (по умолчанию ÑоздаётÑÑ\n" +"-p[N]\t\tСоздать вкладки Ð´Ð»Ñ N файлов (по умолчанию ÑоздаётÑÑ\n" "\t\t\t по одной вкладке на каждый файл)" # \n\t\t.. Ð´Ð»Ñ ÑƒÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð² 80 Ñтолбцов (С. Ðлёшин) msgid "-o[N]\t\tOpen N windows (default: one for each file)" msgstr "" -"-o[N]\t\tСоздать N окон Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² (по умолчанию ÑоздаётÑÑ\n" +"-o[N]\t\tСоздание окон Ð´Ð»Ñ N файлов (по умолчанию ÑоздаётÑÑ\n" "\t\t\t по одному окну на каждый файл)" msgid "-O[N]\t\tLike -o but split vertically" @@ -2834,10 +2835,10 @@ msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " SPACE/d/j - вниз, b/u/k - вверх на Ñкран/Ñтраницу/Ñтроку; q - отбой " msgid "W23: Clipboard register not available, using register 0" -msgstr "W23: РегиÑтр буфера обмена недоÑтупен. Будет иÑпользован региÑтр 0" +msgstr "W23: РегиÑтр буфера обмена не доÑтупен. Будет иÑпользован региÑÑ‚ 0" msgid "W24: Clipboard register not available. See :h W24" -msgstr "W24: РегиÑтр буфера обмена недоÑтупен. Подробнее Ñм. :h W24" +msgstr "W24: РегиÑтр буфера обмена не доÑтупен. Подробнее Ñм. :h W24" # #Restorer: заголовок окна msgid "Question" @@ -5315,7 +5316,8 @@ msgstr "E131: Удаление не выполнено. Эта Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ñ msgid "E132: Function call depth is higher than 'maxfuncdepth'" msgstr "" -"E132: КоличеÑтво вызовов функций превышает значение параметра 'maxfuncdepth'" +"E132: КоличеÑтво вызовов функций превышает значение в параметре " +"'maxfuncdepth'" msgid "E133: :return not inside a function" msgstr "E133: Команда :return указанна вне тела функции" @@ -6769,7 +6771,7 @@ msgid "E523: Not allowed here" msgstr "E523: Ð’ целÑÑ… безопаÑноÑти данные дейÑÑ‚Ð²Ð¸Ñ Ð·Ð°Ð¿Ñ€ÐµÑ‰ÐµÐ½Ñ‹" msgid "E524: Missing colon" -msgstr "E524: Ðе указан Ñимвол двоеточие, как разделитель флага и значениÑ" +msgstr "E524: Ðе указан Ñимвол двоеточиÑ, как разделитель флага и значениÑ" msgid "E525: Zero length string" msgstr "E525: Ðе допуÑкаетÑÑ ÑƒÑтановка пуÑтого Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð»Ñ" @@ -6779,7 +6781,7 @@ msgid "E526: Missing number after <%s>" msgstr "E526: Ðе указано чиÑловое значение поÑле Ñимвола <%s>" msgid "E527: Missing comma" -msgstr "E527: Ðе указан Ñимвол запÑтаÑ, как разделитель значений" +msgstr "E527: Ðе указан Ñимвол запÑтой, как разделитель значений" msgid "E528: Must specify a ' value" msgstr "E528: ТребуетÑÑ ÑƒÐºÐ°Ð·Ð°Ñ‚ÑŒ значение Ð´Ð»Ñ Ñ„Ð»Ð°Ð³Ð° ' " @@ -6808,7 +6810,7 @@ msgid "E535: Illegal character after <%c>" msgstr "E535: ÐедопуÑтимый Ñимвол поÑле флага <%c> в" msgid "E536: Comma required" -msgstr "E536: Ðе указан Ñимвол запÑтаÑ, как разделитель маркеров в" +msgstr "E536: Ðе указан Ñимвол запÑтой, как разделитель маркеров в" #, c-format msgid "E537: 'commentstring' must be empty or contain %s" @@ -6838,7 +6840,7 @@ msgid "E544: Keymap file not found" msgstr "E544: Ðе найден файл Ñ Ð¾Ð¿Ð¸Ñанием раÑкладки клавиатуры" msgid "E545: Missing colon" -msgstr "E545: Ðе указан Ñимвол двоеточие, как разделитель режима и параметра" +msgstr "E545: Ðе указан Ñимвол двоеточиÑ, как разделитель режима и параметра" msgid "E546: Illegal mode" msgstr "" @@ -6854,7 +6856,7 @@ msgid "E549: Illegal percentage" msgstr "E549: ÐедопуÑтимое значение величины процента" msgid "E550: Missing colon" -msgstr "E550: Ðе указан Ñимвол двоеточие, как разделитель флага и его значениÑ" +msgstr "E550: Ðе указан Ñимвол двоеточиÑ, как разделитель флага и его значениÑ" msgid "E551: Illegal component" msgstr "E551: ÐедопуÑтимое количеÑтво компонентов Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°" @@ -7092,8 +7094,7 @@ msgstr "E619: Файл не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым файлом #, c-format msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "" -"E620: При выводе на печать не удалоÑÑŒ выполнить изменение кодировки \"%s\"" +msgstr "E620: При выводе на печать не удалоÑÑŒ преобразовать в кодировку \"%s\"" #, c-format msgid "E621: \"%s\" resource file has wrong version" @@ -7278,7 +7279,7 @@ msgstr "" "кодировки" msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Ðе задан шрифт Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸ в многобайтовой кодировке" +msgstr "E675: Ðе задан шрифт по умолчанию при печати в многобайтовой кодировке" #, c-format msgid "E676: No matching autocommands for buftype=%s buffer" @@ -7360,7 +7361,7 @@ msgstr "E695: Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ индекÑа Ð´Ð»Ñ #, c-format msgid "E696: Missing comma in List: %s" msgstr "" -"E696: Ð’ данных тип List не указан Ñимвол запÑтаÑ, как разделитель Ñлементов " +"E696: Ð’ данных тип List не указан Ñимвол запÑтой, как разделитель Ñлементов " "%s" #, c-format @@ -8477,7 +8478,8 @@ msgstr "" "E987: ФункциÑ, Ð·Ð°Ð´Ð°Ð½Ð½Ð°Ñ Ð² параметре 'tagfunc', вернула недопуÑтимые данные" msgid "E988: GUI cannot be used. Cannot execute gvim.exe." -msgstr "E988: Сбой запуÑка файла gvim.exe. ГрафичеÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½ÐµÐ´Ð¾Ñтупен" +msgstr "" +"E988: Ðе удалоÑÑŒ запуÑтить графичеÑкий интерфейÑ. Сбой запуÑка файла gvim.exe" msgid "E989: Non-default argument follows default argument" msgstr "" @@ -8702,8 +8704,8 @@ msgstr "" msgid "E1040: Cannot use :scriptversion after :vim9script" msgstr "" -"E1040: Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ команды :scriptversion поÑле " -"команды :vim9script" +"E1040: Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ команды :scriptversion поÑле команды :" +"vim9script" #, c-format msgid "E1041: Redefining script item: \"%s\"" @@ -8851,7 +8853,7 @@ msgstr "E1083: Ðе указан Ñимвол машинопиÑного обр #, c-format msgid "E1084: Cannot delete Vim9 script function %s" -msgstr "E1084: Ðе допуÑкаетÑÑ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ðµ функции Vim9 %s" +msgstr "E1084: Ðе допуÑкаетÑÑ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ðµ функций Vim9 %s" #, c-format msgid "E1085: Not a callable type: %s" @@ -9051,17 +9053,16 @@ msgstr "E1138: ОжидалÑÑ Ñ‚Ð¸Ð¿ данных Number, а получено msgid "E1139: Missing matching bracket after dict key" msgstr "E1139: Ðе указана Ð·Ð°ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ Ð¿Ñ€ÑÐ¼Ð¾ÑƒÐ³Ð¾Ð»ÑŒÐ½Ð°Ñ Ñкобка поÑле ключа ÑловарÑ" -msgid "E1140: :for argument must be a sequence of lists or tuples" -msgstr "" -"E1140: Параметр команды :for должен быть вложенным ÑпиÑком или кортежем" +msgid "E1140: :for argument must be a sequence of lists" +msgstr "E1140: Параметр команды :for должен быть в виде вложенного ÑпиÑка" msgid "E1141: Indexable type required" msgstr "E1141: ТребуетÑÑ Ñ‚Ð¸Ð¿ данных допуÑкающих индекÑацию" msgid "E1142: Calling test_garbagecollect_now() while v:testing is not set" msgstr "" -"E1142: При вызове функции test_garbagecollect_now() не задана Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ " -"v:testing" +"E1142: При вызове функции test_garbagecollect_now() не задана Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ v:" +"testing" #, c-format msgid "E1143: Empty expression: \"%s\"" @@ -9167,7 +9168,7 @@ msgstr "E1168: Этот аргумент уже объÑвлен в команд #, c-format msgid "E1169: Expression too recursive: %s" -msgstr "E1169: ÐœÐ½Ð¾Ð³Ð¾ÐºÑ€Ð°Ñ‚Ð½Ð°Ñ Ð²Ð»Ð¾Ð¶ÐµÐ½Ð½Ð¾Ñть Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ %s" +msgstr "E1169: Ð‘Ð¾Ð»ÑŒÑˆÐ°Ñ Ñ€ÐµÐºÑƒÑ€ÑивноÑть Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ %s" msgid "E1170: Cannot use #{ to start a comment" msgstr "E1170: Ðе допуÑкаетÑÑ Ð¸Ñпользование Ñимволов #{ как начало комментариÑ" @@ -9385,10 +9386,9 @@ msgstr "" "E1224: Тип данных аргумента номер %d должен быть String, Number или List" #, c-format -msgid "E1225: String, List, Tuple or Dictionary required for argument %d" +msgid "E1225: String, List or Dictionary required for argument %d" msgstr "" -"E1225: Тип данных аргумента номер %d должен быть String, List, Tuple или " -"Dictionary" +"E1225: Тип данных аргумента номер %d должен быть String, List или Dictionary" #, c-format msgid "E1226: List or Blob required for argument %d" @@ -9430,10 +9430,6 @@ msgstr "" msgid "E1234: legacy must be followed by a command" msgstr "E1234: ПоÑле команды :legacy должна быть указана поÑÐ»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð°" -#, c-format -msgid "E1235: Bool or Number required for argument %d" -msgstr "E1235: Тип данных аргумента номер %d должен быть Number или Bool" - #, c-format msgid "E1236: Cannot use %s itself, it is imported" msgstr "E1236: Ðе допуÑкаетÑÑ Ð¾Ð±Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ðµ к %s. Это импортированный компонент" @@ -9487,25 +9483,18 @@ msgstr "E1249: Ðаименование группы подÑветки прев #, c-format msgid "E1250: Argument of %s must be a List, String, Dictionary or Blob" -msgstr "" -"E1250: Ð’ функции %s тип аргумента должен быть List, String, Dictionary или " -"BLOB" +msgstr "E1250: Ð’ функции %s тип аргумента должен быть List, String или BLOB" #, c-format -msgid "E1251: List, Tuple, Dictionary, Blob or String required for argument %d" +msgid "E1251: List, Dictionary, Blob or String required for argument %d" msgstr "" -"E1251: Тип данных аргумента номер %d должен быть List, Tuple, Dictionary, " -"BLOB или String" +"E1251: Тип данных аргумента номер %d должен быть List, Dictionary, BLOB или " +"String" #, c-format msgid "E1252: String, List or Blob required for argument %d" msgstr "E1252: Тип данных аргумента номер %d должен быть String, List или BLOB" -#, c-format -msgid "E1253: String, List, Tuple or Blob required for argument %d" -msgstr "" -"E1253: Тип данных аргумента номер %d должен быть String, List, Tuple или BLOB" - msgid "E1254: Cannot use script variable in for loop" msgstr "" "E1254: Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ локальных переменных в команде цикла :for" @@ -9536,11 +9525,12 @@ msgid "E1260: Cannot unlet an imported item: %s" msgstr "E1260: Ðе допуÑкаетÑÑ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ðµ компонента в импортированных данных %s" msgid "E1261: Cannot import .vim without using \"as\"" -msgstr "E1261: Импорт командного файла без ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ ÐºÐ»ÑŽÑ‡ÐµÐ²Ð¾Ð³Ð¾ Ñлова \"as\"" +msgstr "" +"E1261: Импортирование командного файла без ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ ÐºÐ»ÑŽÑ‡ÐµÐ²Ð¾Ð³Ð¾ Ñлова \"as\"" #, c-format msgid "E1262: Cannot import the same script twice: %s" -msgstr "E1262: Ðе допуÑкаетÑÑ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ñ‹Ð¹ импорт командного файла %s" +msgstr "E1262: Ðе допуÑкаетÑÑ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾Ðµ импортирование командного файла %s" msgid "E1263: Cannot use name with # in Vim9 script, use export instead" msgstr "" @@ -9697,10 +9687,10 @@ msgstr "" "E1300: Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ команды :defer Ð´Ð»Ñ Ñ‡Ð°Ñтичной Ñловарной функции" #, c-format -msgid "E1301: String, Number, List, Tuple or Blob required for argument %d" +msgid "E1301: String, Number, List or Blob required for argument %d" msgstr "" -"E1301: Тип данных аргумента номер %d должен быть String, Number, List, Tuple " -"или BLOB" +"E1301: Тип данных аргумента номер %d должен быть String, Number, List или " +"BLOB" msgid "E1302: Script variable was deleted" msgstr "E1302: ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð¾Ð³Ð¾ файла была удалена" @@ -10052,9 +10042,6 @@ msgstr "E1393: Тип может быть определён только в к msgid "E1394: Type name must start with an uppercase letter: %s" msgstr "E1394: Ðаименование типа должно начинатьÑÑ Ñ Ð¿Ñ€Ð¾Ð¿Ð¸Ñной буквы %s" -msgid "E1395: Using a null class" -msgstr "E1395: Обнаружен неинициализированный тип данных Class" - #, c-format msgid "E1396: Type alias \"%s\" already exists" msgstr "E1396: ПÑевдоним типа уже ÑущеÑтвует \"%s\"" @@ -10172,17 +10159,6 @@ msgstr "" "E1429: Тип данных Class может быть определён только на уровне командного " "файла" -#, c-format -msgid "E1430: Uninitialized object variable '%s' referenced" -msgstr "E1430: СÑылка на неинициализированную объектную переменную '%s'" - -#, c-format -msgid "" -"E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly" -msgstr "" -"E1431: Ðе допуÑкаетÑÑ Ð¿Ñ€Ñмое обращение к абÑтрактному методу \"%s\" клаÑÑа " -"\"%s\"" - #, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Указаны как позиционные, так и не позиционные Ñпецификаторы %s" @@ -10247,110 +10223,6 @@ msgid "E1514: 'findfunc' did not return a List type" msgstr "" "E1514: Полученные от параметра 'findfunc' данные не ÑвлÑÑŽÑ‚ÑÑ Ñ‚Ð¸Ð¿Ð¾Ð¼ List" -#, c-format -msgid "E1515: Unable to convert from '%s' encoding" -msgstr "E1515: Ðе удалоÑÑŒ выполнить преобразование Ð´Ð»Ñ ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²ÐºÐ¸ '%s'" - -#, c-format -msgid "E1516: Unable to convert to '%s' encoding" -msgstr "E1516: Ðе удалоÑÑŒ выполнить преобразование из кодировки '%s'" - -msgid "E1517: Can only compare Tuple with Tuple" -msgstr "" -"E1517: Операции ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ Ð´Ð»Ñ Ñ‚Ð¸Ð¿Ð° Tuple допуÑтимы только Ñ Ñ‚Ð¸Ð¿Ð¾Ð¼ Tuple" - -msgid "E1518: Invalid operation for Tuple" -msgstr "E1518: ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ Ð¾Ð¿ÐµÑ€Ð°Ñ†Ð¸Ñ Ð´Ð»Ñ Tuple" - -#, c-format -msgid "E1519: Tuple index out of range: %ld" -msgstr "E1519: Выход за границы диапазона данных тип Tuple Ð´Ð»Ñ Ð¸Ð½Ð´ÐµÐºÑа %ld" - -msgid "E1520: Using a Tuple as a Number" -msgstr "E1520: ОжидалÑÑ Ñ‚Ð¸Ð¿ данных Tuple, а получен Number" - -msgid "E1521: Using a Tuple as a Float" -msgstr "E1521: ОжидалÑÑ Ñ‚Ð¸Ð¿ данных Tuple, а получен Float" - -msgid "E1522: Using a Tuple as a String" -msgstr "E1522: ОжидалÑÑ Ñ‚Ð¸Ð¿ данных Tuple, а получен String" - -msgid "E1523: String, List, Tuple or Blob required" -msgstr "E1523: Тип данных должен быть String, List, Tuple или BLOB" - -#, c-format -msgid "E1524: Cannot use a tuple with function %s" -msgstr "E1524: Ðе допуÑкаетÑÑ Ð¸Ñпользовать кортежи в функции %s" - -#, c-format -msgid "E1525: Argument of %s must be a List, Tuple, String, Dictionary or Blob" -msgstr "" -"E1525: Ð’ функции %s тип аргумента должен быть List, Tuple, String, Dictionary" -" или BLOB" - -#, c-format -msgid "E1526: Missing end of Tuple ')': %s" -msgstr "E1526: Ðе указана Ð·Ð°ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ ÐºÑ€ÑƒÐ³Ð»Ð°Ñ Ñкобка в данных тип Tuple %s" - -#, c-format -msgid "E1527: Missing comma in Tuple: %s" -msgstr "" -"E1527: Ð’ данных тип Tuple не указан Ñимвол запÑтаÑ, как разделитель " -"Ñлементов %s" - -#, c-format -msgid "E1528: List or Tuple or Blob required for argument %d" -msgstr "E1528: Тип данных аргумента номер %d должен быть List, Tuple или BLOB" - -#, c-format -msgid "E1529: List or Tuple required for argument %d" -msgstr "E1529: Тип данных аргумента номер %d должен быть List или Tuple" - -#, c-format -msgid "E1530: List or Tuple or Dictionary required for argument %d" -msgstr "" -"E1530: Тип данных аргумента номер %d должен быть List, Tuple или Dictionary" - -#, c-format -msgid "E1531: Argument of %s must be a List, Tuple, Dictionary or Blob" -msgstr "" -"E1531: Ð’ функции %s тип аргумента должен быть List, Tuple, Dictionary или " -"BLOB" - -msgid "E1532: Cannot modify a tuple" -msgstr "E1532: Ðе допуÑкаетÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ кортежей" - -msgid "E1533: Cannot slice a tuple" -msgstr "E1533: Ðе допуÑкаетÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ðµ диапазона Ð´Ð»Ñ ÐºÐ¾Ñ€Ñ‚ÐµÐ¶ÐµÐ¹" - -#, c-format -msgid "E1534: Tuple required for argument %d" -msgstr "E1534: Тип данных аргумента номер %d должен быть Tuple" - -msgid "E1535: List or Tuple required" -msgstr "E1535: Тип данных должен быть List или Tuple" - -msgid "E1536: Tuple required" -msgstr "E1536: Тип данных должен быть Tuple" - -msgid "E1537: Less targets than Tuple items" -msgstr "E1537: КоличеÑтво переменных меньше количеÑтва Ñлементов кортежа" - -msgid "E1538: More targets than Tuple items" -msgstr "E1538: КоличеÑтво переменных больше количеÑтва Ñлементов кортежа" - -#, c-format -msgid "E1539: Variadic tuple must end with a list type: %s" -msgstr "E1539: Вариационный кортеж должен заканчиватьÑÑ Ñ‚Ð¸Ð¿Ð¾Ð¼ данных List %s" - -msgid "E1540: Cannot use a variadic tuple in concatenation" -msgstr "E1540: Ðе допуÑкаетÑÑ Ð¾Ð±ÑŠÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ðµ вариационных кортежей" - -msgid "E1541: Value too large, max Unicode codepoint is U+10FFFF" -msgstr "" -"E1541: Значение превышает допуÑтимую величину кодовой позиции Юникода " -"U+10FFFF" - # #Restorer: выводитÑÑ, например, по команде `CTRL+g`, `g CTRL+g` и Ñ‚. п. msgid "--No lines in buffer--" msgstr "-- Буфер не Ñодержит текÑÑ‚ --" @@ -10465,18 +10337,19 @@ msgstr "произошёл Ñбой при Ñмене каталога" #, c-format msgid "expected 3-tuple as imp.find_module() result, but got %s" msgstr "" -"результат функции imp.find_module() кортеж из трёх Ñлементов, а получен %s" +"результат функции imp.find_module() неизменÑемый ÑпиÑок из трёх Ñлементов, а " +"получен %s" #, c-format msgid "expected 3-tuple as imp.find_module() result, but got tuple of size %d" msgstr "" -"результат функции imp.find_module() кортеж из трёх Ñлементов, а получено " -"Ñлементов %d" +"результат функции imp.find_module() неизменÑемый ÑпиÑок из трёх Ñлементов, а " +"получено Ñлементов %d" msgid "internal error: imp.find_module returned tuple with NULL" msgstr "" -"внутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Результат функции imp.find_module() кортеж Ñ Ð½ÑƒÐ»ÐµÐ²Ñ‹Ð¼ " -"количеÑтвом Ñлементов" +"внутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°. Результат функции imp.find_module() неизменÑемый ÑпиÑок " +"без Ñлементов" msgid "cannot delete vim.Dictionary attributes" msgstr "ÑвойÑтва объекта vim.Dictionary не могут быть удалены" @@ -10540,19 +10413,6 @@ msgstr "ÑвойÑтва объекта vim.List не могут быть уда msgid "cannot modify fixed list" msgstr "ÑоÑтоÑние блокировки объекта не может быть изменено" -msgid "tuple constructor does not accept keyword arguments" -msgstr "" -"не допуÑкаетÑÑ Ð¸Ñпользовать в конÑтрукторе кортежа зарезервированные Ñлова" - -msgid "tuple index out of range" -msgstr "Ð¸Ð½Ð´ÐµÐºÑ ÐºÐ¾Ñ€Ñ‚ÐµÐ¶Ð° выходит за границы диапазона" - -msgid "cannot delete vim.Tuple attributes" -msgstr "ÑвойÑтва объекта vim.Tuple не могут быть удалены" - -msgid "cannot modify fixed tuple" -msgstr "не допуÑкаетÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ фикÑированного кортежа" - #, c-format msgid "unnamed function %s does not exist" msgstr "не ÑущеÑтвует безымÑнной функции %s" @@ -10842,7 +10702,7 @@ msgid "nroff macro names that separate sections" msgstr "разделитель параграфов в терминах макроÑзыка nroff" msgid "list of directory names used for file searching" -msgstr "каталоги в которых выполнÑетÑÑ Ð¿Ð¾Ð¸Ñк файлов" +msgstr "каталоги, в которых выполнÑетÑÑ Ð¿Ð¾Ð¸Ñк файлов" msgid ":cd without argument goes to the home directory" msgstr "" @@ -10905,7 +10765,7 @@ msgid "tags" msgstr "ИндекÑирование" msgid "use binary searching in tags files" -msgstr "иÑпользовать Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² индекÑов бинарный поиÑк" +msgstr "иÑпользовать Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка в файлах индекÑов бинарный поиÑк" msgid "number of significant characters in a tag name or zero" msgstr "" @@ -10982,13 +10842,13 @@ msgstr "" "параметре 'breakat'" msgid "preserve indentation in wrapped text" -msgstr "Ñохранение отÑтупов при переноÑе длинных Ñтрок" +msgstr "при разбивке длинных Ñтрок Ñохранить отÑтупы" msgid "adjust breakindent behaviour" msgstr "наÑтройки, иÑпользуемые Ð´Ð»Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° 'breakindent'" msgid "which characters might cause a line break" -msgstr "Ñимволы, поÑле которых может выполнÑтьÑÑ Ñ€Ð°Ð·Ð±Ð¸Ð²ÐºÐ° Ñтрок" +msgstr "Ñимволы, поÑле которых выполнÑетÑÑ Ñ€Ð°Ð·Ð±Ð¸Ð²ÐºÐ° длинных Ñтрок" msgid "string to put before wrapped screen lines" msgstr "" @@ -11092,10 +10952,10 @@ msgid "use GUI colors for the terminal" msgstr "иÑпользовать группы подÑветки ГИП Ð´Ð»Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð°" msgid "highlight the screen column of the cursor" -msgstr "подÑветка Ñтолбца Ñкрана в котором находитÑÑ ÐºÐ°Ñ€ÐµÑ‚ÐºÐ°" +msgstr "подÑветка Ñтолбца в позиции каретки" msgid "highlight the screen line of the cursor" -msgstr "подÑветка Ñтроки Ñкрана в которой находитÑÑ ÐºÐ°Ñ€ÐµÑ‚ÐºÐ°" +msgstr "подÑветка Ñтроки в позиции каретки" msgid "specifies which area 'cursorline' highlights" msgstr "облаÑть подÑветки, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð¿Ñ€Ð¸ включённом 'cursorline'" @@ -11107,7 +10967,7 @@ msgid "highlight spelling mistakes" msgstr "подÑвечивать Ñлова Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°Ð¼Ð¸ напиÑаниÑ" msgid "list of accepted languages" -msgstr "Ñзыки Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… будет выполнÑтьÑÑ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ° правопиÑаниÑ" +msgstr "Ñзыки, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… будет выполнÑтьÑÑ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ° правопиÑаниÑ" msgid "file that \"zg\" adds good words to" msgstr "Ñловарь пользователÑ, иÑпользуемый Ð´Ð»Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ‹ `zg`" @@ -11271,11 +11131,11 @@ msgid "terminal connection is fast" msgstr "Ñоединение Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð¾Ð¼ ÑвлÑетÑÑ Ð²Ñ‹ÑокоÑкороÑтным" msgid "request terminal key codes when an xterm is detected" -msgstr "Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð´ÐµÐ¹Ñтвующих параметров терминала при обнаружении xterm" +msgstr "Ð·Ð°Ð¿Ñ€Ð¾Ñ ÐºÐ¾Ð´Ð¾Ð² клавиш при обнаружении терминала xterm" # ~!: Matvey Tarasov msgid "terminal that requires extra redrawing" -msgstr "терминал, требующий дополнительную прориÑовку текÑта" +msgstr "терминал, требующий дополнительную отриÑовку текÑта" msgid "what keyboard protocol to use for which terminal" msgstr "иÑпользуемый терминалом протокол обмена данных Ñ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ð¾Ð¹" @@ -11336,7 +11196,7 @@ msgstr "" "указатель «мыши»" msgid "hide the mouse pointer while typing" -msgstr "Ñкрывать указатель «мыши» при наборе текÑта" +msgstr "Ñкрыть указатель «мыши» при наборе текÑта" msgid "report mouse movement events" msgstr "активировать оповещение по Ñобытию Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ Â«Ð¼Ñ‹ÑˆÐ¸Â»" @@ -11363,13 +11223,13 @@ msgid "GUI" msgstr "ГрафичеÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ" msgid "list of font names to be used in the GUI" -msgstr "шрифты иÑпользуемые в графичеÑком интерфейÑе" +msgstr "шрифты, иÑпользуемые в графичеÑком интерфейÑе" msgid "pair of fonts to be used, for multibyte editing" -msgstr "пары шрифтов иÑпользуемые при многобайтовой кодировке" +msgstr "пары шрифтов, иÑпользуемые при многобайтовой кодировке" msgid "list of font names to be used for double-wide characters" -msgstr "шрифты иÑпользуемые при отображении Ñимволов двойной ширины" +msgstr "шрифты, иÑпользуемые при отображении Ñимволов двойной ширины" msgid "use smooth, antialiased fonts" msgstr "иÑпользовать шрифты Ñо «Ñглаживанием»" @@ -11386,7 +11246,7 @@ msgid "size of toolbar icons" msgstr "размер значков на панели инÑтрументов" msgid "room (in pixels) left above/below the window" -msgstr "облаÑть Ñкрана (в пикÑелÑÑ…), оÑтающаÑÑÑ Ð½Ðµ занÑтой окном программы" +msgstr "облаÑть Ñкрана, оÑтающаÑÑÑ Ð½Ðµ занÑтой окном программы (в пикÑелÑÑ…)" msgid "list of ASCII characters that can be combined into complex shapes" msgstr "перечень Ñимволов кодировки ASCII, иÑпользуемых в ÑоÑтавных Ñимволах" @@ -11424,10 +11284,10 @@ msgid "delay in milliseconds before a balloon may pop up" msgstr "задержка в Ð¼Ñ Ð¿ÐµÑ€ÐµÐ´ отображением вÑплывающей выноÑки" msgid "use balloon evaluation in the GUI" -msgstr "включение вÑплывающих выноÑок в графичеÑком интерфейÑе" +msgstr "иÑпользовать вÑплывающие выноÑки в графичеÑком интерфейÑе" msgid "use balloon evaluation in the terminal" -msgstr "включение вÑплывающих выноÑок в окне терминала" +msgstr "иÑпользовать вÑплывающие выноÑки в окне терминала" msgid "expression to show in balloon eval" msgstr "функциÑ, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð²Ñплывающей выноÑки" @@ -11457,7 +11317,7 @@ msgid "the CJK character set to be used for CJK output from :hardcopy" msgstr "набор Ñимволов, иÑпользуемый при печати ККЯ Ñзыков" msgid "list of font names to be used for CJK output from :hardcopy" -msgstr "шрифты иÑпользуемые при печати ККЯ Ñзыков" +msgstr "шрифты, иÑпользуемые при печати ККЯ Ñзыков" msgid "messages and info" msgstr "Отображение информации и Ñообщений программы" @@ -11468,14 +11328,14 @@ msgstr "" "(не Ñообщать о доÑтижении границ документа при поиÑке)" msgid "list of flags to make messages shorter" -msgstr "флаги, задающие количеÑтво отображаемых Ñообщений программы" +msgstr "флаги, управлÑющие количеÑтвом отображаемых Ñообщений программы" -msgid "options for outputting messages" -msgstr "наÑтройки, иÑпользуемые Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° Ñообщений" +msgid "how many messages are remembered" +msgstr "количеÑтво запоминаемых Ñообщений" msgid "show (partial) command keys in location given by 'showcmdloc'" msgstr "" -"отображать набираемые команды в меÑте которое указанно в параметре\n" +"отображение набранных команд там, где указанно в параметре\n" "'showcmdloc'" msgid "location where to show the (partial) command keys for 'showcmd'" @@ -11598,11 +11458,6 @@ msgstr "функциÑ, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð´Ð»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½ msgid "specifies how Insert mode completion works for CTRL-N and CTRL-P" msgstr "работа команд CTRL+N и CTRL+P при подÑтановке в режиме вÑтавки" -msgid "use fuzzy collection for specific completion modes" -msgstr "" -" \n" -"иÑпользовать неполные коллекции Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ñ… режимов подÑтановки" - msgid "whether to use a popup menu for Insert mode completion" msgstr "иÑпользовать вÑплывающее меню при подÑтановке в режиме вÑтавки" @@ -11618,9 +11473,6 @@ msgstr "макÑÐ¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð²Ñ‹Ñота вÑплывающего меню msgid "minimum width of the popup menu" msgstr "Ð¼Ð¸Ð½Ð¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ ÑˆÐ¸Ñ€Ð¸Ð½Ð° вÑплывающего меню при подÑтановке" -msgid "maximum width of the popup menu" -msgstr "макÑÐ¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ ÑˆÐ¸Ñ€Ð¸Ð½Ð° вÑплывающего меню при подÑтановке" - msgid "user defined function for Insert mode completion" msgstr "пользовательÑÐºÐ°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð¿Ñ€Ð¸ подÑтановке в режиме вÑтавки" @@ -11828,7 +11680,7 @@ msgid "options for using diff mode" msgstr "наÑтройки, иÑпользуемые Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° Ñверки различий" msgid "expression used to obtain a diff file" -msgstr "функциÑ, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° различий" +msgstr "функциÑ, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° различий" msgid "expression used to patch a file" msgstr "функциÑ, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð´Ð»Ñ Ð²Ð½ÐµÑÐµÐ½Ð¸Ñ Ð¸Ñправлений в файл" @@ -11906,13 +11758,13 @@ msgstr "Ñоздавать резервную копию файла поÑле msgid "patterns that specify for which files a backup is not made" msgstr "" -"не Ñоздавать резервные копии Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð², которые ÑоответÑтвуют\n" -"заданным шаблонам" +"шаблоны, указывающие, Ð´Ð»Ñ ÐºÐ°ÐºÐ¸Ñ… файлов не Ñоздавать резервные\n" +"копии" msgid "whether to make the backup as a copy or rename the existing file" msgstr "" -"метод ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ñ€ÐµÐ·ÐµÑ€Ð²Ð½Ð¾Ð¹ копии — или копированием,\n" -"или переименованием файла" +"метод ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ñ€ÐµÐ·ÐµÑ€Ð²Ð½Ð¾Ð¹ копии — или копированием, или переименованием\n" +"файла" msgid "list of directories to put backup files in" msgstr "каталоги, в которых могут размещатьÑÑ Ñ€ÐµÐ·ÐµÑ€Ð²Ð½Ñ‹Ðµ копии файла" @@ -12130,7 +11982,7 @@ msgid "specifies printable characters" msgstr "задаёт печатаемые Ñимволы" msgid "specifies escape characters in a string" -msgstr "задаёт Ñкранирующие Ñимволы иÑпользуемые в Ñтроке" +msgstr "задаёт Ñкранирующие Ñимволы, иÑпользуемые в Ñтроке" msgid "display the buffer right-to-left" msgstr "отображать Ñодержимое буфера Ñправа налево" @@ -12254,11 +12106,6 @@ msgstr "" msgid "list of autocommand events which are to be ignored" msgstr "перечень Ñобытий, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… не будут иÑполнÑтьÑÑ Ð°Ð²Ñ‚Ð¾ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ‹" -msgid "list of autocommand events which are to be ignored in a window" -msgstr "" -"перечень Ñобытий, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… не будут иÑполнÑтьÑÑ Ð°Ð²Ñ‚Ð¾ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ‹\n" -"в указанном окне буфера" - msgid "load plugin scripts when starting up" msgstr "загружать подключаемые модули при запуÑке программы" diff --git a/src/popupmenu.c b/src/popupmenu.c index 4aaddaf8..443223de 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -115,8 +115,6 @@ pum_display( do { def_width = p_pw; - if (p_pmw > 0 && def_width > p_pmw) - def_width = p_pmw; above_row = 0; below_row = cmdline_row; @@ -228,8 +226,6 @@ pum_display( pum_size = size; pum_compute_size(); max_width = pum_base_width; - if (p_pmw > 0 && max_width > p_pmw) - max_width = p_pmw; // Calculate column if (State == MODE_CMDLINE) @@ -279,12 +275,8 @@ pum_display( content_width = max_width + pum_kind_width + pum_extra_width + 1; if (pum_width > content_width && pum_width > p_pw) - { // Reduce width to fit item - pum_width = MAX(content_width, p_pw); - if (p_pmw > 0 && pum_width > p_pmw) - pum_width = p_pmw; - } + pum_width = MAX(content_width , p_pw); else if (((cursor_col > p_pw || cursor_col > max_width) #ifdef FEAT_RIGHTLEFT && !pum_rl) @@ -321,8 +313,6 @@ pum_display( if (pum_width < p_pw) { pum_width = p_pw; - if (p_pmw > 0 && pum_width > p_pmw) - pum_width = p_pmw; #ifdef FEAT_RIGHTLEFT if (pum_rl) { @@ -337,15 +327,7 @@ pum_display( } } else if (pum_width > content_width && pum_width > p_pw) - { pum_width = MAX(content_width, p_pw); - if (p_pmw > 0 && pum_width > p_pmw) - pum_width = p_pmw; - } - else if (p_pmw > 0 && pum_width > p_pmw) - { - pum_width = p_pmw; - } } } @@ -359,15 +341,11 @@ pum_display( #endif pum_col = 0; pum_width = Columns - 1; - if (p_pmw > 0 && pum_width > p_pmw) - pum_width = p_pmw; } else { if (max_width > p_pw) max_width = p_pw; // truncate - if (p_pmw > 0 && max_width > p_pmw) - max_width = p_pmw; #ifdef FEAT_RIGHTLEFT if (pum_rl) pum_col = max_width - 1; @@ -478,7 +456,7 @@ pum_compute_text_attrs(char_u *text, hlf_T hlf, int user_hlattr) else { if (matched_len < 0 && MB_STRNICMP(ptr, leader, leader_len) == 0) - matched_len = (int)leader_len; + matched_len = leader_len; if (matched_len > 0) { new_attr = highlight_attr[is_select ? HLF_PMSI : HLF_PMNI]; @@ -574,301 +552,6 @@ pum_user_attr_combine(int idx, int type, int attr) return user_attr[type] > 0 ? hl_combine_attr(attr, user_attr[type]) : attr; } -#ifdef FEAT_RIGHTLEFT -/* - * Display RTL text with proper attributes in the popup menu. - * Returns the adjusted column position after drawing. - */ - static int -pum_display_rtl_text( - int row, - int col, - char_u *st, - int attr, - int *attrs, - int width, - int width_limit, - int totwidth, - int next_isempty) -{ - char_u *rt; - int cells; - int over_cell = 0; - int truncated = FALSE; - int pad = next_isempty ? 0 : 2; - int remaining; - int truncrl = curwin->w_fill_chars.truncrl != NUL - ? curwin->w_fill_chars.truncrl : '<'; - - if (st == NULL) - return col; - - rt = reverse_text(st); - if (rt == NULL) - { - VIM_CLEAR(st); - return col; - } - - char_u *rt_start = rt; - cells = mb_string2cells(rt, -1); - truncated = width_limit == p_pmw && width_limit - totwidth < cells + pad; - - // only draw the text that fits - if (cells > width_limit) - { - do - { - cells -= has_mbyte ? (*mb_ptr2cells)(rt) : 1; - MB_PTR_ADV(rt); - } while (cells > width_limit); - - if (cells < width_limit) - { - // Most left character requires 2-cells - // but only 1 cell is available on screen. - // Put a '<' on the left of the pum item. - *(--rt) = '<'; - cells++; - } - } - - if (truncated) - { - char_u *orig_rt = rt; - int size = 0; - - remaining = width_limit - totwidth - 1; - cells = mb_string2cells(rt, -1); - if (cells > remaining) - { - while (cells > remaining) - { - MB_PTR_ADV(orig_rt); - cells -= has_mbyte ? (*mb_ptr2cells)(orig_rt) : 1; - } - } - size = (int)STRLEN(orig_rt); - if (cells < remaining) - over_cell = remaining - cells; - - cells = mb_string2cells(orig_rt, size); - width = cells + over_cell + 1; - rt = orig_rt; - - screen_putchar(truncrl, row, col - width + 1, attr); - - if (over_cell > 0) - screen_fill(row, row + 1, col - width + 2, - col - width + 2 + over_cell, ' ', ' ', attr); - } - - if (attrs == NULL) - screen_puts_len(rt, (int)STRLEN(rt), row, col - cells + 1, attr); - else - pum_screen_puts_with_attrs(row, col - cells + 1, cells, rt, - (int)STRLEN(rt), attrs); - - vim_free(rt_start); - VIM_CLEAR(st); - return col - width; -} -#endif - -/* - * Display LTR text with proper attributes in the popup menu. - * Returns the adjusted column position after drawing. - */ - static int -pum_display_ltr_text( - int row, - int col, - char_u *st, - int attr, - int *attrs, - int width, // width already calculated in outer loop - int width_limit, - int totwidth, - int next_isempty) -{ - int size; - int cells; - char_u *st_end = NULL; - int over_cell = 0; - int pad = next_isempty ? 0 : 2; - int truncated; - int remaining; - int trunc = curwin->w_fill_chars.trunc != NUL - ? curwin->w_fill_chars.trunc : '>'; - - if (st == NULL) - return col; - - size = (int)STRLEN(st); - cells = (*mb_string2cells)(st, size); - truncated = width_limit == p_pmw && width_limit - totwidth < cells + pad; - - // only draw the text that fits - while (size > 0 && col + cells > width_limit + pum_col) - { - --size; - if (has_mbyte) - { - size -= (*mb_head_off)(st, st + size); - cells -= (*mb_ptr2cells)(st + size); - } - else - --cells; - } - - // truncated - if (truncated) - { - remaining = width_limit - totwidth - 1; - if (cells > remaining) - { - st_end = st + size; - while (st_end > st && cells > remaining) - { - MB_PTR_BACK(st, st_end); - cells -= has_mbyte ? (*mb_ptr2cells)(st_end) : 1; - } - size = st_end - st; - } - - if (cells < remaining) - over_cell = remaining - cells; - cells = mb_string2cells(st, size); - width = cells + over_cell + 1; - } - - if (attrs == NULL) - screen_puts_len(st, size, row, col, attr); - else - pum_screen_puts_with_attrs(row, col, cells, st, size, attrs); - - if (truncated) - { - if (over_cell > 0) - screen_fill(row, row + 1, col + cells, - col + cells + over_cell, ' ', ' ', attr); - - screen_putchar(trunc, row, col + cells + over_cell, attr); - } - - VIM_CLEAR(st); - return col + width; -} - - -/* - * Process and display a single popup menu item (text/kind/extra). - * Returns the new column position after drawing. - */ - static int -pum_process_item( - int row, - int col, - int idx, - int j, // Current position in order array - int *order, // Order array - hlf_T hlf, - int attr, - int *totwidth_ptr, - int next_isempty) -{ - int item_type = order[j]; - char_u *s = NULL; - char_u *p = pum_get_item(idx, item_type); - int width = 0; // item width - int w; // char width - - for ( ; ; MB_PTR_ADV(p)) - { - if (s == NULL) - s = p; - w = ptr2cells(p); - if (*p != NUL && *p != TAB && *totwidth_ptr + w <= pum_width) - { - width += w; - continue; - } - - // Display the text that fits or comes before a Tab. - // First convert it to printable characters. - char_u *st; - int *attrs = NULL; - int saved = *p; - - if (saved != NUL) - *p = NUL; - st = transstr(s); - if (saved != NUL) - *p = saved; - - if (item_type == CPT_ABBR) - attrs = pum_compute_text_attrs(st, hlf, - pum_array[idx].pum_user_abbr_hlattr); -#ifdef FEAT_RIGHTLEFT - if (pum_rl) - col = pum_display_rtl_text(row, col, st, attr, attrs, - width, pum_width, *totwidth_ptr, next_isempty); - else -#endif - col = pum_display_ltr_text(row, col, st, attr, attrs, - width, pum_width, *totwidth_ptr, next_isempty); - - if (attrs != NULL) - VIM_CLEAR(attrs); - - if (*p != TAB) - break; - - // Display two spaces for a Tab. -#ifdef FEAT_RIGHTLEFT - if (pum_rl) - { - screen_puts_len((char_u *)" ", 2, row, col - 1, attr); - col -= 2; - } - else -#endif - { - screen_puts_len((char_u *)" ", 2, row, col, attr); - col += 2; - } - *totwidth_ptr += 2; - s = NULL; // start text at next char - width = 0; - } - - return col; -} - -/* - * Draw the scrollbar for the popup menu. - */ - static void -pum_draw_scrollbar( - int row, - int i, - int thumb_pos, - int thumb_height) -{ - if (pum_scrollbar <= 0) - return; - - int attr = (i >= thumb_pos && i < thumb_pos + thumb_height) ? - highlight_attr[HLF_PST] : highlight_attr[HLF_PSB]; - -#ifdef FEAT_RIGHTLEFT - if (pum_rl) - screen_putchar(' ', row, pum_col - pum_width, attr); - else -#endif - screen_putchar(' ', row, pum_col + pum_width, attr); -} - /* * Redraw the popup menu, using "pum_first" and "pum_selected". */ @@ -877,13 +560,16 @@ pum_redraw(void) { int row = pum_row; int col; + int attr_scroll = highlight_attr[HLF_PSB]; + int attr_thumb = highlight_attr[HLF_PST]; hlf_T *hlfs; // array used for highlights hlf_T hlf; int attr; int i, j; int idx; + char_u *s; char_u *p = NULL; - int totwidth; + int totwidth, width, w; // total-width item-width char-width int thumb_pos = 0; int thumb_height = 1; int item_type; @@ -971,21 +657,148 @@ pum_redraw(void) orig_attr = attr; if (item_type < 2) // try combine attr with user custom attr = pum_user_attr_combine(idx, item_type, attr); + width = 0; + s = NULL; p = pum_get_item(idx, item_type); + if (p != NULL) + for ( ; ; MB_PTR_ADV(p)) + { + if (s == NULL) + s = p; + w = ptr2cells(p); + if (*p != NUL && *p != TAB && totwidth + w <= pum_width) + { + width += w; + continue; + } - if (j + 1 < 3) - next_isempty = pum_get_item(idx, order[j + 1]) == NULL; + // Display the text that fits or comes before a Tab. + // First convert it to printable characters. + char_u *st; + int *attrs = NULL; + int saved = *p; + + if (saved != NUL) + *p = NUL; + st = transstr(s); + if (saved != NUL) + *p = saved; + + if (item_type == CPT_ABBR) + attrs = pum_compute_text_attrs(st, hlf, + pum_array[idx].pum_user_abbr_hlattr); +#ifdef FEAT_RIGHTLEFT + if (pum_rl) + { + if (st != NULL) + { + char_u *rt = reverse_text(st); + + if (rt != NULL) + { + char_u *rt_start = rt; + int cells; + + cells = vim_strsize(rt); + if (cells > pum_width) + { + do + { + cells -= has_mbyte + ? (*mb_ptr2cells)(rt) : 1; + MB_PTR_ADV(rt); + } while (cells > pum_width); + + if (cells < pum_width) + { + // Most left character requires 2-cells + // but only 1 cell is available on + // screen. Put a '<' on the left of + // the pum item. + *(--rt) = '<'; + cells++; + } + } + + if (attrs == NULL) + screen_puts_len(rt, (int)STRLEN(rt), row, + col - cells + 1, attr); + else + pum_screen_puts_with_attrs(row, + col - cells + 1, cells, rt, + (int)STRLEN(rt), attrs); + + vim_free(rt_start); + } + vim_free(st); + } + col -= width; + } + else +#endif + { + if (st != NULL) + { + int size = (int)STRLEN(st); + int cells = (*mb_string2cells)(st, size); + + // only draw the text that fits + while (size > 0 + && col + cells > pum_width + pum_col) + { + --size; + if (has_mbyte) + { + size -= (*mb_head_off)(st, st + size); + cells -= (*mb_ptr2cells)(st + size); + } + else + --cells; + } + + if (attrs == NULL) + screen_puts_len(st, size, row, col, attr); + else + pum_screen_puts_with_attrs(row, col, cells, + st, size, attrs); + + vim_free(st); + } + col += width; + } - if (p != NULL) - // Process and display the item - col = pum_process_item(row, col, idx, j, order, hlf, attr, - &totwidth, next_isempty); + if (attrs != NULL) + VIM_CLEAR(attrs); + + if (*p != TAB) + break; + + // Display two spaces for a Tab. +#ifdef FEAT_RIGHTLEFT + if (pum_rl) + { + screen_puts_len((char_u *)" ", 2, row, col - 1, attr); + col -= 2; + } + else +#endif + { + screen_puts_len((char_u *)" ", 2, row, col, attr); + col += 2; + } + totwidth += 2; + s = NULL; // start text at next char + width = 0; + } if (j > 0) n = items_width_array[order[1]] + (last_isabbr ? 0 : 1); else n = order[j] == CPT_ABBR ? 1 : 0; + if (j + 1 < 3) + next_isempty = pum_get_item(idx, order[j + 1]) == NULL; + // Stop when there is nothing more to display. if (j == 2 || (next_isempty && (j == 1 || (j == 0 @@ -1017,7 +830,19 @@ pum_redraw(void) #endif screen_fill(row, row + 1, col, pum_col + pum_width, ' ', ' ', orig_attr); - pum_draw_scrollbar(row, i, thumb_pos, thumb_height); + if (pum_scrollbar > 0) + { +#ifdef FEAT_RIGHTLEFT + if (pum_rl) + screen_putchar(' ', row, pum_col - pum_width, + i >= thumb_pos && i < thumb_pos + thumb_height + ? attr_thumb : attr_scroll); + else +#endif + screen_putchar(' ', row, pum_col + pum_width, + i >= thumb_pos && i < thumb_pos + thumb_height + ? attr_thumb : attr_scroll); + } ++row; } diff --git a/src/popupwin.c b/src/popupwin.c index 60a54d78..76ebf38e 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -40,11 +40,11 @@ static int message_win_time = 3000; // hit-enter prompt. static int start_message_win_timer = FALSE; +static int popup_on_cmdline = FALSE; + static void may_start_message_win_timer(win_T *wp); #endif -static int popup_on_cmdline = FALSE; - static void popup_adjust_position(win_T *wp); /* @@ -3592,8 +3592,8 @@ popup_do_filter(int c) { popup_reset_handled(POPUP_HANDLED_2); wp = find_next_popup(FALSE, POPUP_HANDLED_2); - if (wp != NULL) - { + if (wp != NULL) + { popup_close_with_retval(wp, -1); res = TRUE; } @@ -4416,13 +4416,13 @@ set_ref_in_one_popup(win_T *wp, int copyID) { tv.v_type = VAR_PARTIAL; tv.vval.v_partial = wp->w_close_cb.cb_partial; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); } if (wp->w_filter_cb.cb_partial != NULL) { tv.v_type = VAR_PARTIAL; tv.vval.v_partial = wp->w_filter_cb.cb_partial; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); } abort = abort || set_ref_in_list(wp->w_popup_mask, copyID); return abort; @@ -4586,6 +4586,15 @@ popup_hide_info(void) } } +/* + * Returns TRUE if a popup extends into the cmdline area. + */ + int +popup_overlaps_cmdline(void) +{ + return popup_on_cmdline; +} + /* * Close any info popup. */ @@ -4599,15 +4608,6 @@ popup_close_info(void) } #endif -/* - * Returns TRUE if a popup extends into the cmdline area. - */ - int -popup_overlaps_cmdline(void) -{ - return popup_on_cmdline; -} - #if defined(HAS_MESSAGE_WINDOW) || defined(PROTO) /* diff --git a/src/profiler.c b/src/profiler.c index 00da9b64..504d7136 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -8,7 +8,7 @@ */ /* - * profiler.c: Vim script profiler + * profiler.c: vim script profiler */ #include "vim.h" diff --git a/src/proto.h b/src/proto.h index a5ca9e4e..091e0935 100644 --- a/src/proto.h +++ b/src/proto.h @@ -140,7 +140,6 @@ void siemsg(const char *, ...) ATTRIBUTE_COLD ATTRIBUTE_FORMAT_PRINTF(1, 2); int vim_snprintf_add(char *, size_t, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4); int vim_snprintf(char *, size_t, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4); -size_t vim_snprintf_safelen(char *, size_t, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4); int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) ATTRIBUTE_FORMAT_PRINTF(3, 0); @@ -208,7 +207,6 @@ void mbyte_im_set_active(int active_arg); # include "textobject.pro" # include "textformat.pro" # include "time.pro" -# include "tuple.pro" # include "typval.pro" # include "ui.pro" # include "undo.pro" diff --git a/src/proto/autocmd.pro b/src/proto/autocmd.pro index ce1f7591..ff42b600 100644 --- a/src/proto/autocmd.pro +++ b/src/proto/autocmd.pro @@ -5,8 +5,8 @@ void do_augroup(char_u *arg, int del_group); void autocmd_init(void); void free_all_autocmds(void); int is_aucmd_win(win_T *win); -int event_ignored(event_T event, char_u *ei); int check_ei(char_u *ei); +int event_ignored(event_T event, char_u *ei); char_u *au_event_disable(char *what); void au_event_restore(char_u *old_ei); void do_autocmd(exarg_T *eap, char_u *arg_in, int forceit); @@ -41,11 +41,11 @@ int has_autocmd(event_T event, char_u *sfname, buf_T *buf); char_u *get_augroup_name(expand_T *xp, int idx); char_u *set_context_in_autocmd(expand_T *xp, char_u *arg, int doautocmd); char_u *get_event_name(expand_T *xp, int idx); -char_u *get_event_name_no_group(expand_T *xp, int idx, int win); -int has_tabclosedpre(void); +char_u *get_event_name_no_group(expand_T *xp, int idx, int eiw); int autocmd_supported(char_u *name); int au_exists(char_u *arg); void f_autocmd_add(typval_T *argvars, typval_T *rettv); void f_autocmd_delete(typval_T *argvars, typval_T *rettv); void f_autocmd_get(typval_T *argvars, typval_T *rettv); +int has_tabclosedpre(void); /* vim: set ft=c : */ diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro index 9044bae8..5491940d 100644 --- a/src/proto/buffer.pro +++ b/src/proto/buffer.pro @@ -70,4 +70,5 @@ char_u *buf_get_fname(buf_T *buf); void set_buflisted(int on); int buf_contents_changed(buf_T *buf); void wipe_buffer(buf_T *buf, int aucmd); +int buf_locked(buf_T *buf); /* vim: set ft=c : */ diff --git a/src/proto/charset.pro b/src/proto/charset.pro index c9af1b0d..bf1fc102 100644 --- a/src/proto/charset.pro +++ b/src/proto/charset.pro @@ -1,7 +1,7 @@ /* charset.c */ int init_chartab(void); int buf_init_chartab(buf_T *buf, int global); -int check_isopt(char_u *var); +int check_isopt(char_u *isopt); void trans_characters(char_u *buf, int bufsize); char_u *transstr(char_u *s); char_u *str_foldcase(char_u *str, int orglen, char_u *buf, int buflen); diff --git a/src/proto/cmdexpand.pro b/src/proto/cmdexpand.pro index 92e9dcb0..e627639d 100644 --- a/src/proto/cmdexpand.pro +++ b/src/proto/cmdexpand.pro @@ -11,7 +11,6 @@ int cmdline_compl_is_fuzzy(void); char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode); void ExpandInit(expand_T *xp); void ExpandCleanup(expand_T *xp); -void clear_cmdline_orig(void); int showmatches(expand_T *xp, int wildmenu); char_u *addstar(char_u *fname, int len, int context); void set_expand_context(expand_T *xp); @@ -24,5 +23,4 @@ int wildmenu_translate_key(cmdline_info_T *cclp, int key, expand_T *xp, int did_ int wildmenu_process_key(cmdline_info_T *cclp, int key, expand_T *xp); void wildmenu_cleanup(cmdline_info_T *cclp); void f_getcompletion(typval_T *argvars, typval_T *rettv); -void f_cmdcomplete_info(typval_T *argvars UNUSED, typval_T *rettv); /* vim: set ft=c : */ diff --git a/src/proto/diff.pro b/src/proto/diff.pro index d4482b13..5141e370 100644 --- a/src/proto/diff.pro +++ b/src/proto/diff.pro @@ -13,19 +13,15 @@ void ex_diffthis(exarg_T *eap); void diff_win_options(win_T *wp, int addbuf); void ex_diffoff(exarg_T *eap); void diff_clear(tabpage_T *tp); -int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus); int diff_check(win_T *wp, linenr_T lnum); +int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus); int diff_check_fill(win_T *wp, linenr_T lnum); void diff_set_topline(win_T *fromwin, win_T *towin); int diffopt_changed(void); int diffopt_horizontal(void); int diffopt_hiddenoff(void); int diffopt_closeoff(void); -void diff_update_line(linenr_T lnum); -#ifdef FEAT_DIFF -int diff_change_parse( diffline_T *diffline, diffline_change_T *change, int *change_start, int *change_end); -int diff_find_change( win_T *wp, linenr_T lnum, diffline_T *diffline); -#endif +int diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp); int diff_infold(win_T *wp, linenr_T lnum); void nv_diffgetput(int put, long count); void ex_diffgetput(exarg_T *eap); diff --git a/src/proto/eval.pro b/src/proto/eval.pro index 47be0b9a..e945a284 100644 --- a/src/proto/eval.pro +++ b/src/proto/eval.pro @@ -45,7 +45,6 @@ int eval0_retarg(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg, int eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg); void eval_addblob(typval_T *tv1, typval_T *tv2); int eval_addlist(typval_T *tv1, typval_T *tv2); -int eval_addtuple(typval_T *tv1, typval_T *tv2); int eval_leader(char_u **arg, int vim9); int handle_predefined(char_u *s, int len, typval_T *rettv); int check_can_index(typval_T *rettv, int evaluate, int verbose); @@ -74,5 +73,5 @@ int get_echo_attr(void); void ex_execute(exarg_T *eap); char_u *find_option_end(char_u **arg, int *scope); void last_set_msg(sctx_T script_ctx); -char_u *do_string_sub(char_u *str, size_t len, char_u *pat, char_u *sub, typval_T *expr, char_u *flags, size_t *ret_len); +char_u *do_string_sub(char_u *str, size_t str_len, char_u *pat, char_u *sub, typval_T *expr, char_u *flags, size_t *ret_len); /* vim: set ft=c : */ diff --git a/src/proto/evalfunc.pro b/src/proto/evalfunc.pro index 627af17a..a720b643 100644 --- a/src/proto/evalfunc.pro +++ b/src/proto/evalfunc.pro @@ -23,7 +23,6 @@ void execute_common(typval_T *argvars, typval_T *rettv, int arg_off); void f_exists(typval_T *argvars, typval_T *rettv); void f_has(typval_T *argvars, typval_T *rettv); int dynamic_feature(char_u *feature); -int indexof_eval_expr(typval_T *expr); void f_len(typval_T *argvars, typval_T *rettv); void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv); void range_list_materialize(list_T *list); diff --git a/src/proto/filepath.pro b/src/proto/filepath.pro index 66866211..260f4072 100644 --- a/src/proto/filepath.pro +++ b/src/proto/filepath.pro @@ -6,6 +6,7 @@ void f_chdir(typval_T *argvars, typval_T *rettv); void f_delete(typval_T *argvars, typval_T *rettv); void f_executable(typval_T *argvars, typval_T *rettv); void f_exepath(typval_T *argvars, typval_T *rettv); +void f_filecopy(typval_T *argvars, typval_T *rettv); void f_filereadable(typval_T *argvars, typval_T *rettv); void f_filewritable(typval_T *argvars, typval_T *rettv); void f_finddir(typval_T *argvars, typval_T *rettv); @@ -35,7 +36,6 @@ void f_writefile(typval_T *argvars, typval_T *rettv); char_u *do_browse(int flags, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter, buf_T *buf); void f_browse(typval_T *argvars, typval_T *rettv); void f_browsedir(typval_T *argvars, typval_T *rettv); -void f_filecopy(typval_T *argvars, typval_T *rettv); void home_replace(buf_T *buf, char_u *src, char_u *dst, int dstlen, int one); char_u *home_replace_save(buf_T *buf, char_u *src); int fullpathcmp(char_u *s1, char_u *s2, int checkname, int expandenv); diff --git a/src/proto/gc.pro b/src/proto/gc.pro index 8c8f73f2..e13dbda3 100644 --- a/src/proto/gc.pro +++ b/src/proto/gc.pro @@ -1,13 +1,12 @@ /* gc.c */ int get_copyID(void); int garbage_collect(int testing); -int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack, tuple_stack_T **tuple_stack); +int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack); int set_ref_in_dict(dict_T *d, int copyID); int set_ref_in_list(list_T *ll, int copyID); -int set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack, tuple_stack_T **tuple_stack); -int set_ref_in_tuple(tuple_T *tuple, int copyID); -int set_ref_in_tuple_items(tuple_T *tuple, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); +int set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack); int set_ref_in_callback(callback_T *cb, int copyID); -int set_ref_in_item_class(class_T *cl, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack, tuple_stack_T **tuple_stack); -int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack, tuple_stack_T **tuple_stack); +int set_ref_in_item_class(class_T *cl, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); +int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); /* vim: set ft=c : */ + diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro index cf5ef7fe..d8fcf3fe 100644 --- a/src/proto/getchar.pro +++ b/src/proto/getchar.pro @@ -15,8 +15,8 @@ void AppendToRedobuffSpec(char_u *s); void AppendCharToRedobuff(int c); void AppendNumberToRedobuff(long n); void stuffReadbuff(char_u *s); -void stuffRedoReadbuff(char_u *s); void stuffReadbuffLen(char_u *s, long len); +void stuffRedoReadbuff(char_u *s); void stuffReadbuffSpec(char_u *s); void stuffcharReadbuff(int c); void stuffnumReadbuff(long n); diff --git a/src/proto/highlight.pro b/src/proto/highlight.pro index 760e8fa1..53182583 100644 --- a/src/proto/highlight.pro +++ b/src/proto/highlight.pro @@ -43,7 +43,7 @@ int highlight_changed(void); void set_context_in_highlight_cmd(expand_T *xp, char_u *arg); char_u *get_highlight_name(expand_T *xp, int idx); char_u *get_highlight_name_ext(expand_T *xp, int idx, int skip_cleared); -int expand_highlight_group(char_u *pat, expand_T *xp, regmatch_T *rmp, char_u ***matches, int *numMatches); +int expand_highlight_group( char_u *pat, expand_T *xp, regmatch_T *rmp, char_u ***matches, int *numMatches); void free_highlight_fonts(void); void f_hlget(typval_T *argvars, typval_T *rettv); void f_hlset(typval_T *argvars, typval_T *rettv); diff --git a/src/proto/insexpand.pro b/src/proto/insexpand.pro index e9ff6266..2d1d12cd 100644 --- a/src/proto/insexpand.pro +++ b/src/proto/insexpand.pro @@ -25,8 +25,6 @@ int has_compl_option(int dict_opt); int vim_is_ctrl_x_key(int c); int ins_compl_accept_char(int c); int ins_compl_add_infercase(char_u *str_arg, int len, int icase, char_u *fname, int dir, int cont_s_ipos, int score); -int ins_compl_col_range_attr(linenr_T lnum, int col); -int ins_compl_lnum_in_range(linenr_T lnum); int ins_compl_has_shown_match(void); int ins_compl_long_shown_match(void); unsigned int get_cot_flags(void); @@ -36,7 +34,6 @@ char_u *ins_compl_leader(void); size_t ins_compl_leader_len(void); char_u *find_word_start(char_u *ptr); char_u *find_word_end(char_u *ptr); -char_u *find_line_end(char_u *ptr); void ins_compl_clear(void); int ins_compl_active(void); int ins_compl_win_active(win_T *wp); @@ -46,7 +43,6 @@ int ins_compl_interrupted(void); int ins_compl_enter_selects(void); colnr_T ins_compl_col(void); int ins_compl_len(void); -int ins_compl_preinsert_effect(void); int ins_compl_bs(void); void ins_compl_addleader(int c); void ins_compl_addfrommatch(void); @@ -65,7 +61,10 @@ void ins_compl_delete(void); void ins_compl_insert(int in_compl_func, int move_cursor); void ins_compl_check_keys(int frequency, int in_compl_func); int ins_complete(int c, int enable_pum); +int ins_compl_col_range_attr(linenr_T lnum, int col); void free_insexpand_stuff(void); -int ins_compl_cancel(void); -void f_complete_match(typval_T *argvars, typval_T *rettv); +int ins_compl_preinsert_effect(void); +int ins_compl_lnum_in_range(linenr_T lnum); +char_u *find_line_end(char_u *ptr); + /* vim: set ft=c : */ diff --git a/src/proto/list.pro b/src/proto/list.pro index cb052030..27bea5e8 100644 --- a/src/proto/list.pro +++ b/src/proto/list.pro @@ -50,8 +50,6 @@ int eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error); int write_list(FILE *fd, list_T *list, int binary); void init_static_list(staticList10_T *sl); void f_list2str(typval_T *argvars, typval_T *rettv); -void f_list2tuple(typval_T *argvars, typval_T *rettv); -void f_tuple2list(typval_T *argvars, typval_T *rettv); void f_sort(typval_T *argvars, typval_T *rettv); void f_uniq(typval_T *argvars, typval_T *rettv); int filter_map_one(typval_T *tv, typval_T *expr, filtermap_T filtermap, funccall_T *fc, typval_T *newtv, int *remp); diff --git a/src/proto/mark.pro b/src/proto/mark.pro index ce83fa0b..d398c367 100644 --- a/src/proto/mark.pro +++ b/src/proto/mark.pro @@ -1,7 +1,6 @@ /* mark.c */ int setmark(int c); int setmark_pos(int c, pos_T *pos, int fnum); -void mark_forget_file(win_T *wp, int fnum); void setpcmark(void); void checkpcmark(void); pos_T *movemark(int count); @@ -29,4 +28,5 @@ void set_last_cursor(win_T *win); void free_all_marks(void); xfmark_T *get_namedfm(void); void f_getmarklist(typval_T *argvars, typval_T *rettv); +void mark_forget_file(win_T *wp, int fnum); /* vim: set ft=c : */ diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro index b0309dd0..7061bab8 100644 --- a/src/proto/mbyte.pro +++ b/src/proto/mbyte.pro @@ -48,8 +48,8 @@ int utf_toupper(int a); int utf_islower(int a); int utf_tolower(int a); int utf_isupper(int a); -int mb_strnicmp2(char_u *s1, char_u *s2, size_t n1, size_t n2); int mb_strnicmp(char_u *s1, char_u *s2, size_t nn); +int mb_strnicmp2(char_u *s1, char_u *s2, size_t n1, size_t n2); void show_utf8(void); int latin_head_off(char_u *base, char_u *p); int dbcs_screen_head_off(char_u *base, char_u *p); diff --git a/src/proto/move.pro b/src/proto/move.pro index 61bc64de..1302c292 100644 --- a/src/proto/move.pro +++ b/src/proto/move.pro @@ -36,9 +36,9 @@ void curs_columns(int may_scroll); void textpos2screenpos(win_T *wp, pos_T *pos, int *rowp, int *scolp, int *ccolp, int *ecolp); void f_screenpos(typval_T *argvars, typval_T *rettv); void f_virtcol2col(typval_T *argvars, typval_T *rettv); -void scroll_redraw(int up, long count); void scrolldown(long line_count, int byfold); void scrollup(long line_count, int byfold); +void scroll_redraw(int up, long count); void adjust_skipcol(void); void check_topfill(win_T *wp, int down); void scrolldown_clamp(void); diff --git a/src/proto/normal.pro b/src/proto/normal.pro index cf873f20..36a26ec4 100644 --- a/src/proto/normal.pro +++ b/src/proto/normal.pro @@ -22,6 +22,7 @@ void pop_showcmd(void); void do_check_scrollbind(int check); void check_scrollbind(linenr_T topline_diff, long leftcol_diff); int find_decl(char_u *ptr, int len, int locally, int thisblock, int flags_arg); +void nv_g_home_m_cmd(cmdarg_T *cap); int nv_screengo(oparg_T *oap, int dir, long dist); void nv_scroll_line(cmdarg_T *cap); void handle_tabmenu(void); @@ -29,7 +30,6 @@ void do_nv_ident(int c1, int c2); int get_visual_text(cmdarg_T *cap, char_u **pp, int *lenp); void start_selection(void); void may_start_select(int c); -void nv_g_home_m_cmd(cmdarg_T *cap); int unadjust_for_sel(void); int unadjust_for_sel_inner(pos_T *pp); void set_cursor_for_append_to_line(void); diff --git a/src/proto/option.pro b/src/proto/option.pro index c6dfc1bd..83f32aad 100644 --- a/src/proto/option.pro +++ b/src/proto/option.pro @@ -69,6 +69,7 @@ char *did_set_showtabline(optset_T *args); char *did_set_smoothscroll(optset_T *args); char *did_set_spell(optset_T *args); char *did_set_swapfile(optset_T *args); +char *did_set_tabclose(optset_T *args); char *did_set_termguicolors(optset_T *args); char *did_set_termwinscroll(optset_T *args); char *did_set_terse(optset_T *args); @@ -88,7 +89,6 @@ char *did_set_winminheight(optset_T *args); char *did_set_winminwidth(optset_T *args); char *did_set_winwidth(optset_T *args); char *did_set_wrap(optset_T *args); -char *did_set_xhistory(optset_T *args); void check_redraw(long_u flags); int findoption(char_u *arg); getoption_T get_option_value(char_u *name, long *numval, char_u **stringval, int *flagsp, int scope); diff --git a/src/proto/optionstr.pro b/src/proto/optionstr.pro index 4c4ec3e4..c52dbe93 100644 --- a/src/proto/optionstr.pro +++ b/src/proto/optionstr.pro @@ -42,9 +42,9 @@ char *did_set_complete(optset_T *args); int expand_set_complete(optexpand_T *args, int *numMatches, char_u ***matches); char *did_set_completeopt(optset_T *args); int expand_set_completeopt(optexpand_T *args, int *numMatches, char_u ***matches); +char *did_set_completeitemalign(optset_T *args); char *did_set_completefuzzycollect(optset_T *args); int expand_set_completefuzzycollect(optexpand_T *args, int *numMatches, char_u ***matches); -char *did_set_completeitemalign(optset_T *args); char *did_set_completepopup(optset_T *args); char *did_set_completeslash(optset_T *args); int expand_set_completeslash(optexpand_T *args, int *numMatches, char_u ***matches); @@ -101,7 +101,6 @@ char *did_set_highlight(optset_T *args); int expand_set_highlight(optexpand_T *args, int *numMatches, char_u ***matches); char *did_set_iconstring(optset_T *args); char *did_set_imactivatekey(optset_T *args); -char *did_set_isexpand(optset_T *args); char *did_set_iskeyword(optset_T *args); char *did_set_isopt(optset_T *args); char *did_set_jumpoptions(optset_T *args); @@ -163,7 +162,6 @@ char *did_set_swapsync(optset_T *args); int expand_set_swapsync(optexpand_T *args, int *numMatches, char_u ***matches); char *did_set_switchbuf(optset_T *args); int expand_set_switchbuf(optexpand_T *args, int *numMatches, char_u ***matches); -char *did_set_tabclose(optset_T *args); int expand_set_tabclose(optexpand_T *args, int *numMatches, char_u ***matches); char *did_set_tabline(optset_T *args); char *did_set_tagcase(optset_T *args); diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro index e8e08d2e..cde9ceae 100644 --- a/src/proto/os_mswin.pro +++ b/src/proto/os_mswin.pro @@ -1,5 +1,4 @@ /* os_mswin.c */ -void SaveInst(HINSTANCE hInst); void mch_exit_g(int r); void mch_early_init(void); int mch_input_isatty(void); @@ -11,8 +10,8 @@ int mch_FullName(char_u *fname, char_u *buf, int len, int force); int mch_isFullName(char_u *fname); void slash_adjust(char_u *p); char_u *resolve_appexeclink(char_u *fname); -int vim_lstat(const char *name, stat_T *stp); int vim_stat(const char *name, stat_T *stp); +int vim_lstat(const char *name, stat_T *stp); void mch_settmode(tmode_T tmode); int mch_get_shellsize(void); void mch_set_shellsize(void); @@ -23,8 +22,8 @@ int mch_has_exp_wildcard(char_u *p); int mch_has_wildcard(char_u *p); int mch_chdir(char *path); int mch_icon_load(HANDLE *iconp); -int mch_get_random(char_u *buf, int len); int mch_libcall(char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result); +int mch_get_random(char_u *buf, int len); void DumpPutS(const char *psz); int mch_get_winpos(int *x, int *y); void mch_set_winpos(int x, int y); diff --git a/src/proto/os_unix.pro b/src/proto/os_unix.pro index 5fee8a5a..4b1257ba 100644 --- a/src/proto/os_unix.pro +++ b/src/proto/os_unix.pro @@ -56,7 +56,6 @@ void mch_setmouse(int on); void mch_bevalterm_changed(void); void check_mouse_termcode(void); int mch_get_shellsize(void); -void mch_calc_cell_size(struct cellsize *cs_out); int mch_report_winsize(int fd, int rows, int cols); void mch_set_shellsize(void); void mch_new_shellsize(void); @@ -76,8 +75,8 @@ int mch_has_wildcard(char_u *p); int mch_rename(const char *src, const char *dest); int gpm_available(void); int gpm_enabled(void); -int mch_get_random(char_u *buf, int len); int mch_libcall(char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result); +int mch_get_random(char_u *buf, int len); void setup_term_clip(void); void start_xterm_trace(int button); void stop_xterm_trace(void); @@ -92,4 +91,5 @@ void xsmp_close(void); void stop_timeout(void); volatile sig_atomic_t *start_timeout(long msec); void delete_timer(void); +void mch_calc_cell_size(struct cellsize *cs_out); /* vim: set ft=c : */ diff --git a/src/proto/popupwin.pro b/src/proto/popupwin.pro index d8df6f35..14432fc9 100644 --- a/src/proto/popupwin.pro +++ b/src/proto/popupwin.pro @@ -64,7 +64,6 @@ void f_popup_findpreview(typval_T *argvars, typval_T *rettv); int popup_create_preview_window(int info); void popup_close_preview(void); void popup_hide_info(void); -int popup_overlaps_cmdline(void); void popup_close_info(void); win_T *popup_get_message_win(void); void popup_show_message_win(void); @@ -75,4 +74,6 @@ void end_echowindow(void); int popup_win_closed(win_T *win); void popup_set_title(win_T *wp); void popup_update_preview_title(void); +int popup_overlaps_cmdline(void); + /* vim: set ft=c : */ diff --git a/src/proto/quickfix.pro b/src/proto/quickfix.pro index 6cd7cfcc..b708d6bd 100644 --- a/src/proto/quickfix.pro +++ b/src/proto/quickfix.pro @@ -3,9 +3,6 @@ int qf_init(win_T *wp, char_u *efile, char_u *errorformat, int newlist, char_u * int qf_stack_get_bufnr(void); void qf_free_all(win_T *wp); void check_quickfix_busy(void); -int qf_resize_stack(int n); -int ll_resize_stack(win_T *wp, int n); -void qf_init_stack(void); void copy_loclist_stack(win_T *from, win_T *to); void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit); void qf_list(exarg_T *eap); diff --git a/src/proto/search.pro b/src/proto/search.pro index 6f1cf928..1927738d 100644 --- a/src/proto/search.pro +++ b/src/proto/search.pro @@ -42,8 +42,9 @@ void f_matchfuzzy(typval_T *argvars, typval_T *rettv); void f_matchfuzzypos(typval_T *argvars, typval_T *rettv); int fuzzy_match_str(char_u *str, char_u *pat); garray_T *fuzzy_match_str_with_pos(char_u *str, char_u *pat); -int fuzzy_match_str_in_line(char_u **ptr, char_u *pat, int *len, pos_T *current_pos, int *score); int search_for_fuzzy_match(buf_T *buf, pos_T *pos, char_u *pattern, int dir, pos_T *start_pos, int *len, char_u **ptr, int *score); void fuzmatch_str_free(fuzmatch_str_T *fuzmatch, int count); int fuzzymatches_to_strmatches(fuzmatch_str_T *fuzmatch, char_u ***matches, int count, int funcsort); +int fuzzy_match_str_in_line(char_u **ptr, char_u *pat, int *len, pos_T *current_pos, int *score); + /* vim: set ft=c : */ diff --git a/src/proto/strings.pro b/src/proto/strings.pro index 8e7dc180..ddc53cce 100644 --- a/src/proto/strings.pro +++ b/src/proto/strings.pro @@ -17,6 +17,7 @@ int vim_stricmp(char *s1, char *s2); int vim_strnicmp(char *s1, char *s2, size_t len); int vim_strnicmp_asc(char *s1, char *s2, size_t len); char_u *vim_strchr(char_u *string, int c); +char *vim_strnchr(const char *p, size_t *n, int c); char_u *vim_strbyte(char_u *string, int c); char_u *vim_strrchr(char_u *string, int c); void sort_strings(char_u **files, int count); diff --git a/src/proto/tag.pro b/src/proto/tag.pro index 4ab2e00d..eec7c24e 100644 --- a/src/proto/tag.pro +++ b/src/proto/tag.pro @@ -10,9 +10,9 @@ int find_tags(char_u *pat, int *num_matches, char_u ***matchesp, int flags, int void free_tag_stuff(void); int get_tagfname(tagname_T *tnp, int first, char_u *buf); void tagname_free(tagname_T *tnp); -void tagstack_clear_entry(taggy_T *item); int expand_tags(int tagnames, char_u *pat, int *num_file, char_u ***file); int get_tags(list_T *list, char_u *pat, char_u *buf_fname); void get_tagstack(win_T *wp, dict_T *retdict); int set_tagstack(win_T *wp, dict_T *d, int action); +void tagstack_clear_entry(taggy_T *item); /* vim: set ft=c : */ diff --git a/src/proto/term.pro b/src/proto/term.pro index c76acabb..d82f9064 100644 --- a/src/proto/term.pro +++ b/src/proto/term.pro @@ -30,10 +30,10 @@ void term_enable_mouse(int enable); void term_set_winpos(int x, int y); int term_get_winpos(int *x, int *y, varnumber_T timeout); void term_set_winsize(int height, int width); -void term_font(int n); void term_fg_color(int n); void term_bg_color(int n); void term_ul_color(int n); +void term_font(int n); char_u *term_bg_default(void); void term_fg_rgb_color(guicolor_T rgb); void term_bg_rgb_color(guicolor_T rgb); diff --git a/src/proto/testing.pro b/src/proto/testing.pro index 1c93f8cd..dea4f753 100644 --- a/src/proto/testing.pro +++ b/src/proto/testing.pro @@ -30,7 +30,6 @@ void f_test_null_list(typval_T *argvars, typval_T *rettv); void f_test_null_function(typval_T *argvars, typval_T *rettv); void f_test_null_partial(typval_T *argvars, typval_T *rettv); void f_test_null_string(typval_T *argvars, typval_T *rettv); -void f_test_null_tuple(typval_T *argvars, typval_T *rettv); void f_test_unknown(typval_T *argvars, typval_T *rettv); void f_test_void(typval_T *argvars, typval_T *rettv); void f_test_setmouse(typval_T *argvars, typval_T *rettv); diff --git a/src/proto/tuple.pro b/src/proto/tuple.pro deleted file mode 100644 index 138648d3..00000000 --- a/src/proto/tuple.pro +++ /dev/null @@ -1,34 +0,0 @@ -/* tuple.c */ -tuple_T *tuple_alloc(void); -tuple_T *tuple_alloc_with_items(int count); -void tuple_set_item(tuple_T *tuple, int idx, typval_T *tv); -int rettv_tuple_alloc(typval_T *rettv); -void rettv_tuple_set(typval_T *rettv, tuple_T *tuple); -int rettv_tuple_set_with_items(typval_T *rettv, int count); -void tuple_unref(tuple_T *tuple); -int tuple_free_nonref(int copyID); -void tuple_free_items(int copyID); -void tuple_free(tuple_T *tuple); -long tuple_len(tuple_T *tuple); -int tuple_equal(tuple_T *t1, tuple_T *t2, int ic); -typval_T *tuple_find(tuple_T *tuple, long n); -int tuple_append_tv(tuple_T *tuple, typval_T *tv); -int tuple_concat(tuple_T *t1, tuple_T *t2, typval_T *tv); -tuple_T *tuple_slice(tuple_T *tuple, long n1, long n2); -int tuple_slice_or_index(tuple_T *tuple, int range, varnumber_T n1_arg, varnumber_T n2_arg, int exclusive, typval_T *rettv, int verbose); -tuple_T *tuple_copy(tuple_T *orig, int deep, int top, int copyID); -int eval_tuple(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error); -void tuple_lock(tuple_T *tuple, int deep, int lock, int check_refcount); -int tuple_join(garray_T *gap, tuple_T *tuple, char_u *sep, int echo_style, int restore_copyID, int copyID); -char_u *tuple2string(typval_T *tv, int copyID, int restore_copyID); -void tuple_foreach(tuple_T *tuple, filtermap_T filtermap, typval_T *expr); -long tuple_count(tuple_T *tuple, typval_T *needle, long idx, int ic); -void tuple2items(typval_T *argvars, typval_T *rettv); -int index_tuple(tuple_T *tuple, typval_T *tv, int start_idx, int ic); -int indexof_tuple(tuple_T *tuple, long startidx, typval_T *expr); -varnumber_T tuple_max_min(tuple_T *tuple, int domax, int *error); -void tuple_repeat(tuple_T *tuple, int n, typval_T *rettv); -void tuple_reverse(tuple_T *tuple, typval_T *rettv); -void tuple_reduce(typval_T *argvars, typval_T *expr, typval_T *rettv); -int check_tuples_addable(type_T *type1, type_T *type2); -/* vim: set ft=c : */ diff --git a/src/proto/typval.pro b/src/proto/typval.pro index d30cdedc..90dcc543 100644 --- a/src/proto/typval.pro +++ b/src/proto/typval.pro @@ -18,13 +18,13 @@ int check_for_number_arg(typval_T *args, int idx); int check_for_opt_number_arg(typval_T *args, int idx); int check_for_float_or_nr_arg(typval_T *args, int idx); int check_for_bool_arg(typval_T *args, int idx); +int check_for_bool_or_number_arg(typval_T *args, int idx); int check_for_opt_bool_arg(typval_T *args, int idx); int check_for_opt_bool_or_number_arg(typval_T *args, int idx); int check_for_blob_arg(typval_T *args, int idx); int check_for_list_arg(typval_T *args, int idx); int check_for_nonnull_list_arg(typval_T *args, int idx); int check_for_opt_list_arg(typval_T *args, int idx); -int check_for_tuple_arg(typval_T *args, int idx); int check_for_dict_arg(typval_T *args, int idx); int check_for_nonnull_dict_arg(typval_T *args, int idx); int check_for_opt_dict_arg(typval_T *args, int idx); @@ -41,20 +41,18 @@ int check_for_lnum_arg(typval_T *args, int idx); int check_for_opt_lnum_arg(typval_T *args, int idx); int check_for_string_or_blob_arg(typval_T *args, int idx); int check_for_string_or_list_arg(typval_T *args, int idx); -int check_for_string_or_list_or_tuple_or_blob_arg(typval_T *args, int idx); +int check_for_string_or_list_or_blob_arg(typval_T *args, int idx); int check_for_opt_string_or_list_arg(typval_T *args, int idx); int check_for_string_or_dict_arg(typval_T *args, int idx); int check_for_string_or_number_or_list_arg(typval_T *args, int idx); int check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx); -int check_for_repeat_func_arg(typval_T *args, int idx); -int check_for_string_list_tuple_or_dict_arg(typval_T *args, int idx); +int check_for_string_or_number_or_list_or_blob_arg(typval_T *args, int idx); +int check_for_string_or_list_or_dict_arg(typval_T *args, int idx); int check_for_string_or_func_arg(typval_T *args, int idx); int check_for_list_or_blob_arg(typval_T *args, int idx); -int check_for_list_or_tuple_arg(typval_T *args, int idx); -int check_for_list_or_tuple_or_blob_arg(typval_T *args, int idx); -int check_for_list_or_tuple_or_dict_arg(typval_T *args, int idx); +int check_for_list_or_dict_arg(typval_T *args, int idx); int check_for_list_or_dict_or_blob_arg(typval_T *args, int idx); -int check_for_list_tuple_dict_blob_or_string_arg(typval_T *args, int idx); +int check_for_list_or_dict_or_blob_or_string_arg(typval_T *args, int idx); int check_for_opt_buffer_or_dict_arg(typval_T *args, int idx); int check_for_object_arg(typval_T *args, int idx); int check_for_class_or_typealias_args(typval_T *args, int idx); @@ -69,7 +67,6 @@ int tv_check_lock(typval_T *tv, char_u *name, int use_gettext); void copy_tv(typval_T *from, typval_T *to); int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic); int typval_compare_list(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res); -int typval_compare_tuple(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res); int typval_compare_null(typval_T *tv1, typval_T *tv2); int typval_compare_blob(typval_T *tv1, typval_T *tv2, exprtype_T type, int *res); int typval_compare_object(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res); diff --git a/src/proto/undo.pro b/src/proto/undo.pro index 14c233c8..619ad702 100644 --- a/src/proto/undo.pro +++ b/src/proto/undo.pro @@ -18,9 +18,9 @@ void ex_undojoin(exarg_T *eap); void u_unchanged(buf_T *buf); void u_find_first_changed(void); void u_update_save_nr(buf_T *buf); -void u_clearallandblockfree(buf_T *buf); void u_clearline(void); void u_undoline(void); +void u_clearallandblockfree(buf_T *buf); int bufIsChanged(buf_T *buf); int anyBufIsChanged(void); int bufIsChangedNotTerm(buf_T *buf); diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro index e91dd3a4..95d8cc4f 100644 --- a/src/proto/userfunc.pro +++ b/src/proto/userfunc.pro @@ -48,7 +48,6 @@ char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, f void list_functions(regmatch_T *regmatch); ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free, int class_flags, ocmember_T *obj_members, int obj_member_count); void ex_function(exarg_T *eap); -int get_func_arity(char_u *name, int *required, int *optional, int *varargs); ufunc_T *find_func_by_name(char_u *name, compiletype_T *compile_type); void defcompile_function(ufunc_T *ufunc, class_T *cl); void ex_defcompile(exarg_T *eap); @@ -95,4 +94,5 @@ int set_ref_in_call_stack(int copyID); int set_ref_in_functions(int copyID); int set_ref_in_func_args(int copyID); int set_ref_in_func(char_u *name, ufunc_T *fp_in, int copyID); +int get_func_arity(char_u *name, int *required, int *optional, int *varargs); /* vim: set ft=c : */ diff --git a/src/proto/vim9class.pro b/src/proto/vim9class.pro index d40e71af..d59caa06 100644 --- a/src/proto/vim9class.pro +++ b/src/proto/vim9class.pro @@ -2,10 +2,11 @@ int object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl); int is_valid_builtin_obj_methodname(char_u *funcname); ufunc_T *class_get_builtin_method(class_T *cl, class_builtin_T builtin_method, int *method_idx); -void enum_set_internal_obj_vars(class_T *en, object_T *enval); void ex_class(exarg_T *eap); +void enum_set_internal_obj_vars(class_T *en, object_T *enval); type_T *oc_member_type(class_T *cl, int is_object, char_u *name, char_u *name_end, int *member_idx); type_T *oc_member_type_by_idx(class_T *cl, int is_object, int member_idx); +void ex_enum(exarg_T *eap); void typealias_unref(typealias_T *ta); void ex_type(exarg_T *eap); int get_member_tv(class_T *cl, int is_object, char_u *name, size_t namelen, class_T *current_class, typval_T *rettv); @@ -37,6 +38,7 @@ void member_not_found_msg(class_T *cl, vartype_T v_type, char_u *name, size_t le void defcompile_class(class_T *cl); void defcompile_classes_in_script(void); int is_class_name(char_u *name, typval_T *rettv); +void protected_method_access_errmsg(char_u *method_name); int object_empty(object_T *obj); int object_len(object_T *obj); int object_equal(object_T *o1, object_T *o2, int ic); diff --git a/src/proto/vim9compile.pro b/src/proto/vim9compile.pro index 6d91bc86..080a2ffa 100644 --- a/src/proto/vim9compile.pro +++ b/src/proto/vim9compile.pro @@ -2,6 +2,7 @@ int lookup_local(char_u *name, size_t len, lvar_T *lvar, cctx_T *cctx); int arg_exists(char_u *name, size_t len, int *idxp, type_T **type, int *gen_load_outer, cctx_T *cctx); void update_script_var_block_id(char_u *name, int block_id); +int script_is_vim9(void); int script_var_exists(char_u *name, size_t len, cctx_T *cctx, cstack_T *cstack); int cctx_class_method_idx(cctx_T *cctx, char_u *name, size_t len, class_T **cl_ret); int cctx_class_member_idx(cctx_T *cctx, char_u *name, size_t len, class_T **cl_ret); diff --git a/src/proto/vim9instr.pro b/src/proto/vim9instr.pro index a4504c51..641648f4 100644 --- a/src/proto/vim9instr.pro +++ b/src/proto/vim9instr.pro @@ -44,7 +44,6 @@ int generate_LOCKCONST(cctx_T *cctx); int generate_OLDSCRIPT(cctx_T *cctx, isntype_T isn_type, char_u *name, int sid, type_T *type); int generate_VIM9SCRIPT(cctx_T *cctx, isntype_T isn_type, int sid, int idx, type_T *type); int generate_NEWLIST(cctx_T *cctx, int count, int use_null); -int generate_NEWTUPLE(cctx_T *cctx, int count, int use_null); int generate_NEWDICT(cctx_T *cctx, int count, int use_null); int generate_FUNCREF(cctx_T *cctx, ufunc_T *ufunc, class_T *cl, int object_method, int fi, int *isn_idx); int generate_NEWFUNC(cctx_T *cctx, char_u *lambda_name, char_u *func_name); diff --git a/src/proto/vim9type.pro b/src/proto/vim9type.pro index 865a93c1..093a5ec3 100644 --- a/src/proto/vim9type.pro +++ b/src/proto/vim9type.pro @@ -7,7 +7,6 @@ type_T *alloc_type(type_T *type); void free_type(type_T *type); void set_tv_type(typval_T *tv, type_T *type); type_T *get_list_type(type_T *member_type, garray_T *type_gap); -type_T *get_tuple_type(garray_T *tuple_types_gap, garray_T *type_gap); type_T *get_dict_type(type_T *member_type, garray_T *type_gap); type_T *alloc_func_type(type_T *ret_type, int argcount, garray_T *type_gap); type_T *get_func_type(type_T *ret_type, int argcount, garray_T *type_gap); @@ -28,14 +27,12 @@ char_u *skip_type(char_u *start, int optional); type_T *parse_type(char_u **arg, garray_T *type_gap, int give_error); int equal_type(type_T *type1, type_T *type2, int flags); void common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap); -type_T *get_item_type(type_T *type); int push_type_stack(cctx_T *cctx, type_T *type); int push_type_stack2(cctx_T *cctx, type_T *type, type_T *decl_type); void set_type_on_stack(cctx_T *cctx, type_T *type, int offset); type_T *get_type_on_stack(cctx_T *cctx, int offset); type_T *get_decl_type_on_stack(cctx_T *cctx, int offset); type_T *get_member_type_from_stack(int count, int skip, cctx_T *cctx); -int get_tuple_type_from_stack(int count, garray_T *tuple_types_gap, cctx_T *cctx); char *vartype_name(vartype_T type); char *type_name(type_T *type, char **tofree); void f_typename(typval_T *argvars, typval_T *rettv); diff --git a/src/proto/window.pro b/src/proto/window.pro index d92a5af4..f1e129d6 100644 --- a/src/proto/window.pro +++ b/src/proto/window.pro @@ -1,15 +1,14 @@ /* window.c */ -void window_layout_lock(void); -void window_layout_unlock(void); -int window_layout_locked(enum CMD_index cmd); int check_can_set_curbuf_disabled(void); int check_can_set_curbuf_forceit(int forceit); +int window_layout_locked(enum CMD_index cmd); win_T *prevwin_curwin(void); win_T *swbuf_goto_win_with_buf(buf_T *buf); void do_window(int nchar, long Prenum, int xchar); void get_wincmd_addr_type(char_u *arg, exarg_T *eap); int check_split_disallowed(win_T *wp); int win_split(int size, int flags); +int win_splitmove(win_T *wp, int size, int flags); int win_split_ins(int size, int flags, win_T *new_wp, int dir, frame_T *to_flatten); int win_valid_popup(win_T *win); int win_valid(win_T *win); @@ -17,7 +16,6 @@ win_T *win_find_by_id(int id); int win_valid_any_tab(win_T *win); int win_count(void); int make_windows(int count, int vertical); -int win_splitmove(win_T *wp, int size, int flags); void win_move_after(win_T *win1, win_T *win2); void win_equal(win_T *next_curwin, int current, int dir); void leaving_window(win_T *win); @@ -27,7 +25,6 @@ void close_windows(buf_T *buf, int keep_curwin); int last_window(void); int one_window(void); int win_close(win_T *win, int free_buf); -void trigger_tabclosedpre(tabpage_T *tp, int directly); void snapshot_windows_scroll_size(void); void may_make_initial_scroll_size_snapshot(void); void may_trigger_win_scrolled_resized(void); @@ -105,4 +102,5 @@ int get_tab_number(tabpage_T *tp); char *check_colorcolumn(char_u *cc, win_T *wp); int get_last_winid(void); int win_locked(win_T *wp); +void trigger_tabclosedpre(tabpage_T *tp, int directly); /* vim: set ft=c : */ diff --git a/src/quickfix.c b/src/quickfix.c index 9c5ad938..e498d5eb 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -51,6 +51,7 @@ struct qfline_S /* * There is a stack of error lists. */ +#define LISTCOUNT 10 #define INVALID_QFIDX (-1) #define INVALID_QFBUFNR (0) @@ -112,14 +113,12 @@ struct qf_info_S int qf_refcount; int qf_listcount; // current number of lists int qf_curlist; // current error list - int qf_maxcount; // maximum number of lists - qf_list_T *qf_lists; + qf_list_T qf_lists[LISTCOUNT]; qfltype_T qfl_type; // type of list int qf_bufnr; // quickfix window buffer number }; -static qf_info_T ql_info_actual; // global quickfix list -static qf_info_T *ql_info; // points to ql_info_actual if memory allocation is successful. +static qf_info_T ql_info; // global quickfix list static int_u last_qf_id = 0; // Last used quickfix list id #define FMT_PATTERNS 14 // maximum number of % recognized @@ -171,21 +170,14 @@ static efm_T *fmt_start = NULL; // cached across qf_parse_line() calls // callback function for 'quickfixtextfunc' static callback_T qftf_cb; -static void qf_pop_stack(qf_info_T *qi, int adjust); static void qf_new_list(qf_info_T *qi, char_u *qf_title); static int qf_add_entry(qf_list_T *qfl, char_u *dir, char_u *fname, char_u *module, int bufnum, char_u *mesg, long lnum, long end_lnum, int col, int end_col, int vis_col, char_u *pattern, int nr, int type, typval_T *user_data, int valid); -static int qf_resize_stack_base(qf_info_T *qi, int n); -static void qf_sync_llw_to_win(win_T *llw); -static void qf_sync_win_to_llw(win_T *pwp); -static qf_info_T *qf_alloc_stack(qfltype_T qfltype, int n); -static qf_list_T *qf_alloc_list_stack(int n); static void qf_free(qf_list_T *qfl); static char_u *qf_types(int, int); static int qf_get_fnum(qf_list_T *qfl, char_u *, char_u *); static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack); static char_u *qf_pop_dir(struct dir_stack_T **); static char_u *qf_guess_filepath(qf_list_T *qfl, char_u *); -static win_T *qf_find_win_with_loclist(qf_info_T *ll); static void qf_jump_newwin(qf_info_T *qi, int dir, int errornr, int forceit, int newwin); static void qf_fmt_text(garray_T *gap, char_u *text); static void qf_range_text(garray_T *gap, qfline_T *qfp); @@ -1910,12 +1902,14 @@ qf_init(win_T *wp, char_u *qf_title, char_u *enc) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; if (wp != NULL) + { qi = ll_get_or_alloc_list(wp); - if (qi == NULL) - return FAIL; + if (qi == NULL) + return FAIL; + } return qf_init_ext(qi, qi->qf_curlist, efile, curbuf, NULL, errorformat, newlist, (linenr_T)0, (linenr_T)0, qf_title, enc); @@ -1964,34 +1958,6 @@ qf_get_curlist(qf_info_T *qi) return qf_get_list(qi, qi->qf_curlist); } -/* - * Pop a quickfix list from the quickfix/location list stack - * Automatically adjust qf_curlist so that it stays pointed - * to the same list, unless it is deleted, if so then use the - * newest created list instead. qf_listcount will be set correctly. - * The above will only happen if is TRUE. - */ - static void -qf_pop_stack(qf_info_T *qi, int adjust) -{ - int i; - qf_free(&qi->qf_lists[0]); - for (i = 1; i < qi->qf_listcount; ++i) - qi->qf_lists[i - 1] = qi->qf_lists[i]; - - // fill with zeroes now unused list at the top - vim_memset(qi->qf_lists + qi->qf_listcount - 1, 0, sizeof(*qi->qf_lists)); - - if (adjust) - { - qi->qf_listcount--; - if (qi->qf_curlist == 0) - qi->qf_curlist = qi->qf_listcount - 1; - else - qi->qf_curlist--; - } -} - /* * Prepare for adding a new quickfix list. If the current list is in the * middle of the stack, then all the following lists are freed and then @@ -2000,6 +1966,7 @@ qf_pop_stack(qf_info_T *qi, int adjust) static void qf_new_list(qf_info_T *qi, char_u *qf_title) { + int i; qf_list_T *qfl; // If the current entry is not the last entry, delete entries beyond @@ -2010,14 +1977,15 @@ qf_new_list(qf_info_T *qi, char_u *qf_title) // When the stack is full, remove to oldest entry // Otherwise, add a new entry. - if (qi->qf_listcount == qi->qf_maxcount) + if (qi->qf_listcount == LISTCOUNT) { - qf_pop_stack(qi, FALSE); - qi->qf_curlist = qi->qf_listcount - 1; // point to new empty list + qf_free(&qi->qf_lists[0]); + for (i = 1; i < LISTCOUNT; ++i) + qi->qf_lists[i - 1] = qi->qf_lists[i]; + qi->qf_curlist = LISTCOUNT - 1; } else qi->qf_curlist = qi->qf_listcount++; - qfl = qf_get_curlist(qi); CLEAR_POINTER(qfl); qf_store_title(qfl, qf_title); @@ -2049,9 +2017,7 @@ locstack_queue_delreq(qf_info_T *qi) int qf_stack_get_bufnr(void) { - if (ql_info == NULL) - return INVALID_QFBUFNR; - return ql_info->qf_bufnr; + return ql_info.qf_bufnr; } /* @@ -2069,56 +2035,20 @@ wipe_qf_buffer(qf_info_T *qi) qfbuf = buflist_findnr(qi->qf_bufnr); if (qfbuf != NULL && qfbuf->b_nwindows == 0) { - int buf_was_null = FALSE; - // can happen when curwin is going to be closed e.g. curwin->w_buffer - // was already closed in win_close(), and we are now closing the - // window related location list buffer from win_free_mem() - // but close_buffer() calls CHECK_CURBUF() macro and requires - // curwin->w_buffer == curbuf - if (curwin->w_buffer == NULL) - { - curwin->w_buffer = curbuf; - buf_was_null = TRUE; - } - // If the quickfix buffer is not loaded in any window, then // wipe the buffer. close_buffer(NULL, qfbuf, DOBUF_WIPE, FALSE, FALSE); qi->qf_bufnr = INVALID_QFBUFNR; - if (buf_was_null) - curwin->w_buffer = NULL; } } - -/* - * Free all lists in the stack (not including the stack) - */ - static void -qf_free_list_stack_items(qf_info_T *qi) -{ - for (int i = 0; i < qi->qf_listcount; ++i) - qf_free(qf_get_list(qi, i)); -} - -/* - * Free a qf_info_T struct completely - */ - static void -qf_free_lists(qf_info_T *qi) -{ - qf_free_list_stack_items(qi); - - vim_free(qi->qf_lists); - vim_free(qi); -} - /* * Free a location list stack */ static void ll_free_all(qf_info_T **pqi) { + int i; qf_info_T *qi; qi = *pqi; @@ -2141,7 +2071,9 @@ ll_free_all(qf_info_T **pqi) // If the quickfix window buffer is loaded, then wipe it wipe_qf_buffer(qi); - qf_free_lists(qi); + for (i = 0; i < qi->qf_listcount; ++i) + qf_free(qf_get_list(qi, i)); + vim_free(qi); } } @@ -2151,7 +2083,8 @@ ll_free_all(qf_info_T **pqi) void qf_free_all(win_T *wp) { - qf_info_T *qi = ql_info; + int i; + qf_info_T *qi = &ql_info; if (wp != NULL) { @@ -2159,8 +2092,10 @@ qf_free_all(win_T *wp) ll_free_all(&wp->w_llist); ll_free_all(&wp->w_llist_ref); } - else if (qi != NULL) - qf_free_list_stack_items(qi); // quickfix list + else + // quickfix list + for (i = 0; i < qi->qf_listcount; ++i) + qf_free(qf_get_list(qi, i)); } /* @@ -2268,12 +2203,12 @@ qf_add_entry( if (buf != NULL && buf->b_ffname != NULL && fullname != NULL) { - if (fnamecmp(fullname, buf->b_ffname) != 0) - { - p = shorten_fname1(fullname); - if (p != NULL) + if (fnamecmp(fullname, buf->b_ffname) != 0) + { + p = shorten_fname1(fullname); + if (p != NULL) qfp->qf_fname = vim_strsave(p); - } + } } vim_free(fullname); if ((qfp->qf_text = vim_strsave(mesg)) == NULL) @@ -2343,169 +2278,23 @@ qf_add_entry( } /* - * Resize quickfix stack to be able to hold n amount of lists. - * returns FAIL on failure and OK on success. - */ - int -qf_resize_stack(int n) -{ - if (ql_info == NULL) - return FAIL; - - if (qf_resize_stack_base(ql_info, n) == FAIL) - return FAIL; - - return OK; -} - -/* - * Resize location list stack for window 'wp' to be able to - * hold n amount of lists. Returns FAIL on failure and OK on success - */ - int -ll_resize_stack(win_T *wp, int n) -{ - // check if given window is a location list window; - // if so then sync its 'lhistory' to the parent window or vice versa - if (IS_LL_WINDOW(wp)) - qf_sync_llw_to_win(wp); - else - qf_sync_win_to_llw(wp); - - qf_info_T *qi = ll_get_or_alloc_list(wp); - if (qi == NULL) - return FAIL; - - if (qf_resize_stack_base(qi, n) == FAIL) - return FAIL; - - return OK; -} - -/* - * Resize quickfix/location lists stack to be able to hold n amount of lists. - * Returns FAIL on failure and OK on success. - */ - static int -qf_resize_stack_base(qf_info_T *qi, int n) -{ - qf_list_T *new; - int amount_to_rm = 0, i; - - if (qi == NULL) - return FAIL; - - size_t lsz = sizeof(*qi->qf_lists); - - if (n == qi->qf_maxcount) - return OK; - else if (n < qi->qf_maxcount && n < qi->qf_listcount) - { - // We have too many lists to store them all in the new stack, - // pop lists until we can fit them all in the newly resized stack - amount_to_rm = qi->qf_listcount - n; - - for (i = 0; i < amount_to_rm; i++) - qf_pop_stack(qi, TRUE); - } - - new = vim_realloc(qi->qf_lists, lsz * n); - - if (new == NULL) - return FAIL; - - // fill with zeroes any newly allocated memory - if (n > qi->qf_maxcount) - vim_memset(new + qi->qf_maxcount, 0, lsz * (n - qi->qf_maxcount)); - - qi->qf_lists = new; - qi->qf_maxcount = n; - - qf_update_buffer(qi, NULL); - - return OK; -} - -/* - * Initialize quickfix list, should only be called once. - */ - void -qf_init_stack(void) -{ - ql_info = qf_alloc_stack(QFLT_QUICKFIX, p_chi); -} - -/* - * Sync a location list window's 'lhistory' value to the parent window - */ - static void -qf_sync_llw_to_win(win_T *llw) -{ - win_T *wp = qf_find_win_with_loclist(llw->w_llist_ref); - - if (wp != NULL) - wp->w_p_lhi = llw->w_p_lhi; -} - -/* - * Sync a window's 'lhistory' value to its location list window, if any - */ - static void -qf_sync_win_to_llw(win_T *pwp) -{ - win_T *wp; - qf_info_T *llw = pwp->w_llist; - - if (llw != NULL) - FOR_ALL_WINDOWS(wp) - if (wp->w_llist_ref == llw && bt_quickfix(wp->w_buffer)) - { - wp->w_p_lhi = pwp->w_p_lhi; - return; - } -} - -/* - * Allocate a new quickfix/location list stack that is able to hold - * up to n amount of lists + * Allocate a new quickfix/location list stack */ static qf_info_T * -qf_alloc_stack(qfltype_T qfltype, int n) +qf_alloc_stack(qfltype_T qfltype) { qf_info_T *qi; - if (qfltype == QFLT_QUICKFIX) - qi = &ql_info_actual; - else - { - qi = ALLOC_CLEAR_ONE_ID(qf_info_T, aid_qf_qfinfo); - if (qi == NULL) - return NULL; - qi->qf_refcount++; - } - qi->qfl_type = qfltype; - qi->qf_bufnr = INVALID_QFBUFNR; - qi->qf_lists = qf_alloc_list_stack(n); - if (qi->qf_lists == NULL) - { - if (qfltype != QFLT_QUICKFIX) - vim_free(qi); + qi = ALLOC_CLEAR_ONE_ID(qf_info_T, aid_qf_qfinfo); + if (qi == NULL) return NULL; - } - qi->qf_maxcount = n; + qi->qf_refcount++; + qi->qfl_type = qfltype; + qi->qf_bufnr = INVALID_QFBUFNR; return qi; } -/* - * Allocate memory for qf_lists member of qf_info_T struct. - */ - static qf_list_T * -qf_alloc_list_stack(int n) -{ - return ALLOC_CLEAR_MULT(qf_list_T, n); -} - /* * Return the location list stack for window 'wp'. * If not present, allocate a location list stack @@ -2522,9 +2311,7 @@ ll_get_or_alloc_list(win_T *wp) ll_free_all(&wp->w_llist_ref); if (wp->w_llist == NULL) - // new location list - wp->w_llist = qf_alloc_stack(QFLT_LOCATION, wp->w_p_lhi); - + wp->w_llist = qf_alloc_stack(QFLT_LOCATION); // new location list return wp->w_llist; } @@ -2537,7 +2324,7 @@ ll_get_or_alloc_list(win_T *wp) static qf_info_T * qf_cmd_get_stack(exarg_T *eap, int print_emsg) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; if (is_loclist_cmd(eap->cmdidx)) { @@ -2549,8 +2336,6 @@ qf_cmd_get_stack(exarg_T *eap, int print_emsg) return NULL; } } - if (qi == NULL && print_emsg) - emsg(_(e_no_quickfix_stack)); return qi; } @@ -2565,7 +2350,7 @@ qf_cmd_get_stack(exarg_T *eap, int print_emsg) static qf_info_T * qf_cmd_get_or_alloc_stack(exarg_T *eap, win_T **pwinp) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; if (is_loclist_cmd(eap->cmdidx)) { @@ -2695,12 +2480,9 @@ copy_loclist_stack(win_T *from, win_T *to) if (qi == NULL) // no location list to copy return; - // allocate a new location list, set size of stack to 'from' window value - if ((to->w_llist = qf_alloc_stack(QFLT_LOCATION, from->w_p_lhi)) == NULL) + // allocate a new location list + if ((to->w_llist = qf_alloc_stack(QFLT_LOCATION)) == NULL) return; - else - // set 'to' lhi to reflect new value - to->w_p_lhi = to->w_llist->qf_maxcount; to->w_llist->qf_listcount = qi->qf_listcount; @@ -2964,7 +2746,7 @@ qf_guess_filepath(qf_list_T *qfl, char_u *filename) static int qflist_valid(win_T *wp, int_u qf_id) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; int i; if (wp != NULL) @@ -2972,9 +2754,9 @@ qflist_valid(win_T *wp, int_u qf_id) if (!win_valid(wp)) return FALSE; qi = GET_LOC_LIST(wp); // Location list + if (qi == NULL) + return FALSE; } - if (qi == NULL) - return FALSE; for (i = 0; i < qi->qf_listcount; ++i) if (qi->qf_lists[i].qf_id == qf_id) @@ -3837,14 +3619,7 @@ qf_jump_newwin(qf_info_T *qi, int retval = OK; if (qi == NULL) - { - if (ql_info == NULL) - { - emsg(_(e_no_quickfix_stack)); - return; - } - qi = ql_info; - } + qi = &ql_info; if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi))) { @@ -4348,7 +4123,7 @@ qf_mark_adjust( int i; qfline_T *qfp; int idx; - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; int found_one = FALSE; int buf_has_flag = wp == NULL ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY; @@ -4360,8 +4135,6 @@ qf_mark_adjust( return; qi = wp->w_llist; } - else if (qi == NULL) - return; for (idx = 0; idx < qi->qf_listcount; ++idx) { @@ -4444,15 +4217,10 @@ qf_types(int c, int nr) void qf_view_result(int split) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; if (IS_LL_WINDOW(curwin)) qi = GET_LOC_LIST(curwin); - else if (qi == NULL) - { - emsg(_(e_no_quickfix_stack)); - return; - } if (qf_list_empty(qf_get_curlist(qi))) { @@ -4762,13 +4530,11 @@ ex_cbottom(exarg_T *eap) linenr_T qf_current_entry(win_T *wp) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; if (IS_LL_WINDOW(wp)) // In the location list window, use the referenced location list qi = wp->w_llist_ref; - else if (qi == NULL) - return 0; return qf_get_curlist(qi)->qf_index; } @@ -5450,7 +5216,7 @@ ex_make(exarg_T *eap) char_u *cmd; char_u *enc = NULL; win_T *wp = NULL; - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; int res; char_u *au_name = NULL; int_u save_qfid; @@ -5515,9 +5281,6 @@ ex_make(exarg_T *eap) if (qi == NULL) goto cleanup; } - else if (qi == NULL) - goto cleanup; - if (res >= 0) qf_list_changed(qf_get_curlist(qi)); @@ -6191,7 +5954,7 @@ ex_cfile(exarg_T *eap) { char_u *enc = NULL; win_T *wp = NULL; - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; char_u *au_name = NULL; int_u save_qfid = 0; // init for gcc int res; @@ -6248,11 +6011,6 @@ ex_cfile(exarg_T *eap) return; } } - else if (qi == NULL) - { - decr_quickfix_busy(); - return; - } if (res >= 0) qf_list_changed(qf_get_curlist(qi)); save_qfid = qf_get_curlist(qi)->qf_id; @@ -7026,11 +6784,7 @@ load_dummy_buffer( aucmd_restbuf(&aco); if (newbuf_to_wipe.br_buf != NULL && bufref_valid(&newbuf_to_wipe)) - { - block_autocmds(); - wipe_dummy_buffer(newbuf_to_wipe.br_buf, NULL); - unblock_autocmds(); - } + wipe_buffer(newbuf_to_wipe.br_buf, FALSE); } // Add back the "dummy" flag, otherwise buflist_findname_stat() won't @@ -7056,8 +6810,8 @@ load_dummy_buffer( /* * Wipe out the dummy buffer that load_dummy_buffer() created. Restores - * directory to "dirname_start" if not NULL prior to returning, if autocmds or - * the 'autochdir' option have changed it. + * directory to "dirname_start" prior to returning, if autocmds or the + * 'autochdir' option have changed it. */ static void wipe_dummy_buffer(buf_T *buf, char_u *dirname_start) @@ -7078,7 +6832,7 @@ wipe_dummy_buffer(buf_T *buf, char_u *dirname_start) break; } if (!did_one) - goto fail; + return; } if (curbuf != buf && buf->b_nwindows == 0) // safety check @@ -7099,16 +6853,9 @@ wipe_dummy_buffer(buf_T *buf, char_u *dirname_start) // new aborting error, interrupt, or uncaught exception. leave_cleanup(&cs); #endif - if (dirname_start != NULL) - // When autocommands/'autochdir' option changed directory: go back. - restore_start_dir(dirname_start); - - return; + // When autocommands/'autochdir' option changed directory: go back. + restore_start_dir(dirname_start); } - -fail: - // Keeping the buffer, remove the dummy flag. - buf->b_flags &= ~BF_DUMMY; } /* @@ -7192,12 +6939,13 @@ get_errorlist( if (qi == NULL) { - qi = ql_info; + qi = &ql_info; if (wp != NULL) + { qi = GET_LOC_LIST(wp); - if (qi == NULL) - return FAIL; - + if (qi == NULL) + return FAIL; + } } if (eidx < 0) @@ -7276,7 +7024,7 @@ qf_get_list_from_lines(dict_T *what, dictitem_T *di, dict_T *retdict) if (l == NULL) return FAIL; - qi = qf_alloc_stack(QFLT_INTERNAL, 1); + qi = qf_alloc_stack(QFLT_INTERNAL); if (qi != NULL) { if (qf_init_ext(qi, 0, NULL, NULL, &di->di_tv, errorformat, @@ -7285,8 +7033,7 @@ qf_get_list_from_lines(dict_T *what, dictitem_T *di, dict_T *retdict) (void)get_errorlist(qi, NULL, 0, 0, l); qf_free(&qi->qf_lists[0]); } - - qf_free_lists(qi); + free(qi); } dict_add_list(retdict, "items", l); status = OK; @@ -7604,7 +7351,7 @@ qf_getprop_qftf(qf_list_T *qfl, dict_T *retdict) static int qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict) { - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; qf_list_T *qfl; int status = OK; int qf_idx = INVALID_QFIDX; @@ -7617,8 +7364,6 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict) if (wp != NULL) qi = GET_LOC_LIST(wp); - else if (qi == NULL) - return FAIL; flags = qf_getprop_keys2flags(what, (wp != NULL)); @@ -7904,7 +7649,7 @@ qf_add_entries( { entry_to_select = entry; entry_to_select_index = qfl->qf_count; - } + } } // Check if any valid error entries are added to the list. @@ -8234,7 +7979,7 @@ qf_free_stack(win_T *wp, qf_info_T *qi) { // If the location list window is open, then create a new empty // location list - qf_info_T *new_ll = qf_alloc_stack(QFLT_LOCATION, wp->w_p_lhi); + qf_info_T *new_ll = qf_alloc_stack(QFLT_LOCATION); if (new_ll != NULL) { @@ -8264,15 +8009,15 @@ set_errorlist( char_u *title, dict_T *what) { - qf_info_T *qi; + qf_info_T *qi = &ql_info; int retval = OK; if (wp != NULL) + { qi = ll_get_or_alloc_list(wp); - else - qi = ql_info; - if (qi == NULL) - return FAIL; + if (qi == NULL) + return FAIL; + } if (action == 'f') { @@ -8308,7 +8053,7 @@ set_errorlist( static int mark_quickfix_user_data(qf_info_T *qi, int copyID) { int abort = FALSE; - for (int i = 0; i < qi->qf_maxcount && !abort; ++i) + for (int i = 0; i < LISTCOUNT && !abort; ++i) { qf_list_T *qfl = &qi->qf_lists[i]; if (!qfl->qf_has_user_data) @@ -8320,7 +8065,7 @@ static int mark_quickfix_user_data(qf_info_T *qi, int copyID) typval_T* user_data = &qfp->qf_user_data; if (user_data != NULL && user_data->v_type != VAR_NUMBER && user_data->v_type != VAR_STRING && user_data->v_type != VAR_FLOAT) - abort = abort || set_ref_in_item(user_data, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(user_data, copyID, NULL, NULL); } } return abort; @@ -8338,12 +8083,12 @@ mark_quickfix_ctx(qf_info_T *qi, int copyID) typval_T *ctx; callback_T *cb; - for (i = 0; i < qi->qf_maxcount && !abort; ++i) + for (i = 0; i < LISTCOUNT && !abort; ++i) { ctx = qi->qf_lists[i].qf_ctx; if (ctx != NULL && ctx->v_type != VAR_NUMBER && ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT) - abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL); cb = &qi->qf_lists[i].qf_qftf_cb; abort = abort || set_ref_in_callback(cb, copyID); @@ -8363,14 +8108,11 @@ set_ref_in_quickfix(int copyID) tabpage_T *tp; win_T *win; - if (ql_info == NULL) - return TRUE; - - abort = mark_quickfix_ctx(ql_info, copyID); + abort = mark_quickfix_ctx(&ql_info, copyID); if (abort) return abort; - abort = mark_quickfix_user_data(ql_info, copyID); + abort = mark_quickfix_user_data(&ql_info, copyID); if (abort) return abort; @@ -8698,7 +8440,7 @@ hgr_get_ll(int *new_ll) if (qi == NULL) { // Allocate a new location list for help text matches - if ((qi = qf_alloc_stack(QFLT_LOCATION, 1)) == NULL) + if ((qi = qf_alloc_stack(QFLT_LOCATION)) == NULL) return NULL; *new_ll = TRUE; } @@ -8869,7 +8611,7 @@ ex_helpgrep(exarg_T *eap) regmatch_T regmatch; char_u *save_cpo; int save_cpo_allocated; - qf_info_T *qi = ql_info; + qf_info_T *qi = &ql_info; int new_qi = FALSE; char_u *au_name = NULL; char_u *lang = NULL; @@ -8896,11 +8638,6 @@ ex_helpgrep(exarg_T *eap) if (qi == NULL) return; } - else if (qi == NULL) - { - emsg(_(e_no_quickfix_stack)); - return; - } // Make 'cpoptions' empty, the 'l' flag should not be used here. save_cpo = p_cpo; diff --git a/src/regexp.c b/src/regexp.c index 32a721f9..ea6079b0 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -427,9 +427,9 @@ static void skipchr_keepstart(void); static int peekchr(void); static void skipchr(void); static void ungetchr(void); -static vimlong_T gethexchrs(int maxinputlen); +static long gethexchrs(int maxinputlen); static long getoctchrs(void); -static vimlong_T getdecchrs(void); +static long getdecchrs(void); static int coll_get_char(void); static int prog_magic_wrong(void); static int cstrncmp(char_u *s1, char_u *s2, int *n); @@ -979,7 +979,7 @@ ungetchr(void) * The parameter controls the maximum number of input characters. This will be * 2 when reading a \%x20 sequence and 4 when reading a \%u20AC sequence. */ - static vimlong_T + static long gethexchrs(int maxinputlen) { long_u nr = 0; @@ -998,14 +998,14 @@ gethexchrs(int maxinputlen) if (i == 0) return -1; - return nr; + return (long)nr; } /* * Get and return the value of the decimal string immediately after the * current position. Return -1 for invalid. Consumes all digits. */ - static vimlong_T + static long getdecchrs(void) { long_u nr = 0; @@ -1025,7 +1025,7 @@ getdecchrs(void) if (i == 0) return -1; - return nr; + return (long)nr; } /* diff --git a/src/regexp_bt.c b/src/regexp_bt.c index f4bd6c36..16dac730 100644 --- a/src/regexp_bt.c +++ b/src/regexp_bt.c @@ -1589,7 +1589,7 @@ regatom(int *flagp) case 'u': // %uabcd hex 4 case 'U': // %U1234abcd hex 8 { - vimlong_T i; + long i; switch (c) { @@ -1612,7 +1612,7 @@ regatom(int *flagp) if (i == 0) regc(0x0a); else - regmbc((int)i); + regmbc(i); regc(NUL); *flagp |= HASWIDTH; break; @@ -1831,10 +1831,6 @@ regatom(int *flagp) || *regparse == 'U') { startc = coll_get_char(); - // max UTF-8 Codepoint is U+10FFFF, - // but allow values until INT_MAX - if (startc == INT_MAX) - EMSG_RET_NULL(_(e_unicode_val_too_large)); if (startc == 0) regc(0x0a); else @@ -2135,7 +2131,7 @@ regpiece(int *flagp) int lop = END; long nr; - nr = (long)getdecchrs(); + nr = getdecchrs(); switch (no_Magic(getchr())) { case '=': lop = MATCH; break; // \@= @@ -2614,7 +2610,7 @@ vim_regcomp_had_eol(void) static int coll_get_char(void) { - vimlong_T nr = -1; + long nr = -1; switch (*regparse++) { @@ -2624,15 +2620,13 @@ coll_get_char(void) case 'u': nr = gethexchrs(4); break; case 'U': nr = gethexchrs(8); break; } - if (nr < 0) + if (nr < 0 || nr > INT_MAX) { // If getting the number fails be backwards compatible: the character // is a backslash. --regparse; nr = '\\'; } - if (nr > INT_MAX) - nr = INT_MAX; return nr; } diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 6ad682bc..557d0e1a 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -1560,7 +1560,7 @@ nfa_regatom(void) case 'u': // %uabcd hex 4 case 'U': // %U1234abcd hex 8 { - vimlong_T nr; + long nr; switch (c) { @@ -1577,7 +1577,7 @@ nfa_regatom(void) reg_magic == MAGIC_ALL); // A NUL is stored in the text as NL // TODO: what if a composing character follows? - EMIT(nr == 0 ? 0x0a : (long)nr); + EMIT(nr == 0 ? 0x0a : nr); } break; @@ -1953,10 +1953,6 @@ nfa_regatom(void) { // TODO(RE) This needs more testing startc = coll_get_char(); - // max UTF-8 Codepoint is U+10FFFF, - // but allow values until INT_MAX - if (startc == INT_MAX) - EMSG_RET_FAIL(_(e_unicode_val_too_large)); got_coll_char = TRUE; MB_PTR_BACK(old_regparse, regparse); } @@ -2222,7 +2218,7 @@ nfa_regpiece(void) break; case Magic('@'): - c2 = (long)getdecchrs(); + c2 = getdecchrs(); op = no_Magic(getchr()); i = 0; switch(op) diff --git a/src/register.c b/src/register.c index 72d31353..267e0fcc 100644 --- a/src/register.c +++ b/src/register.c @@ -846,7 +846,7 @@ insert_reg( { for (i = 0; i < y_current->y_size; ++i) { - if (regname == '-' && y_current->y_type == MCHAR) + if (regname == '-') { int dir = BACKWARD; if ((State & REPLACE_FLAG) != 0) @@ -867,13 +867,11 @@ insert_reg( do_put(regname, NULL, dir, 1L, PUT_CURSEND); } else - { stuffescaped(y_current->y_array[i].string, literally); - // Insert a newline between lines and after last line if - // y_type is MLINE. - if (y_current->y_type == MLINE || i < y_current->y_size - 1) - stuffcharReadbuff('\n'); - } + // Insert a newline between lines and after last line if + // y_type is MLINE. + if (y_current->y_type == MLINE || i < y_current->y_size - 1) + stuffcharReadbuff('\n'); } } } @@ -2068,8 +2066,7 @@ do_put( else { totlen = count * yanklen; - do - { + do { oldp = ml_get(lnum); oldlen = ml_get_len(lnum); if (lnum > start_lnum) diff --git a/src/screen.c b/src/screen.c index ab37e1d6..b8a9c480 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4712,9 +4712,7 @@ static struct charstab filltab[] = CHARSTAB_ENTRY(&fill_chars.foldsep, "foldsep"), CHARSTAB_ENTRY(&fill_chars.diff, "diff"), CHARSTAB_ENTRY(&fill_chars.eob, "eob"), - CHARSTAB_ENTRY(&fill_chars.lastline, "lastline"), - CHARSTAB_ENTRY(&fill_chars.trunc, "trunc"), - CHARSTAB_ENTRY(&fill_chars.truncrl, "truncrl"), + CHARSTAB_ENTRY(&fill_chars.lastline, "lastline") }; static lcs_chars_T lcs_chars; static struct charstab lcstab[] = @@ -4828,8 +4826,6 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, fill_chars.diff = '-'; fill_chars.eob = '~'; fill_chars.lastline = '@'; - fill_chars.trunc = '>'; - fill_chars.truncrl = '<'; } } p = value; @@ -4841,7 +4837,6 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, continue; s = p + tab[i].name.length + 1; - if (is_listchars && STRCMP(tab[i].name.string, "multispace") == 0) { if (round == 0) @@ -4863,6 +4858,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, tab[i].name.string); + p = s; } else { @@ -4874,8 +4870,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, if (p == last_multispace && lcs_chars.multispace != NULL) lcs_chars.multispace[multispace_pos++] = c1; } + p = s; } - p = s; break; } @@ -4883,7 +4879,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, { if (round == 0) { - // Get length of lcs-leadmultispace string in first + // get length of lcs-leadmultispace string in first // round last_lmultispace = p; lead_multispace_len = 0; @@ -4901,6 +4897,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, tab[i].name.string); + p = s; } else { @@ -4912,8 +4909,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, if (p == last_lmultispace && lcs_chars.leadmultispace != NULL) lcs_chars.leadmultispace[multispace_pos++] = c1; } + p = s; } - p = s; break; } diff --git a/src/search.c b/src/search.c index ea7e6549..abd74416 100644 --- a/src/search.c +++ b/src/search.c @@ -439,7 +439,7 @@ ignorecase(char_u *pat) } /* - * As ignorecase() but pass the "ic" and "scs" flags. + * As ignorecase() put pass the "ic" and "scs" flags. */ int ignorecase_opt(char_u *pat, int ic_in, int scs) @@ -4518,13 +4518,13 @@ fuzzy_match_compute_score( } // Check exact match condition - if (currIdx != (int_u)i) + if (currIdx != (int_u)i) is_exact_match = FALSE; } // Boost score for exact matches if (is_exact_match && numMatches == strSz) - score += EXACT_MATCH_BONUS; + score += EXACT_MATCH_BONUS; return score; } @@ -5265,7 +5265,7 @@ fuzzy_match_str_in_line( char_u *line_end = NULL; if (str == NULL || pat == NULL) - return found; + return found; line_end = find_line_end(str); while (str < line_end) @@ -5333,19 +5333,18 @@ search_for_fuzzy_match( int whole_line = ctrl_x_mode_whole_line(); if (buf == curbuf) - circly_end = *start_pos; + circly_end = *start_pos; else { - circly_end.lnum = buf->b_ml.ml_line_count; - circly_end.col = 0; - circly_end.coladd = 0; + circly_end.lnum = buf->b_ml.ml_line_count; + circly_end.col = 0; + circly_end.coladd = 0; } if (whole_line && start_pos->lnum != pos->lnum) current_pos.lnum += dir; - do - { + do { // Check if looped around and back to start position if (looped_around && EQUAL_POS(current_pos, circly_end)) @@ -5371,6 +5370,30 @@ search_for_fuzzy_match( len, ¤t_pos, score); if (found_new_match) { + if (ctrl_x_mode_normal()) + { + if (STRNCMP(*ptr, pattern, *len) == 0 && pattern[*len] == NUL) + { + char_u *next_word_end = find_word_start(*ptr + *len); + if (*next_word_end != NUL && *next_word_end != NL) + { + // Find end of the word. + if (has_mbyte) + while (*next_word_end != NUL) + { + int l = (*mb_ptr2len)(next_word_end); + + if (l < 2 && !vim_iswordc(*next_word_end)) + break; + next_word_end += l; + } + else + next_word_end = find_word_end(next_word_end); + } + + *len = next_word_end - *ptr; + } + } *pos = current_pos; break; } diff --git a/src/session.c b/src/session.c index 56d368ac..eea57a23 100644 --- a/src/session.c +++ b/src/session.c @@ -1072,7 +1072,7 @@ ex_loadview(exarg_T *eap) if (fname == NULL) return; - (void)do_source(fname, FALSE, DOSO_NONE, NULL); + do_source(fname, FALSE, DOSO_NONE, NULL); vim_free(fname); } diff --git a/src/strings.c b/src/strings.c index 16a09f83..d6f1b382 100644 --- a/src/strings.c +++ b/src/strings.c @@ -603,9 +603,9 @@ vim_strnicmp_asc(char *s1, char *s2, size_t len) { i = TOLOWER_ASC(*s1) - TOLOWER_ASC(*s2); if (i != 0) - break; // this character is different + break; // this character is different if (*s1 == NUL) - break; // strings match until NUL + break; // strings match until NUL ++s1; ++s2; --len; @@ -2487,33 +2487,6 @@ vim_snprintf(char *str, size_t str_m, const char *fmt, ...) return str_l; } -/* - * Like vim_snprintf() except the return value can be safely used to increment a - * buffer length. - * Normal `snprintf()` (and `vim_snprintf()`) returns the number of bytes that - * would have been copied if the destination buffer was large enough. - * This means that you cannot rely on it's return value for the destination - * length because the destination may be shorter than the source. This function - * guarantees the returned length will never be greater than the destination length. - */ - size_t -vim_snprintf_safelen(char *str, size_t str_m, const char *fmt, ...) -{ - va_list ap; - int str_l; - - va_start(ap, fmt); - str_l = vim_vsnprintf(str, str_m, fmt, ap); - va_end(ap); - - if (str_l < 0) - { - *str = NUL; - return 0; - } - return ((size_t)str_l >= str_m) ? str_m - 1 : (size_t)str_l; -} - int vim_vsnprintf( char *str, @@ -2782,7 +2755,7 @@ format_overflow_error(const char *pstart) semsg(_(e_out_of_memory_allocating_nr_bytes), arglen); } -#define MAX_ALLOWED_STRING_WIDTH 1048576 // 1 MiB +#define MAX_ALLOWED_STRING_WIDTH 6400 static int get_unsigned_int( diff --git a/src/structs.h b/src/structs.h index caf61eda..ce98bcef 100644 --- a/src/structs.h +++ b/src/structs.h @@ -73,7 +73,6 @@ typedef struct listvar_S list_T; typedef struct dictvar_S dict_T; typedef struct partial_S partial_T; typedef struct blobvar_S blob_T; -typedef struct tuplevar_S tuple_T; typedef struct window_S win_T; typedef struct wininfo_S wininfo_T; @@ -276,8 +275,6 @@ typedef struct #if defined(FEAT_QUICKFIX) int wo_pvw; # define w_p_pvw w_onebuf_opt.wo_pvw // 'previewwindow' - long wo_lhi; -# define w_p_lhi w_onebuf_opt.wo_lhi // 'lhistory' #endif #ifdef FEAT_RIGHTLEFT int wo_rl; @@ -1514,8 +1511,7 @@ typedef enum VAR_INSTR, // "v_instr" is used VAR_CLASS, // "v_class" is used (also used for interface) VAR_OBJECT, // "v_object" is used - VAR_TYPEALIAS, // "v_typealias" is used - VAR_TUPLE // "v_tuple" is used + VAR_TYPEALIAS // "v_typealias" is used } vartype_T; // A type specification. @@ -1683,7 +1679,6 @@ struct typval_S class_T *v_class; // class value (can be NULL) object_T *v_object; // object value (can be NULL) typealias_T *v_typealias; // user-defined type name - tuple_T *v_tuple; // tuple } vval; }; @@ -1823,21 +1818,6 @@ struct blobvar_S char bv_lock; // zero, VAR_LOCKED, VAR_FIXED }; -/* - * Structure to hold info about a tuple. - */ -struct tuplevar_S -{ - garray_T tv_items; // tuple items - type_T *tv_type; // current type, allocated by alloc_type() - tuple_T *tv_copytuple; // copied tuple used by deepcopy() - tuple_T *tv_used_next; // next tuple in used tuples list - tuple_T *tv_used_prev; // previous tuple in used tuples list - int tv_refcount; // reference count - int tv_copyID; // ID used by deepcopy() - char tv_lock; // zero, VAR_LOCKED, VAR_FIXED -}; - typedef int (*cfunc_T)(int argcount, typval_T *argvars, typval_T *rettv, void *state); typedef void (*cfunc_free_T)(void *state); @@ -1866,8 +1846,6 @@ typedef struct blob_T *fi_blob; // blob being used char_u *fi_string; // copy of string being used int fi_byte_idx; // byte index in fi_string - tuple_T *fi_tuple; // tuple being used - int fi_tuple_idx; // tuple index in fi_tuple int fi_cs_flags; // cs_flags or'ed together } forinfo_T; @@ -1976,7 +1954,7 @@ struct ufunc_S #define FC_DEAD 0x80 // function kept only for reference to dfunc #define FC_EXPORT 0x100 // "export def Func()" #define FC_NOARGS 0x200 // no a: variables in lambda -#define FC_VIM9 0x400 // defined in Vim9 script file +#define FC_VIM9 0x400 // defined in vim9 script file #define FC_CFUNC 0x800 // defined as Lua C func #define FC_COPY 0x1000 // copy of another function by // copy_lambda_to_global_func() @@ -2842,15 +2820,6 @@ typedef struct list_stack_S struct list_stack_S *prev; } list_stack_T; -/* - * structure used for explicit stack while garbage collecting tuples - */ -typedef struct tuple_stack_S -{ - tuple_T *tuple; - struct tuple_stack_S *prev; -} tuple_stack_T; - /* * Structure used for iterating over dictionary items. * Initialize with dict_iterate_start(). @@ -3072,7 +3041,7 @@ struct file_buffer int b_locked; // Buffer is being closed or referenced, don't // let autocommands wipe it out. int b_locked_split; // Buffer is being closed, don't allow opening - // it in more windows. + // a new window with it. /* * b_ffname has the full path of the file (NULL for no name). @@ -3302,7 +3271,6 @@ struct file_buffer char_u *b_p_fo; // 'formatoptions' char_u *b_p_flp; // 'formatlistpat' int b_p_inf; // 'infercase' - char_u *b_p_ise; // 'isexpand' local value char_u *b_p_isk; // 'iskeyword' #ifdef FEAT_FIND_ID char_u *b_p_def; // 'define' local value @@ -3574,17 +3542,14 @@ struct file_buffer * and how many lines it occupies in that buffer. When the lines are missing * in the buffer the df_count[] is zero. This is all counted in * buffer lines. - * There is always at least one unchanged line in between the diffs (unless - * linematch is used). Otherwise it would have been included in the diff above - * or below it. + * There is always at least one unchanged line in between the diffs. + * Otherwise it would have been included in the diff above or below it. * df_lnum[] + df_count[] is the lnum below the change. When in one buffer * lines have been inserted, in the other buffer df_lnum[] is the line below * the insertion and df_count[] is zero. When appending lines at the end of * the buffer, df_lnum[] is one beyond the end! * This is using a linked list, because the number of differences is expected * to be reasonable small. The list is sorted on lnum. - * Each diffblock also contains a cached list of inline diff of changes within - * the block, used for highlighting. */ typedef struct diffblock_S diff_T; struct diffblock_S @@ -3594,37 +3559,6 @@ struct diffblock_S linenr_T df_count[DB_COUNT]; // nr of inserted/changed lines int is_linematched; // has the linematch algorithm ran on this diff hunk to divide it into // smaller diff hunks? - - int has_changes; // has cached list of inline changes - garray_T df_changes; // list of inline changes (diffline_change_T) -}; - -/* - * Each entry stores a single inline change within a diff block. Line numbers - * are recorded as relative offsets, and columns are byte offsets, not - * character counts. - * Ranges are [start,end), with the end being exclusive. - */ -typedef struct diffline_change_S diffline_change_T; -struct diffline_change_S -{ - colnr_T dc_start[DB_COUNT]; // byte offset of start of range in the line - colnr_T dc_end[DB_COUNT]; // 1 past byte offset of end of range in line - int dc_start_lnum_off[DB_COUNT]; // starting line offset - int dc_end_lnum_off[DB_COUNT]; // end line offset -}; - -/* - * Describes a single line's list of inline changes. Use diff_change_parse() to - * parse this. - */ -typedef struct diffline_S diffline_T; -struct diffline_S -{ - diffline_change_T *changes; - int num_changes; - int bufidx; - int lineoff; }; #endif @@ -3851,8 +3785,6 @@ typedef struct int diff; int eob; int lastline; - int trunc; - int truncrl; } fill_chars_T; /* @@ -4760,7 +4692,6 @@ typedef struct lval_S char_u *ll_newkey; // New key for Dict in alloc. mem or NULL. type_T *ll_valtype; // type expected for the value or NULL blob_T *ll_blob; // The Blob or NULL - tuple_T *ll_tuple; // tuple or NULL ufunc_T *ll_ufunc; // The function or NULL object_T *ll_object; // The object or NULL, class is not NULL class_T *ll_class; // The class or NULL, object may be NULL diff --git a/src/tag.c b/src/tag.c index b36415c9..f61f1167 100644 --- a/src/tag.c +++ b/src/tag.c @@ -1481,7 +1481,6 @@ find_tagfunc_tags( save_pos = curwin->w_cursor; result = call_callback(&curbuf->b_tfu_cb, 0, &rettv, 3, args); curwin->w_cursor = save_pos; // restore the cursor position - check_cursor(); // make sure cursor position is valid --d->dv_refcount; if (result == FAIL) @@ -1835,8 +1834,7 @@ findtags_in_help_init(findtags_state_T *st) * Use the function set in 'tagfunc' (if configured and enabled) to get the * tags. * Return OK if at least 1 tag has been successfully found, NOTDONE if the - * 'tagfunc' is not used, still executing or the 'tagfunc' returned v:null and - * FAIL otherwise. + * 'tagfunc' is not used or the 'tagfunc' returns v:null and FAIL otherwise. */ static int findtags_apply_tfu(findtags_state_T *st, char_u *pat, char_u *buf_ffname) diff --git a/src/term.c b/src/term.c index 5c030ed2..b356ca2b 100644 --- a/src/term.c +++ b/src/term.c @@ -67,20 +67,15 @@ static int term_is_builtin(char_u *name); static int term_7to8bit(char_u *p); static void accept_modifiers_for_function_keys(void); -#if 0 // Change to 1 to enable ch_log() calls for termresponse debugging. -# define DEBUG_TERMRESPONSE -# define LOG_TR1(str) \ - ch_log(NULL, "TermResp: %s " str, \ - must_redraw == UPD_NOT_VALID ? "NV" \ - : must_redraw == UPD_CLEAR ? "CL" : " ") -# define LOG_TRN(fmt,...) \ - ch_log(NULL, "TermResp: %s " fmt, \ - must_redraw == UPD_NOT_VALID ? "NV" \ - : must_redraw == UPD_CLEAR ? "CL" : " ", __VA_ARGS__) -#else -# define LOG_TR1(str) do { /**/ } while (0) -# define LOG_TRN(fmt,...) do { /**/ } while (0) -#endif +# if 0 // Change to 1 to enable ch_log() calls for termresponse debugging. +# define DEBUG_TERMRESPONSE +# define LOG_TR(fmt,...) \ + ch_log(NULL, "TermResp: %s " fmt, \ + must_redraw == UPD_NOT_VALID ? "NV" \ + : must_redraw == UPD_CLEAR ? "CL" : " ", ##__VA_ARGS__) +# else +# define LOG_TR(fmt,...) do { /**/ } while (0) +# endif #ifdef HAVE_TGETENT static char *invoke_tgetent(char_u *, char_u *); @@ -104,7 +99,7 @@ typedef struct { time_t tr_start; // when request was sent, -1 for never } termrequest_T; -#define TERMREQUEST_INIT {STATUS_GET, -1} +# define TERMREQUEST_INIT {STATUS_GET, -1} // Request Terminal Version status: static termrequest_T crv_status = TERMREQUEST_INIT; @@ -143,9 +138,9 @@ static termrequest_T *all_termrequests[] = { &crv_status, &u7_status, &xcc_status, -# ifdef FEAT_TERMINAL +# ifdef FEAT_TERMINAL &rfg_status, -# endif +# endif &rbg_status, &rbm_status, &rcs_status, @@ -173,9 +168,9 @@ int write_t_8u_state = FALSE; # ifndef HAVE_OSPEED # ifdef OSPEED_EXTERN extern short ospeed; -# else +# else short ospeed; -# endif +# endif # endif # ifndef HAVE_UP_BC_PC # ifdef UP_BC_PC_EXTERN @@ -235,33 +230,33 @@ typedef struct static tcap_entry_T builtin_ansi[] = { {(int)KS_CE, "\033[K"}, {(int)KS_AL, "\033[L"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "\033[%p1%dL"}, -#else +# else {(int)KS_CAL, "\033[%dL"}, -#endif +# endif {(int)KS_DL, "\033[M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "\033[%p1%dM"}, -#else +# else {(int)KS_CDL, "\033[%dM"}, -#endif +# endif {(int)KS_CL, "\033[H\033[2J"}, {(int)KS_ME, "\033[0m"}, {(int)KS_MR, "\033[7m"}, {(int)KS_MS, "y"}, {(int)KS_UT, "y"}, // guessed {(int)KS_LE, "\b"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, -#else +# else {(int)KS_CM, "\033[%i%d;%dH"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CRI, "\033[%p1%dC"}, -#else +# else {(int)KS_CRI, "\033[%dC"}, -#endif +# endif {(int)KS_NAME, NULL} // end marker }; @@ -275,17 +270,17 @@ static tcap_entry_T builtin_ansi[] = { static tcap_entry_T builtin_vt320[] = { {(int)KS_CE, "\033[K"}, {(int)KS_AL, "\033[L"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "\033[%p1%dL"}, -#else +# else {(int)KS_CAL, "\033[%dL"}, -#endif +# endif {(int)KS_DL, "\033[M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "\033[%p1%dM"}, -#else +# else {(int)KS_CDL, "\033[%dM"}, -#endif +# endif {(int)KS_CL, "\033[H\033[2J"}, {(int)KS_CD, "\033[J"}, {(int)KS_CCO, "8"}, // allow 8 colors @@ -305,16 +300,16 @@ static tcap_entry_T builtin_vt320[] = { {(int)KS_UT, "y"}, {(int)KS_XN, "y"}, {(int)KS_LE, "\b"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, -#else +# else {(int)KS_CM, "\033[%i%d;%dH"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CRI, "\033[%p1%dC"}, -#else +# else {(int)KS_CRI, "\033[%dC"}, -#endif +# endif {K_UP, "\033[A"}, {K_DOWN, "\033[B"}, {K_RIGHT, "\033[C"}, @@ -375,11 +370,11 @@ static tcap_entry_T builtin_vt320[] = { static tcap_entry_T builtin_vt52[] = { {(int)KS_CE, "\033K"}, {(int)KS_CD, "\033J"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033Y%p1%' '%+%c%p2%' '%+%c"}, -#else +# else {(int)KS_CM, "\033Y%+ %+ "}, -#endif +# endif {(int)KS_LE, "\b"}, {(int)KS_SR, "\033I"}, {(int)KS_AL, "\033L"}, @@ -403,22 +398,22 @@ static tcap_entry_T builtin_vt52[] = { static tcap_entry_T builtin_xterm[] = { {(int)KS_CE, "\033[K"}, {(int)KS_AL, "\033[L"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "\033[%p1%dL"}, -#else +# else {(int)KS_CAL, "\033[%dL"}, -#endif +# endif {(int)KS_DL, "\033[M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "\033[%p1%dM"}, -#else +# else {(int)KS_CDL, "\033[%dM"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CS, "\033[%i%p1%d;%p2%dr"}, -#else +# else {(int)KS_CS, "\033[%i%d;%dr"}, -#endif +# endif {(int)KS_CL, "\033[H\033[2J"}, {(int)KS_CD, "\033[J"}, {(int)KS_ME, "\033[m"}, @@ -435,30 +430,30 @@ static tcap_entry_T builtin_xterm[] = { {(int)KS_VE, "\033[?25h"}, {(int)KS_VS, "\033[?12h"}, {(int)KS_CVS, "\033[?12l"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CSH, "\033[%p1%d q"}, -#else +# else {(int)KS_CSH, "\033[%d q"}, -#endif +# endif {(int)KS_CRC, "\033[?12$p"}, {(int)KS_CRS, "\033P$q q\033\\"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, -#else +# else {(int)KS_CM, "\033[%i%d;%dH"}, -#endif +# endif {(int)KS_SR, "\033M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CRI, "\033[%p1%dC"}, -#else +# else {(int)KS_CRI, "\033[%dC"}, -#endif +# endif {(int)KS_KS, "\033[?1h\033="}, {(int)KS_KE, "\033[?1l\033>"}, -#ifdef FEAT_XTERM_SAVE +# ifdef FEAT_XTERM_SAVE {(int)KS_TI, "\0337\033[?47h"}, {(int)KS_TE, "\033[?47l\0338"}, -#endif +# endif // These are now under control of the 'keyprotocol' option, see // "builtin_mok2". // {(int)KS_CTI, "\033[>4;2m"}, @@ -470,15 +465,15 @@ static tcap_entry_T builtin_xterm[] = { {(int)KS_FS, "\007"}, {(int)KS_CSC, "\033]12;"}, {(int)KS_CEC, "\007"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CWS, "\033[8;%p1%d;%p2%dt"}, {(int)KS_CWP, "\033[3;%p1%d;%p2%dt"}, {(int)KS_CGP, "\033[13t"}, -#else +# else {(int)KS_CWS, "\033[8;%d;%dt"}, {(int)KS_CWP, "\033[3;%d;%dt"}, {(int)KS_CGP, "\033[13t"}, -#endif +# endif {(int)KS_CRV, "\033[>c"}, {(int)KS_CXM, "\033[?1006;1000%?%p1%{1}%=%th%el%;"}, {(int)KS_RFG, "\033]10;?\007"}, @@ -491,10 +486,10 @@ static tcap_entry_T builtin_xterm[] = { {(int)KS_CRT, "\033[23;2t"}, {(int)KS_SSI, "\033[22;1t"}, {(int)KS_SRI, "\033[23;1t"}, -#if (defined(UNIX) || defined(VMS)) +# if (defined(UNIX) || defined(VMS)) {(int)KS_FD, "\033[?1004l"}, {(int)KS_FE, "\033[?1004h"}, -#endif +# endif {K_UP, "\033O*A"}, {K_DOWN, "\033O*B"}, @@ -658,23 +653,23 @@ static tcap_entry_T builtin_iris_ansi[] = { {(int)KS_CE, "\033[K"}, {(int)KS_CD, "\033[J"}, {(int)KS_AL, "\033[L"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "\033[%p1%dL"}, -#else +# else {(int)KS_CAL, "\033[%dL"}, -#endif +# endif {(int)KS_DL, "\033[M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "\033[%p1%dM"}, -#else +# else {(int)KS_CDL, "\033[%dM"}, -#endif +# endif #if 0 // The scroll region is not working as Vim expects. -# ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CS, "\033[%i%p1%d;%p2%dr"}, -# else +# else {(int)KS_CS, "\033[%i%d;%dr"}, -# endif +# endif #endif {(int)KS_CL, "\033[H\033[2J"}, {(int)KS_VE, "\033[9/y\033[12/y"}, // These aren't documented @@ -691,42 +686,42 @@ static tcap_entry_T builtin_iris_ansi[] = { {(int)KS_CZR, "\033[23m"}, // italic mode off {(int)KS_US, "\033[4m"}, // underline on {(int)KS_UE, "\033[24m"}, // underline off -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAB, "\033[4%p1%dm"}, // set background color (ANSI) {(int)KS_CAF, "\033[3%p1%dm"}, // set foreground color (ANSI) {(int)KS_CSB, "\033[102;%p1%dm"}, // set screen background color {(int)KS_CSF, "\033[101;%p1%dm"}, // set screen foreground color -#else +# else {(int)KS_CAB, "\033[4%dm"}, // set background color (ANSI) {(int)KS_CAF, "\033[3%dm"}, // set foreground color (ANSI) {(int)KS_CSB, "\033[102;%dm"}, // set screen background color {(int)KS_CSF, "\033[101;%dm"}, // set screen foreground color -#endif +# endif {(int)KS_MS, "y"}, // guessed {(int)KS_UT, "y"}, // guessed {(int)KS_LE, "\b"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, -#else +# else {(int)KS_CM, "\033[%i%d;%dH"}, -#endif +# endif {(int)KS_SR, "\033M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CRI, "\033[%p1%dC"}, -#else +# else {(int)KS_CRI, "\033[%dC"}, -#endif +# endif {(int)KS_CIS, "\033P3.y"}, {(int)KS_CIE, "\234"}, // ST "String Terminator" {(int)KS_TS, "\033P1.y"}, {(int)KS_FS, "\234"}, // ST "String Terminator" -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CWS, "\033[203;%p1%d;%p2%d/y"}, {(int)KS_CWP, "\033[205;%p1%d;%p2%d/y"}, -#else +# else {(int)KS_CWS, "\033[203;%d;%d/y"}, {(int)KS_CWP, "\033[205;%d;%d/y"}, -#endif +# endif {K_UP, "\033[A"}, {K_DOWN, "\033[B"}, {K_LEFT, "\033[D"}, @@ -789,27 +784,27 @@ static tcap_entry_T builtin_pcansi[] = { {(int)KS_US, "\033[36;41m"}, // underscore mode: cyan text on red {(int)KS_UE, "\033[0m"}, // underscore mode end {(int)KS_CCO, "8"}, // allow 8 colors -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAB, "\033[4%p1%dm"},// set background color {(int)KS_CAF, "\033[3%p1%dm"},// set foreground color -#else +# else {(int)KS_CAB, "\033[4%dm"}, // set background color {(int)KS_CAF, "\033[3%dm"}, // set foreground color -#endif +# endif {(int)KS_OP, "\033[0m"}, // reset colors {(int)KS_MS, "y"}, {(int)KS_UT, "y"}, // guessed {(int)KS_LE, "\b"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, -#else +# else {(int)KS_CM, "\033[%i%d;%dH"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CRI, "\033[%p1%dC"}, -#else +# else {(int)KS_CRI, "\033[%dC"}, -#endif +# endif {K_UP, "\316H"}, {K_DOWN, "\316P"}, {K_LEFT, "\316K"}, @@ -858,19 +853,19 @@ static tcap_entry_T builtin_pcansi[] = { static tcap_entry_T builtin_win32[] = { {(int)KS_CE, "\033|K"}, // clear to end of line {(int)KS_AL, "\033|L"}, // add new blank line -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "\033|%p1%dL"}, // add number of new blank lines -#else +# else {(int)KS_CAL, "\033|%dL"}, // add number of new blank lines -#endif +# endif {(int)KS_DL, "\033|M"}, // delete line -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "\033|%p1%dM"}, // delete number of lines {(int)KS_CSV, "\033|%p1%d;%p2%dV"}, -#else +# else {(int)KS_CDL, "\033|%dM"}, // delete number of lines {(int)KS_CSV, "\033|%d;%dV"}, -#endif +# endif {(int)KS_CL, "\033|J"}, // clear screen {(int)KS_CD, "\033|j"}, // clear to end of display {(int)KS_VI, "\033|v"}, // cursor invisible @@ -891,31 +886,31 @@ static tcap_entry_T builtin_win32[] = { {(int)KS_US, "\033|67m"}, // underscore: cyan text on red {(int)KS_UE, "\033|0m"}, // underscore end {(int)KS_CCO, "16"}, // allow 16 colors -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAB, "\033|%p1%db"}, // set background color {(int)KS_CAF, "\033|%p1%df"}, // set foreground color -#else +# else {(int)KS_CAB, "\033|%db"}, // set background color {(int)KS_CAF, "\033|%df"}, // set foreground color -#endif +# endif {(int)KS_MS, "y"}, // save to move cur in reverse mode {(int)KS_UT, "y"}, {(int)KS_XN, "y"}, {(int)KS_LE, "\b"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033|%i%p1%d;%p2%dH"}, // cursor motion -#else +# else {(int)KS_CM, "\033|%i%d;%dH"}, // cursor motion -#endif +# endif {(int)KS_VB, "\033|B"}, // visual bell {(int)KS_TI, "\033|S"}, // put terminal in termcap mode {(int)KS_TE, "\033|E"}, // out of termcap mode -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CS, "\033|%i%p1%d;%p2%dr"}, // scroll region -#else +# else {(int)KS_CS, "\033|%i%d;%dr"}, // scroll region -#endif +# endif {K_UP, "\316H"}, {K_DOWN, "\316P"}, @@ -1043,17 +1038,17 @@ static tcap_entry_T builtin_amiga[] = { {(int)KS_CE, "\033[K"}, {(int)KS_CD, "\033[J"}, {(int)KS_AL, "\033[L"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "\033[%p1%dL"}, -#else +# else {(int)KS_CAL, "\033[%dL"}, -#endif +# endif {(int)KS_DL, "\033[M"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "\033[%p1%dM"}, -#else +# else {(int)KS_CDL, "\033[%dM"}, -#endif +# endif {(int)KS_CL, "\014"}, {(int)KS_VI, "\033[0 p"}, {(int)KS_VE, "\033[1 p"}, @@ -1068,31 +1063,31 @@ static tcap_entry_T builtin_amiga[] = { {(int)KS_CZR, "\033[0m"}, #if defined(__amigaos4__) || defined(__MORPHOS__) || defined(__AROS__) {(int)KS_CCO, "8"}, // allow 8 colors -# ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAB, "\033[4%p1%dm"},// set background color {(int)KS_CAF, "\033[3%p1%dm"},// set foreground color -# else +# else {(int)KS_CAB, "\033[4%dm"}, // set background color {(int)KS_CAF, "\033[3%dm"}, // set foreground color -# endif +# endif {(int)KS_OP, "\033[m"}, // reset colors #endif {(int)KS_MS, "y"}, {(int)KS_UT, "y"}, // guessed {(int)KS_LE, "\b"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, -#else +# else {(int)KS_CM, "\033[%i%d;%dH"}, -#endif +# endif #if defined(__MORPHOS__) {(int)KS_SR, "\033M"}, #endif -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CRI, "\033[%p1%dC"}, -#else +# else {(int)KS_CRI, "\033[%dC"}, -#endif +# endif {K_UP, "\233A"}, {K_DOWN, "\233B"}, {K_LEFT, "\233D"}, @@ -1158,38 +1153,38 @@ static tcap_entry_T builtin_debug[] = { {(int)KS_CE, "[CE]"}, {(int)KS_CD, "[CD]"}, {(int)KS_AL, "[AL]"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CAL, "[CAL%p1%d]"}, -#else +# else {(int)KS_CAL, "[CAL%d]"}, -#endif +# endif {(int)KS_DL, "[DL]"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CDL, "[CDL%p1%d]"}, -#else +# else {(int)KS_CDL, "[CDL%d]"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CS, "[%p1%dCS%p2%d]"}, -#else +# else {(int)KS_CS, "[%dCS%d]"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CSV, "[%p1%dCSV%p2%d]"}, -#else +# else {(int)KS_CSV, "[%dCSV%d]"}, -#endif -#ifdef TERMINFO +# endif +# ifdef TERMINFO {(int)KS_CAB, "[CAB%p1%d]"}, {(int)KS_CAF, "[CAF%p1%d]"}, {(int)KS_CSB, "[CSB%p1%d]"}, {(int)KS_CSF, "[CSF%p1%d]"}, -#else +# else {(int)KS_CAB, "[CAB%d]"}, {(int)KS_CAF, "[CAF%d]"}, {(int)KS_CSB, "[CSB%d]"}, {(int)KS_CSF, "[CSF%d]"}, -#endif +# endif {(int)KS_CAU, "[CAU%d]"}, {(int)KS_OP, "[OP]"}, {(int)KS_LE, "[LE]"}, @@ -1215,17 +1210,17 @@ static tcap_entry_T builtin_debug[] = { {(int)KS_MS, "[MS]"}, {(int)KS_UT, "[UT]"}, {(int)KS_XN, "[XN]"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CM, "[%p1%dCM%p2%d]"}, -#else +# else {(int)KS_CM, "[%dCM%d]"}, -#endif +# endif {(int)KS_SR, "[SR]"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CRI, "[CRI%p1%d]"}, -#else +# else {(int)KS_CRI, "[CRI%d]"}, -#endif +# endif {(int)KS_VB, "[VB]"}, {(int)KS_KS, "[KS]"}, {(int)KS_KE, "[KE]"}, @@ -1237,13 +1232,13 @@ static tcap_entry_T builtin_debug[] = { {(int)KS_CEC, "[CEC]"}, {(int)KS_TS, "[TS]"}, {(int)KS_FS, "[FS]"}, -#ifdef TERMINFO +# ifdef TERMINFO {(int)KS_CWS, "[%p1%dCWS%p2%d]"}, {(int)KS_CWP, "[%p1%dCWP%p2%d]"}, -#else +# else {(int)KS_CWS, "[%dCWS%d]"}, {(int)KS_CWP, "[%dCWP%d]"}, -#endif +# endif {(int)KS_CRV, "[CRV]"}, {(int)KS_CXM, "[CXM]"}, {(int)KS_U7, "[U7]"}, @@ -1668,11 +1663,11 @@ set_color_count(int nr) else *nr_colors = NUL; #if 0 -# ifdef FEAT_TERMGUICOLORS +#ifdef FEAT_TERMGUICOLORS // xterm-direct, enable termguicolors, when it wasn't set yet if (t_colors == 0x1000000 && !p_tgc_set) set_option_value((char_u *)"termguicolors", 1L, NULL, 0); -# endif +#endif #endif set_string_option_direct((char_u *)"t_Co", -1, nr_colors, OPT_FREE, 0); } @@ -1696,7 +1691,7 @@ may_adjust_color_count(int val) { int r = redraw_asap(UPD_CLEAR); - LOG_TRN("Received t_Co, redraw_asap(): %d", r); + LOG_TR("Received t_Co, redraw_asap(): %d", r); } #else redraw_asap(UPD_CLEAR); @@ -1710,7 +1705,7 @@ static char *(key_names[]) = // Do those ones first, both may cause a screen redraw. "Co", // disabled, because it switches termguicolors, but that - // is noticeable and confuses users + // is noticable and confuses users // "RGB", # endif "ku", "kd", "kr", "kl", @@ -1794,9 +1789,9 @@ get_term_entries(int *height, int *width) if (term_strings_not_set(string_names[i].dest)) { TERM_STR(string_names[i].dest) = TGETSTR(string_names[i].name, &tp); -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL set_term_option_sctx_idx(string_names[i].name, -1); -# endif +#endif } } @@ -1844,9 +1839,9 @@ get_term_entries(int *height, int *width) if (term_strings_not_set(KS_CCO)) { set_color_count(tgetnum("Co")); -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL set_term_option_sctx_idx("Co", -1); -# endif +#endif } # ifndef hpux @@ -2248,9 +2243,9 @@ set_termname(char_u *term) reset_option_was_set((char_u *)"ttym"); } if (p == NULL -# ifdef FEAT_GUI +# ifdef FEAT_GUI || gui.in_use -# endif +# endif ) check_mouse_termcode(); // set mouse termcode anyway } @@ -2305,7 +2300,7 @@ set_termname(char_u *term) full_screen = TRUE; // we can use termcap codes from now on set_term_defaults(); // use current values as defaults #ifdef FEAT_TERMRESPONSE - LOG_TR1("setting crv_status to STATUS_GET"); + LOG_TR("setting crv_status to STATUS_GET"); crv_status.tr_progress = STATUS_GET; // Get terminal version later write_t_8u_state = FALSE; #endif @@ -2424,11 +2419,11 @@ invoke_tgetent(char_u *tbuf, char_u *term) return _(e_cannot_open_termcap_file); if (i == 0) # endif -# ifdef TERMINFO +#ifdef TERMINFO return _(e_terminal_entry_not_found_in_terminfo); -# else +#else return _(e_terminal_entry_not_found_in_termcap); -# endif +#endif } return NULL; } @@ -3090,7 +3085,7 @@ static int winpos_x = -1; static int winpos_y = -1; static int did_request_winpos = 0; -# if defined(FEAT_EVAL) || defined(FEAT_TERMINAL) || defined(PROTO) +# if defined(FEAT_EVAL) || defined(FEAT_TERMINAL) || defined(PROTO) /* * Try getting the Vim window position from the terminal. * Returns OK or FAIL. @@ -3263,21 +3258,21 @@ term_bg_default(void) #if defined(FEAT_TERMGUICOLORS) || defined(PROTO) -# define RED(rgb) (((long_u)(rgb) >> 16) & 0xFF) -# define GREEN(rgb) (((long_u)(rgb) >> 8) & 0xFF) -# define BLUE(rgb) (((long_u)(rgb) ) & 0xFF) +#define RED(rgb) (((long_u)(rgb) >> 16) & 0xFF) +#define GREEN(rgb) (((long_u)(rgb) >> 8) & 0xFF) +#define BLUE(rgb) (((long_u)(rgb) ) & 0xFF) static void term_rgb_color(char_u *s, guicolor_T rgb) { -# define MAX_COLOR_STR_LEN 100 +#define MAX_COLOR_STR_LEN 100 char buf[MAX_COLOR_STR_LEN]; if (*s == NUL) return; vim_snprintf(buf, MAX_COLOR_STR_LEN, (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb)); -# ifdef FEAT_VTP +#ifdef FEAT_VTP if (use_vtp() && (p_tgc || t_colors >= 256)) { out_flush(); @@ -3285,7 +3280,7 @@ term_rgb_color(char_u *s, guicolor_T rgb) vtp_printf(buf); } else -# endif +#endif OUT_STR(buf); } @@ -4085,7 +4080,7 @@ may_req_termresponse(void) && *T_CRV != NUL) { MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending CRV request"); + LOG_TR("Sending CRV request"); out_str(T_CRV); termrequest_sent(&crv_status); // check for the characters now, otherwise they might be eaten by @@ -4124,7 +4119,7 @@ check_terminal_behavior(void) // changes cursor position, so it must be called immediately after // entering termcap mode. MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending request for ambiwidth check"); + LOG_TR("Sending request for ambiwidth check"); // Do this in the second row. In the first row the returned sequence // may be CSI 1;2R, which is the same as . term_windgoto(1, 0); @@ -4153,7 +4148,7 @@ check_terminal_behavior(void) // handles test sequence incorrectly, a garbage string is displayed and // the cursor does move. MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending xterm compatibility test sequence."); + LOG_TR("Sending xterm compatibility test sequence."); // Do this in the third row. Second row is used by ambiguous // character width check. term_windgoto(2, 0); @@ -4204,7 +4199,7 @@ may_req_bg_color(void) if (rfg_status.tr_progress == STATUS_GET && *T_RFG != NUL) { MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending FG request"); + LOG_TR("Sending FG request"); out_str(T_RFG); termrequest_sent(&rfg_status); didit = TRUE; @@ -4215,7 +4210,7 @@ may_req_bg_color(void) if (rbg_status.tr_progress == STATUS_GET && *T_RBG != NUL) { MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending BG request"); + LOG_TR("Sending BG request"); out_str(T_RBG); termrequest_sent(&rbg_status); didit = TRUE; @@ -4399,13 +4394,13 @@ term_cursor_color(char_u *color) int blink_state_is_inverted(void) { -# ifdef FEAT_TERMRESPONSE +#ifdef FEAT_TERMRESPONSE return rbm_status.tr_progress == STATUS_GOT && rcs_status.tr_progress == STATUS_GOT && initial_cursor_blink != initial_cursor_shape_blink; -# else +#else return FALSE; -# endif +#endif } /* @@ -4826,7 +4821,7 @@ switch_to_8bit(void) need_gather = TRUE; // need to fill termleader[] } detected_8bit = TRUE; - LOG_TR1("Switching to 8 bit"); + LOG_TR("Switching to 8 bit"); } #ifdef CHECK_DOUBLE_CLICK @@ -4862,9 +4857,9 @@ set_mouse_topline(win_T *wp) is_mouse_topline(win_T *wp) { return orig_topline == wp->w_topline -# ifdef FEAT_DIFF +#ifdef FEAT_DIFF && orig_topfill == wp->w_topfill -# endif +#endif ; } #endif @@ -4979,7 +4974,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED) { char *aw = NULL; - LOG_TRN("Received U7 status: %s", tp); + LOG_TR("Received U7 status: %s", tp); u7_status.tr_progress = STATUS_GOT; did_cursorhold = TRUE; if (arg[1] == 2) @@ -4996,7 +4991,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED) { int r = redraw_asap(UPD_CLEAR); - LOG_TRN("set 'ambiwidth', redraw_asap(): %d", r); + LOG_TR("set 'ambiwidth', redraw_asap(): %d", r); } #else redraw_asap(UPD_CLEAR); @@ -5012,7 +5007,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED) { int value; - LOG_TRN("Received compatibility test result: %s", tp); + LOG_TR("Received compatibility test result: %s", tp); xcc_status.tr_progress = STATUS_GOT; // Third row: xterm compatibility test. @@ -5036,7 +5031,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp) // version. int version = arg[1]; - LOG_TRN("Received CRV response: %s", tp); + LOG_TR("Received CRV response: %s", tp); crv_status.tr_progress = STATUS_GOT; did_cursorhold = TRUE; @@ -5079,7 +5074,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp) // terminals the request should be ignored. if (version >= 141 && p_xtermcodes) { - LOG_TR1("Enable checking for XT codes"); + LOG_TR("Enable checking for XT codes"); check_for_codes = TRUE; need_gather = TRUE; req_codes_from_term(); @@ -5249,7 +5244,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp) && *T_CRS != NUL) { MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending cursor style request"); + LOG_TR("Sending cursor style request"); out_str(T_CRS); termrequest_sent(&rcs_status); need_flush = TRUE; @@ -5264,7 +5259,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp) && *T_CRC != NUL) { MAY_WANT_TO_LOG_THIS; - LOG_TR1("Sending cursor blink mode request"); + LOG_TR("Sending cursor blink mode request"); out_str(T_CRC); termrequest_sent(&rbm_status); need_flush = TRUE; @@ -5636,7 +5631,7 @@ handle_csi( { initial_cursor_blink = (arg[1] == '1'); rbm_status.tr_progress = STATUS_GOT; - LOG_TRN("Received cursor blinking mode response: %s", tp); + LOG_TR("Received cursor blinking mode response: %s", tp); key_name[0] = (int)KS_EXTRA; key_name[1] = (int)KE_IGNORE; *slen = csi_len; @@ -5769,7 +5764,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen) char *new_bg_val = (3 * '6' < *tp_r + *tp_g + *tp_b) ? "light" : "dark"; - LOG_TRN("Received RBG response: %s", tp); + LOG_TR("Received RBG response: %s", tp); #ifdef FEAT_TERMRESPONSE rbg_status.tr_progress = STATUS_GOT; # ifdef FEAT_TERMINAL @@ -5791,7 +5786,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen) #if defined(FEAT_TERMRESPONSE) && defined(FEAT_TERMINAL) else { - LOG_TRN("Received RFG response: %s", tp); + LOG_TR("Received RFG response: %s", tp); rfg_status.tr_progress = STATUS_GOT; fg_r = rval; fg_g = gval; @@ -5814,7 +5809,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen) } if (i == len) { - LOG_TR1("not enough characters for RB"); + LOG_TR("not enough characters for RB"); return FAIL; } return OK; @@ -5844,7 +5839,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen) { int i, j; - LOG_TRN("Received DCS response: %s", (char*)tp); + LOG_TR("Received DCS response: %s", (char*)tp); j = 1 + (tp[0] == ESC); if (len < j + 3) i = len; // need more chars @@ -5901,7 +5896,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen) (number & 1) ? FALSE : TRUE; rcs_status.tr_progress = STATUS_GOT; #endif - LOG_TRN("Received cursor shape response: %s", tp); + LOG_TR("Received cursor shape response: %s", tp); key_name[0] = (int)KS_EXTRA; key_name[1] = (int)KE_IGNORE; @@ -5920,7 +5915,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen) { // These codes arrive many together, each code can be // truncated at any point. - LOG_TR1("not enough characters for XT"); + LOG_TR("not enough characters for XT"); return FAIL; } return OK; @@ -6272,7 +6267,7 @@ check_termcode( { #ifdef DEBUG_TERMRESPONSE if (resp == -1) - LOG_TR1("Not enough characters for CSI sequence"); + LOG_TR("Not enough characters for CSI sequence"); #endif return resp; } @@ -6563,7 +6558,7 @@ check_termcode( } #ifdef FEAT_TERMRESPONSE - LOG_TR1("normal character"); + LOG_TR("normal character"); #endif return 0; // no match found @@ -6855,14 +6850,14 @@ replace_termcodes( result[dlen++] = KS_SPECIAL; result[dlen++] = KE_FILLER; } -#ifdef FEAT_GUI +# ifdef FEAT_GUI else if (*src == CSI) { result[dlen++] = K_SPECIAL; result[dlen++] = KS_EXTRA; result[dlen++] = (int)KE_CSI; } -#endif +# endif else result[dlen++] = *src; ++src; @@ -7105,7 +7100,7 @@ req_more_codes_from_term(void) char *key_name = key_names[xt_index_out]; MAY_WANT_TO_LOG_THIS; - LOG_TRN("Requesting XT %d: %s", xt_index_out, key_name); + LOG_TR("Requesting XT %d: %s", xt_index_out, key_name); if (key_name[2] != NUL) sprintf(buf, "\033P+q%02x%02x%02x\033\\", key_name[0], key_name[1], key_name[2]); else @@ -7130,7 +7125,7 @@ req_more_codes_from_term(void) static void got_code_from_term(char_u *code, int len) { -# define XT_LEN 100 +#define XT_LEN 100 char_u name[4]; char_u str[XT_LEN]; int i; @@ -7159,7 +7154,7 @@ got_code_from_term(char_u *code, int len) } } - LOG_TRN("Received XT %d: %s", xt_index_in, (char *)name); + LOG_TR("Received XT %d: %s", xt_index_in, (char *)name); if (key_names[i] != NULL) { @@ -7171,18 +7166,18 @@ got_code_from_term(char_u *code, int len) { // Color count is not a key code. int val = atoi((char *)str); -# if defined(FEAT_EVAL) +#if defined(FEAT_EVAL) if (val == t_colors) ch_log(NULL, "got_code_from_term(Co): no change (%d)", val); else ch_log(NULL, "got_code_from_term(Co): changed from %d to %d", t_colors, val); -# endif +#endif may_adjust_color_count(val); } -# if 0 -# ifdef FEAT_TERMGUICOLORS +#if 0 +#ifdef FEAT_TERMGUICOLORS // when RGB result comes back, it is supported when the result contains an '=' else if (name[0] == 'R' && name[1] == 'G' && name[2] == 'B' && code[9] == '=') { @@ -7191,15 +7186,15 @@ got_code_from_term(char_u *code, int len) // there are 8 bits per color channel if (val == 8 && !p_tgc_set) { -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL ch_log(NULL, "got_code_from_term(RGB): xterm-direct colors detected"); -# endif +#endif // RGB capability set, enable termguicolors set_option_value((char_u *)"termguicolors", 1L, NULL, 0); } } -# endif -# endif +#endif +#endif else { i = find_term_bykeys(str); @@ -7207,27 +7202,27 @@ got_code_from_term(char_u *code, int len) && name[1] == termcodes[i].name[1]) { // Existing entry with the same name and code - skip. -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL ch_log(NULL, "got_code_from_term(): Entry %c%c did not change", name[0], name[1]); -# endif +#endif } else { if (i >= 0) { // Delete an existing entry using the same code. -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL ch_log(NULL, "got_code_from_term(): Deleting entry %c%c with matching keys %s", termcodes[i].name[0], termcodes[i].name[1], str); -# endif +#endif del_termcode_idx(i); } -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL else ch_log(NULL, "got_code_from_term(): Adding entry %c%c with keys %s", name[0], name[1], str); -# endif +#endif add_termcode(name, str, ATC_FROM_TERM); } } @@ -7466,14 +7461,14 @@ static const char_u ansi_table[16][3] = { {255, 255, 255}, // white }; -# if defined(MSWIN) +#if defined(MSWIN) // Mapping between cterm indices < 16 and their counterpart in the ANSI palette. static const char_u cterm_ansi_idx[] = { 0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15 }; -# endif +#endif -# define ANSI_INDEX_NONE 0 +#define ANSI_INDEX_NONE 0 void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx) @@ -7501,11 +7496,11 @@ cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx) if (nr < 16) { -# if defined(MSWIN) +#if defined(MSWIN) idx = cterm_ansi_idx[nr]; -# else +#else idx = nr; -# endif +#endif *r = ansi_table[idx][0]; *g = ansi_table[idx][1]; *b = ansi_table[idx][2]; diff --git a/src/terminal.c b/src/terminal.c index 9f948257..6edc21a1 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -53,10 +53,10 @@ // This is VTermScreenCell without the characters, thus much smaller. typedef struct { - VTermScreenCellAttrs attrs; - char width; - VTermColor fg; - VTermColor bg; + VTermScreenCellAttrs attrs; + char width; + VTermColor fg; + VTermColor bg; } cellattr_T; typedef struct sb_line_S { @@ -3454,23 +3454,11 @@ limit_scrollback(term_T *term, garray_T *gap, int update_buffer) (sb_line_T *)gap->ga_data + todo, sizeof(sb_line_T) * gap->ga_len); if (update_buffer) - { - win_T *curwin_save = curwin; - win_T *wp = NULL; - term->tl_scrollback_scrolled -= todo; - FOR_ALL_WINDOWS(wp) - { - if (wp->w_buffer == term->tl_buffer) - { - curwin = wp; - check_cursor(); - update_topline(); - } - } - curwin = curwin_save; - } + // make sure cursor is on a valid line + if (curbuf == term->tl_buffer) + check_cursor(); } /* @@ -3634,15 +3622,15 @@ handle_bell(void *user UNUSED) } static VTermScreenCallbacks screen_callbacks = { - handle_damage, // damage - handle_moverect, // moverect - handle_movecursor, // movecursor - handle_settermprop, // settermprop - handle_bell, // bell - handle_resize, // resize - handle_pushline, // sb_pushline - NULL, // sb_popline - NULL // sb_clear + handle_damage, // damage + handle_moverect, // moverect + handle_movecursor, // movecursor + handle_settermprop, // settermprop + handle_bell, // bell + handle_resize, // resize + handle_pushline, // sb_pushline + NULL, // sb_popline + NULL // sb_clear }; /* @@ -4858,13 +4846,13 @@ parse_csi( } static VTermStateFallbacks state_fallbacks = { - NULL, // control - parse_csi, // csi - parse_osc, // osc - NULL, // dcs - NULL, // apc - NULL, // pm - NULL // sos + NULL, // control + parse_csi, // csi + parse_osc, // osc + NULL, // dcs + NULL, // apc + NULL, // pm + NULL // sos }; /* @@ -5093,7 +5081,7 @@ set_ref_in_term(int copyID) { tv.v_type = VAR_JOB; tv.vval.v_job = term->tl_job; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); } return abort; } @@ -7080,11 +7068,7 @@ conpty_term_and_job_init( if (cmd_wchar == NULL) goto failed; if (opt->jo_cwd != NULL) - { cwd_wchar = enc_to_utf16(opt->jo_cwd, NULL); - if (cwd_wchar == NULL) - goto failed; - } win32_build_env(opt->jo_env, &ga_env, TRUE); env_wchar = ga_env.ga_data; @@ -7426,11 +7410,7 @@ winpty_term_and_job_init( if (cmd_wchar == NULL) goto failed; if (opt->jo_cwd != NULL) - { cwd_wchar = enc_to_utf16(opt->jo_cwd, NULL); - if (cwd_wchar == NULL) - goto failed; - } win32_build_env(opt->jo_env, &ga_env, TRUE); env_wchar = ga_env.ga_data; @@ -7590,11 +7570,7 @@ winpty_term_and_job_init( char *msg = (char *)utf16_to_enc( (short_u *)winpty_error_msg(winpty_err), NULL); - if (msg != NULL) - { - emsg(msg); - vim_free(msg); - } + emsg(msg); winpty_error_free(winpty_err); } return FAIL; diff --git a/src/termlib.c b/src/termlib.c index 42eccf5e..ad5165a3 100644 --- a/src/termlib.c +++ b/src/termlib.c @@ -279,8 +279,7 @@ tgetstr(char *id, char **buf) char *hold; int i; - do - { + do { tmp = _find(tmp, ":"); // For each field while (*tmp == ':') // skip empty fields tmp++; diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 88bf5c3d..7d50a7ee 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -245,7 +245,6 @@ NEW_TESTS = \ test_plugin_matchparen \ test_plugin_termdebug \ test_plugin_tohtml \ - test_plugin_tutor \ test_plugin_zip \ test_plus_arg_edit \ test_popup \ @@ -328,7 +327,6 @@ NEW_TESTS = \ test_timers \ test_true_false \ test_trycatch \ - test_tuple \ test_undo \ test_unlet \ test_user_func \ @@ -435,7 +433,6 @@ NEW_TESTS_RES = \ test_float_func.res \ test_fnameescape.res \ test_fold.res \ - test_format.res \ test_functions.res \ test_function_lists.res \ test_getcwd.res \ @@ -512,7 +509,6 @@ NEW_TESTS_RES = \ test_plugin_matchparen.res \ test_plugin_termdebug.res \ test_plugin_tohtml.res \ - test_plugin_tutor.res \ test_plugin_zip.res \ test_plus_arg_edit.res \ test_popup.res \ @@ -582,7 +578,6 @@ NEW_TESTS_RES = \ test_timers.res \ test_true_false.res \ test_trycatch.res \ - test_tuple.res \ test_undo.res \ test_user_func.res \ test_usercommands.res \ diff --git a/src/testdir/check.vim b/src/testdir/check.vim index 76f6692a..a60dd908 100644 --- a/src/testdir/check.vim +++ b/src/testdir/check.vim @@ -127,39 +127,13 @@ func CheckNotMacM1() endif endfunc -func SetupWindowSizeToForVisualDumps() - " The dumps used as reference in these tests were created with a terminal - " width of 75 columns. The vim window that uses the remainder of the GUI - " window width must be at least 3 columns. In theory this means we need the - " GUI shell to provide 78+ columns. However the GTK3 resize logic is flaky, - " sometimes resulting in X11 Configure events that are narrower than - " expected by a number of pixels equal to 2 column widths. Therefore - " setting 80 columns ensures that the GUI shell can still provide 78+ - " columns. This is very likely papering over a GTK3 resize bug but one that - " has existed for a very long time. Establishing this workaround is meant to - " get the GTK3 code working under CI so that we can focus on removing this - " over the long term. - if &columns != 80 - set columns=80 - endif - " Without resetting lines, some GTK3 resize events can carry over between - " tests, which invalidate assumptions in the scrollbar offset calculations. - if &lines != 25 - set lines=25 - endif -endfunc - " Command to check that making screendumps is supported. " Caller must source screendump.vim command CheckScreendump call CheckScreendump() func CheckScreendump() - let g:check_screendump_called = v:true if !CanRunVimInTerminal() throw 'Skipped: cannot make screendumps' endif - if has('gui_running') - call SetupWindowSizeToForVisualDumps() - endif endfunc " Command to check that we can Run Vim in a terminal window diff --git a/src/testdir/dumps/Test_diff_inline_01.dump b/src/testdir/dumps/Test_diff_inline_01.dump deleted file mode 100644 index 9f342575..00000000 --- a/src/testdir/dumps/Test_diff_inline_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c|d|e|f| |g|h|i| |j|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|B+2&#ff404010|c|e|f| |g|H|i| |l|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_02.dump b/src/testdir/dumps/Test_diff_inline_02.dump deleted file mode 100644 index 2fb78a7d..00000000 --- a/src/testdir/dumps/Test_diff_inline_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b|c|d|e|f| |g|h|i| |j|k| |n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|B|c|e|f| |g|H|i| |l|m| |n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_03.dump b/src/testdir/dumps/Test_diff_inline_03.dump deleted file mode 100644 index 7e6cf2a2..00000000 --- a/src/testdir/dumps/Test_diff_inline_03.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c+0&#ffd7ff255|d+2&#ff404010|e+0&#ffd7ff255|f| |g|h+2&#ff404010|i+0&#ffd7ff255| |j+2&#ff404010|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|B+2&#ff404010|c+0&#ffd7ff255|e|f| |g|H+2&#ff404010|i+0&#ffd7ff255| |l+2&#ff404010|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_04.dump b/src/testdir/dumps/Test_diff_inline_04.dump deleted file mode 100644 index ed4f5a2a..00000000 --- a/src/testdir/dumps/Test_diff_inline_04.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|b|c|d|e|f| +0&#ffd7ff255|g+2&#ff404010|h|i| +0&#ffd7ff255|j+2&#ff404010|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|B|c|e|f| +0&#ffd7ff255|g+2&#ff404010|H|i| +0&#ffd7ff255|l+2&#ff404010|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_05.dump b/src/testdir/dumps/Test_diff_inline_05.dump deleted file mode 100644 index f2d0c7cc..00000000 --- a/src/testdir/dumps/Test_diff_inline_05.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c+0&#ffd7ff255|d+0࿈ff13|e+0&#ffd7ff255|f| |g|h+2&#ff404010|i+0&#ffd7ff255| |j+2&#ff404010|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|B+2&#ff404010|c+0&#ffd7ff255|e|f| |g|H+2&#ff404010|i+0&#ffd7ff255| |l+2&#ff404010|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_06.dump b/src/testdir/dumps/Test_diff_inline_06.dump deleted file mode 100644 index 67f4b5b0..00000000 --- a/src/testdir/dumps/Test_diff_inline_06.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|s+2#0000000#ff404010|o|m|e|t|e|x|t>a|b|c|d|e+0&#ffd7ff255|f| |g|h+2&#ff404010|i+0&#ffd7ff255| |j+2&#ff404010|k| +0&#ffd7ff255|n| @11||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|B|c|e+0&#ffd7ff255|f| |g|H+2&#ff404010|i+0&#ffd7ff255| |l+2&#ff404010|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|,|9| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|9| @11|A|l@1 -|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@62 diff --git a/src/testdir/dumps/Test_diff_inline_07.dump b/src/testdir/dumps/Test_diff_inline_07.dump deleted file mode 100644 index 3129968b..00000000 --- a/src/testdir/dumps/Test_diff_inline_07.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b|c|d+2&#ff404010|e|f| |g|h|i| |j|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|B|c|e+2&#ff404010|f| |g|H|i| |l|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_08.dump b/src/testdir/dumps/Test_diff_inline_08.dump deleted file mode 100644 index baf74b57..00000000 --- a/src/testdir/dumps/Test_diff_inline_08.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b|c|d+0࿈ff13|e+0&#ffd7ff255|f| |g|h|i| |j+2&#ff404010|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|B|c|e|f| |g|H|i| |l+2&#ff404010|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_09.dump b/src/testdir/dumps/Test_diff_inline_09.dump deleted file mode 100644 index b8dcad6e..00000000 --- a/src/testdir/dumps/Test_diff_inline_09.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|b|c|d|e|f| +0&#ffd7ff255|g|h|i| |j+2&#ff404010|k| +0&#ffd7ff255|n| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|B|c|e|f| +0&#ffd7ff255|g|H|i| |l+2&#ff404010|m| +0&#ffd7ff255|n| @20 -| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0| @33 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_10.dump b/src/testdir/dumps/Test_diff_inline_10.dump deleted file mode 100644 index 27095fbd..00000000 --- a/src/testdir/dumps/Test_diff_inline_10.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|p@1|l|e+0&#ffd7ff255|s| |a|n|d| |o+2&#ff404010|r|a|n|g|e+0&#ffd7ff255|s| @16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|r|a|n|g|e+0&#ffd7ff255|s| |a|n|d| |a+2&#ff404010|p@1|l|e+0&#ffd7ff255|s| @16 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_11.dump b/src/testdir/dumps/Test_diff_inline_11.dump deleted file mode 100644 index a485a9a5..00000000 --- a/src/testdir/dumps/Test_diff_inline_11.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#4040ff13|p@1|l|e|s| |a|n|d| |o+0&#ffd7ff255|r|a|n|g|e|s| @16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|r|a|n|g|e|s| +0࿈ff13|a|n|d| |a|p@1|l|e|s| +0&#ffd7ff255@16 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_12.dump b/src/testdir/dumps/Test_diff_inline_12.dump deleted file mode 100644 index b6894f34..00000000 --- a/src/testdir/dumps/Test_diff_inline_12.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|1+2#0000000#ff404010| +0&#ffd7ff255|-| |s+2&#ff404010|i+0&#ffd7ff255|g|m|a| |i|n| |6|σ+2&#ff404010| +0&#ffd7ff255|a|n|d| |Ὀ|δ+2&#ff404010|Ï…|σ@1|ε|Ï|Ï‚| +0&#ffd7ff255@6||+1&#ffffff0| +0#0000e05#a8a8a8255@1|2+2#0000000#ff404010| +0&#ffd7ff255|-| |S+2&#ff404010|i+0&#ffd7ff255|g|m|a| |i|n| |6|Σ+2&#ff404010| +0&#ffd7ff255|a|n|d| |Ὀ|Δ+2&#ff404010|Î¥|Σ@1|Ε|ÎŽ|Σ| +0&#ffd7ff255@6 -| +0#0000e05#a8a8a8255@1|1+2#0000000#ff404010| +0&#ffd7ff255|-| |a+2&#ff404010|n+0&#ffd7ff255|g|s|t|r|o|m| |i|n| |Ã¥+2&#ff404010@1| +0&#ffd7ff255@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|2+2#0000000#ff404010| +0&#ffd7ff255|-| |A+2&#ff404010|n+0&#ffd7ff255|g|s|t|r|o|m| |i|n| |â„«+2&#ff404010|Ã…| +0&#ffd7ff255@16 -| +0#0000e05#a8a8a8255@1|1+2#0000000#ff404010| +0&#ffd7ff255|-| |c+2&#ff404010|o+0&#ffd7ff255|m|p|o|s|i|n|g|:| |i+0࿈ff13|i⃗+0&#ffd7ff255|I⃗| @16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|2+2#0000000#ff404010| +0&#ffd7ff255|-| |C+2&#ff404010|o+0&#ffd7ff255|m|p|o|s|i|n|g|:| |i⃗|I⃗|I⃗+0࿈ff13| +0&#ffd7ff255@16 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_13.dump b/src/testdir/dumps/Test_diff_inline_13.dump deleted file mode 100644 index a3ddf8c4..00000000 --- a/src/testdir/dumps/Test_diff_inline_13.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|1+2#0000000#ff404010| +0&#ffd7ff255|-| |s|i|g|m|a| |i|n| |6|σ| |a|n|d| |Ὀ|δ|Ï…|σ@1|ε|Ï|Ï‚| @6||+1&#ffffff0| +0#0000e05#a8a8a8255@1|2+2#0000000#ff404010| +0&#ffd7ff255|-| |S|i|g|m|a| |i|n| |6|Σ| |a|n|d| |Ὀ|Δ|Î¥|Σ@1|Ε|ÎŽ|Σ| @6 -| +0#0000e05#a8a8a8255@1|1+2#0000000#ff404010| +0&#ffd7ff255|-| |a|n|g|s|t|r|o|m| |i|n| |Ã¥@1| @16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|2+2#0000000#ff404010| +0&#ffd7ff255|-| |A|n|g|s|t|r|o|m| |i|n| |â„«|Ã…| @16 -| +0#0000e05#a8a8a8255@1|1+2#0000000#ff404010| +0&#ffd7ff255|-| |c|o|m|p|o|s|i|n|g|:| |i+2&#ff404010|i⃗+0&#ffd7ff255|I⃗| @16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|2+2#0000000#ff404010| +0&#ffd7ff255|-| |C|o|m|p|o|s|i|n|g|:| |i⃗+2&#ff404010|I⃗+0&#ffd7ff255@1| @16 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_14.dump b/src/testdir/dumps/Test_diff_inline_14.dump deleted file mode 100644 index 9946527b..00000000 --- a/src/testdir/dumps/Test_diff_inline_14.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b|c|😅*2&#ff404010|x+&|d+0&#ffd7ff255|e|一*0࿈ff13| +0&#ffd7ff255@24||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b|c|y+2&#ff404010|😢*&|d+0&#ffd7ff255|e| @26 -| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|🚀*&|g+&| @30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|二*0#0000000#4040ff13|f+0&#ffd7ff255|🚀*&|g+&| @28 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_15.dump b/src/testdir/dumps/Test_diff_inline_15.dump deleted file mode 100644 index 91ac04bc..00000000 --- a/src/testdir/dumps/Test_diff_inline_15.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|1+0#0000000#ffd7ff255|^+2#0000e05#ff404010|@|3+0#0000000#ffd7ff255|4|^+0#0000e05&|@|5+0#0000000&|^+2#0000e05#ff404010|@|6+0#0000000#ffd7ff255| @23||+1&#ffffff0| +0#0000e05#a8a8a8255@1|1+0#0000000#ffd7ff255|2+2&#ff404010|3+0&#ffd7ff255|4|^+0#0000e05&|@|5+0#0000000&| @27 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|6+0#0000000#ffd7ff255| @33 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_char_01.dump b/src/testdir/dumps/Test_diff_inline_char_01.dump deleted file mode 100644 index ce703ea3..00000000 --- a/src/testdir/dumps/Test_diff_inline_char_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|p+0#0000000#ffd7ff255|r|e|f|i|x|F|o@1|,| |p|r|e|f|i|x|E|n|d| @14||+1&#ffffff0| +0#0000e05#a8a8a8255@1|p+0#0000000#ffd7ff255|r|e|f|i|x|F|o@1|,| |p+0࿈ff13|r|e|f|i|x|B|a|r|,| |p+0&#ffd7ff255|r|e|f|i|x|E|n|d| @3 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_char_02.dump b/src/testdir/dumps/Test_diff_inline_char_02.dump deleted file mode 100644 index b7072003..00000000 --- a/src/testdir/dumps/Test_diff_inline_char_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c+0&#ffd7ff255|d+2&#ff404010|e|f|g|h|i|j|k|l|m|n|o+0&#ffd7ff255| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|?+2&#ff404010|c+0&#ffd7ff255|?+2&#ff404010|e|?|g|?|i|?|k|?@2|o+0&#ffd7ff255| @19 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r|1| @27||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r|1| @27 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c|d+0&#ffd7ff255|e|f+2&#ff404010|g|h|i|j|k+0&#ffd7ff255|l|m|n|o| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|?+2&#ff404010@1|d+0&#ffd7ff255|e|?+2&#ff404010@4|k+0&#ffd7ff255|l|m|n|o| @19 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r|2| @27||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r|2| @27 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c|d|e|f|g|h|i|j|k|l+0&#ffd7ff255|m|n|o| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|?+2&#ff404010@1|d|e|?@5|l+0&#ffd7ff255|m|n|o| @19 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r|3| @27||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r|3| @27 -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e+2&#ff404010|s+0&#ffd7ff255|t+2&#ff404010| +0&#ffd7ff255@30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|?+2&#ff404010|s+0&#ffd7ff255|?+2&#ff404010| +0&#ffd7ff255@30 -| +0#0000e05#a8a8a8255@1|m+2#0000000#ff404010|u|l|t|i|l|i|n|e+0&#ffd7ff255| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010@5|i|?|e+0&#ffd7ff255| @25 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_01.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_01.dump deleted file mode 100644 index 8b402579..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|a+2&#ff404010|t| +0&#ffd7ff255|i|s| |b|u|f@1|e|r|1+2&#ff404010|.+0&#ffd7ff255| @6||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|i+2&#ff404010|s| +0&#ffd7ff255|i|s| |b|u|f@1|e|r|2+2&#ff404010|.+0&#ffd7ff255| @5||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|i+2&#ff404010|s| +0&#ffd7ff255|i|s| |b|u|f@1|e|r|3+2&#ff404010|.| |L|a|s|t|.+0&#ffd7ff255 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @16||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15 -| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |r+2&#ff404010|a|n|d|o|m| |t+0&#ffd7ff255|e|x|t| @6||+1&#ffffff0| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |t|e|x|t| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |m+2&#ff404010|o|r|e| +0&#ffd7ff255@12 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t| +0࿈ff13|h|e|r|e|.| +0&#ffd7ff255@11 -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @16||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|u|f@1|e|r|2|/|3| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#4040ff13|n|l|y| |i|n| |b+0&#ffd7ff255|u|f@1|e|r|2|/|3| @4 -| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#5fd7ff255|o|t| |i|n| |b|u|f@1|e|r|1| @7 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_02.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_02.dump deleted file mode 100644 index d6358d4f..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -|T+0&#ffffff0|h|a|t| |i|s| |b|u|f@1|e|r|1|.| @8||+1&&| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|i|s| |i|s| |b|u|f@1|e|r|2+2&#ff404010|.+0&#ffd7ff255| @5||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|i|s| |i|s| |b|u|f@1|e|r|3+2&#ff404010|.| |L|a|s|t|.+0&#ffd7ff255 -|a+0&#ffffff0|n|c|h|o|r| @18||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15 -|S|o|m|e| |r|a|n|d|o|m| |t|e|x|t| @8||+1&&| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |t|e|x|t| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |m+0࿈ff13|o|r|e| +0&#ffd7ff255@12 -|a+0&#ffffff0|n|c|h|o|r| @18||+1&&| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t| +0࿈ff13|h|e|r|e|.| +0&#ffd7ff255@11 -|~+0#4040ff13#ffffff0| @23||+1#0000000&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15 -|~+0#4040ff13&| @23||+1#0000000&| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|u|f@1|e|r|2|/|3| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#4040ff13|n|l|y| |i|n| |b+0&#ffd7ff255|u|f@1|e|r|2|/|3| @4 -|~+0#4040ff13#ffffff0| @23||+1#0000000&| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#5fd7ff255|o|t| |i|n| |b|u|f@1|e|r|1| @7 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_03.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_03.dump deleted file mode 100644 index 21bbfba8..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_03.dump +++ /dev/null @@ -1,20 +0,0 @@ -|s+0&#ffffff0|o|m|e|t|e|x|t>T|h|a|t| |i|s| |b|u|f@1|e|r|1|.| ||+1&&| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|i|s| |i|s| |b|u|f@1|e|r|2+2&#ff404010|.+0&#ffd7ff255| @5||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+0#0000000#ffd7ff255|h|i|s| |i|s| |b|u|f@1|e|r|3+2&#ff404010|.| |L|a|s|t|.+0&#ffd7ff255 -|a+0&#ffffff0|n|c|h|o|r| @18||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15 -|S|o|m|e| |r|a|n|d|o|m| |t|e|x|t| @8||+1&&| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |t|e|x|t| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|S+0#0000000#ffd7ff255|o|m|e| |m+0࿈ff13|o|r|e| +0&#ffd7ff255@12 -|a+0&#ffffff0|n|c|h|o|r| @18||+1&&| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t| +0࿈ff13|h|e|r|e|.| +0&#ffd7ff255@11 -|~+0#4040ff13#ffffff0| @23||+1#0000000&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0|n|c|h|o|r| @15 -|~+0#4040ff13&| @23||+1#0000000&| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|u|f@1|e|r|2|/|3| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#4040ff13|n|l|y| |i|n| |b+0&#ffd7ff255|u|f@1|e|r|2|/|3| @4 -|~+0#4040ff13#ffffff0| @23||+1#0000000&| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#5fd7ff255|o|t| |i|n| |b|u|f@1|e|r|1| @7 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|<+3#0000000&|d|i|f|i|l|e|1| |[|+|]| |1|,|9| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@62 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_04.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_04.dump deleted file mode 100644 index 3da504b6..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_04.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|T+2#0000000#ff404010|h|i|s|+|i|s|=+0&#ffd7ff255|a+2&#ff404010|-+0&#ffd7ff255|s|e|t|e|n|c|e| @5||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+2#0000000#ff404010|h|i|s|+|i|s|=+0&#ffd7ff255|a+2&#ff404010|n|o|t|h|e|r|-+0&#ffd7ff255|s|e|t|e|n|c||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+2#0000000#ff404010|h|a|t|+|i|s|=+0&#ffd7ff255|a+2&#ff404010|-+0&#ffd7ff255|s|e|t|e|n|c|e| @4 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_05.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_05.dump deleted file mode 100644 index 0f5ef736..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_05.dump +++ /dev/null @@ -1,20 +0,0 @@ -|T+0&#ffffff0|h|i|s|+|i|s|=|a|-|s|e|t|e|n|c|e| @7||+1&&| +0#0000e05#a8a8a8255@1|T+2#0000000#ff404010|h|i|s|++0&#ffd7ff255|i|s|=|a+2&#ff404010|n|o|t|h|e|r|-|s|e|t|e|n|c||+1&#ffffff0| +0#0000e05#a8a8a8255@1|T+2#0000000#ff404010|h|a|t|++0&#ffd7ff255|i|s|=|a+2&#ff404010|-|s|e|t|e|n|c|e| +0&#ffd7ff255@4 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_06.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_06.dump deleted file mode 100644 index 8c37b138..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_06.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c|d|e|f|g+0&#ffd7ff255|h|i|j|k|Y+2&#ff404010|m|Y@2| +0&#ffd7ff255@6||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|X+2&#ff404010@1|d|X@1|g+0&#ffd7ff255|h|i|j|k|l+2&#ff404010|m|n|o|p| +0&#ffd7ff255@5||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c|d|e|f|g+0&#ffd7ff255|h|i|j|k|Y+2&#ff404010|m|Y|o|p| +0&#ffd7ff255@5 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multibuffer_07.dump b/src/testdir/dumps/Test_diff_inline_multibuffer_07.dump deleted file mode 100644 index 0db4f77e..00000000 --- a/src/testdir/dumps/Test_diff_inline_multibuffer_07.dump +++ /dev/null @@ -1,20 +0,0 @@ -|a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|Y|m|Y@2| @8||+1&&| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|X+2&#ff404010@1|d|X@1|g+0&#ffd7ff255|h|i|j|k|l+2&#ff404010|m+0&#ffd7ff255|n+2&#ff404010|o+0&#ffd7ff255|p| @5||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|b+2&#ff404010|c|d|e|f|g+0&#ffd7ff255|h|i|j|k|Y+2&#ff404010|m+0&#ffd7ff255|Y+2&#ff404010|o+0&#ffd7ff255|p| @5 -|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 -|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_01.dump b/src/testdir/dumps/Test_diff_inline_multiline_01.dump deleted file mode 100644 index 53d6139e..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| @2|i|s| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| +0࿈ff13|t+0&#ffd7ff255|e|s|t| @17 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| |t|e|x|t| |f|o@1| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+0࿈ff13| +0&#ffd7ff255@29 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| +0&#ffd7ff255|d+2&#ff404010|e+0&#ffd7ff255|f| @23||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| +0&#ffd7ff255|Y+2&#ff404010|e+0&#ffd7ff255|f| @19 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d| @14 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_02.dump b/src/testdir/dumps/Test_diff_inline_multiline_02.dump deleted file mode 100644 index c7bf4cb6..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| @2|i|s| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s+2&#ff404010|o|m|e| +0&#ffd7ff255|t+2&#ff404010|e|s|t| +0&#ffd7ff255@17 -| +0#0000e05#a8a8a8255@1|s+2#0000000#ff404010|o|m|e|t|e|s|t| +0&#ffd7ff255|t+2&#ff404010|e|x|t| +0&#ffd7ff255|f+2&#ff404010|o@1| +0&#ffd7ff255@17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+2#0000000#ff404010|e|x|t|s| +0&#ffd7ff255@29 -| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010|a|z| +0&#ffd7ff255|a+2&#ff404010|b|c| +0&#ffd7ff255|d+2&#ff404010|e|f| +0&#ffd7ff255@23||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1| +0&#ffd7ff255|b+2&#ff404010|a|r| +0&#ffd7ff255|a+2&#ff404010|b|X| +0&#ffd7ff255|Y+2&#ff404010|e|f| +0&#ffd7ff255@19 -| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|n|e| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|n|e|w|o|r|d| +0&#ffd7ff255|a|n|o|t|h|e|r| |w|o|r|d| @14 -| +0#0000e05#a8a8a8255@1|w+2#0000000#ff404010|o|r|d| +0&#ffd7ff255|a|n|o|t|h|e|r| |w|o|r|d| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_03.dump b/src/testdir/dumps/Test_diff_inline_multiline_03.dump deleted file mode 100644 index 3cc0dbe3..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_03.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| | +0࿈ff13@1|i+0&#ffd7ff255|s| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| +0࿈ff13|t+0&#ffd7ff255|e|s|t| @17 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| |t|e|x|t| |f|o@1| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+0࿈ff13| +0&#ffd7ff255@29 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| +0&#ffd7ff255|d+2&#ff404010|e+0&#ffd7ff255|f| @23||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| +0&#ffd7ff255|Y+2&#ff404010|e+0&#ffd7ff255|f| @19 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d| @14 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_04.dump b/src/testdir/dumps/Test_diff_inline_multiline_04.dump deleted file mode 100644 index 4aef70cb..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_04.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| | +0࿈ff13@1|i+0&#ffd7ff255|s| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s+2&#ff404010|o|m|e| +0&#ffd7ff255|t+2&#ff404010|e|s|t| +0&#ffd7ff255@17 -| +0#0000e05#a8a8a8255@1|s+2#0000000#ff404010|o|m|e|t|e|s|t| +0&#ffd7ff255|t+2&#ff404010|e|x|t| +0&#ffd7ff255|f|o@1| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+2#0000000#ff404010|e|x|t|s| +0&#ffd7ff255@29 -| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010|a|z| +0&#ffd7ff255|a+2&#ff404010|b|c| +0&#ffd7ff255|d+2&#ff404010|e|f| +0&#ffd7ff255@23||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b+2&#ff404010|a|r| +0&#ffd7ff255|a+2&#ff404010|b|X| +0&#ffd7ff255|Y+2&#ff404010|e|f| +0&#ffd7ff255@19 -| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|n|e| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|n|e|w|o|r|d| +0&#ffd7ff255|a|n|o|t|h|e|r| |w|o|r|d| @14 -| +0#0000e05#a8a8a8255@1|w+2#0000000#ff404010|o|r|d| +0&#ffd7ff255|a|n|o|t|h|e|r| |w|o|r|d| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_05.dump b/src/testdir/dumps/Test_diff_inline_multiline_05.dump deleted file mode 100644 index 7ff92f73..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_05.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| @2|i|s| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| |t|e|s|t| @17 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| |t|e|x|t| |f|o@1| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+0࿈ff13| +0&#ffd7ff255@29 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| |d|e+0&#ffd7ff255|f| @23||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| |Y|e+0&#ffd7ff255|f| @19 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d| @14 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_06.dump b/src/testdir/dumps/Test_diff_inline_multiline_06.dump deleted file mode 100644 index 9a756670..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_06.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| @2|i|s| @25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s+2&#ff404010|o|m|e| |t|e|s|t| +0&#ffd7ff255@17 -| +0#0000e05#a8a8a8255@1|s+2#0000000#ff404010|o|m|e|t|e|s|t| |t|e|x|t| +0&#ffd7ff255|f|o@1| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+2#0000000#ff404010|e|x|t|s| +0&#ffd7ff255@29 -| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010|a|z| |a|b|c| |d|e|f| | +0&#ffd7ff255@22||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b+2&#ff404010|a|r| |a|b|X| |Y|e|f| @4| +0&#ffd7ff255@14 -| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|n|e| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+2#0000000#ff404010|n|e|w|o|r|d| +0&#ffd7ff255|a|n|o|t|h|e|r| |w|o|r|d| @14 -| +0#0000e05#a8a8a8255@1|w+2#0000000#ff404010|o|r|d| +0&#ffd7ff255|a|n|o|t|h|e|r| |w|o|r|d| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_07.dump b/src/testdir/dumps/Test_diff_inline_multiline_07.dump deleted file mode 100644 index de58a6ac..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_07.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| | +0࿈ff13@1|i+0&#ffd7ff255|s| | +0࿈ff13@1|$+0#4040ff13&| +0#0000000#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| +0࿈ff13|t+0&#ffd7ff255|e|s|t|$+2#4040ff13#ff404010| +0#0000000#ffd7ff255@16 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| +2&#ff404010|t+0&#ffd7ff255|e|x|t| +2&#ff404010|f+0&#ffd7ff255|o@1|$+2#4040ff13#ff404010| +0#0000000#ffd7ff255@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+2&#ff404010|$+2#4040ff13&| +0#0000000#ffd7ff255@28 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| +0&#ffd7ff255|d+2&#ff404010|e+0&#ffd7ff255|f| |$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| +2&#ff404010|b+0&#ffd7ff255|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| +0&#ffd7ff255|Y+2&#ff404010|e+0&#ffd7ff255|f| | +0࿈ff13@3|$+0#4040ff13#ffd7ff255| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|$+0#4040ff13#4040ff13| +0#0000000#ffd7ff255@30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e|$+0#4040ff13&| +0#0000000&@18||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+1#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_08.dump b/src/testdir/dumps/Test_diff_inline_multiline_08.dump deleted file mode 100644 index 901ea469..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_08.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| @2|i|s| @2|$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| +0࿈ff13|t+0&#ffd7ff255|e|s|t|$+0#4040ff13&| +0#0000000&@16 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| |t|e|x|t| |f|o@1|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+0࿈ff13|$+0#4040ff13#ffd7ff255| +0#0000000&@28 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| +0&#ffd7ff255|d+2&#ff404010|e+0&#ffd7ff255|f| |$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| +0&#ffd7ff255|Y+2&#ff404010|e+0&#ffd7ff255|f| @4|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|$+0#4040ff13#4040ff13| +0#0000000#ffd7ff255@30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e|$+0#4040ff13&| +0#0000000&@18||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+1#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_09.dump b/src/testdir/dumps/Test_diff_inline_multiline_09.dump deleted file mode 100644 index 91f59cda..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_09.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| | +0࿈ff13@1|i+0&#ffd7ff255|s| @2|$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| +0࿈ff13|t+0&#ffd7ff255|e|s|t|$+0#4040ff13&| +0#0000000&@16 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| |t|e|x|t| |f|o@1|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+0࿈ff13|$+0#4040ff13#ffd7ff255| +0#0000000&@28 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| +0&#ffd7ff255|d+2&#ff404010|e+0&#ffd7ff255|f| |$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| +0&#ffd7ff255|Y+2&#ff404010|e+0&#ffd7ff255|f| @4|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|$+0#4040ff13#4040ff13| +0#0000000#ffd7ff255@30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e|$+0#4040ff13&| +0#0000000&@18||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+1#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_multiline_10.dump b/src/testdir/dumps/Test_diff_inline_multiline_10.dump deleted file mode 100644 index 212c2479..00000000 --- a/src/testdir/dumps/Test_diff_inline_multiline_10.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| @2|i|s| @2|$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|h|i|s| |i|s| |s|o|m|e| |t|e|s|t|$+0#4040ff13&| +0#0000000&@16 -| +0#0000e05#a8a8a8255@1|s+0#0000000#ffd7ff255|o|m|e|t|e|s|t| |t|e|x|t| |f|o@1|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|e|x|t|s+0࿈ff13|$+0#4040ff13#ffd7ff255| +0#0000000&@28 -| +0#0000e05#a8a8a8255@1|b+0#0000000#ffd7ff255|a|z+2&#ff404010| +0&#ffd7ff255|a|b|c+2&#ff404010| |d|e+0&#ffd7ff255|f| |$+0#4040ff13&| +0#0000000&@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1| |b|a|r+2&#ff404010| +0&#ffd7ff255|a|b|X+2&#ff404010| |Y|e+0&#ffd7ff255|f| @4|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|$+0#4040ff13&| +0#0000000&@30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|o+0#0000000#ffd7ff255|n|e|w|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@13 -| +0#0000e05#a8a8a8255@1|w+0#0000000#ffd7ff255|o|r|d| |a|n|o|t|h|e|r| |w|o|r|d|$+0#4040ff13&| +0#0000000&@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|d@1|i|t|i|o|n|a|l| |l|i|n|e|$+0#4040ff13&| +0#0000000&@18||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 -|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+1#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_word_01.dump b/src/testdir/dumps/Test_diff_inline_word_01.dump deleted file mode 100644 index c7b7bdb4..00000000 --- a/src/testdir/dumps/Test_diff_inline_word_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1|+|b+2&#ff404010|a|r| +0&#ffd7ff255|t|e|s|t| @22||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#ffd7ff255|o@1|+|b+2&#ff404010|a|z| +0&#ffd7ff255|t|e|s|t| @22 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_word_02.dump b/src/testdir/dumps/Test_diff_inline_word_02.dump deleted file mode 100644 index db6865d1..00000000 --- a/src/testdir/dumps/Test_diff_inline_word_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1|+|b|a|r| +0&#ffd7ff255|t|e|s|t| @22||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010|o@1|+|b|a|z| +0&#ffd7ff255|t|e|s|t| @22 -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_inline_word_03.dump b/src/testdir/dumps/Test_diff_inline_word_03.dump deleted file mode 100644 index 30efaed3..00000000 --- a/src/testdir/dumps/Test_diff_inline_word_03.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +0#0000e05#a8a8a8255@1|🚀*0#0000000#ffd7ff255|⛵ï¸*2&#ff404010|一*0&#ffd7ff255|二|三*2&#ff404010|ã²*0&#ffd7ff255|ら|ãŒ*0࿈ff13|ãª*0&#ffd7ff255|Δ+2&#ff404010|έ|λ|Ï„|α| +0&#ffd7ff255|Δ+2&#ff404010|e|l|t|a| +0&#ffd7ff255|f|o@1|b|a||+1&#ffffff0| +0#0000e05#a8a8a8255@1|🚀*0#0000000#ffd7ff255|🛸*2&#ff404010|一*0&#ffd7ff255|二|å››*2&#ff404010|ã²*0&#ffd7ff255|ら|ãª|δ+2&#ff404010|έ|λ|Ï„|α| +0&#ffd7ff255|δ+2&#ff404010|e|l|t|a| +0&#ffd7ff255|f|o@1|b|a|r| -|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 -|:+0&&> @73 diff --git a/src/testdir/dumps/Test_matchparen_winscrolled1.dump b/src/testdir/dumps/Test_matchparen_winscrolled1.dump deleted file mode 100644 index 60232cf2..00000000 --- a/src/testdir/dumps/Test_matchparen_winscrolled1.dump +++ /dev/null @@ -1,7 +0,0 @@ -|f+0&#ffffff0|o@1|b|a|r| |{+0(ffff15| +0&#ffffff0@66 -@75 -@75 -@75 ->}+0(ffff15| +0&#ffffff0@73 -|~+0#4040ff13&| @73 -| +0#0000000&@56|5|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_matchparen_winscrolled2.dump b/src/testdir/dumps/Test_matchparen_winscrolled2.dump deleted file mode 100644 index 37f37927..00000000 --- a/src/testdir/dumps/Test_matchparen_winscrolled2.dump +++ /dev/null @@ -1,7 +0,0 @@ -| +0&#ffffff0@74 -@75 -@75 ->}| @73 -|~+0#4040ff13&| @73 -|~| @73 -| +0#0000000&@56|5|,|1| @10|B|o|t| diff --git a/src/testdir/dumps/Test_pum_maxwidth_01.dump b/src/testdir/dumps/Test_pum_maxwidth_01.dump deleted file mode 100644 index a836ab0a..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_01.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43 -|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43 -@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31 -|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| | +0#4040ff13#ffffff0@30 -|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| | +0#4040ff13#ffffff0@30 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_02.dump b/src/testdir/dumps/Test_pum_maxwidth_02.dump deleted file mode 100644 index 17e77e54..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_02.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43 -|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43 -@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31 -|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@52 -|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@52 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_03.dump b/src/testdir/dumps/Test_pum_maxwidth_03.dump deleted file mode 100644 index 906e5950..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_03.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43 -|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43 -@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31 -|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@42 -|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@42 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_04.dump b/src/testdir/dumps/Test_pum_maxwidth_04.dump deleted file mode 100644 index 72d0c5ac..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_04.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43 -|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43 -@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31 -|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@54 -|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@54 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_05.dump b/src/testdir/dumps/Test_pum_maxwidth_05.dump deleted file mode 100644 index 6fb50819..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_05.dump +++ /dev/null @@ -1,10 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| -|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| -@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_ -|1|2|3|4|5|6|7|8|9|_|a> @20 -|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@11 -|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@11 -|~| @30 -|~| @30 -|~| @30 -|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@16 diff --git a/src/testdir/dumps/Test_pum_maxwidth_06.dump b/src/testdir/dumps/Test_pum_maxwidth_06.dump deleted file mode 100644 index b5765bc0..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_06.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44 -|1+0#0000001#e0e0e08|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_| | +0#4040ff13#ffffff0@43 -|一*0#0000001#ffd7ff255|二|三|å››|五|å…­|七|å…«|ä¹|å| +&@10| +0#4040ff13#ffffff0@43 -|a+0#0000001#ffd7ff255|b|c|d|e|f|g|h|i|j| @20| +0#4040ff13#ffffff0@43 -|上*0#0000001#ffd7ff255|下|å·¦|å³| +&@22| +0#4040ff13#ffffff0@43 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_07.dump b/src/testdir/dumps/Test_pum_maxwidth_07.dump deleted file mode 100644 index 112e1f58..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_07.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44 -|1+0#0000001#e0e0e08|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@64 -|一*0#0000001#ffd7ff255|二|三|å››| +&|>| +0#4040ff13#ffffff0@64 -|a+0#0000001#ffd7ff255|b|c|d|e|f|g|h|i|j| +0#4040ff13#ffffff0@64 -|上*0#0000001#ffd7ff255|下|å·¦|å³| +&@1| +0#4040ff13#ffffff0@64 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_08.dump b/src/testdir/dumps/Test_pum_maxwidth_08.dump deleted file mode 100644 index 9f92ae70..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_08.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@43> |_|9|8|7|6|5|4|3|2|1|_|9|8|7|6|5|4|3|2|1|_|9|8|7|6|5|4|3|2|1 -| +0#4040ff13&@64|<+0#0000001#e0e0e08|9|8|7|6|5|4|3|2|1 -| +0#4040ff13#ffffff0@64|<+0#0000001#ffd7ff255| |å››*&|三|二|一 -| +0#4040ff13#ffffff0@64|j+0#0000001#ffd7ff255|i|h|g|f|e|d|c|b|a -| +0#4040ff13#ffffff0@64| +0#0000001#ffd7ff255@1|å³*&|å·¦|下|上 -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_pum_maxwidth_09.dump b/src/testdir/dumps/Test_pum_maxwidth_09.dump deleted file mode 100644 index fd71673b..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_09.dump +++ /dev/null @@ -1,8 +0,0 @@ -|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44 -|1+0#0000001#e0e0e08|>| +0#4040ff13#ffffff0@72 -| +0#0000001#ffd7ff255|>| +0#4040ff13#ffffff0@72 -|a+0#0000001#ffd7ff255|>| +0#4040ff13#ffffff0@72 -| +0#0000001#ffd7ff255|>| +0#4040ff13#ffffff0@72 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_10.dump b/src/testdir/dumps/Test_pum_maxwidth_10.dump deleted file mode 100644 index bf47664c..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_10.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|>| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|>| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|>| +0#4040ff13#ffffff0@60 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_11.dump b/src/testdir/dumps/Test_pum_maxwidth_11.dump deleted file mode 100644 index 21d0f02d..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_11.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|…| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|…| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|…| +0#4040ff13#ffffff0@60 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_12.dump b/src/testdir/dumps/Test_pum_maxwidth_12.dump deleted file mode 100644 index 6168fd8d..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_12.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1| @7|f|o|…| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|r| @7|一*&|…+&| +0#4040ff13#ffffff0@60 -|一*0#0000001#ffd7ff255|二|三|å››|五| +&|m|u|…| +0#4040ff13#ffffff0@60 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_13.dump b/src/testdir/dumps/Test_pum_maxwidth_13.dump deleted file mode 100644 index 09ead2ab..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_13.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1| @7|f|o|>| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|r| @7|一*&|>+&| +0#4040ff13#ffffff0@60 -|一*0#0000001#ffd7ff255|二|三|å››|五| +&|m|u|>| +0#4040ff13#ffffff0@60 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_14.dump b/src/testdir/dumps/Test_pum_maxwidth_14.dump deleted file mode 100644 index e8fb585d..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_14.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|_| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|_| +0#4040ff13#ffffff0@60 -|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|_| +0#4040ff13#ffffff0@60 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_15.dump b/src/testdir/dumps/Test_pum_maxwidth_15.dump deleted file mode 100644 index bf76319e..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_15.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@70> |o@1|f -| +0#4040ff13&@60|<+0#0000001#e0e0e08|f| |d|n|i|K|o@1|f| |o@1|f -| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|b| |d|n|i|K|r|a|b| |r|a|b -| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|b| |d|n|i|K|z|a|b| |z|a|b -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_pum_maxwidth_16.dump b/src/testdir/dumps/Test_pum_maxwidth_16.dump deleted file mode 100644 index 3a9ff4dd..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_16.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@70> |o@1|f -| +0#4040ff13&@60|<+0#0000001#e0e0e08|o|f| @7|o@1|f -| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|一*&| +&@7|r|a|b -| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|u|m| |五*&|å››|三|二|一 -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_pum_maxwidth_17.dump b/src/testdir/dumps/Test_pum_maxwidth_17.dump deleted file mode 100644 index 7bd5affd..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_17.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@70> |o@1|f -| +0#4040ff13&@60|…+0#0000001#e0e0e08|o|f| @7|o@1|f -| +0#4040ff13#ffffff0@60|…+0#0000001#ffd7ff255|一*&| +&@7|r|a|b -| +0#4040ff13#ffffff0@60|…+0#0000001#ffd7ff255|u|m| |五*&|å››|三|二|一 -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_pum_maxwidth_18.dump b/src/testdir/dumps/Test_pum_maxwidth_18.dump deleted file mode 100644 index 6a0b6b17..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_18.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@70> |r|a|b -| +0#4040ff13&@60|<+0#0000001#e0e0e08|o|f| |三*&|二|一| +&|r|a|b -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ -| @73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_pum_maxwidth_19.dump b/src/testdir/dumps/Test_pum_maxwidth_19.dump deleted file mode 100644 index 0b09ce9c..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_19.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1|>| +0#4040ff13#ffffff0@70 -|b+0#0000001#ffd7ff255|a|r|>| +0#4040ff13#ffffff0@70 -|一*0#0000001#ffd7ff255| +&|>| +0#4040ff13#ffffff0@70 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_20.dump b/src/testdir/dumps/Test_pum_maxwidth_20.dump deleted file mode 100644 index 2946f249..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_20.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@70> |o@1|f -| +0#4040ff13&@70|<+0#0000001#e0e0e08|o@1|f -| +0#4040ff13#ffffff0@70|<+0#0000001#ffd7ff255|r|a|b -| +0#4040ff13#ffffff0@70|<+0#0000001#ffd7ff255| |一*& -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_pum_maxwidth_21.dump b/src/testdir/dumps/Test_pum_maxwidth_21.dump deleted file mode 100644 index 53def2cf..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_21.dump +++ /dev/null @@ -1,8 +0,0 @@ -|f+0&#ffffff0|o@1> @71 -|f+0#0000001#e0e0e08|o@1| @7|f|o@1|K|>| +0#4040ff13#ffffff0@58 -|b+0#0000001#ffd7ff255|a|r| @7|一*&|二|>+&| +0#4040ff13#ffffff0@58 -|一*0#0000001#ffd7ff255|二|三|å››|五| +&|m|u|l|t|i| +0#4040ff13#ffffff0@58 -|~| @73 -|~| @73 -|~| @73 -|~| @73 diff --git a/src/testdir/dumps/Test_pum_maxwidth_22.dump b/src/testdir/dumps/Test_pum_maxwidth_22.dump deleted file mode 100644 index fa95a1ea..00000000 --- a/src/testdir/dumps/Test_pum_maxwidth_22.dump +++ /dev/null @@ -1,8 +0,0 @@ -| +0&#ffffff0@70> |o@1|f -| +0#4040ff13&@58|<+0#0000001#e0e0e08|K|o@1|f| @7|o@1|f -| +0#4040ff13#ffffff0@58|<+0#0000001#ffd7ff255|二*&|一| +&@7|r|a|b -| +0#4040ff13#ffffff0@58|i+0#0000001#ffd7ff255|t|l|u|m| |五*&|å››|三|二|一 -| +0#4040ff13#ffffff0@73|~ -| @73|~ -| @73|~ -| @73|~ diff --git a/src/testdir/dumps/Test_sign_number_without_signtext.dump b/src/testdir/dumps/Test_sign_number_without_signtext.dump deleted file mode 100644 index 0cf55bdb..00000000 --- a/src/testdir/dumps/Test_sign_number_without_signtext.dump +++ /dev/null @@ -1,5 +0,0 @@ -| +0#ffffff16#ff404010|>@1| >a+0#0000000#ffffff0| @69 -| +0#ffffff16#ff404010@1|2| |b+0#0000000#ffffff0| @69 -| +0#af5f00255&@1|3| |c+0#0000000&| @69 -|~+0#4040ff13&| @73 -| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_switchwin_clear_pum_01.dump b/src/testdir/dumps/Test_switchwin_clear_pum_01.dump deleted file mode 100644 index 9005f8d8..00000000 --- a/src/testdir/dumps/Test_switchwin_clear_pum_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -|b+0&#ffffff0@1| |b@2| |b@1> @27||+1&&|a+0&&@1| |a@2| |a@1| @27 -|~+0#4040ff13&| @4| +0#0000001#e0e0e08|b@1| @12| +0#4040ff13#ffffff0@14||+1#0000000&|~+0#4040ff13&| @35 -|~| @4| +0#0000001#ffd7ff255|b@2| @11| +0#4040ff13#ffffff0@14||+1#0000000&|~+0#4040ff13&| @35 -|~| @4| +0#0000001#ffd7ff255|a@1| @12| +0#4040ff13#ffffff0@14||+1#0000000&|~+0#4040ff13&| @35 -|~| @4| +0#0000001#ffd7ff255|a@2| @11| +0#4040ff13#ffffff0@14||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|w+3#0000000&|i|n|_|b| |[|+|]| @9|1|,|1|0| @10|A|l@1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|9| @11|A|l@1 -|-+2&&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |4| +0#0000000&@33 diff --git a/src/testdir/dumps/Test_switchwin_clear_pum_02.dump b/src/testdir/dumps/Test_switchwin_clear_pum_02.dump deleted file mode 100644 index 39013c09..00000000 --- a/src/testdir/dumps/Test_switchwin_clear_pum_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -|b+0&#ffffff0@1| |b@2| |b@1| @27||+1&&|a+0&&@1| |a@2| |a>a| @27 -|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|~| @35||+1#0000000&|~+0#4040ff13&| @35 -|w+1#0000000&|i|n|_|b| |[|+|]| @9|1|,|1|0| @10|A|l@1| |[+3&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|9| @11|A|l@1 -|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@62 diff --git a/src/testdir/dumps/Test_tabnext_clear_pum_01.dump b/src/testdir/dumps/Test_tabnext_clear_pum_01.dump deleted file mode 100644 index 6eb86e6c..00000000 --- a/src/testdir/dumps/Test_tabnext_clear_pum_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +8#0000001#e0e0e08|[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|+| |[|N|o| |N|a|m|e|]| | +1&&@49|X+8#0000001#e0e0e08 -|a+0#0000000#ffffff0@1| |a@2| |a@1> @65 -|~+0#4040ff13&| @4| +0#0000001#e0e0e08|a@1| @12| +0#4040ff13#ffffff0@52 -|~| @4| +0#0000001#ffd7ff255|a@2| @11| +0#4040ff13#ffffff0@52 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|-+2#0000000&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@33 diff --git a/src/testdir/dumps/Test_tabnext_clear_pum_02.dump b/src/testdir/dumps/Test_tabnext_clear_pum_02.dump deleted file mode 100644 index 347767c6..00000000 --- a/src/testdir/dumps/Test_tabnext_clear_pum_02.dump +++ /dev/null @@ -1,20 +0,0 @@ -| +2&#ffffff0|[|N|o| |N|a|m|e|]| | +8#0000001#e0e0e08|+| |[|N|o| |N|a|m|e|]| | +1#0000000#ffffff0@49|X+8#0000001#e0e0e08 -> +0#0000000#ffffff0@74 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|0|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_xxd_color_0.dump b/src/testdir/dumps/Test_xxd_color_0.dump index 0b3b5fc1..73cbe6b6 100644 --- a/src/testdir/dumps/Test_xxd_color_0.dump +++ b/src/testdir/dumps/Test_xxd_color_0.dump @@ -1,5 +1,4 @@ -|$+0&#ffffff0| |.@1|/|x@1|d|/|x@1|d| |-|R| |n|e|v|e|r| @1|<| |X@1|D|f|i|l|e|_|c|o|l|o|r|s| @35 -|0@7|:| |0@2|1| |0|2|0|3| |0|4|0|5| |0|6|0|7| |0|8|0|9| |0|a|0|b| |0|c|0|d| |0|e|0|f| @1|.@15| @7 +|$+0&#ffffff0| |0@7|:| |0@2|1| |0|2|0|3| |0|4|0|5| |0|6|0|7| |0|8|0|9| |0|a|0|b| |0|c|0|d| |0|e|0|f| @1|.@15| @7 |0@5|1|0|:| |1|0|1@1| |1|2|1|3| |1|4|1|5| |1|6|1|7| |1|8|1|9| |1|a|1|b| |1|c|1|d| |1|e|1|f| @1|.@15| @7 |0@5|2|0|:| |2|0|2|1| |2@2|3| |2|4|2|5| |2|6|0@1| |2|8|2|9| |2|a|2|b| |2|c|2|d| |2|e|2|f| @2|!|"|#|$|%|&|.|(|)|*|+|,|-|.|/| @7 |0@5|3|0|:| |3|0|3|1| |3|2|3@1| |3|4|3|5| |3|6|3|7| |3|8|3|9| |3|a|3|b| |3|c|3|d| |3|e|3|f| @1|0|1|2|3|4|5|6|7|8|9|:|;|<|=|>|?| @7 diff --git a/src/testdir/dumps/Test_xxd_color_1.vim b/src/testdir/dumps/Test_xxd_color_1.vim index 7ac1f264..daf8dd39 100644 --- a/src/testdir/dumps/Test_xxd_color_1.vim +++ b/src/testdir/dumps/Test_xxd_color_1.vim @@ -1,2 +1,3 @@ " Filter that removes the Shell Prompt from the xxd command -:1s#|\$+0&\#ffffff0| \S\+/|x@1|d|.*\n#|$+0\&\#ffffff0| #e +" 18,20d +:1s#|\$+0&\#ffffff0| |.@1|/|x@1|d|/|x@1|d|.*\n#|$+0\&\#ffffff0| #e diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim index 3d798e9f..b3a89a0f 100644 --- a/src/testdir/gen_opt_test.vim +++ b/src/testdir/gen_opt_test.vim @@ -73,7 +73,6 @@ let test_values = { \ []], \ "\ number options - \ 'chistory': [[1, 2, 10, 50], [1000, -1]], \ 'cmdheight': [[1, 2, 10], [-1, 0]], \ 'cmdwinheight': [[1, 2, 10], [-1, 0]], \ 'columns': [[12, 80, 10000], [-1, 0, 10]], @@ -84,7 +83,6 @@ let test_values = { \ 'iminsert': [[0, 1, 2], [-1, 3, 999]], \ 'imsearch': [[-1, 0, 1, 2], [-2, 3, 999]], \ 'imstyle': [[0, 1], [-1, 2, 999]], - \ 'lhistory': [[1, 2, 10, 50], [1000, -1]], \ 'lines': [[2, 24, 1000], [-1, 0, 1]], \ 'linespace': [[-1, 0, 2, 4, 999], ['']], \ 'numberwidth': [[1, 4, 8, 10, 11, 20], [-1, 0, 21]], @@ -184,12 +182,10 @@ let test_values = { \ 'closeoff', 'hiddenoff', 'foldcolumn:0', 'foldcolumn:12', \ 'followwrap', 'internal', 'indent-heuristic', 'algorithm:myers', \ 'icase,iwhite', 'algorithm:minimal', 'algorithm:patience', - \ 'algorithm:histogram', 'inline:none', 'inline:simple', - \ 'inline:char', 'inline:word', 'inline:char,inline:word', 'linematch:5'], + \ 'algorithm:histogram', 'linematch:5'], \ ['xxx', 'foldcolumn:', 'foldcolumn:x', 'foldcolumn:xxx', \ 'linematch:', 'linematch:x', 'linematch:xxx', 'algorithm:', - \ 'algorithm:xxx', 'context:', 'context:x', 'context:xxx', - \ 'inline:xxx']], + \ 'algorithm:xxx', 'context:', 'context:x', 'context:xxx']], \ 'display': [['', 'lastline', 'truncate', 'uhex', 'lastline,uhex'], \ ['xxx']], \ 'eadirection': [['', 'both', 'ver', 'hor'], ['xxx', 'ver,hor']], @@ -203,9 +199,8 @@ let test_values = { \ 'fileformats': [['', 'dos', 'dos,unix'], ['xxx']], \ 'fillchars': [['', 'stl:x', 'stlnc:x', 'vert:x', 'fold:x', 'foldopen:x', \ 'foldclose:x', 'foldsep:x', 'diff:x', 'eob:x', 'lastline:x', - \ 'trunc:_', 'trunc:_,eob:x,trunc:_', - \ 'stl:\ ,vert:\|,fold:\\,trunc:…,diff:x'], - \ ['xxx', 'vert:', 'trunc:', "trunc:\b"]], + \ 'stl:\ ,vert:\|,fold:\\,diff:x'], + \ ['xxx', 'vert:']], \ 'foldclose': [['', 'all'], ['xxx']], \ 'foldmethod': [['manual', 'indent', 'expr', 'marker', 'syntax', 'diff'], \ ['', 'xxx', 'expr,diff']], @@ -229,7 +224,6 @@ let test_values = { \ 'imactivatekey': [['', 'S-space'], ['xxx']], \ 'isfname': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'isident': [['', '@', '@,48-52'], ['xxx', '@48']], - \ 'isexpand': [['', '.,->', '/,/*,\\,'], [',,', '\\,,']], \ 'iskeyword': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'isprint': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'jumpoptions': [['', 'stack'], ['xxx']], diff --git a/src/testdir/lsan-suppress.txt b/src/testdir/lsan-suppress.txt index 46421d3c..8e1451e7 100644 --- a/src/testdir/lsan-suppress.txt +++ b/src/testdir/lsan-suppress.txt @@ -11,6 +11,3 @@ leak:libperl.so.* leak:libpython*.so.* leak:libruby*.so.* leak:libxcb*.so.* -# The renderer leaks 128 bytes of metadata when run under CI. Seems to only -# happen with software rendering. -leak:gdk_x11_screen_init_gl diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 0d531215..c14f44e6 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -606,8 +606,6 @@ for g:testfunc in sort(s:tests) " A test can set g:test_is_flaky to retry running the test. let g:test_is_flaky = 0 - let g:check_screendump_called = v:false - " A test can set g:max_run_nr to change the max retry count. let g:max_run_nr = 5 if has('mac') diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim index d7207d41..744f2ab6 100644 --- a/src/testdir/screendump.vim +++ b/src/testdir/screendump.vim @@ -48,10 +48,6 @@ enddef " message. Use this when using the same dump file with different options. " Returns non-zero when verification fails. func VerifyScreenDump(buf, filename, options, ...) - if has('gui_running') && exists("g:check_screendump_called") && g:check_screendump_called == v:false - echoerr "VerifyScreenDump() called from a test that lacks a CheckScreendump guard." - return 1 - endif let reference = 'dumps/' . a:filename . '.dump' let filter = 'dumps/' . a:filename . '.vim' let testfile = 'failed/' . a:filename . '.dump' diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim index c320d096..d21a2221 100644 --- a/src/testdir/test_arglist.vim +++ b/src/testdir/test_arglist.vim @@ -640,7 +640,7 @@ endfunc func Test_clear_arglist_in_all() n 0 00 000 0000 00000 000000 au WinNew 0 n 0 - call assert_fails("all", "E1156:") + call assert_fails("all", "E1156") au! * endfunc diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index db555830..2519e60a 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -580,7 +580,6 @@ func Test_WinScrolled_close_curwin() endfunc func Test_WinScrolled_once_only() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -610,7 +609,6 @@ endfunc " Check that WinScrolled is not triggered immediately when defined and there " are split windows. func Test_WinScrolled_not_when_defined() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2002,122 +2000,6 @@ func Test_QuitPre() bwipe Xbar endfunc -func Test_Cmdline_Trigger() - autocmd CmdlineLeavePre : let g:log = "CmdlineLeavePre" - autocmd CmdlineLeave : let g:log2 = "CmdlineLeave" - new - let g:log = '' - let g:log2 = '' - nnoremap echo "hello" - call feedkeys("\", 'x') - call assert_equal('', g:log) - call assert_equal('', g:log2) - nunmap - - let g:log = '' - let g:log2 = '' - nnoremap :echo "hello" - call feedkeys("\", 'x') - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - nunmap - - let g:log = '' - let g:log2 = '' - call feedkeys(":\", "tx") - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - - let g:log = '' - let g:log2 = '' - split - call assert_equal('', g:log) - call feedkeys(":echo hello", "tx") - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - - let g:log = '' - let g:log2 = '' - close - call assert_equal('', g:log) - call feedkeys(":echo hello", "tx") - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - - let g:log = '' - let g:log2 = '' - tabnew - call assert_equal('', g:log) - call feedkeys(":echo hello", "tx") - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - - let g:log = '' - let g:log2 = '' - split - call assert_equal('', g:log) - call feedkeys(":echo hello", "tx") - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - - let g:log = '' - let g:log2 = '' - tabclose - call assert_equal('', g:log) - call feedkeys(":echo hello", "tx") - call assert_equal('CmdlineLeavePre', g:log) - call assert_equal('CmdlineLeave', g:log2) - - autocmd CmdlineLeavePre * let g:cmdline += [getcmdline()] - - for end_keys in ["\", "\", "\", "\", "\", - \ "\\", "\\"] - let g:cmdline = [] - let g:log = '' - let g:log2 = '' - call assert_equal('', g:log) - let keys = $':echo "hello"{end_keys}' - let msg = keytrans(keys) - call feedkeys(keys, "tx") - call assert_equal(['echo "hello"'], g:cmdline, msg) - call assert_equal('CmdlineLeavePre', g:log, msg) - call assert_equal('CmdlineLeave', g:log2, msg) - endfor - - let g:cmdline = [] - call feedkeys(":let c = input('? ')\ABCDE\", "tx") - call assert_equal(["let c = input('? ')", 'ABCDE'], g:cmdline) - - au! CmdlineLeavePre - unlet! g:cmdline - unlet! g:log - unlet! g:log2 - bw! -endfunc - -" Ensure :cabbr does not cause a spurious CmdlineLeavePre. -func Test_CmdlineLeavePre_cabbr() - " For unknown reason this fails intermittently on MS-Windows - CheckNotMSWindows - CheckFeature terminal - let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3}) - call assert_equal('running', term_getstatus(buf)) - call term_sendkeys(buf, ":let g:a=0\") - call term_wait(buf, 50) - call term_sendkeys(buf, ":cabbr v v\") - call term_wait(buf, 50) - call term_sendkeys(buf, ":command! -nargs=* Foo echo\") - call term_wait(buf, 50) - call term_sendkeys(buf, ":au! CmdlineLeavePre * :let g:a+=1\") - call term_wait(buf, 50) - call term_sendkeys(buf, ":Foo v\") - call term_wait(buf, 50) - call term_sendkeys(buf, ":echo g:a\") - call term_wait(buf, 50) - call WaitForAssert({-> assert_match('^2.*$', term_getline(buf, 3))}) - bwipe! -endfunc - func Test_Cmdline() au! CmdlineChanged : let g:text = getcmdline() let g:text = 0 @@ -2191,54 +2073,30 @@ func Test_Cmdline() au! CmdlineEnter : let g:entered = expand('') au! CmdlineLeave : let g:left = expand('') - au! CmdlineLeavePre : let g:leftpre = expand('') let g:entered = 0 let g:left = 0 - let g:leftpre = 0 call feedkeys(":echo 'hello'\", 'xt') call assert_equal(':', g:entered) call assert_equal(':', g:left) - call assert_equal(':', g:leftpre) au! CmdlineEnter au! CmdlineLeave - au! CmdlineLeavePre let save_shellslash = &shellslash set noshellslash au! CmdlineEnter / let g:entered = expand('') au! CmdlineLeave / let g:left = expand('') - au! CmdlineLeavePre / let g:leftpre = expand('') let g:entered = 0 let g:left = 0 - let g:leftpre = 0 new call setline(1, 'hello') call feedkeys("/hello\", 'xt') call assert_equal('/', g:entered) call assert_equal('/', g:left) - call assert_equal('/', g:leftpre) bwipe! au! CmdlineEnter au! CmdlineLeave - au! CmdlineLeavePre let &shellslash = save_shellslash - let g:left = "cancelled" - let g:leftpre = "cancelled" - au! CmdlineLeave : let g:left = "triggered" - au! CmdlineLeavePre : let g:leftpre = "triggered" - call feedkeys(":echo 'hello'\", 'xt') - call assert_equal('triggered', g:left) - call assert_equal('triggered', g:leftpre) - let g:left = "cancelled" - let g:leftpre = "cancelled" - au! CmdlineLeave : let g:left = "triggered" - call feedkeys(":echo 'hello'\", 'xt') - call assert_equal('triggered', g:left) - call assert_equal('triggered', g:leftpre) - au! CmdlineLeave - au! CmdlineLeavePre - au! CursorMovedC : let g:pos += [getcmdpos()] let g:pos = [] call feedkeys(":foo bar baz\\\\", 'xt') @@ -3026,7 +2884,6 @@ endfunc func Test_autocmd_nested_switch_window() " run this in a separate Vim so that SafeState works CheckRunVimInTerminal - CheckScreendump let lines =<< trim END vim9script @@ -3804,9 +3661,9 @@ func Test_autocmd_normal_mess() augroup aucmd_normal_test au BufLeave,BufWinLeave,BufHidden,BufUnload,BufDelete,BufWipeout * norm 7q/qc augroup END - call assert_fails('o4', 'E1159:') + call assert_fails('o4', 'E1159') silent! H - call assert_fails('e xx', 'E1159:') + call assert_fails('e xx', 'E1159') normal G augroup aucmd_normal_test @@ -5038,8 +4895,7 @@ func Test_autocmd_BufWinLeave_with_vsp() exe "e " fname vsp augroup testing - exe 'au BufWinLeave' fname 'e' dummy - \ '| call assert_fails(''vsp' fname ''', ''E1546:'')' + exe "au BufWinLeave " .. fname .. " :e " dummy .. "| vsp " .. fname augroup END bw call CleanUpTestAuGroup() @@ -5222,32 +5078,32 @@ func Test_autocmd_tabclosedpre() " Close tab in TabClosedPre autocmd call ClearAutomcdAndCreateTabs() au TabClosedPre * tabclose - call assert_fails('tabclose', 'E1312:') + call assert_fails('tabclose', 'E1312') call ClearAutomcdAndCreateTabs() au TabClosedPre * tabclose - call assert_fails('tabclose 2', 'E1312:') + call assert_fails('tabclose 2', 'E1312') call ClearAutomcdAndCreateTabs() au TabClosedPre * tabclose 1 - call assert_fails('tabclose', 'E1312:') + call assert_fails('tabclose', 'E1312') " Close other (all) tabs in TabClosedPre autocmd call ClearAutomcdAndCreateTabs() au TabClosedPre * tabonly - call assert_fails('tabclose', 'E1312:') + call assert_fails('tabclose', 'E1312') call ClearAutomcdAndCreateTabs() au TabClosedPre * tabonly - call assert_fails('tabclose 2', 'E1312:') + call assert_fails('tabclose 2', 'E1312') call ClearAutomcdAndCreateTabs() au TabClosedPre * tabclose 4 - call assert_fails('tabclose 2', 'E1312:') + call assert_fails('tabclose 2', 'E1312') " Open new tabs in TabClosedPre autocmd call ClearAutomcdAndCreateTabs() au TabClosedPre * tabnew D - call assert_fails('tabclose', 'E1312:') + call assert_fails('tabclose', 'E1312') call ClearAutomcdAndCreateTabs() au TabClosedPre * tabnew D - call assert_fails('tabclose 1', 'E1312:') + call assert_fails('tabclose 1', 'E1312') " Moving the tab page in TabClosedPre autocmd call ClearAutomcdAndCreateTabs() @@ -5276,10 +5132,10 @@ func Test_autocmd_tabclosedpre() " Create new windows in TabClosedPre autocmd call ClearAutomcdAndCreateTabs() au TabClosedPre * split | e X| vsplit | e Y | split | e Z - call assert_fails('tabclose', 'E242:') + call assert_fails('tabclose', 'E242') call ClearAutomcdAndCreateTabs() au TabClosedPre * new X | new Y | new Z - call assert_fails('tabclose 1', 'E242:') + call assert_fails('tabclose 1', 'E242') " Test directly closing the tab page with ':tabclose' au! @@ -5314,80 +5170,4 @@ func Test_autocmd_tabclosedpre() bw! endfunc -func Test_eventignorewin_non_current() - defer CleanUpTestAuGroup() - let s:triggered = '' - augroup testing - " Will set to the buffer of the closing window. - autocmd WinClosed * let s:triggered = 'WinClosed' - augroup END - let initial_win = win_getid() - - new - let new_buf = bufnr() - " Only set for one of the windows into the new buffer. - setlocal eventignorewin=all - split - setlocal eventignorewin= - let close_winnr = winnr() - - " Return to the window where the buffer is non-current. WinClosed should - " trigger as not all windows into new_buf have 'eventignorewin' set for it. - call win_gotoid(initial_win) - call assert_notequal(new_buf, bufnr()) - execute close_winnr 'close' - call assert_equal('WinClosed', s:triggered) - - wincmd w - call assert_equal(new_buf, bufnr()) - tab split - setlocal eventignorewin= - let close_winnr = win_getid() - - " Ensure that new_buf's window in the other tabpage with 'eventignorewin' - " unset allows WinClosed to run when new_buf is non-current. - call win_gotoid(initial_win) - call assert_notequal(new_buf, bufnr()) - let s:triggered = '' - only! - call assert_equal('WinClosed', s:triggered) - call assert_equal(1, win_findbuf(new_buf)->len()) - - " Create an only window to new_buf with 'eventignorewin' set. - tabonly! - execute new_buf 'sbuffer' - setlocal eventignorewin=all - wincmd p - call assert_equal(1, win_findbuf(new_buf)->len()) - call assert_notequal(new_buf, bufnr()) - - " Closing a window unrelated to new_buf should not block WinClosed. - split - let s:triggered = '' - close - call assert_equal('WinClosed', s:triggered) - call assert_equal(1, win_findbuf(new_buf)->len()) - - " Check WinClosed is blocked when we close the only window to new_buf (that - " has 'eventignorewin' set) while new_buf is non-current. - call assert_notequal(new_buf, bufnr()) - let s:triggered = '' - only! - call assert_equal('', s:triggered) - call assert_equal(0, win_findbuf(new_buf)->len()) - - augroup testing - autocmd! - autocmd BufNew * ++once let s:triggered = 'BufNew' - augroup END - - " Buffer not shown in a window, 'eventignorewin' should not block (and - " can't even be set for it anyway in this case). - badd foo - call assert_equal('BufNew', s:triggered) - - unlet! s:triggered - %bw! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim index 1a9e2258..3db37a76 100644 --- a/src/testdir/test_balloon.vim +++ b/src/testdir/test_balloon.vim @@ -6,6 +6,7 @@ CheckNotGui CheckFeature balloon_eval_term source screendump.vim +CheckScreendump let s:common_script =<< trim [CODE] call setline(1, ["one one one", "two tXo two", "three three three"]) @@ -18,7 +19,6 @@ let s:common_script =<< trim [CODE] [CODE] func Test_balloon_eval_term() - CheckScreendump " Use after to return from vgetc() without removing " the balloon. let xtra_lines =<< trim [CODE] @@ -49,7 +49,6 @@ func Test_balloon_eval_term() endfunc func Test_balloon_eval_term_visual() - CheckScreendump " Use after to return from vgetc() without removing " the balloon. call writefile(s:common_script + [ @@ -67,7 +66,6 @@ func Test_balloon_eval_term_visual() endfunc func Test_balloon_eval_term_rightleft() - CheckScreendump CheckFeature rightleft " Use after to return from vgetc() without removing diff --git a/src/testdir/test_blob.vim b/src/testdir/test_blob.vim index addb3950..f0e82090 100644 --- a/src/testdir/test_blob.vim +++ b/src/testdir/test_blob.vim @@ -35,7 +35,7 @@ func Test_blob_create() call assert_fails('VAR b = 0z1.1') call assert_fails('VAR b = 0z.') call assert_fails('VAR b = 0z001122.') - call assert_fails('call get("", 1)', 'E1531:') + call assert_fails('call get("", 1)', 'E896:') call assert_equal(0, len(test_null_blob())) call assert_equal(0z, copy(test_null_blob())) END @@ -240,13 +240,13 @@ func Test_blob_compare() VAR b1 = 0z0011 echo b1 == 9 END - call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072:', 'E1072:']) + call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072', 'E1072']) let lines =<< trim END VAR b1 = 0z0011 echo b1 != 9 END - call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072:', 'E1072:']) + call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072', 'E1072']) let lines =<< trim END VAR b1 = 0z0011 @@ -786,7 +786,6 @@ endfunc func Test_blob_repeat() call assert_equal(0z, repeat(0z00, 0)) - call assert_equal(0z, repeat(0z, 1)) call assert_equal(0z00, repeat(0z00, 1)) call assert_equal(0z0000, repeat(0z00, 2)) call assert_equal(0z00000000, repeat(0z0000, 2)) diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim index 36a6ef50..757ba057 100644 --- a/src/testdir/test_buffer.vim +++ b/src/testdir/test_buffer.vim @@ -569,39 +569,4 @@ func Test_buflist_alloc_failure() call assert_fails('cexpr "XallocFail6:10:Line10"', 'E342:') endfunc -func Test_closed_buffer_still_in_window() - %bw! - - let s:w = win_getid() - new - let s:b = bufnr() - setl bufhidden=wipe - - augroup ViewClosedBuffer - autocmd! - autocmd BufUnload * ++once call assert_fails( - \ 'call win_execute(s:w, "' .. s:b .. 'b")', 'E1546:') - augroup END - quit! - " Previously resulted in s:b being curbuf while unloaded (no memfile). - call assert_equal(1, bufloaded(bufnr())) - call assert_equal(0, bufexists(s:b)) - - let s:w = win_getid() - split - new - let s:b = bufnr() - - augroup ViewClosedBuffer - autocmd! - autocmd BufWipeout * ++once call win_gotoid(s:w) - \| call assert_fails(s:b .. 'b', 'E1546:') | wincmd p - augroup END - bw! " Close only this buffer first; used to be a heap UAF. - - unlet! s:w s:b - autocmd! ViewClosedBuffer - %bw! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_clientserver.vim b/src/testdir/test_clientserver.vim index 02b0c392..8be521b9 100644 --- a/src/testdir/test_clientserver.vim +++ b/src/testdir/test_clientserver.vim @@ -191,47 +191,6 @@ func Test_client_server() \ has('unix') ? ['E573:.*abc'] : 'E258:') endfunc -func Test_client_server_stopinsert() - " test does not work on MS-Windows - CheckNotMSWindows - let g:test_is_flaky = 1 - let cmd = GetVimCommand() - if cmd == '' - throw 'GetVimCommand() failed' - endif - call Check_X11_Connection() - let fname = 'Xclientserver_stop.txt' - let name = 'XVIMTEST2' - call writefile(['one two three'], fname, 'D') - - let cmd .= ' -c "set virtualedit=onemore"' - let cmd .= ' -c "call cursor(1, 14)"' - let cmd .= ' -c "startinsert"' - let cmd .= ' --servername ' . name - let cmd .= ' ' .. fname - let job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'}) - call WaitForAssert({-> assert_equal("run", job_status(job))}) - - " Takes a short while for the server to be active. - " When using valgrind it takes much longer. - call WaitForAssert({-> assert_match(name, serverlist())}) - - call remote_expr(name, 'execute("stopinsert")') - - call assert_equal('n', name->remote_expr("mode(1)")) - call assert_equal('13', name->remote_expr("col('.')")) - - eval name->remote_send(":qa!\") - try - call WaitForAssert({-> assert_equal("dead", job_status(job))}) - finally - if job_status(job) != 'dead' - call assert_report('Server did not exit') - call job_stop(job, 'kill') - endif - endtry -endfunc - " Uncomment this line to get a debugging log " call ch_logfile('channellog', 'w') diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 68933a3c..57b57cb8 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -684,13 +684,6 @@ func Test_getcompletion() let l = getcompletion('kill', 'expression') call assert_equal([], l) - let l = getcompletion('', 'filetypecmd') - call assert_equal(["indent", "off", "on", "plugin"], l) - let l = getcompletion('not', 'filetypecmd') - call assert_equal([], l) - let l = getcompletion('o', 'filetypecmd') - call assert_equal(['off', 'on'], l) - let l = getcompletion('tag', 'function') call assert_true(index(l, 'taglist(') >= 0) let l = getcompletion('paint', 'function') @@ -2637,7 +2630,6 @@ endfunc " Test for using a popup menu for the command line completion matches " (wildoptions=pum) func Test_wildmenu_pum() - CheckScreendump CheckRunVimInTerminal let commands =<< trim [CODE] @@ -2930,7 +2922,6 @@ func Test_wildmenumode_with_pum() endfunc func Test_wildmenu_with_pum_foldexpr() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2956,7 +2947,6 @@ endfunc " The popup menu should be positioned correctly over the status line of the " bottom-most window. func Test_wildmenu_pum_from_terminal() - CheckScreendump CheckRunVimInTerminal let python = PythonProg() call CheckPython(python) @@ -2977,7 +2967,6 @@ func Test_wildmenu_pum_from_terminal() endfunc func Test_wildmenu_pum_odd_wildchar() - CheckScreendump CheckRunVimInTerminal " Test odd wildchar interactions with pum. Make sure they behave properly @@ -3220,26 +3209,6 @@ func Test_fuzzy_completion_behave() set wildoptions& endfunc -" :filetype suboptions completion -func Test_completion_filetypecmd() - set wildoptions& - call feedkeys(":filetype \\\"\", 'tx') - call assert_equal('"filetype indent off on plugin', @:) - call feedkeys(":filetype plugin \\\"\", 'tx') - call assert_equal('"filetype plugin indent off on', @:) - call feedkeys(":filetype indent \\\"\", 'tx') - call assert_equal('"filetype indent off on plugin', @:) - call feedkeys(":filetype i\\\"\", 'tx') - call assert_equal('"filetype indent', @:) - call feedkeys(":filetype p\\\"\", 'tx') - call assert_equal('"filetype plugin', @:) - call feedkeys(":filetype o\\\"\", 'tx') - call assert_equal('"filetype off on', @:) - call feedkeys(":filetype indent of\\\"\", 'tx') - call assert_equal('"filetype indent off', @:) - set wildoptions& -endfunc - " " colorscheme name fuzzy completion - NOT supported " func Test_fuzzy_completion_colorscheme() " endfunc @@ -4271,7 +4240,7 @@ func Test_ex_command_completion() " required for :* set cpo+=* let list = filter(getcompletion('', 'command'), 'exists(":" . v:val) == 0') - " :++ and :-- are only valid in Vim9 script context, so they can be ignored + " :++ and :-- are only valid in Vim9 Script context, so they can be ignored call assert_equal(['++', '--'], sort(list)) call assert_equal(2, exists(':k')) call assert_equal(0, exists(':ke')) @@ -4299,50 +4268,4 @@ func Test_cd_bslash_completion_windows() let &shellslash = save_shellslash endfunc -" Test cmdcomplete_info() with CmdlineLeavePre autocmd -func Test_cmdcomplete_info() - augroup test_CmdlineLeavePre - autocmd! - " Calling expand() should not interfere with cmdcomplete_info(). - autocmd CmdlineLeavePre * call expand('test_cmdline.*') - autocmd CmdlineLeavePre * let g:cmdcomplete_info = string(cmdcomplete_info()) - augroup END - new - call assert_equal({}, cmdcomplete_info()) - call feedkeys(":h echom\", "tx") " No expansion - call assert_equal('{}', g:cmdcomplete_info) - call feedkeys(":h echoms\\", "tx") - call assert_equal('{''cmdline_orig'': '''', ''pum_visible'': 0, ''matches'': [], ''selected'': 0}', g:cmdcomplete_info) - call feedkeys(":h echom\\", "tx") - call assert_equal( - \ '{''cmdline_orig'': ''h echom'', ''pum_visible'': 0, ''matches'': ['':echom'', '':echomsg''], ''selected'': 0}', - \ g:cmdcomplete_info) - call feedkeys(":h echom\\\", "tx") - call assert_equal( - \ '{''cmdline_orig'': ''h echom'', ''pum_visible'': 0, ''matches'': ['':echom'', '':echomsg''], ''selected'': 1}', - \ g:cmdcomplete_info) - call feedkeys(":h echom\\\\", "tx") - call assert_equal( - \ '{''cmdline_orig'': ''h echom'', ''pum_visible'': 0, ''matches'': ['':echom'', '':echomsg''], ''selected'': -1}', - \ g:cmdcomplete_info) - - set wildoptions=pum - call feedkeys(":h echoms\\", "tx") - call assert_equal('{''cmdline_orig'': '''', ''pum_visible'': 0, ''matches'': [], ''selected'': 0}', g:cmdcomplete_info) - call feedkeys(":h echom\\", "tx") - call assert_equal( - \ '{''cmdline_orig'': ''h echom'', ''pum_visible'': 1, ''matches'': ['':echom'', '':echomsg''], ''selected'': 0}', - \ g:cmdcomplete_info) - call feedkeys(":h echom\\\", "tx") - call assert_equal( - \ '{''cmdline_orig'': ''h echom'', ''pum_visible'': 1, ''matches'': ['':echom'', '':echomsg''], ''selected'': 1}', - \ g:cmdcomplete_info) - call feedkeys(":h echom\\\\", "tx") - call assert_equal( - \ '{''cmdline_orig'': ''h echom'', ''pum_visible'': 1, ''matches'': ['':echom'', '':echomsg''], ''selected'': -1}', - \ g:cmdcomplete_info) - bw! - set wildoptions& -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_codestyle.vim b/src/testdir/test_codestyle.vim index b7bbad3f..51c1209d 100644 --- a/src/testdir/test_codestyle.vim +++ b/src/testdir/test_codestyle.vim @@ -163,30 +163,5 @@ def Test_help_files() bwipe! enddef -def Test_indent_of_source_files() - for fname in glob('../*.[ch]', 0, 1) + ['../xxd/xxd.c'] - execute 'tabnew ' .. fname - if &expandtab - continue - endif - for lnum in range(1, line('$')) - var name: string = synIDattr(synID(lnum, 1, 0), 'name') - if -1 == index(['cComment', 'cCommentStart'], name) - var line: string = getline(lnum) - var indent: string = matchstr(line, '^\s*') - var tailing: string = matchstr(line, '\s*$') - if !empty(indent) - if indent !~# '^\t* \{0,7}$' - ReportError('testdir/' .. fname, lnum, 'invalid indent') - endif - endif - if !empty(tailing) - ReportError('testdir/' .. fname, lnum, 'tailing spaces') - endif - endif - endfor - close - endfor -enddef " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_comments.vim b/src/testdir/test_comments.vim index f22f9030..67454f47 100644 --- a/src/testdir/test_comments.vim +++ b/src/testdir/test_comments.vim @@ -17,7 +17,7 @@ func Test_comment_nested() >>>> H END call assert_equal(expected, getline(1, '$')) - bw! + close! endfunc " Test for the 'b' flag in 'comments' @@ -36,7 +36,7 @@ func Test_comment_blank() H END call assert_equal(expected, getline(1, '$')) - bw! + close! endfunc " Test for the 'f' flag in 'comments' (only the first line has a comment @@ -50,7 +50,7 @@ func Test_comment_firstline() setlocal comments=:- exe "normal i- B\nD\ggoC\ggOA\" call assert_equal(['- A', '- B', '- C', '- D'], getline(1, '$')) - bw! + close! endfunc " Test for the 's', 'm' and 'e' flags in 'comments' @@ -75,7 +75,7 @@ func Test_comment_threepiece() setlocal autoindent noexpandtab call feedkeys("a\t/*\tone\ntwo\n/", 'xt') call assert_equal(["\t/*\tone", "\t *\ttwo", "\t */"], getline(1, '$')) - bw! + close! endfunc " Test for the 'r' flag in 'comments' (right align comment) @@ -97,7 +97,7 @@ func Test_comment_rightalign() G END call assert_equal(expected, getline(1, '$')) - bw! + close! endfunc " Test for the 'O' flag in 'comments' @@ -112,7 +112,7 @@ func Test_comment_O() * D END call assert_equal(expected, getline(1, '$')) - bw! + close! endfunc " Test for using a multibyte character as a comment leader @@ -185,7 +185,7 @@ func Test_comment_multibyte_leader() call assert_equal(expected, getline(1, '$')) set tw& fo& comments& - bw! + close! endfunc " Test for a space character in 'comments' setting @@ -205,7 +205,7 @@ func Test_comment_space() > H END call assert_equal(expected, getline(1, '$')) - bw! + close! endfunc " Test for formatting lines with and without comments @@ -214,7 +214,7 @@ func Test_comment_format_lines() call setline(1, ['one', '/* two */', 'three']) normal gggqG call assert_equal(['one', '/* two */', 'three'], getline(1, '$')) - bw! + close! endfunc " Test for using 'a' in 'formatoptions' with comments @@ -243,7 +243,7 @@ func Test_comment_autoformat() call assert_equal(['one'], getline(1, '$')) set backspace& - bw! + close! endfunc " Test for joining lines with comments ('j' flag in 'formatoptions') @@ -262,7 +262,7 @@ func Test_comment_join_lines_fo_j() call setline(1, ['i++; > ) > ) comment1', ' > ) comment2']) normal J call assert_equal('i++; > ) > ) comment1 comment2', getline(1)) - bw! + close! endfunc " Test for formatting lines where only the first line has a comment. @@ -277,7 +277,7 @@ func Test_comment_format_firstline_comment() call setline(1, ['- one', '- two']) normal gggqG call assert_equal(['- one', '- two'], getline(1, '$')) - bw! + close! endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim index bac3ed10..2ce7384b 100644 --- a/src/testdir/test_conceal.vim +++ b/src/testdir/test_conceal.vim @@ -559,8 +559,6 @@ endfunc " Test that cursor is drawn at the correct column when it is after end of the " line with 'virtualedit' and concealing. func Run_test_conceal_virtualedit_after_eol(wrap) - CheckScreendump - let code =<< trim eval [CODE] let &wrap = {a:wrap} call setline(1, 'abcdefgh|hidden|ijklmnpop') @@ -593,8 +591,6 @@ endfunc " Same as Run_test_conceal_virtualedit_after_eol(), but with 'rightleft'. func Run_test_conceal_virtualedit_after_eol_rightleft(wrap) - CheckScreendump - let code =<< trim eval [CODE] let &wrap = {a:wrap} call setline(1, 'abcdefgh|hidden|ijklmnpop') @@ -628,8 +624,6 @@ endfunc " Test that cursor position is correct when double-width chars are concealed. func Run_test_conceal_double_width(wrap) - CheckScreendump - let code =<< trim eval [CODE] let &wrap = {a:wrap} call setline(1, ['aaaaaå£=å£bbbbbå£=å£ccccc', 'foobar']) diff --git a/src/testdir/test_crash.vim b/src/testdir/test_crash.vim index 80c1ccf0..85b1290d 100644 --- a/src/testdir/test_crash.vim +++ b/src/testdir/test_crash.vim @@ -218,7 +218,6 @@ func Test_crash1_3() endfunc func Test_crash2() - CheckScreendump " The following used to crash Vim let opts = #{wait_for_ruler: 0, rows: 20} let args = ' -u NONE -i NONE -n -e -s -S ' diff --git a/src/testdir/test_crypt.vim b/src/testdir/test_crypt.vim index f056e38f..85ed5740 100644 --- a/src/testdir/test_crypt.vim +++ b/src/testdir/test_crypt.vim @@ -344,7 +344,7 @@ func Test_uncrypt_xchacha20_3_persistent_undo() " should fail norm! u call assert_match('Already at oldest change', execute(':1mess')) - call assert_fails('verbose rundo ' .. fnameescape(ufile), 'E822:') + call assert_fails('verbose rundo ' .. fnameescape(ufile), 'E822') bw! set undolevels& cryptmethod& undofile& call delete('Xcrypt_sodium_undo.txt') @@ -357,8 +357,8 @@ func Test_encrypt_xchacha20_missing() return endif sp Xcrypt_sodium_undo.txt - call assert_fails(':set cryptmethod=xchacha20', 'E474:') - call assert_fails(':set cryptmethod=xchacha20v2', 'E474:') + call assert_fails(':set cryptmethod=xchacha20', 'E474') + call assert_fails(':set cryptmethod=xchacha20v2', 'E474') bw! set cm& endfunc diff --git a/src/testdir/test_cursor_func.vim b/src/testdir/test_cursor_func.vim index 1fd6b5fc..8766f97d 100644 --- a/src/testdir/test_cursor_func.vim +++ b/src/testdir/test_cursor_func.vim @@ -92,10 +92,6 @@ func Test_curswant_with_cursorline() endfunc func Test_screenpos() - if has('gui_running') - set lines=25 - set columns=78 - endif rightbelow new rightbelow 20vsplit call setline(1, ["\tsome text", "long wrapping line here", "next line"]) diff --git a/src/testdir/test_delete.vim b/src/testdir/test_delete.vim index 6323f9ab..c00b8ca4 100644 --- a/src/testdir/test_delete.vim +++ b/src/testdir/test_delete.vim @@ -111,7 +111,6 @@ endfunc " This should no longer trigger ml_get errors func Test_delete_ml_get_errors() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END set noshowcmd noruler scrolloff=0 diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index dadffecb..b62266bb 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -430,13 +430,13 @@ endfunc func Common_icase_test() edit one - call setline(1, ['One', 'Two', 'Three', 'Four', 'Fi#vϵ', 'Si⃗x', 'Se⃗ve⃗n']) + call setline(1, ['One', 'Two', 'Three', 'Four', 'Fi#ve']) redraw let normattr = screenattr(1, 1) diffthis botright vert new two - call setline(1, ['one', 'TWO', 'Three ', 'Four', 'fI=VΕ', 'SI⃗x', 'SEvE⃗n']) + call setline(1, ['one', 'TWO', 'Three ', 'Four', 'fI=VE']) diffthis redraw @@ -444,13 +444,10 @@ func Common_icase_test() call assert_equal(normattr, screenattr(2, 1)) call assert_notequal(normattr, screenattr(3, 1)) call assert_equal(normattr, screenattr(4, 1)) - call assert_equal(normattr, screenattr(6, 2)) - call assert_notequal(normattr, screenattr(7, 2)) let dtextattr = screenattr(5, 3) call assert_notequal(dtextattr, screenattr(5, 1)) call assert_notequal(dtextattr, screenattr(5, 5)) - call assert_notequal(dtextattr, screenattr(7, 4)) diffoff! %bwipe! @@ -781,10 +778,10 @@ endfunc func Test_diff_hlID() new - call setline(1, [1, 2, 3, 'Yz', 'a dxxg',]) + call setline(1, [1, 2, 3]) diffthis vnew - call setline(1, ['1x', 2, 'x', 3, 'yx', 'abc defg']) + call setline(1, ['1x', 2, 'x', 3]) diffthis redraw @@ -795,26 +792,6 @@ func Test_diff_hlID() call diff_hlID(2, 1)->synIDattr("name")->assert_equal("") call diff_hlID(3, 1)->synIDattr("name")->assert_equal("DiffAdd") eval 4->diff_hlID(1)->synIDattr("name")->assert_equal("") - call diff_hlID(5, 1)->synIDattr("name")->assert_equal("DiffText") - call diff_hlID(5, 2)->synIDattr("name")->assert_equal("DiffText") - - set diffopt+=icase " test that caching is invalidated by diffopt change - call diff_hlID(5, 1)->synIDattr("name")->assert_equal("DiffChange") - set diffopt-=icase - call diff_hlID(5, 1)->synIDattr("name")->assert_equal("DiffText") - - call diff_hlID(6, 1)->synIDattr("name")->assert_equal("DiffChange") - call diff_hlID(6, 2)->synIDattr("name")->assert_equal("DiffText") - call diff_hlID(6, 4)->synIDattr("name")->assert_equal("DiffText") - call diff_hlID(6, 7)->synIDattr("name")->assert_equal("DiffText") - call diff_hlID(6, 8)->synIDattr("name")->assert_equal("DiffChange") - set diffopt+=inline:char - call diff_hlID(6, 1)->synIDattr("name")->assert_equal("DiffChange") - call diff_hlID(6, 2)->synIDattr("name")->assert_equal("DiffTextAdd") - call diff_hlID(6, 4)->synIDattr("name")->assert_equal("DiffChange") - call diff_hlID(6, 7)->synIDattr("name")->assert_equal("DiffText") - call diff_hlID(6, 8)->synIDattr("name")->assert_equal("DiffChange") - set diffopt-=inline:char wincmd w call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange") @@ -879,8 +856,6 @@ endfunc " Verify a screendump with both the internal and external diff. func VerifyBoth(buf, dumpfile, extra) - CheckScreendump - " trailing : for leaving the cursor on the command line for cmd in [":set diffopt=filler" . a:extra . "\:", ":set diffopt+=internal\:"] call term_sendkeys(a:buf, cmd) @@ -899,8 +874,6 @@ endfunc " Verify a screendump with the internal diff only. func VerifyInternal(buf, dumpfile, extra) - CheckScreendump - call term_sendkeys(a:buf, ":diffupdate!\") " trailing : for leaving the cursor on the command line call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\:") @@ -2377,183 +2350,6 @@ func Test_diff_topline_noscroll() call StopVimInTerminal(buf) endfunc -" Test inline highlighting which shows what's different within each diff block -func Test_diff_inline() - CheckScreendump - - call WriteDiffFiles(0, [], []) - let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) - call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") - - call WriteDiffFiles(buf, ["abcdef ghi jk n", "x", "y"], ["aBcef gHi lm n", "y", "z"]) - call VerifyInternal(buf, "Test_diff_inline_01", "") - call VerifyInternal(buf, "Test_diff_inline_02", " diffopt+=inline:none") - - " inline:simple is the same as default - call VerifyInternal(buf, "Test_diff_inline_01", " diffopt+=inline:simple") - - call VerifyInternal(buf, "Test_diff_inline_03", " diffopt+=inline:char") - call VerifyInternal(buf, "Test_diff_inline_04", " diffopt+=inline:word") - - " multiple inline values will the last one - call VerifyInternal(buf, "Test_diff_inline_01", " diffopt+=inline:none,inline:char,inline:simple") - call VerifyInternal(buf, "Test_diff_inline_02", " diffopt+=inline:simple,inline:word,inline:none") - call VerifyInternal(buf, "Test_diff_inline_03", " diffopt+=inline:simple,inline:word,inline:char") - - " DiffTextAdd highlight - call term_sendkeys(buf, ":hi DiffTextAdd ctermbg=blue\") - call VerifyInternal(buf, "Test_diff_inline_05", " diffopt+=inline:char") - - " Live update in insert mode - call term_sendkeys(buf, "\isometext") - call VerifyScreenDump(buf, "Test_diff_inline_06", {}) - call term_sendkeys(buf, "\u") - - " icase simple scenarios - call VerifyInternal(buf, "Test_diff_inline_07", " diffopt+=inline:simple,icase") - call VerifyInternal(buf, "Test_diff_inline_08", " diffopt+=inline:char,icase") - call VerifyInternal(buf, "Test_diff_inline_09", " diffopt+=inline:word,icase") - - " diff algorithms should affect highlight - call WriteDiffFiles(buf, ["apples and oranges"], ["oranges and apples"]) - call VerifyInternal(buf, "Test_diff_inline_10", " diffopt+=inline:char") - call VerifyInternal(buf, "Test_diff_inline_11", " diffopt+=inline:char,algorithm:patience") - - " icase: composing chars and Unicode fold case edge cases - call WriteDiffFiles(buf, - \ ["1 - sigma in 6σ and ὈδυσσεÏÏ‚", "1 - angstrom in åå", "1 - composing: ii⃗I⃗"], - \ ["2 - Sigma in 6Σ and ὈΔΥΣΣΕΎΣ", "2 - Angstrom in â„«Ã…", "2 - Composing: i⃗I⃗I⃗"]) - call VerifyInternal(buf, "Test_diff_inline_12", " diffopt+=inline:char") - call VerifyInternal(buf, "Test_diff_inline_13", " diffopt+=inline:char,icase") - - " wide chars - call WriteDiffFiles(buf, ["abc😅xde一", "f🚀g"], ["abcy😢de", "二f🚀g"]) - call VerifyInternal(buf, "Test_diff_inline_14", " diffopt+=inline:char,icase") - - " NUL char (\n below is internally substituted as NUL) - call WriteDiffFiles(buf, ["1\n34\n5\n6"], ["1234\n5", "6"]) - call VerifyInternal(buf, "Test_diff_inline_15", " diffopt+=inline:char") - - " word diff: always use first buffer's iskeyword and ignore others' for consistency - call WriteDiffFiles(buf, ["foo+bar test"], ["foo+baz test"]) - call VerifyInternal(buf, "Test_diff_inline_word_01", " diffopt+=inline:word") - - call term_sendkeys(buf, ":set iskeyword+=+\:diffupdate\") - call VerifyInternal(buf, "Test_diff_inline_word_02", " diffopt+=inline:word") - - call term_sendkeys(buf, ":set iskeyword&\:wincmd w\") - call term_sendkeys(buf, ":set iskeyword+=+\:wincmd w\:diffupdate\") - " Use the previous screen dump as 2nd buffer's iskeyword does not matter - call VerifyInternal(buf, "Test_diff_inline_word_01", " diffopt+=inline:word") - - call term_sendkeys(buf, ":windo set iskeyword&\:1wincmd w\") - - " word diff: test handling of multi-byte characters. Only alphanumeric chars - " (e.g. Greek alphabet, but not CJK/emoji) count as words. - call WriteDiffFiles(buf, ["🚀⛵ï¸ä¸€äºŒä¸‰ã²ã‚‰ãŒãªÎ”έλτα Δelta foobar"], ["🚀🛸一二四ã²ã‚‰ãªÎ´Î­Î»Ï„α δelta foobar"]) - call VerifyInternal(buf, "Test_diff_inline_word_03", " diffopt+=inline:word") - - " char diff: should slide highlight to whitespace boundary if possible for - " better readability (by using forced indent-heuristics). A wrong result - " would be if the highlight is "Bar, prefix". It should be "prefixBar, " - " instead. - call WriteDiffFiles(buf, ["prefixFoo, prefixEnd"], ["prefixFoo, prefixBar, prefixEnd"]) - call VerifyInternal(buf, "Test_diff_inline_char_01", " diffopt+=inline:char") - - " char diff: small gaps between inline diff blocks will be merged during refine step - " - first segment: test that we iteratively merge small gaps after we merged - " adjacent blocks, but only with limited number (set to 4) of iterations. - " - second and third segments: show that we need a large enough adjacent block to - " trigger a merge. - " - fourth segment: small gaps are not merged when adjacent large block is - " on a different line. - call WriteDiffFiles(buf, - \ ["abcdefghijklmno", "anchor1", - \ "abcdefghijklmno", "anchor2", - \ "abcdefghijklmno", "anchor3", - \ "test", "multiline"], - \ ["a?c?e?g?i?k???o", "anchor1", - \ "a??de?????klmno", "anchor2", - \ "a??de??????lmno", "anchor3", - \ "t?s?", "??????i?e"]) - call VerifyInternal(buf, "Test_diff_inline_char_02", " diffopt+=inline:char") - - " Test multi-line blocks and whitespace - call WriteDiffFiles(buf, - \ ["this is ", "sometest text foo", "baz abc def ", "one", "word another word", "additional line"], - \ ["this is some test", "texts", "foo bar abX Yef ", "oneword another word"]) - call VerifyInternal(buf, "Test_diff_inline_multiline_01", " diffopt+=inline:char,iwhite") - call VerifyInternal(buf, "Test_diff_inline_multiline_02", " diffopt+=inline:word,iwhite") - call VerifyInternal(buf, "Test_diff_inline_multiline_03", " diffopt+=inline:char,iwhiteeol") - call VerifyInternal(buf, "Test_diff_inline_multiline_04", " diffopt+=inline:word,iwhiteeol") - call VerifyInternal(buf, "Test_diff_inline_multiline_05", " diffopt+=inline:char,iwhiteall") - call VerifyInternal(buf, "Test_diff_inline_multiline_06", " diffopt+=inline:word,iwhiteall") - - " newline should be highlighted too when 'list' is set - call term_sendkeys(buf, ":windo set list\") - call VerifyInternal(buf, "Test_diff_inline_multiline_07", " diffopt+=inline:char") - call VerifyInternal(buf, "Test_diff_inline_multiline_08", " diffopt+=inline:char,iwhite") - call VerifyInternal(buf, "Test_diff_inline_multiline_09", " diffopt+=inline:char,iwhiteeol") - call VerifyInternal(buf, "Test_diff_inline_multiline_10", " diffopt+=inline:char,iwhiteall") - call term_sendkeys(buf, ":windo set nolist\") - - call StopVimInTerminal(buf) -endfunc - -func Test_diff_inline_multibuffer() - CheckScreendump - - call WriteDiffFiles3(0, [], [], []) - let buf = RunVimInTerminal('-d Xdifile1 Xdifile2 Xdifile3', {}) - call term_sendkeys(buf, ":windo set autoread\:1wincmd w\") - call term_sendkeys(buf, ":hi DiffTextAdd ctermbg=blue\") - - call WriteDiffFiles3(buf, - \ ["That is buffer1.", "anchor", "Some random text", "anchor"], - \ ["This is buffer2.", "anchor", "Some text", "anchor", "buffer2/3"], - \ ["This is buffer3. Last.", "anchor", "Some more", "text here.", "anchor", "only in buffer2/3", "not in buffer1"]) - call VerifyInternal(buf, "Test_diff_inline_multibuffer_01", " diffopt+=inline:char") - - " Close one of the buffers and make sure it updates correctly - call term_sendkeys(buf, ":diffoff\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_02", " diffopt+=inline:char") - - " Update text in the non-diff buffer and nothing should be changed - call term_sendkeys(buf, "\isometext") - call VerifyScreenDump(buf, "Test_diff_inline_multibuffer_03", {}) - call term_sendkeys(buf, "\u") - - call term_sendkeys(buf, ":diffthis\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_01", " diffopt+=inline:char") - - " Test that removing first buffer from diff will in turn use the next - " earliest buffer's iskeyword during word diff. - call WriteDiffFiles3(buf, - \ ["This+is=a-setence"], - \ ["This+is=another-setence"], - \ ["That+is=a-setence"]) - call term_sendkeys(buf, ":set iskeyword+=+\:2wincmd w\:set iskeyword+=-\:1wincmd w\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_04", " diffopt+=inline:word") - call term_sendkeys(buf, ":diffoff\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_05", " diffopt+=inline:word") - call term_sendkeys(buf, ":diffthis\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_04", " diffopt+=inline:word") - - " Test multi-buffer char diff refinement, and that removing a buffer from - " diff will update the others properly. - call WriteDiffFiles3(buf, - \ ["abcdefghijkYmYYY"], - \ ["aXXdXXghijklmnop"], - \ ["abcdefghijkYmYop"]) - call VerifyInternal(buf, "Test_diff_inline_multibuffer_06", " diffopt+=inline:char") - call term_sendkeys(buf, ":diffoff\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_07", " diffopt+=inline:char") - call term_sendkeys(buf, ":diffthis\") - call VerifyInternal(buf, "Test_diff_inline_multibuffer_06", " diffopt+=inline:char") - - call StopVimInTerminal(buf) -endfunc - func Test_diffget_diffput_linematch() CheckScreendump call delete('.Xdifile1.swp') diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim index 8f3806bd..86e400ef 100644 --- a/src/testdir/test_display.vim +++ b/src/testdir/test_display.vim @@ -377,8 +377,6 @@ func Test_display_linebreak_breakat() endfunc func Run_Test_display_lastline(euro) - CheckScreendump - let lines =<< trim END call setline(1, ['aaa', 'b'->repeat(200)]) set display=truncate diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index a212e8c5..dbeb78dc 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -2021,7 +2021,6 @@ endfunc " Test for positioning cursor after CTRL-R expression failed func Test_edit_ctrl_r_failed() - CheckScreendump CheckRunVimInTerminal let buf = RunVimInTerminal('', #{rows: 6, cols: 60}) @@ -2084,7 +2083,7 @@ endfunc func Test_read_invalid() set encoding=latin1 " This was not properly checking for going past the end. - call assert_fails('r`=', 'E484:') + call assert_fails('r`=', 'E484') set encoding=utf-8 endfunc diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim index d2f949ed..1b17108c 100644 --- a/src/testdir/test_eval_stuff.vim +++ b/src/testdir/test_eval_stuff.vim @@ -124,9 +124,9 @@ func Test_E963() endfunc func Test_for_invalid() - call assert_fails("for x in 99", 'E1523:') - call assert_fails("for x in function('winnr')", 'E1523:') - call assert_fails("for x in {'a': 9}", 'E1523:') + call assert_fails("for x in 99", 'E1098:') + call assert_fails("for x in function('winnr')", 'E1098:') + call assert_fails("for x in {'a': 9}", 'E1098:') let lines =<< trim END for v:maxcol in range(5) diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index 8bba1f00..5dedce58 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -257,10 +257,10 @@ func Test_method_with_prefix() call v9.CheckLegacyAndVim9Success(lines) call assert_equal([0, 1, 2], --3->range()) - call v9.CheckDefAndScriptFailure(['eval --3->range()'], 'E15:') + call v9.CheckDefAndScriptFailure(['eval --3->range()'], 'E15') call assert_equal(1, !+-+0) - call v9.CheckDefAndScriptFailure(['eval !+-+0'], 'E15:') + call v9.CheckDefAndScriptFailure(['eval !+-+0'], 'E15') endfunc func Test_option_value() @@ -658,10 +658,10 @@ func Test_printf_spec_b() endfunc func Test_max_min_errors() - call v9.CheckLegacyAndVim9Failure(['call max(v:true)'], ['E712:', 'E1013:', 'E1530:']) - call v9.CheckLegacyAndVim9Failure(['call max(v:true)'], ['max()', 'E1013:', 'E1530:']) - call v9.CheckLegacyAndVim9Failure(['call min(v:true)'], ['E712:', 'E1013:', 'E1530:']) - call v9.CheckLegacyAndVim9Failure(['call min(v:true)'], ['min()', 'E1013:', 'E1530:']) + call v9.CheckLegacyAndVim9Failure(['call max(v:true)'], ['E712:', 'E1013:', 'E1227:']) + call v9.CheckLegacyAndVim9Failure(['call max(v:true)'], ['max()', 'E1013:', 'E1227:']) + call v9.CheckLegacyAndVim9Failure(['call min(v:true)'], ['E712:', 'E1013:', 'E1227:']) + call v9.CheckLegacyAndVim9Failure(['call min(v:true)'], ['min()', 'E1013:', 'E1227:']) endfunc func Test_function_with_funcref() @@ -874,7 +874,7 @@ endfunc " Test for errors in expression evaluation func Test_expr_eval_error() call v9.CheckLegacyAndVim9Failure(["VAR i = 'abc' .. []"], ['E730:', 'E1105:', 'E730:']) - call v9.CheckLegacyAndVim9Failure(["VAR l = [] + 10"], ['E745:', 'E1051:', 'E745:']) + call v9.CheckLegacyAndVim9Failure(["VAR l = [] + 10"], ['E745:', 'E1051:', 'E745']) call v9.CheckLegacyAndVim9Failure(["VAR v = 10 + []"], ['E745:', 'E1051:', 'E745:']) call v9.CheckLegacyAndVim9Failure(["VAR v = 10 / []"], ['E745:', 'E1036:', 'E745:']) call v9.CheckLegacyAndVim9Failure(["VAR v = -{}"], ['E728:', 'E1012:', 'E728:']) @@ -1060,16 +1060,6 @@ func Test_bitwise_shift() END call v9.CheckDefAndScriptSuccess(lines) - " Error in the second expression of "<<" - let lines =<< trim END - vim9script - def Fn() - var x = 1 << y - enddef - defcompile - END - call v9.CheckSourceFailure(lines, 'E1001: Variable not found: y') - let lines =<< trim END # Use in a lambda function const DivBy2Ref_A = (n: number): number => n >> 1 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 7cac3d0a..bfebea4f 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -181,15 +181,14 @@ def s:GetFilenameChecks(): dict> cobol: ['file.cbl', 'file.cob'], coco: ['file.atg'], conaryrecipe: ['file.recipe'], - conf: ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags'], + conf: ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags', '.mbsyncrc'], config: ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'], - confini: ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection', - 'any/.gnuradio/grc.conf', 'any/gnuradio/config.conf', 'any/gnuradio/conf.d/modtool.conf'], + confini: ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], context: ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], cook: ['file.cook'], corn: ['file.corn'], cpon: ['file.cpon'], - cpp: ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.ixx', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh', 'file.cppm', 'file.ccm', 'file.cxxm', 'file.c++m', 'file.mpp'], + cpp: ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh', 'file.cppm', 'file.ccm', 'file.cxxm', 'file.c++m'], cqlang: ['file.cql'], crm: ['file.crm'], crontab: ['crontab', 'crontab.file', '/etc/cron.d/file', 'any/etc/cron.d/file'], @@ -214,7 +213,6 @@ def s:GetFilenameChecks(): dict> dafny: ['file.dfy'], dart: ['file.dart', 'file.drt'], datascript: ['file.ds'], - dax: ['file.dax'], dcd: ['file.dcd'], deb822sources: ['/etc/apt/sources.list.d/file.sources', 'any/etc/apt/sources.list.d/file.sources'], debchangelog: ['changelog.Debian', 'changelog.dch', 'NEWS.Debian', 'NEWS.dch', '/debian/changelog'], @@ -240,9 +238,7 @@ def s:GetFilenameChecks(): dict> '.coveragerc', '.pypirc', '.gitlint', '.oelint.cfg', 'pylintrc', '.pylintrc', '/home/user/.config/bpython/config', '/home/user/.config/mypy/config', '.wakatime.cfg', '.replyrc', 'psprint.conf', 'sofficerc', 'any/.config/lxqt/globalkeyshortcuts.conf', 'any/.config/screengrab/screengrab.conf', - 'any/.local/share/flatpak/repo/config', - '.alsoftrc', 'alsoft.conf', 'alsoft.ini', 'alsoftrc.sample', - '.notmuch-config', '.notmuch-config.myprofile', + 'any/.local/share/flatpak/repo/config', '.notmuch-config', '.notmuch-config.myprofile', '~/.config/notmuch/myprofile/config'] + WhenConfigHome('$XDG_CONFIG_HOME/notmuch/myprofile/config'), dot: ['file.dot', 'file.gv'], dracula: ['file.drac', 'file.drc', 'file.lvs', 'file.lpe', 'drac.file'], @@ -475,7 +471,6 @@ def s:GetFilenameChecks(): dict> matlab: ['file.m'], maxima: ['file.demo', 'file.dmt', 'file.dm1', 'file.dm2', 'file.dm3', 'file.wxm', 'maxima-init.mac'], - mbsync: ['.mbsyncrc', 'file.mbsyncrc', 'isyncrc'], mediawiki: ['file.mw', 'file.wiki'], mel: ['file.mel'], mermaid: ['file.mmd', 'file.mmdc', 'file.mermaid'], @@ -612,7 +607,6 @@ def s:GetFilenameChecks(): dict> povini: ['.povrayrc'], ppd: ['file.ppd'], ppwiz: ['file.it', 'file.ih'], - pq: ['file.pq'], prisma: ['file.prisma'], privoxy: ['file.action'], proc: ['file.pc'], @@ -633,7 +627,7 @@ def s:GetFilenameChecks(): dict> pymanifest: ['MANIFEST.in'], pyret: ['file.arr'], pyrex: ['file.pyx', 'file.pxd', 'file.pxi', 'file.pyx+'], - python: ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', '.python_history', '.jline-jython.history', 'file.ptl', 'file.pyi', 'SConstruct', 'file.ipy'], + python: ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', '.python_history', '.jline-jython.history', 'file.ptl', 'file.pyi', 'SConstruct'], ql: ['file.ql', 'file.qll'], qml: ['file.qml', 'file.qbs'], qmldir: ['qmldir'], @@ -727,8 +721,6 @@ def s:GetFilenameChecks(): dict> snobol4: ['file.sno', 'file.spt'], solidity: ['file.sol'], solution: ['file.sln'], - spajson: ['any/pipewire/file.conf', 'any/pipewire/file.conf.d/other.conf', - 'any/wireplumber/file.conf', 'any/wireplumber/file.conf.d/other.conf'], sparql: ['file.rq', 'file.sparql'], spec: ['file.spec'], spice: ['file.sp', 'file.spice'], @@ -1074,10 +1066,10 @@ def s:GetScriptEnvChecks(): dict>> return { perl: [['#!/usr/bin/env VAR=val perl']], scala: [['#!/usr/bin/env VAR=val VVAR=vval scala']], - awk: [['#!/usr/bin/env --split-string=VAR= awk -vFS="," -f']], + awk: [['#!/usr/bin/env VAR=val -i awk']], execline: [['#!/usr/bin/env execlineb']], scheme: [['#!/usr/bin/env VAR=val --ignore-environment scheme']], - python: [['#!/usr/bin/env -S -i VAR=val python -B -u']], + python: [['#!/usr/bin/env VAR=val -S python -w -T']], wml: [['#!/usr/bin/env VAR=val --split-string wml']], nix: [['#!/usr/bin/env nix-shell']], } @@ -1132,34 +1124,6 @@ func Test_filetype_indent_off() close endfunc -func Test_undo_ftplugin_on_buffer_reuse() - filetype on - - new - let b:undo_ftplugin = ":let g:var='exists'" - let g:bufnr = bufnr('%') - " no changes done to the buffer, so the buffer will be re-used - e $VIMRUNTIME/defaults.vim - call assert_equal(g:bufnr, bufnr('%')) - call assert_equal('exists', get(g:, 'var', 'fail')) - unlet! g:bufnr g:var - - " try to wipe the buffer - enew - bw defaults.vim - let b:undo_ftplugin = ':bw' - call assert_fails(':e $VIMRUNTIME/defaults.vim', 'E937:') - - " try to split the window - enew - bw defaults.vim - let b:undo_ftplugin = ':sp $VIMRUNTIME/defaults.vim' - call assert_fails(':e $VIMRUNTIME/defaults.vim', 'E242:') - - bwipe! - filetype off -endfunc - """"""""""""""""""""""""""""""""""""""""""""""""" " Tests for specific extensions and filetypes. " Keep sorted. @@ -1631,22 +1595,6 @@ func Test_git_file() filetype off endfunc -func Test_grc_file() - filetype on - - call writefile(['', '', ''], 'Xfile.grc') - split Xfile.grc - call assert_equal('xml', &filetype) - bwipe! - - call writefile(['metadata:', ' file_format: 1'], 'Xfile.grc') - split Xfile.grc - call assert_equal('yaml', &filetype) - bwipe! - - filetype off -endfunc - func Test_haredoc_file() filetype on call assert_true(mkdir('foo/bar', 'pR')) @@ -1683,36 +1631,20 @@ func Test_haredoc_file() endfunc func Test_help_file() - func! s:Check_help_with_iskeyword(fname) - exe 'split' a:fname - call assert_equal('help', &filetype) - bwipe! - set iskeyword+=: - exe 'split' a:fname - call assert_equal('help', &filetype) - bwipe! - set iskeyword& - endfunc - set nomodeline filetype on call assert_true(mkdir('doc', 'pR')) call writefile(['some text', 'vim:ft=help:'], 'doc/help.txt', 'D') - call s:Check_help_with_iskeyword('doc/help.txt') + split doc/help.txt + call assert_equal('help', &filetype) + bwipe! call writefile(['some text', 'Copyright: |manual-copyright| vim:ft=help:'], \ 'doc/help1.txt', 'D') - call s:Check_help_with_iskeyword('doc/help1.txt') - - call writefile(['some text', 'vim:noet:ft=help:'], 'doc/help2.txt', 'D') - call s:Check_help_with_iskeyword('doc/help2.txt') - - call writefile(['some text', 'vim: noet ft=help'], 'doc/help3.txt', 'D') - call s:Check_help_with_iskeyword('doc/help3.txt') - - call writefile(['some text', 'vim: ft=help noet'], 'doc/help4.txt', 'D') - call s:Check_help_with_iskeyword('doc/help4.txt') + split doc/help1.txt + call assert_equal('help', &filetype) + bwipe! call writefile(['some text'], 'doc/nothelp.txt', 'D') split doc/nothelp.txt @@ -2862,7 +2794,6 @@ func Test_pro_file() call writefile(['x = findgen(100)/10'], 'Xfile.pro', 'D') split Xfile.pro call assert_equal('idlang', &filetype) - bwipe! filetype off endfunc @@ -2896,7 +2827,6 @@ func Test_pl_file() call writefile(['%data = (1, 2, 3);'], 'Xfile.pl', 'D') split Xfile.pl call assert_equal('perl', &filetype) - bwipe! filetype off endfunc @@ -2904,48 +2834,15 @@ endfunc func Test_make_file() filetype on - " BSD Makefile - call writefile([''], 'BSDmakefile', 'D') - split BSDmakefile - call assert_equal('bsd', get(b:, 'make_flavor', '')) - bwipe! - - call writefile(['.ifmake all', '.endif'], 'XMakefile.mak', 'D') - split XMakefile.mak - call assert_equal('bsd', get(b:, 'make_flavor', '')) - bwipe! - - " GNU Makefile - call writefile([''], 'GNUmakefile', 'D') - split GNUmakefile - call assert_equal('gnu', get(b:, 'make_flavor', '')) - bwipe! - - call writefile(['ifeq ($(foo),foo)', 'endif'], 'XMakefile.mak', 'D') - split XMakefile.mak - call assert_equal('gnu', get(b:, 'make_flavor', '')) - bwipe! - - call writefile(['define foo', 'endef'], 'XMakefile.mak', 'D') - split XMakefile.mak - call assert_equal('gnu', get(b:, 'make_flavor', '')) - bwipe! - - call writefile(['vim := $(wildcard *.vim)'], 'XMakefile.mak', 'D') - split XMakefile.mak - call assert_equal('gnu', get(b:, 'make_flavor', '')) - bwipe! - " Microsoft Makefile call writefile(['# Makefile for Windows', '!if "$(VIMDLL)" == "yes"'], 'XMakefile.mak', 'D') split XMakefile.mak - call assert_equal('microsoft', get(b:, 'make_flavor', '')) + call assert_equal(1, get(b:, 'make_microsoft', 0)) bwipe! - " BSD or GNU call writefile(['# get the list of tests', 'include testdir/Make_all.mak'], 'XMakefile.mak', 'D') split XMakefile.mak - call assert_notequal('microsoft', get(b:, 'make_flavor', '')) + call assert_equal(0, get(b:, 'make_microsoft', 0)) bwipe! filetype off @@ -2969,37 +2866,12 @@ func Test_map_file() filetype off endfunc -func Test_nroff_file() - filetype on - - call writefile(['.TH VIM 1 "YYYY Mth DD"'], 'Xfile.1', 'D') - split Xfile.1 - call assert_equal('nroff', &filetype) - bwipe! - - call writefile(['.Dd $Mdocdate$', '.Dt "DETECTION TEST" "7"', '.Os'], 'Xfile.7', 'D') - split Xfile.7 - call assert_equal('nroff', &filetype) - bwipe! - - call writefile(['''\" t'], 'Xfile.3p', 'D') - split Xfile.3p - call assert_equal('nroff', &filetype) - bwipe! - - call writefile(['. /etc/profile'], 'Xfile.1', 'D') - split Xfile.1 - call assert_notequal('nroff', &filetype) - bwipe! -endfunc - func Test_org_file() filetype on call writefile(['* org Headline', '*some bold text*', '/some italic text/'], 'Xfile.org', 'D') split Xfile.org call assert_equal('org', &filetype) - bwipe! filetype off endfunc diff --git a/src/testdir/test_filter_map.vim b/src/testdir/test_filter_map.vim index 39da767f..37ebe847 100644 --- a/src/testdir/test_filter_map.vim +++ b/src/testdir/test_filter_map.vim @@ -173,7 +173,6 @@ func Test_map_filter_fails() call assert_fails("let l = filter([1, 2], {a, b, c -> 1})", 'E119:') call assert_fails('call foreach([1], "xyzzy")', 'E492:') call assert_fails('call foreach([1], "let a = foo")', 'E121:') - call assert_fails('call foreach(test_null_function(), "")', 'E1525:') endfunc func Test_map_and_modify() diff --git a/src/testdir/test_format.vim b/src/testdir/test_format.vim index c2612889..785348be 100644 --- a/src/testdir/test_format.vim +++ b/src/testdir/test_format.vim @@ -334,13 +334,13 @@ func Test_printf_pos_errors() call v9.CheckLegacyAndVim9Failure(["call printf('%1$*123456789$.*987654321$d', 5)"], "E1510:") call v9.CheckLegacyAndVim9Failure(["call printf('%123456789$*1$.*987654321$d', 5)"], "E1510:") - call v9.CheckLegacyAndVim9Failure(["call printf('%1$*2$.*1$d', 5, 9999999)"], "E1510:") - call v9.CheckLegacyAndVim9Failure(["call printf('%1$*1$.*2$d', 5, 9999999)"], "E1510:") - call v9.CheckLegacyAndVim9Failure(["call printf('%2$*3$.*1$d', 5, 9999123, 9999321)"], "E1510:") - call v9.CheckLegacyAndVim9Failure(["call printf('%1$*2$.*3$d', 5, 9999123, 9999321)"], "E1510:") - call v9.CheckLegacyAndVim9Failure(["call printf('%2$*1$.*3$d', 5, 9999123, 9999312)"], "E1510:") + call v9.CheckLegacyAndVim9Failure(["call printf('%1$*2$.*1$d', 5, 9999)"], "E1510:") + call v9.CheckLegacyAndVim9Failure(["call printf('%1$*1$.*2$d', 5, 9999)"], "E1510:") + call v9.CheckLegacyAndVim9Failure(["call printf('%2$*3$.*1$d', 5, 9123, 9321)"], "E1510:") + call v9.CheckLegacyAndVim9Failure(["call printf('%1$*2$.*3$d', 5, 9123, 9321)"], "E1510:") + call v9.CheckLegacyAndVim9Failure(["call printf('%2$*1$.*3$d', 5, 9123, 9312)"], "E1510:") - call v9.CheckLegacyAndVim9Failure(["call printf('%1$*2$d', 5, 9999999)"], "E1510:") + call v9.CheckLegacyAndVim9Failure(["call printf('%1$*2$d', 5, 9999)"], "E1510:") endfunc func Test_printf_pos_64bit() diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 847987b5..28800f1e 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -951,6 +951,18 @@ func Test_mode() execute "normal! gR\g@l\" call assert_equal('n-niV', g:current_modes) + " Test statusline updates for overstrike mode + if CanRunVimInTerminal() + let buf = RunVimInTerminal('', {'rows': 12}) + call term_sendkeys(buf, ":set laststatus=2 statusline=%!mode(1)\") + call term_sendkeys(buf, ":") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_mode_1', {}) + call term_sendkeys(buf, "\") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_mode_2', {}) + call StopVimInTerminal(buf) + endif if has('terminal') term @@ -978,22 +990,6 @@ func Test_mode() delfunction OperatorFunc endfunc -" Test for the mode() function using Screendump feature -func Test_mode_screendump() - CheckScreendump - - " Test statusline updates for overstrike mode - let buf = RunVimInTerminal('', {'rows': 12}) - call term_sendkeys(buf, ":set laststatus=2 statusline=%!mode(1)\") - call term_sendkeys(buf, ":") - call TermWait(buf) - call VerifyScreenDump(buf, 'Test_mode_1', {}) - call term_sendkeys(buf, "\") - call TermWait(buf) - call VerifyScreenDump(buf, 'Test_mode_2', {}) - call StopVimInTerminal(buf) -endfunc - " Test for append() func Test_append() enew! @@ -1032,7 +1028,7 @@ func Test_setline() call setline(3, test_null_list()) call setline(2, ["baz"]) call assert_equal(['bar', 'baz'], getline(1, '$')) - bw! + close! endfunc func Test_getbufvar() diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 9d319960..29259345 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -770,10 +770,13 @@ func Test_set_guioptions() endfunc func Test_scrollbars() + " this test sometimes fails on CI + let g:test_is_flaky = 1 + " buffer with 200 lines + new call setline(1, repeat(['one', 'two'], 100)) - set scrolloff=0 - set guioptions=rlbk + set guioptions+=rlb " scroll to move line 11 at top, moves the cursor there let args = #{which: 'left', value: 10, dragging: 0} @@ -823,7 +826,6 @@ func Test_scrollbars() call assert_fails("call test_gui_event('scrollbar', #{which: 'a', value: 1, dragging: 0})", 'E475:') set guioptions& - set scrolloff& set wrap& bwipe! endfunc diff --git a/src/testdir/test_help.vim b/src/testdir/test_help.vim index 6422317d..6c8b3ab3 100644 --- a/src/testdir/test_help.vim +++ b/src/testdir/test_help.vim @@ -205,22 +205,5 @@ func Test_help_using_visual_match() call v9.CheckScriptFailure(lines, 'E149:') endfunc -func Test_helptag_navigation() - let helpdir = tempname() - let tempfile = helpdir . '/test.txt' - call mkdir(helpdir, 'pR') - call writefile(['', '*[tag*', '', '|[tag|'], tempfile) - exe 'helptags' helpdir - exe 'sp' tempfile - exe 'lcd' helpdir - setl ft=help - let &l:iskeyword='!-~,^*,^|,^",192-255' - call cursor(4, 2) - " Vim must not escape `[` when expanding the tag - exe "normal! \" - call assert_equal(2, line('.')) - bw -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_hlsearch.vim b/src/testdir/test_hlsearch.vim index 557fe5da..eb8fb873 100644 --- a/src/testdir/test_hlsearch.vim +++ b/src/testdir/test_hlsearch.vim @@ -74,7 +74,6 @@ func Test_hlsearch_eol_highlight() endfunc func Test_hlsearch_Ctrl_R() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -93,7 +92,6 @@ func Test_hlsearch_Ctrl_R() endfunc func Test_hlsearch_clipboard() - CheckScreendump CheckRunVimInTerminal CheckFeature clipboard_working diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 741cc9d9..7b180a64 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -130,15 +130,10 @@ func Test_omni_dash() new exe "normal Gofind -\\" call assert_equal("find -help", getline('$')) - %d - set complete=o - exe "normal Gofind -\" - " 'complete' inserts at 'iskeyword' boundary (so you get --help) - call assert_equal("find --help", getline('$')) bwipe! delfunc Omni - set omnifunc= complete& + set omnifunc= endfunc func Test_omni_throw() @@ -158,21 +153,11 @@ func Test_omni_throw() call assert_exception('he he he') call assert_equal(1, g:CallCount) endtry - %d - set complete=o - let g:CallCount = 0 - try - exe "normal ifoo\" - call assert_false(v:true, 'command should have failed') - catch - call assert_exception('he he he') - call assert_equal(1, g:CallCount) - endtry bwipe! delfunc Omni unlet g:CallCount - set omnifunc= complete& + set omnifunc= endfunc func Test_omni_autoload() @@ -225,16 +210,6 @@ func Test_completefunc_args() call assert_equal(0, s:args[1][0]) set omnifunc= - set complete=fCompleteFunc - call feedkeys("i\\", 'x') - call assert_equal([1, 1], s:args[0]) - call assert_equal(0, s:args[1][0]) - set complete=o - call feedkeys("i\\", 'x') - call assert_equal([1, 1], s:args[0]) - call assert_equal(0, s:args[1][0]) - set complete& - bwipe! unlet s:args delfunc CompleteFunc @@ -280,7 +255,7 @@ func s:CompleteDone_CheckCompletedItemDict(pre) call assert_equal( ['one', 'two'], v:completed_item[ 'user_data' ] ) if a:pre - call assert_equal(a:pre == 1 ? 'function' : 'keyword', complete_info().mode) + call assert_equal('function', complete_info().mode) endif let s:called_completedone = 1 @@ -297,15 +272,7 @@ func Test_CompleteDoneNone() call assert_true(s:called_completedone) call assert_equal(oldline, newline) - let s:called_completedone = 0 - - set complete=fCompleteDone_CompleteFuncNone - execute "normal a\\" - set complete& - let newline = join(map(range(&columns), 'nr2char(screenchar(&lines-1, v:val+1))'), '') - call assert_true(s:called_completedone) - call assert_equal(oldline, newline) let s:called_completedone = 0 au! CompleteDone endfunc @@ -326,7 +293,6 @@ func Test_CompleteDone_vevent_keys() endfunc set omnifunc=CompleteFunc set completefunc=CompleteFunc - set complete=.,fCompleteFunc set completeopt+=menuone new @@ -350,11 +316,7 @@ func Test_CompleteDone_vevent_keys() call assert_equal('vim', g:complete_word) call assert_equal('keyword', g:complete_type) - call feedkeys("Shello vim visual v\\", 'tx') - call assert_equal('', g:complete_word) - call assert_equal('keyword', g:complete_type) - - call feedkeys("Shello vim visual v\\", 'tx') + call feedkeys("Shello vim visual v\\\", 'tx') call assert_equal('vim', g:complete_word) call assert_equal('keyword', g:complete_type) @@ -412,21 +374,6 @@ func Test_CompleteDoneDict() call assert_true(s:called_completedone) let s:called_completedone = 0 - au! CompleteDonePre - au! CompleteDone - - au CompleteDonePre * :call CompleteDone_CheckCompletedItemDict(2) - au CompleteDone * :call CompleteDone_CheckCompletedItemDict(0) - - set complete=.,fCompleteDone_CompleteFuncDict - execute "normal a\\" - set complete& - - call assert_equal(['one', 'two'], v:completed_item[ 'user_data' ]) - call assert_true(s:called_completedone) - - let s:called_completedone = 0 - au! CompleteDonePre au! CompleteDone endfunc @@ -469,15 +416,6 @@ func Test_CompleteDoneDictNoUserData() call assert_equal('', v:completed_item[ 'user_data' ]) call assert_true(s:called_completedone) - let s:called_completedone = 0 - - set complete=.,fCompleteDone_CompleteFuncDictNoUserData - execute "normal a\\" - set complete& - - call assert_equal('', v:completed_item[ 'user_data' ]) - call assert_true(s:called_completedone) - let s:called_completedone = 0 au! CompleteDone endfunc @@ -511,24 +449,6 @@ func Test_CompleteDoneList() call assert_equal('', v:completed_item[ 'user_data' ]) call assert_true(s:called_completedone) - let s:called_completedone = 0 - - set complete=.,fCompleteDone_CompleteFuncList - execute "normal a\\" - set complete& - - call assert_equal('', v:completed_item[ 'user_data' ]) - call assert_true(s:called_completedone) - - let s:called_completedone = 0 - - set complete=.,f - execute "normal a\\" - set complete& - - call assert_equal('', v:completed_item[ 'user_data' ]) - call assert_true(s:called_completedone) - let s:called_completedone = 0 au! CompleteDone endfunc @@ -572,51 +492,11 @@ func Test_completefunc_info() set completefunc=CompleteTest call feedkeys("i\\\\=string(complete_info())\\", "tx") call assert_equal("matched{'pum_visible': 1, 'mode': 'function', 'selected': 0, 'items': [{'word': 'matched', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}]}", getline(1)) - %d - set complete=.,fCompleteTest - call feedkeys("i\\\=string(complete_info())\\", "tx") - call assert_equal("matched{'pum_visible': 1, 'mode': 'keyword', 'selected': 0, 'items': [{'word': 'matched', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}]}", getline(1)) - %d - set complete=.,f - call feedkeys("i\\\=string(complete_info())\\", "tx") - call assert_equal("matched{'pum_visible': 1, 'mode': 'keyword', 'selected': 0, 'items': [{'word': 'matched', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}]}", getline(1)) + bwipe! set completeopt& - set complete& set completefunc& endfunc -func Test_cpt_func_cursorcol() - func CptColTest(findstart, query) - if a:findstart - call assert_equal("foo bar", getline(1)) - call assert_equal(8, col('.')) - return col('.') - endif - call assert_equal("foo bar", getline(1)) - call assert_equal(8, col('.')) - return v:none - endfunc - - set complete=fCptColTest - new - call feedkeys("ifoo bar\", "tx") - bwipe! - new - set completeopt=longest - call feedkeys("ifoo bar\", "tx") - bwipe! - new - set completeopt=menuone - call feedkeys("ifoo bar\", "tx") - bwipe! - new - set completeopt=menuone,preinsert - call feedkeys("ifoo bar\", "tx") - bwipe! - set complete& completeopt& - delfunc CptColTest -endfunc - func ScrollInfoWindowUserDefinedFn(findstart, query) " User defined function (i_CTRL-X_CTRL-U) if a:findstart @@ -672,34 +552,24 @@ func CompleteInfoUserDefinedFn(findstart, query) endfunc func CompleteInfoTestUserDefinedFn(mvmt, idx, noselect) + new if a:noselect set completeopt=menuone,popup,noinsert,noselect else set completeopt=menu,preview endif - let items = "[" . + set completefunc=CompleteInfoUserDefinedFn + call feedkeys("i\\" . a:mvmt . "\\=string(complete_info())\\", "tx") + let completed = a:idx != -1 ? ['foo', 'bar', 'baz', 'qux']->get(a:idx) : '' + call assert_equal(completed. "{'pum_visible': 1, 'mode': 'function', 'selected': " . a:idx . ", 'items': [" . \ "{'word': 'foo', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, " . \ "{'word': 'bar', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, " . \ "{'word': 'baz', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, " . \ "{'word': 'qux', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}" . - \ "]" - new - set completefunc=CompleteInfoUserDefinedFn - call feedkeys("i\\" . a:mvmt . "\\=string(complete_info())\\", "tx") - let completed = a:idx != -1 ? ['foo', 'bar', 'baz', 'qux']->get(a:idx) : '' - call assert_equal(completed. "{'pum_visible': 1, 'mode': 'function', 'selected': " . a:idx . ", 'items': " . items . "}", getline(1)) - %d - set complete=.,fCompleteInfoUserDefinedFn - call feedkeys("i\" . a:mvmt . "\\=string(complete_info())\\", "tx") - let completed = a:idx != -1 ? ['foo', 'bar', 'baz', 'qux']->get(a:idx) : '' - call assert_equal(completed. "{'pum_visible': 1, 'mode': 'keyword', 'selected': " . a:idx . ", 'items': " . items . "}", getline(1)) - %d - set complete=.,f - call feedkeys("i\" . a:mvmt . "\\=string(complete_info())\\", "tx") - let completed = a:idx != -1 ? ['foo', 'bar', 'baz', 'qux']->get(a:idx) : '' - call assert_equal(completed. "{'pum_visible': 1, 'mode': 'keyword', 'selected': " . a:idx . ", 'items': " . items . "}", getline(1)) + \ "]}", getline(1)) bwipe! - set completeopt& completefunc& complete& + set completeopt& + set completefunc& endfunc func Test_complete_info_user_defined_fn() @@ -969,10 +839,6 @@ func Test_completefunc_error() set completefunc=CompleteFunc call setline(1, ['', 'abcd', '']) call assert_fails('exe "normal 2G$a\\"', 'E565:') - set complete=fCompleteFunc - call assert_fails('exe "normal 2G$a\"', 'E565:') - set complete=f - call assert_fails('exe "normal 2G$a\"', 'E565:') " delete text when called for the second time func CompleteFunc2(findstart, base) @@ -985,10 +851,6 @@ func Test_completefunc_error() set completefunc=CompleteFunc2 call setline(1, ['', 'abcd', '']) call assert_fails('exe "normal 2G$a\\"', 'E565:') - set complete=fCompleteFunc2 - call assert_fails('exe "normal 2G$a\"', 'E565:') - set complete=f - call assert_fails('exe "normal 2G$a\"', 'E565:') " Jump to a different window from the complete function func CompleteFunc3(findstart, base) @@ -1001,15 +863,9 @@ func Test_completefunc_error() set completefunc=CompleteFunc3 new call assert_fails('exe "normal a\\"', 'E565:') - %d - set complete=fCompleteFunc3 - call assert_fails('exe "normal a\"', 'E565:') - %d - set complete=f - call assert_fails('exe "normal a\"', 'E565:') close! - set completefunc& complete& + set completefunc& delfunc CompleteFunc delfunc CompleteFunc2 delfunc CompleteFunc3 @@ -1028,15 +884,7 @@ func Test_completefunc_invalid_data() set completefunc=CompleteFunc exe "normal i\\" call assert_equal('moon', getline(1)) - %d - set complete=fCompleteFunc - exe "normal i\" - call assert_equal('moon', getline(1)) - %d - set complete=f - exe "normal i\" - call assert_equal('moon', getline(1)) - set completefunc& complete& + set completefunc& close! endfunc @@ -1709,361 +1557,16 @@ func Test_complete_item_refresh_always() return #{words: res, refresh: 'always'} endif endfunc + new set completeopt=menu,longest set completefunc=Tcomplete - new exe "normal! iup\\\\\\\" call assert_equal('up', getline(1)) call assert_equal(6, g:CallCount) - %d - let g:CallCount = 0 - set complete=fTcomplete - exe "normal! iup\\\\\\" - call assert_equal('up', getline(1)) - call assert_equal(6, g:CallCount) - %d - let g:CallCount = 0 - set complete=f - exe "normal! iup\\\\\\" - call assert_equal('up', getline(1)) - call assert_equal(6, g:CallCount) - %d - let g:CallCount = 0 - set omnifunc=Tcomplete - set complete=o - exe "normal! iup\\\\\\" - call assert_equal('up', getline(1)) - call assert_equal(6, g:CallCount) - bw! set completeopt& - set complete& set completefunc& - delfunc Tcomplete -endfunc - -" Test for 'cpt' user func that fails (return -2/-3) when refresh:always -func Test_cpt_func_refresh_always_fail() - func! CompleteFail(retval, findstart, base) - if a:findstart - return a:retval - endif - call assert_equal(-999, a:findstart) " Should not reach here - endfunc - new - set complete=ffunction('CompleteFail'\\,\ [-2]) - exe "normal! ia\" - %d - set complete=ffunction('CompleteFail'\\,\ [-3]) - exe "normal! ia\" bw! - - func! CompleteFailIntermittent(retval, findstart, base) - if a:findstart - if g:CallCount == 2 - let g:CallCount += 1 - return a:retval - endif - return col('.') - 1 - endif - let g:CallCount += 1 - let res = [[], ['foo', 'fbar'], ['foo1', 'foo2'], ['foofail'], ['fooo3']] - return #{words: res[g:CallCount], refresh: 'always'} - endfunc - new - set completeopt=menuone,noselect - set complete=ffunction('CompleteFailIntermittent'\\,\ [-2]) - let g:CallCount = 0 - exe "normal! if\\=complete_info([\"items\"])\" - call assert_match('''word'': ''foo''.*''word'': ''fbar''', getline(1)) - call assert_equal(1, g:CallCount) - %d - let g:CallCount = 0 - exe "normal! if\o\=complete_info([\"items\", \"selected\"])\" - call assert_match('''selected'': -1.*''word'': ''foo1''.*''word'': ''foo2''', getline(1)) - call assert_equal(2, g:CallCount) - %d - set complete=ffunction('CompleteFailIntermittent'\\,\ [-3]) - let g:CallCount = 0 - exe "normal! if\o\=complete_info([\"items\", \"selected\"])\" - call assert_match('''selected'': -1.*''word'': ''foo1''.*''word'': ''foo2''', getline(1)) - call assert_equal(2, g:CallCount) - %d - set complete=ffunction('CompleteFailIntermittent'\\,\ [-2]) - " completion mode is dismissed when there are no matches in list - let g:CallCount = 0 - exe "normal! if\oo\=complete_info([\"items\"])\" - call assert_equal('foo{''items'': []}', getline(1)) - call assert_equal(3, g:CallCount) - %d - let g:CallCount = 0 - exe "normal! if\oo\\=complete_info([\"items\"])\" - call assert_equal('fo{''items'': []}', getline(1)) - call assert_equal(3, g:CallCount) - %d - " completion mode continues when matches from other sources present - set complete=.,ffunction('CompleteFailIntermittent'\\,\ [-2]) - call setline(1, 'fooo1') - let g:CallCount = 0 - exe "normal! Gof\oo\=complete_info([\"items\", \"selected\"])\" - call assert_equal('foo{''selected'': -1, ''items'': [{''word'': ''fooo1'', ''menu'': '''', ' - \ . '''user_data'': '''', ''info'': '''', ''kind'': '''', ''abbr'': ''''}]}', - \ getline(2)) - call assert_equal(3, g:CallCount) - %d - call setline(1, 'fooo1') - let g:CallCount = 0 - exe "normal! Gof\oo\\=complete_info([\"items\"])\" - call assert_match('''word'': ''fooo1''.*''word'': ''fooo3''', getline(2)) - call assert_equal(4, g:CallCount) - %d - " refresh will stop when -3 is returned - set complete=.,,\ ffunction('CompleteFailIntermittent'\\,\ [-3]) - call setline(1, 'fooo1') - let g:CallCount = 0 - exe "normal! Gof\o\\=complete_info([\"items\", \"selected\"])\" - call assert_equal('f{''selected'': -1, ''items'': [{''word'': ''fooo1'', ''menu'': '''', ' - \ . '''user_data'': '''', ''info'': '''', ''kind'': '''', ''abbr'': ''''}]}', - \ getline(2)) - call assert_equal(3, g:CallCount) - %d - call setline(1, 'fooo1') - let g:CallCount = 0 - exe "normal! Gof\oo\\=complete_info([\"items\", \"selected\"])\" - call assert_equal('fo{''selected'': -1, ''items'': [{''word'': ''fooo1'', ''menu'': '''', ' - \ . '''user_data'': '''', ''info'': '''', ''kind'': '''', ''abbr'': ''''}]}', - \ getline(2)) - call assert_equal(3, g:CallCount) - bw! - - set complete& completeopt& - delfunc CompleteFail - delfunc CompleteFailIntermittent -endfunc - -" Select items before they are removed by refresh:always -func Test_cpt_select_item_refresh_always() - - func CompleteMenuWords() - let info = complete_info(["items", "selected"]) - call map(info.items, {_, v -> v.word}) - return info - endfunc - - func! CompleteItemsSelect(compl, findstart, base) - if a:findstart - return col('.') - 1 - endif - let g:CallCount += 1 - if g:CallCount == 2 - return #{words: a:compl, refresh: 'always'} - endif - let res = [[], ['fo', 'foobar'], [], ['foo1', 'foo2']] - return #{words: res[g:CallCount], refresh: 'always'} - endfunc - - new - set complete=.,ffunction('CompleteItemsSelect'\\,\ [[]]) - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\=CompleteMenuWords()\" - call assert_equal('fo{''selected'': 1, ''items'': [''foobarbar'', ''fo'', ''foobar'']}', getline(2)) - call assert_equal(1, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\=CompleteMenuWords()\" - call assert_equal('fo{''selected'': 0, ''items'': [''fo'', ''foobar'', ''foobarbar'']}', getline(2)) - call assert_equal(1, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\o\=CompleteMenuWords()\" - call assert_equal('foo{''selected'': -1, ''items'': []}' , getline(2)) - call assert_equal(1, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\=CompleteMenuWords()\" - call assert_equal('f{''selected'': -1, ''items'': [''foobarbar'']}', getline(2)) - call assert_equal(2, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\\=CompleteMenuWords()\" - call assert_equal('f{''selected'': -1, ''items'': [''foobarbar'']}', getline(2)) - call assert_equal(2, g:CallCount) - - %d - set complete=.,ffunction('CompleteItemsSelect'\\,\ [['foonext']]) - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\=CompleteMenuWords()\" - call assert_equal('f{''selected'': -1, ''items'': [''foobarbar'', ''foonext'']}', getline(2)) - call assert_equal(2, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\\=CompleteMenuWords()\" - call assert_equal('f{''selected'': -1, ''items'': [''foonext'', ''foobarbar'']}', getline(2)) - call assert_equal(2, g:CallCount) - - %d - call setline(1, "foob") - let g:CallCount = 0 - exe "normal! Gof\\\=CompleteMenuWords()\" - call assert_equal('foo{''selected'': 0, ''items'': [''foob'', ''foonext'']}', getline(2)) - call assert_equal(2, g:CallCount) - %d - call setline(1, "foob") - let g:CallCount = 0 - exe "normal! Gof\\\\=CompleteMenuWords()\" - call assert_equal('fo{''selected'': 0, ''items'': [''foob'', ''foo1'', ''foo2'']}', getline(2)) - call assert_equal(3, g:CallCount) - - %d - call setline(1, "foob") - let g:CallCount = 0 - exe "normal! Gof\\\=CompleteMenuWords()\" - call assert_equal('foo{''selected'': 1, ''items'': [''foonext'', ''foob'']}', getline(2)) - call assert_equal(2, g:CallCount) - %d - call setline(1, "foob") - let g:CallCount = 0 - exe "normal! Gof\\\\=CompleteMenuWords()\" - call assert_equal('fo{''selected'': 2, ''items'': [''foo1'', ''foo2'', ''foob'']}', getline(2)) - call assert_equal(3, g:CallCount) - - %d - set complete=.,ffunction('CompleteItemsSelect'\\,\ [['fo'\\,\ 'foonext']]) - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\=CompleteMenuWords()\" - call assert_equal('f{''selected'': -1, ''items'': [''foobarbar'', ''fo'', ''foonext'']}', getline(2)) - call assert_equal(2, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\\\=CompleteMenuWords()\" - call assert_equal('f{''selected'': -1, ''items'': [''fo'', ''foonext'', ''foobarbar'']}', getline(2)) - call assert_equal(2, g:CallCount) - bw! - - set complete& - delfunc CompleteMenuWords - delfunc CompleteItemsSelect -endfunc - -" Test two functions together, each returning refresh:always -func Test_cpt_multi_func_refresh_always() - - func CompleteMenuMatches() - let info = complete_info(["matches", "selected"]) - call map(info.matches, {_, v -> v.word}) - return info - endfunc - - func! CompleteItems1(findstart, base) - if a:findstart - return col('.') - 1 - endif - let g:CallCount1 += 1 - let res = [[], [], ['foo1', 'foobar1'], [], ['foo11', 'foo12'], [], ['foo13', 'foo14']] - return #{words: res[g:CallCount1], refresh: 'always'} - endfunc - - func! CompleteItems2(findstart, base) - if a:findstart - return col('.') - 1 - endif - let g:CallCount2 += 1 - let res = [[], [], [], ['foo2', 'foobar2'], ['foo21', 'foo22'], ['foo23'], []] - return #{words: res[g:CallCount2], refresh: 'always'} - endfunc - - set complete= - exe "normal! if\\=CompleteMenuMatches()\" - " \x0e is - call assert_equal("f\x0e" . '{''matches'': [], ''selected'': -1}', getline(1)) - - set completeopt=menuone,noselect - set complete=fCompleteItems1,fCompleteItems2 - - new - let g:CallCount1 = 0 - let g:CallCount2 = 0 - exe "normal! if\o\o\=CompleteMenuMatches()\" - call assert_equal('foo{''matches'': [''foo2'', ''foobar2''], ''selected'': -1}', getline(1)) - call assert_equal(3, g:CallCount1) - call assert_equal(3, g:CallCount2) - %d - let g:CallCount1 = 0 - let g:CallCount2 = 0 - exe "normal! if\o\o\=CompleteMenuMatches()\" - call assert_equal('foo{''matches'': [''foo2'', ''foobar2''], ''selected'': -1}', getline(1)) - call assert_equal(3, g:CallCount1) - call assert_equal(3, g:CallCount2) - %d - let g:CallCount1 = 0 - let g:CallCount2 = 0 - exe "normal! if\\=CompleteMenuMatches()\" - call assert_equal('f{''matches'': [], ''selected'': -1}', getline(1)) - call assert_equal(1, g:CallCount1) - call assert_equal(1, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\\=CompleteMenuMatches()\" - call assert_equal('f{''matches'': [''foo1'', ''foobar1''], ''selected'': -1}', getline(1)) - call assert_equal(2, g:CallCount2) - call assert_equal(2, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\o\=CompleteMenuMatches()\" - call assert_equal('fo{''matches'': [''foo2'', ''foobar2''], ''selected'': -1}', getline(1)) - call assert_equal(3, g:CallCount2) - call assert_equal(3, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\o\=CompleteMenuMatches()\" - call assert_equal('fo{''matches'': [''foo2'', ''foobar2''], ''selected'': -1}', getline(1)) - call assert_equal(3, g:CallCount2) - call assert_equal(3, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\oo\=CompleteMenuMatches()\" - call assert_equal('foo{''matches'': [''foo11'', ''foo12'', ''foo21'', ''foo22''], ''selected'': -1}', getline(1)) - call assert_equal(4, g:CallCount2) - call assert_equal(4, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\oo\\=CompleteMenuMatches()\" - call assert_equal('fo{''matches'': [''foo23''], ''selected'': -1}', getline(1)) - call assert_equal(5, g:CallCount2) - call assert_equal(5, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\oo\\=CompleteMenuMatches()\" - call assert_equal('fo{''matches'': [''foo23''], ''selected'': -1}', getline(1)) - call assert_equal(5, g:CallCount2) - call assert_equal(5, g:CallCount2) - %d - let g:CallCount1 = 1 - let g:CallCount2 = 1 - exe "normal! if\oo\o\=CompleteMenuMatches()\" - call assert_equal('foo{''matches'': [''foo13'', ''foo14''], ''selected'': -1}', getline(1)) - call assert_equal(6, g:CallCount2) - call assert_equal(6, g:CallCount2) - bw! - - set complete& completeopt& - delfunc CompleteMenuMatches - delfunc CompleteItems1 - delfunc CompleteItems2 + delfunc Tcomplete endfunc " Test for completing from a thesaurus file without read permission @@ -2105,143 +1608,6 @@ func Test_no_mapping_for_ctrl_x_key() bwipe! endfunc -" Test for different ways of setting a function in 'complete' option -func Test_cpt_func_callback() - func CompleteFunc1(callnr, findstart, base) - call add(g:CompleteFunc1Args, [a:callnr, a:findstart, a:base]) - return a:findstart ? 0 : [] - endfunc - func CompleteFunc2(findstart, base) - call add(g:CompleteFunc2Args, [a:findstart, a:base]) - return a:findstart ? 0 : [] - endfunc - - let lines =<< trim END - #" Test for using a global function name - set complete=fg:CompleteFunc2 - new - call setline(1, 'global') - LET g:CompleteFunc2Args = [] - call feedkeys("A\\", 'x') - call assert_equal([[1, ''], [0, 'global']], g:CompleteFunc2Args) - set complete& - bw! - - #" Test for using a function() - set complete=ffunction('g:CompleteFunc1'\\,\ [10]) - new - call setline(1, 'one') - LET g:CompleteFunc1Args = [] - call feedkeys("A\\", 'x') - call assert_equal([[10, 1, ''], [10, 0, 'one']], g:CompleteFunc1Args) - set complete& - bw! - - #" Using a funcref variable - set complete=ffuncref('g:CompleteFunc1'\\,\ [11]) - new - call setline(1, 'two') - LET g:CompleteFunc1Args = [] - call feedkeys("A\\", 'x') - call assert_equal([[11, 1, ''], [11, 0, 'two']], g:CompleteFunc1Args) - set complete& - bw! - - END - call v9.CheckLegacyAndVim9Success(lines) - - " Test for using a script-local function name - func s:CompleteFunc3(findstart, base) - call add(g:CompleteFunc3Args, [a:findstart, a:base]) - return a:findstart ? 0 : [] - endfunc - set complete=fs:CompleteFunc3 - new - call setline(1, 'script1') - let g:CompleteFunc3Args = [] - call feedkeys("A\\", 'x') - call assert_equal([[1, ''], [0, 'script1']], g:CompleteFunc3Args) - set complete& - bw! - - let &complete = 'fs:CompleteFunc3' - new - call setline(1, 'script2') - let g:CompleteFunc3Args = [] - call feedkeys("A\\", 'x') - call assert_equal([[1, ''], [0, 'script2']], g:CompleteFunc3Args) - bw! - delfunc s:CompleteFunc3 - set complete& - - " In Vim9 script s: can be omitted - let lines =<< trim END - vim9script - var CompleteFunc4Args = [] - def CompleteFunc4(findstart: bool, base: string): any - add(CompleteFunc4Args, [findstart, base]) - return findstart ? 0 : [] - enddef - set complete=fCompleteFunc4 - new - setline(1, 'script1') - feedkeys("A\\", 'x') - assert_equal([[1, ''], [0, 'script1']], CompleteFunc4Args) - set complete& - bw! - END - call v9.CheckScriptSuccess(lines) - - " Vim9 tests - let lines =<< trim END - vim9script - - def Vim9CompleteFunc(callnr: number, findstart: number, base: string): any - add(g:Vim9completeFuncArgs, [callnr, findstart, base]) - return findstart ? 0 : [] - enddef - - # Test for using a def function with completefunc - set complete=ffunction('Vim9CompleteFunc'\\,\ [60]) - new | only - setline(1, 'one') - g:Vim9completeFuncArgs = [] - feedkeys("A\\", 'x') - assert_equal([[60, 1, ''], [60, 0, 'one']], g:Vim9completeFuncArgs) - bw! - - # Test for using a global function name - &complete = 'fg:CompleteFunc2' - new | only - setline(1, 'two') - g:CompleteFunc2Args = [] - feedkeys("A\\", 'x') - assert_equal([[1, ''], [0, 'two']], g:CompleteFunc2Args) - bw! - - # Test for using a script-local function name - def LocalCompleteFunc(findstart: number, base: string): any - add(g:LocalCompleteFuncArgs, [findstart, base]) - return findstart ? 0 : [] - enddef - &complete = 'fLocalCompleteFunc' - new | only - setline(1, 'three') - g:LocalCompleteFuncArgs = [] - feedkeys("A\\", 'x') - assert_equal([[1, ''], [0, 'three']], g:LocalCompleteFuncArgs) - bw! - END - call v9.CheckScriptSuccess(lines) - - " cleanup - set completefunc& complete& - delfunc CompleteFunc1 - delfunc CompleteFunc2 - unlet g:CompleteFunc1Args g:CompleteFunc2Args - %bw! -endfunc - " Test for different ways of setting the 'completefunc' option func Test_completefunc_callback() func CompleteFunc1(callnr, findstart, base) @@ -3118,19 +2484,10 @@ endfunc func Test_complete_smartindent() new setlocal smartindent completefunc=FooBarComplete + exe "norm! o{\\\\}\\" let result = getline(1,'$') call assert_equal(['', '{','}',''], result) - %d - setlocal complete=fFooBarComplete - exe "norm! o{\\\}\\" - let result = getline(1,'$') - call assert_equal(['', '{','}',''], result) - %d - setlocal complete=f - exe "norm! o{\\\}\\" - let result = getline(1,'$') - call assert_equal(['', '{','}',''], result) bw! delfunction! FooBarComplete endfunc @@ -3387,15 +2744,11 @@ func Test_complete_opt_fuzzy() autocmd CompleteChanged * :call OnPumChange() augroup END - let g:change = 0 func Omni_test(findstart, base) if a:findstart return col(".") endif - if g:change == 0 - return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}, #{word: "你好å—"}, #{word: "我好"}] - endif - return [#{word: "for i = .."}, #{word: "bar"}, #{word: "foo"}, #{word: "for .. ipairs"}, #{word: "for .. pairs"}] + return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}, #{word: "你好å—"}, #{word: "我好"}] endfunc new @@ -3476,31 +2829,6 @@ func Test_complete_opt_fuzzy() call feedkeys("i\=CompAnother()\\\", 'tx') call assert_equal("for", g:abbr) - set cot=menu,fuzzy - call feedkeys("Sblue\bar\b\\\\", 'tx') - call assert_equal('bar', getline('.')) - call feedkeys("Sb\\\\", 'tx') - call assert_equal('blue', getline('.')) - call feedkeys("Sb\\\\\", 'tx') - call assert_equal('b', getline('.')) - - " chain completion - call feedkeys("Slore spum\lor\\\\\", 'tx') - call assert_equal('lore spum', getline('.')) - - " issue #15412 - call feedkeys("Salpha bravio charlie\alpha\\\\\\\", 'tx') - call assert_equal('alpha bravio charlie', getline('.')) - - set cot=fuzzy,menu,noinsert - call feedkeys(":let g:change=1\") - call feedkeys("S\\for\\\", 'tx') - call assert_equal('for', getline('.')) - call feedkeys("S\\for\", 'tx') - call assert_equal('for', getline('.')) - call feedkeys("S\\for\\", 'tx') - call assert_equal('for .. ipairs', getline('.')) - " clean up set omnifunc= bw! @@ -3586,6 +2914,34 @@ func Test_complete_fuzzy_collect() call feedkeys("Su\\\\0", 'tx!') call assert_equal('no one can save me but you', getline('.')) + " issue #15412 + call setline(1, ['alpha bravio charlie']) + call feedkeys("Salpha\\\0", 'tx!') + call assert_equal('alpha bravio', getline('.')) + call feedkeys("Salp\\\0", 'tx!') + call assert_equal('alpha', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio charlie', getline('.')) + + set complete-=i + call feedkeys("Salp\\\0", 'tx!') + call assert_equal('alpha', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio charlie', getline('.')) + + call setline(1, ['alpha bravio charlie', 'alpha another']) + call feedkeys("Salpha\\\\0", 'tx!') + call assert_equal('alpha another', getline('.')) + call setline(1, ['你好 我好', '你好 他好']) + call feedkeys("S你好\\\0", 'tx!') + call assert_equal('你好 我好', getline('.')) + call feedkeys("S你好\\\\0", 'tx!') + call assert_equal('你好 他好', getline('.')) + " issue #15526 set completeopt=menuone,menu,noselect call setline(1, ['Text', 'ToText', '']) @@ -3611,11 +2967,6 @@ func Test_complete_fuzzy_collect() call feedkeys("Gofuzzy\\\\\\0", 'tx!') call assert_equal('completefuzzycollect', getline('.')) - %d _ - call setline(1, ['fuzzy', 'fuzzy foo', "fuzzy bar", 'fuzzycollect']) - call feedkeys("Gofuzzy\\\\\\0", 'tx!') - call assert_equal('fuzzycollect', getline('.')) - bw! bw! set dict& @@ -3846,7 +3197,7 @@ func Test_complete_info_completed() set cot& endfunc -func Test_completeopt_preinsert() +function Test_completeopt_preinsert() func Omni_test(findstart, base) if a:findstart return col(".") @@ -3986,47 +3337,6 @@ func Test_completeopt_preinsert() call assert_equal(4, g:col) call assert_equal("wp.", getline('.')) - %delete _ - let &l:undolevels = &l:undolevels - normal! ifoo - let &l:undolevels = &l:undolevels - normal! obar - let &l:undolevels = &l:undolevels - normal! obaz - let &l:undolevels = &l:undolevels - - func CheckUndo() - let g:errmsg = '' - call assert_equal(['foo', 'bar', 'baz'], getline(1, '$')) - undo - call assert_equal(['foo', 'bar'], getline(1, '$')) - undo - call assert_equal(['foo'], getline(1, '$')) - undo - call assert_equal([''], getline(1, '$')) - later 3 - call assert_equal(['foo', 'bar', 'baz'], getline(1, '$')) - call assert_equal('', v:errmsg) - endfunc - - " Check that switching buffer with "preinsert" doesn't corrupt undo. - new - setlocal bufhidden=wipe - inoremap enew! - call feedkeys("i\\\\", 'tx') - bwipe! - call CheckUndo() - - " Check that closing window with "preinsert" doesn't corrupt undo. - new - setlocal bufhidden=wipe - inoremap close! - call feedkeys("i\\\\", 'tx') - call CheckUndo() - - %delete _ - delfunc CheckUndo - bw! set cot& set omnifunc& @@ -4077,441 +3387,4 @@ func Test_complete_multiline_marks() delfunc Omni_test endfunc -func Test_complete_match_count() - func PrintMenuWords() - let info = complete_info(["selected", "matches"]) - call map(info.matches, {_, v -> v.word}) - return info - endfunc - - new - set cpt=.^0,w - call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foo'', ''foobar'', ''fobarbaz''], ''selected'': 0}', getline(5)) - 5d - set cpt=.^0,w - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fobarbaz{''matches'': [''fo'', ''foo'', ''foobar'', ''fobarbaz''], ''selected'': 3}', getline(5)) - 5d - set cpt=.^1,w - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo''], ''selected'': 0}', getline(5)) - 5d - " max_matches is ignored for backward search - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fobarbaz{''matches'': [''fo'', ''foo'', ''foobar'', ''fobarbaz''], ''selected'': 3}', getline(5)) - 5d - set cpt=.^2,w - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foo''], ''selected'': 0}', getline(5)) - 5d - set cot=menuone,noselect - set cpt=.^1,w - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''fo''], ''selected'': -1}', getline(5)) - set cot& - - func ComplFunc(findstart, base) - if a:findstart - return col(".") - endif - return ["foo1", "foo2", "foo3", "foo4"] - endfunc - - %d - set completefunc=ComplFunc - set cpt=.^1,f^2 - call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 0}', getline(5)) - 5d - exe "normal! Gof\\\=PrintMenuWords()\" - call assert_equal('foo1{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 1}', getline(5)) - 5d - exe "normal! Gof\\\\=PrintMenuWords()\" - call assert_equal('foo2{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 2}', getline(5)) - 5d - exe "normal! Gof\\\\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': -1}', getline(5)) - 5d - exe "normal! Gof\\\\\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 0}', getline(5)) - - 5d - exe "normal! Gof\\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': -1}', getline(5)) - 5d - exe "normal! Gof\\\\=PrintMenuWords()\" - call assert_equal('foo2{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 2}', getline(5)) - 5d - exe "normal! Gof\\\\\=PrintMenuWords()\" - call assert_equal('foo1{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 1}', getline(5)) - 5d - exe "normal! Gof\\\\\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': 0}', getline(5)) - 5d - exe "normal! Gof\\\\\\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''fo'', ''foo1'', ''foo2''], ''selected'': -1}', getline(5)) - - %d - call setline(1, ["foo"]) - set cpt=fComplFunc^2,. - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('foo1{''matches'': [''foo1'', ''foo2'', ''foo''], ''selected'': 0}', getline(2)) - bw! - - " Test refresh:always with max_items - let g:CallCount = 0 - func! CompleteItemsSelect(findstart, base) - if a:findstart - return col('.') - 1 - endif - let g:CallCount += 1 - let res = [[], ['foobar'], ['foo1', 'foo2', 'foo3'], ['foo4', 'foo5', 'foo6']] - return #{words: res[g:CallCount], refresh: 'always'} - endfunc - - new - set complete=.,ffunction('CompleteItemsSelect')^2 - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\\=PrintMenuWords()\" - call assert_equal('foobar{''matches'': [''foobarbar'', ''foobar''], ''selected'': 1}', getline(2)) - call assert_equal(1, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\o\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''foobarbar'', ''foo1'', ''foo2''], ''selected'': -1}', getline(2)) - call assert_equal(2, g:CallCount) - %d - call setline(1, "foobarbar") - let g:CallCount = 0 - exe "normal! Gof\\o\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobarbar'', ''foo4'', ''foo5''], ''selected'': -1}', getline(2)) - call assert_equal(3, g:CallCount) - bw! - - set completeopt& complete& - delfunc PrintMenuWords -endfunc - -func Test_complete_append_selected_match_default() - " when typing a normal character during completion, - " completion is ended, see - " :h popupmenu-completion ("There are three states:") - func PrintMenuWords() - let info = complete_info(["selected", "matches"]) - call map(info.matches, {_, v -> v.word}) - return info - endfunc - - new - call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foo'', ''foobar'', ''fobarbaz''], ''selected'': 0}', getline(5)) - %d - call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) - exe "normal! Gof\o\=PrintMenuWords()\" - call assert_equal('foo{''matches'': [], ''selected'': -1}', getline(5)) - %d - set completeopt=menu,noselect - call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) - exe "normal! Gof\\o\=PrintMenuWords()\" - call assert_equal('foo{''matches'': [], ''selected'': -1}', getline(5)) - bw! - - set completeopt& - delfunc PrintMenuWords -endfunc - -" Test normal mode (^N/^P/^X^N/^X^P) with smartcase when 1) matches are first -" found and 2) matches are filtered (when a character is typed). -func Test_smartcase_normal_mode() - - func! PrintMenu() - let info = complete_info(["matches"]) - call map(info.matches, {_, v -> v.word}) - return info - endfunc - - func! TestInner(key) - let pr = "\=PrintMenu()\" - - new - set completeopt=menuone,noselect ignorecase smartcase - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}{pr}" - call assert_equal('F{''matches'': [''Fast'', ''FAST'', ''False'', - \ ''FALSE'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}a{pr}" - call assert_equal('Fa{''matches'': [''Fast'', ''False'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}a\{pr}" - call assert_equal('F{''matches'': [''Fast'', ''FAST'', ''False'', - \ ''FALSE'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}ax{pr}" - call assert_equal('Fax{''matches'': []}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}ax\{pr}" - call assert_equal('Fa{''matches'': [''Fast'', ''False'']}', getline(1)) - - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}A{pr}" - call assert_equal('FA{''matches'': [''FAST'', ''FALSE'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}A\{pr}" - call assert_equal('F{''matches'': [''Fast'', ''FAST'', ''False'', - \ ''FALSE'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}AL{pr}" - call assert_equal('FAL{''matches'': [''FALSE'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}ALx{pr}" - call assert_equal('FALx{''matches'': []}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOF{a:key}ALx\{pr}" - call assert_equal('FAL{''matches'': [''FALSE'']}', getline(1)) - - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOf{a:key}{pr}" - call assert_equal('f{''matches'': [''Fast'', ''FAST'', ''False'', ''FALSE'', - \ ''fast'', ''false'']}', getline(1)) - %d - call setline(1, ["Fast", "FAST", "False", "FALSE", "fast", "false"]) - exe $"normal! ggOf{a:key}a{pr}" - call assert_equal('fa{''matches'': [''Fast'', ''FAST'', ''False'', ''FALSE'', - \ ''fast'', ''false'']}', getline(1)) - - %d - exe $"normal! ggOf{a:key}{pr}" - call assert_equal('f{''matches'': []}', getline(1)) - exe $"normal! ggOf{a:key}a\{pr}" - call assert_equal('f{''matches'': []}', getline(1)) - set ignorecase& smartcase& completeopt& - bw! - endfunc - - call TestInner("\") - call TestInner("\") - call TestInner("\\") - call TestInner("\\") - delfunc PrintMenu - delfunc TestInner -endfunc - -" Test 'nearest' flag of 'completeopt' -func Test_nearest_cpt_option() - - func PrintMenuWords() - let info = complete_info(["selected", "matches"]) - call map(info.matches, {_, v -> v.word}) - return info - endfunc - - new - set completeopt+=nearest - call setline(1, ["fo", "foo", "foobar"]) - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('foobar{''matches'': [''foobar'', ''foo'', ''fo''], ''selected'': 0}', getline(4)) - %d - call setline(1, ["fo", "foo", "foobar"]) - exe "normal! Of\\=PrintMenuWords()\" - call assert_equal('foobar{''matches'': [''fo'', ''foo'', ''foobar''], ''selected'': 2}', getline(1)) - %d - - set completeopt=menu,noselect,nearest - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobarbaz'', ''foobar'', ''foo'', ''fo''], ''selected'': -1}', getline(5)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! Gof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobarbaz'', ''foobar'', ''foo'', ''fo''], ''selected'': -1}', getline(5)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! Of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''fo'', ''foo'', ''foobar'', ''foobarbaz''], ''selected'': -1}', getline(1)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! Of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''fo'', ''foo'', ''foobar'', ''foobarbaz''], ''selected'': -1}', getline(1)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foo'', ''fo'', ''foobar'', ''foobarbaz''], ''selected'': -1}', getline(2)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foo'', ''fo'', ''foobar'', ''foobarbaz''], ''selected'': -1}', getline(2)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! jof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobar'', ''foo'', ''foobarbaz'', ''fo''], ''selected'': -1}', getline(3)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! jof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobar'', ''foo'', ''foobarbaz'', ''fo''], ''selected'': -1}', getline(3)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! 2jof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobarbaz'', ''foobar'', ''foo'', ''fo''], ''selected'': -1}', getline(4)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! 2jof\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foobarbaz'', ''foobar'', ''foo'', ''fo''], ''selected'': -1}', getline(4)) - - %d - set completeopt=menuone,noselect,nearest - call setline(1, "foo") - exe "normal! Of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foo''], ''selected'': -1}', getline(1)) - %d - call setline(1, "foo") - exe "normal! o\\=PrintMenuWords()\" - call assert_equal('{''matches'': [''foo''], ''selected'': -1}', getline(2)) - %d - exe "normal! o\\=PrintMenuWords()\" - call assert_equal('', getline(1)) - %d - exe "normal! o\\=PrintMenuWords()\" - call assert_equal('', getline(1)) - - " Reposition match: node is at tail but score is too small - %d - call setline(1, ["foo1", "bar1", "bar2", "foo2", "foo1"]) - exe "normal! of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foo1'', ''foo2''], ''selected'': -1}', getline(2)) - " Reposition match: node is in middle but score is too big - %d - call setline(1, ["foo1", "bar1", "bar2", "foo3", "foo1", "foo2"]) - exe "normal! of\\=PrintMenuWords()\" - call assert_equal('f{''matches'': [''foo1'', ''foo3'', ''foo2''], ''selected'': -1}', getline(2)) - - set completeopt=menu,longest,nearest - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! of\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''foo'', ''fo'', ''foobar'', ''foobarbaz''], ''selected'': -1}', getline(2)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! 2jof\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''foobarbaz'', ''foobar'', ''foo'', ''fo''], ''selected'': -1}', getline(4)) - - " No effect if 'fuzzy' is present - set completeopt& - set completeopt+=fuzzy,nearest - %d - call setline(1, ["foo", "fo", "foobarbaz", "foobar"]) - exe "normal! of\\=PrintMenuWords()\" - call assert_equal('fo{''matches'': [''fo'', ''foobarbaz'', ''foobar'', ''foo''], ''selected'': 0}', getline(2)) - %d - call setline(1, ["fo", "foo", "foobar", "foobarbaz"]) - exe "normal! 2jof\\=PrintMenuWords()\" - call assert_equal('foobar{''matches'': [''foobarbaz'', ''fo'', ''foo'', ''foobar''], ''selected'': 3}', getline(4)) - bw! - - set completeopt& - delfunc PrintMenuWords -endfunc - -func Test_complete_match() - set isexpand=.,/,->,abc,/*,_ - func TestComplete() - let res = complete_match() - if res->len() == 0 - return - endif - let [startcol, expandchar] = res[0] - - if startcol >= 0 - let line = getline('.') - - let items = [] - if expandchar == '/*' - let items = ['/** */'] - elseif expandchar =~ '^/' - let items = ['/*! */', '// TODO:', '// fixme:'] - elseif expandchar =~ '^\.' && startcol < 4 - let items = ['length()', 'push()', 'pop()', 'slice()'] - elseif expandchar =~ '^\.' && startcol > 4 - let items = ['map()', 'filter()', 'reduce()'] - elseif expandchar =~ '^\abc' - let items = ['def', 'ghk'] - elseif expandchar =~ '^\->' - let items = ['free()', 'xfree()'] - else - let items = ['test1', 'test2', 'test3'] - endif - - call complete(expandchar =~ '^/' ? startcol : startcol + strlen(expandchar), items) - endif - endfunc - - new - inoremap call TestComplete() - - call feedkeys("S/*\\", 'tx') - call assert_equal('/** */', getline('.')) - - call feedkeys("S/\\\", 'tx') - call assert_equal('// TODO:', getline('.')) - - call feedkeys("Swp.\\\", 'tx') - call assert_equal('wp.push()', getline('.')) - - call feedkeys("Swp.property.\\\", 'tx') - call assert_equal('wp.property.filter()', getline('.')) - - call feedkeys("Sp->\\\", 'tx') - call assert_equal('p->xfree()', getline('.')) - - call feedkeys("Swp->property.\\", 'tx') - call assert_equal('wp->property.map()', getline('.')) - - call feedkeys("Sabc\\", 'tx') - call assert_equal('abcdef', getline('.')) - - call feedkeys("S_\\", 'tx') - call assert_equal('_test1', getline('.')) - - set ise& - call feedkeys("Sabc \:let g:result=complete_match()\", 'tx') - call assert_equal([[1, 'abc']], g:result) - - call assert_fails('call complete_match(99, 0)', 'E966:') - call assert_fails('call complete_match(1, 99)', 'E964:') - call assert_fails('call complete_match(1)', 'E474:') - - set ise=你好,好 - call feedkeys("S你好 \:let g:result=complete_match()\", 'tx') - call assert_equal([[1, '你好'], [4, '好']], g:result) - - set ise=\\,,-> - call feedkeys("Sabc, \:let g:result=complete_match()\", 'tx') - call assert_equal([[4, ',']], g:result) - - set ise=\ ,= - call feedkeys("Sif true \:let g:result=complete_match()\", 'tx') - call assert_equal([[8, ' ']], g:result) - - bw! - unlet g:result - set isexpand& - delfunc TestComplete -endfunc - " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim index f05080e0..250ce5c4 100644 --- a/src/testdir/test_lambda.vim +++ b/src/testdir/test_lambda.vim @@ -362,7 +362,7 @@ endfunc func Test_lambda_error() " This was causing a crash - call assert_fails('ec{@{->{d->()()', 'E451:') + call assert_fails('ec{@{->{d->()()', 'E15:') endfunc func Test_closure_error() diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim index a90b55cb..e31b5147 100644 --- a/src/testdir/test_let.vim +++ b/src/testdir/test_let.vim @@ -93,26 +93,6 @@ func Test_let() let [l[0], l[1]] = [10, 20] call assert_equal([10, 20, 3], l) - " Test for using curly brace name in the LHS of an assignment - let listvar = [1, 2] - let s = 'listvar' - let {s} = [3, 4] - call assert_equal([3, 4], listvar) - - " Test for using curly brace name as a list and as list index in the LHS of - " an assignment - let listvar = [1, 2] - let idx = 1 - let s = 'listvar' - let {s}[0] = 10 - let s = 'idx' - let listvar[{s}] = 20 - call assert_equal([10, 20], listvar) - let s1 = 'listvar' - let s2 = 'idx' - let {s1}[{s2}] = 30 - call assert_equal([10, 30], listvar) - " Test for errors in conditional expression call assert_fails('let val = [] ? 1 : 2', 'E745:') call assert_fails('let val = 1 ? 5+ : 6', 'E121:') @@ -330,7 +310,7 @@ func Test_let_errors() call assert_fails('let [a]', 'E474:') call assert_fails('let [a, b] = [', 'E697:') call assert_fails('let [a, b] = [10, 20', 'E696:') - call assert_fails('let [a, b] = 10', 'E1535:') + call assert_fails('let [a, b] = 10', 'E714:') call assert_fails('let [a, , b] = [10, 20]', 'E475:') call assert_fails('let [a, b&] = [10, 20]', 'E475:') call assert_fails('let $ = 10', 'E475:') diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim index a7e9cb79..f3bdcd4b 100644 --- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -192,14 +192,6 @@ func Test_list_assign() END call v9.CheckLegacyAndVim9Success(lines) - let lines =<< trim END - VAR [x, y] = test_null_list() - END - call v9.CheckLegacyAndVim9Failure(lines, [ - \ 'E714: List required', - \ 'E1093: Expected 2 items but got 0', - \ 'E714: List required']) - let d = {'abc': [1, 2, 3]} call assert_fails('let d.abc[0:0z10] = [10, 20]', 'E976: Using a Blob as a String') endfunc @@ -1008,7 +1000,7 @@ func Test_reverse_sort_uniq() END call v9.CheckLegacyAndVim9Success(lines) - call assert_fails('call reverse({})', 'E1253:') + call assert_fails('call reverse({})', 'E1252:') call assert_fails('call uniq([1, 2], {x, y -> []})', 'E745:') call assert_fails("call sort([1, 2], function('min'), 1)", "E1206:") call assert_fails("call sort([1, 2], function('invalid_func'))", "E700:") @@ -1081,15 +1073,15 @@ func Test_reduce() call assert_fails("call reduce('', { acc, val -> acc + val })", 'E998: Reduce of an empty String with no initial value') call assert_fails("call reduce(test_null_string(), { acc, val -> acc + val })", 'E998: Reduce of an empty String with no initial value') - call assert_fails("call reduce({}, { acc, val -> acc + val }, 1)", 'E1253:') - call assert_fails("call reduce(0, { acc, val -> acc + val }, 1)", 'E1253:') + call assert_fails("call reduce({}, { acc, val -> acc + val }, 1)", 'E1098:') + call assert_fails("call reduce(0, { acc, val -> acc + val }, 1)", 'E1098:') call assert_fails("call reduce([1, 2], 'Xdoes_not_exist')", 'E117:') call assert_fails("echo reduce(0z01, { acc, val -> 2 * acc + val }, '')", 'E1210:') - call assert_fails("vim9 reduce(0, (acc, val) => (acc .. val), '')", 'E1253:') - call assert_fails("vim9 reduce({}, (acc, val) => (acc .. val), '')", 'E1253:') - call assert_fails("vim9 reduce(0.1, (acc, val) => (acc .. val), '')", 'E1253:') - call assert_fails("vim9 reduce(function('tr'), (acc, val) => (acc .. val), '')", 'E1253:') + call assert_fails("vim9 reduce(0, (acc, val) => (acc .. val), '')", 'E1252:') + call assert_fails("vim9 reduce({}, (acc, val) => (acc .. val), '')", 'E1252:') + call assert_fails("vim9 reduce(0.1, (acc, val) => (acc .. val), '')", 'E1252:') + call assert_fails("vim9 reduce(function('tr'), (acc, val) => (acc .. val), '')", 'E1252:') call assert_fails("call reduce('', { acc, val -> acc + val }, 1)", 'E1174:') call assert_fails("call reduce('', { acc, val -> acc + val }, {})", 'E1174:') call assert_fails("call reduce('', { acc, val -> acc + val }, 0.1)", 'E1174:') @@ -1412,7 +1404,7 @@ func Test_listdict_index() call v9.CheckLegacyAndVim9Failure(['VAR d = {"k": 10}', 'echo d[1 : 2]'], 'E719:') call assert_fails("let v = [4, 6][{-> 1}]", 'E729:') - call v9.CheckDefAndScriptFailure(['var v = [4, 6][() => 1]'], ['E1012:', 'E703:']) + call v9.CheckDefAndScriptFailure(['var v = [4, 6][() => 1]'], ['E1012', 'E703:']) call v9.CheckLegacyAndVim9Failure(['VAR v = range(5)[2 : []]'], ['E730:', 'E1012:', 'E730:']) @@ -1471,7 +1463,7 @@ func Test_null_list() let l = test_null_list() call assert_equal([], extend(l, l, 0)) call assert_equal(0, insert(test_null_list(), 2, -1)) - call assert_fails('let s = join([1, 2], [])', 'E1174:') + call assert_fails('let s = join([1, 2], [])', 'E730:') call assert_fails('call remove(l, 0, 2)', 'E684:') call assert_fails('call insert(l, 2, -1)', 'E684:') call assert_fails('call extend(test_null_list(), test_null_list())', 'E1134:') @@ -1552,7 +1544,7 @@ func Test_indexof() call assert_fails('let i = indexof(l, "v:val == ''cyan''")', 'E735:') call assert_fails('let i = indexof(l, "color == ''cyan''")', 'E121:') call assert_fails('let i = indexof(l, {})', 'E1256:') - call assert_fails('let i = indexof({}, "v:val == 2")', 'E1528:') + call assert_fails('let i = indexof({}, "v:val == 2")', 'E1226:') call assert_fails('let i = indexof([], "v:val == 2", [])', 'E1206:') func TestIdx(k, v) diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 1e42aba4..eb777912 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -345,7 +345,6 @@ func Test_matchdelete_error() endfunc func Test_matchclear_other_window() - CheckScreendump CheckRunVimInTerminal let buf = OtherWindowCommon() call term_sendkeys(buf, ":call clearmatches(winid)\") @@ -356,7 +355,6 @@ func Test_matchclear_other_window() endfunc func Test_matchadd_other_window() - CheckScreendump CheckRunVimInTerminal let buf = OtherWindowCommon() call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\") @@ -368,7 +366,6 @@ func Test_matchadd_other_window() endfunc func Test_match_in_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -384,7 +381,6 @@ func Test_match_in_linebreak() endfunc func Test_match_with_incsearch() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -424,7 +420,6 @@ func Test_matchdelete_redraw() endfunc func Test_match_tab_with_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/src/testdir/test_menu.vim b/src/testdir/test_menu.vim index 8ac1da55..40fec405 100644 --- a/src/testdir/test_menu.vim +++ b/src/testdir/test_menu.vim @@ -631,7 +631,6 @@ endfunc " Test for opening a menu drawn in the cmdline area func Test_popupmenu_cmdline() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim index e1eab59e..87b1131c 100644 --- a/src/testdir/test_messages.vim +++ b/src/testdir/test_messages.vim @@ -324,7 +324,6 @@ endfunc " Test more-prompt scrollback func Test_message_more_scrollback() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -349,7 +348,6 @@ func Test_message_more_scrollback() endfunc func Test_message_not_cleared_after_mode() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -385,7 +383,6 @@ func Test_message_not_cleared_after_mode() endfunc func Test_mode_cleared_after_silent_message() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -410,7 +407,6 @@ endfunc " Test verbose message before echo command func Test_echo_verbose_system() - CheckScreendump CheckRunVimInTerminal CheckUnix " needs the "seq" command CheckNotMac " the macos TMPDIR is too long for snapshot testing diff --git a/src/testdir/test_method.vim b/src/testdir/test_method.vim index 99e4917c..f18ac143 100644 --- a/src/testdir/test_method.vim +++ b/src/testdir/test_method.vim @@ -52,7 +52,7 @@ func Test_dict_method() call assert_fails("let x = d->insert(0)", 'E899:') call assert_true(d->has_key('two')) call assert_equal([['one', 1], ['two', 2], ['three', 3]], d->items()) - call assert_fails("let x = d->join()", 'E1529:') + call assert_fails("let x = d->join()", 'E1211:') call assert_equal(['one', 'two', 'three'], d->keys()) call assert_equal(3, d->len()) call assert_equal(#{one: 2, two: 3, three: 4}, d->map('v:val + 1')) @@ -62,7 +62,7 @@ func Test_dict_method() call assert_equal(2, d->remove("two")) let d.two = 2 call assert_fails('let x = d->repeat(2)', 'E731:') - call assert_fails('let x = d->reverse()', 'E1253:') + call assert_fails('let x = d->reverse()', 'E1252:') call assert_fails('let x = d->sort()', 'E686:') call assert_equal("{'one': 1, 'two': 2, 'three': 3}", d->string()) call assert_equal(v:t_dict, d->type()) diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index 72a9376c..d0ee6e8a 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -1264,24 +1264,6 @@ func Test_mkview_manual_fold() bw! endfunc -" Test for handling invalid folds within views -func Test_mkview_ignore_invalid_folds() - call writefile(range(1,10), 'Xmkvfile', 'D') - new Xmkvfile - " create some folds - 5,6fold - 4,7fold - mkview Xview - normal zE - " delete lines to make folds invalid - call deletebufline('', 6, '$') - source Xview - call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4), - \ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)]) - call delete('Xview') - bw! -endfunc - " Test default 'viewdir' value func Test_mkview_default_home() if has('win32') diff --git a/src/testdir/test_move.vim b/src/testdir/test_move.vim index d932a60e..04120975 100644 --- a/src/testdir/test_move.vim +++ b/src/testdir/test_move.vim @@ -47,7 +47,6 @@ func Test_move() endfunc func Test_move_undo() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 7f4f9096..75a3028b 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -2698,22 +2698,6 @@ func Test_normal33_g_cmd2() call assert_equal(87, col('.')) call assert_equal('E', getreg(0)) - " Have an odd number of chars in the line - norm! A. - call assert_equal(145, col('.')) - norm! gMyl - call assert_equal(73, col('.')) - call assert_equal('0', getreg(0)) - - " 'listchars' "eol" should not affect gM behavior - setlocal list listchars=eol:$ - norm! $ - call assert_equal(145, col('.')) - norm! gMyl - call assert_equal(73, col('.')) - call assert_equal('0', getreg(0)) - setlocal nolist - " Test for gM with Tab characters call setline('.', "\ta\tb\tc\td\te\tf") norm! gMyl @@ -4326,32 +4310,4 @@ func Test_normal_go() bwipe! endfunc -" Test for Ctrl-D with 'scrolloff' and narrow window does not get stuck. -func Test_scroll_longline_scrolloff() - 11new - 36vsplit - set scrolloff=5 - - call setline(1, ['']->repeat(5)) - call setline(6, ['foo'->repeat(20)]->repeat(2)) - call setline(8, ['bar'->repeat(30)]) - call setline(9, ['']->repeat(5)) - exe "normal! \" - call assert_equal(6, line('w0')) - exe "normal! \" - call assert_equal(7, line('w0')) - - set scrolloff& - bwipe! -endfunc - -" Benchmark test for Ctrl-F with 'nosmoothscroll' -func Test_scroll_longline_benchmark() - call setline(1, ['foo'->repeat(20000)] + ['']) - let start = reltime() - exe "normal! \" - call assert_inrange(0, 0.1, reltimefloat(reltime(start))) - bwipe! -endfunc - " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 1f71e1f5..6a561ac7 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -272,23 +272,6 @@ func Test_complete() call feedkeys("i\\", 'xt') bwipe! call assert_fails('set complete=ix', 'E535:') - call assert_fails('set complete=x', 'E539:') - call assert_fails('set complete=..', 'E535:') - set complete=.,w,b,u,k,\ s,i,d,],t,U,f,o - call assert_fails('set complete=i^-10', 'E535:') - call assert_fails('set complete=i^x', 'E535:') - call assert_fails('set complete=k^2,t^-1,s^', 'E535:') - call assert_fails('set complete=t^-1', 'E535:') - call assert_fails('set complete=kfoo^foo2', 'E535:') - call assert_fails('set complete=kfoo^', 'E535:') - call assert_fails('set complete=.^', 'E535:') - set complete=.,w,b,u,k,s,i,d,],t,U,f,o - set complete=. - set complete=.^10,t^0 - set complete+=ffuncref('foo'\\,\ [10]) - set complete=ffuncref('foo'\\,\ [10])^10 - set complete& - set complete+=ffunction('g:foo'\\,\ [10\\,\ 20]) set complete& endfun @@ -328,13 +311,6 @@ func Test_set_completion() " Expand key codes. call feedkeys(":set \\"\", 'tx') call assert_equal('"set ', @:) - " (alt name) and should both show up in auto-complete - call feedkeys(":set \\"\", 'tx') - call assert_equal('"set ', @:) - " has alt name but it should not show up here - " nor show up as duplicates - call feedkeys(":set \\"\", 'tx') - call assert_equal('"set ', @:) " Expand terminal options. call feedkeys(":set t_A\\\"\", 'tx') @@ -636,11 +612,10 @@ func Test_set_completion_string_values() call assert_equal([], getcompletion('set completepopup=bogusname:', 'cmdline')) set previewpopup& completepopup& - " diffopt: special handling of algorithm: and inline: + " diffopt: special handling of algorithm: call assert_equal('filler', getcompletion('set diffopt+=', 'cmdline')[0]) call assert_equal([], getcompletion('set diffopt+=iblank,foldcolumn:', 'cmdline')) call assert_equal('patience', getcompletion('set diffopt+=iblank,algorithm:pat*', 'cmdline')[0]) - call assert_equal('char', getcompletion('set diffopt+=iwhite,inline:ch*', 'cmdline')[0]) " highlight: special parsing, including auto-completing highlight groups " after ':' @@ -730,7 +705,7 @@ func Test_set_completion_string_values() call assert_equal([], getcompletion('set diffopt-=', 'cmdline')) " Test all possible values call assert_equal(['filler', 'context:', 'iblank', 'icase', 'iwhite', 'iwhiteall', 'iwhiteeol', 'horizontal', - \ 'vertical', 'closeoff', 'hiddenoff', 'foldcolumn:', 'followwrap', 'internal', 'indent-heuristic', 'algorithm:', 'inline:', 'linematch:'], + \ 'vertical', 'closeoff', 'hiddenoff', 'foldcolumn:', 'followwrap', 'internal', 'indent-heuristic', 'algorithm:', 'linematch:'], \ getcompletion('set diffopt=', 'cmdline')) set diffopt& @@ -1168,14 +1143,11 @@ func Test_backupskip() call setenv(var, '/duplicate/path') endfor - " unset $HOME, so that it won't try to read init files - let saveenv['HOME'] = getenv("HOME") - call setenv('HOME', v:null) exe 'silent !' . cmd call assert_equal(['errors:'], readfile('Xtestout')) " restore environment variables - for var in ['TMPDIR', 'TMP', 'TEMP', 'HOME'] + for var in ['TMPDIR', 'TMP', 'TEMP'] call setenv(var, saveenv[var]) endfor diff --git a/src/testdir/test_plugin_comment.vim b/src/testdir/test_plugin_comment.vim index 800c2751..a0425d58 100644 --- a/src/testdir/test_plugin_comment.vim +++ b/src/testdir/test_plugin_comment.vim @@ -1,5 +1,3 @@ -" Test for the comment package - source check.vim source term_util.vim @@ -59,29 +57,6 @@ func Test_basic_uncomment() call assert_equal(["# vim9script", "", "def Hello()", ' echo "Hello"', "enddef"], result) endfunc -func Test_caseinsensitive_uncomment() - CheckScreendump - let lines =<< trim END - rem echo "Hello" - END - - let input_file = "test_caseinsensitive_uncomment_input.bat" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" ' .. input_file, {}) - - call term_sendkeys(buf, "gcc") - let output_file = "comment_testinsensitive_uncomment_test.bat" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - - call assert_equal(['echo "Hello"'], result) -endfunc - func Test_bothends_comment() CheckScreendump let lines =<< trim END @@ -130,6 +105,7 @@ func Test_bothends_uncomment() call assert_equal(["int main() {", " return 0;", "}"], result) endfunc + func Test_mixed_comment() CheckScreendump let lines =<< trim END @@ -201,56 +177,6 @@ func Test_mixed_indent_comment() call assert_equal(["/* int main() { */", "\t/* if 1 { */", "\t /* return 0; */", "\t/* } */", " /* return 1; */", "/* } */"], result) endfunc -func Test_buffer_first_col_comment() - CheckScreendump - let lines =<< trim END - def Hello(): - print("Hello") - pass - END - - let input_file = "test_first_col_comment_input.py" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" -c "let b:comment_first_col=1" ' .. input_file, {}) - - call term_sendkeys(buf, "jgcc") - let output_file = "comment_first_col_test.py" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - - call assert_equal(["def Hello():", '# print("Hello")', " pass"], result) -endfunc - -func Test_global_first_col_comment() - CheckScreendump - let lines =<< trim END - def Hello(): - print("Hello") - pass - END - - let input_file = "test_first_col_comment_input.py" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" -c "let g:comment_first_col=1" ' .. input_file, {}) - - call term_sendkeys(buf, "jgcj") - let output_file = "comment_first_col_test.py" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - - call assert_equal(["def Hello():", '# print("Hello")', "# pass"], result) -endfunc - func Test_textobj_icomment() CheckScreendump let lines =<< trim END @@ -508,73 +434,6 @@ func Test_textobj_noleading_space_comment2() call assert_equal(["int main() {", "}"], result) endfunc -func Test_textobj_trailing_spaces_comment() - CheckScreendump - let lines = ['# print("hello") ', '# print("world") ', "#", 'print("!")'] - - let input_file = "test_textobj_trailing_spaces_input.py" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" ' .. input_file, {}) - - call term_sendkeys(buf, "jdac") - let output_file = "comment_textobj_trailing_spaces_comment.py" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - - call assert_equal(['print("!")'], result) -endfunc - -func Test_textobj_trailing_spaces_last_comment() - CheckScreendump - let lines = ['# print("hello") ', '# print("world") ', "#", '', ''] - - let input_file = "test_textobj_trailing_spaces_last_input.py" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" ' .. input_file, {}) - - call term_sendkeys(buf, "jdac") - let output_file = "comment_textobj_trailing_spaces_last_comment.py" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - - call assert_equal([], result) -endfunc - -func Test_textobj_last_line_empty_comment() - CheckScreendump - let lines =<< trim END - # print("hello") - # - # - END - - let input_file = "test_textobj_last_line_empty_input.py" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" ' .. input_file, {}) - - call term_sendkeys(buf, "dac") - let output_file = "comment_textobj_last_line_empty_comment.py" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - - call assert_equal([], result) -endfunc - func Test_textobj_cursor_on_leading_space_comment() CheckScreendump let lines =<< trim END @@ -598,7 +457,7 @@ func Test_textobj_cursor_on_leading_space_comment() let result = readfile(output_file) - call assert_equal(["int main() {", "}"], result) + call assert_equal(["int main() {", "", "}"], result) endfunc func Test_textobj_conseq_comment() @@ -655,72 +514,3 @@ func Test_textobj_conseq_comment2() call assert_equal(["int main() {", " printf(\"hello\");", "", " // world", " printf(\"world\");", "}"], result) endfunc - -func Test_inline_comment() - CheckScreendump - let lines =<< trim END - echo "Hello" This should be a comment - END - - let input_file = "test_inline_comment_input.vim" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" -c "nnoremap gC comment#Toggle()..''$''" ' .. input_file, {}) - - call term_sendkeys(buf, "fTgC") - - let output_file = "comment_inline_test.vim" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - call assert_equal(['echo "Hello" " This should be a comment'], result) -endfunc - -func Test_inline_uncomment() - CheckScreendump - let lines =<< trim END - echo "Hello" " This should be a comment - END - - let input_file = "test_inline_uncomment_input.vim" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "packadd comment" -c "nnoremap gC comment#Toggle()..''$''" ' .. input_file, {}) - - call term_sendkeys(buf, '$F"gC') - - let output_file = "uncomment_inline_test.vim" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - call assert_equal(['echo "Hello" This should be a comment'], result) -endfunc - -func Test_textobj_selection_exclusive_inline_comment() - CheckScreendump - let lines =<< trim END - print("Hello") # selection exclusive - END - - let input_file = "test_selection_exclusive_inline_comment_input.py" - call writefile(lines, input_file, "D") - - let buf = RunVimInTerminal('-c "set selection=exclusive" -c "packadd comment" ' .. input_file, {}) - - call term_sendkeys(buf, "dac") - - let output_file = "test_selection_exclusive_inline_comment.py" - call term_sendkeys(buf, $":w {output_file}\") - defer delete(output_file) - - call StopVimInTerminal(buf) - - let result = readfile(output_file) - call assert_equal(['print("Hello")'], result) -endfunc diff --git a/src/testdir/test_plugin_matchparen.vim b/src/testdir/test_plugin_matchparen.vim index 74563a19..13d6e9e1 100644 --- a/src/testdir/test_plugin_matchparen.vim +++ b/src/testdir/test_plugin_matchparen.vim @@ -177,28 +177,4 @@ func Test_matchparen_ignore_sh_case() call StopVimInTerminal(buf) endfunc -" Test for the WinScrolled event -func Test_scroll_winscrolled() - CheckScreendump - - let lines =<< trim END - source $VIMRUNTIME/plugin/matchparen.vim - set scrolloff=1 - call setline(1, ['foobar {', '', '', '', '}']) - call cursor(5, 1) - END - - let filename = 'Xmatchparen_winscrolled' - call writefile(lines, filename, 'D') - - let buf = RunVimInTerminal('-S '.filename, #{rows: 7}) - call VerifyScreenDump(buf, 'Test_matchparen_winscrolled1', {}) - call term_sendkeys(buf, "\") - call VerifyScreenDump(buf, 'Test_matchparen_winscrolled2', {}) - call term_sendkeys(buf, "\") - call VerifyScreenDump(buf, 'Test_matchparen_winscrolled1', {}) - - call StopVimInTerminal(buf) -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_plugin_tutor.vim b/src/testdir/test_plugin_tutor.vim deleted file mode 100644 index 61cea3fa..00000000 --- a/src/testdir/test_plugin_tutor.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Test for the new-tutor plugin - -func SetUp() - set nocompatible - runtime plugin/tutor.vim -endfunc - -func Test_auto_enable_interactive() - Tutor - call assert_equal('nofile', &buftype) - call assert_match('tutor#EnableInteractive', b:undo_ftplugin) - - edit Xtutor/Xtest.tutor - call assert_true(empty(&buftype)) - call assert_match('tutor#EnableInteractive', b:undo_ftplugin) -endfunc diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index f1fc9600..e599a8d0 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1986,221 +1986,4 @@ func Test_pum_complete_with_special_characters() call StopVimInTerminal(buf) endfunc -func Test_pum_maxwidth() - CheckScreendump - - let lines =<< trim END - 123456789_123456789_123456789_a - 123456789_123456789_123456789_b - 123 - END - call writefile(lines, 'Xtest', 'D') - let buf = RunVimInTerminal('Xtest', {}) - - call term_sendkeys(buf, "G\"zyy") - call term_sendkeys(buf, "A\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_01', {'rows': 8}) - call term_sendkeys(buf, "\3Gdd\"zp") - - call term_sendkeys(buf, ":set pummaxwidth=10\") - call term_sendkeys(buf, "GA\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_02', {'rows': 8}) - call term_sendkeys(buf, "\3Gdd\"zp") - - call term_sendkeys(buf, ":set pummaxwidth=20\") - call term_sendkeys(buf, "GA\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_03', {'rows': 8}) - call term_sendkeys(buf, "\3Gdd\"zp") - - call term_sendkeys(buf, ":set pumwidth=20 pummaxwidth=8\") - call term_sendkeys(buf, "GA\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_04', {'rows': 8}) - call term_sendkeys(buf, "\3Gdd\"zp") - - call term_sendkeys(buf, ":set lines=10 columns=32\") - call TermWait(buf, 50) - call term_sendkeys(buf, "GA\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_05', {'rows': 10, 'cols': 32}) - call term_sendkeys(buf, "\3Gdd\"zp") - - call StopVimInTerminal(buf) -endfunc - -func Test_pum_maxwidth_multibyte() - CheckScreendump - - let lines =<< trim END - let g:change = 0 - func Omni_test(findstart, base) - if a:findstart - return col(".") - endif - if g:change == 0 - return [ - \ #{word: "123456789_123456789_123456789_"}, - \ #{word: "一二三四五六七八ä¹å"}, - \ #{word: "abcdefghij"}, - \ #{word: "上下左å³"}, - \ ] - elseif g:change == 1 - return [ - \ #{word: "foo", menu: "fooMenu", kind: "fooKind"}, - \ #{word: "bar", menu: "barMenu", kind: "barKind"}, - \ #{word: "baz", menu: "bazMenu", kind: "bazKind"}, - \ ] - elseif g:change == 2 - return [ - \ #{word: "foo", menu: "fooMenu", kind: "fooKind"}, - \ #{word: "bar", menu: "fooMenu", kind: "一二三四"}, - \ #{word: "一二三四五", kind: "multi"}, - \ ] - else - return [#{word: "bar", menu: "fooMenu", kind: "一二三"}] - endif - endfunc - set omnifunc=Omni_test - set cot+=menuone - END - call writefile(lines, 'Xtest', 'D') - let buf = RunVimInTerminal('-S Xtest', {}) - call TermWait(buf) - - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_06', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":set pummaxwidth=10\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_07', {'rows': 8}) - call term_sendkeys(buf, "\") - - if has('rightleft') - call term_sendkeys(buf, ":set rightleft\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_08', {'rows': 8}) - call term_sendkeys(buf, "\:set norightleft\") - endif - - call term_sendkeys(buf, ":set pummaxwidth=2\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_09', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":set pummaxwidth=14\") - call term_sendkeys(buf, ":let g:change=1\S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_10', {'rows': 8}) - call term_sendkeys(buf, "\") - - " Unicode Character U+2026 but one cell - call term_sendkeys(buf, ":set fcs+=trunc:…\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_11', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":let g:change=2\S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_12', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":set fcs&\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_13', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":set fcs=trunc:_\") - call term_sendkeys(buf, ":let g:change=1\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_14', {'rows': 8}) - call term_sendkeys(buf, "\") - call term_sendkeys(buf, ":set fcs&\") - - if has('rightleft') - call term_sendkeys(buf, ":set rightleft\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_15', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":let g:change=2\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_16', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":set fcs+=truncrl:…\") - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_17', {'rows': 8}) - call term_sendkeys(buf, "\") - - call term_sendkeys(buf, ":set fcs&\") - call term_sendkeys(buf, ":let g:change=3\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_18', {'rows': 8}) - call term_sendkeys(buf, "\:set norightleft\") - endif - - call term_sendkeys(buf, ":set pummaxwidth=4\") - call term_sendkeys(buf, ":let g:change=2\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_19', {'rows': 8}) - call term_sendkeys(buf, "\") - - if has('rightleft') - call term_sendkeys(buf, ":set rightleft\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_20', {'rows': 8}) - call term_sendkeys(buf, "\:set norightleft\") - endif - - call term_sendkeys(buf, ":set pummaxwidth=16\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_21', {'rows': 8}) - call term_sendkeys(buf, "\") - - if has('rightleft') - call term_sendkeys(buf, ":set rightleft\") - call TermWait(buf, 50) - call term_sendkeys(buf, "S\\") - call VerifyScreenDump(buf, 'Test_pum_maxwidth_22', {'rows': 8}) - call term_sendkeys(buf, "\:set norightleft\") - endif - - call StopVimInTerminal(buf) -endfunc - -func Test_pum_clear_when_switch_tab_or_win() - CheckScreendump - - let lines =<< trim END - inoremap wincmd w - inoremap tabnext - END - - call writefile(lines, 'Xtest', 'D') - let buf = RunVimInTerminal('-S Xtest', {}) - - call term_sendkeys(buf, ":tabe\") - call TermWait(buf, 50) - call term_sendkeys(buf, "Aaa aaa \") - call VerifyScreenDump(buf, 'Test_tabnext_clear_pum_01', {}) - call term_sendkeys(buf, "\") - call TermWait(buf, 50) - call VerifyScreenDump(buf, 'Test_tabnext_clear_pum_02', {}) - call term_sendkeys(buf, "\:tabclose!\") - - call term_sendkeys(buf, ":vnew win_b\") - call TermWait(buf, 50) - call term_sendkeys(buf, "Abb bbb \") - call VerifyScreenDump(buf, 'Test_switchwin_clear_pum_01', {}) - call term_sendkeys(buf, "\") - call TermWait(buf, 50) - call VerifyScreenDump(buf, 'Test_switchwin_clear_pum_02', {}) - - call StopVimInTerminal(buf) -endfunc - - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 3c8e5d71..5082676e 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -148,7 +148,7 @@ func Test_popup_with_border_and_padding() \ lastline: 1, \ scrollbar: 0, \ visible: 1} - let winid = popup_create('hello border', #{line: 2, col: 3, border: []}) + let winid = popup_create('hello border', #{line: 2, col: 3, border: []})", call assert_equal(with_border_or_padding, winid->popup_getpos()) let options = popup_getoptions(winid) call assert_equal([], options.border) diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim index 50e28488..80b5a886 100644 --- a/src/testdir/test_popupwin_textprop.vim +++ b/src/testdir/test_popupwin_textprop.vim @@ -5,9 +5,9 @@ CheckFeature popupwin CheckFeature textprop source screendump.vim +CheckScreendump func Test_textprop_popup() - CheckScreendump let lines =<< trim END call setline(1, range(1, 100)) call setline(50, 'some text to work with') @@ -55,7 +55,6 @@ func Test_textprop_popup() endfunc func Test_textprop_popup_corners() - CheckScreendump let lines =<< trim END call setline(1, range(1, 100)) call setline(50, 'now working with some longer text here') @@ -116,7 +115,6 @@ func Test_textprop_popup_corners() endfunc func Test_textprop_popup_offsets() - CheckScreendump let lines =<< trim END call setline(1, range(1, 100)) call setline(50, 'now working with some longer text here') diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim index 5a99b3b6..26eb7f0e 100644 --- a/src/testdir/test_put.vim +++ b/src/testdir/test_put.vim @@ -248,7 +248,6 @@ func Test_put_visual_block_mode() endfunc func Test_put_other_window() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -268,7 +267,6 @@ func Test_put_other_window() endfunc func Test_put_in_last_displayed_line() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -435,12 +433,4 @@ func Test_put_inserted() bwipe! endfunc -func Test_put_tuple() - new - let t = ('a', 'b', 'c') - put! =t - call assert_equal(['a', 'b', 'c', ''], getline(1, '$')) - bw! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_python2.vim b/src/testdir/test_python2.vim index cafba3de..4ba0f8ef 100644 --- a/src/testdir/test_python2.vim +++ b/src/testdir/test_python2.vim @@ -406,107 +406,6 @@ func Test_python_list() \ 'Vim(python):TypeError: index must be int or slice, not dict') endfunc -" Test for the python Tuple object -func Test_python_tuple() - " Try to convert a null tuple - call AssertException(["py l = vim.eval('test_null_tuple()')"], - \ 'Vim(python):SystemError: error return without exception set') - - " Try to convert a Tuple with a null Tuple item - call AssertException(["py t = vim.eval('(test_null_tuple(),)')"], - \ 'Vim(python):SystemError: error return without exception set') - - " Try to convert a List with a null Tuple item - call AssertException(["py t = vim.eval('[test_null_tuple()]')"], - \ 'Vim(python):SystemError: error return without exception set') - - " Try to convert a Tuple with a null List item - call AssertException(["py t = vim.eval('(test_null_list(),)')"], - \ 'Vim(python):SystemError: error return without exception set') - - " Try to bind a null Tuple variable (works because an empty tuple is used) - let cmds =<< trim END - let t = test_null_tuple() - py tt = vim.bindeval('t') - END - call AssertException(cmds, '') - - " Creating a tuple using different iterators - py t1 = vim.Tuple(['abc', 20, 1.2, (4, 5)]) - call assert_equal(('abc', 20, 1.2, (4, 5)), pyeval('t1')) - py t2 = vim.Tuple('abc') - call assert_equal(('a', 'b', 'c'), pyeval('t2')) - py t3 = vim.Tuple({'color': 'red', 'model': 'ford'}) - call assert_equal(('color', 'model'), pyeval('t3')) - py t4 = vim.Tuple() - call assert_equal((), pyeval('t4')) - py t5 = vim.Tuple(x**2 for x in range(5)) - call assert_equal((0, 1, 4, 9, 16), pyeval('t5')) - py t6 = vim.Tuple(('abc', 20, 1.2, (4, 5))) - call assert_equal(('abc', 20, 1.2, (4, 5)), pyeval('t6')) - - " Convert between Vim tuple/list and python tuple/list - py t = vim.Tuple(vim.bindeval("('a', ('b',), ['c'], {'s': 'd'})")) - call assert_equal(('a', ('b',), ['c'], {'s': 'd'}), pyeval('t')) - call assert_equal(['a', ('b',), ['c'], {'s': 'd'}], pyeval('list(t)')) - call assert_equal(('a', ('b',), ['c'], {'s': 'd'}), pyeval('tuple(t)')) - - py l = vim.List(vim.bindeval("['e', ('f',), ['g'], {'s': 'h'}]")) - call assert_equal(('e', ('f',), ['g'], {'s': 'h'}), pyeval('tuple(l)')) - - " Tuple assignment - py tt = vim.bindeval('("a", "b")') - call AssertException(['py tt[0] = 10'], - \ "Vim(python):TypeError: 'vim.tuple' object does not support item assignment") - py tt = vim.bindeval('("a", "b")') - call AssertException(['py tt[0:1] = (10, 20)'], - \ "Vim(python):TypeError: 'vim.tuple' object does not support item assignment") - - " iterating over tuple from Python - py print([x for x in vim.bindeval("('a', 'b')")]) - - " modifying a list item within a tuple - let t = ('a', ['b', 'c'], 'd') - py vim.bindeval('t')[1][1] = 'x' - call assert_equal(('a', ['b', 'x'], 'd'), t) - - " length of a tuple - let t = () - py p_t = vim.bindeval('t') - call assert_equal(0, pyeval('len(p_t)')) - let t = ('a', ) - py p_t = vim.bindeval('t') - call assert_equal(1, pyeval('len(p_t)')) - let t = ('a', 'b', 'c') - py p_t = vim.bindeval('t') - call assert_equal(3, pyeval('len(p_t)')) - - " membership test - let t = ('a', 'b', 'c') - py p_t = vim.bindeval('t') - call assert_true(pyeval("b'c' in p_t")) - call assert_true(pyeval("b'd' not in p_t")) - - py x = vim.eval('("a", (2), [3], {})') - call assert_equal(('a', '2', ['3'], {}), pyeval('x')) - - " Using a keyword argument for a tuple - call AssertException(['py x = vim.Tuple(a=1)'], - \ 'Vim(python):TypeError: tuple constructor does not accept keyword arguments') - - " Using dict as an index - call AssertException(['py x = tt[{}]'], - \ 'Vim(python):TypeError: index must be int or slice, not dict') - call AssertException(['py x = tt["abc"]'], - \ 'Vim(python):TypeError: index must be int or slice, not str') - - call AssertException(['py del tt.locked'], - \ 'Vim(python):AttributeError: cannot delete vim.Tuple attributes') - - call AssertException(['py tt.foobar = 1'], - \ 'Vim(python):AttributeError: cannot set attribute foobar') -endfunc - " Test for the python Dict object func Test_python_dict() let d = {} @@ -888,24 +787,11 @@ func Test_python_lock_scope_attr() \ 'Vim(python):TypeError: cannot modify fixed list') endfunc -" Test for locking/unlocking a tuple -func Test_tuple_lock() - let t = (1, 2, 3) - py t = vim.bindeval('t') - py t.locked = True - call assert_equal(1, islocked('t')) - py t.locked = False - call assert_equal(0, islocked('t')) -endfunc - " Test for pyeval() func Test_python_pyeval() let l = pyeval('range(3)') call assert_equal([0, 1, 2], l) - let t = pyeval('("a", "b", "c")') - call assert_equal(("a", "b", "c"), t) - let d = pyeval('{"a": "b", "c": 1, "d": ["e"]}') call assert_equal([['a', 'b'], ['c', 1], ['d', ['e']]], sort(items(d))) @@ -926,20 +812,18 @@ func Test_python_pyeval() call AssertException(['let v = pyeval("vim")'], 'E859:') endfunc -" Test for pyeval with locals +" Test for py3eval with locals func Test_python_pyeval_locals() let str = 'a string' let num = 0xbadb33f let d = {'a': 1, 'b': 2, 'c': str} let l = [ str, num, d ] - let t = ( str, num, d ) let locals = #{ \ s: str, \ n: num, \ d: d, \ l: l, - \ t: t, \ } " check basics @@ -947,8 +831,6 @@ func Test_python_pyeval_locals() call assert_equal(0xbadb33f, pyeval('n', locals)) call assert_equal(d, pyeval('d', locals)) call assert_equal(l, pyeval('l', locals)) - call assert_equal(t, pyeval('t', locals)) - call assert_equal('a-b-c', 'b"-".join(t)'->pyeval({'t': ('a', 'b', 'c')})) py << trim EOF def __UpdateDict(d, upd): @@ -1115,92 +997,6 @@ func Test_python_list_slice() \ 'Vim(python):SystemError: error return without exception set') endfunc -" Slice -func Test_python_tuple_slice() - py tt = vim.bindeval('(0, 1, 2, 3, 4, 5)') - py t = tt[:4] - call assert_equal((0, 1, 2, 3), pyeval('t')) - py t = tt[2:] - call assert_equal((2, 3, 4, 5), pyeval('t')) - py t = tt[:-4] - call assert_equal((0, 1), pyeval('t')) - py t = tt[-2:] - call assert_equal((4, 5), pyeval('t')) - py t = tt[2:4] - call assert_equal((2, 3), pyeval('t')) - py t = tt[4:2] - call assert_equal((), pyeval('t')) - py t = tt[-4:-2] - call assert_equal((2, 3), pyeval('t')) - py t = tt[-2:-4] - call assert_equal((), pyeval('t')) - py t = tt[:] - call assert_equal((0, 1, 2, 3, 4, 5), pyeval('t')) - py t = tt[0:6] - call assert_equal((0, 1, 2, 3, 4, 5), pyeval('t')) - py t = tt[-10:10] - call assert_equal((0, 1, 2, 3, 4, 5), pyeval('t')) - py t = tt[4:2:-1] - call assert_equal((4, 3), pyeval('t')) - py t = tt[::2] - call assert_equal((0, 2, 4), pyeval('t')) - py t = tt[4:2:1] - call assert_equal((), pyeval('t')) - - " Error case: Use an invalid index - call AssertException(['py x = tt[-10]'], 'Vim(python):IndexError: tuple index out of range') - - " Use a step value of 0 - call AssertException(['py x = tt[0:3:0]'], - \ 'Vim(python):ValueError: slice step cannot be zero') - - " Error case: Invalid slice type - call AssertException(["py x = tt['abc']"], - \ "Vim(python):TypeError: index must be int or slice, not str") - - " Error case: List with a null tuple item - let t = (test_null_tuple(),) - py tt = vim.bindeval('t') - call AssertException(["py x = tt[:]"], 'Vim(python):SystemError: error return without exception set') -endfunc - -func Test_python_pytuple_to_vimtuple() - let t = pyeval("('a', 'b')") - call assert_equal(('a', 'b'), t) - let t = pyeval("()") - call assert_equal((), t) - let t = pyeval("('x',)") - call assert_equal(('x',), t) - let t = pyeval("((1, 2), (), (3, 4))") - call assert_equal(((1, 2), (), (3, 4)), t) - let t = pyeval("((1, 2), {'a': 10}, [5, 6])") - call assert_equal(((1, 2), {'a': 10}, [5, 6]), t) - - " Invalid python tuple - py << trim END - class FailingIter(object): - def __iter__(self): - raise NotImplementedError('iter') - END - call assert_fails('call pyeval("(1, FailingIter, 2)")', - \ 'E859: Failed to convert returned python object to a Vim value') - - py del FailingIter -endfunc - -" Test for tuple garbage collection -func Test_python_tuple_garbage_collect() - let t = (1, (2, 3), [4, 5], {'a': 6}) - py py_t = vim.bindeval('t') - let save_testing = v:testing - let v:testing = 1 - call test_garbagecollect_now() - let v:testing = save_testing - - let new_t = pyeval('py_t') - call assert_equal((1, (2, 3), [4, 5], {'a': 6}), new_t) -endfunc - " Vars func Test_python_vars() let g:foo = 'bac' @@ -2180,7 +1976,6 @@ func Test_python_dir_method() ('range', vim.current.range), ('dictionary', vim.bindeval('{}')), ('list', vim.bindeval('[]')), - ('tuple', vim.bindeval('()')), ('function', vim.bindeval('function("tr")')), ('output', sys.stdout), ): @@ -2196,7 +1991,6 @@ func Test_python_dir_method() range:__dir__,__members__,append,end,start dictionary:__dir__,__members__,get,has_key,items,keys,locked,pop,popitem,scope,update,values list:__dir__,__members__,extend,locked - tuple:__dir__,__members__,locked function:__dir__,__members__,args,auto_rebind,self,softspace output:__dir__,__members__,close,closed,flush,isatty,readable,seekable,softspace,writable,write,writelines END @@ -2209,9 +2003,7 @@ func Test_python_new() call assert_equal({'a': 1}, pyeval('vim.Dictionary(a=1)')) call assert_equal({'a': 1}, pyeval('vim.Dictionary(((''a'', 1),))')) call assert_equal([], pyeval('vim.List()')) - call assert_equal((), pyeval('vim.Tuple()')) call assert_equal(['a', 'b', 'c', '7'], pyeval('vim.List(iter(''abc7''))')) - call assert_equal(('a', 'b', 'c', '7'), pyeval('vim.Tuple(iter(''abc7''))')) call assert_equal(function('tr'), pyeval('vim.Function(''tr'')')) call assert_equal(function('tr', [123, 3, 4]), \ pyeval('vim.Function(''tr'', args=[123, 3, 4])')) diff --git a/src/testdir/test_python3.vim b/src/testdir/test_python3.vim index e59ddf93..c0449543 100644 --- a/src/testdir/test_python3.vim +++ b/src/testdir/test_python3.vim @@ -8,10 +8,6 @@ func Create_vim_list() return [1] endfunction -func Create_vim_tuple() - return ('a', 'b') -endfunction - func Create_vim_dict() return {'a': 1} endfunction @@ -631,107 +627,6 @@ func Test_python3_list() \ 'Vim(py3):TypeError: index must be int or slice, not dict') endfunc -" Test for the python Tuple object -func Test_python3_tuple() - " Try to convert a null tuple - call AssertException(["py3 l = vim.eval('test_null_tuple()')"], - \ s:system_error_pat) - - " Try to convert a Tuple with a null Tuple item - call AssertException(["py3 t = vim.eval('(test_null_tuple(),)')"], - \ s:system_error_pat) - - " Try to convert a List with a null Tuple item - call AssertException(["py3 t = vim.eval('[test_null_tuple()]')"], - \ s:system_error_pat) - - " Try to convert a Tuple with a null List item - call AssertException(["py3 t = vim.eval('(test_null_list(),)')"], - \ s:system_error_pat) - - " Try to bind a null Tuple variable (works because an empty tuple is used) - let cmds =<< trim END - let t = test_null_tuple() - py3 tt = vim.bindeval('t') - END - call AssertException(cmds, '') - - " Creating a tuple using different iterators - py3 t1 = vim.Tuple(['abc', 20, 1.2, (4, 5)]) - call assert_equal(('abc', 20, 1.2, (4, 5)), py3eval('t1')) - py3 t2 = vim.Tuple('abc') - call assert_equal(('a', 'b', 'c'), py3eval('t2')) - py3 t3 = vim.Tuple({'color': 'red', 'model': 'ford'}) - call assert_equal(('color', 'model'), py3eval('t3')) - py3 t4 = vim.Tuple() - call assert_equal((), py3eval('t4')) - py3 t5 = vim.Tuple(x**2 for x in range(5)) - call assert_equal((0, 1, 4, 9, 16), py3eval('t5')) - py3 t6 = vim.Tuple(('abc', 20, 1.2, (4, 5))) - call assert_equal(('abc', 20, 1.2, (4, 5)), py3eval('t6')) - - " Convert between Vim tuple/list and python tuple/list - py3 t = vim.Tuple(vim.bindeval("('a', ('b',), ['c'], {'s': 'd'})")) - call assert_equal(('a', ('b',), ['c'], {'s': 'd'}), py3eval('t')) - call assert_equal(['a', ('b',), ['c'], {'s': 'd'}], py3eval('list(t)')) - call assert_equal(('a', ('b',), ['c'], {'s': 'd'}), py3eval('tuple(t)')) - - py3 l = vim.List(vim.bindeval("['e', ('f',), ['g'], {'s': 'h'}]")) - call assert_equal(('e', ('f',), ['g'], {'s': 'h'}), py3eval('tuple(l)')) - - " Tuple assignment - py3 tt = vim.bindeval('("a", "b")') - call AssertException(['py3 tt[0] = 10'], - \ "Vim(py3):TypeError: 'vim.tuple' object does not support item assignment") - py3 tt = vim.bindeval('("a", "b")') - call AssertException(['py3 tt[0:1] = (10, 20)'], - \ "Vim(py3):TypeError: 'vim.tuple' object does not support item assignment") - - " iterating over tuple from Python - py3 print([x for x in vim.bindeval("('a', 'b')")]) - - " modifying a list item within a tuple - let t = ('a', ['b', 'c'], 'd') - py3 vim.bindeval('t')[1][1] = 'x' - call assert_equal(('a', ['b', 'x'], 'd'), t) - - " length of a tuple - let t = () - py3 p_t = vim.bindeval('t') - call assert_equal(0, py3eval('len(p_t)')) - let t = ('a', ) - py3 p_t = vim.bindeval('t') - call assert_equal(1, py3eval('len(p_t)')) - let t = ('a', 'b', 'c') - py3 p_t = vim.bindeval('t') - call assert_equal(3, py3eval('len(p_t)')) - - " membership test - let t = ('a', 'b', 'c') - py3 p_t = vim.bindeval('t') - call assert_true(py3eval("b'c' in p_t")) - call assert_true(py3eval("b'd' not in p_t")) - - py3 x = vim.eval('("a", (2), [3], {})') - call assert_equal(('a', '2', ['3'], {}), py3eval('x')) - - " Using a keyword argument for a tuple - call AssertException(['py3 x = vim.Tuple(a=1)'], - \ 'Vim(py3):TypeError: tuple constructor does not accept keyword arguments') - - " Using dict as an index - call AssertException(['py3 x = tt[{}]'], - \ 'Vim(py3):TypeError: index must be int or slice, not dict') - call AssertException(['py3 x = tt["abc"]'], - \ 'Vim(py3):TypeError: index must be int or slice, not str') - - call AssertException(['py3 del tt.locked'], - \ 'Vim(py3):AttributeError: cannot delete vim.Tuple attributes') - - call AssertException(['py3 tt.foobar = 1'], - \ 'Vim(py3):AttributeError: cannot set attribute foobar') -endfunc - " Test for the python Dict object func Test_python3_dict() " Try to convert a null Dict @@ -1110,24 +1005,11 @@ func Test_python3_lock_scope_attr() \ 'Vim(py3):TypeError: cannot modify fixed list') endfunc -" Test for locking/unlocking a tuple -func Test_tuple_lock() - let t = (1, 2, 3) - py3 t = vim.bindeval('t') - py3 t.locked = True - call assert_equal(1, islocked('t')) - py3 t.locked = False - call assert_equal(0, islocked('t')) -endfunc - " Test for py3eval() func Test_python3_pyeval() let l = py3eval('[0, 1, 2]') call assert_equal([0, 1, 2], l) - let t = py3eval('("a", "b", "c")') - call assert_equal(("a", "b", "c"), t) - let d = py3eval('{"a": "b", "c": 1, "d": ["e"]}') call assert_equal([['a', 'b'], ['c', 1], ['d', ['e']]], sort(items(d))) @@ -1154,14 +1036,12 @@ func Test_python3_pyeval_locals() let num = 0xbadb33f let d = {'a': 1, 'b': 2, 'c': str} let l = [ str, num, d ] - let t = ( str, num, d ) let locals = #{ \ s: str, \ n: num, \ d: d, \ l: l, - \ t: t, \ } " check basics @@ -1169,11 +1049,9 @@ func Test_python3_pyeval_locals() call assert_equal(0xbadb33f, py3eval('n', locals)) call assert_equal(d, py3eval('d', locals)) call assert_equal(l, py3eval('l', locals)) - call assert_equal(t, py3eval('t', locals)) call assert_equal('a,b,c', py3eval('b",".join(l)', {'l': ['a', 'b', 'c']})) call assert_equal('hello', 's'->py3eval({'s': 'hello'})) call assert_equal('a,b,c', 'b",".join(l)'->py3eval({'l': ['a', 'b', 'c']})) - call assert_equal('a-b-c', 'b"-".join(t)'->py3eval({'t': ('a', 'b', 'c')})) py3 << trim EOF def __UpdateDict(d, upd): @@ -1340,92 +1218,6 @@ func Test_python3_list_slice() \ s:system_error_pat) endfunc -" Slice -func Test_python3_tuple_slice() - py3 tt = vim.bindeval('(0, 1, 2, 3, 4, 5)') - py3 t = tt[:4] - call assert_equal((0, 1, 2, 3), py3eval('t')) - py3 t = tt[2:] - call assert_equal((2, 3, 4, 5), py3eval('t')) - py3 t = tt[:-4] - call assert_equal((0, 1), py3eval('t')) - py3 t = tt[-2:] - call assert_equal((4, 5), py3eval('t')) - py3 t = tt[2:4] - call assert_equal((2, 3), py3eval('t')) - py3 t = tt[4:2] - call assert_equal((), py3eval('t')) - py3 t = tt[-4:-2] - call assert_equal((2, 3), py3eval('t')) - py3 t = tt[-2:-4] - call assert_equal((), py3eval('t')) - py3 t = tt[:] - call assert_equal((0, 1, 2, 3, 4, 5), py3eval('t')) - py3 t = tt[0:6] - call assert_equal((0, 1, 2, 3, 4, 5), py3eval('t')) - py3 t = tt[-10:10] - call assert_equal((0, 1, 2, 3, 4, 5), py3eval('t')) - py3 t = tt[4:2:-1] - call assert_equal((4, 3), py3eval('t')) - py3 t = tt[::2] - call assert_equal((0, 2, 4), py3eval('t')) - py3 t = tt[4:2:1] - call assert_equal((), py3eval('t')) - - " Error case: Use an invalid index - call AssertException(['py3 x = tt[-10]'], 'Vim(py3):IndexError: tuple index out of range') - - " Use a step value of 0 - call AssertException(['py3 x = tt[0:3:0]'], - \ 'Vim(py3):ValueError: slice step cannot be zero') - - " Error case: Invalid slice type - call AssertException(["py3 x = tt['abc']"], - \ "Vim(py3):TypeError: index must be int or slice, not str") - - " Error case: List with a null tuple item - let t = (test_null_tuple(),) - py3 tt = vim.bindeval('t') - call AssertException(["py3 x = tt[:]"], s:system_error_pat) -endfunc - -func Test_python3_pytuple_to_vimtuple() - let t = py3eval("('a', 'b')") - call assert_equal(('a', 'b'), t) - let t = py3eval("()") - call assert_equal((), t) - let t = py3eval("('x',)") - call assert_equal(('x',), t) - let t = py3eval("((1, 2), (), (3, 4))") - call assert_equal(((1, 2), (), (3, 4)), t) - let t = py3eval("((1, 2), {'a': 10}, [5, 6])") - call assert_equal(((1, 2), {'a': 10}, [5, 6]), t) - - " Invalid python tuple - py3 << trim END - class FailingIter(object): - def __iter__(self): - raise NotImplementedError('iter') - END - call assert_fails('call py3eval("(1, FailingIter, 2)")', - \ 'E859: Failed to convert returned python object to a Vim value') - - py3 del FailingIter -endfunc - -" Test for tuple garbage collection -func Test_python3_tuple_garbage_collect() - let t = (1, (2, 3), [4, 5], {'a': 6}) - py3 py_t = vim.bindeval('t') - let save_testing = v:testing - let v:testing = 1 - call test_garbagecollect_now() - let v:testing = save_testing - - let new_t = py3eval('py_t') - call assert_equal((1, (2, 3), [4, 5], {'a': 6}), new_t) -endfunc - " Vars func Test_python3_vars() let g:foo = 'bac' @@ -2397,7 +2189,6 @@ func Test_python3_dir_method() ('range', vim.current.range), ('dictionary', vim.bindeval('{}')), ('list', vim.bindeval('[]')), - ('tuple', vim.bindeval('()')), ('function', vim.bindeval('function("tr")')), ('output', sys.stdout), ): @@ -2413,7 +2204,6 @@ func Test_python3_dir_method() range:__dir__,append,end,start dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values list:__dir__,extend,locked - tuple:__dir__,locked function:__dir__,args,auto_rebind,self,softspace output:__dir__,close,closed,flush,isatty,readable,seekable,softspace,writable,write,writelines END @@ -2426,9 +2216,7 @@ func Test_python3_new() call assert_equal({'a': 1}, py3eval('vim.Dictionary(a=1)')) call assert_equal({'a': 1}, py3eval('vim.Dictionary(((''a'', 1),))')) call assert_equal([], py3eval('vim.List()')) - call assert_equal((), py3eval('vim.Tuple()')) call assert_equal(['a', 'b', 'c', '7'], py3eval('vim.List(iter(''abc7''))')) - call assert_equal(('a', 'b', 'c', '7'), py3eval('vim.Tuple(iter(''abc7''))')) call assert_equal(function('tr'), py3eval('vim.Function(''tr'')')) call assert_equal(function('tr', [123, 3, 4]), \ py3eval('vim.Function(''tr'', args=[123, 3, 4])')) @@ -4277,7 +4065,6 @@ endfunc " Regression: Iterator for a Vim object should hold a reference. func Test_python3_iter_ref() let g:list_iter_ref_count_increase = -1 - let g:tuple_iter_ref_count_increase = -1 let g:dict_iter_ref_count_increase = -1 let g:bufmap_iter_ref_count_increase = -1 let g:options_iter_ref_count_increase = -1 @@ -4293,12 +4080,6 @@ func Test_python3_iter_ref() for el in v: vim.vars['list_iter_ref_count_increase'] = sys.getrefcount(v) - base_ref_count - create_tuple = vim.Function('Create_vim_tuple') - v = create_tuple() - base_ref_count = sys.getrefcount(v) - for el in v: - vim.vars['tuple_iter_ref_count_increase'] = sys.getrefcount(v) - base_ref_count - create_dict = vim.Function('Create_vim_dict') v = create_dict() base_ref_count = sys.getrefcount(v) @@ -4319,7 +4100,6 @@ func Test_python3_iter_ref() EOF call assert_equal(1, g:list_iter_ref_count_increase) - call assert_equal(1, g:tuple_iter_ref_count_increase) call assert_equal(1, g:dict_iter_ref_count_increase) if py3eval('sys.version_info[:2] < (3, 13)') call assert_equal(1, g:bufmap_iter_ref_count_increase) diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index fe85887e..c382e683 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -43,8 +43,6 @@ func s:setup_commands(cchar) command! -count=1 -nargs=0 Xabove cabove command! -count=1 -nargs=0 Xbefore cbefore command! -count=1 -nargs=0 Xafter cafter - command! -nargs=1 Xsethist set chistory= - command! -nargs=0 Xsethistdefault set chistory& let g:Xgetlist = function('getqflist') let g:Xsetlist = function('setqflist') call setqflist([], 'f') @@ -82,9 +80,6 @@ func s:setup_commands(cchar) command! -count=1 -nargs=0 Xabove labove command! -count=1 -nargs=0 Xbefore lbefore command! -count=1 -nargs=0 Xafter lafter - command! -nargs=1 Xsethist set lhistory= - command! -nargs=1 Xsetlocalhist setlocal lhistory= - command! -nargs=0 Xsethistdefault set lhistory& let g:Xgetlist = function('getloclist', [0]) let g:Xsetlist = function('setloclist', [0]) call setloclist(0, [], 'f') @@ -6723,221 +6718,4 @@ func Test_hardlink_fname() call Xtest_hardlink_fname('l') endfunc -" Test for checking if correct number of tests are deleted -" and current list stays the same after setting Xhistory -" to a smaller number. Do roughly the same for growing the stack. -func Xtest_resize_list_stack(cchar) - call s:setup_commands(a:cchar) - Xsethist 100 - - for i in range(1, 100) - Xexpr string(i) - endfor - Xopen - call assert_equal(g:Xgetlist({'nr': '$'}).nr, 100) - call assert_equal("|| 100", getline(1)) - Xsethist 8 - call assert_equal("|| 100", getline(1)) - Xolder 5 - call assert_equal("|| 95", getline(1)) - Xsethist 6 - call assert_equal("|| 95", getline(1)) - Xsethist 1 - call assert_equal("|| 100", getline(1)) - - " grow array again - Xsethist 100 - for i in range(1, 99) - Xexpr string(i) - endfor - call assert_equal("|| 99", getline(1)) - Xolder 99 - call assert_equal("|| 100", getline(1)) - - Xsethistdefault -endfunc - -func Test_resize_list_stack() - call Xtest_resize_list_stack('c') - call Xtest_resize_list_stack('l') -endfunc - -" Test to check if order of lists is from -" oldest at the bottom to newest at the top -func Xtest_Xhistory_check_order(cchar) - - Xsethist 100 - - for i in range(1, 100) - Xexpr string(i) - endfor - - Xopen - for i in range(100, 1, -1) - let l:ret = assert_equal("|| " .. i, getline(1)) - - if ret == 1 || i == 1 - break - endif - Xolder - endfor - - for i in range(1, 50) - Xexpr string(i) - endfor - - for i in range(50, 1, -1) - let l:ret = assert_equal("|| " .. i, getline(1)) - - if ret == 1 || i == 50 - break - endif - Xolder - endfor - - for i in range(50, 1, -1) - let l:ret = assert_equal("|| " .. i, getline(1)) - - if ret == 1 || i == 50 - break - endif - Xolder - endfor - - Xsethistdefault -endfunc - -func Test_set_history_to_check_order() - call Xtest_Xhistory_check_order('c') - call Xtest_Xhistory_check_order('l') -endfunc - -" Check if 'lhistory' is the same between the location list window -" and associated normal window -func Test_win_and_loc_synced() - new - set lhistory=2 - lexpr "Text" - lopen - - " check if lhistory is synced when modified inside the - " location list window - setlocal lhistory=1 - wincmd k - call assert_equal(&lhistory, 1) - - " check if lhistory is synced when modified inside the - " normal window - setlocal lhistory=10 - lopen - call assert_equal(&lhistory, 10) - - wincmd k - lclose - wincmd q - - set lhistory& -endfunc - -" Test if setting the lhistory of one window doesn't affect the other -func Test_two_win_are_independent_of_history() - setlocal lhistory=10 - new - setlocal lhistory=20 - wincmd w - call assert_equal(&lhistory, 10) - wincmd w - wincmd q - - set lhistory& -endfunc - -" Test if lhistory is copied over to a new window -func Test_lhistory_copied_over() - setlocal lhistory=3 - split - call assert_equal(&lhistory, 3) - wincmd q - - set lhistory& -endfunc - -" Test if error occurs when given invalid history number -func Xtest_invalid_history_num(cchar) - call s:setup_commands(a:cchar) - - call assert_fails('Xsethist -10000', "E1542:") - call assert_fails('Xsethist 10000', "E1543:") - Xsethistdefault -endfunc - -func Test_invalid_history_num() - call Xtest_invalid_history_num('c') - call Xtest_invalid_history_num('l') -endfunc - -" Test if chistory and lhistory don't affect each other -func Test_chi_and_lhi_are_independent() - set chistory=100 - set lhistory=100 - - set chistory=10 - call assert_equal(&lhistory, 100) - - set lhistory=1 - call assert_equal(&chistory, 10) - - set chistory& - set lhistory& -endfunc - -func Test_quickfix_close_buffer_crash() - new - lexpr 'test' | lopen - wincmd k - lclose - wincmd q -endfunc - -func Test_vimgrep_dummy_buffer_crash() - augroup DummyCrash - autocmd! - " Make the dummy buffer non-current, but still open in a window. - autocmd BufReadCmd * ++once let s:dummy_buf = bufnr() - \| split | wincmd p | enew - - " Autocmds from cleaning up the dummy buffer in this case should be blocked. - autocmd BufWipeout * - \ call assert_notequal(s:dummy_buf, str2nr(expand(''))) - augroup END - - silent! vimgrep /./ . - redraw! " Window to freed dummy buffer used to remain; heap UAF. - call assert_equal([], win_findbuf(s:dummy_buf)) - call assert_equal(0, bufexists(s:dummy_buf)) - - unlet! s:dummy_buf - autocmd! DummyCrash - %bw! -endfunc - -func Test_vimgrep_dummy_buffer_keep() - augroup DummyKeep - autocmd! - " Trigger a wipe of the dummy buffer by aborting script processing. Prevent - " wiping it by splitting it from the autocmd window into an only window. - autocmd BufReadCmd * ++once let s:dummy_buf = bufnr() - \| tab split | call interrupt() - augroup END - - call assert_fails('vimgrep /./ .') - call assert_equal(1, bufexists(s:dummy_buf)) - " Ensure it's no longer considered a dummy; should be able to switch to it. - execute s:dummy_buf 'sbuffer' - - unlet! s:dummy_buf - autocmd! DummyKeep - %bw! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim index b597ab32..981f9d22 100644 --- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -1204,13 +1204,4 @@ func Test_mark_from_yank() bw! endfunc -func Test_insert_small_delete_linewise() - new - call setline(1, ['foo']) - call cursor(1, 1) - exe ":norm! \"-cc\-" - call assert_equal(['foo', ''], getline(1, '$')) - bwipe! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 8ec513e0..708aca2a 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -945,7 +945,6 @@ func Test_incsearch_cmdline_modifier() endfunc func Test_incsearch_scrolling() - CheckScreendump CheckRunVimInTerminal call assert_equal(0, &scrolloff) call writefile([ @@ -1542,44 +1541,15 @@ func Test_large_hex_chars2() try /[\Ufffffc1f] catch - call assert_match('E1541:', v:exception) + call assert_match('E486:', v:exception) endtry try set re=1 /[\Ufffffc1f] - catch - call assert_match('E1541:', v:exception) - endtry - set re& -endfunc - -func Test_large_hex_chars3() - " Validate max number of Unicode char - try - /[\UFFFFFFFF] - catch - call assert_match('E1541:', v:exception) - endtry - try - /[\UFFFFFFF] catch call assert_match('E486:', v:exception) endtry - try - /\%#=2[\d32-\UFFFFFFFF] - catch - call assert_match('E1541:', v:exception) - endtry - try - /\%#=1[\UFFFFFFFF] - catch - call assert_match('E1541:', v:exception) - endtry - try - /\%#=1[\d32-\UFFFFFFFF] - catch - call assert_match('E945:', v:exception) - endtry + set re& endfunc func Test_one_error_msg() diff --git a/src/testdir/test_shell.vim b/src/testdir/test_shell.vim index 667b158c..2ac55967 100644 --- a/src/testdir/test_shell.vim +++ b/src/testdir/test_shell.vim @@ -299,18 +299,4 @@ func Test_shell_no_prevcmd() call delete('Xtestdone') endfunc -func Test_shell_filter_buffer_with_nul_bytes() - CheckUnix - new - set noshelltemp - " \n is a NUL byte - let lines = ["aaa\nbbb\nccc\nddd\neee", "fff\nggg\nhhh\niii\njjj"] - call setline(1, lines) - %!cat - call assert_equal(lines, getline(1, '$')) - - set shelltemp& - bwipe! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_signs.vim b/src/testdir/test_signs.vim index e66e6fa0..7f53d62d 100644 --- a/src/testdir/test_signs.vim +++ b/src/testdir/test_signs.vim @@ -1813,7 +1813,6 @@ endfunc " Test for correct cursor position after the sign column appears or disappears. func Test_sign_cursor_position() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2103,23 +2102,4 @@ func Test_sign_null_list() eval test_null_list()->sign_unplacelist() endfunc -func Test_sign_number_without_signtext() - CheckScreendump - CheckRunVimInTerminal - - let lines =<< trim END - set number signcolumn=number - call setline(1, ['a', 'b', 'c']) - sign define SignA text=>> texthl=Search numhl=Error - sign define SignB numhl=Error - sign place 1 line=1 name=SignA buffer=1 - sign place 2 line=2 name=SignB buffer=1 - END - call writefile(lines, 'XtestSigncolumnNumber', 'D') - let buf = RunVimInTerminal('-S XtestSigncolumnNumber', {'rows': 5}) - call VerifyScreenDump(buf, 'Test_sign_number_without_signtext', {}) - - call StopVimInTerminal(buf) -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_source.vim b/src/testdir/test_source.vim index 55b2ffff..3692eee5 100644 --- a/src/testdir/test_source.vim +++ b/src/testdir/test_source.vim @@ -57,7 +57,7 @@ func Test_different_script() call assert_fails('source XtwoScript', 'E121:') endfunc -" When sourcing a Vim script, shebang should be ignored. +" When sourcing a vim script, shebang should be ignored. func Test_source_ignore_shebang() call writefile(['#!./xyzabc', 'let g:val=369'], 'Xsisfile.vim', 'D') source Xsisfile.vim @@ -408,7 +408,7 @@ func Test_source_buffer_vim9() source call assert_equal(10, Xtestfunc()) - " test for sourcing a Vim9 script with line continuation + " test for sourcing a vim9 script with line continuation %d _ let lines =<< trim END vim9script diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim index 0b2b76ad..8052aa88 100644 --- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -781,68 +781,6 @@ func Test_progpath() call assert_match('vim\c', v:progname) endfunc -func Test_stdin_no_newline() - CheckScreendump - CheckUnix - CheckExecutable bash - - let $PS1 = 'TEST_PROMPT> ' - let buf = RunVimInTerminal('', #{rows: 20, cmd: 'bash --noprofile --norc'}) - call TermWait(buf, 100) - - " Write input to temp file - call term_sendkeys(buf, "echo hello > temp.txt\") - call TermWait(buf, 200) - - call term_sendkeys(buf, "bash -c '../vim --not-a-term -u NONE -c \":q!\" -' < temp.txt\") - call TermWait(buf, 200) - - " Capture terminal output - let lines = [] - for i in range(1, term_getsize(buf)[0]) - call add(lines, term_getline(buf, i)) - endfor - - " Find the command line in output - let cmd_line = -1 - for i in range(len(lines)) - if lines[i] =~ '.*vim.*--not-a-term.*' - let cmd_line = i - break - endif - endfor - - if cmd_line == -1 - call assert_report('Command line not found in terminal output') - else - let next_line = -1 - for i in range(cmd_line + 1, len(lines)) - if lines[i] =~ '\S' - let next_line = i - break - endif - endfor - - if next_line == -1 - call assert_report('No prompt found after command execution') - else - call assert_equal(cmd_line + 1, next_line, 'Prompt should be on the immediate next line') - call assert_match('.*TEST_PROMPT>.*', lines[next_line], 'Line should contain the prompt PS1') - endif - endif - - " Clean up temp file and exit shell - call term_sendkeys(buf, "rm -f temp.txt\") - call term_sendkeys(buf, "exit\") - call TermWait(buf, 200) - - if job_status(term_getjob(buf)) ==# 'run' - call StopVimInTerminal(buf) - endif - - unlet $PS1 -endfunc - func Test_silent_ex_mode() " must be able to get the output of Vim. CheckUnix @@ -900,7 +838,6 @@ func Test_issue_3969() endfunc func Test_start_with_tabs() - CheckScreendump CheckRunVimInTerminal let buf = RunVimInTerminal('-p a b c', {}) @@ -1442,7 +1379,7 @@ func Test_cq_zero_exmode() let logfile = 'Xcq_log.txt' let out = system(GetVimCommand() .. ' --clean --log ' .. logfile .. ' -es -X -c "argdelete foobar" -c"7cq"') call assert_equal(8, v:shell_error) - let log = filter(readfile(logfile), {idx, val -> val =~ "E480:"}) + let log = filter(readfile(logfile), {idx, val -> val =~ "E480"}) call assert_match('E480: No match: foobar', log[0]) call delete(logfile) @@ -1453,7 +1390,7 @@ func Test_cq_zero_exmode() else call assert_equal(256, v:shell_error) endif - let log = filter(readfile(logfile), {idx, val -> val =~ "E480:"}) + let log = filter(readfile(logfile), {idx, val -> val =~ "E480"}) call assert_match('E480: No match: foobar', log[0]) call delete('Xcq_log.txt') endfunc diff --git a/src/testdir/test_statusline.vim b/src/testdir/test_statusline.vim index f2204db5..73c3bee2 100644 --- a/src/testdir/test_statusline.vim +++ b/src/testdir/test_statusline.vim @@ -16,10 +16,6 @@ func TearDown() endfunc func s:get_statusline() - if has('gui_running') - redraw! - sleep 1m - endif return ScreenLines(&lines - 1, &columns)[0] endfunc diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim index 21527db5..b25cd608 100644 --- a/src/testdir/test_substitute.vim +++ b/src/testdir/test_substitute.vim @@ -728,7 +728,6 @@ func Test_sub_cmd_9() endfunc func Test_sub_highlight_zero_match() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index d152ec5c..49f88330 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -631,7 +631,6 @@ endfunc " Check highlighting for a small piece of C code with a screen dump. func Test_syntax_c() - CheckScreendump CheckRunVimInTerminal call writefile([ \ '/* comment line at the top */', diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index 0e219e20..1a405670 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -688,7 +688,6 @@ func Test_tabs() endfunc func Test_tabpage_cmdheight() - CheckScreendump CheckRunVimInTerminal call writefile([ \ 'set laststatus=2', diff --git a/src/testdir/test_tagfunc.vim b/src/testdir/test_tagfunc.vim index 96ed1094..d3cd053f 100644 --- a/src/testdir/test_tagfunc.vim +++ b/src/testdir/test_tagfunc.vim @@ -412,24 +412,5 @@ func Test_tagfunc_closes_window() set tagfunc= endfunc -func Test_tagfunc_deletes_lines() - defer delete('Xany') - split Xany - call writefile([''], 'Xtest', 'D') - call setline(1, range(10)) - call cursor(10, 1) - func MytagfuncDel(pat, flags, info) - 9,10d - return [{'name' : 'mytag', 'filename' : 'Xtest', 'cmd' : '1'}] - endfunc - set tagfunc=MytagfuncDel - call taglist('.') - call assert_equal([0, 8, 1, 0], getpos('.')) - norm! ofoobar - call assert_equal(['0', '1', '2', '3', '4', '5', '6', '7', 'foobar'], getline(1, '$')) - - bw! - set tagfunc= -endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_termencoding.vim b/src/testdir/test_termencoding.vim index a45ff847..9b7f487b 100644 --- a/src/testdir/test_termencoding.vim +++ b/src/testdir/test_termencoding.vim @@ -15,7 +15,6 @@ endif " running with 'encoding' "euc-jp". We need to make sure the text is in the " right encoding, this is a bit tricky. func Test_termencoding_euc_jp() - CheckScreendump new call setline(1, 'E89: ãƒãƒƒãƒ•ã‚¡ %ld ã®å¤‰æ›´ã¯ä¿å­˜ã•れã¦ã„ã¾ã›ã‚“ (! ã§å¤‰æ›´ã‚’破棄)') write ++enc=euc-jp Xeuc_jp.txt diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 7476b499..9dbdfdac 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -522,7 +522,6 @@ func Test_terminal_scrollback() endfunc func Test_terminal_postponed_scrollback() - CheckScreendump " tail -f only works on Unix CheckUnix @@ -1299,7 +1298,6 @@ endfunc " Run this first, it fails when run after other tests. func Test_aa_terminal_focus_events() - CheckScreendump CheckNotGui CheckUnix CheckRunVimInTerminal @@ -1477,7 +1475,6 @@ func Test_terminal_open_autocmd() endfunc func Test_open_term_from_cmd() - CheckScreendump CheckUnix CheckRunVimInTerminal @@ -1500,7 +1497,6 @@ func Test_open_term_from_cmd() endfunc func Test_combining_double_width() - CheckScreendump CheckUnix CheckRunVimInTerminal @@ -1670,7 +1666,6 @@ func Test_terminal_dumpload() endfunc func Test_terminal_dumpload_dump() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2173,7 +2168,6 @@ func Test_terminal_ansicolors_default() endfunc func Test_terminal_ansicolors_default_reset_tgc() - CheckScreendump CheckFeature termguicolors CheckRunVimInTerminal @@ -2267,7 +2261,6 @@ func Test_terminal_ansicolors_func() endfunc func Test_terminal_all_ansi_colors() - CheckScreendump CheckRunVimInTerminal " Use all the ANSI colors. diff --git a/src/testdir/test_terminal2.vim b/src/testdir/test_terminal2.vim index 195d0baa..542f2ec5 100644 --- a/src/testdir/test_terminal2.vim +++ b/src/testdir/test_terminal2.vim @@ -245,9 +245,6 @@ func Test_termwinscroll() endfunc func Test_termwinscroll_topline() - " TODO: why does this fail on Appveyor and Github? - CheckNotMSWindows - set termwinscroll=1000 mouse=a terminal call assert_equal(2, winnr('$')) @@ -499,7 +496,6 @@ func Test_terminal_switch_mode() endfunc func Test_terminal_normal_mode() - CheckScreendump CheckRunVimInTerminal " Run Vim in a terminal and open a terminal window to run Vim in. diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim index 64b8ac8a..0e5f70b9 100644 --- a/src/testdir/test_terminal3.vim +++ b/src/testdir/test_terminal3.vim @@ -70,7 +70,6 @@ endfunc " Check a terminal with different colors func Terminal_color(group_name, highlight_cmds, highlight_opt, open_cmds) - CheckScreendump CheckRunVimInTerminal CheckUnix @@ -140,7 +139,6 @@ func Test_terminal_color_wincolor_over_group() endfunc func Test_terminal_color_wincolor_split() - CheckScreendump CheckRunVimInTerminal CheckUnix @@ -248,7 +246,6 @@ func Test_terminal_color_gui_transp_wincolor() endfunc func Test_terminal_in_popup() - CheckScreendump CheckRunVimInTerminal let text =<< trim END @@ -327,7 +324,6 @@ endfunc " Check a terminal in popup window uses the default minimum size. func Test_terminal_in_popup_min_size() - CheckScreendump CheckRunVimInTerminal let text =<< trim END @@ -360,7 +356,6 @@ endfunc " Check a terminal in popup window with different colors func Terminal_in_popup_color(group_name, highlight_cmds, highlight_opt, popup_cmds, popup_opt) - CheckScreendump CheckRunVimInTerminal CheckUnix diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index d26efa94..abc63652 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -1256,7 +1256,6 @@ endfunc func Test_textprop_hl_override() CheckScreendump - CheckRunVimInTerminal let lines =<< trim END call setline(1, ['One one one one one', 'Two two two two two', 'Three three three three']) @@ -1287,7 +1286,6 @@ func Test_textprop_hl_override() endfunc func RunTestVisualBlock(width, dump) - CheckScreendump call writefile([ \ "call setline(1, [" \ .. "'xxxxxxxxx 123 x'," @@ -1994,7 +1992,6 @@ def Test_delete_line_within_multiline_prop() enddef func Test_prop_in_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2020,7 +2017,6 @@ func Test_prop_in_linebreak() endfunc func Test_prop_with_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2040,7 +2036,6 @@ func Test_prop_with_linebreak() endfunc func Test_prop_with_wrap() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2059,7 +2054,6 @@ func Test_prop_with_wrap() endfunc func Test_prop_after_tab() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2076,7 +2070,6 @@ func Test_prop_after_tab() endfunc func Test_prop_before_tab() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2116,7 +2109,6 @@ func Test_prop_before_tab() endfunc func Test_prop_after_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2566,7 +2558,6 @@ func Test_props_do_not_affect_byte_offsets_editline() endfunc func Test_prop_inserts_text() - CheckScreendump CheckRunVimInTerminal " Just a basic check for now @@ -2618,7 +2609,6 @@ func Test_prop_inserts_text() endfunc func Test_prop_inserts_text_highlight() - CheckScreendump CheckRunVimInTerminal " Just a basic check for now @@ -2654,7 +2644,6 @@ func Test_prop_inserts_text_highlight() endfunc func Test_prop_inserts_text_normal_gM() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2672,7 +2661,6 @@ func Test_prop_inserts_text_normal_gM() endfunc func Run_test_prop_inserts_text_normal_gj_gk(cmd) - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2707,7 +2695,6 @@ func Test_prop_inserts_text_normal_gj_gk() endfunc func Test_prop_normal_gj_gk_gM_with_outer_virtual_text() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2750,7 +2737,6 @@ func Test_prop_normal_gj_gk_gM_with_outer_virtual_text() endfunc func Test_prop_inserts_text_visual_block() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2779,7 +2765,6 @@ func Test_prop_inserts_text_visual_block() endfunc func Run_test_prop_inserts_text_showbreak(cmd) - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2853,7 +2838,6 @@ func Test_prop_inserts_text_showbreak() endfunc func Test_prop_before_tab_skipcol() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2891,7 +2875,6 @@ func Test_prop_before_tab_skipcol() endfunc func Test_prop_inserts_text_before_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2911,7 +2894,6 @@ func Test_prop_inserts_text_before_linebreak() endfunc func Test_prop_inserts_text_before_double_width_wrap() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2932,7 +2914,6 @@ func Test_prop_inserts_text_before_double_width_wrap() endfunc func Test_prop_inserts_text_lcs_extends() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2967,7 +2948,6 @@ func Test_prop_add_with_text_fails() endfunc func Test_props_with_text_right_align_twice() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -2993,7 +2973,6 @@ func Test_props_with_text_right_align_twice() endfunc func Test_props_with_text_after() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3025,7 +3004,6 @@ func Test_props_with_text_after() endfunc func Test_props_with_text_after_and_list() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3063,7 +3041,6 @@ func Test_props_with_text_after_and_list() endfunc func Test_props_with_text_after_below_trunc() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3100,7 +3077,6 @@ func Test_props_with_text_after_below_trunc() endfunc func Test_props_with_text_truncated_just_before_after() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3138,7 +3114,6 @@ func Test_props_with_text_truncated_just_before_after() endfunc func Test_prop_with_text_below_after_empty() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3178,7 +3153,6 @@ func Test_prop_with_text_below_after_empty() endfunc func Test_prop_with_text_above_below_empty() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3230,7 +3204,6 @@ func Test_prop_with_text_above_below_empty() endfunc func Test_prop_multiple_lines_above() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3253,7 +3226,6 @@ func Test_prop_multiple_lines_above() endfunc func Test_prop_with_multibyte_above() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3275,7 +3247,6 @@ func Test_prop_with_multibyte_above() endfunc func Test_prop_with_multibyte_below() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3297,7 +3268,6 @@ func Test_prop_with_multibyte_below() endfunc func Test_prop_with_text_below_rightleft() - CheckScreendump CheckRunVimInTerminal CheckFeature rightleft @@ -3315,7 +3285,6 @@ func Test_prop_with_text_below_rightleft() endfunc func Test_prop_with_text_above_empty() - CheckScreendump CheckRunVimInTerminal " check the cursor is in the correct line @@ -3341,7 +3310,6 @@ func Test_prop_with_text_above_empty() endfunc func Test_prop_with_text_below_after_match() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3365,7 +3333,6 @@ func Test_prop_with_text_below_after_match() endfunc func Test_props_with_text_after_joined() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3391,7 +3358,6 @@ func Test_props_with_text_after_joined() endfunc func Test_props_with_text_after_truncated() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3430,7 +3396,6 @@ func Test_props_with_text_after_truncated() endfunc func Test_props_with_text_after_truncated_and_ambiwidth_is_double() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3457,7 +3422,6 @@ endfunc func Test_props_with_text_after_truncated_not_utf8() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3483,7 +3447,6 @@ func Test_props_with_text_after_truncated_not_utf8() endfunc func Test_props_with_text_empty_line() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3517,7 +3480,6 @@ func Test_props_with_text_empty_line() endfunc func Test_props_with_text_after_wraps() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3542,7 +3504,6 @@ func Test_props_with_text_after_wraps() endfunc func Test_props_with_text_after_nowrap() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3576,7 +3537,6 @@ func Test_props_with_text_after_nowrap() endfunc func Test_prop_with_text_below_cul() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3600,7 +3560,6 @@ func Test_prop_with_text_below_cul() endfunc func Test_props_with_text_below_nowrap() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3633,7 +3592,6 @@ func Test_props_with_text_below_nowrap() endfunc func Test_props_with_text_above() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3696,7 +3654,6 @@ func Test_props_with_text_above() endfunc func Test_prop_with_text_above_padding() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3733,7 +3690,6 @@ func Test_prop_above_with_indent() endfunc func Test_prop_above_with_number() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3769,7 +3725,6 @@ func Test_prop_above_with_number() endfunc func Test_prop_above_with_linebreak() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3789,7 +3744,6 @@ func Test_prop_above_with_linebreak() endfunc func Test_prop_above_and_before() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3816,7 +3770,6 @@ func Test_prop_above_and_before() endfunc func Test_prop_below_split_line() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3845,7 +3798,6 @@ func Test_prop_below_split_line() endfunc func Test_prop_above_below_smoothscroll() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3874,7 +3826,6 @@ func Test_prop_above_below_smoothscroll() endfunc func Test_props_with_text_override() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3898,7 +3849,6 @@ func Test_props_with_text_override() endfunc func Test_props_with_text_CursorMoved() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3937,7 +3887,6 @@ func Test_props_with_text_CursorMoved() endfunc func Test_props_with_text_after_split_join() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4007,7 +3956,6 @@ def Test_insert_text_before_virtual_text() enddef func Test_insert_text_start_incl() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4049,7 +3997,6 @@ func Test_insert_text_start_incl() endfunc func Test_insert_text_list_mode() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4079,7 +4026,6 @@ func Test_insert_text_list_mode() endfunc func Test_insert_text_with_padding() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4132,7 +4078,6 @@ func Test_insert_text_with_padding() endfunc func Test_long_text_below_with_padding() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4164,7 +4109,6 @@ func Test_long_text_below_with_padding() endfunc func Test_text_after_nowrap() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4229,7 +4173,6 @@ func Test_text_after_nowrap() endfunc func Test_text_after_nowrap_list() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4266,7 +4209,6 @@ func Test_text_after_nowrap_list() endfunc func Test_text_below_nowrap() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4296,7 +4238,6 @@ func Test_text_below_nowrap() endfunc func Test_virtual_text_overlap_with_highlight() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4337,7 +4278,6 @@ func Test_virtual_text_overlap_with_highlight() endfunc func Test_virtual_text_in_popup_highlight() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4382,7 +4322,6 @@ func Test_virtual_text_in_popup_highlight() endfunc func Test_insert_text_change_arg() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4444,7 +4383,6 @@ def Test_textprop_in_quickfix_window() enddef func Test_text_prop_delete_updates() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4483,7 +4421,6 @@ func Test_text_prop_delete_updates() endfunc func Test_text_prop_diff_mode() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4522,7 +4459,6 @@ func Test_error_when_using_negative_id() endfunc func Test_error_after_using_negative_id() - CheckScreendump " This needs to run a separate Vim instance because the " "did_use_negative_pop_id" will be set. CheckRunVimInTerminal @@ -4559,7 +4495,6 @@ func Test_error_after_using_negative_id() endfunc func Test_modify_text_before_prop() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4582,7 +4517,6 @@ func Test_modify_text_before_prop() endfunc func Test_overlong_textprop_above_crash() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4604,7 +4538,6 @@ func Test_overlong_textprop_above_crash() endfunc func Test_text_prop_list_hl_and_sign_highlight() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -4699,7 +4632,6 @@ func Test_textprop_backspace_fo_aw() endfunc func Test_textprop_with_wincolor() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/src/testdir/test_trycatch.vim b/src/testdir/test_trycatch.vim index 31ac6f89..813ad08b 100644 --- a/src/testdir/test_trycatch.vim +++ b/src/testdir/test_trycatch.vim @@ -1850,7 +1850,7 @@ func T75_R() Xpath 'f' finally Xpath 'g' - if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:' + if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' Xpath 'h' endif break " discard error for $VIMNOERRTHROW @@ -1877,7 +1877,7 @@ func Test_builtin_func_error() Xpath 'k' finally Xpath 'l' - if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:' + if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' Xpath 'm' endif break " discard error for $VIMNOERRTHROW @@ -1896,7 +1896,7 @@ func Test_builtin_func_error() Xpath 'o' finally Xpath 'p' - if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:' + if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' Xpath 'q' endif break " discard error for $VIMNOERRTHROW @@ -1915,7 +1915,7 @@ func Test_builtin_func_error() Xpath 's' finally Xpath 't' - if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:' + if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' Xpath 'u' endif break " discard error for $VIMNOERRTHROW @@ -1938,7 +1938,7 @@ func Test_builtin_func_error() Xpath 'x' finally Xpath 'y' - if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:' + if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' Xpath 'z' endif break " discard error for $VIMNOERRTHROW @@ -1958,7 +1958,7 @@ func Test_builtin_func_error() Xpath 'B' finally Xpath 'C' - if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:' + if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' Xpath 'D' endif call assert_equal('a', x) diff --git a/src/testdir/test_tuple.vim b/src/testdir/test_tuple.vim deleted file mode 100644 index 875031f2..00000000 --- a/src/testdir/test_tuple.vim +++ /dev/null @@ -1,2356 +0,0 @@ -" Tests for the Tuple types - -import './vim9.vim' as v9 - -func TearDown() - " Run garbage collection after every test - call test_garbagecollect_now() -endfunc - -" Tuple declaration -func Test_tuple_declaration() - let lines =<< trim END - var Fn = function('min') - var t = (1, 'a', true, 3.1, 0z10, ['x'], {'a': []}, Fn) - assert_equal((1, 'a', true, 3.1, 0z10, ['x'], {'a': []}, Fn), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - " Multiline tuple declaration - let lines =<< trim END - var t = ( - 'a', - 'b', - ) - assert_equal(('a', 'b'), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - " Tuple declaration with comments - let lines =<< trim END - var t = ( # xxx - # xxx - 'a', # xxx - # xxx - 'b', # xxx - ) # xxx - assert_equal(('a', 'b'), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - " Tuple declaration separated by '|' - let lines =<< trim END - VAR t1 = ('a', 'b') | VAR t2 = ('c', 'd') - call assert_equal(('a', 'b'), t1) - call assert_equal(('c', 'd'), t2) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " Space after and before parens - let lines =<< trim END - var t = ( 1, 2 ) - assert_equal((1, 2), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" Tuple declaration error -func Test_tuple_declaration_error() - let lines =<< trim END - var t: tuple<> = ('a', 'b') - END - call v9.CheckSourceDefAndScriptFailure(lines, "E1008: Missing after > = ('a', 'b')") - - let lines =<< trim END - var t: tuple = ('a', 'b') - END - call v9.CheckSourceDefAndScriptFailure(lines, "E1008: Missing after tuple") - - let lines =<< trim END - var t: tuple = ('a','b') - END - call v9.CheckSourceDefAndScriptFailure(lines, "E1069: White space required after ',': ,'b')") - - let lines =<< trim END - var t: tuple = ('a', 'b','c') - END - call v9.CheckSourceDefAndScriptFailure(lines, "E1069: White space required after ',': ,'c')") - - let lines =<< trim END - var t: tuple = () - END - call v9.CheckSourceDefAndScriptFailure(lines, "E1068: No white space allowed before '<'") - - let lines =<< trim END - var t: tuple - END - call v9.CheckSourceDefAndScriptFailure(lines, "E1069: White space required after ','") - - let lines =<< trim END - var t: tuple - END - call v9.CheckSourceDefFailure(lines, "E1068: No white space allowed before ','") - - let lines =<< trim END - var t = ('a', 'b' , 'c') - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ "E1068: No white space allowed before ','", - \ "E1068: No white space allowed before ','"]) - - let lines =<< trim END - VAR t = ('a', 'b' 'c') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ "E1527: Missing comma in Tuple: 'c')", - \ "E1527: Missing comma in Tuple: 'c')", - \ "E1527: Missing comma in Tuple: 'c')"]) - - let lines =<< trim END - VAR t = ('a', 'b', - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ "E1526: Missing end of Tuple ')'", - \ "E1526: Missing end of Tuple ')'", - \ "E1526: Missing end of Tuple ')'"]) - - let lines =<< trim END - var t: tuple = (1, 2, 3) - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1010: Type not recognized: ', - \ 'E1010: Type not recognized: ']) - - let lines =<< trim END - var t: tuple = (1, 2, 3) - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1539: Variadic tuple must end with a list type: number', - \ 'E1539: Variadic tuple must end with a list type: number']) - - " Invalid expression in the tuple - let lines =<< trim END - def Foo() - var t = (1, 1*2, 2) - enddef - defcompile - END - call v9.CheckSourceDefFailure(lines, 'E1004: White space required before and after ''*'' at "*2, 2)"') - - let lines =<< trim END - VAR t = ('a', , 'b',) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E15: Invalid expression: ", ''b'',)"', - \ "E1068: No white space allowed before ',': , 'b',)", - \ 'E15: Invalid expression: ", ''b'',)"']) - - let lines =<< trim END - VAR t = ('a', 'b', ,) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E15: Invalid expression: ",)"', - \ "E1068: No white space allowed before ',': ,)", - \ 'E15: Invalid expression: ",)"']) - - let lines =<< trim END - VAR t = (, 'a', 'b') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E15: Invalid expression: ", ''a'', ''b'')"', - \ "E1015: Name expected: , 'a', 'b')", - \ 'E15: Invalid expression: ", ''a'', ''b'')"']) - - let lines =<< trim END - var t: tupel = (1,) - END - call v9.CheckSourceDefAndScriptFailure(lines, 'E1010: Type not recognized: tupel') - - let lines =<< trim END - var t: tuple = [1, 2] - END - call v9.CheckSourceDefAndScriptFailure(lines, 'E1012: Type mismatch; expected tuple but got list') -endfunc - -" Test for indexing a tuple -func Test_tuple_indexing() - let lines =<< trim END - VAR t = ('a', 'b', 'c') - call assert_equal(['a', 'b', 'c'], [t[0], t[1], t[2]]) - call assert_equal(['c', 'b', 'a'], [t[-1], t[-2], t[-3]]) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " Indexing a tuple passed as a function argument - let lines =<< trim END - vim9script - def Fn(t: any) - call assert_equal(['a', 'b', 'c'], [t[0], t[1], t[2]]) - call assert_equal(['c', 'b', 'a'], [t[-1], t[-2], t[-3]]) - enddef - Fn(('a', 'b', 'c')) - END - call v9.CheckSourceSuccess(lines) - - let lines =<< trim END - var t: tuple<...list> = (10, 20) - var x: number = t[0] - assert_equal(10, x) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - var t: tuple<...list>> = ([1, 2], [3, 4]) - t[0][1] = 5 - assert_equal(([1, 5], [3, 4]), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - var t: tuple> = ([2, 4],) - t[0][1] = 6 - assert_equal(([2, 6],), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" Indexing a tuple in a Dict -func Test_tuple_in_a_dict_index() - let lines =<< trim END - vim9script - def Fn() - var d = {a: (1, 2)} - var x = d.a[0] - assert_equal('number', typename(x)) - enddef - Fn() - END - call v9.CheckSourceSuccess(lines) -endfunc - -func Test_tuple_index_error() - let lines =<< trim END - echo ('a', 'b', 'c')[3] - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1519: Tuple index out of range: 3', - \ 'E1519: Tuple index out of range: 3', - \ 'E1519: Tuple index out of range: 3']) - - let lines =<< trim END - echo ('a', 'b', 'c')[-4] - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1519: Tuple index out of range: -4', - \ 'E1519: Tuple index out of range: -4', - \ 'E1519: Tuple index out of range: -4']) - - let lines =<< trim END - vim9script - def Fn(t: any) - echo t[3] - enddef - Fn(('a', 'b', 'c')) - END - call v9.CheckSourceFailure(lines, 'E1519: Tuple index out of range: 3') - - let lines =<< trim END - vim9script - def Fn(t: any) - echo t[-4] - enddef - Fn(('a', 'b', 'c')) - END - call v9.CheckSourceFailure(lines, 'E1519: Tuple index out of range: -4') - - let lines =<< trim END - vim9script - def Fn(t: any) - var x = t[0] - enddef - Fn(()) - END - call v9.CheckSourceFailure(lines, 'E1519: Tuple index out of range: 0') - - " Index a null tuple - let lines =<< trim END - VAR t = test_null_tuple() - LET t[0][0] = 10 - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1519: Tuple index out of range: 0', - \ 'E1519: Tuple index out of range: 0', - \ 'E1519: Tuple index out of range: 0']) - - let lines =<< trim END - var x = null_tuple - x[0][0] = 10 - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1519: Tuple index out of range: 0', - \ 'E1519: Tuple index out of range: 0']) - - " Use a float as the index - let lines =<< trim END - VAR t = (1, 2) - VAR x = t[0.1] - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E805: Using a Float as a Number', - \ 'E1012: Type mismatch; expected number but got float', - \ 'E805: Using a Float as a Number']) -endfunc - -" Test for slicing a tuple -func Test_tuple_slice() - let lines =<< trim END - VAR t = (1, 3, 5, 7, 9) - call assert_equal((3, 5), t[1 : 2]) - call assert_equal((9,), t[4 : 4]) - call assert_equal((7, 9), t[3 : 6]) - call assert_equal((1, 3, 5), t[: 2]) - call assert_equal((5, 7, 9), t[2 :]) - call assert_equal((1, 3, 5, 7, 9), t[:]) - call assert_equal((), test_null_tuple()[:]) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - call assert_equal(('b', 'c'), ('a', 'b', 'c')[1 : 5]) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for concatenating tuples -func Test_tuple_concatenate() - let lines =<< trim END - VAR t1 = ('a', 'b') + ('c', 'd') - call assert_equal(('a', 'b', 'c', 'd'), t1) - - VAR t2 = ('a',) + ('b',) - call assert_equal(('a', 'b'), t2) - - VAR t3 = ('a',) + () - call assert_equal(('a',), t3) - - VAR t4 = () + ('b',) - call assert_equal(('b',), t4) - - VAR t5 = ('a', 'b') + test_null_tuple() - call assert_equal(('a', 'b'), t5) - call assert_equal('tuple', typename(t5)) - - VAR t6 = test_null_tuple() + ('c', 'd') - call assert_equal(('c', 'd'), t6) - call assert_equal('tuple', typename(t6)) - - VAR t7 = ('a', 'b') + (8, 9) - call assert_equal(('a', 'b', 8, 9), t7) - call assert_equal('tuple', typename(t7)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - var t1: tuple<...list>> = () - var t2: tuple<...list>> = () - var t: tuple<...list>> = t1 + t2 - assert_equal((), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - var t: tuple<...list> = (1, 2) + ('a', 'b') - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1012: Type mismatch; expected tuple<...list> but got tuple', - \ 'E1012: Type mismatch; expected tuple<...list> but got tuple']) - - let lines =<< trim END - var a: tuple<...list> = (1, 2) - var b: tuple<...list> = ('a', 'b') - var t = a + b - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1540: Cannot use a variadic tuple in concatenation', - \ 'E1540: Cannot use a variadic tuple in concatenation']) - - let lines =<< trim END - var a: tuple<...list> = (1, 2) - var b: tuple = ('a', 'b') - var t = a + b - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1540: Cannot use a variadic tuple in concatenation', - \ 'E1540: Cannot use a variadic tuple in concatenation']) - - let lines =<< trim END - var a: tuple> = (1, 'a', 'b') - var b: tuple> = (2, 'c', 'd') - var t = a + b - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1540: Cannot use a variadic tuple in concatenation', - \ 'E1540: Cannot use a variadic tuple in concatenation']) - - let lines =<< trim END - var a: tuple> = (1, 'a', 'b') - var b: tuple<...list> = ('c', 'd') - var t = a + b - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1540: Cannot use a variadic tuple in concatenation', - \ 'E1540: Cannot use a variadic tuple in concatenation']) - - let lines =<< trim END - var a: tuple<...list> = ('a', 'b') - var b: tuple> = (2, 'c', 'd') - var t = a + b - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1540: Cannot use a variadic tuple in concatenation', - \ 'E1540: Cannot use a variadic tuple in concatenation']) - - let lines =<< trim END - var t1: tuple<...list>> = () - var t2: tuple<...list>> = () - var t = t1 + t2 - END - call v9.CheckSourceDefExecAndScriptFailure(lines, [ - \ 'E1540: Cannot use a variadic tuple in concatenation', - \ 'E1540: Cannot use a variadic tuple in concatenation']) - - " Make sure the correct line number is used in the error message - let lines =<< trim END - vim9script - var t1: tuple<...list>> = () - var t2: tuple<...list>> = () - var t = t1 + t2 - - END - call v9.CheckSourceFailure(lines, 'E1540: Cannot use a variadic tuple in concatenation', 4) - - let lines =<< trim END - vim9script - - def Fn() - var t1: tuple<...list>> = () - var t2: tuple<...list>> = () - var t = t1 + t2 - - enddef - Fn() - END - call v9.CheckSourceFailure(lines, 'E1540: Cannot use a variadic tuple in concatenation', 3) - - " One or both the operands are variadic tuples - let lines =<< trim END - var a1: tuple = (1, 2) - var b1: tuple<...list> = ('a', 'b') - var t1 = a1 + b1 - assert_equal((1, 2, 'a', 'b'), t1) - - var a2: tuple = ('a', 'b') - var b2: tuple> = (1, 'c', 'd') - var t2 = a2 + b2 - assert_equal(('a', 'b', 1, 'c', 'd'), t2) - - var a3: tuple<...list> = ('a', 'b') - var b3: tuple<...list> = ('c', 'd') - var t3 = a3 + b3 - assert_equal(('a', 'b', 'c', 'd'), t3) - - var a4: tuple<...list> = (1, 2) - var t4 = a4 + () - assert_equal((1, 2), t4) - - var b5: tuple<...list> = (1, 2) - var t5 = () + b5 - assert_equal((1, 2), t5) - - var a6: tuple<...list> = (1, 2) - var t6 = a6 + null_tuple - assert_equal((1, 2), t6) - - var b7: tuple<...list> = ('a', 'b') - var t7 = null_tuple + b7 - assert_equal(('a', 'b'), t7) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - VAR t = test_null_tuple() + test_null_tuple() - call assert_equal(test_null_tuple(), t) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - vim9script - def Fn(x: any, y: any): any - return x + y - enddef - assert_equal((1, 2), Fn((1,), (2,))) - assert_equal((1, 'a'), Fn((1,), ('a',))) - assert_equal((1,), Fn((1,), null_tuple)) - assert_equal(('a',), Fn(null_tuple, ('a',))) - assert_equal((), Fn(null_tuple, null_tuple)) - END - call v9.CheckSourceScriptSuccess(lines) - - " Test for concatenating to lists containing tuples - let lines =<< trim END - var x = [test_null_tuple()] + [test_null_tuple()] - assert_equal([(), ()], x) - var y = [()] + [()] - assert_equal([(), ()], y) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" Test for comparing tuples -func Test_tuple_compare() - let lines =<< trim END - call assert_false((1, 2) == (1, 3)) - call assert_true((1, 2) == (1, 2)) - call assert_true((1,) == (1,)) - call assert_true(() == ()) - call assert_false((1, 2) == (1, 2, 3)) - call assert_false((1, 2) == test_null_tuple()) - VAR t1 = (1, 2) - VAR t2 = t1 - call assert_true(t1 == t2) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - echo (1.0, ) == 1.0 - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1517: Can only compare Tuple with Tuple', - \ 'E1072: Cannot compare tuple with float', - \ 'E1072: Cannot compare tuple with float']) - - let lines =<< trim END - echo 1.0 == (1.0,) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1517: Can only compare Tuple with Tuple', - \ 'E1072: Cannot compare float with tuple', - \ 'E1072: Cannot compare float with tuple']) - - let lines =<< trim END - echo (1, 2) =~ [] - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E691: Can only compare List with List', - \ 'E1072: Cannot compare tuple with list', - \ 'E1072: Cannot compare tuple with list']) - - let lines =<< trim END - echo (1, 2) =~ (1, 2) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1518: Invalid operation for Tuple', - \ 'E1518: Invalid operation for Tuple', - \ 'E1518: Invalid operation for Tuple']) -endfunc - -" Test for assigning multiple items from a tuple -func Test_multi_assign_from_tuple() - let lines =<< trim END - VAR [v1, v2] = ('a', 'b') - call assert_equal(['a', 'b'], [v1, v2]) - - VAR [v3] = ('c',) - call assert_equal('c', v3) - - VAR [v4; v5] = ('a', 'b', 'c') - call assert_equal('a', v4) - call assert_equal(('b', 'c'), v5) - - VAR [v6; v7] = ('a',) - call assert_equal('a', v6) - call assert_equal((), v7) - - VAR sum = 0 - for [v8, v9] in ((2, 2), (2, 3)) - LET sum += v8 * v9 - endfor - call assert_equal(10, sum) - - #" for: rest of the items in a List - LET sum = 0 - for [v10; v11] in ((2, 1, 2, 5), (2, 1, 2, 10)) - LET sum += v10 * max(v11) - endfor - call assert_equal(30, sum) - - #" for: one item in the list - LET sum = 0 - for [v12; v13] in ((2, 6), (2, 7)) - LET sum += v12 * max(v13) - endfor - call assert_equal(26, sum) - - #" for: zero items in the list - LET sum = 0 - for [v14; v15] in ((4,), (5,)) - LET sum += v14 + max(v15) - endfor - call assert_equal(9, sum) - - #" A null tuple should be treated like an empty tuple - for [v16, v17] in test_null_tuple() - endfor - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - var t: tuple<...list> = (4, 8) - var [x: number, y: number] = t - assert_equal([4, 8], [x, y]) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - " Test a mix lists and tuples with "any" type - let lines =<< trim END - vim9script - def Fn(x: any): string - var str = '' - for [a, b] in x - str ..= a .. b - endfor - return str - enddef - # List of lists - assert_equal('abcd', Fn([['a', 'b'], ['c', 'd']])) - # List of tuples - assert_equal('abcd', Fn([('a', 'b'), ('c', 'd')])) - # Tuple of lists - assert_equal('abcd', Fn((['a', 'b'], ['c', 'd']))) - # Tuple of tuples - assert_equal('abcd', Fn((('a', 'b'), ('c', 'd')))) - END - call v9.CheckSourceSuccess(lines) - - let lines =<< trim END - VAR [v1, v2] = ('a', 'b', 'c') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1537: Less targets than Tuple items', - \ 'E1093: Expected 2 items but got 3', - \ 'E1537: Less targets than Tuple items']) - - let lines =<< trim END - VAR [v1, v2, v3] = ('a', 'b') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1538: More targets than Tuple items', - \ 'E1093: Expected 3 items but got 2', - \ 'E1538: More targets than Tuple items']) - - let lines =<< trim END - VAR [v1; v2] = test_null_tuple() - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1536: Tuple required', - \ 'E1093: Expected 1 items but got 0', - \ 'E1536: Tuple required']) - - let lines =<< trim END - for [v1, v2] in (('a', 'b', 'c'),) - endfor - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1537: Less targets than Tuple items', - \ 'E1537: Less targets than Tuple items', - \ 'E1537: Less targets than Tuple items']) - - let lines =<< trim END - for [v1, v2] in (('a',),) - endfor - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1538: More targets than Tuple items', - \ 'E1538: More targets than Tuple items', - \ 'E1538: More targets than Tuple items']) - - let lines =<< trim END - for [v1, v2] in (test_null_tuple(),) - endfor - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1536: Tuple required', - \ 'E1538: More targets than Tuple items', - \ 'E1536: Tuple required']) - - let lines =<< trim END - for [v1; v2] in (test_null_tuple(),) - endfor - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1536: Tuple required', - \ 'E1538: More targets than Tuple items', - \ 'E1536: Tuple required']) - - " List assignment errors using a function tuple argument - let lines =<< trim END - vim9script - def Fn(x: tuple<...list>) - var [a, b] = x - enddef - Fn((1, 2, 3)) - END - call v9.CheckSourceFailure(lines, 'E1093: Expected 2 items but got 3') - - let lines =<< trim END - vim9script - def Fn(x: tuple) - var [a, b] = x - enddef - Fn((1,)) - END - call v9.CheckSourceFailure(lines, 'E1093: Expected 2 items but got 1') - - let lines =<< trim END - vim9script - def Fn(x: tuple) - var [a, b] = x - enddef - Fn(null_tuple) - END - call v9.CheckSourceFailure(lines, 'E1093: Expected 2 items but got 0') -endfunc - -" Test for performing an arithmetic operation on multiple variables using -" items from a tuple -func Test_multi_arithmetic_op_from_tuple() - let lines =<< trim END - VAR x = 10 - VAR y = 10 - LET [x, y] += (2, 4) - call assert_equal([12, 14], [x, y]) - LET [x, y] -= (4, 2) - call assert_equal([8, 12], [x, y]) - LET [x, y] *= (2, 3) - call assert_equal([16, 36], [x, y]) - LET [x, y] /= (4, 2) - call assert_equal([4, 18], [x, y]) - LET [x, y] %= (3, 5) - call assert_equal([1, 3], [x, y]) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " The "." operator is supported only in Vim script - let lines =<< trim END - let x = 'a' - let y = 'b' - let [x, y] .= ('a', 'b') - call assert_equal(['aa', 'bb'], [x, y]) - END - call v9.CheckSourceSuccess(lines) - - let lines =<< trim END - VAR x = 'a' - VAR y = 'b' - LET [x, y] ..= ('a', 'b') - call assert_equal(('aa', 'bb'), (x, y)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for using a tuple in a for statement -func Test_tuple_for() - let lines =<< trim END - VAR sum = 0 - for v1 in (1, 3, 5) - LET sum += v1 - endfor - call assert_equal(9, sum) - - LET sum = 0 - for v2 in () - LET sum += v2 - endfor - call assert_equal(0, sum) - - LET sum = 0 - for v2 in test_null_tuple() - LET sum += v2 - endfor - call assert_equal(0, sum) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " ignoring the for loop assignment using '_' - let lines =<< trim END - vim9script - var count = 0 - for _ in (1, 2, 3) - count += 1 - endfor - assert_equal(3, count) - END - call v9.CheckSourceSuccess(lines) - - let lines =<< trim END - var sum = 0 - for v in null_tuple - sum += v - endfor - assert_equal(0, sum) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - vim9script - def Foo() - for x in ((1, 2), (3, 4)) - endfor - enddef - Foo() - END - call v9.CheckSourceSuccess(lines) - - " Test for assigning multiple items from a tuple in a for loop - let lines =<< trim END - vim9script - def Fn() - for [x, y] in ([1, 2],) - assert_equal([1, 2], [x, y]) - endfor - enddef - defcompile - Fn() - END - call v9.CheckSourceSuccess(lines) - - " iterate over tuple<...list - let lines =<< trim END - vim9script - def Fn() - var t: tuple<...list> = (1, 2) - var sum = 0 - for i: number in t - sum += i - endfor - assert_equal(3, sum) - enddef - Fn() - END - call v9.CheckSourceSuccess(lines) - - " iterate over tuple<...list>> - let lines =<< trim END - vim9script - def Fn() - var t: tuple<...list>> = ([1, 2], [3, 4]) - var sum = 0 - for [x: number, y: number] in t - sum += x + y - endfor - assert_equal(10, sum) - enddef - Fn() - END - call v9.CheckSourceSuccess(lines) - - " iterate over tuple<...list>>> - let lines =<< trim END - vim9script - def Fn() - var t: tuple<...list>>> = ((1, 2), (3, 4)) - var sum = 0 - for [x: number, y: number] in t - sum += x + y - endfor - assert_equal(10, sum) - enddef - Fn() - END - call v9.CheckSourceSuccess(lines) - - " iterate over tuple<...list>> - let lines =<< trim END - vim9script - def Fn() - var t: tuple<...list>> = ([1, 2], [3, 4]) - var sum = 0 - for [x: number, y: number] in t - sum += x + y - endfor - assert_equal(10, sum) - enddef - Fn() - END - call v9.CheckSourceSuccess(lines) - - " iterate over a tuple<...list> - let lines =<< trim END - vim9script - def Fn() - var t: tuple<...list> = (1, 'x', true, [], {}, ()) - var str = '' - for v in t - str ..= string(v) - endfor - assert_equal("1'x'true[]{}()", str) - enddef - Fn() - END - call v9.CheckSourceSuccess(lines) - - " use multiple variable assignment syntax with a tuple<...list> - let lines =<< trim END - vim9script - def Fn() - var t: tuple<...list> = (1, 2, 3) - for [i] in t - endfor - enddef - Fn() - END - call v9.CheckSourceFailure(lines, 'E1140: :for argument must be a sequence of lists or tuples', 2) -endfunc - -" Test for checking the tuple type in assignment and return value -func Test_tuple_type_check() - let lines =<< trim END - var t: tuple<...list> = ('a', 'b') - END - call v9.CheckSourceDefFailure(lines, 'E1012: Type mismatch; expected tuple<...list> but got tuple', 1) - - let lines =<< trim END - var t1: tuple<...list> = ('a', 'b') - assert_equal(('a', 'b'), t1) - var t2 = (1, 2) - assert_equal((1, 2), t2) - var t = null_tuple - assert_equal(null_tuple, t) - t = test_null_tuple() - assert_equal(test_null_tuple(), t) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - var t = ('a', 'b') - t = (1, 2) - END - call v9.CheckSourceDefFailure(lines, 'E1012: Type mismatch; expected tuple but got tuple', 2) - - let lines =<< trim END - var t: tuple = [] - END - call v9.CheckSourceDefFailure(lines, 'E1012: Type mismatch; expected tuple but got list', 1) - - let lines =<< trim END - var t: tuple = {} - END - call v9.CheckSourceDefFailure(lines, 'E1012: Type mismatch; expected tuple but got dict', 1) - - let lines =<< trim END - var l: list = (1, 2) - END - call v9.CheckSourceDefFailure(lines, 'E1012: Type mismatch; expected list but got tuple', 1) - - let lines =<< trim END - vim9script - def Fn(): tuple<...list>>> - return ((1, 2), (3, 4)) - enddef - defcompile - END - call v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected tuple<...list>>> but got tuple, tuple>', 1) - - let lines =<< trim END - var t: tuple = () - END - call v9.CheckSourceDefSuccess(lines) - - let lines =<< trim END - vim9script - def Fn(): tuple> - return () - enddef - defcompile - END - call v9.CheckSourceSuccess(lines) - - let lines =<< trim END - vim9script - def Fn(t: tuple<...list>) - enddef - Fn(('a', 'b')) - END - call v9.CheckSourceFailure(lines, 'E1013: Argument 1: type mismatch, expected tuple<...list> but got tuple') - - let lines =<< trim END - var t: any = (1, 2) - t = ('a', 'b') - END - call v9.CheckSourceDefSuccess(lines) - - let lines =<< trim END - var t: tuple<...list> = (1, 2) - t = ('a', 'b') - END - call v9.CheckSourceDefSuccess(lines) - - let lines =<< trim END - var nll: tuple> = ([1, 2],) - nll->copy()[0]->extend(['x']) - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1013: Argument 2: type mismatch, expected list but got list', - \ 'E1013: Argument 2: type mismatch, expected list but got list in extend()']) - - let lines =<< trim END - vim9script - def Fn(y: tuple>) - var x: tuple> - x = y - enddef - - var t: tuple> = (1, true, false) - Fn(t) - END - call v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected tuple> but got tuple>') -endfunc - -" Test for setting the type of a script variable to tuple -func Test_tuple_scriptvar_type() - " Uninitialized script variable should retain the type - let lines =<< trim END - vim9script - var foobar: tuple> - def Foo() - var x = foobar - assert_equal('tuple>', typename(x)) - enddef - Foo() - END - call v9.CheckSourceScriptSuccess(lines) - - " Initialized script variable should retain the type - let lines =<< trim END - vim9script - var foobar: tuple<...list> = ('a', 'b') - def Foo() - var x = foobar - assert_equal('tuple<...list>', typename(x)) - enddef - Foo() - END - call v9.CheckSourceScriptSuccess(lines) -endfunc - -" Test for modifying a tuple -func Test_tuple_modify() - let lines =<< trim END - var t = (1, 2) - t[0] = 3 - END - call v9.CheckSourceDefAndScriptFailure(lines, ['E1532: Cannot modify a tuple', 'E1532: Cannot modify a tuple']) -endfunc - -def Test_using_null_tuple() - var lines =<< trim END - var x = null_tuple - assert_true(x is null_tuple) - var y = copy(x) - assert_true(y is null_tuple) - call assert_true((1, 2) != null_tuple) - call assert_true(null_tuple != (1, 2)) - assert_equal(0, count(null_tuple, 'xx')) - var z = deepcopy(x) - assert_true(z is null_tuple) - assert_equal(1, empty(x)) - assert_equal('xx', get(x, 0, 'xx')) - assert_equal(-1, index(null_tuple, 10)) - assert_equal(-1, indexof(null_tuple, 'v:val == 2')) - assert_equal('', join(null_tuple)) - assert_equal(0, len(x)) - assert_equal(0, min(null_tuple)) - assert_equal(0, max(null_tuple)) - assert_equal((), repeat(null_tuple, 3)) - assert_equal((), reverse(null_tuple)) - assert_equal((), slice(null_tuple, 0, 0)) - assert_equal('()', string(x)) - assert_equal('tuple', typename(x)) - assert_equal(17, type(x)) - END - v9.CheckSourceDefAndScriptSuccess(lines) - - lines =<< trim END - # An uninitialized tuple is not equal to null - var t1: tuple - assert_true(t1 != null) - - # An empty tuple is equal to null_tuple but not equal to null - var t2: tuple = () - assert_true(t2 == null_tuple) - assert_true(t2 != null) - - # null_tuple is equal to null - assert_true(null_tuple == null) - END - v9.CheckSourceDefAndScriptSuccess(lines) - - lines =<< trim END - var x = null_tupel - END - v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1001: Variable not found: null_tupel', - \ 'E121: Undefined variable: null_tupel']) -enddef - -" Test for modifying a mutable item in a tuple -func Test_tuple_modify_mutable_item() - let lines =<< trim END - VAR t = ('a', ['b', 'c'], {'a': 10, 'b': 20}) - LET t[1][1] = 'x' - LET t[2].a = 30 - call assert_equal(('a', ['b', 'x'], {'a': 30, 'b': 20}), t) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - VAR t = ('a', (['b'], 'c')) - LET t[1][0][0] = 'x' - call assert_equal(('a', (['x'], 'c')), t) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " Use a negative index - let lines =<< trim END - VAR t = ([1, 2], [3]) - LET t[-2][-2] = 5 - call assert_equal(([5, 2], [3]), t) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - VAR t = ('a', ('b', 'c')) - LET t[1][0] = 'x' - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple']) - - let lines =<< trim END - VAR t = ['a', ('b', 'c')] - LET t[1][0] = 'x' - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple']) - - let lines =<< trim END - VAR t = {'a': ('b', 'c')} - LET t['a'][0] = 'x' - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple']) - - let lines =<< trim END - VAR t = {'a': ['b', ('c',)]} - LET t['a'][1][0] = 'x' - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple', - \ 'E1532: Cannot modify a tuple']) - - let lines =<< trim END - let t = ('a', 'b', 'c', 'd') - let t[1 : 2] = ('x', 'y') - END - call v9.CheckSourceFailure(lines, 'E1533: Cannot slice a tuple') - - let lines =<< trim END - var t: tuple<...list> = ('a', 'b', 'c', 'd') - t[1 : 2] = ('x', 'y') - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1533: Cannot slice a tuple', - \ 'E1533: Cannot slice a tuple']) - - let lines =<< trim END - var t: tuple<...list> = ('a', 'b', 'c', 'd') - t[ : 2] = ('x', 'y') - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1533: Cannot slice a tuple', - \ 'E1533: Cannot slice a tuple']) - - let lines =<< trim END - let t = ('a', 'b', 'c', 'd') - let t[ : ] = ('x', 'y') - END - call v9.CheckSourceFailure(lines, 'E1533: Cannot slice a tuple') - - let lines =<< trim END - var t: tuple<...list> = ('a', 'b', 'c', 'd') - t[ : ] = ('x', 'y') - END - call v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1533: Cannot slice a tuple', - \ 'E1533: Cannot slice a tuple']) - - let lines =<< trim END - VAR t = ('abc',) - LET t[0][1] = 'x' - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ "E689: Index not allowed after a string: t[0][1] = 'x'", - \ 'E1148: Cannot index a string', - \ "E689: Index not allowed after a string: t[0][1] = 'x'"]) - - " Out of range indexing - let lines =<< trim END - VAR t = ([1, 2], [3]) - LET t[2][0] = 5 - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1519: Tuple index out of range: 2', - \ 'E1519: Tuple index out of range: 2', - \ 'E1519: Tuple index out of range: 2']) - - let lines =<< trim END - VAR t = ([1, 2], [3]) - LET t[-3][0] = 5 - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1519: Tuple index out of range: -3', - \ 'E1519: Tuple index out of range: -3', - \ 'E1519: Tuple index out of range: -3']) - - " Use a null tuple - let lines =<< trim END - VAR t = test_null_tuple() - LET t[0][0] = 5 - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1519: Tuple index out of range: 0', - \ 'E1519: Tuple index out of range: 0', - \ 'E1519: Tuple index out of range: 0']) -endfunc - -" Test for locking and unlocking a tuple variable -func Test_tuple_lock() - " lockvar 0 - let g:t = ([0, 1],) - let lines =<< trim END - lockvar 0 g:t - LET g:t = () - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1122: Variable is locked: g:t', - \ 'E1122: Variable is locked: t', - \ 'E1122: Variable is locked: g:t']) - unlet g:t - - " Tuple is immutable. So "lockvar 1" is not applicable to a tuple. - - " lockvar 2 - let g:t = ([0, 1],) - let lines =<< trim END - lockvar 2 g:t - call add(g:t[0], 2) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E741: Value is locked: add() argument', - \ 'E741: Value is locked: add() argument', - \ 'E741: Value is locked: add() argument']) - unlet g:t - - " lockvar 3 - let g:t = ([0, 1],) - let lines =<< trim END - lockvar 3 g:t - LET g:t[0][0] = 10 - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E741: Value is locked: g:t[0][0] = 10', - \ 'E1119: Cannot change locked list item', - \ 'E741: Value is locked: g:t[0][0] = 10']) - unlet g:t - - let lines =<< trim END - VAR t = ([0, 1],) - lockvar 2 t - call add(t[0], 2) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E741: Value is locked: add() argument', - \ 'E1178: Cannot lock or unlock a local variable', - \ 'E741: Value is locked: add() argument']) - - let lines =<< trim END - LET g:t = ([0, 1],) - lockvar 2 g:t - unlockvar 2 g:t - call add(g:t[0], 3) - call assert_equal(([0, 1, 3], ), g:t) - unlet g:t - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - VAR t1 = (1, 2) - const t2 = t1 - LET t2 = () - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E741: Value is locked: t2', - \ 'E1018: Cannot assign to a constant: t2', - \ 'E46: Cannot change read-only variable "t2"']) -endfunc - -" Test for using a class as a tuple item -func Test_tuple_use_class_item() - let lines =<< trim END - vim9script - class A - endclass - var t = (A,) - END - call v9.CheckSourceScriptFailure(lines, 'E1405: Class "A" cannot be used as a value', 4) - - let lines =<< trim END - vim9script - class A - endclass - var t = ('a', A) - END - call v9.CheckSourceScriptFailure(lines, 'E1405: Class "A" cannot be used as a value', 4) - - let lines =<< trim END - vim9script - class A - endclass - def Fn() - var t = (A,) - enddef - defcompile - END - call v9.CheckSourceScriptFailure(lines, 'E1405: Class "A" cannot be used as a value', 1) - - let lines =<< trim END - vim9script - class A - endclass - def Fn() - var t = ('a', A) - enddef - defcompile - END - call v9.CheckSourceScriptFailure(lines, 'E1405: Class "A" cannot be used as a value', 1) -endfunc - -" Test for using a user-defined type as a tuple item -func Test_tuple_user_defined_type_as_item() - let lines =<< trim END - vim9script - type N = number - var t = (N,) - END - call v9.CheckSourceScriptFailure(lines, 'E1403: Type alias "N" cannot be used as a value', 3) - - let lines =<< trim END - vim9script - type N = number - var t = ('a', N) - END - call v9.CheckSourceScriptFailure(lines, 'E1403: Type alias "N" cannot be used as a value', 3) - - let lines =<< trim END - vim9script - type N = number - def Fn() - var t = (N,) - enddef - defcompile - END - call v9.CheckSourceScriptFailure(lines, 'E1407: Cannot use a Typealias as a variable or value', 1) - - let lines =<< trim END - vim9script - type N = number - def Fn() - var t = ('a', N) - enddef - defcompile - END - call v9.CheckSourceScriptFailure(lines, 'E1407: Cannot use a Typealias as a variable or value', 1) -endfunc - -" Test for using a tuple as a function argument -func Test_tuple_func_arg() - let lines =<< trim END - vim9script - def Fn(t: tuple<...list>): tuple<...list> - return t[:] - enddef - var r1 = Fn(('a', 'b')) - assert_equal(('a', 'b'), r1) - var r2 = Fn(('a',)) - assert_equal(('a',), r2) - var r3 = Fn(()) - assert_equal((), r3) - var r4 = Fn(null_tuple) - assert_equal((), r4) - END - call v9.CheckSourceScriptSuccess(lines) - - func TupleArgFunc(t) - return a:t[:] - endfunc - let r = TupleArgFunc(('a', 'b')) - call assert_equal(('a', 'b'), r) - let r = TupleArgFunc(('a',)) - call assert_equal(('a',), r) - let r = TupleArgFunc(()) - call assert_equal((), r) - let r = TupleArgFunc(test_null_tuple()) - call assert_equal((), r) - delfunc TupleArgFunc -endfunc - -" Test for tuple identity -func Test_tuple_identity() - let lines =<< trim END - call assert_false((1, 2) is (1, 2)) - call assert_true((1, 2) isnot (1, 2)) - call assert_true((1, 2) isnot test_null_tuple()) - VAR t1 = ('abc', 'def') - VAR t2 = t1 - call assert_true(t2 is t1) - VAR t3 = (1, 2) - call assert_false(t3 is t1) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for using a compound op with a tuple -func Test_tuple_compound_op() - let lines =<< trim END - VAR t = (1, 2) - LET t += (3,) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E734: Wrong variable type for +=', - \ 'E734: Wrong variable type for +=', - \ 'E734: Wrong variable type for +=']) - - for op in ['-', '*', '/', '%'] - let lines =<< trim eval END - VAR t = (1, 2) - LET t {op}= (3,) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ $'E734: Wrong variable type for {op}=', - \ $'E734: Wrong variable type for {op}=', - \ $'E734: Wrong variable type for {op}=']) - endfor - - let lines =<< trim END - VAR t = (1, 2) - LET t ..= (3,) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E734: Wrong variable type for .=', - \ 'E1019: Can only concatenate to string', - \ 'E734: Wrong variable type for .=']) -endfunc - -" Test for using the falsy operator with tuple -func Test_tuple_falsy_op() - let lines =<< trim END - VAR t = test_null_tuple() - call assert_equal('null tuple', t ?? 'null tuple') - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for tuple typecasting -def Test_tuple_typecast() - var lines =<< trim END - var x = >('a', 'b') - END - v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1012: Type mismatch; expected tuple but got tuple', - \ 'E1012: Type mismatch; expected tuple but got tuple']) -enddef - -" Test for using a tuple in string interpolation -def Test_tuple_string_interop() - var lines =<< trim END - VAR emptytuple = () - call assert_equal("a()b", $'a{emptytuple}b') - VAR nulltuple = test_null_tuple() - call assert_equal("a()b", $'a{nulltuple}b') - - #" Tuple interpolation - VAR t = ('a', 'b', 'c') - call assert_equal("x('a', 'b', 'c')x", $'x{t}x') - END - v9.CheckSourceLegacyAndVim9Success(lines) - - lines =<< trim END - call assert_equal("a()b", $'a{null_tuple}b') - END - v9.CheckSourceDefAndScriptSuccess(lines) - - #" Tuple evaluation in heredoc - lines =<< trim END - VAR t1 = ('a', 'b', 'c') - VAR data =<< eval trim DATA - let x = {t1} - DATA - call assert_equal(["let x = ('a', 'b', 'c')"], data) - END - v9.CheckSourceLegacyAndVim9Success(lines) - - #" Empty tuple evaluation in heredoc - lines =<< trim END - VAR t1 = () - VAR data =<< eval trim DATA - let x = {t1} - DATA - call assert_equal(["let x = ()"], data) - END - v9.CheckSourceLegacyAndVim9Success(lines) - - #" Null tuple evaluation in heredoc - lines =<< trim END - VAR t1 = test_null_tuple() - VAR data =<< eval trim DATA - let x = {t1} - DATA - call assert_equal(["let x = ()"], data) - END - v9.CheckSourceLegacyAndVim9Success(lines) - - lines =<< trim END - var t1 = null_tuple - var data =<< eval trim DATA - let x = {t1} - DATA - call assert_equal(["let x = ()"], data) - END - v9.CheckSourceDefAndScriptSuccess(lines) -enddef - -" Test for a return in "finally" block overriding the tuple return value in a -" try block. -func Test_try_finally_with_tuple_return() - let lines =<< trim END - func s:Fn() - try - return (1, 2) - finally - return (3, 4) - endtry - endfunc - call assert_equal((3, 4), s:Fn()) - delfunc s:Fn - END - call v9.CheckSourceSuccess(lines) - - let lines =<< trim END - vim9script - def Fn(): tuple<...list> - try - return (1, 2) - finally - return (3, 4) - endtry - enddef - assert_equal((3, 4), Fn()) - END - call v9.CheckSourceSuccess(lines) -endfunc - -" Test for add() with a tuple -func Test_tuple_add() - let lines =<< trim END - VAR t = (1, 2) - call add(t, 3) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E897: List or Blob required', - \ 'E1013: Argument 1: type mismatch, expected list but got tuple', - \ 'E1226: List or Blob required for argument 1']) -endfunc - -" Test for copy() -func Test_tuple_copy() - let lines =<< trim END - VAR t1 = (['a', 'b'], ['c', 'd'], ['e', 'f']) - VAR t2 = copy(t1) - VAR t3 = t1 - call assert_false(t2 is t1) - call assert_true(t3 is t1) - call assert_true(t2[1] is t1[1]) - call assert_equal((), copy(())) - call assert_equal((), copy(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for count() -func Test_tuple_count() - let lines =<< trim END - VAR t = ('ab', 'cd', 'ab') - call assert_equal(2, count(t, 'ab')) - call assert_equal(0, count(t, 'xx')) - call assert_equal(0, count((), 'xx')) - call assert_equal(0, count(test_null_tuple(), 'xx')) - call assert_fails("call count((1, 2), 1, v:true, 2)", 'E1519: Tuple index out of range: 2') - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for deepcopy() -func Test_tuple_deepcopy() - let lines =<< trim END - VAR t1 = (['a', 'b'], ['c', 'd'], ['e', 'f']) - VAR t2 = deepcopy(t1) - VAR t3 = t1 - call assert_false(t2 is t1) - call assert_true(t3 is t1) - call assert_false(t2[1] is t1[1]) - call assert_equal((), deepcopy(())) - call assert_equal((), deepcopy(test_null_tuple())) - - #" copy a recursive tuple - VAR l = [] - VAR tuple = (l,) - call add(l, tuple) - call assert_equal('([(...)], )', string(deepcopy(tuple))) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for empty() -func Test_tuple_empty() - let lines =<< trim END - call assert_true(empty(())) - call assert_true(empty(test_null_tuple())) - call assert_false(empty((1, 2))) - VAR t = ('abc', 'def') - call assert_false(empty(t)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for eval() -func Test_tuple_eval() - let lines =<< trim END - call assert_equal((), eval('()')) - call assert_equal(([],), eval('([],)')) - call assert_equal((1, 2, 3), eval('(1, 2, 3)')) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for extend() with a tuple -func Test_tuple_extend() - let lines =<< trim END - VAR t = (1, 2, 3) - call extend(t, (4, 5)) - call extendnew(t, (4, 5)) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E712: Argument of extend() must be a List or Dictionary', - \ 'E1013: Argument 1: type mismatch, expected list but got tuple', - \ 'E712: Argument of extend() must be a List or Dictionary']) -endfunc - -" Test for filter() with a tuple -func Test_tuple_filter() - let lines =<< trim END - VAR t = (1, 2, 3) - call filter(t, 'v:val == 2') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1524: Cannot use a tuple with function filter()', - \ 'E1013: Argument 1: type mismatch, expected list but got tuple', - \ 'E1524: Cannot use a tuple with function filter()']) -endfunc - -" Test for flatten() with a tuple -func Test_tuple_flatten() - let t = ([1, 2], [3, 4], [5, 6]) - call assert_fails("call flatten(t, 2)", 'E686: Argument of flatten() must be a List') -endfunc - -" Test for flattennew() with a tuple -func Test_tuple_flattennew() - let lines =<< trim END - var t = ([1, 2], [3, 4], [5, 6]) - flattennew(t, 2) - END - call v9.CheckSourceDefFailure(lines, 'E1013: Argument 1: type mismatch, expected list but got tuple, list, list>') -endfunc - -" Test for foreach() with a tuple -func Test_tuple_foreach() - let t = ('a', 'b', 'c') - let str = '' - call foreach(t, 'let str ..= v:val') - call assert_equal('abc', str) - - let sum = 0 - call foreach(test_null_tuple(), 'let sum += v:val') - call assert_equal(0, sum) - - let lines =<< trim END - def Concatenate(k: number, v: string) - g:str ..= v - enddef - var t = ('a', 'b', 'c') - var str = 0 - g:str = '' - call foreach(t, Concatenate) - call assert_equal('abc', g:str) - - g:str = '' - call foreach(test_null_tuple(), Concatenate) - call assert_equal('', g:str) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - let lines =<< trim END - LET g:sum = 0 - call foreach((1, 2, 3), 'LET g:sum += x') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E121: Undefined variable: x', - \ 'E121: Undefined variable: x', - \ 'E121: Undefined variable: x']) -endfunc - -" Test for get() -func Test_tuple_get() - let lines =<< trim END - VAR t = (10, 20, 30) - for [i, v] in [[0, 10], [1, 20], [2, 30], [3, 0]] - call assert_equal(v, get(t, i)) - endfor - - for [i, v] in [[-1, 30], [-2, 20], [-3, 10], [-4, 0]] - call assert_equal(v, get(t, i)) - endfor - call assert_equal(0, get((), 5)) - call assert_equal('c', get(('a', 'b'), 2, 'c')) - call assert_equal('x', get(test_null_tuple(), 0, 'x')) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for id() -func Test_tuple_id() - let lines =<< trim END - VAR t1 = (['a'], ['b'], ['c']) - VAR t2 = (['a'], ['b'], ['c']) - VAR t3 = t1 - call assert_true(id(t1) != id(t2)) - call assert_true(id(t1) == id(t3)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for index() function -func Test_tuple_index_func() - let lines =<< trim END - VAR t = (88, 33, 99, 77) - call assert_equal(3, index(t, 77)) - call assert_equal(2, index(t, 99, 1)) - call assert_equal(2, index(t, 99, -4)) - call assert_equal(2, index(t, 99, -5)) - call assert_equal(-1, index(t, 66)) - call assert_equal(-1, index(t, 77, 4)) - call assert_equal(-1, index((), 8)) - call assert_equal(-1, index(test_null_tuple(), 9)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - VAR t = (88, 33, 99, 77) - call assert_equal(-1, index(t, 77, [])) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E745: Using a List as a Number', - \ 'E1013: Argument 3: type mismatch, expected number but got list', - \ 'E1210: Number required for argument 3']) - - let lines =<< trim END - VAR t = (88,) - call assert_equal(-1, index(t, 77, 1, ())) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1520: Using a Tuple as a Number', - \ 'E1013: Argument 4: type mismatch, expected bool but got tuple', - \ 'E1212: Bool required for argument 4']) -endfunc - -" Test for indexof() -func Test_tuple_indexof() - let lines =<< trim END - VAR t = ('a', 'b', 'c', 'd') - call assert_equal(2, indexof(t, 'v:val =~ "c"')) - call assert_equal(2, indexof(t, 'v:val =~ "c"', {'startidx': 2})) - call assert_equal(-1, indexof(t, 'v:val =~ "c"', {'startidx': 3})) - call assert_equal(2, indexof(t, 'v:val =~ "c"', {'startidx': -3})) - call assert_equal(2, indexof(t, 'v:val =~ "c"', {'startidx': -6})) - call assert_equal(-1, indexof(t, 'v:val =~ "e"')) - call assert_equal(-1, indexof((), 'v:val == 1')) - call assert_equal(-1, indexof(test_null_tuple(), 'v:val == 2')) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - func g:MyIndexOf(k, v) - echoerr 'MyIndexOf failed' - endfunc - let lines =<< trim END - VAR t = (1, 2, 3) - echo indexof(t, function('g:MyIndexOf')) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'MyIndexOf failed', - \ 'MyIndexOf failed', - \ 'MyIndexOf failed']) - delfunc g:MyIndexOf -endfunc - -" Test for insert() -func Test_tuple_insert() - let lines =<< trim END - VAR t = (1, 2, 3) - call insert(t, 4) - call insert(t, 4, 2) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E899: Argument of insert() must be a List or Blob', - \ 'E1013: Argument 1: type mismatch, expected list but got tuple', - \ 'E1226: List or Blob required for argument 1']) -endfunc - -" Test for islocked() -func Test_tuple_islocked() - let lines =<< trim END - let t = (1, [2], 3) - call assert_equal(0, islocked('t')) - call assert_equal(0, islocked('t[1]')) - lockvar 1 t - call assert_equal(1, islocked('t')) - call assert_equal(0, islocked('t[1]')) - unlockvar t - call assert_equal(0, islocked('t')) - lockvar 2 t - call assert_equal(1, islocked('t[1]')) - unlockvar t - call assert_equal(0, islocked('t[1]')) - END - call v9.CheckSourceSuccess(lines) -endfunc - -" Test for items() -func Test_tuple_items() - let lines =<< trim END - VAR t = ([], {}, ()) - call assert_equal([[0, []], [1, {}], [2, ()]], items(t)) - call assert_equal([[0, 1]], items((1, ))) - call assert_equal([], items(())) - call assert_equal([], items(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for join() -func Test_tuple_join() - let lines =<< trim END - VAR t = ('a', 'b', 'c') - call assert_equal('a b c', join(t)) - call assert_equal('f o o', ('f', 'o', 'o')->join()) - call assert_equal('a-b-c', join(t, '-')) - call assert_equal('', join(())) - call assert_equal('', join(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for js_encode() -func Test_tuple_js_encode() - let lines =<< trim END - call assert_equal('["a","b","c"]', js_encode(('a', 'b', 'c'))) - call assert_equal('["a","b"]', js_encode(('a', 'b'))) - call assert_equal('["a"]', js_encode(('a',))) - call assert_equal("[]", js_encode(())) - call assert_equal("[]", js_encode(test_null_tuple())) - call assert_equal('["a",,]', js_encode(('a', v:none))) - - #" encode a recursive tuple - VAR l = [] - VAR tuple = (l,) - call add(l, tuple) - call assert_equal("[[[]]]", js_encode(tuple)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for json_encode() -func Test_tuple_json_encode() - let lines =<< trim END - call assert_equal('["a","b","c"]', json_encode(('a', 'b', 'c'))) - call assert_equal('["a","b"]', json_encode(('a', 'b'))) - call assert_equal('["a"]', json_encode(('a',))) - call assert_equal("[]", json_encode(())) - call assert_equal("[]", json_encode(test_null_tuple())) - - #" encode a recursive tuple - VAR l = [] - VAR tuple = (l,) - call add(l, tuple) - call assert_equal("[[[]]]", json_encode(tuple)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - VAR t = (function('min'), function('max')) - VAR s = json_encode(t) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1161: Cannot json encode a func', - \ 'E1161: Cannot json encode a func', - \ 'E1161: Cannot json encode a func']) -endfunc - -" Test for len() -func Test_tuple_len() - let lines =<< trim END - call assert_equal(0, len(())) - call assert_equal(0, len(test_null_tuple())) - call assert_equal(1, len(("abc",))) - call assert_equal(3, len(("abc", "def", "ghi"))) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for map() with a tuple -func Test_tuple_map() - let t = (1, 3, 5) - call assert_fails("call map(t, 'v:val + 1')", 'E1524: Cannot use a tuple with function map()') -endfunc - -" Test for max() -func Test_tuple_max() - let lines =<< trim END - VAR t1 = (1, 3, 5) - call assert_equal(5, max(t1)) - VAR t2 = (6,) - call assert_equal(6, max(t2)) - call assert_equal(0, max(())) - call assert_equal(0, max(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - vim9script - var x = max(('a', 2)) - END - call v9.CheckSourceFailure(lines, 'E1030: Using a String as a Number: "a"') - - let lines =<< trim END - vim9script - var x = max((1, 'b')) - END - call v9.CheckSourceFailure(lines, 'E1030: Using a String as a Number: "b"') - - let lines =<< trim END - vim9script - def Fn() - var x = max(('a', 'b')) - enddef - Fn() - END - call v9.CheckSourceFailure(lines, 'E1030: Using a String as a Number: "a"') - - let lines =<< trim END - echo max([('a', 'b'), 20]) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1520: Using a Tuple as a Number', - \ 'E1520: Using a Tuple as a Number', - \ 'E1520: Using a Tuple as a Number']) -endfunc - -" Test for min() -func Test_tuple_min() - let lines =<< trim END - VAR t1 = (5, 3, 1) - call assert_equal(1, min(t1)) - VAR t2 = (6,) - call assert_equal(6, min(t2)) - call assert_equal(0, min(())) - call assert_equal(0, min(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - vim9script - var x = min(('a', 2)) - END - call v9.CheckSourceFailure(lines, 'E1030: Using a String as a Number: "a"') - - let lines =<< trim END - vim9script - var x = min((1, 'b')) - END - call v9.CheckSourceFailure(lines, 'E1030: Using a String as a Number: "b"') - - - let lines =<< trim END - vim9script - def Fn() - var x = min(('a', 'b')) - enddef - Fn() - END - call v9.CheckSourceFailure(lines, 'E1030: Using a String as a Number: "a"') -endfunc - -" Test for reduce() -func Test_tuple_reduce() - let lines =<< trim END - call assert_equal(1, reduce((), LSTART acc, val LMIDDLE acc + val LEND, 1)) - call assert_equal(10, reduce((1, 3, 5), LSTART acc, val LMIDDLE acc + val LEND, 1)) - call assert_equal(2 * (2 * ((2 * 1) + 2) + 3) + 4, reduce((2, 3, 4), LSTART acc, val LMIDDLE 2 * acc + val LEND, 1)) - call assert_equal('a x y z', ('x', 'y', 'z')->reduce(LSTART acc, val LMIDDLE acc .. ' ' .. val LEND, 'a')) - - VAR t = ('x', 'y', 'z') - call assert_equal(42, reduce(t, function('get'), {'x': {'y': {'z': 42 } } })) - call assert_equal(('x', 'y', 'z'), t) - call assert_equal(1, reduce((1,), LSTART acc, val LMIDDLE acc + val LEND)) - call assert_equal('x y z', reduce(('x', 'y', 'z'), LSTART acc, val LMIDDLE acc .. ' ' .. val LEND)) - call assert_equal(5, reduce(test_null_tuple(), LSTART acc, val LMIDDLE acc + val LEND, 5)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - call assert_equal({'x': 1, 'y': 1, 'z': 1 }, ('x', 'y', 'z')->reduce({ acc, val -> extend(acc, { val: 1 }) }, {})) - - call assert_fails("call reduce((), { acc, val -> acc + val })", 'E998: Reduce of an empty Tuple with no initial value') - call assert_fails("call reduce(test_null_tuple(), { acc, val -> acc + val })", 'E998: Reduce of an empty Tuple with no initial value') - - let lines =<< trim END - echo reduce((1, 2, 3), LSTART acc, val LMIDDLE acc + foo LEND) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E121: Undefined variable: foo', - \ 'E1001: Variable not found: foo', - \ 'E1001: Variable not found: foo']) -endfunc - -" Test for remove() -func Test_tuple_remove() - let lines =<< trim END - VAR t = (1, 3, 5) - call remove(t, 1) - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E896: Argument of remove() must be a List, Dictionary or Blob', - \ 'E1013: Argument 1: type mismatch, expected list but got tuple', - \ 'E1228: List, Dictionary or Blob required for argument 1']) -endfunc - -" Test for test_refcount() -func Test_tuple_refcount() - let lines =<< trim END - VAR t = (1, 2, 3) - call assert_equal(1, test_refcount(t)) - VAR x = t - call assert_equal(2, test_refcount(t)) - LET x = (4, 5, 6) - call assert_equal(1, test_refcount(t)) - for n in t - call assert_equal(2, test_refcount(t)) - endfor - call assert_equal(1, test_refcount(t)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for repeat() -func Test_tuple_repeat() - let lines =<< trim END - VAR t = ('a', 'b') - call assert_equal(('a', 'b', 'a', 'b', 'a', 'b'), repeat(('a', 'b'), 3)) - call assert_equal(('x', 'x', 'x'), repeat(('x',), 3)) - call assert_equal((), repeat((), 3)) - call assert_equal((), repeat((), 0)) - call assert_equal((), repeat((), -1)) - call assert_equal((), repeat(test_null_tuple(), 3)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for reverse() -func Test_tuple_reverse() - let lines =<< trim END - VAR t = (['a'], ['b'], ['c']) - call assert_equal((['c'], ['b'], ['a']), reverse(t)) - call assert_equal(('a',), reverse(('a',))) - call assert_equal((), reverse(())) - call assert_equal((), reverse(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for slicing a tuple -func Test_tuple_slice_func() - let lines =<< trim END - VAR t = (1, 3, 5, 7, 9) - call assert_equal((9,), slice(t, 4)) - call assert_equal((5, 7, 9), slice(t, 2)) - call assert_equal((), slice(t, 5)) - call assert_equal((), slice((), 1, 2)) - call assert_equal((), slice(test_null_tuple(), 1, 2)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " return value of slice() should be the correct tuple type - let lines =<< trim END - var t: tuple<...list> = (1, 3, 5) - var x: tuple<...list> = slice(t, 1, 2) - assert_equal((3,), x) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" Test for sort() -func Test_tuple_sort() - let lines =<< trim END - call sort([1.1, (1.2,)], 'f') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1521: Using a Tuple as a Float', - \ 'E1521: Using a Tuple as a Float', - \ 'E1521: Using a Tuple as a Float']) -endfunc - -" Test for stridx() -func Test_tuple_stridx() - let lines =<< trim END - call stridx(('abc', ), 'a') - END - call v9.CheckSourceLegacyAndVim9Failure(lines, [ - \ 'E1522: Using a Tuple as a String', - \ 'E1013: Argument 1: type mismatch, expected string but got tuple', - \ 'E1174: String required for argument 1']) -endfunc - -" Test for string() -func Test_tuple_string() - let lines =<< trim END - VAR t1 = (1, 'as''d', [1, 2, function("strlen")], {'a': 1}, ) - call assert_equal("(1, 'as''d', [1, 2, function('strlen')], {'a': 1})", string(t1)) - - #" empty tuple - VAR t2 = () - call assert_equal("()", string(t2)) - - #" one item tuple - VAR t3 = ("a", ) - call assert_equal("('a', )", string(t3)) - - call assert_equal("()", string(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - " recursive tuple - let lines =<< trim END - VAR l = [] - VAR t = (l,) - call add(l, t) - call assert_equal('([(...)], )', string(t)) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for type() -func Test_tuple_type() - let lines =<< trim END - VAR t = (1, 2) - call assert_equal(17, type(t)) - call assert_equal(v:t_tuple, type(t)) - call assert_equal(v:t_tuple, type(())) - call assert_equal(v:t_tuple, type(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) -endfunc - -" Test for typename() -func Test_tuple_typename() - let lines =<< trim END - call assert_equal('tuple', typename((1, 2))) - call assert_equal('tuple', typename(('a', 'b'))) - call assert_equal('tuple', typename((v:true, v:true))) - call assert_equal('tuple', typename((1, 'b'))) - call assert_equal('tuple', typename(())) - call assert_equal('tuple>', typename(({}, ))) - call assert_equal('tuple>', typename(([], ))) - call assert_equal('tuple>', typename(([1, 2], ))) - call assert_equal('tuple>', typename((['a', 'b'], ))) - call assert_equal('tuple>>', typename(([[1], [2]], ))) - call assert_equal('tuple>', typename(((1, 2), ))) - VAR t1 = (([1, 2],), (['a', 'b'],)) - call assert_equal('tuple>, tuple>>', typename(t1)) - call assert_equal('list>', typename([(1,)])) - call assert_equal('list>', typename([()])) - call assert_equal('tuple', typename(test_null_tuple())) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - let lines =<< trim END - var d: dict = {a: 0} - var t2 = (d,) - t2[0].e = {b: t2} - call assert_equal('tuple>', typename(t2)) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - " check the type of a circular reference tuple - let lines =<< trim END - # circular reference tuple - var l: list> = [] - var t = (l,) - add(l, t) - assert_equal('tuple>>', typename(t)) - assert_equal('list>', typename(l)) - END - call v9.CheckSourceDefAndScriptSuccess(lines) - - " When a tuple item is used in a "for" loop, the type is tuple - let lines =<< trim END - vim9script - var l = [(1, 2)] - for t in l - assert_equal('tuple', typename(t)) - endfor - END - call v9.CheckSourceScriptSuccess(lines) - - " type of a tuple copy should be the same - let lines =<< trim END - var t: tuple<...list> = (1, 2) - var x: tuple<...list> = t - assert_equal('tuple<...list>', typename(x)) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" Test for saving and restoring tuples from a viminfo file -func Test_tuple_viminfo() - let viminfo_save = &viminfo - set viminfo^=! - - let g:MYTUPLE = ([1, 2], [3, 4], 'a', 'b', 1, 2) - - " create a tuple with circular reference - " This should not be saved in the viminfo file - let l = [] - let g:CIRCTUPLE = (l,) - call add(l, g:CIRCTUPLE) - - wviminfo! Xviminfo - unlet g:MYTUPLE - unlet g:CIRCTUPLE - rviminfo! Xviminfo - call assert_equal(([1, 2], [3, 4], 'a', 'b', 1, 2), g:MYTUPLE) - call assert_false(exists('g:CIRCTUPLE')) - let &viminfo = viminfo_save - call delete('Xviminfo') -endfunc - -" Test for list2tuple() -func Test_list2tuple() - let lines =<< trim END - call assert_equal((), list2tuple([])) - call assert_equal((), list2tuple(test_null_list())) - call assert_equal(('a', ['b'], {'n': 20}), list2tuple(['a', ['b'], {'n': 20}])) - - VAR l = ['a', 'b'] - VAR t = list2tuple(l) - LET l[0] = 'x' - call assert_equal(('a', 'b'), t) - - call assert_equal((0, 1, 2), list2tuple(range(3))) - - call assert_equal(((),), [()]->list2tuple()) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - call assert_fails('call list2tuple(())', 'E1211: List required for argument 1') - - " Check the returned type - let lines =<< trim END - var l1 = [1, 2] - var t1: tuple<...list> = list2tuple(l1) - assert_equal('tuple<...list>', typename(t1)) - var l2 = ['a', 'b'] - var t2: tuple<...list> = list2tuple(l2) - assert_equal('tuple<...list>', typename(t2)) - var l3 = [] - var t3 = list2tuple(l3) - assert_equal('tuple', typename(t3)) - var l4 = [([{}])] - var t4: tuple>> = list2tuple(l4) - assert_equal('tuple>>', typename(t4)) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" Test for tuple2list() -func Test_tuple2list() - let lines =<< trim END - call assert_equal([], tuple2list(())) - call assert_equal([], tuple2list(test_null_tuple())) - - VAR t1 = ('a', ['b'], {'n': 20}, ('a',)) - call assert_equal(['a', ['b'], {'n': 20}, ('a',)], tuple2list(t1)) - - VAR t = ('a', 'b') - VAR l = tuple2list(t) - LET l[0] = 'x' - call assert_equal(('a', 'b'), t) - - call assert_equal([[]], ([],)->tuple2list()) - END - call v9.CheckSourceLegacyAndVim9Success(lines) - - call assert_fails('call tuple2list([])', 'E1534: Tuple required for argument 1') - - " Check the returned type - let lines =<< trim END - var t1 = (1, 2) - var l1 = tuple2list(t1) - assert_equal('list', typename(l1)) - var t2 = ('a', 'b') - var l2 = tuple2list(t2) - assert_equal('list', typename(l2)) - var t3 = () - var l3 = tuple2list(t3) - assert_equal('list', typename(l3)) - var t4 = ([({},)],) - var l4 = tuple2list(t4) - assert_equal('list>>>', typename(l4)) - END - call v9.CheckSourceDefAndScriptSuccess(lines) -endfunc - -" vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim index af6cefeb..844ba77e 100644 --- a/src/testdir/test_undo.vim +++ b/src/testdir/test_undo.vim @@ -849,7 +849,6 @@ func Test_undo_mark() endfunc func Test_undo_after_write() - CheckScreendump " use a terminal to make undo work like when text is typed CheckRunVimInTerminal diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim index deea5dfa..fe08b958 100644 --- a/src/testdir/test_usercommands.vim +++ b/src/testdir/test_usercommands.vim @@ -326,13 +326,13 @@ func Test_CmdErrors() vim9script com! -complete=file DoCmd : END - call v9.CheckScriptFailure(lines, 'E1208:', 2) + call v9.CheckScriptFailure(lines, 'E1208', 2) let lines =<< trim END vim9script com! -nargs=0 -complete=file DoCmd : END - call v9.CheckScriptFailure(lines, 'E1208:', 2) + call v9.CheckScriptFailure(lines, 'E1208', 2) com! -nargs=0 DoCmd : call assert_fails('DoCmd x', 'E488:') diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim index 61ea0d02..991a0953 100644 --- a/src/testdir/test_utf8.vim +++ b/src/testdir/test_utf8.vim @@ -294,7 +294,6 @@ func Test_getcellwidths() endfunc func Test_setcellwidths_dump() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -312,7 +311,6 @@ endfunc " Test setcellwidths() on characters that are not targets of 'ambiwidth'. func Test_setcellwidths_with_non_ambiwidth_character_dump() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -335,7 +333,6 @@ endfunc " For some reason this test causes Test_customlist_completion() to fail on CI, " so run it as the last test. func Test_zz_ambiwidth_hl_dump() - CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim index 3b083843..616e2249 100644 --- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -326,8 +326,6 @@ def Test_reserved_name() 'null_list', 'null_partial', 'null_string', - 'null_object', - 'null_class', ] + more_names v9.CheckDefExecAndScriptFailure(['var ' .. name .. ' = 0'], 'E1034:') v9.CheckDefExecAndScriptFailure(['var ' .. name .. ': bool'], 'E1034:') @@ -383,7 +381,7 @@ def Test_type_with_extra_white() var lines =<< trim END const x : number = 3 END - v9.CheckDefExecAndScriptFailure(lines, 'E1059:') + v9.CheckDefExecAndScriptFailure(lines, 'E1059') enddef def Test_keep_type_after_assigning_null() @@ -532,15 +530,15 @@ def Test_assign_unpack() lines =<< trim END [v1, v2] = [1, 2] END - v9.CheckDefFailure(lines, 'E1089:', 1) - v9.CheckScriptFailure(['vim9script'] + lines, 'E1089:', 2) + v9.CheckDefFailure(lines, 'E1089', 1) + v9.CheckScriptFailure(['vim9script'] + lines, 'E1089', 2) lines =<< trim END var v1: number var v2: number [v1, v2] = '' END - v9.CheckDefFailure(lines, 'E1535: List or Tuple required', 3) + v9.CheckDefFailure(lines, 'E1012: Type mismatch; expected list but got string', 3) lines =<< trim END g:values = [false, 0] @@ -2499,11 +2497,12 @@ def Test_unlet() assert_false(exists('g:somevar')) unlet! g:somevar - # script-local variable cannot be removed in Vim9 script - s:somevar = 'local' + # also works for script-local variable in legacy Vim script + s:somevar = 'legacy' assert_true(exists('s:somevar')) - v9.CheckDefExecFailure(['unlet s:somevar'], 'E1081:', 1) - v9.CheckDefExecFailure(['unlet! s:somevar'], 'E1081:', 1) + unlet s:somevar + assert_false(exists('s:somevar')) + unlet! s:somevar if 0 unlet g:does_not_exist @@ -2676,21 +2675,13 @@ def Test_unlet() 'enddef', 'defcompile', ], 'E1081:') - v9.CheckScriptSuccess([ + v9.CheckScriptFailure([ 'vim9script', 'var svar = 123', 'func Func()', ' unlet s:svar', 'endfunc', 'Func()', - ]) - v9.CheckScriptFailure([ - 'vim9script', - 'var svar = 123', - 'def Func()', - ' vim9cmd unlet s:svar', - 'enddef', - 'defcompile', ], 'E1081:') v9.CheckScriptFailure([ 'vim9script', diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 2ad4a850..80ed2b23 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -882,7 +882,7 @@ enddef def Test_count() count('ABC ABC ABC', 'b', true)->assert_equal(3) count('ABC ABC ABC', 'b', false)->assert_equal(0) - v9.CheckSourceDefAndScriptFailure(['count(10, 1)'], 'E1225: String, List, Tuple or Dictionary required for argument 1') + v9.CheckSourceDefAndScriptFailure(['count(10, 1)'], 'E1225: String, List or Dictionary required for argument 1') v9.CheckSourceDefAndScriptFailure(['count("a", [1], 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) v9.CheckSourceDefAndScriptFailure(['count("a", [1], 0, "b")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) count([1, 2, 2, 3], 2)->assert_equal(2) @@ -1037,7 +1037,7 @@ def Test_execute() v9.CheckSourceDefAndScriptFailure(['execute(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) v9.CheckSourceDefFailure(['execute([123])'], 'E1013: Argument 1: type mismatch, expected list but got list') - v9.CheckSourceDefExecFailure(['echo execute(["xx", 123])'], 'E492:') + v9.CheckSourceDefExecFailure(['echo execute(["xx", 123])'], 'E492') v9.CheckSourceDefAndScriptFailure(['execute("xx", 123)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef @@ -1530,7 +1530,7 @@ def Test_filter() END v9.CheckSourceScriptSuccess(lines) - v9.CheckSourceDefAndScriptFailure(['filter(1.1, "1")'], ['E1013: Argument 1: type mismatch, expected list but got float', 'E1251: List, Tuple, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['filter(1.1, "1")'], ['E1013: Argument 1: type mismatch, expected list but got float', 'E1251: List, Dictionary, Blob or String required for argument 1']) v9.CheckSourceDefAndScriptFailure(['filter([1, 2], 4)'], ['E1256: String or function required for argument 2', 'E1024: Using a Number as a String']) lines =<< trim END @@ -1647,11 +1647,6 @@ def Test_foldtextresult() assert_equal('', foldtextresult('.')) enddef -def Test_foreach() - CheckFeature job - v9.CheckSourceDefAndScriptFailure(['foreach(test_null_job(), "")'], ['E1013: Argument 1: type mismatch, expected list but got job', 'E1251: List, Tuple, Dictionary, Blob or String required for argument 1']) -enddef - def Test_fullcommand() assert_equal('next', fullcommand('n')) assert_equal('noremap', fullcommand('no')) @@ -1760,8 +1755,7 @@ def Test_garbagecollect() enddef def Test_get() - CheckFeature quickfix - v9.CheckSourceDefAndScriptFailure(['get("a", 1)'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1531: Argument of get() must be a List, Tuple, Dictionary or Blob']) + v9.CheckSourceDefAndScriptFailure(['get("a", 1)'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E896: Argument of get() must be a List, Dictionary or Blob']) [3, 5, 2]->get(1)->assert_equal(5) [3, 5, 2]->get(3)->assert_equal(0) [3, 5, 2]->get(3, 9)->assert_equal(9) @@ -1982,13 +1976,11 @@ def Test_getline() enddef def Test_getloclist() - CheckFeature quickfix v9.CheckSourceDefAndScriptFailure(['getloclist("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) v9.CheckSourceDefAndScriptFailure(['getloclist(1, [])'], ['E1013: Argument 2: type mismatch, expected dict but got list', 'E1206: Dictionary required for argument 2']) enddef def Test_getloclist_return_type() - CheckFeature quickfix var l = getloclist(1) l->assert_equal([]) @@ -2016,13 +2008,11 @@ def Test_getpos() enddef def Test_getqflist() - CheckFeature quickfix v9.CheckSourceDefAndScriptFailure(['getqflist([])'], ['E1013: Argument 1: type mismatch, expected dict but got list', 'E1206: Dictionary required for argument 1']) call assert_equal({}, getqflist({})) enddef def Test_getqflist_return_type() - CheckFeature quickfix var l = getqflist() l->assert_equal([]) @@ -2286,7 +2276,7 @@ enddef def Test_index() index(['a', 'b', 'a', 'B'], 'b', 2, true)->assert_equal(3) - v9.CheckSourceDefAndScriptFailure(['index("a", "a")'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1528: List or Tuple or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['index("a", "a")'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1226: List or Blob required for argument 1']) v9.CheckSourceDefFailure(['index(["1"], 1)'], 'E1013: Argument 2: type mismatch, expected string but got number') v9.CheckSourceDefAndScriptFailure(['index(0z10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) v9.CheckSourceDefAndScriptFailure(['index([1], 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) @@ -2431,7 +2421,7 @@ def Test_instanceof() enddef Bar() END - v9.CheckSourceScriptFailure(lines, 'E1013: Argument 1: type mismatch, expected object but got string') + v9.CheckSourceScriptFailure(lines, 'E1013: Argument 1: type mismatch, expected object but got string') lines =<< trim END vim9script @@ -2549,7 +2539,7 @@ def Test_job_stop() enddef def Test_join() - v9.CheckSourceDefAndScriptFailure(['join("abc")'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1529: List or Tuple required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['join("abc")'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1211: List required for argument 1']) v9.CheckSourceDefAndScriptFailure(['join([], 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) join([''], '')->assert_equal('') enddef @@ -2670,9 +2660,9 @@ enddef def Test_map() if has('channel') - v9.CheckSourceDefAndScriptFailure(['map(test_null_channel(), "1")'], ['E1013: Argument 1: type mismatch, expected list but got channel', 'E1251: List, Tuple, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['map(test_null_channel(), "1")'], ['E1013: Argument 1: type mismatch, expected list but got channel', 'E1251: List, Dictionary, Blob or String required for argument 1']) endif - v9.CheckSourceDefAndScriptFailure(['map(1, "1")'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1251: List, Tuple, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['map(1, "1")'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1251: List, Dictionary, Blob or String required for argument 1']) v9.CheckSourceDefAndScriptFailure(['map([1, 2], 4)'], ['E1256: String or function required for argument 2', 'E1024: Using a Number as a String']) # type of dict remains dict even when type of values changes @@ -2903,9 +2893,9 @@ enddef def Test_mapnew() if has('channel') - v9.CheckSourceDefAndScriptFailure(['mapnew(test_null_job(), "1")'], ['E1013: Argument 1: type mismatch, expected list but got job', 'E1251: List, Tuple, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mapnew(test_null_job(), "1")'], ['E1013: Argument 1: type mismatch, expected list but got job', 'E1251: List, Dictionary, Blob or String required for argument 1']) endif - v9.CheckSourceDefAndScriptFailure(['mapnew(1, "1")'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1251: List, Tuple, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mapnew(1, "1")'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1251: List, Dictionary, Blob or String required for argument 1']) enddef def Test_mapset() @@ -3082,7 +3072,7 @@ def Test_max() ? [1, max([2, 3])] : [4, 5] assert_equal([4, 5], l2) - v9.CheckSourceDefAndScriptFailure(['max(5)'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1530: List or Tuple or Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['max(5)'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1227: List or Dictionary required for argument 1']) enddef def Test_menu_info() @@ -3104,7 +3094,7 @@ def Test_min() ? [1, min([2, 3])] : [4, 5] assert_equal([4, 5], l2) - v9.CheckSourceDefAndScriptFailure(['min(5)'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1530: List or Tuple or Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['min(5)'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1227: List or Dictionary required for argument 1']) enddef def Test_mkdir() @@ -3463,7 +3453,7 @@ def Test_readfile() enddef def Test_reduce() - v9.CheckSourceDefAndScriptFailure(['reduce({a: 10}, "1")'], ['E1013: Argument 1: type mismatch, expected list but got dict', 'E1253: String, List, Tuple or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['reduce({a: 10}, "1")'], ['E1013: Argument 1: type mismatch, expected list but got dict', 'E1252: String, List or Blob required for argument 1']) assert_equal(6, [1, 2, 3]->reduce((r, c) => r + c, 0)) assert_equal(11, 0z0506->reduce((r, c) => r + c, 0)) enddef @@ -3626,8 +3616,8 @@ def Test_rename() enddef def Test_repeat() - v9.CheckSourceDefAndScriptFailure(['repeat(1.1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1301: String, Number, List, Tuple or Blob required for argument 1']) - v9.CheckSourceDefAndScriptFailure(['repeat({a: 10}, 2)'], ['E1013: Argument 1: type mismatch, expected string but got dict<', 'E1301: String, Number, List, Tuple or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['repeat(1.1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1301: String, Number, List or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['repeat({a: 10}, 2)'], ['E1013: Argument 1: type mismatch, expected string but got dict<', 'E1301: String, Number, List or Blob required for argument 1']) var lines =<< trim END assert_equal('aaa', repeat('a', 3)) assert_equal('111', repeat(1, 3)) @@ -3648,7 +3638,7 @@ def Test_resolve() enddef def Test_reverse() - v9.CheckSourceDefAndScriptFailure(['reverse(10)'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1253: String, List, Tuple or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['reverse(10)'], ['E1013: Argument 1: type mismatch, expected list but got number', 'E1252: String, List or Blob required for argument 1']) enddef def Test_reverse_return_type() diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 3ba467b2..1e63f22d 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -564,7 +564,7 @@ def Test_using_null_class() lines =<< trim END vim9script assert_equal(12, type(null_class)) - assert_equal('class', typename(null_class)) + assert_equal('class', typename(null_class)) END v9.CheckSourceSuccess(lines) enddef @@ -643,6 +643,7 @@ def Test_object_not_set() END v9.CheckSourceFailure(lines, 'E1360: Using a null object', 1) + # TODO: this should not give an error but be handled at runtime lines =<< trim END vim9script @@ -659,7 +660,7 @@ def Test_object_not_set() enddef Func() END - v9.CheckSourceFailure(lines, 'E1360: Using a null object', 1) + v9.CheckSourceFailure(lines, 'E1363: Incomplete type', 1) # Reference a object variable through a null class object which is stored in a # variable of type "any". @@ -709,7 +710,7 @@ def Test_null_object_assign_compare() def F(): any return nullo enddef - assert_equal('object', typename(F())) + assert_equal('object', typename(F())) var o0 = F() assert_true(o0 == null_object) @@ -1921,21 +1922,6 @@ def Test_class_member() END v9.CheckSourceFailure(lines, "E1004: White space required before and after '='", 3) - # Space is not allowed before the object member variable name - lines =<< trim END - vim9script - class A - var n: number = 10 - endclass - - def Fn() - var a = A.new() - var y = a. n - enddef - defcompile - END - v9.CheckSourceFailure(lines, "E1202: No white space allowed after '.': . n", 2) - # Access a non-existing member lines =<< trim END vim9script @@ -3484,39 +3470,6 @@ def Test_super_dispatch() assert_equal('A', TestA(C.new())) END v9.CheckSourceSuccess(lines) - - # Invoking a class method in the parent class using "super" should fail - lines =<< trim END - vim9script - - class A - static def Fn(): string - return 'A' - enddef - endclass - - class B extends A - static def Fn(): string - return super.Fn() - enddef - endclass - defcompile - END - v9.CheckSourceFailure(lines, 'E1325: Method "Fn" not found in class "B"') - - # Missing name after "super" keyword - lines =<< trim END - vim9script - class A - endclass - class B extends A - def Fn() - var x = super.() - enddef - endclass - defcompile - END - v9.CheckSourceFailure(lines, 'E1127: Missing name after dot', 1) enddef def Test_class_import() @@ -12502,24 +12455,6 @@ def Test_super_keyword() END v9.CheckSourceSuccess(lines) - # Using 'super' to access an static class variable in the parent should fail - lines =<< trim END - vim9script - - class A - static var foo: string = 'xxx' - endclass - - class B extends A - def GetString(): string - return super.foo - enddef - endclass - - defcompile - END - v9.CheckSourceFailure(lines, 'E1326: Variable "foo" not found in object "B"') - # Using super to access an overriden method in the parent class lines =<< trim END vim9script @@ -12544,613 +12479,6 @@ def Test_super_keyword() assert_equal('A.Foo B.Foo', b.Bar()) END v9.CheckSourceSuccess(lines) - - # Test for using super in a lambda function to invoke a base class method from - # the new() method. - lines =<< trim END - vim9script - - def G(F: func): string - return F() - enddef - - class Base - def F(): string - return 'Base.F()' - enddef - endclass - - class Foo extends Base - var s: string = 'x' - def new() - this.s = G((): string => { - return super.F() - }) - enddef - endclass - - var f = Foo.new() - assert_equal('Base.F()', f.s) - END - v9.CheckSourceSuccess(lines) -enddef - -" Test for using a list of objects -def Test_method_call_from_list_of_objects() - var lines =<< trim END - vim9script - - class A - var n: list = [100, 101] - def F(): string - return 'A.F' - enddef - endclass - - class B - var name: string - var n: list = [200, 201] - def new(this.name) - enddef - def F(): string - return 'B.F' - enddef - endclass - - var obj1 = A.new() - var obj2 = B.new('b1') - - def CheckObjectList() - var objlist = [obj1, obj2] - assert_equal('list>', typename(objlist)) - - # Use a member function - assert_equal('A.F', objlist[0].F()) - assert_equal('B.F', objlist[1].F()) - - # Use a member variable on the RHS - assert_equal([100, 101], objlist[0].n) - assert_equal([200, 201], objlist[1].n) - - # Use a member variable on the LHS - objlist[0].n[1] = 110 - objlist[1].n[1] = 210 - assert_equal([100, 110], objlist[0].n) - assert_equal([200, 210], objlist[1].n) - - # Iterate using a for loop - var s1 = [] - for o in objlist - add(s1, o.F()) - endfor - assert_equal(['A.F', 'B.F'], s1) - - # Iterate using foreach() - var s2 = [] - foreach(objlist, (k, v) => add(s2, v.F())) - assert_equal(['A.F', 'B.F'], s2) - - # Add a new list item - objlist->add(B.new('b2')) - assert_equal('b2', objlist[2].name) - enddef - - CheckObjectList() - - var objlist = [A.new(), B.new('b2')] - assert_equal('list>', typename(objlist)) - - # Use a member function - assert_equal('A.F', objlist[0].F()) - assert_equal('B.F', objlist[1].F()) - - # Use a member variable on the RHS - assert_equal([100, 101], objlist[0].n) - assert_equal([200, 201], objlist[1].n) - - # Use a member variable on the LHS - objlist[0].n[1] = 110 - objlist[1].n[1] = 210 - assert_equal([100, 110], objlist[0].n) - assert_equal([200, 210], objlist[1].n) - - # Iterate using a for loop - var s1 = [] - for o in objlist - add(s1, o.F()) - endfor - assert_equal(['A.F', 'B.F'], s1) - - # Iterate using foreach() - var s2 = [] - foreach(objlist, (k, v) => add(s2, v.F())) - assert_equal(['A.F', 'B.F'], s2) - - # Add a new list item - objlist->add(B.new('b2')) - assert_equal('b2', objlist[2].name) - END - v9.CheckSourceSuccess(lines) - - lines =<< trim END - vim9script - - class A - endclass - - class B - endclass - - var objlist = [A.new(), B.new()] - def Fn() - objlist->add(10) - enddef - - try - Fn() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got number') - endtry - - try - objlist->add(10) - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got number') - endtry - END - v9.CheckSourceSuccess(lines) - - # Adding an enum to a List of objects should fail - lines =<< trim END - vim9script - class A - endclass - class B - endclass - enum C - Red, - Green, - endenum - var items = [A.new(), B.new()] - def Fn() - items->add(C.Red) - enddef - - try - Fn() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got enum') - endtry - - try - items->add(C.Green) - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got enum') - endtry - - var items2 = [C.Red, C.Green] - def Fn2() - items2->add(A.new()) - enddef - try - Fn2() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected enum but got object') - endtry - - try - items2->add(B.new()) - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected enum but got object') - endtry - END - v9.CheckSourceSuccess(lines) -enddef - -" Test for using a dict of objects -def Test_dict_of_objects() - var lines =<< trim END - vim9script - - class A - var n: list = [100, 101] - def F(): string - return 'A.F' - enddef - endclass - - class B - var name: string - var n: list = [200, 201] - def new(this.name) - enddef - def F(): string - return 'B.F' - enddef - endclass - - var obj1 = A.new() - var obj2 = B.new('b1') - - def CheckObjectDict() - var objdict = {o_a: obj1, o_b: obj2} - assert_equal('dict>', typename(objdict)) - - # Use a member function - assert_equal('A.F', objdict.o_a.F()) - assert_equal('B.F', objdict.o_b.F()) - - # Use a member variable on the RHS - assert_equal([100, 101], objdict.o_a.n) - assert_equal([200, 201], objdict.o_b.n) - - # Use a member variable on the LHS - objdict.o_a.n[1] = 110 - objdict.o_b.n[1] = 210 - assert_equal([100, 110], objdict.o_a.n) - assert_equal([200, 210], objdict.o_b.n) - - # Iterate using a for loop - var l = [] - for v in values(objdict) - add(l, v.F()) - endfor - assert_equal(['A.F', 'B.F'], l) - - # Iterate using foreach() - l = [] - foreach(objdict, (k, v) => add(l, v.F())) - assert_equal(['A.F', 'B.F'], l) - - # Add a new dict item - objdict['o_b2'] = B.new('b2') - assert_equal('b2', objdict.o_b2.name) - enddef - - CheckObjectDict() - - var objdict = {o_a: A.new(), o_b: B.new('b2')} - assert_equal('dict>', typename(objdict)) - assert_equal('A.F', objdict.o_a.F()) - assert_equal('B.F', objdict.o_b.F()) - assert_equal([100, 101], objdict.o_a.n) - assert_equal([200, 201], objdict.o_b.n) - - var l = [] - for v in values(objdict) - add(l, v.F()) - endfor - assert_equal(['A.F', 'B.F'], l) - - # Add a new dict item - objdict['o_b2'] = B.new('b2') - assert_equal('b2', objdict.o_b2.name) - END - v9.CheckSourceSuccess(lines) - - lines =<< trim END - vim9script - - class A - endclass - class B - endclass - class C - endclass - var objdict = {a: A.new(), b: B.new()} - def Fn() - objdict['c'] = C.new() - enddef - - try - Fn() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got number') - endtry - - try - objdict['c'] = C.new() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got number') - endtry - END - v9.CheckSourceSuccess(lines) - - # Adding an enum to a Dict of objects should fail - lines =<< trim END - vim9script - class A - endclass - class B - endclass - enum C - Red, - Green, - endenum - var items = {o_a: A.new(), o_b: B.new()} - def Fn() - items['o_c'] = C.Red - enddef - - try - Fn() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected object but got enum') - endtry - - try - items['o_c'] = C.Green - catch - assert_exception('Vim(var):E1012: Type mismatch; expected object but got enum') - endtry - - var items2 = {red: C.Red, green: C.Green} - def Fn2() - items2['o_a'] = A.new() - enddef - try - Fn2() - catch - assert_exception('Vim(eval):E1012: Type mismatch; expected enum but got object') - endtry - - try - items2['o_a'] = B.new() - catch - assert_exception('Vim(var):E1012: Type mismatch; expected enum but got object') - endtry - END - v9.CheckSourceSuccess(lines) -enddef - -" Test for using the type() and typename() functions with a variable of type -" object -def Test_type_typename_funcs_with_object_variable() - var lines =<< trim END - vim9script - - class A - endclass - - class B - endclass - - var o1: object - assert_equal([13, 'object'], [type(o1), typename(o1)]) - - var o2: object - assert_equal([13, 'object'], [type(o2), typename(o2)]) - - var o3: A - assert_equal([13, 'object'], [type(o3), typename(o3)]) - - var o4 = A.new() - assert_equal([13, 'object'], [type(o4), typename(o4)]) - - var l = [A.new(), B.new()] - assert_equal([13, 'object'], [type(l[1]), typename(l[1])]) - - var d = {o_a: A.new(), o_b: B.new()} - assert_equal([13, 'object'], [type(d.o_b), typename(d.o_b)]) - END - v9.CheckSourceSuccess(lines) -enddef - -" Test for object type -def Test_object_any_type() - # assigning different objects to variable of type object - var lines =<< trim END - vim9script - class A - endclass - class B - endclass - var x: object - x = A.new() - assert_true(instanceof(x, A)) - x = B.new() - assert_true(instanceof(x, B)) - x = null_object - assert_true(instanceof(x, null_class)) - END - v9.CheckSourceSuccess(lines) - - # Use a list of object variable - lines =<< trim END - vim9script - class A - endclass - class B - endclass - var l: list> - l->add(A.new()) - l->add(B.new()) - assert_true(instanceof(l[0], A)) - assert_true(instanceof(l[1], B)) - END - v9.CheckSourceSuccess(lines) - - # Using object as a function argument type and the return type - lines =<< trim END - vim9script - class A - endclass - class B - endclass - def Fn(x: object): object - return x - enddef - assert_true(instanceof(Fn(A.new()), A)) - assert_true(instanceof(Fn(B.new()), B)) - END - - # Try assigning a different type of value to a object variable - lines =<< trim END - var x: object = [] - END - v9.CheckSourceDefAndScriptFailure(lines, ['E1012: Type mismatch; expected object but got list', 'E1012: Type mismatch; expected object but got list']) - - # Try assigning a different type of value to a object variable - lines =<< trim END - var x: object - x = 0z10 - END - v9.CheckSourceDefAndScriptFailure(lines, ['E1012: Type mismatch; expected object but got blob', 'E1012: Type mismatch; expected object but got blob']) - - # Try adding a different type of value to a list> variable - lines =<< trim END - var x: list> - x->add({}) - END - v9.CheckSourceDefAndScriptFailure(lines, ['E1012: Type mismatch; expected object but got dict', 'E1012: Type mismatch; expected object but got dict']) - - # Try adding a different type of value to a dict> variable - lines =<< trim END - var x: dict> - x['a'] = {} - END - v9.CheckSourceDefAndScriptFailure(lines, ['E1012: Type mismatch; expected object but got dict', 'E1012: Type mismatch; expected object but got dict']) -enddef - -" Test for object<{class}> type -def Test_object_of_class_type() - var lines =<< trim END - vim9script - class A - endclass - var x: object - x = A.new() - assert_true(instanceof(x, A)) - var y: object = A.new() - assert_true(instanceof(y, A)) - END - v9.CheckSourceSuccess(lines) - - lines =<< trim END - vim9script - class A - endclass - class B - endclass - var x: object - x = B.new() - END - v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected object but got object') - - lines =<< trim END - vim9script - class A - endclass - class B - endclass - def Fn(x: object): object - return B.new() - enddef - assert_true(instanceof(Fn(A.new()), B)) - END - v9.CheckSourceSuccess(lines) - - lines =<< trim END - var x: object - END - v9.CheckSourceDefAndScriptFailure(lines, ['E1008: Missing after object', 'E1008: Missing after object']) - - lines =<< trim END - var x: object - END - v9.CheckSourceDefAndScriptFailure(lines, ['E1068: No white space allowed before ''<'': ', 'E1068: No white space allowed before ''<'': ']) - - lines =<< trim END - var x: object after type: after type: - END - v9.CheckSourceDefFailure(lines, 'E1009: Missing > after type: ') - - lines =<< trim END - vim9script - var x: object - END - v9.CheckSourceFailure(lines, 'E488: Trailing characters: ,any>') - - lines =<< trim END - var x: object - END - v9.CheckSourceDefAndScriptFailure(lines, [ - \ 'E1353: Class name not found: ', - \ 'E1353: Class name not found: ']) -enddef - -" Test for the object and class member type -def Test_obj_class_member_type() - var lines =<< trim END - vim9script - class L - var l: list - endclass - var obj_L = L.new([10, 20]) - assert_equal('list', typename(obj_L.l)) - obj_L.l->add('a') - END - v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected number but got string', 7) - - lines =<< trim END - vim9script - class T - var t: list> - endclass - var obj_T = T.new([('a',), ('b',)]) - assert_equal('list>', typename(obj_T.t)) - obj_T.t->add([('c', 10, true)]) - END - v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected tuple but got list>', 7) - - lines =<< trim END - vim9script - class D - var d: dict - endclass - var obj_D = D.new({a: 10, b: 20}) - assert_equal('dict', typename(obj_D.d)) - obj_D.d->extend({c: 'C'}) - END - v9.CheckSourceFailure(lines, 'E1013: Argument 2: type mismatch, expected dict but got dict in extend()', 7) - - lines =<< trim END - vim9script - class L - public static var l: list - endclass - L.l = [10, 20] - assert_equal('list', typename(L.l)) - L.l->add('a') - END - v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected number but got string', 7) - - lines =<< trim END - vim9script - class T - public static var t: list> - endclass - T.t = [('a',), ('b',)] - assert_equal('list>', typename(T.t)) - T.t->add([('c', 10, true)]) - END - v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected tuple but got list>', 7) - - lines =<< trim END - vim9script - class D - public static var d: dict - endclass - D.d = {a: 10, b: 20} - assert_equal('dict', typename(D.d)) - D.d->extend({c: 'C'}) - END - v9.CheckSourceFailure(lines, 'E1013: Argument 2: type mismatch, expected dict but got dict in extend()', 7) enddef " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index d38e1c89..26a3f09a 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -159,7 +159,7 @@ def Test_cmdmod_execute() v9.CheckScriptSuccess(lines) delfunc g:TheFunc - # vim9cmd execute(cmd) executes code in Vim9 script context + # vim9cmd execute(cmd) executes code in vim9 script context lines =<< trim END vim9cmd execute("g:vim9executetest = 'bar'") call assert_equal('bar', g:vim9executetest) @@ -176,7 +176,7 @@ def Test_cmdmod_execute() unlet g:vim9executetest1 unlet g:vim9executetest2 - # legacy call execute(cmd) executes code in Vim script context + # legacy call execute(cmd) executes code in vim script context lines =<< trim END vim9script legacy call execute("let g:vim9executetest = 'bar'") @@ -1705,7 +1705,7 @@ def Test_lockvar() enddef SetList() END - v9.CheckScriptFailure(lines, 'E1119:', 4) + v9.CheckScriptFailure(lines, 'E1119', 4) lines =<< trim END vim9script @@ -1716,7 +1716,7 @@ def Test_lockvar() enddef AddToList() END - v9.CheckScriptFailure(lines, 'E741:', 2) + v9.CheckScriptFailure(lines, 'E741', 2) lines =<< trim END vim9script @@ -1727,7 +1727,7 @@ def Test_lockvar() enddef AddToList() END - v9.CheckScriptFailure(lines, 'E741:', 2) + v9.CheckScriptFailure(lines, 'E741', 2) # can unlet a locked list item but not change it lines =<< trim END @@ -1742,7 +1742,7 @@ def Test_lockvar() lockvar ll[1] ll[1] = 9 END - v9.CheckDefExecAndScriptFailure(lines, ['E1119:', 'E741:'], 3) + v9.CheckDefExecAndScriptFailure(lines, ['E1119:', 'E741'], 3) # can unlet a locked dict item but not change it lines =<< trim END @@ -1757,26 +1757,26 @@ def Test_lockvar() lockvar dd.a dd.a = 3 END - v9.CheckDefExecAndScriptFailure(lines, ['E1121:', 'E741:'], 3) + v9.CheckDefExecAndScriptFailure(lines, ['E1121:', 'E741'], 3) lines =<< trim END var theList = [1, 2, 3] lockvar theList END - v9.CheckDefFailure(lines, 'E1178:', 2) + v9.CheckDefFailure(lines, 'E1178', 2) lines =<< trim END var theList = [1, 2, 3] unlockvar theList END - v9.CheckDefFailure(lines, 'E1178:', 2) + v9.CheckDefFailure(lines, 'E1178', 2) lines =<< trim END vim9script var name = 'john' lockvar nameX END - v9.CheckScriptFailure(lines, 'E1246:', 3) + v9.CheckScriptFailure(lines, 'E1246', 3) lines =<< trim END vim9script @@ -1786,14 +1786,14 @@ def Test_lockvar() enddef LockIt() END - v9.CheckScriptFailure(lines, 'E1246:', 1) + v9.CheckScriptFailure(lines, 'E1246', 1) lines =<< trim END vim9script const name = 'john' unlockvar name END - v9.CheckScriptFailure(lines, 'E46:', 3) + v9.CheckScriptFailure(lines, 'E46', 3) lines =<< trim END vim9script @@ -1803,7 +1803,7 @@ def Test_lockvar() enddef UnLockIt() END - v9.CheckScriptFailure(lines, 'E46:', 1) + v9.CheckScriptFailure(lines, 'E46', 1) lines =<< trim END def _() @@ -1811,7 +1811,7 @@ def Test_lockvar() enddef defcomp END - v9.CheckScriptFailure(lines, 'E179:', 1) + v9.CheckScriptFailure(lines, 'E179', 1) lines =<< trim END def T() @@ -1819,7 +1819,7 @@ def Test_lockvar() enddef defcomp END - v9.CheckScriptFailure(lines, 'E179:', 1) + v9.CheckScriptFailure(lines, 'E179', 1) enddef def Test_substitute_expr() @@ -2108,14 +2108,12 @@ enddef " Test for the 'previewpopup' option def Test_previewpopup() - CheckFeature quickfix set previewpopup=height:10,width:60 pedit Xppfile s:check_previewpopup('Xppfile') enddef def Test_previewpopup_pbuffer() - CheckFeature quickfix set previewpopup=height:10,width:60 edit Xppfile pbuffer diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index e98ab75a..27b71feb 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -243,7 +243,6 @@ def s:Cexpr() enddef def Test_disassemble_cexpr() - CheckFeature quickfix var res = execute('disass s:Cexpr') assert_match('\d*_Cexpr.*' .. ' var errors = "list of errors"\_s*' .. @@ -3696,184 +3695,4 @@ def Test_disassemble_using_script_local_var_in_obj_init() unlet g:instr enddef -" Disassemble the code generated for indexing a tuple -def Test_disassemble_tuple_indexing() - var lines =<< trim END - vim9script - def Fn(): tuple<...list> - var t = (5, 6, 7) - var i = t[2] - var j = t[1 : 2] - return t - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'var t = (5, 6, 7)\_s*' .. - '0 PUSHNR 5\_s*' .. - '1 PUSHNR 6\_s*' .. - '2 PUSHNR 7\_s*' .. - '3 NEWTUPLE size 3\_s*' .. - '4 SETTYPE tuple\_s*' .. - '5 STORE $0\_s*' .. - 'var i = t\[2\]\_s*' .. - '6 LOAD $0\_s*' .. - '7 PUSHNR 2\_s*' .. - '8 TUPLEINDEX\_s*' .. - '9 STORE $1\_s*' .. - 'var j = t\[1 : 2\]\_s*' .. - '10 LOAD $0\_s*' .. - '11 PUSHNR 1\_s*' .. - '12 PUSHNR 2\_s*' .. - '13 TUPLESLICE\_s*' .. - '14 SETTYPE tuple\_s*' .. - '15 STORE $2\_s*' .. - 'return t\_s*' .. - '16 LOAD $0\_s*' .. - '17 RETURN', g:instr) - unlet g:instr -enddef - -" Disassemble the code generated for assigning a tuple to a default value -def Test_disassemble_tuple_default_value() - var lines =<< trim END - vim9script - def Fn() - var t: tuple - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'var t: tuple\_s*' .. - '0 NEWTUPLE size 0\_s*' .. - '1 SETTYPE tuple\_s*' .. - '2 STORE $0\_s*' .. - '3 RETURN void', g:instr) - unlet g:instr -enddef - -" Disassemble the code generated for comparing tuples -def Test_disassemble_tuple_compare() - var lines =<< trim END - vim9script - def Fn() - var t1 = (1, 2) - var t2 = t1 - var x = t1 == t2 - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'var t1 = (1, 2)\_s*' .. - '0 PUSHNR 1\_s*' .. - '1 PUSHNR 2\_s*' .. - '2 NEWTUPLE size 2\_s*' .. - '3 SETTYPE tuple\_s*' .. - '4 STORE $0\_s*' .. - 'var t2 = t1\_s*' .. - '5 LOAD $0\_s*' .. - '6 SETTYPE tuple\_s*' .. - '7 STORE $1\_s*' .. - 'var x = t1 == t2\_s*' .. - '8 LOAD $0\_s*' .. - '9 LOAD $1\_s*' .. - '10 COMPARETUPLE ==\_s*' .. - '11 STORE $2\_s*' .. - '12 RETURN void', g:instr) - unlet g:instr -enddef - -" Disassemble the code generated for concatenating tuples -def Test_disassemble_tuple_concatenate() - var lines =<< trim END - vim9script - def Fn() - var t1 = (1,) + (2,) - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'var t1 = (1,) + (2,)\_s*' .. - '0 PUSHNR 1\_s*' .. - '1 NEWTUPLE size 1\_s*' .. - '2 PUSHNR 2\_s*' .. - '3 NEWTUPLE size 1\_s*' .. - '4 ADDTUPLE\_s*' .. - '5 SETTYPE tuple\_s*' .. - '6 STORE $0\_s*' .. - '7 RETURN void', g:instr) - unlet g:instr -enddef - -" Disassemble the code generated for a constant tupe -def Test_disassemble_tuple_const() - var lines =<< trim END - vim9script - def Fn() - const t = (1, 2, 3) - var x = t[1 : 2] - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'const t = (1, 2, 3)\_s*' .. - '0 PUSHNR 1\_s*' .. - '1 PUSHNR 2\_s*' .. - '2 PUSHNR 3\_s*' .. - '3 NEWTUPLE size 3\_s*' .. - '4 LOCKCONST\_s*' .. - '5 SETTYPE tuple\_s*' .. - '6 STORE $0\_s*' .. - 'var x = t\[1 : 2\]\_s*' .. - '7 LOAD $0\_s*' .. - '8 PUSHNR 1\_s*' .. - '9 PUSHNR 2\_s*' .. - '10 TUPLESLICE\_s*' .. - '11 SETTYPE tuple\_s*' .. - '12 STORE $1\_s*' .. - '13 RETURN void', g:instr) - unlet g:instr -enddef - -" Disassemble the code generated for setting the type when using a tuple in an -" assignment -def Test_disassemble_assign_tuple_set_type() - var lines =<< trim END - vim9script - def Fn() - var x = (1,) - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'var x = (1,)\_s*' .. - '0 PUSHNR 1\_s*' .. - '1 NEWTUPLE size 1\_s*' .. - '2 SETTYPE tuple\_s*' .. - '3 STORE $0\_s*' .. - '4 RETURN void', g:instr) - - lines =<< trim END - vim9script - def Fn() - var x = () - enddef - g:instr = execute('disassemble Fn') - END - v9.CheckScriptSuccess(lines) - assert_match('\d\+_Fn\_s*' .. - 'var x = ()\_s*' .. - '0 NEWTUPLE size 0\_s*' .. - '1 STORE $0\_s*' .. - '2 RETURN void', g:instr) - - unlet g:instr -enddef - " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index b0a623aa..57347318 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -712,7 +712,7 @@ def Test_expr4_equal() v9.CheckDefExecAndScriptFailure(['var x: any = "a"', 'echo x == true'], 'E1072: Cannot compare string with bool', 2) v9.CheckDefExecAndScriptFailure(["var x: any = true", 'echo x == ""'], 'E1072: Cannot compare bool with string', 2) - v9.CheckDefExecAndScriptFailure(["var x: any = 99", 'echo x == true'], ['E1138:', 'E1072:'], 2) + v9.CheckDefExecAndScriptFailure(["var x: any = 99", 'echo x == true'], ['E1138', 'E1072:'], 2) v9.CheckDefExecAndScriptFailure(["var x: any = 'a'", 'echo x == 99'], ['E1030:', 'E1072:'], 2) lines =<< trim END @@ -1610,7 +1610,7 @@ def Test_expr6_vim9script() lines =<< trim END echo 0z1234 - 44 END - v9.CheckDefAndScriptFailure(lines, ['E1036:', 'E974:'], 1) + v9.CheckDefAndScriptFailure(lines, ['E1036', 'E974:'], 1) lines =<< trim END echo 'abc' is? 'abc' @@ -1865,8 +1865,8 @@ def Test_expr7() v9.CheckDefFailure(["var d = 6 * "], 'E1097:', 3) v9.CheckScriptFailure(['vim9script', "var d = 6 * "], 'E15:', 2) - v9.CheckDefAndScriptFailure(['echo 1 / 0'], 'E1154:', 1) - v9.CheckDefAndScriptFailure(['echo 1 % 0'], 'E1154:', 1) + v9.CheckDefAndScriptFailure(['echo 1 / 0'], 'E1154', 1) + v9.CheckDefAndScriptFailure(['echo 1 % 0'], 'E1154', 1) g:zero = 0 v9.CheckDefExecFailure(['echo 123 / g:zero'], 'E1154: Divide by zero') @@ -1876,19 +1876,19 @@ def Test_expr7() 'g:one = 1.0', 'g:two = 2.0', 'echo g:one % g:two', - ], 'E804:', 3) + ], 'E804', 3) lines =<< trim END var n = 0 eval 1 / n END - v9.CheckDefExecAndScriptFailure(lines, 'E1154:', 2) + v9.CheckDefExecAndScriptFailure(lines, 'E1154', 2) lines =<< trim END var n = 0 eval 1 % n END - v9.CheckDefExecAndScriptFailure(lines, 'E1154:', 2) + v9.CheckDefExecAndScriptFailure(lines, 'E1154', 2) enddef def Test_expr7_vim9script() @@ -2185,7 +2185,7 @@ def Test_expr9_string() v9.CheckDefAndScriptFailure(['var x = "abc'], 'E114:', 1) v9.CheckDefAndScriptFailure(["var x = 'abc"], 'E115:', 1) - v9.CheckDefFailure(["if 0", "echo 'xx", "endif"], 'E115:', 2) + v9.CheckDefFailure(["if 0", "echo 'xx", "endif"], 'E115', 2) # interpolated string var val = 'val' @@ -2556,28 +2556,28 @@ def Test_expr9_lambda_block() lines =<< trim END map([1, 2], (k, v) => { redrawt }) END - v9.CheckDefAndScriptFailure(lines, 'E488:') + v9.CheckDefAndScriptFailure(lines, 'E488') lines =<< trim END var Func = (nr: int) => { echo nr } END - v9.CheckDefAndScriptFailure(lines, 'E1010:', 1) + v9.CheckDefAndScriptFailure(lines, 'E1010', 1) lines =<< trim END var Func = (nr: number): int => { return nr } END - v9.CheckDefAndScriptFailure(lines, 'E1010:', 1) + v9.CheckDefAndScriptFailure(lines, 'E1010', 1) lines =<< trim END var Func = (nr: number): int => { return nr END - v9.CheckDefFailure(lines, 'E1171:', 0) # line nr is function start - v9.CheckScriptFailure(['vim9script'] + lines, 'E1171:', 2) + v9.CheckDefFailure(lines, 'E1171', 0) # line nr is function start + v9.CheckScriptFailure(['vim9script'] + lines, 'E1171', 2) lines =<< trim END var Func = (nr: number): int => { @@ -3292,7 +3292,6 @@ def SetSomeVar() enddef def Test_expr9_option() - CheckFeature quickfix var lines =<< trim END # option set ts=11 @@ -3640,7 +3639,6 @@ def Test_expr9_call_autoload() enddef def Test_expr9_method_call() - CheckFeature quickfix var lines =<< trim END new setline(1, ['first', 'last']) diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 1d5de42f..4e31f34d 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -3204,7 +3204,6 @@ def Test_nested_closure_fails() enddef def Run_Test_closure_in_for_loop_fails() - CheckScreendump var lines =<< trim END vim9script redraw @@ -3601,7 +3600,6 @@ func Test_silent_echo() endfunc def Run_Test_silent_echo() - CheckScreendump var lines =<< trim END vim9script def EchoNothing() @@ -3720,7 +3718,6 @@ def Test_invalid_function_name() enddef def Test_partial_call() - CheckFeature quickfix var lines =<< trim END var Xsetlist: func Xsetlist = function('setloclist', [0]) @@ -4577,7 +4574,6 @@ def Test_multiple_funcref() enddef def Test_cexpr_errmsg_line_number() - CheckFeature quickfix var lines =<< trim END vim9script def Func() @@ -4647,7 +4643,6 @@ def Test_invalid_redir() enddef func Test_keytyped_in_nested_function() - CheckScreendump CheckRunVimInTerminal call Run_Test_keytyped_in_nested_function() diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 1c8136a0..8376a931 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -657,7 +657,6 @@ def Test_import_export_expr_map() enddef def Test_import_in_filetype() - CheckFeature quickfix # check that :import works when the buffer is locked mkdir('ftplugin', 'pR') var export_lines =<< trim END diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index d0bedf2a..b29f3cd8 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1226,7 +1226,6 @@ def Test_nocatch_return_in_try() enddef def Test_cnext_works_in_catch() - CheckFeature quickfix var lines =<< trim END vim9script au BufEnter * eval 1 + 2 @@ -1542,7 +1541,6 @@ def Test_abort_after_error() enddef def Test_cexpr_vimscript() - CheckFeature quickfix # only checks line continuation set errorformat=File\ %f\ line\ %l var lines =<< trim END @@ -3993,7 +3991,6 @@ func Test_vim9script_not_global() endfunc def Test_vim9_copen() - CheckFeature quickfix # this was giving an error for setting w:quickfix_title copen quit @@ -4055,22 +4052,6 @@ def Test_error_in_autoload_script() &rtp = save_rtp enddef -" Test for sourcing a Vim9 script with a function script variable and "noclear". -" The type for the variable is dynamically allocated and should be freed. -def Test_source_func_script_var() - var lines =<< trim END - vim9script noclear - var Fn: func(list): number - Fn = function('min') - assert_equal(2, Fn([4, 2])) - END - new - setline(1, lines) - source - source - bw! -enddef - def Test_error_in_autoload_script_foldexpr() var save_rtp = &rtp mkdir('Xvim/autoload', 'pR') @@ -4174,7 +4155,6 @@ func Test_no_redraw_when_restoring_cpo() endfunc def Run_test_no_redraw_when_restoring_cpo() - CheckScreendump var lines =<< trim END vim9script export def Func() @@ -4206,7 +4186,6 @@ func Test_reject_declaration() endfunc def Run_test_reject_declaration() - CheckScreendump var buf = g:RunVimInTerminal('', {'rows': 6}) term_sendkeys(buf, ":vim9cmd var x: number\") g:VerifyScreenDump(buf, 'Test_vim9_reject_declaration_1', {}) @@ -4833,13 +4812,11 @@ def Test_profile_with_lambda() enddef func Test_misplaced_type() - CheckScreendump CheckRunVimInTerminal call Run_Test_misplaced_type() endfunc def Run_Test_misplaced_type() - CheckScreendump writefile(['let g:somevar = "asdf"'], 'XTest_misplaced_type', 'D') var buf = g:RunVimInTerminal('-S XTest_misplaced_type', {'rows': 6}) term_sendkeys(buf, ":vim9cmd echo islocked('somevar: string')\") @@ -5200,7 +5177,7 @@ def Test_null_values() [null_dict, 1, '{}', 4, 'dict'], [null_function, 1, "function('')", 2, 'func(...): unknown'], [null_list, 1, '[]', 3, 'list'], - [null_object, 1, 'object of [unknown]', 13, 'object'], + [null_object, 1, 'object of [unknown]', 13, 'object'], [null_partial, 1, "function('')", 2, 'func(...): unknown'], [null_string, 1, "''", 1, 'string'] ] diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim index 2bbca3e5..7aab2713 100644 --- a/src/testdir/test_viminfo.vim +++ b/src/testdir/test_viminfo.vim @@ -1329,30 +1329,4 @@ func Test_viminfo_oldfiles_filter() let &viminfofile = _viminfofile endfunc -func Test_viminfo_global_var() - let _viminfofile = &viminfofile - let _viminfo = &viminfo - let &viminfofile='' - set viminfo+=! - let lines = [ - \ '# comment line', - \ "", - \ '# Viminfo version', - \ '|1,4', - \ "", - \ '*encoding=utf-8', - \ "", - \ '# global variables:', - \ "!VAL\tFLO\t-in", - \ "!VAR\tFLO\t-inf", - \ "", - \ ] - call writefile(lines, 'Xviminfo2', 'D') - rviminfo! Xviminfo2 - call assert_equal(0.0, g:VAL) - call assert_equal(str2float("-inf"), g:VAR) - let &viminfofile = _viminfofile - let &viminfo = _viminfo -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim index 16dd70c9..21f894e9 100644 --- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -7519,17 +7519,6 @@ func Test_for_over_string() endfor endfunc -" Test for 'for' loop failures -func Test_for_loop_failure() - CheckFeature job - func ForFn() - for x in test_null_job() - endfor - endfunc - call assert_fails('call ForFn()', 'E1523: String, List, Tuple or Blob required') - delfunc ForFn -endfunc - " Test for deeply nested :source command {{{1 func Test_deeply_nested_source() let lines =<< trim END diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index c5edb0d4..b6381a33 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -1979,18 +1979,6 @@ func Test_splitkeep_misc() set splitkeep& endfunc -func Test_splitkeep_screen_cursor_pos() - new - set splitkeep=screen - call setline(1, ["longer than the last", "shorter"]) - norm! $ - wincmd s - close - call assert_equal([0, 1, 20, 0], getpos('.')) - %bwipeout! - set splitkeep& -endfunc - func Test_splitkeep_cursor() CheckScreendump let lines =<< trim END diff --git a/src/testdir/test_xxd.vim b/src/testdir/test_xxd.vim index 5d739e07..690c8daf 100644 --- a/src/testdir/test_xxd.vim +++ b/src/testdir/test_xxd.vim @@ -667,7 +667,6 @@ func Test_xxd_color2() let buf = RunVimInTerminal('', #{rows: 20, cmd: 'sh'}) call term_sendkeys(buf, s:xxd_cmd .. " -R never < XXDfile_colors\") call TermWait(buf) - redraw call VerifyScreenDump(buf, 'Test_xxd_color_0', {}) call TermWait(buf) diff --git a/src/testdir/vim9.vim b/src/testdir/vim9.vim index b994855b..ff4db7bb 100644 --- a/src/testdir/vim9.vim +++ b/src/testdir/vim9.vim @@ -1,6 +1,6 @@ vim9script -# Utility functions for testing Vim9 script +# Utility functions for testing vim9 script # Use a different file name for each run. var sequence = 1 @@ -191,23 +191,19 @@ export func CheckLegacyFailure(lines, error) endtry endfunc -# Translate "lines" to legacy Vim script -def LegacyTrans(lines: list): list - return lines->mapnew((_, v) => - v->substitute('\', 'let', 'g') - ->substitute('\', 'let', 'g') - ->substitute('\', '{', 'g') - ->substitute('\', '->', 'g') - ->substitute('\', '}', 'g') - ->substitute('\', '1', 'g') - ->substitute('\', '0', 'g') - ->substitute('#"', ' "', 'g')) -enddef - # Execute "lines" in a legacy function, translated as in # CheckLegacyAndVim9Success() export def CheckTransLegacySuccess(lines: list) - CheckLegacySuccess(LegacyTrans(lines)) + var legacylines = lines->mapnew((_, v) => + v->substitute('\', 'let', 'g') + ->substitute('\', 'let', 'g') + ->substitute('\', '{', 'g') + ->substitute('\', '->', 'g') + ->substitute('\', '}', 'g') + ->substitute('\', '1', 'g') + ->substitute('\', '0', 'g') + ->substitute('#"', ' "', 'g')) + CheckLegacySuccess(legacylines) enddef export def Vim9Trans(lines: list): list @@ -268,87 +264,16 @@ export def CheckLegacyAndVim9Failure(lines: list, error: any) var legacylines = lines->mapnew((_, v) => v->substitute('\', 'let', 'g') ->substitute('\', 'let', 'g') - ->substitute('\', '{', 'g') - ->substitute('\', '->', 'g') - ->substitute('\', '}', 'g') - ->substitute('\', '1', 'g') - ->substitute('\', '0', 'g') ->substitute('#"', ' "', 'g')) CheckLegacyFailure(legacylines, legacyError) var vim9lines = lines->mapnew((_, v) => v->substitute('\', 'var', 'g') - ->substitute('\substitute('\', '(', 'g') - ->substitute('\', ') =>', 'g') - ->substitute(' *\ *', '', 'g') - ->substitute('\', 'true', 'g') - ->substitute('\', 'false', 'g')) + ->substitute('\) - CheckSourceLegacySuccess(LegacyTrans(lines)) -enddef - -# Execute "lines" in a :def function, translated as in -# CheckLegacyAndVim9Success() -export def CheckSourceTransDefSuccess(lines: list) - CheckSourceDefSuccess(Vim9Trans(lines)) -enddef - -# Execute "lines" in a Vim9 script, translated as in -# CheckLegacyAndVim9Success() -export def CheckSourceTransVim9Success(lines: list) - CheckSourceScriptSuccess(['vim9script'] + Vim9Trans(lines)) -enddef - -# Execute "lines" in a legacy function, :def function and Vim9 script. -# Use 'VAR' for a declaration. -# Use 'LET' for an assignment -# Use ' #"' for a comment -# Use LSTART arg LMIDDLE expr LEND for lambda -# Use 'TRUE' for 1 in legacy, true in Vim9 -# Use 'FALSE' for 0 in legacy, false in Vim9 -export def CheckSourceLegacyAndVim9Success(lines: list) - CheckSourceTransLegacySuccess(lines) - CheckSourceTransDefSuccess(lines) - CheckSourceTransVim9Success(lines) -enddef - # :source a list of "lines" and check whether it fails with "error" export def CheckSourceScriptFailure(lines: list, error: string, lnum = -3) var cwd = getcwd() @@ -392,6 +317,18 @@ export def CheckSourceScriptSuccess(lines: list) endtry enddef +export def CheckSourceSuccess(lines: list) + CheckSourceScriptSuccess(lines) +enddef + +export def CheckSourceFailure(lines: list, error: string, lnum = -3) + CheckSourceScriptFailure(lines, error, lnum) +enddef + +export def CheckSourceFailureList(lines: list, errors: list, lnum = -3) + CheckSourceScriptFailureList(lines, errors, lnum) +enddef + # :source a List of "lines" inside a ":def" function and check that no error # occurs when called. export func CheckSourceDefSuccess(lines) @@ -409,6 +346,11 @@ export func CheckSourceDefSuccess(lines) endtry endfunc +export def CheckSourceDefAndScriptSuccess(lines: list) + CheckSourceDefSuccess(lines) + CheckSourceScriptSuccess(['vim9script'] + lines) +enddef + # Check that "lines" inside a ":def" function has no error when compiled. export func CheckSourceDefCompileSuccess(lines) let cwd = getcwd() @@ -505,45 +447,3 @@ export def CheckSourceDefExecAndScriptFailure(lines: list, error: any, l CheckSourceScriptFailure(['vim9script'] + lines, errorScript, lnum + 1) enddef -export def CheckSourceSuccess(lines: list) - CheckSourceScriptSuccess(lines) -enddef - -export def CheckSourceFailure(lines: list, error: string, lnum = -3) - CheckSourceScriptFailure(lines, error, lnum) -enddef - -export def CheckSourceFailureList(lines: list, errors: list, lnum = -3) - CheckSourceScriptFailureList(lines, errors, lnum) -enddef - -export def CheckSourceDefAndScriptSuccess(lines: list) - CheckSourceDefSuccess(lines) - CheckSourceScriptSuccess(['vim9script'] + lines) -enddef - -# Execute "lines" in a legacy function, :def function and Vim9 script. -# Use 'VAR' for a declaration. -# Use 'LET' for an assignment -# Use ' #"' for a comment -export def CheckSourceLegacyAndVim9Failure(lines: list, error: any) - var legacyError: string - var defError: string - var scriptError: string - - if type(error) == type('string') - legacyError = error - defError = error - scriptError = error - else - legacyError = error[0] - defError = error[1] - scriptError = error[2] - endif - - CheckSourceLegacyFailure(LegacyTrans(lines), legacyError) - var vim9lines = Vim9Trans(lines) - CheckSourceDefExecFailure(vim9lines, defError) - CheckSourceScriptFailure(['vim9script'] + vim9lines, scriptError) -enddef - diff --git a/src/testing.c b/src/testing.c index cfa01ff9..7ab109c1 100644 --- a/src/testing.c +++ b/src/testing.c @@ -1132,10 +1132,6 @@ f_test_refcount(typval_T *argvars, typval_T *rettv) if (argvars[0].vval.v_list != NULL) retval = argvars[0].vval.v_list->lv_refcount - 1; break; - case VAR_TUPLE: - if (argvars[0].vval.v_tuple != NULL) - retval = argvars[0].vval.v_tuple->tv_refcount - 1; - break; case VAR_DICT: if (argvars[0].vval.v_dict != NULL) retval = argvars[0].vval.v_dict->dv_refcount - 1; @@ -1252,12 +1248,6 @@ f_test_null_string(typval_T *argvars UNUSED, typval_T *rettv) rettv->vval.v_string = NULL; } - void -f_test_null_tuple(typval_T *argvars UNUSED, typval_T *rettv) -{ - rettv_tuple_set(rettv, NULL); -} - void f_test_unknown(typval_T *argvars UNUSED, typval_T *rettv) { @@ -1411,7 +1401,7 @@ test_gui_mouse_event(dict_T *args) if (dict_get_bool(args, "cell", FALSE)) { // calculate the middle of the character cell - // Note: Cell coordinates are 1-based from Vim script + // Note: Cell coordinates are 1-based from vimscript pY = (row - 1) * gui.char_height + gui.char_height / 2; pX = (col - 1) * gui.char_width + gui.char_width / 2; } diff --git a/src/textformat.c b/src/textformat.c index 1af4b2f4..018565f7 100644 --- a/src/textformat.c +++ b/src/textformat.c @@ -369,7 +369,7 @@ internal_format( { // In MODE_VREPLACE state, we will backspace over the text to be // wrapped, so save a copy now to put on the next line. - saved_text = vim_strnsave(ml_get_cursor(), ml_get_cursor_len()); + 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 @@ -552,7 +552,9 @@ same_leader( char_u *leader2_flags) { int idx1 = 0, idx2 = 0; + char_u *p; char_u *line1; + char_u *line2; if (leader1_len == 0) return (leader2_len == 0); @@ -564,8 +566,6 @@ same_leader( // some text after it and the second line has the 'm' flag. if (leader1_flags != NULL) { - char_u *p; - for (p = leader1_flags; *p && *p != ':'; ++p) { if (*p == COM_FIRST) @@ -589,11 +589,9 @@ same_leader( // Get current line and next line, compare the leaders. // The first line has to be saved, only one line can be locked at a time. - line1 = vim_strnsave(ml_get(lnum), ml_get_len(lnum)); + line1 = vim_strsave(ml_get(lnum)); if (line1 != NULL) { - char_u *line2; - for (idx1 = 0; VIM_ISWHITE(line1[idx1]); ++idx1) ; line2 = ml_get(lnum + 1); @@ -667,8 +665,11 @@ auto_format( 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; @@ -687,8 +688,6 @@ auto_format( wasatend = (pos.col == ml_get_curline_len()); if (*old != NUL && !trailblank && wasatend) { - int cc; - dec_cursor(); cc = gchar_cursor(); if (!WHITECHAR(cc) && curwin->w_cursor.col > 0 @@ -741,13 +740,11 @@ auto_format( // formatted. if (!wasatend && has_format_option(FO_WHITE_PAR)) { - char_u *new = ml_get_curline(); - colnr_T len = ml_get_curline_len(); + new = ml_get_curline(); + len = ml_get_curline_len(); if (curwin->w_cursor.col == len) { - char_u *pnew = vim_strnsave(new, len + 2); - if (pnew == NULL) - return; + pnew = vim_strnsave(new, len + 2); pnew[len] = ' '; pnew[len + 1] = NUL; ml_replace(curwin->w_cursor.lnum, pnew, FALSE); diff --git a/src/time.c b/src/time.c index 2fb0c393..8725a885 100644 --- a/src/time.c +++ b/src/time.c @@ -778,7 +778,7 @@ set_ref_in_timer(int copyID) tv.v_type = VAR_FUNC; tv.vval.v_string = timer->tr_callback.cb_name; } - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL, NULL); + abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); } return abort; } diff --git a/src/tuple.c b/src/tuple.c deleted file mode 100644 index eff4bdcc..00000000 --- a/src/tuple.c +++ /dev/null @@ -1,1122 +0,0 @@ -/* 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. - */ - -/* - * tuple.c: Tuple support functions. - */ - -#include "vim.h" - -#if defined(FEAT_EVAL) || defined(PROTO) - -// Tuple heads for garbage collection. -static tuple_T *first_tuple = NULL; // list of all tuples - - static void -tuple_init(tuple_T *tuple) -{ - // Prepend the tuple to the list of tuples for garbage collection. - if (first_tuple != NULL) - first_tuple->tv_used_prev = tuple; - tuple->tv_used_prev = NULL; - tuple->tv_used_next = first_tuple; - first_tuple = tuple; - - ga_init2(&tuple->tv_items, sizeof(typval_T), 20); -} - -/* - * Allocate an empty header for a tuple. - * Caller should take care of the reference count. - */ - tuple_T * -tuple_alloc(void) -{ - tuple_T *tuple; - - tuple = ALLOC_CLEAR_ONE(tuple_T); - if (tuple != NULL) - tuple_init(tuple); - return tuple; -} - -/* - * Allocate space for a tuple with "count" items. - * This uses one allocation for efficiency. - * The reference count is not set. - * Next tuple_set_item() must be called for each item. - */ - tuple_T * -tuple_alloc_with_items(int count) -{ - tuple_T *tuple; - - tuple = tuple_alloc(); - if (tuple == NULL) - return NULL; - - if (count <= 0) - return tuple; - - if (ga_grow(&tuple->tv_items, count) == FAIL) - { - tuple_free(tuple); - return NULL; - } - - return tuple; -} - -/* - * Set item "idx" for a tuple previously allocated with - * tuple_alloc_with_items(). - * The contents of "tv" is copied into the tuple item. - * Each item must be set exactly once. - */ - void -tuple_set_item(tuple_T *tuple, int idx, typval_T *tv) -{ - *TUPLE_ITEM(tuple, idx) = *tv; - tuple->tv_items.ga_len++; -} - -/* - * Allocate an empty tuple for a return value, with reference count set. - * Returns OK or FAIL. - */ - int -rettv_tuple_alloc(typval_T *rettv) -{ - tuple_T *tuple = tuple_alloc(); - - if (tuple == NULL) - return FAIL; - - rettv->v_lock = 0; - rettv_tuple_set(rettv, tuple); - return OK; -} - -/* - * Set a tuple as the return value. Increments the reference count. - */ - void -rettv_tuple_set(typval_T *rettv, tuple_T *tuple) -{ - rettv->v_type = VAR_TUPLE; - rettv->vval.v_tuple = tuple; - if (tuple != NULL) - ++tuple->tv_refcount; -} - -/* - * Set a new tuple with "count" items as the return value. - * Returns OK on success and FAIL on allocation failure. - */ - int -rettv_tuple_set_with_items(typval_T *rettv, int count) -{ - tuple_T *new_tuple; - - new_tuple = tuple_alloc_with_items(count); - if (new_tuple == NULL) - return FAIL; - - rettv_tuple_set(rettv, new_tuple); - - return OK; -} - -/* - * Unreference a tuple: decrement the reference count and free it when it - * becomes zero. - */ - void -tuple_unref(tuple_T *tuple) -{ - if (tuple != NULL && --tuple->tv_refcount <= 0) - tuple_free(tuple); -} - -/* - * Free a tuple, including all non-container items it points to. - * Ignores the reference count. - */ - static void -tuple_free_contents(tuple_T *tuple) -{ - for (int i = 0; i < TUPLE_LEN(tuple); i++) - clear_tv(TUPLE_ITEM(tuple, i)); - - ga_clear(&tuple->tv_items); -} - -/* - * Go through the list of tuples and free items without the copyID. - * But don't free a tuple that has a watcher (used in a for loop), these - * are not referenced anywhere. - */ - int -tuple_free_nonref(int copyID) -{ - tuple_T *tt; - int did_free = FALSE; - - for (tt = first_tuple; tt != NULL; tt = tt->tv_used_next) - if ((tt->tv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) - { - // Free the Tuple 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. - tuple_free_contents(tt); - did_free = TRUE; - } - return did_free; -} - - static void -tuple_free_list(tuple_T *tuple) -{ - // Remove the tuple from the list of tuples for garbage collection. - if (tuple->tv_used_prev == NULL) - first_tuple = tuple->tv_used_next; - else - tuple->tv_used_prev->tv_used_next = tuple->tv_used_next; - if (tuple->tv_used_next != NULL) - tuple->tv_used_next->tv_used_prev = tuple->tv_used_prev; - - free_type(tuple->tv_type); - vim_free(tuple); -} - - void -tuple_free_items(int copyID) -{ - tuple_T *tt, *tt_next; - - for (tt = first_tuple; tt != NULL; tt = tt_next) - { - tt_next = tt->tv_used_next; - if ((tt->tv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) - { - // Free the tuple 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. - tuple_free_list(tt); - } - } -} - - void -tuple_free(tuple_T *tuple) -{ - if (in_free_unref_items) - return; - - tuple_free_contents(tuple); - tuple_free_list(tuple); -} - -/* - * Get the number of items in a tuple. - */ - long -tuple_len(tuple_T *tuple) -{ - if (tuple == NULL) - return 0L; - return tuple->tv_items.ga_len; -} - -/* - * Return TRUE when two tuples have exactly the same values. - */ - int -tuple_equal( - tuple_T *t1, - tuple_T *t2, - int ic) // ignore case for strings -{ - if (t1 == t2) - return TRUE; - - int t1_len = tuple_len(t1); - int t2_len = tuple_len(t2); - - if (t1_len != t2_len) - return FALSE; - - if (t1_len == 0) - // empty and NULL tuples are considered equal - return TRUE; - - // If the tuples "t1" or "t2" is NULL, then it is handled by the length - // checks above. - - for (int i = 0, j = 0; i < t1_len && j < t2_len; i++, j++) - if (!tv_equal(TUPLE_ITEM(t1, i), TUPLE_ITEM(t2, j), ic)) - return FALSE; - - return TRUE; -} - -/* - * Locate item with index "n" in tuple "tuple" and return it. - * A negative index is counted from the end; -1 is the last item. - * Returns NULL when "n" is out of range. - */ - typval_T * -tuple_find(tuple_T *tuple, long n) -{ - if (tuple == NULL) - return NULL; - - // Negative index is relative to the end. - if (n < 0) - n = TUPLE_LEN(tuple) + n; - - // Check for index out of range. - if (n < 0 || n >= TUPLE_LEN(tuple)) - return NULL; - - return TUPLE_ITEM(tuple, n); -} - - int -tuple_append_tv(tuple_T *tuple, typval_T *tv) -{ - if (ga_grow(&tuple->tv_items, 1) == FAIL) - return FAIL; - - tuple_set_item(tuple, TUPLE_LEN(tuple), tv); - - return OK; -} - -/* - * Concatenate tuples "t1" and "t2" into a new tuple, stored in "tv". - * Return FAIL when out of memory. - */ - int -tuple_concat(tuple_T *t1, tuple_T *t2, typval_T *tv) -{ - tuple_T *tuple; - - // make a copy of the first tuple. - if (t1 == NULL) - tuple = tuple_alloc(); - else - tuple = tuple_copy(t1, FALSE, TRUE, 0); - if (tuple == NULL) - return FAIL; - - tv->v_type = VAR_TUPLE; - tv->v_lock = 0; - tv->vval.v_tuple = tuple; - if (t1 == NULL) - ++tuple->tv_refcount; - - // append all the items from the second tuple - for (int i = 0; i < tuple_len(t2); i++) - { - typval_T new_tv; - - copy_tv(TUPLE_ITEM(t2, i), &new_tv); - - if (tuple_append_tv(tuple, &new_tv) == FAIL) - { - tuple_free(tuple); - return FAIL; - } - } - - return OK; -} - -/* - * Return a slice of tuple starting at index n1 and ending at index n2, - * inclusive (tuple[n1 : n2]) - */ - tuple_T * -tuple_slice(tuple_T *tuple, long n1, long n2) -{ - tuple_T *new_tuple; - - new_tuple = tuple_alloc_with_items(n2 - n1 + 1); - if (new_tuple == NULL) - return NULL; - - for (int i = n1; i <= n2; i++) - { - typval_T new_tv; - - copy_tv(TUPLE_ITEM(tuple, i), &new_tv); - - if (tuple_append_tv(new_tuple, &new_tv) == FAIL) - { - tuple_free(new_tuple); - return NULL; - } - } - - return new_tuple; -} - - int -tuple_slice_or_index( - tuple_T *tuple, - int range, - varnumber_T n1_arg, - varnumber_T n2_arg, - int exclusive, - typval_T *rettv, - int verbose) -{ - long len = tuple_len(tuple); - varnumber_T n1 = n1_arg; - varnumber_T n2 = n2_arg; - typval_T var1; - - if (n1 < 0) - n1 = len + n1; - if (n1 < 0 || n1 >= len) - { - // For a range we allow invalid values and for legacy script return an - // empty tuple, for Vim9 script start at the first item. - // A tuple index out of range is an error. - if (!range) - { - if (verbose) - semsg(_(e_tuple_index_out_of_range_nr), (long)n1_arg); - return FAIL; - } - if (in_vim9script()) - n1 = n1 < 0 ? 0 : len; - else - n1 = len; - } - if (range) - { - tuple_T *new_tuple; - - if (n2 < 0) - n2 = len + n2; - else if (n2 >= len) - n2 = len - (exclusive ? 0 : 1); - if (exclusive) - --n2; - if (n2 < 0 || n2 + 1 < n1) - n2 = -1; - new_tuple = tuple_slice(tuple, n1, n2); - if (new_tuple == NULL) - return FAIL; - clear_tv(rettv); - rettv_tuple_set(rettv, new_tuple); - } - else - { - // copy the item to "var1" to avoid that freeing the tuple makes it - // invalid. - copy_tv(tuple_find(tuple, n1), &var1); - clear_tv(rettv); - *rettv = var1; - } - return OK; -} - -/* - * Make a copy of tuple "orig". Shallow if "deep" is FALSE. - * The refcount of the new tuple is set to 1. - * See item_copy() for "top" and "copyID". - * Returns NULL when out of memory. - */ - tuple_T * -tuple_copy(tuple_T *orig, int deep, int top, int copyID) -{ - tuple_T *copy; - int idx; - - if (orig == NULL) - return NULL; - - copy = tuple_alloc_with_items(TUPLE_LEN(orig)); - if (copy == NULL) - return NULL; - - if (orig->tv_type == NULL || top || deep) - copy->tv_type = NULL; - else - copy->tv_type = alloc_type(orig->tv_type); - if (copyID != 0) - { - // Do this before adding the items, because one of the items may - // refer back to this tuple. - orig->tv_copyID = copyID; - orig->tv_copytuple = copy; - } - - for (idx = 0; idx < TUPLE_LEN(orig) && !got_int; idx++) - { - copy->tv_items.ga_len++; - if (deep) - { - if (item_copy(TUPLE_ITEM(orig, idx), TUPLE_ITEM(copy, idx), - deep, FALSE, copyID) == FAIL) - break; - } - else - copy_tv(TUPLE_ITEM(orig, idx), TUPLE_ITEM(copy, idx)); - } - - ++copy->tv_refcount; - if (idx != TUPLE_LEN(orig)) - { - tuple_unref(copy); - copy = NULL; - } - - return copy; -} - -/* - * Allocate a variable for a tuple and fill it from "*arg". - * "*arg" points to the "," after the first element. - * "rettv" contains the first element. - * Returns OK or FAIL. - */ - int -eval_tuple(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error) -{ - int evaluate = evalarg == NULL ? FALSE - : evalarg->eval_flags & EVAL_EVALUATE; - tuple_T *tuple = NULL; - typval_T tv; - int vim9script = in_vim9script(); - int had_comma; - - if (check_typval_is_value(rettv) == FAIL) - { - // the first item is not a valid value type - clear_tv(rettv); - return FAIL; - } - - if (evaluate) - { - tuple = tuple_alloc(); - if (tuple == NULL) - return FAIL; - - if (rettv->v_type != VAR_UNKNOWN) - { - // Add the first item to the tuple from "rettv" - if (tuple_append_tv(tuple, rettv) == FAIL) - return FAIL; - } - } - - if (**arg == ')') - // empty tuple - goto done; - - if (vim9script && !IS_WHITE_NL_OR_NUL((*arg)[1]) && (*arg)[1] != ')') - { - semsg(_(e_white_space_required_after_str_str), ",", *arg); - goto failret; - } - - *arg = skipwhite_and_linebreak(*arg + 1, evalarg); - while (**arg != ')' && **arg != NUL) - { - if (eval1(arg, &tv, evalarg) == FAIL) // recursive! - goto failret; - if (check_typval_is_value(&tv) == FAIL) - { - if (evaluate) - clear_tv(&tv); - goto failret; - } - - if (evaluate) - { - if (tuple_append_tv(tuple, &tv) == FAIL) - { - clear_tv(&tv); - goto failret; - } - } - - if (!vim9script) - *arg = skipwhite(*arg); - - // the comma must come after the value - had_comma = **arg == ','; - if (had_comma) - { - if (vim9script && !IS_WHITE_NL_OR_NUL((*arg)[1]) && (*arg)[1] != ')') - { - semsg(_(e_white_space_required_after_str_str), ",", *arg); - goto failret; - } - *arg = skipwhite(*arg + 1); - } - - // The ")" can be on the next line. But a double quoted string may - // follow, not a comment. - *arg = skipwhite_and_linebreak(*arg, evalarg); - if (**arg == ')') - break; - - if (!had_comma) - { - if (do_error) - { - if (**arg == ',') - semsg(_(e_no_white_space_allowed_before_str_str), - ",", *arg); - else - semsg(_(e_missing_comma_in_tuple_str), *arg); - } - goto failret; - } - } - - if (**arg != ')') - { - if (do_error) - semsg(_(e_missing_end_of_tuple_rsp_str), *arg); -failret: - if (evaluate) - tuple_free(tuple); - return FAIL; - } - -done: - *arg += 1; - if (evaluate) - rettv_tuple_set(rettv, tuple); - - return OK; -} - -/* - * Lock or unlock a tuple. "deep" is number of levels to go. - * When "check_refcount" is TRUE do not lock a tuple with a reference - * count larger than 1. - */ - void -tuple_lock(tuple_T *tuple, int deep, int lock, int check_refcount) -{ - if (tuple == NULL || (check_refcount && tuple->tv_refcount > 1)) - return; - - if (lock) - tuple->tv_lock |= VAR_LOCKED; - else - tuple->tv_lock &= ~VAR_LOCKED; - - if (deep < 0 || deep > 1) - { - // recursive: lock/unlock the items the Tuple contains - for (int i = 0; i < TUPLE_LEN(tuple); i++) - item_lock(TUPLE_ITEM(tuple, i), deep - 1, lock, check_refcount); - } -} - -typedef struct join_S { - char_u *s; - char_u *tofree; -} join_T; - - static int -tuple_join_inner( - garray_T *gap, // to store the result in - tuple_T *tuple, - char_u *sep, - int echo_style, - int restore_copyID, - int copyID, - garray_T *join_gap) // to keep each tuple item string -{ - int i; - join_T *p; - int len; - int sumlen = 0; - int first = TRUE; - char_u *tofree; - char_u numbuf[NUMBUFLEN]; - char_u *s; - typval_T *tv; - - // Stringify each item in the tuple. - for (i = 0; i < TUPLE_LEN(tuple) && !got_int; i++) - { - tv = TUPLE_ITEM(tuple, i); - s = echo_string_core(tv, &tofree, numbuf, copyID, - echo_style, restore_copyID, !echo_style); - if (s == NULL) - return FAIL; - - len = (int)STRLEN(s); - sumlen += len; - - (void)ga_grow(join_gap, 1); - p = ((join_T *)join_gap->ga_data) + (join_gap->ga_len++); - if (tofree != NULL || s != numbuf) - { - p->s = s; - p->tofree = tofree; - } - else - { - p->s = vim_strnsave(s, len); - p->tofree = p->s; - } - - line_breakcheck(); - if (did_echo_string_emsg) // recursion error, bail out - break; - } - - // Allocate result buffer with its total size, avoid re-allocation and - // multiple copy operations. Add 2 for a tailing ')' and NUL. - if (join_gap->ga_len >= 2) - sumlen += (int)STRLEN(sep) * (join_gap->ga_len - 1); - if (ga_grow(gap, sumlen + 2) == FAIL) - return FAIL; - - for (i = 0; i < join_gap->ga_len && !got_int; ++i) - { - if (first) - first = FALSE; - else - ga_concat(gap, sep); - p = ((join_T *)join_gap->ga_data) + i; - - if (p->s != NULL) - ga_concat(gap, p->s); - line_breakcheck(); - } - - // If there is only one item in the tuple, then add the separator after - // that. - if (join_gap->ga_len == 1) - ga_concat(gap, sep); - - return OK; -} - -/* - * Join tuple "tuple" into a string in "*gap", using separator "sep". - * When "echo_style" is TRUE use String as echoed, otherwise as inside a Tuple. - * Return FAIL or OK. - */ - int -tuple_join( - garray_T *gap, - tuple_T *tuple, - char_u *sep, - int echo_style, - int restore_copyID, - int copyID) -{ - garray_T join_ga; - int retval; - join_T *p; - int i; - - if (TUPLE_LEN(tuple) < 1) - return OK; // nothing to do - ga_init2(&join_ga, sizeof(join_T), TUPLE_LEN(tuple)); - retval = tuple_join_inner(gap, tuple, sep, echo_style, restore_copyID, - copyID, &join_ga); - - if (join_ga.ga_data == NULL) - return retval; - - // Dispose each item in join_ga. - p = (join_T *)join_ga.ga_data; - for (i = 0; i < join_ga.ga_len; ++i) - { - vim_free(p->tofree); - ++p; - } - ga_clear(&join_ga); - - return retval; -} - -/* - * Return an allocated string with the string representation of a tuple. - * May return NULL. - */ - char_u * -tuple2string(typval_T *tv, int copyID, int restore_copyID) -{ - garray_T ga; - - if (tv->vval.v_tuple == NULL) - return NULL; - ga_init2(&ga, sizeof(char), 80); - ga_append(&ga, '('); - if (tuple_join(&ga, tv->vval.v_tuple, (char_u *)", ", - FALSE, restore_copyID, copyID) == FAIL) - { - vim_free(ga.ga_data); - return NULL; - } - ga_append(&ga, ')'); - ga_append(&ga, NUL); - return (char_u *)ga.ga_data; -} - -/* - * Implementation of foreach() for a Tuple. Apply "expr" to - * every item in Tuple "tuple" and return the result in "rettv". - */ - void -tuple_foreach( - tuple_T *tuple, - filtermap_T filtermap, - typval_T *expr) -{ - int len = tuple_len(tuple); - int rem; - typval_T newtv; - funccall_T *fc; - - // set_vim_var_nr() doesn't set the type - set_vim_var_type(VV_KEY, VAR_NUMBER); - - // Create one funccall_T for all eval_expr_typval() calls. - fc = eval_expr_get_funccal(expr, &newtv); - - for (int idx = 0; idx < len; idx++) - { - set_vim_var_nr(VV_KEY, idx); - if (filter_map_one(TUPLE_ITEM(tuple, idx), expr, filtermap, fc, - &newtv, &rem) == FAIL) - break; - } - - if (fc != NULL) - remove_funccal(); -} - -/* - * Count the number of times item "needle" occurs in Tuple "l" starting at index - * "idx". Case is ignored if "ic" is TRUE. - */ - long -tuple_count(tuple_T *tuple, typval_T *needle, long idx, int ic) -{ - long n = 0; - - if (tuple == NULL) - return 0; - - int len = TUPLE_LEN(tuple); - if (len == 0) - return 0; - - if (idx < 0 || idx >= len) - { - semsg(_(e_tuple_index_out_of_range_nr), idx); - return 0; - } - - for (int i = idx; i < len; i++) - { - if (tv_equal(TUPLE_ITEM(tuple, i), needle, ic)) - ++n; - } - - return n; -} - -/* - * "items(tuple)" function - * Caller must have already checked that argvars[0] is a tuple. - */ - void -tuple2items(typval_T *argvars, typval_T *rettv) -{ - tuple_T *tuple = argvars[0].vval.v_tuple; - varnumber_T idx; - - if (rettv_list_alloc(rettv) == FAIL) - return; - - if (tuple == NULL) - return; // null tuple behaves like an empty list - - for (idx = 0; idx < TUPLE_LEN(tuple); idx++) - { - list_T *l = list_alloc(); - - if (l == NULL) - break; - - if (list_append_list(rettv->vval.v_list, l) == FAIL) - { - vim_free(l); - break; - } - if (list_append_number(l, idx) == FAIL - || list_append_tv(l, TUPLE_ITEM(tuple, idx)) == FAIL) - break; - } -} - -/* - * Search for item "tv" in tuple "tuple" starting from index "start_idx". - * If "ic" is set to TRUE, then case is ignored. - * - * Returns the index where "tv" is present or -1 if it is not found. - */ - int -index_tuple(tuple_T *tuple, typval_T *tv, int start_idx, int ic) -{ - if (start_idx < 0) - { - start_idx = TUPLE_LEN(tuple) + start_idx; - if (start_idx < 0) - start_idx = 0; - } - - for (int idx = start_idx; idx < TUPLE_LEN(tuple); idx++) - { - if (tv_equal(TUPLE_ITEM(tuple, idx), tv, ic)) - return idx; - } - - return -1; // "tv" not found -} - -/* - * Evaluate 'expr' for each item in the Tuple 'tuple' starting with the item at - * 'startidx' and return the index of the item where 'expr' is TRUE. Returns - * -1 if 'expr' doesn't evaluate to TRUE for any of the items. - */ - int -indexof_tuple(tuple_T *tuple, long startidx, typval_T *expr) -{ - long idx = 0; - int len; - int found; - - if (tuple == NULL) - return -1; - - len = TUPLE_LEN(tuple); - - if (startidx < 0) - { - // negative index: index from the end - startidx = len + startidx; - if (startidx < 0) - startidx = 0; - } - - set_vim_var_type(VV_KEY, VAR_NUMBER); - - int called_emsg_start = called_emsg; - - for (idx = startidx; idx < len; idx++) - { - set_vim_var_nr(VV_KEY, idx); - copy_tv(TUPLE_ITEM(tuple, idx), get_vim_var_tv(VV_VAL)); - - found = indexof_eval_expr(expr); - clear_tv(get_vim_var_tv(VV_VAL)); - - if (found) - return idx; - - if (called_emsg != called_emsg_start) - return -1; - } - - return -1; -} - -/* - * Return the max or min of the items in tuple "tuple". - * If a tuple item is not a number, then "error" is set to TRUE. - */ - varnumber_T -tuple_max_min(tuple_T *tuple, int domax, int *error) -{ - varnumber_T n = 0; - varnumber_T v; - - if (tuple == NULL || TUPLE_LEN(tuple) == 0) - return 0; - - n = tv_get_number_chk(TUPLE_ITEM(tuple, 0), error); - if (*error) - return n; // type error; errmsg already given - - for (int idx = 1; idx < TUPLE_LEN(tuple); idx++) - { - v = tv_get_number_chk(TUPLE_ITEM(tuple, idx), error); - if (*error) - return n; // type error; errmsg already given - if (domax ? v > n : v < n) - n = v; - } - - return n; -} - -/* - * Repeat the tuple "tuple" "n" times and set "rettv" to the new tuple. - */ - void -tuple_repeat(tuple_T *tuple, int n, typval_T *rettv) -{ - rettv->v_type = VAR_TUPLE; - rettv->vval.v_tuple = NULL; - - if (tuple == NULL || TUPLE_LEN(tuple) == 0 || n <= 0) - return; - - if (rettv_tuple_set_with_items(rettv, TUPLE_LEN(tuple) * n) == FAIL) - return; - - tuple_T *new_tuple = rettv->vval.v_tuple; - for (int count = 0; count < n; count++) - { - for (int idx = 0; idx < TUPLE_LEN(tuple); idx++) - { - copy_tv(TUPLE_ITEM(tuple, idx), - TUPLE_ITEM(new_tuple, TUPLE_LEN(new_tuple))); - new_tuple->tv_items.ga_len++; - } - } -} - -/* - * Reverse "tuple" and return the new tuple in "rettv" - */ - void -tuple_reverse(tuple_T *tuple, typval_T *rettv) -{ - rettv->v_type = VAR_TUPLE; - rettv->vval.v_tuple = NULL; - - int len = tuple_len(tuple); - - if (len == 0) - return; - - if (rettv_tuple_set_with_items(rettv, len) == FAIL) - return; - - tuple_T *new_tuple = rettv->vval.v_tuple; - for (int i = 0; i < len; i++) - copy_tv(TUPLE_ITEM(tuple, i), TUPLE_ITEM(new_tuple, len - i - 1)); - new_tuple->tv_items.ga_len = tuple->tv_items.ga_len; -} - -/* - * Tuple reduce() function - */ - void -tuple_reduce(typval_T *argvars, typval_T *expr, typval_T *rettv) -{ - tuple_T *tuple = argvars[0].vval.v_tuple; - int called_emsg_start = called_emsg; - typval_T initial; - int idx = 0; - funccall_T *fc; - typval_T argv[3]; - int r; - - if (argvars[2].v_type == VAR_UNKNOWN) - { - if (tuple == NULL || TUPLE_LEN(tuple) == 0) - { - semsg(_(e_reduce_of_an_empty_str_with_no_initial_value), "Tuple"); - return; - } - initial = *TUPLE_ITEM(tuple, 0); - idx = 1; - } - else - { - initial = argvars[2]; - idx = 0; - } - - copy_tv(&initial, rettv); - - if (tuple == NULL) - return; - - // Create one funccall_T for all eval_expr_typval() calls. - fc = eval_expr_get_funccal(expr, rettv); - - for ( ; idx < TUPLE_LEN(tuple); idx++) - { - argv[0] = *rettv; - rettv->v_type = VAR_UNKNOWN; - argv[1] = *TUPLE_ITEM(tuple, idx); - - r = eval_expr_typval(expr, TRUE, argv, 2, fc, rettv); - - clear_tv(&argv[0]); - - if (r == FAIL || called_emsg != called_emsg_start) - break; - } - - if (fc != NULL) - remove_funccal(); -} - -/* - * Returns TRUE if two tuples with types "type1" and "type2" are addable. - * Otherwise returns FALSE. - */ - int -check_tuples_addable(type_T *type1, type_T *type2) -{ - int addable = TRUE; - - // If the first operand is a variadic tuple and the second argument is - // non-variadic, then concatenation is not possible. - if ((type1->tt_flags & TTFLAG_VARARGS) - && !(type2->tt_flags & TTFLAG_VARARGS) - && (type2->tt_argcount > 0)) - addable = FALSE; - - if ((type1->tt_flags & TTFLAG_VARARGS) - && (type2->tt_flags & TTFLAG_VARARGS)) - { - // two variadic tuples - if (type1->tt_argcount > 1 || type2->tt_argcount > 1) - // one of the variadic tuple has fixed number of items - addable = FALSE; - else if ((type1->tt_argcount == 1 && type2->tt_argcount == 1) - && !equal_type(type1->tt_args[0], type2->tt_args[0], 0)) - // the tuples have different item types - addable = FALSE; - } - - if (!addable) - { - emsg(_(e_cannot_use_variadic_tuple_in_concatenation)); - return FAIL; - } - - return OK; -} - -#endif // defined(FEAT_EVAL) diff --git a/src/typval.c b/src/typval.c index db439cbd..cd39a0d9 100644 --- a/src/typval.c +++ b/src/typval.c @@ -72,9 +72,6 @@ free_tv(typval_T *varp) case VAR_LIST: list_unref(varp->vval.v_list); break; - case VAR_TUPLE: - tuple_unref(varp->vval.v_tuple); - break; case VAR_DICT: dict_unref(varp->vval.v_dict); break; @@ -141,10 +138,6 @@ clear_tv(typval_T *varp) list_unref(varp->vval.v_list); varp->vval.v_list = NULL; break; - case VAR_TUPLE: - tuple_unref(varp->vval.v_tuple); - varp->vval.v_tuple = NULL; - break; case VAR_DICT: dict_unref(varp->vval.v_dict); varp->vval.v_dict = NULL; @@ -241,9 +234,6 @@ tv_get_bool_or_number_chk( case VAR_LIST: emsg(_(e_using_list_as_number)); break; - case VAR_TUPLE: - emsg(_(e_using_tuple_as_number)); - break; case VAR_DICT: emsg(_(e_using_dictionary_as_number)); break; @@ -378,9 +368,6 @@ tv_get_float_chk(typval_T *varp, int *error) case VAR_LIST: emsg(_(e_using_list_as_float)); break; - case VAR_TUPLE: - emsg(_(e_using_tuple_as_float)); - break; case VAR_DICT: emsg(_(e_using_dictionary_as_float)); break; @@ -542,7 +529,7 @@ check_for_bool_arg(typval_T *args, int idx) /* * Give an error and return FAIL unless "args[idx]" is a bool or a number. */ - static int + int check_for_bool_or_number_arg(typval_T *args, int idx) { if (args[idx].v_type != VAR_BOOL && args[idx].v_type != VAR_NUMBER) @@ -632,20 +619,6 @@ check_for_opt_list_arg(typval_T *args, int idx) || check_for_list_arg(args, idx) != FAIL) ? OK : FAIL; } -/* - * Give an error and return FAIL unless "args[idx]" is a tuple. - */ - int -check_for_tuple_arg(typval_T *args, int idx) -{ - if (args[idx].v_type != VAR_TUPLE) - { - semsg(_(e_tuple_required_for_argument_nr), idx + 1); - return FAIL; - } - return OK; -} - /* * Give an error and return FAIL unless "args[idx]" is a dict. */ @@ -854,18 +827,17 @@ check_for_string_or_list_arg(typval_T *args, int idx) } /* - * Give an error and return FAIL unless "args[idx]" is a string, a list, a - * tuple or a blob. + * Give an error and return FAIL unless "args[idx]" is a string, a list or a + * blob. */ int -check_for_string_or_list_or_tuple_or_blob_arg(typval_T *args, int idx) +check_for_string_or_list_or_blob_arg(typval_T *args, int idx) { if (args[idx].v_type != VAR_STRING && args[idx].v_type != VAR_LIST - && args[idx].v_type != VAR_TUPLE && args[idx].v_type != VAR_BLOB) { - semsg(_(e_string_list_tuple_or_blob_required_for_argument_nr), idx + 1); + semsg(_(e_string_list_or_blob_required_for_argument_nr), idx + 1); return FAIL; } return OK; @@ -925,37 +897,35 @@ check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx) } /* - * Give an error and return FAIL unless "args[idx]" is a string, a number, a - * list, a tuple or a blob. + * Give an error and return FAIL unless "args[idx]" is a string or a number + * or a list or a blob. */ int -check_for_repeat_func_arg(typval_T *args, int idx) +check_for_string_or_number_or_list_or_blob_arg(typval_T *args, int idx) { if (args[idx].v_type != VAR_STRING && args[idx].v_type != VAR_NUMBER && args[idx].v_type != VAR_LIST - && args[idx].v_type != VAR_TUPLE && args[idx].v_type != VAR_BLOB) { - semsg(_(e_repeatable_type_required_for_argument_nr), idx + 1); + semsg(_(e_string_number_list_or_blob_required_for_argument_nr), idx + 1); return FAIL; } return OK; } /* - * Give an error and return FAIL unless "args[idx]" is a string, a list, a - * tuple or a dict. + * Give an error and return FAIL unless "args[idx]" is a string or a list + * or a dict. */ int -check_for_string_list_tuple_or_dict_arg(typval_T *args, int idx) +check_for_string_or_list_or_dict_arg(typval_T *args, int idx) { if (args[idx].v_type != VAR_STRING && args[idx].v_type != VAR_LIST - && args[idx].v_type != VAR_TUPLE && args[idx].v_type != VAR_DICT) { - semsg(_(e_string_list_tuple_or_dict_required_for_argument_nr), idx + 1); + semsg(_(e_string_list_or_dict_required_for_argument_nr), idx + 1); return FAIL; } return OK; @@ -993,48 +963,15 @@ check_for_list_or_blob_arg(typval_T *args, int idx) } /* - * Give an error and return FAIL unless "args[idx]" is a list or a tuple. + * Give an error and return FAIL unless "args[idx]" is a list or dict */ int -check_for_list_or_tuple_arg(typval_T *args, int idx) -{ - if (args[idx].v_type != VAR_LIST && args[idx].v_type != VAR_TUPLE) - { - semsg(_(e_list_or_tuple_required_for_argument_nr), idx + 1); - return FAIL; - } - return OK; -} - -/* - * Give an error and return FAIL unless "args[idx]" is a list, a tuple or a - * blob. - */ - int -check_for_list_or_tuple_or_blob_arg(typval_T *args, int idx) +check_for_list_or_dict_arg(typval_T *args, int idx) { if (args[idx].v_type != VAR_LIST - && args[idx].v_type != VAR_TUPLE - && args[idx].v_type != VAR_BLOB) - { - semsg(_(e_list_or_tuple_or_blob_required_for_argument_nr), idx + 1); - return FAIL; - } - return OK; -} - -/* - * Give an error and return FAIL unless "args[idx]" is a list, a tuple or a - * dict - */ - int -check_for_list_or_tuple_or_dict_arg(typval_T *args, int idx) -{ - if (args[idx].v_type != VAR_LIST - && args[idx].v_type != VAR_TUPLE && args[idx].v_type != VAR_DICT) { - semsg(_(e_list_or_tuple_or_dict_required_for_argument_nr), idx + 1); + semsg(_(e_list_or_dict_required_for_argument_nr), idx + 1); return FAIL; } return OK; @@ -1058,19 +995,18 @@ check_for_list_or_dict_or_blob_arg(typval_T *args, int idx) } /* - * Give an error and return FAIL unless "args[idx]" is a list, a tuple, a dict, - * a blob or a string. + * Give an error and return FAIL unless "args[idx]" is a list or dict or a + * blob or a string. */ int -check_for_list_tuple_dict_blob_or_string_arg(typval_T *args, int idx) +check_for_list_or_dict_or_blob_or_string_arg(typval_T *args, int idx) { if (args[idx].v_type != VAR_LIST - && args[idx].v_type != VAR_TUPLE && args[idx].v_type != VAR_DICT && args[idx].v_type != VAR_BLOB && args[idx].v_type != VAR_STRING) { - semsg(_(e_list_tuple_dict_blob_or_string_required_for_argument_nr), idx + 1); + semsg(_(e_list_dict_blob_or_string_required_for_argument_nr), idx + 1); return FAIL; } return OK; @@ -1213,9 +1149,6 @@ tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict) case VAR_LIST: emsg(_(e_using_list_as_string)); break; - case VAR_TUPLE: - emsg(_(e_using_tuple_as_string)); - break; case VAR_DICT: emsg(_(e_using_dictionary_as_string)); break; @@ -1305,7 +1238,6 @@ tv_stringify(typval_T *varp, char_u *buf) { typval_T tmp; - init_tv(&tmp); f_string(varp, &tmp); tv_get_string_buf(&tmp, buf); clear_tv(varp); @@ -1335,10 +1267,6 @@ tv_check_lock(typval_T *tv, char_u *name, int use_gettext) if (tv->vval.v_list != NULL) lock = tv->vval.v_list->lv_lock; break; - case VAR_TUPLE: - if (tv->vval.v_tuple != NULL) - lock = tv->vval.v_tuple->tv_lock; - break; case VAR_DICT: if (tv->vval.v_dict != NULL) lock = tv->vval.v_dict->dv_lock; @@ -1436,15 +1364,6 @@ copy_tv(typval_T *from, typval_T *to) ++to->vval.v_list->lv_refcount; } break; - case VAR_TUPLE: - if (from->vval.v_tuple == NULL) - to->vval.v_tuple = NULL; - else - { - to->vval.v_tuple = from->vval.v_tuple; - ++to->vval.v_tuple->tv_refcount; - } - break; case VAR_DICT: if (from->vval.v_dict == NULL) to->vval.v_dict = NULL; @@ -1533,15 +1452,6 @@ typval_compare( } n1 = res; } - else if (tv1->v_type == VAR_TUPLE || tv2->v_type == VAR_TUPLE) - { - if (typval_compare_tuple(tv1, tv2, type, ic, &res) == FAIL) - { - clear_tv(tv1); - return FAIL; - } - n1 = res; - } else if (tv1->v_type == VAR_OBJECT || tv2->v_type == VAR_OBJECT) { if (typval_compare_object(tv1, tv2, type, ic, &res) == FAIL) @@ -1739,47 +1649,6 @@ typval_compare_list( return OK; } -/* - * Compare "tv1" to "tv2" as tuples according to "type" and "ic". - * Put the result, false or true, in "res". - * Return FAIL and give an error message when the comparison can't be done. - */ - int -typval_compare_tuple( - typval_T *tv1, - typval_T *tv2, - exprtype_T type, - int ic, - int *res) -{ - int val = 0; - - if (type == EXPR_IS || type == EXPR_ISNOT) - { - val = (tv1->v_type == tv2->v_type - && tv1->vval.v_tuple == tv2->vval.v_tuple); - if (type == EXPR_ISNOT) - val = !val; - } - else if (tv1->v_type != tv2->v_type - || (type != EXPR_EQUAL && type != EXPR_NEQUAL)) - { - if (tv1->v_type != tv2->v_type) - emsg(_(e_can_only_compare_tuple_with_tuple)); - else - emsg(_(e_invalid_operation_for_tuple)); - return FAIL; - } - else - { - val = tuple_equal(tv1->vval.v_tuple, tv2->vval.v_tuple, ic); - if (type == EXPR_NEQUAL) - val = !val; - } - *res = val; - return OK; -} - /* * Compare v:null with another type. Return TRUE if the value is NULL. */ @@ -1805,7 +1674,6 @@ typval_compare_null(typval_T *tv1, typval_T *tv2) case VAR_JOB: return tv->vval.v_job == NULL; #endif case VAR_LIST: return tv->vval.v_list == NULL; - case VAR_TUPLE: return tv->vval.v_tuple == NULL; case VAR_OBJECT: return tv->vval.v_object == NULL; case VAR_PARTIAL: return tv->vval.v_partial == NULL; case VAR_STRING: return tv->vval.v_string == NULL; @@ -2096,9 +1964,6 @@ tv_islocked(typval_T *tv) || (tv->v_type == VAR_LIST && tv->vval.v_list != NULL && (tv->vval.v_list->lv_lock & VAR_LOCKED)) - || (tv->v_type == VAR_TUPLE - && tv->vval.v_tuple != NULL - && (tv->vval.v_tuple->tv_lock & VAR_LOCKED)) || (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL && (tv->vval.v_dict->dv_lock & VAR_LOCKED)); @@ -2213,12 +2078,6 @@ tv_equal( --recursive_cnt; return r; - case VAR_TUPLE: - ++recursive_cnt; - r = tuple_equal(tv1->vval.v_tuple, tv2->vval.v_tuple, ic); - --recursive_cnt; - return r; - case VAR_DICT: ++recursive_cnt; r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic); diff --git a/src/usercmd.c b/src/usercmd.c index ded11e75..ff2c353e 100644 --- a/src/usercmd.c +++ b/src/usercmd.c @@ -71,7 +71,6 @@ static keyvalue_T command_complete_tab[] = KEYVALUE_ENTRY(EXPAND_FILES, "file"), KEYVALUE_ENTRY(EXPAND_FILES_IN_PATH, "file_in_path"), KEYVALUE_ENTRY(EXPAND_FILETYPE, "filetype"), - KEYVALUE_ENTRY(EXPAND_FILETYPECMD, "filetypecmd"), KEYVALUE_ENTRY(EXPAND_FUNCTIONS, "function"), KEYVALUE_ENTRY(EXPAND_HELP, "help"), KEYVALUE_ENTRY(EXPAND_HIGHLIGHT, "highlight"), @@ -606,8 +605,7 @@ uc_list(char_u *name, size_t name_len) msg_outtrans_attr(cmd->uc_name, HL_ATTR(HLF_D)); len = (int)cmd->uc_namelen + 4; - do - { + do { msg_putchar(' '); ++len; } while (len < 22); @@ -627,8 +625,7 @@ uc_list(char_u *name, size_t name_len) case (EX_EXTRA|EX_NOSPC|EX_NEEDARG): IObuff[len++] = '1'; break; } - do - { + do { IObuff[len++] = ' '; } while (len < 5 - over); @@ -651,8 +648,7 @@ uc_list(char_u *name, size_t name_len) IObuff[len++] = '.'; } - do - { + do { IObuff[len++] = ' '; } while (len < 8 - over); @@ -666,8 +662,7 @@ uc_list(char_u *name, size_t name_len) break; } - do - { + do { IObuff[len++] = ' '; } while (len < 13 - over); @@ -692,8 +687,7 @@ uc_list(char_u *name, size_t name_len) #endif } - do - { + do { IObuff[len++] = ' '; } while (len < 25 - over); diff --git a/src/userfunc.c b/src/userfunc.c index 76cfd441..d8d7014a 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -4838,117 +4838,6 @@ list_functions(regmatch_T *regmatch) } } -/* - * ":function /pat": list functions matching pattern. - */ - static char_u * -list_functions_matching_pat(exarg_T *eap) -{ - char_u *p; - char_u c; - - p = skip_regexp(eap->arg + 1, '/', TRUE); - if (!eap->skip) - { - regmatch_T regmatch; - - c = *p; - *p = NUL; - regmatch.regprog = vim_regcomp(eap->arg + 1, RE_MAGIC); - *p = c; - if (regmatch.regprog != NULL) - { - regmatch.rm_ic = p_ic; - list_functions(®match); - vim_regfree(regmatch.regprog); - } - } - if (*p == '/') - ++p; - - return p; -} - -/* - * List function "name". - * Returns the function pointer or NULL on failure. - */ - static ufunc_T * -list_one_function(exarg_T *eap, char_u *name, char_u *p, int is_global) -{ - ufunc_T *fp = NULL; - int j; - - if (!ends_excmd(*skipwhite(p))) - { - semsg(_(e_trailing_characters_str), p); - return NULL; - } - - set_nextcmd(eap, p); - - if (eap->nextcmd != NULL) - *p = NUL; - - if (eap->skip || got_int) - return NULL; - - fp = find_func(name, is_global); - if (fp == NULL && ASCII_ISUPPER(*eap->arg)) - { - char_u *up = untrans_function_name(name); - - // With Vim9 script the name was made script-local, if not - // found try again with the original name. - if (up != NULL) - fp = find_func(up, FALSE); - } - - if (fp == NULL) - { - emsg_funcname(e_undefined_function_str, eap->arg); - return NULL; - } - - // Check no function was added or removed from a timer, e.g. at - // the more prompt. "fp" may then be invalid. - int prev_ht_changed = func_hashtab.ht_changed; - - if (list_func_head(fp, TRUE) != OK) - return fp; - - for (j = 0; j < fp->uf_lines.ga_len && !got_int; ++j) - { - if (FUNCLINE(fp, j) == NULL) - continue; - msg_putchar('\n'); - msg_outnum((long)(j + 1)); - if (j < 9) - msg_putchar(' '); - if (j < 99) - msg_putchar(' '); - if (function_list_modified(prev_ht_changed)) - break; - msg_prt_line(FUNCLINE(fp, j), FALSE); - out_flush(); // show a line at a time - ui_breakcheck(); - } - - if (!got_int) - { - msg_putchar('\n'); - if (!function_list_modified(prev_ht_changed)) - { - if (fp->uf_def_status != UF_NOT_COMPILED) - msg_puts(" enddef"); - else - msg_puts(" endfunction"); - } - } - - return fp; -} - /* * ":function" also supporting nested ":def". * When "name_arg" is not NULL this is a nested function, using "name_arg" for @@ -4969,6 +4858,7 @@ define_function( int obj_member_count) { int j; + int c; int saved_did_emsg = FALSE; char_u *name = name_arg; size_t namelen = 0; @@ -4998,7 +4888,9 @@ define_function( int vim9script = in_vim9script(); imported_T *import = NULL; - // ":function" without argument: list functions. + /* + * ":function" without argument: list functions. + */ if (ends_excmd2(eap->cmd, eap->arg)) { if (!eap->skip) @@ -5012,7 +4904,24 @@ define_function( */ if (*eap->arg == '/') { - p = list_functions_matching_pat(eap); + p = skip_regexp(eap->arg + 1, '/', TRUE); + if (!eap->skip) + { + regmatch_T regmatch; + + c = *p; + *p = NUL; + regmatch.regprog = vim_regcomp(eap->arg + 1, RE_MAGIC); + *p = c; + if (regmatch.regprog != NULL) + { + regmatch.rm_ic = p_ic; + list_functions(®match); + vim_regfree(regmatch.regprog); + } + } + if (*p == '/') + ++p; set_nextcmd(eap, p); return NULL; } @@ -5118,7 +5027,67 @@ define_function( */ if (!paren) { - fp = list_one_function(eap, name, p, is_global); + if (!ends_excmd(*skipwhite(p))) + { + semsg(_(e_trailing_characters_str), p); + goto ret_free; + } + set_nextcmd(eap, p); + if (eap->nextcmd != NULL) + *p = NUL; + if (!eap->skip && !got_int) + { + fp = find_func(name, is_global); + if (fp == NULL && ASCII_ISUPPER(*eap->arg)) + { + char_u *up = untrans_function_name(name); + + // With Vim9 script the name was made script-local, if not + // found try again with the original name. + if (up != NULL) + fp = find_func(up, FALSE); + } + + if (fp != NULL) + { + // Check no function was added or removed from a timer, e.g. at + // the more prompt. "fp" may then be invalid. + int prev_ht_changed = func_hashtab.ht_changed; + + if (list_func_head(fp, TRUE) == OK) + { + for (j = 0; j < fp->uf_lines.ga_len && !got_int; ++j) + { + if (FUNCLINE(fp, j) == NULL) + continue; + msg_putchar('\n'); + msg_outnum((long)(j + 1)); + if (j < 9) + msg_putchar(' '); + if (j < 99) + msg_putchar(' '); + if (function_list_modified(prev_ht_changed)) + break; + msg_prt_line(FUNCLINE(fp, j), FALSE); + out_flush(); // show a line at a time + ui_breakcheck(); + } + if (!got_int) + { + msg_putchar('\n'); + if (!function_list_modified(prev_ht_changed)) + { + if (fp->uf_def_status != UF_NOT_COMPILED) + msg_puts(" enddef"); + else + msg_puts(" endfunction"); + } + } + } + } + else + emsg_funcname(e_undefined_function_str, eap->arg); + } goto ret_free; } @@ -7317,9 +7286,9 @@ set_ref_in_previous_funccal(int copyID) for (fc = previous_funccal; fc != NULL; fc = fc->fc_caller) { fc->fc_copyID = copyID + 1; - if (set_ref_in_ht(&fc->fc_l_vars.dv_hashtab, copyID + 1, NULL, NULL) - || set_ref_in_ht(&fc->fc_l_avars.dv_hashtab, copyID + 1, NULL, NULL) - || set_ref_in_list_items(&fc->fc_l_varlist, copyID + 1, NULL, NULL)) + if (set_ref_in_ht(&fc->fc_l_vars.dv_hashtab, copyID + 1, NULL) + || set_ref_in_ht(&fc->fc_l_avars.dv_hashtab, copyID + 1, NULL) + || set_ref_in_list_items(&fc->fc_l_varlist, copyID + 1, NULL)) return TRUE; } return FALSE; @@ -7331,9 +7300,9 @@ set_ref_in_funccal(funccall_T *fc, int copyID) if (fc->fc_copyID != copyID) { fc->fc_copyID = copyID; - if (set_ref_in_ht(&fc->fc_l_vars.dv_hashtab, copyID, NULL, NULL) - || set_ref_in_ht(&fc->fc_l_avars.dv_hashtab, copyID, NULL, NULL) - || set_ref_in_list_items(&fc->fc_l_varlist, copyID, NULL, NULL) + if (set_ref_in_ht(&fc->fc_l_vars.dv_hashtab, copyID, NULL) + || set_ref_in_ht(&fc->fc_l_avars.dv_hashtab, copyID, NULL) + || set_ref_in_list_items(&fc->fc_l_varlist, copyID, NULL) || set_ref_in_func(NULL, fc->fc_func, copyID)) return TRUE; } @@ -7396,7 +7365,7 @@ set_ref_in_func_args(int copyID) for (i = 0; i < funcargs.ga_len; ++i) if (set_ref_in_item(((typval_T **)funcargs.ga_data)[i], - copyID, NULL, NULL, NULL)) + copyID, NULL, NULL)) return TRUE; return FALSE; } diff --git a/src/version.c b/src/version.c index a2cfb00f..f50c414a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,316 +704,6 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ -/**/ - 1385, -/**/ - 1384, -/**/ - 1383, -/**/ - 1382, -/**/ - 1381, -/**/ - 1380, -/**/ - 1379, -/**/ - 1378, -/**/ - 1377, -/**/ - 1376, -/**/ - 1375, -/**/ - 1374, -/**/ - 1373, -/**/ - 1372, -/**/ - 1371, -/**/ - 1370, -/**/ - 1369, -/**/ - 1368, -/**/ - 1367, -/**/ - 1366, -/**/ - 1365, -/**/ - 1364, -/**/ - 1363, -/**/ - 1362, -/**/ - 1361, -/**/ - 1360, -/**/ - 1359, -/**/ - 1358, -/**/ - 1357, -/**/ - 1356, -/**/ - 1355, -/**/ - 1354, -/**/ - 1353, -/**/ - 1352, -/**/ - 1351, -/**/ - 1350, -/**/ - 1349, -/**/ - 1348, -/**/ - 1347, -/**/ - 1346, -/**/ - 1345, -/**/ - 1344, -/**/ - 1343, -/**/ - 1342, -/**/ - 1341, -/**/ - 1340, -/**/ - 1339, -/**/ - 1338, -/**/ - 1337, -/**/ - 1336, -/**/ - 1335, -/**/ - 1334, -/**/ - 1333, -/**/ - 1332, -/**/ - 1331, -/**/ - 1330, -/**/ - 1329, -/**/ - 1328, -/**/ - 1327, -/**/ - 1326, -/**/ - 1325, -/**/ - 1324, -/**/ - 1323, -/**/ - 1322, -/**/ - 1321, -/**/ - 1320, -/**/ - 1319, -/**/ - 1318, -/**/ - 1317, -/**/ - 1316, -/**/ - 1315, -/**/ - 1314, -/**/ - 1313, -/**/ - 1312, -/**/ - 1311, -/**/ - 1310, -/**/ - 1309, -/**/ - 1308, -/**/ - 1307, -/**/ - 1306, -/**/ - 1305, -/**/ - 1304, -/**/ - 1303, -/**/ - 1302, -/**/ - 1301, -/**/ - 1300, -/**/ - 1299, -/**/ - 1298, -/**/ - 1297, -/**/ - 1296, -/**/ - 1295, -/**/ - 1294, -/**/ - 1293, -/**/ - 1292, -/**/ - 1291, -/**/ - 1290, -/**/ - 1289, -/**/ - 1288, -/**/ - 1287, -/**/ - 1286, -/**/ - 1285, -/**/ - 1284, -/**/ - 1283, -/**/ - 1282, -/**/ - 1281, -/**/ - 1280, -/**/ - 1279, -/**/ - 1278, -/**/ - 1277, -/**/ - 1276, -/**/ - 1275, -/**/ - 1274, -/**/ - 1273, -/**/ - 1272, -/**/ - 1271, -/**/ - 1270, -/**/ - 1269, -/**/ - 1268, -/**/ - 1267, -/**/ - 1266, -/**/ - 1265, -/**/ - 1264, -/**/ - 1263, -/**/ - 1262, -/**/ - 1261, -/**/ - 1260, -/**/ - 1259, -/**/ - 1258, -/**/ - 1257, -/**/ - 1256, -/**/ - 1255, -/**/ - 1254, -/**/ - 1253, -/**/ - 1252, -/**/ - 1251, -/**/ - 1250, -/**/ - 1249, -/**/ - 1248, -/**/ - 1247, -/**/ - 1246, -/**/ - 1245, -/**/ - 1244, -/**/ - 1243, -/**/ - 1242, -/**/ - 1241, -/**/ - 1240, -/**/ - 1239, -/**/ - 1238, -/**/ - 1237, -/**/ - 1236, -/**/ - 1235, -/**/ - 1234, -/**/ - 1233, -/**/ - 1232, -/**/ - 1231, /**/ 1230, /**/ diff --git a/src/vim.h b/src/vim.h index fbe5c341..85fad6ce 100644 --- a/src/vim.h +++ b/src/vim.h @@ -87,13 +87,6 @@ # endif #endif -// C89 does not define SIZE_MAX -#if defined(__hpux) || defined(VMS) -# ifndef SIZE_MAX -# define SIZE_MAX ((size_t)(-1)) -# endif -#endif - // user ID of root is usually zero, but not for everybody #ifdef __TANDEM # ifndef _TANDEM_SOURCE @@ -854,7 +847,6 @@ extern int (*dyn_libintl_wputenv)(const wchar_t *envstring); #define EXPAND_SHELLCMDLINE 60 #define EXPAND_FINDFUNC 61 #define EXPAND_HIGHLIGHT_GROUP 62 -#define EXPAND_FILETYPECMD 63 // Values for exmode_active (0 is no exmode) @@ -1372,7 +1364,6 @@ enum auto_event EVENT_BUFWRITEPRE, // before writing a buffer EVENT_CMDLINECHANGED, // command line was modified EVENT_CMDLINEENTER, // after entering the command line - EVENT_CMDLINELEAVEPRE, // just before leaving the command line EVENT_CMDLINELEAVE, // before leaving the command line EVENT_CMDUNDEFINED, // command undefined EVENT_CMDWINENTER, // after entering the cmdline window @@ -1519,8 +1510,7 @@ typedef enum , HLF_ADD // Added diff line , HLF_CHD // Changed diff line , HLF_DED // Deleted diff line - , HLF_TXD // Text Changed in changed diff line - , HLF_TXA // Text Added in changed diff line + , HLF_TXD // Text Changed in diff line , HLF_CONCEAL // Concealed text , HLF_SC // Sign column , HLF_SPB // SpellBad @@ -1554,7 +1544,7 @@ typedef enum // When changing this also adjust the default for 'highlight'. #define HL_FLAGS {'8', '~', '@', 'd', 'e', 'h', 'i', 'l', 'y', 'm', 'M', \ 'n', 'a', 'b', 'N', 'G', 'O', 'r', 's', 'S', 'c', 't', 'v', 'V', \ - 'w', 'W', 'f', 'F', 'A', 'C', 'D', 'T', 'E', '-', '>', \ + 'w', 'W', 'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \ 'B', 'P', 'R', 'L', \ '+', '=', 'k', '<','[', ']', '{', '}', 'x', 'X', \ '*', '#', '_', '!', '.', 'o', 'q', \ @@ -2211,8 +2201,7 @@ typedef int sock_T; #define VV_TYPE_ENUM 108 #define VV_TYPE_ENUMVALUE 109 #define VV_STACKTRACE 110 -#define VV_TYPE_TUPLE 111 -#define VV_LEN 112 // number of v: vars +#define VV_LEN 111 // number of v: vars // used for v_number in VAR_BOOL and VAR_SPECIAL #define VVAL_FALSE 0L // VAR_BOOL @@ -2238,7 +2227,6 @@ typedef int sock_T; #define VAR_TYPE_TYPEALIAS 14 #define VAR_TYPE_ENUM 15 #define VAR_TYPE_ENUMVALUE 16 -#define VAR_TYPE_TUPLE 17 #define DICT_MAXNEST 100 // maximum nesting of lists and dicts diff --git a/src/vim9.h b/src/vim9.h index c10d435a..7c731fa6 100644 --- a/src/vim9.h +++ b/src/vim9.h @@ -105,8 +105,6 @@ typedef enum { ISN_PUSHCLASS, // push class, uses isn_arg.classarg ISN_NEWLIST, // push list from stack items, size is isn_arg.number // -1 for null_list - ISN_NEWTUPLE, // push tuple from stack items, size is isn_arg.number - // -1 for null_list ISN_NEWDICT, // push dict from stack items, size is isn_arg.number // -1 for null_dict ISN_NEWPARTIAL, // push NULL partial @@ -151,7 +149,6 @@ typedef enum { // more expression operations ISN_ADDLIST, // add two lists - ISN_ADDTUPLE, // add two tuples ISN_ADDBLOB, // add two blobs // operation with two arguments; isn_arg.op.op_type is exprtype_T @@ -168,7 +165,6 @@ typedef enum { ISN_COMPARESTRING, ISN_COMPAREBLOB, ISN_COMPARELIST, - ISN_COMPARETUPLE, ISN_COMPAREDICT, ISN_COMPAREFUNC, ISN_COMPAREANY, @@ -181,8 +177,6 @@ typedef enum { ISN_LISTAPPEND, // append to a list, like add() ISN_LISTINDEX, // [expr] list index ISN_LISTSLICE, // [expr:expr] list slice - ISN_TUPLEINDEX, // [expr] tuple index - ISN_TUPLESLICE, // [expr:expr] tuple slice ISN_BLOBINDEX, // [expr] blob index ISN_BLOBSLICE, // [expr:expr] blob slice ISN_ANYINDEX, // [expr] runtime index diff --git a/src/vim9class.c b/src/vim9class.c index a82cc133..1c54474e 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -2928,13 +2928,11 @@ get_member_tv( object_T *obj = rettv->vval.v_object; typval_T *tv = (typval_T *)(obj + 1) + m_idx; copy_tv(tv, rettv); - set_tv_type(rettv, m->ocm_type); object_unref(obj); } else { copy_tv(&cl->class_members_tv[m_idx], rettv); - set_tv_type(rettv, m->ocm_type); class_unref(cl); } @@ -3652,7 +3650,7 @@ class_free_nonref(int copyID) set_ref_in_classes(int copyID) { for (class_T *cl = first_class; cl != NULL; cl = cl->class_next_used) - set_ref_in_item_class(cl, copyID, NULL, NULL, NULL); + set_ref_in_item_class(cl, copyID, NULL, NULL); return FALSE; } @@ -4134,12 +4132,7 @@ f_instanceof(typval_T *argvars, typval_T *rettv) return; if (object_tv->vval.v_object == NULL) - { - if (classinfo_tv->vval.v_class == NULL) - // consider null_object as an instance of null_class - rettv->vval.v_number = VVAL_TRUE; return; - } for (; classinfo_tv->v_type != VAR_UNKNOWN; ++classinfo_tv) { diff --git a/src/vim9cmds.c b/src/vim9cmds.c index d4ffb933..aeb742e5 100644 --- a/src/vim9cmds.c +++ b/src/vim9cmds.c @@ -99,7 +99,7 @@ check_vim9_unlet(char_u *name) if (name[1] != ':' || vim_strchr((char_u *)"gwtb", *name) == NULL) { // "unlet s:var" is allowed in legacy script. - if (*name == 's' && !in_vim9script()) + if (*name == 's' && !script_is_vim9()) return OK; semsg(_(e_cannot_unlet_str), name); return FAIL; @@ -870,40 +870,6 @@ compile_fill_loop_info(loop_info_T *loop_info, int funcref_idx, cctx_T *cctx) loop_info->li_closure_count = cctx->ctx_closure_count; } -/* - * When compiling a for loop to iterate over a tuple, get the type of the loop - * variable to use. - */ - static type_T * -compile_for_tuple_get_vartype(type_T *vartype, int var_list) -{ - // If this is not a variadic tuple, or all the tuple items don't have - // the same type, then use t_any - if (!(vartype->tt_flags & TTFLAG_VARARGS) || vartype->tt_argcount != 1) - return &t_any; - - // variadic tuple - type_T *member_type = vartype->tt_args[0]->tt_member; - if (member_type->tt_type == VAR_ANY) - return &t_any; - - if (!var_list) - // for x in tuple<...list> - return member_type; - - if (member_type->tt_type == VAR_LIST - && member_type->tt_member->tt_type != VAR_ANY) - // for [x, y] in tuple<...list>> - return member_type->tt_member; - else if (member_type->tt_type == VAR_TUPLE - && member_type->tt_flags & TTFLAG_VARARGS - && member_type->tt_argcount == 1) - // for [x, y] in tuple<...list>>> - return member_type->tt_args[0]->tt_member; - - return &t_any; -} - /* * Compile "for var in expr": * @@ -1034,7 +1000,6 @@ compile_for(char_u *arg_start, cctx_T *cctx) // give an error now. vartype = get_type_on_stack(cctx, 0); if (vartype->tt_type != VAR_LIST - && vartype->tt_type != VAR_TUPLE && vartype->tt_type != VAR_STRING && vartype->tt_type != VAR_BLOB && vartype->tt_type != VAR_ANY @@ -1059,8 +1024,6 @@ compile_for(char_u *arg_start, cctx_T *cctx) && vartype->tt_member->tt_member->tt_type != VAR_ANY) item_type = vartype->tt_member->tt_member; } - else if (vartype->tt_type == VAR_TUPLE) - item_type = compile_for_tuple_get_vartype(vartype, var_list); // CMDMOD_REV must come before the FOR instruction. generate_undo_cmdmods(cctx); diff --git a/src/vim9compile.c b/src/vim9compile.c index b3cf86c9..cb7b9482 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -287,6 +287,15 @@ update_script_var_block_id(char_u *name, int block_id) sav->sav_block_id = block_id; } +/* + * Return TRUE if the script context is Vim9 script. + */ + int +script_is_vim9(void) +{ + return SCRIPT_ITEM(current_sctx.sc_sid)->sn_version == SCRIPT_VERSION_VIM9; +} + /* * Lookup a variable (without s: prefix) in the current script. * "cctx" is NULL at the script level, "cstack" is NULL in a function. @@ -297,7 +306,7 @@ script_var_exists(char_u *name, size_t len, cctx_T *cctx, cstack_T *cstack) { if (current_sctx.sc_sid <= 0) return FAIL; - if (current_script_is_vim9()) + if (script_is_vim9()) { // Check script variables that were visible where the function was // defined. @@ -515,10 +524,8 @@ use_typecheck(type_T *actual, type_T *expected) return TRUE; if (actual->tt_type == VAR_OBJECT && expected->tt_type == VAR_OBJECT) return TRUE; - if ((actual->tt_type == VAR_LIST - || actual->tt_type == VAR_TUPLE - || actual->tt_type == VAR_DICT) - && actual->tt_type == expected->tt_type) + if ((actual->tt_type == VAR_LIST || actual->tt_type == VAR_DICT) + && actual->tt_type == expected->tt_type) // This takes care of a nested list or dict. return use_typecheck(actual->tt_member, expected->tt_member); return FALSE; @@ -2489,8 +2496,7 @@ compile_load_lhs( : get_type_on_stack(cctx, 0); if (lhs->lhs_type->tt_type == VAR_CLASS - || (lhs->lhs_type->tt_type == VAR_OBJECT - && lhs->lhs_type != &t_object_any)) + || lhs->lhs_type->tt_type == VAR_OBJECT) { // Check whether the class or object variable is modifiable if (!lhs_class_member_modifiable(lhs, var_start, cctx)) @@ -2514,7 +2520,7 @@ compile_load_lhs( return OK; } - return generate_loadvar(cctx, lhs); + return generate_loadvar(cctx, lhs); } /* @@ -2636,10 +2642,7 @@ compile_assign_unlet( && lhs->lhs_type != &t_blob && lhs->lhs_type != &t_any) { - if (lhs->lhs_type->tt_type == VAR_TUPLE) - emsg(_(e_cannot_slice_tuple)); - else - semsg(_(e_cannot_use_range_with_assignment_str), var_start); + semsg(_(e_cannot_use_range_with_assignment_str), var_start); return FAIL; } @@ -2740,10 +2743,7 @@ compile_assign_unlet( } else { - if (dest_type == VAR_TUPLE) - emsg(_(e_tuple_is_immutable)); - else - emsg(_(e_indexable_type_required)); + emsg(_(e_indexable_type_required)); return FAIL; } @@ -2785,9 +2785,6 @@ push_default_value( case VAR_LIST: r = generate_NEWLIST(cctx, 0, FALSE); break; - case VAR_TUPLE: - r = generate_NEWTUPLE(cctx, 0, FALSE); - break; case VAR_DICT: r = generate_NEWDICT(cctx, 0, FALSE); break; @@ -3018,31 +3015,11 @@ compile_assign_list_check_rhs_type(cctx_T *cctx, cac_T *cac) return FAIL; } - if (stacktype->tt_type != VAR_LIST && stacktype->tt_type != VAR_TUPLE - && stacktype->tt_type != VAR_ANY) - { - emsg(_(e_list_or_tuple_required)); + if (need_type(stacktype, &t_list_any, FALSE, -1, 0, cctx, + FALSE, FALSE) == FAIL) return FAIL; - } - if (need_type(stacktype, - stacktype->tt_type == VAR_TUPLE ? &t_tuple_any : &t_list_any, - FALSE, -1, 0, cctx, FALSE, FALSE) == FAIL) - return FAIL; - - if (stacktype->tt_type == VAR_TUPLE) - { - if (stacktype->tt_argcount != 1) - cac->cac_rhs_type = &t_any; - else - { - if (stacktype->tt_flags & TTFLAG_VARARGS) - cac->cac_rhs_type = stacktype->tt_args[0]->tt_member; - else - cac->cac_rhs_type = stacktype->tt_args[0]; - } - } - else if (stacktype->tt_member != NULL) + if (stacktype->tt_member != NULL) cac->cac_rhs_type = stacktype->tt_member; return OK; @@ -3066,7 +3043,7 @@ compile_assign_list_check_length(cctx_T *cctx, cac_T *cac) isn_T *isn = ((isn_T *)cac->cac_instr->ga_data) + cac->cac_instr->ga_len - 1; - if (isn->isn_type == ISN_NEWLIST || isn->isn_type == ISN_NEWTUPLE) + if (isn->isn_type == ISN_NEWLIST) { did_check = TRUE; if (cac->cac_semicolon ? @@ -3431,17 +3408,6 @@ compile_assign_compound_op(cctx_T *cctx, cac_T *cac) type_T *expected; type_T *stacktype = NULL; - if (cac->cac_lhs.lhs_type->tt_type == VAR_TUPLE) - { - // compound operators are not supported with a tuple - char_u op[2]; - - op[0] = *cac->cac_op; - op[1] = NUL; - semsg(_(e_wrong_variable_type_for_str_equal), op); - return FAIL; - } - if (*cac->cac_op == '.') { if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL) @@ -3520,11 +3486,8 @@ compile_assign_generate_store(cctx_T *cctx, cac_T *cac) && lhs->lhs_type->tt_member != NULL && lhs->lhs_type->tt_member != &t_any && lhs->lhs_type->tt_member != &t_unknown) - // Set the type in the list or dict, so that it can be - // checked, also in legacy script. - generate_SETTYPE(cctx, lhs->lhs_type); - else if (lhs->lhs_type->tt_type == VAR_TUPLE - && lhs->lhs_type->tt_argcount != 0) + // Set the type in the list or dict, so that it can be checked, + // also in legacy script. generate_SETTYPE(cctx, lhs->lhs_type); else if (inferred_type != NULL && (inferred_type->tt_type == VAR_DICT @@ -3532,12 +3495,8 @@ compile_assign_generate_store(cctx_T *cctx, cac_T *cac) && inferred_type->tt_member != NULL && inferred_type->tt_member != &t_unknown && inferred_type->tt_member != &t_any) - // Set the type in the list or dict, so that it can be - // checked, also in legacy script. - generate_SETTYPE(cctx, inferred_type); - else if (inferred_type != NULL - && inferred_type->tt_type == VAR_TUPLE - && inferred_type->tt_argcount > 0) + // Set the type in the list or dict, so that it can be checked, + // also in legacy script. generate_SETTYPE(cctx, inferred_type); if (!cac->cac_skip_store && @@ -4071,15 +4030,13 @@ obj_constructor_prologue(ufunc_T *ufunc, cctx_T *cctx) else push_default_value(cctx, m->ocm_type->tt_type, FALSE, NULL); - if (((m->ocm_type->tt_type == VAR_DICT - || m->ocm_type->tt_type == VAR_LIST) - && m->ocm_type->tt_member != NULL - && m->ocm_type->tt_member != &t_any - && m->ocm_type->tt_member != &t_unknown) - || (m->ocm_type->tt_type == VAR_TUPLE - && m->ocm_type->tt_argcount > 0)) - // Set the type in the list, tuple or dict, so that it can be - // checked, also in legacy script. + if ((m->ocm_type->tt_type == VAR_DICT + || m->ocm_type->tt_type == VAR_LIST) + && m->ocm_type->tt_member != NULL + && m->ocm_type->tt_member != &t_any + && m->ocm_type->tt_member != &t_unknown) + // Set the type in the list or dict, so that it can be checked, + // also in legacy script. generate_SETTYPE(cctx, m->ocm_type); generate_STORE_THIS(cctx, i); diff --git a/src/vim9execute.c b/src/vim9execute.c index 55f9d432..c0c3103d 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -110,11 +110,6 @@ static garray_T profile_info_ga = {0, 0, sizeof(profinfo_T), 20, NULL}; // Get pointer to a local variable on the stack. Negative for arguments. #define STACK_TV_VAR(idx) (((typval_T *)ectx->ec_stack.ga_data) + ectx->ec_frame_idx + STACK_FRAME_SIZE + idx) -// Return value for functions used to execute instructions -#define EXEC_FAIL 0 -#define EXEC_OK 1 -#define EXEC_DONE 2 - void to_string_error(vartype_T vartype) { @@ -211,46 +206,6 @@ exe_newlist(int count, ectx_T *ectx) return OK; } -/* - * Create a new tuple from "count" items at the bottom of the stack. - * When "count" is zero an empty tuple is added to the stack. - * When "count" is -1 a NULL tuple is added to the stack. - */ - static int -exe_newtuple(int count, ectx_T *ectx) -{ - tuple_T *tuple = NULL; - int idx; - typval_T *tv; - - if (count >= 0) - { - tuple = tuple_alloc_with_items(count); - if (tuple == NULL) - return FAIL; - for (idx = 0; idx < count; ++idx) - tuple_set_item(tuple, idx, STACK_TV_BOT(idx - count)); - } - - if (count > 0) - ectx->ec_stack.ga_len -= count - 1; - else if (GA_GROW_FAILS(&ectx->ec_stack, 1)) - { - tuple_unref(tuple); - return FAIL; - } - else - ++ectx->ec_stack.ga_len; - tv = STACK_TV_BOT(-1); - tv->v_type = VAR_TUPLE; - tv->vval.v_tuple = tuple; - tv->v_lock = 0; - if (tuple != NULL) - ++tuple->tv_refcount; - - return OK; -} - /* * Implementation of ISN_NEWDICT. * Returns FAIL on total failure, MAYBE on error. @@ -968,7 +923,7 @@ set_ref_in_funcstacks(int copyID) int i; for (i = 0; i < funcstack->fs_ga.ga_len; ++i) - if (set_ref_in_item(stack + i, copyID, NULL, NULL, NULL)) + if (set_ref_in_item(stack + i, copyID, NULL, NULL)) return TRUE; // abort } return FALSE; @@ -1763,10 +1718,6 @@ allocate_if_null(svar_T *sv) if (tv->vval.v_list == NULL && sv->sv_type != &t_list_empty) (void)rettv_list_alloc(tv); break; - case VAR_TUPLE: - if (tv->vval.v_tuple == NULL && sv->sv_type != &t_tuple_empty) - (void)rettv_tuple_alloc(tv); - break; case VAR_DICT: if (tv->vval.v_dict == NULL && sv->sv_type != &t_dict_empty) (void)rettv_dict_alloc(tv); @@ -2513,11 +2464,6 @@ execute_storeindex(isn_T *iptr, ectx_T *ectx) clear_tv(&otv[lidx]); otv[lidx] = *tv; } - else if (dest_type == VAR_TUPLE) - { - emsg(_(e_tuple_is_immutable)); - status = FAIL; - } else { status = FAIL; @@ -2856,20 +2802,6 @@ execute_for(isn_T *iptr, ectx_T *ectx) ++ectx->ec_stack.ga_len; } } - else if (ltv->v_type == VAR_TUPLE) - { - tuple_T *tuple = ltv->vval.v_tuple; - - // push the next item from the tuple - ++idxtv->vval.v_number; - if (tuple == NULL || idxtv->vval.v_number >= TUPLE_LEN(tuple)) - jump = TRUE; - else - { - copy_tv(TUPLE_ITEM(tuple, idxtv->vval.v_number), STACK_TV_BOT(0)); - ++ectx->ec_stack.ga_len; - } - } else if (ltv->v_type == VAR_STRING) { char_u *str = ltv->vval.v_string; @@ -3134,7 +3066,7 @@ set_ref_in_loopvars(int copyID) int i; for (i = 0; i < loopvars->lvs_ga.ga_len; ++i) - if (set_ref_in_item(stack + i, copyID, NULL, NULL, NULL)) + if (set_ref_in_item(stack + i, copyID, NULL, NULL)) return TRUE; // abort } return FALSE; @@ -3372,145 +3304,6 @@ isn_put_do(ectx_T *ectx, isn_T *iptr, typval_T *tv, int fixindent) vim_free(expr); } -/* - * Execute the ISN_UNPACK instruction for a List - */ - static int -exec_unpack_list(ectx_T *ectx, isn_T *iptr, typval_T *tv) -{ - int count = iptr->isn_arg.unpack.unp_count; - int semicolon = iptr->isn_arg.unpack.unp_semicolon; - list_T *l; - listitem_T *li; - int i; - - l = tv->vval.v_list; - if (l == NULL - || l->lv_len < (semicolon ? count - 1 : count)) - { - SOURCING_LNUM = iptr->isn_lnum; - emsg(_(e_list_value_does_not_have_enough_items)); - return EXEC_FAIL; - } - else if (!semicolon && l->lv_len > count) - { - SOURCING_LNUM = iptr->isn_lnum; - emsg(_(e_list_value_has_more_items_than_targets)); - return EXEC_FAIL; - } - - CHECK_LIST_MATERIALIZE(l); - if (GA_GROW_FAILS(&ectx->ec_stack, count - 1)) - return EXEC_DONE; - ectx->ec_stack.ga_len += count - 1; - - // Variable after semicolon gets a list with the remaining - // items. - if (semicolon) - { - list_T *rem_list = - list_alloc_with_items(l->lv_len - count + 1); - - if (rem_list == NULL) - return EXEC_DONE; - tv = STACK_TV_BOT(-count); - tv->vval.v_list = rem_list; - ++rem_list->lv_refcount; - tv->v_lock = 0; - li = l->lv_first; - for (i = 0; i < count - 1; ++i) - li = li->li_next; - for (i = 0; li != NULL; ++i) - { - typval_T tvcopy; - - copy_tv(&li->li_tv, &tvcopy); - list_set_item(rem_list, i, &tvcopy); - li = li->li_next; - } - --count; - } - - // Produce the values in reverse order, first item last. - li = l->lv_first; - for (i = 0; i < count; ++i) - { - tv = STACK_TV_BOT(-i - 1); - copy_tv(&li->li_tv, tv); - li = li->li_next; - } - - list_unref(l); - - return EXEC_OK; -} - -/* - * Execute the ISN_UNPACK instruction for a Tuple - */ - static int -exec_unpack_tuple(ectx_T *ectx, isn_T *iptr, typval_T *tv) -{ - int count = iptr->isn_arg.unpack.unp_count; - int semicolon = iptr->isn_arg.unpack.unp_semicolon; - tuple_T *tuple; - int i; - - tuple = tv->vval.v_tuple; - if (tuple == NULL - || TUPLE_LEN(tuple) < (semicolon ? count - 1 : count)) - { - SOURCING_LNUM = iptr->isn_lnum; - emsg(_(e_more_targets_than_tuple_items)); - return EXEC_FAIL; - } - else if (!semicolon && TUPLE_LEN(tuple) > count) - { - SOURCING_LNUM = iptr->isn_lnum; - emsg(_(e_less_targets_than_tuple_items)); - return EXEC_FAIL; - } - - if (GA_GROW_FAILS(&ectx->ec_stack, count - 1)) - return EXEC_DONE; - ectx->ec_stack.ga_len += count - 1; - - // Variable after semicolon gets a list with the remaining - // items. - if (semicolon) - { - list_T *rem_list = - list_alloc_with_items(TUPLE_LEN(tuple) - count + 1); - - if (rem_list == NULL) - return EXEC_DONE; - tv = STACK_TV_BOT(-count); - tv->v_type = VAR_LIST; - tv->vval.v_list = rem_list; - ++rem_list->lv_refcount; - tv->v_lock = 0; - for (i = count - 1; i < TUPLE_LEN(tuple); ++i) - { - typval_T tvcopy; - - copy_tv(TUPLE_ITEM(tuple, i), &tvcopy); - list_set_item(rem_list, i - (count - 1), &tvcopy); - } - --count; - } - - // Produce the values in reverse order, first item last. - for (i = 0; i < count; ++i) - { - tv = STACK_TV_BOT(-i - 1); - copy_tv(TUPLE_ITEM(tuple, i), tv); - } - - tuple_unref(tuple); - - return EXEC_OK; -} - /* * Execute instructions in execution context "ectx". * Return OK or FAIL; @@ -4741,12 +4534,6 @@ exec_instructions(ectx_T *ectx) goto theend; break; - // create a tuple from items on the stack - case ISN_NEWTUPLE: - if (exe_newtuple(iptr->isn_arg.number, ectx) == FAIL) - goto theend; - break; - // create a dict from items on the stack case ISN_NEWDICT: { @@ -5151,9 +4938,9 @@ exec_instructions(ectx_T *ectx) size_t argidx = ufunc->uf_def_args.ga_len + iptr->isn_arg.jumparg.jump_arg_off + STACK_FRAME_SIZE; - type_T *tuple = ufunc->uf_arg_types[argidx]; + type_T *t = ufunc->uf_arg_types[argidx]; CLEAR_POINTER(tv); - tv->v_type = tuple->tt_type; + tv->v_type = t->tt_type; } if (iptr->isn_type == ISN_JUMP_IF_ARG_SET ? arg_set : !arg_set) @@ -5512,7 +5299,6 @@ exec_instructions(ectx_T *ectx) break; case ISN_COMPARELIST: - case ISN_COMPARETUPLE: case ISN_COMPAREDICT: case ISN_COMPAREFUNC: case ISN_COMPARESTRING: @@ -5532,11 +5318,6 @@ exec_instructions(ectx_T *ectx) status = typval_compare_list(tv1, tv2, exprtype, ic, &res); } - else if (iptr->isn_type == ISN_COMPARETUPLE) - { - status = typval_compare_tuple(tv1, tv2, - exprtype, ic, &res); - } else if (iptr->isn_type == ISN_COMPAREDICT) { status = typval_compare_dict(tv1, tv2, @@ -5589,7 +5370,6 @@ exec_instructions(ectx_T *ectx) break; case ISN_ADDLIST: - case ISN_ADDTUPLE: case ISN_ADDBLOB: { typval_T *tv1 = STACK_TV_BOT(-2); @@ -5605,8 +5385,6 @@ exec_instructions(ectx_T *ectx) else eval_addlist(tv1, tv2); } - else if (iptr->isn_type == ISN_ADDTUPLE) - eval_addtuple(tv1, tv2); else eval_addblob(tv1, tv2); clear_tv(tv2); @@ -5677,14 +5455,6 @@ exec_instructions(ectx_T *ectx) --ectx->ec_stack.ga_len; break; } - else if (tv1->v_type == VAR_TUPLE - && tv2->v_type == VAR_TUPLE) - { - eval_addtuple(tv1, tv2); - clear_tv(tv2); - --ectx->ec_stack.ga_len; - break; - } else if (tv1->v_type == VAR_BLOB && tv2->v_type == VAR_BLOB) { @@ -5804,25 +5574,20 @@ exec_instructions(ectx_T *ectx) case ISN_LISTINDEX: case ISN_LISTSLICE: - case ISN_TUPLEINDEX: - case ISN_TUPLESLICE: case ISN_BLOBINDEX: case ISN_BLOBSLICE: { int is_slice = iptr->isn_type == ISN_LISTSLICE - || iptr->isn_type == ISN_TUPLESLICE - || iptr->isn_type == ISN_BLOBSLICE; + || iptr->isn_type == ISN_BLOBSLICE; int is_blob = iptr->isn_type == ISN_BLOBINDEX || iptr->isn_type == ISN_BLOBSLICE; - int is_tuple = iptr->isn_type == ISN_TUPLEINDEX - || iptr->isn_type == ISN_TUPLESLICE; varnumber_T n1, n2; typval_T *val_tv; // list index: list is at stack-2, index at stack-1 // list slice: list is at stack-3, indexes at stack-2 and // stack-1 - // Same for tuple and blob. + // Same for blob. val_tv = is_slice ? STACK_TV_BOT(-3) : STACK_TV_BOT(-2); tv = STACK_TV_BOT(-1); @@ -5845,12 +5610,6 @@ exec_instructions(ectx_T *ectx) n1, n2, FALSE, tv) == FAIL) goto on_error; } - else if (is_tuple) - { - if (tuple_slice_or_index(val_tv->vval.v_tuple, - is_slice, n1, n2, FALSE, tv, TRUE) == FAIL) - goto on_error; - } else { if (list_slice_or_index(val_tv->vval.v_list, is_slice, @@ -5889,48 +5648,24 @@ exec_instructions(ectx_T *ectx) case ISN_SLICE: { + list_T *list; int count = iptr->isn_arg.number; // type will have been checked to be a list tv = STACK_TV_BOT(-1); - if (tv->v_type == VAR_LIST) - { - list_T *list = tv->vval.v_list; + list = tv->vval.v_list; - // no error for short list, expect it to be checked - // earlier - if (list != NULL && list->lv_len >= count) - { - list_T *newlist = list_slice(list, - count, list->lv_len - 1); - - if (newlist != NULL) - { - list_unref(list); - tv->vval.v_list = newlist; - ++newlist->lv_refcount; - } - } - } - else + // no error for short list, expect it to be checked earlier + if (list != NULL && list->lv_len >= count) { - tuple_T *tuple = tv->vval.v_tuple; + list_T *newlist = list_slice(list, + count, list->lv_len - 1); - // no error for short tuple, expect it to be checked - // earlier - if (tuple != NULL && TUPLE_LEN(tuple) >= count) + if (newlist != NULL) { - tuple_T *newtuple; - - newtuple = tuple_slice(tuple, count, - TUPLE_LEN(tuple) - 1); - if (newtuple != NULL) - { - tuple_unref(tuple); - tv->v_type = VAR_TUPLE; - tv->vval.v_tuple = newtuple; - ++newtuple->tv_refcount; - } + list_unref(list); + tv->vval.v_list = newlist; + ++newlist->lv_refcount; } } } @@ -5939,24 +5674,17 @@ exec_instructions(ectx_T *ectx) case ISN_GETITEM: { listitem_T *li; - typval_T *item_tv; getitem_T *gi = &iptr->isn_arg.getitem; // Get list item: list is at stack-1, push item. // List type and length is checked for when compiling. tv = STACK_TV_BOT(-1 - gi->gi_with_op); - if (tv->v_type == VAR_LIST) - { - li = list_find(tv->vval.v_list, gi->gi_index); - item_tv = &li->li_tv; - } - else - item_tv = TUPLE_ITEM(tv->vval.v_tuple, gi->gi_index); + li = list_find(tv->vval.v_list, gi->gi_index); if (GA_GROW_FAILS(&ectx->ec_stack, 1)) goto theend; ++ectx->ec_stack.ga_len; - copy_tv(item_tv, STACK_TV_BOT(-1)); + copy_tv(&li->li_tv, STACK_TV_BOT(-1)); // Useful when used in unpack assignment. Reset at // ISN_DROP. @@ -6192,40 +5920,17 @@ exec_instructions(ectx_T *ectx) { int min_len = iptr->isn_arg.checklen.cl_min_len; list_T *list = NULL; - tuple_T *tuple = NULL; - int len = 0; tv = STACK_TV_BOT(-1); - - int len_check_failed = FALSE; if (tv->v_type == VAR_LIST) - { - list = tv->vval.v_list; - if (list == NULL || list->lv_len < min_len + list = tv->vval.v_list; + if (list == NULL || list->lv_len < min_len || (list->lv_len > min_len && !iptr->isn_arg.checklen.cl_more_OK)) - len_check_failed = TRUE; - if (list != NULL) - len = list->lv_len; - } - else if (tv->v_type == VAR_TUPLE) - { - tuple = tv->vval.v_tuple; - if (tuple == NULL || TUPLE_LEN(tuple) < min_len - || (TUPLE_LEN(tuple) > min_len - && !iptr->isn_arg.checklen.cl_more_OK)) - len_check_failed = TRUE; - if (tuple != NULL) - len = TUPLE_LEN(tuple); - } - else - len_check_failed = TRUE; - - if (len_check_failed) { SOURCING_LNUM = iptr->isn_lnum; semsg(_(e_expected_nr_items_but_got_nr), - min_len, len); + min_len, list == NULL ? 0 : list->lv_len); goto on_error; } } @@ -6321,25 +6026,78 @@ exec_instructions(ectx_T *ectx) break; case ISN_UNPACK: - // Check there is a valid list to unpack. - tv = STACK_TV_BOT(-1); - if (tv->v_type != VAR_LIST && tv->v_type != VAR_TUPLE) { - SOURCING_LNUM = iptr->isn_lnum; - emsg(_(e_for_argument_must_be_sequence_of_lists_or_tuples)); - goto on_error; - } + int count = iptr->isn_arg.unpack.unp_count; + int semicolon = iptr->isn_arg.unpack.unp_semicolon; + list_T *l; + listitem_T *li; + int i; - int rc; - if (tv->v_type == VAR_LIST) - rc = exec_unpack_list(ectx, iptr, tv); - else - rc = exec_unpack_tuple(ectx, iptr, tv); - if (rc != EXEC_OK) - { - if (rc == EXEC_FAIL) + // Check there is a valid list to unpack. + tv = STACK_TV_BOT(-1); + if (tv->v_type != VAR_LIST) + { + SOURCING_LNUM = iptr->isn_lnum; + emsg(_(e_for_argument_must_be_sequence_of_lists)); goto on_error; - goto theend; + } + l = tv->vval.v_list; + if (l == NULL + || l->lv_len < (semicolon ? count - 1 : count)) + { + SOURCING_LNUM = iptr->isn_lnum; + emsg(_(e_list_value_does_not_have_enough_items)); + goto on_error; + } + else if (!semicolon && l->lv_len > count) + { + SOURCING_LNUM = iptr->isn_lnum; + emsg(_(e_list_value_has_more_items_than_targets)); + goto on_error; + } + + CHECK_LIST_MATERIALIZE(l); + if (GA_GROW_FAILS(&ectx->ec_stack, count - 1)) + goto theend; + ectx->ec_stack.ga_len += count - 1; + + // Variable after semicolon gets a list with the remaining + // items. + if (semicolon) + { + list_T *rem_list = + list_alloc_with_items(l->lv_len - count + 1); + + if (rem_list == NULL) + goto theend; + tv = STACK_TV_BOT(-count); + tv->vval.v_list = rem_list; + ++rem_list->lv_refcount; + tv->v_lock = 0; + li = l->lv_first; + for (i = 0; i < count - 1; ++i) + li = li->li_next; + for (i = 0; li != NULL; ++i) + { + typval_T tvcopy; + + copy_tv(&li->li_tv, &tvcopy); + list_set_item(rem_list, i, &tvcopy); + li = li->li_next; + } + --count; + } + + // Produce the values in reverse order, first item last. + li = l->lv_first; + for (i = 0; i < count; ++i) + { + tv = STACK_TV_BOT(-i - 1); + copy_tv(&li->li_tv, tv); + li = li->li_next; + } + + list_unref(l); } break; @@ -7425,10 +7183,6 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) smsg("%s%4d NEWLIST size %lld", pfx, current, (varnumber_T)(iptr->isn_arg.number)); break; - case ISN_NEWTUPLE: - smsg("%s%4d NEWTUPLE size %lld", pfx, current, - (varnumber_T)(iptr->isn_arg.number)); - break; case ISN_NEWDICT: smsg("%s%4d NEWDICT size %lld", pfx, current, (varnumber_T)(iptr->isn_arg.number)); @@ -7720,7 +7474,6 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) case ISN_COMPARESTRING: case ISN_COMPAREBLOB: case ISN_COMPARELIST: - case ISN_COMPARETUPLE: case ISN_COMPAREDICT: case ISN_COMPAREFUNC: case ISN_COMPAREOBJECT: @@ -7759,7 +7512,6 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) type = "COMPARESTRING"; break; case ISN_COMPAREBLOB: type = "COMPAREBLOB"; break; case ISN_COMPARELIST: type = "COMPARELIST"; break; - case ISN_COMPARETUPLE: type = "COMPARETUPLE"; break; case ISN_COMPAREDICT: type = "COMPAREDICT"; break; case ISN_COMPAREFUNC: type = "COMPAREFUNC"; break; case ISN_COMPAREOBJECT: @@ -7773,7 +7525,6 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) break; case ISN_ADDLIST: smsg("%s%4d ADDLIST", pfx, current); break; - case ISN_ADDTUPLE: smsg("%s%4d ADDTUPLE", pfx, current); break; case ISN_ADDBLOB: smsg("%s%4d ADDBLOB", pfx, current); break; // expression operations @@ -7789,8 +7540,6 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc) case ISN_BLOBAPPEND: smsg("%s%4d BLOBAPPEND", pfx, current); break; case ISN_LISTINDEX: smsg("%s%4d LISTINDEX", pfx, current); break; case ISN_LISTSLICE: smsg("%s%4d LISTSLICE", pfx, current); break; - case ISN_TUPLEINDEX: smsg("%s%4d TUPLEINDEX", pfx, current); break; - case ISN_TUPLESLICE: smsg("%s%4d TUPLESLICE", pfx, current); break; case ISN_ANYINDEX: smsg("%s%4d ANYINDEX", pfx, current); break; case ISN_ANYSLICE: smsg("%s%4d ANYSLICE", pfx, current); break; case ISN_SLICE: smsg("%s%4d SLICE %lld", @@ -8068,8 +7817,6 @@ tv2bool(typval_T *tv) return tv->vval.v_string != NULL && *tv->vval.v_string != NUL; case VAR_LIST: return tv->vval.v_list != NULL && tv->vval.v_list->lv_len > 0; - case VAR_TUPLE: - return tuple_len(tv->vval.v_tuple) > 0; case VAR_DICT: return tv->vval.v_dict != NULL && tv->vval.v_dict->dv_hashtab.ht_used > 0; diff --git a/src/vim9expr.c b/src/vim9expr.c index d169ed75..f875bc40 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -73,74 +73,7 @@ clear_ppconst(ppconst_T *ppconst) } /* - * Compile getting a member from a tuple. Stack has the indexable value and - * the index or the two indexes of a slice. - */ - static int -compile_tuple_member( - type2_T *typep, - int is_slice, - cctx_T *cctx) -{ - if (is_slice) - { - if (generate_instr_drop(cctx, ISN_TUPLESLICE, 2) == FAIL) - return FAIL; - // a copy is made so the member type is no longer declared - if (typep->type_decl->tt_type == VAR_TUPLE) - typep->type_decl = &t_tuple_any; - - // a copy is made, the composite is no longer "const" - if (typep->type_curr->tt_flags & TTFLAG_CONST) - { - type_T *type = copy_type(typep->type_curr, cctx->ctx_type_list); - - if (type != typep->type_curr) // did get a copy - { - type->tt_flags &= ~(TTFLAG_CONST | TTFLAG_STATIC); - typep->type_curr = type; - } - } - } - else - { - if (typep->type_curr->tt_type == VAR_TUPLE) - { - if (typep->type_curr->tt_argcount == 1) - { - if (typep->type_curr->tt_flags & TTFLAG_VARARGS) - typep->type_curr - = typep->type_curr->tt_args[0]->tt_member; - else - typep->type_curr = typep->type_curr->tt_args[0]; - } - else - typep->type_curr = &t_any; - if (typep->type_decl->tt_type == VAR_TUPLE) - { - if (typep->type_decl->tt_argcount == 1) - { - if (typep->type_decl->tt_flags & TTFLAG_VARARGS) - typep->type_decl - = typep->type_decl->tt_args[0]->tt_member; - else - typep->type_decl = typep->type_decl->tt_args[0]; - } - else - typep->type_curr = &t_any; - } - else - typep->type_decl = typep->type_curr; - } - if (generate_instr_drop(cctx, ISN_TUPLEINDEX, 1) == FAIL) - return FAIL; - } - - return OK; -} - -/* - * Compile getting a member from a list/tuple/dict/string/blob. Stack has the + * Compile getting a member from a list/dict/string/blob. Stack has the * indexable value and the index or the two indexes of a slice. * "keeping_dict" is used for dict[func](arg) to pass dict to func. */ @@ -152,7 +85,7 @@ compile_member(int is_slice, int *keeping_dict, cctx_T *cctx) vartype_T vartype; type_T *idxtype; - // We can index a list, tuple, dict and blob. If we don't know the type + // We can index a list, dict and blob. If we don't know the type // we can use the index value type. If we still don't know use an "ANY" // instruction. // TODO: what about the decl type? @@ -164,8 +97,7 @@ compile_member(int is_slice, int *keeping_dict, cctx_T *cctx) || typep->type_curr->tt_type == VAR_UNKNOWN) && idxtype == &t_string) vartype = VAR_DICT; - if (vartype == VAR_STRING || vartype == VAR_LIST || vartype == VAR_BLOB - || vartype == VAR_TUPLE) + if (vartype == VAR_STRING || vartype == VAR_LIST || vartype == VAR_BLOB) { if (need_type(idxtype, &t_number, FALSE, -1, 0, cctx, FALSE, FALSE) == FAIL) @@ -242,11 +174,6 @@ compile_member(int is_slice, int *keeping_dict, cctx_T *cctx) return FAIL; } } - else if (vartype == VAR_TUPLE) - { - if (compile_tuple_member(typep, is_slice, cctx) == FAIL) - return FAIL; - } else if (vartype == VAR_LIST || typep->type_curr->tt_type == VAR_ANY || typep->type_curr->tt_type == VAR_UNKNOWN) { @@ -404,10 +331,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) char_u *name = *arg; char_u *name_end = find_name_end(name, NULL, NULL, FNE_CHECK_START); if (name_end == name) - { - emsg(_(e_missing_name_after_dot)); return FAIL; - } size_t len = name_end - name; if (*name_end == '(') @@ -1541,82 +1465,6 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) return generate_NEWLIST(cctx, count, FALSE); } -/* - * parse a tuple: (expr, expr) - * "*arg" points to the ','. - * ppconst->pp_is_const is set if all the items are constants. - */ - static int -compile_tuple( - char_u **arg, - cctx_T *cctx, - ppconst_T *ppconst, - int first_item_const) -{ - char_u *p = *arg + 1; - char_u *whitep = *arg + 1; - int count = 0; - int is_const; - int is_all_const = TRUE; // reset when non-const encountered - int must_end = FALSE; - - if (**arg != ')') - { - if (*p != ')' && !IS_WHITE_OR_NUL(*p)) - { - semsg(_(e_white_space_required_after_str_str), ",", p - 1); - return FAIL; - } - count = 1; // the first tuple item is already processed - is_all_const = first_item_const; - for (;;) - { - if (may_get_next_line(whitep, &p, cctx) == FAIL) - { - semsg(_(e_missing_end_of_tuple_rsp_str), *arg); - return FAIL; - } - if (*p == ',') - { - semsg(_(e_no_white_space_allowed_before_str_str), ",", p); - return FAIL; - } - if (*p == ')') - { - ++p; - break; - } - if (must_end) - { - semsg(_(e_missing_comma_in_tuple_str), p); - return FAIL; - } - if (compile_expr0_ext(&p, cctx, &is_const) == FAIL) - return FAIL; - if (!is_const) - is_all_const = FALSE; - ++count; - if (*p == ',') - { - ++p; - if (*p != ')' && !IS_WHITE_OR_NUL(*p)) - { - semsg(_(e_white_space_required_after_str_str), ",", p - 1); - return FAIL; - } - } - else - must_end = TRUE; - whitep = p; - p = skipwhite(p); - } - } - *arg = p; - - ppconst->pp_is_const = is_all_const; - return generate_NEWTUPLE(cctx, count, FALSE); -} - /* * Parse a lambda: "(arg, arg) => expr" * "*arg" points to the '('. @@ -1647,11 +1495,6 @@ compile_lambda(char_u **arg, cctx_T *cctx) ++ufunc->uf_refcount; clear_tv(&rettv); - if (cctx->ctx_ufunc != NULL) - // This lambda might be defined in a class method. Inherit the class - // from the current function. - ufunc->uf_defclass = cctx->ctx_ufunc->uf_defclass; - // Compile it here to get the return type. The return type is optional, // when it's missing use t_unknown. This is recognized in // compile_return(). @@ -2325,11 +2168,6 @@ compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) if (may_get_next_line_error(p, arg, cctx) == FAIL) return FAIL; - - if (**arg == ')') - // empty tuple - return compile_tuple(arg, cctx, ppconst, FALSE); - if (ppconst->pp_used <= PPSIZE - 10) { ret = compile_expr1(arg, cctx, ppconst); @@ -2343,15 +2181,6 @@ compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) } if (may_get_next_line_error(*arg, arg, cctx) == FAIL) return FAIL; - if (ret == OK && **arg == ',') - { - // tuple - int is_const = ppconst->pp_used > 0 || ppconst->pp_is_const; - if (generate_ppconst(cctx, ppconst) == FAIL) - return FAIL; - return compile_tuple(arg, cctx, ppconst, is_const); - } - if (**arg == ')') ++*arg; else if (ret == OK) @@ -2611,7 +2440,6 @@ compile_subscript( int is_slice = FALSE; // list index: list[123] - // tuple index: tuple[123] // dict member: dict[key] // string index: text[123] // blob index: blob[123] @@ -2692,8 +2520,7 @@ compile_subscript( type = get_type_on_stack(cctx, 0); if (type != &t_unknown && (type->tt_type == VAR_CLASS - || (type->tt_type == VAR_OBJECT - && type != &t_object_any))) + || type->tt_type == VAR_OBJECT)) { // class member: SomeClass.varname // class method: SomeClass.SomeMethod() diff --git a/src/vim9instr.c b/src/vim9instr.c index d4593ea1..3da56bf9 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -224,7 +224,6 @@ may_generate_2STRING(int offset, int tostring_flags, cctx_T *cctx) // conversion possible when tolerant case VAR_LIST: - case VAR_TUPLE: case VAR_DICT: if (tostring_flags & TOSTRING_TOLERANT) { @@ -281,58 +280,6 @@ check_number_or_float(type_T *typ1, type_T *typ2, char_u *op) return OK; } -/* - * Append the tuple item types from "tuple_type" to the grow array "gap". - */ - static int -ga_append_tuple_types(type_T *tuple_type, garray_T *gap) -{ - for (int i = 0; i < tuple_type->tt_argcount; i++) - { - if (ga_grow(gap, 1) == FAIL) - return FAIL; - - ((type_T **)gap->ga_data)[gap->ga_len] = tuple_type->tt_args[i]; - gap->ga_len++; - } - - return OK; -} - -/* - * When concatenating two tuples, the resulting tuple gets a union of item - * types from both the tuples. This function sets the union tuple type in the - * stack. - * - * Returns OK on success and FAIL on memory allocation failure. - */ - static int -set_tuple_union_type_on_stack(type_T *type1, type_T *type2, cctx_T *cctx) -{ - // The concatenated tuple has the union of types from both the tuples - garray_T tuple_types_ga; - - ga_init2(&tuple_types_ga, sizeof(type_T *), 10); - - if (type1->tt_argcount > 0) - ga_append_tuple_types(type1, &tuple_types_ga); - if (!(type1->tt_flags & TTFLAG_VARARGS) && (type2->tt_argcount > 0)) - ga_append_tuple_types(type2, &tuple_types_ga); - - type_T *new_tuple_type = get_tuple_type(&tuple_types_ga, - cctx->ctx_type_list); - // result inherits the variadic flag from the operands - new_tuple_type->tt_flags |= (type1->tt_flags & TTFLAG_VARARGS) - | (type2->tt_flags & TTFLAG_VARARGS); - - // set the type on the stack for the resulting tuple - set_type_on_stack(cctx, new_tuple_type, 0); - - ga_clear(&tuple_types_ga); - - return OK; -} - /* * Generate instruction for "+". For a list this creates a new list. */ @@ -347,12 +294,11 @@ generate_add_instr( isn_T *isn = generate_instr_drop(cctx, vartype == VAR_NUMBER ? ISN_OPNR : vartype == VAR_LIST ? ISN_ADDLIST - : vartype == VAR_TUPLE ? ISN_ADDTUPLE : vartype == VAR_BLOB ? ISN_ADDBLOB : vartype == VAR_FLOAT ? ISN_OPFLOAT : ISN_OPANY, 1); - if (vartype != VAR_LIST && vartype != VAR_BLOB && vartype != VAR_TUPLE + if (vartype != VAR_LIST && vartype != VAR_BLOB && type1->tt_type != VAR_ANY && type1->tt_type != VAR_UNKNOWN && type2->tt_type != VAR_ANY @@ -374,14 +320,6 @@ generate_add_instr( && type1->tt_type == VAR_LIST && type2->tt_type == VAR_LIST && type1->tt_member != type2->tt_member) set_type_on_stack(cctx, &t_list_any, 0); - else if (vartype == VAR_TUPLE) - { - if (!check_tuples_addable(type1, type2)) - return FAIL; - - if (set_tuple_union_type_on_stack(type1, type2, cctx) == FAIL) - return FAIL; - } return isn == NULL ? FAIL : OK; } @@ -397,7 +335,6 @@ operator_type(type_T *type1, type_T *type2) if (type1->tt_type == type2->tt_type && (type1->tt_type == VAR_NUMBER || type1->tt_type == VAR_LIST - || type1->tt_type == VAR_TUPLE || type1->tt_type == VAR_FLOAT || type1->tt_type == VAR_BLOB)) return type1->tt_type; @@ -524,7 +461,6 @@ get_compare_isn( case VAR_STRING: isntype = ISN_COMPARESTRING; break; case VAR_BLOB: isntype = ISN_COMPAREBLOB; break; case VAR_LIST: isntype = ISN_COMPARELIST; break; - case VAR_TUPLE: isntype = ISN_COMPARETUPLE; break; case VAR_DICT: isntype = ISN_COMPAREDICT; break; case VAR_FUNC: isntype = ISN_COMPAREFUNC; break; case VAR_OBJECT: isntype = ISN_COMPAREOBJECT; break; @@ -756,7 +692,7 @@ generate_SETTYPE( generate_PUSHOBJ(cctx_T *cctx) { RETURN_OK_IF_SKIP(cctx); - if (generate_instr_type(cctx, ISN_PUSHOBJ, &t_object_any) == NULL) + if (generate_instr_type(cctx, ISN_PUSHOBJ, &t_object) == NULL) return FAIL; return OK; } @@ -808,11 +744,6 @@ generate_tv_PUSH(cctx_T *cctx, typval_T *tv) iemsg("non-empty list constant not supported"); generate_NEWLIST(cctx, 0, TRUE); break; - case VAR_TUPLE: - if (tv->vval.v_tuple != NULL) - iemsg("non-empty tuple constant not supported"); - generate_NEWTUPLE(cctx, 0, TRUE); - break; case VAR_DICT: if (tv->vval.v_dict != NULL) iemsg("non-empty dict constant not supported"); @@ -1078,7 +1009,7 @@ generate_GETITEM(cctx_T *cctx, int index, int with_op) RETURN_OK_IF_SKIP(cctx); - item_type = get_item_type(type); + item_type = type->tt_member; if ((isn = generate_instr(cctx, ISN_GETITEM)) == NULL) return FAIL; isn->isn_arg.getitem.gi_index = index; @@ -1438,45 +1369,6 @@ generate_NEWLIST(cctx_T *cctx, int count, int use_null) return push_type_stack2(cctx, type, decl_type); } -/* - * Generate an ISN_NEWTUPLE instruction for "count" items. - * "use_null" is TRUE for null_tuple. - */ - int -generate_NEWTUPLE(cctx_T *cctx, int count, int use_null) -{ - isn_T *isn; - type_T *type; - type_T *decl_type; - - RETURN_OK_IF_SKIP(cctx); - if ((isn = generate_instr(cctx, ISN_NEWTUPLE)) == NULL) - return FAIL; - isn->isn_arg.number = use_null ? -1 : count; - - // Get the member type and the declared member type from all the items on - // the stack. - garray_T tuple_types_ga; - ga_init2(&tuple_types_ga, sizeof(type_T *), 10); - - if (get_tuple_type_from_stack(count, &tuple_types_ga, cctx) < 0) - { - ga_clear(&tuple_types_ga); - return FAIL; - } - - type = get_tuple_type(&tuple_types_ga, cctx->ctx_type_list); - decl_type = &t_tuple_any; - - ga_clear(&tuple_types_ga); - - // drop the value types - cctx->ctx_type_stack.ga_len -= count; - - // add the tuple type to the type stack - return push_type_stack2(cctx, type, decl_type); -} - /* * Generate an ISN_NEWDICT instruction. * "use_null" is TRUE for null_dict. @@ -2142,8 +2034,7 @@ generate_PCALL( RETURN_OK_IF_SKIP(cctx); - if (type->tt_type == VAR_ANY || type->tt_type == VAR_UNKNOWN - || type == &t_object_any) + if (type->tt_type == VAR_ANY || type->tt_type == VAR_UNKNOWN) ret_type = &t_any; else if (type->tt_type == VAR_FUNC || type->tt_type == VAR_PARTIAL) { @@ -2214,9 +2105,7 @@ generate_STRINGMEMBER(cctx_T *cctx, char_u *name, size_t len) // check for dict type type = get_type_on_stack(cctx, 0); if (type->tt_type != VAR_DICT - && type->tt_type != VAR_OBJECT - && type->tt_type != VAR_ANY - && type->tt_type != VAR_UNKNOWN) + && type->tt_type != VAR_ANY && type->tt_type != VAR_UNKNOWN) { char *tofree; @@ -2849,7 +2738,6 @@ delete_instr(isn_T *isn) case ISN_2STRING_ANY: case ISN_ADDBLOB: case ISN_ADDLIST: - case ISN_ADDTUPLE: case ISN_ANYINDEX: case ISN_ANYSLICE: case ISN_BCALL: @@ -2868,7 +2756,6 @@ delete_instr(isn_T *isn) case ISN_COMPAREFLOAT: case ISN_COMPAREFUNC: case ISN_COMPARELIST: - case ISN_COMPARETUPLE: case ISN_COMPARENR: case ISN_COMPARENULL: case ISN_COMPAREOBJECT: @@ -2900,8 +2787,6 @@ delete_instr(isn_T *isn) case ISN_LISTAPPEND: case ISN_LISTINDEX: case ISN_LISTSLICE: - case ISN_TUPLEINDEX: - case ISN_TUPLESLICE: case ISN_LOAD: case ISN_LOADBDICT: case ISN_LOADGDICT: @@ -2915,7 +2800,6 @@ delete_instr(isn_T *isn) case ISN_NEGATENR: case ISN_NEWDICT: case ISN_NEWLIST: - case ISN_NEWTUPLE: case ISN_NEWPARTIAL: case ISN_OPANY: case ISN_OPFLOAT: diff --git a/src/vim9script.c b/src/vim9script.c index 7e33770a..30358896 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -1119,52 +1119,35 @@ check_script_var_type( } // words that cannot be used as a variable -// Keep this array sorted, as bsearch() is used to search this array. static char *reserved[] = { + "true", "false", "null", "null_blob", - "null_channel", - "null_class", "null_dict", "null_function", - "null_job", "null_list", - "null_object", "null_partial", "null_string", - "null_tuple", + "null_channel", + "null_job", "super", "this", - "true", + NULL }; -/* - * String compare function used for bsearch() - */ - static int -comp_names(const void *s1, const void *s2) -{ - return STRCMP(*(char **)s1, *(char **)s2); -} - -/* - * Returns OK if "name" is not a reserved keyword. Otherwise returns FAIL. - */ int check_reserved_name(char_u *name, int is_objm_access) { - // "this" can be used in an object method - if (is_objm_access && STRCMP("this", name) == 0) - return OK; - - if (bsearch(&name, reserved, ARRAY_LENGTH(reserved), - sizeof(reserved[0]), comp_names) != NULL) - { - semsg(_(e_cannot_use_reserved_name_str), name); - return FAIL; - } + int idx; + for (idx = 0; reserved[idx] != NULL; ++idx) + if (STRCMP(reserved[idx], name) == 0 + && !(STRCMP("this", name) == 0 && is_objm_access)) + { + semsg(_(e_cannot_use_reserved_name_str), name); + return FAIL; + } return OK; } diff --git a/src/vim9type.c b/src/vim9type.c index ab5e0775..1f044d3d 100644 --- a/src/vim9type.c +++ b/src/vim9type.c @@ -202,7 +202,7 @@ set_tv_type_recurse(type_T *type) { return type->tt_member != NULL && (type->tt_member->tt_type == VAR_DICT - || type->tt_member->tt_type == VAR_LIST) + || type->tt_member->tt_type == VAR_LIST) && type->tt_member->tt_member != NULL && type->tt_member->tt_member != &t_any && type->tt_member->tt_member != &t_unknown; @@ -262,37 +262,7 @@ set_tv_type_list(list_T *l, type_T *type) } /* - * Set the type of Tuple "tuple" to "type" - */ - static void -set_tv_type_tuple(tuple_T *tuple, type_T *type) -{ - if (tuple->tv_type == type) - return; - - free_type(tuple->tv_type); - tuple->tv_type = alloc_type(type); - - if (type->tt_argcount <= 0) - return; - - // recursively set the type of list items - type_T *item_type; - for (int i = 0; i < tuple_len(tuple); i++) - { - if ((type->tt_flags & TTFLAG_VARARGS) && (i >= type->tt_argcount - 1)) - // For a variadic tuple, the last type is a List. So use the - // List member type. - item_type = type->tt_args[type->tt_argcount - 1]->tt_member; - else - item_type = type->tt_args[i]; - - set_tv_type(TUPLE_ITEM(tuple, i), item_type); - } -} - -/* - * Set the type of "tv" to "type" if it is a list or tuple or dict. + * Set the type of "tv" to "type" if it is a list or dict. */ void set_tv_type(typval_T *tv, type_T *type) @@ -306,36 +276,8 @@ set_tv_type(typval_T *tv, type_T *type) set_tv_type_dict(tv->vval.v_dict, type); else if (tv->v_type == VAR_LIST && tv->vval.v_list != NULL) set_tv_type_list(tv->vval.v_list, type); - else if (tv->v_type == VAR_TUPLE && tv->vval.v_tuple != NULL) - set_tv_type_tuple(tv->vval.v_tuple, type); } -/* - * For a tuple type, reserve space for "typecount" types (including the - * repeated type). - */ - static int -tuple_type_add_types( - type_T *tupletype, - int typecount, - garray_T *type_gap) -{ - // To make it easy to free the space needed for the types, add the - // pointer to type_gap. - if (ga_grow(type_gap, 1) == FAIL) - return FAIL; - tupletype->tt_args = ALLOC_CLEAR_MULT(type_T *, typecount); - if (tupletype->tt_args == NULL) - return FAIL; - ((type_T **)type_gap->ga_data)[type_gap->ga_len] = - (void *)tupletype->tt_args; - ++type_gap->ga_len; - return OK; -} - -/* - * Get a list type, based on the member item type in "member_type". - */ type_T * get_list_type(type_T *member_type, garray_T *type_gap) { @@ -365,42 +307,6 @@ get_list_type(type_T *member_type, garray_T *type_gap) return type; } -/* - * Create and return a tuple type from the tuple item types in - * "tuple_types_ga". - */ - type_T * -get_tuple_type(garray_T *tuple_types_gap, garray_T *type_gap) -{ - type_T *type; - type_T **tuple_types = tuple_types_gap->ga_data; - int typecount = tuple_types_gap->ga_len; - - // recognize commonly used types - if (typecount == 0) - return &t_tuple_any; - - // Not a common type, create a new entry. - type = get_type_ptr(type_gap); - if (type == NULL) - return &t_any; - type->tt_type = VAR_TUPLE; - type->tt_member = NULL; - if (typecount > 0) - { - if (tuple_type_add_types(type, typecount, type_gap) == FAIL) - return NULL; - mch_memmove(type->tt_args, tuple_types, sizeof(type_T *) * typecount); - } - type->tt_argcount = typecount; - type->tt_flags = 0; - - return type; -} - -/* - * Get a dict type, based on the member item type in "member_type". - */ type_T * get_dict_type(type_T *member_type, garray_T *type_gap) { @@ -447,23 +353,6 @@ alloc_func_type(type_T *ret_type, int argcount, garray_T *type_gap) return type; } -/* - * Allocate a new type for a tuple. - */ - static type_T * -alloc_tuple_type(int typecount, garray_T *type_gap) -{ - type_T *type = get_type_ptr(type_gap); - - if (type == NULL) - return &t_any; - type->tt_type = VAR_TUPLE; - type->tt_member = NULL; - type->tt_argcount = typecount; - type->tt_args = NULL; - return type; -} - /* * Get a function type, based on the return type "ret_type". * "argcount" must be -1 or 0, a predefined type can be used. @@ -617,64 +506,6 @@ list_typval2type(typval_T *tv, int copyID, garray_T *type_gap, int flags) return get_list_type(member_type, type_gap); } -/* - * Get a type_T for a Tuple typval in "tv". - * When "flags" has TVTT_DO_MEMBER also get the member type, otherwise use - * "any". - * When "flags" has TVTT_MORE_SPECIFIC get the more specific member type if it - * is "any". - */ - static type_T * -tuple_typval2type(typval_T *tv, int copyID, garray_T *type_gap, int flags) -{ - tuple_T *tuple = tv->vval.v_tuple; - int len = tuple_len(tuple); - type_T *type = NULL; - - // An empty tuple has type tuple, unless the type was specified - // and is not tuple. This matters when assigning to a variable - // with a specific tuple type. - if (tuple == NULL || (len == 0 && (tuple->tv_type == NULL - || tuple->tv_type->tt_argcount == 0))) - return &t_tuple_empty; - - if ((flags & TVTT_DO_MEMBER) == 0) - return &t_tuple_any; - - // If the type is tuple go through the members, it may end up a - // more specific type. - if (tuple->tv_type != NULL && (len == 0 - || (flags & TVTT_MORE_SPECIFIC) == 0)) - // make a copy, tv_type may be freed if the tuple is freed - return copy_type_deep(tuple->tv_type, type_gap); - - if (tuple->tv_copyID == copyID) - // avoid recursion - return &t_tuple_any; - - tuple->tv_copyID = copyID; - - garray_T tuple_types_ga; - ga_init2(&tuple_types_ga, sizeof(type_T *), 10); - for (int i = 0; i < len; i++) - { - type = typval2type(TUPLE_ITEM(tuple, i), copyID, type_gap, - TVTT_DO_MEMBER); - if (ga_grow(&tuple_types_ga, 1) == FAIL) - { - ga_clear(&tuple_types_ga); - return NULL; - } - ((type_T **)tuple_types_ga.ga_data)[tuple_types_ga.ga_len] = type; - tuple_types_ga.ga_len++; - } - - type_T *tuple_type = get_tuple_type(&tuple_types_ga, type_gap); - ga_clear(&tuple_types_ga); - - return tuple_type; -} - /* * Get a type_T for a Dict typval in "tv". * When "flags" has TVTT_DO_MEMBER also get the member type, otherwise use @@ -768,7 +599,7 @@ oc_typval2type(typval_T *tv) if (tv->vval.v_object != NULL) return &tv->vval.v_object->obj_class->class_object_type; - return &t_object_any; + return &t_object; } /* @@ -892,9 +723,6 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int flags) case VAR_LIST: return list_typval2type(tv, copyID, type_gap, flags); - case VAR_TUPLE: - return tuple_typval2type(tv, copyID, type_gap, flags); - case VAR_DICT: return dict_typval2type(tv, copyID, type_gap, flags); @@ -1121,179 +949,6 @@ type_mismatch_where(type_T *expected, type_T *actual, where_T where) vim_free(tofree2); } -/* - * Check if the expected and actual types match for a tuple - */ - static int -check_tuple_type_maybe( - type_T *expected, - type_T *actual, - where_T where) -{ - if (expected->tt_argcount == -1 || actual->tt_argcount == -1 - || expected->tt_args == NULL || actual->tt_args == NULL) - return OK; - - // For a non-variadic tuple, the number of items must match - if (!(expected->tt_flags & TTFLAG_VARARGS) - && expected->tt_argcount != actual->tt_argcount) - return FAIL; - - // compare the type of each tuple item - for (int i = 0; i < actual->tt_argcount; ++i) - { - type_T *exp_type; - type_T *actual_type; - - if (expected->tt_flags & TTFLAG_VARARGS) - { - if (i < expected->tt_argcount - 1) - exp_type = expected->tt_args[i]; - else - // For a variadic tuple, the last type is a List. So use the - // List member type. - exp_type = expected->tt_args[expected->tt_argcount - 1]->tt_member; - } - else - exp_type = expected->tt_args[i]; - - if (actual->tt_flags & TTFLAG_VARARGS) - { - if (i < actual->tt_argcount - 1) - actual_type = actual->tt_args[i]; - else - // For a variadic tuple, the last type is a List. So use the - // List member type. - actual_type = actual->tt_args[actual->tt_argcount - 1]->tt_member; - } - else - actual_type = actual->tt_args[i]; - - // Allow for using "any" type for a tuple item - if (actual->tt_args[i] != &t_any && check_type(exp_type, actual_type, - FALSE, where) == FAIL) - return FAIL; - } - - return OK; -} - -/* - * Check if the expected and actual types match for a function - * Returns OK if "expected" and "actual" are matching function types. - * Returns FAIL if "expected" and "actual" are different types. - * Returns MAYBE when a runtime type check is needed. - */ - static int -check_func_type_maybe( - type_T *expected, - type_T *actual, - where_T where) -{ - int ret = OK; - - // If the return type is unknown it can be anything, including - // nothing, thus there is no point in checking. - if (expected->tt_member != &t_unknown) - { - if (actual->tt_member != NULL - && actual->tt_member != &t_unknown) - { - where_T func_where = where; - - func_where.wt_kind = WT_METHOD_RETURN; - ret = check_type_maybe(expected->tt_member, - actual->tt_member, FALSE, - func_where); - } - else - ret = MAYBE; - } - if (ret != FAIL - && ((expected->tt_flags & TTFLAG_VARARGS) - != (actual->tt_flags & TTFLAG_VARARGS)) - && expected->tt_argcount != -1) - ret = FAIL; - if (ret != FAIL && expected->tt_argcount != -1 - && actual->tt_min_argcount != -1 - && (actual->tt_argcount == -1 - || (actual->tt_argcount < expected->tt_min_argcount - || actual->tt_argcount > expected->tt_argcount))) - ret = FAIL; - if (ret != FAIL && expected->tt_args != NULL - && actual->tt_args != NULL) - { - int i; - - for (i = 0; i < expected->tt_argcount - && i < actual->tt_argcount; ++i) - { - where_T func_where = where; - func_where.wt_kind = WT_METHOD_ARG; - - // Allow for using "any" argument type, lambda's have them. - if (actual->tt_args[i] != &t_any && check_type( - expected->tt_args[i], actual->tt_args[i], FALSE, - func_where) == FAIL) - { - ret = FAIL; - break; - } - } - } - if (ret == OK && expected->tt_argcount >= 0 - && actual->tt_argcount == -1) - // check the argument count at runtime - ret = MAYBE; - - return ret; -} - -/* - * Check if the expected and actual types match for an object - * Returns OK if "expected" and "actual" are matching object types. - * Returns FAIL if "expected" and "actual" are different types. - * Returns MAYBE when a runtime type check is needed. - */ - static int -check_object_type_maybe( - type_T *expected, - type_T *actual, - where_T where) -{ - int ret = OK; - - if (actual->tt_type == VAR_ANY) - return MAYBE; // use runtime type check - if (actual->tt_type != VAR_OBJECT) - return FAIL; // don't use tt_class - if (actual->tt_class == NULL) // null object - return OK; - // t_object_any matches any object except for an enum item - if (expected == &t_object_any && !IS_ENUM(actual->tt_class)) - return OK; - - // For object method arguments, do a invariant type check in - // an extended class. For all others, do a covariance type check. - if (where.wt_kind == WT_METHOD_ARG) - { - if (actual->tt_class != expected->tt_class) - ret = FAIL; - } - else if (!class_instance_of(actual->tt_class, expected->tt_class)) - { - // Check if this is an up-cast, if so we'll have to check the type at - // runtime. - if (where.wt_kind == WT_CAST && - class_instance_of(expected->tt_class, actual->tt_class)) - ret = MAYBE; - else - ret = FAIL; - } - - return ret; -} - /* * Check if the expected and actual types match. * Does not allow for assigning "any" to a specific type. @@ -1363,12 +1018,89 @@ check_type_maybe( ret = check_type_maybe(expected->tt_member, actual->tt_member, FALSE, where); } - else if (expected->tt_type == VAR_TUPLE && actual != &t_any) - ret = check_tuple_type_maybe(expected, actual, where); else if (expected->tt_type == VAR_FUNC && actual != &t_any) - ret = check_func_type_maybe(expected, actual, where); + { + // If the return type is unknown it can be anything, including + // nothing, thus there is no point in checking. + if (expected->tt_member != &t_unknown) + { + if (actual->tt_member != NULL + && actual->tt_member != &t_unknown) + { + where_T func_where = where; + + func_where.wt_kind = WT_METHOD_RETURN; + ret = check_type_maybe(expected->tt_member, + actual->tt_member, FALSE, + func_where); + } + else + ret = MAYBE; + } + if (ret != FAIL + && ((expected->tt_flags & TTFLAG_VARARGS) + != (actual->tt_flags & TTFLAG_VARARGS)) + && expected->tt_argcount != -1) + ret = FAIL; + if (ret != FAIL && expected->tt_argcount != -1 + && actual->tt_min_argcount != -1 + && (actual->tt_argcount == -1 + || (actual->tt_argcount < expected->tt_min_argcount + || actual->tt_argcount > expected->tt_argcount))) + ret = FAIL; + if (ret != FAIL && expected->tt_args != NULL + && actual->tt_args != NULL) + { + int i; + + for (i = 0; i < expected->tt_argcount + && i < actual->tt_argcount; ++i) + { + where_T func_where = where; + func_where.wt_kind = WT_METHOD_ARG; + + // Allow for using "any" argument type, lambda's have them. + if (actual->tt_args[i] != &t_any && check_type( + expected->tt_args[i], actual->tt_args[i], FALSE, + func_where) == FAIL) + { + ret = FAIL; + break; + } + } + } + if (ret == OK && expected->tt_argcount >= 0 + && actual->tt_argcount == -1) + // check the argument count at runtime + ret = MAYBE; + } else if (expected->tt_type == VAR_OBJECT) - ret = check_object_type_maybe(expected, actual, where); + { + if (actual->tt_type == VAR_ANY) + return MAYBE; // use runtime type check + if (actual->tt_type != VAR_OBJECT) + return FAIL; // don't use tt_class + if (actual->tt_class == NULL) + return OK; // A null object matches + + // For object method arguments, do a invariant type check in + // an extended class. For all others, do a covariance type check. + if (where.wt_kind == WT_METHOD_ARG) + { + if (actual->tt_class != expected->tt_class) + ret = FAIL; + } + else if (!class_instance_of(actual->tt_class, expected->tt_class)) + { + // Check if this is an up-cast, if so we'll have to check the type at + // runtime. + if (where.wt_kind == WT_CAST && + class_instance_of(expected->tt_class, actual->tt_class)) + ret = MAYBE; + else + ret = FAIL; + } + } if (ret == FAIL && give_msg) type_mismatch_where(expected, actual, where); @@ -1449,91 +1181,6 @@ check_argument_types( return OK; } -/* - * Skip over type in list, dict or tuple. - * Returns a pointer to the character after the type. "syn_error" is set to - * TRUE on syntax error. - */ - static char_u * -skip_member_type(char_u *start, char_u *p, int *syn_error) -{ - if (STRNCMP("tuple", start, 5) == 0) - { - // handle tuple<{type1}, {type2}, ....> - p = skipwhite(p + 1); - while (*p != '>' && *p != NUL) - { - char_u *sp = p; - - if (STRNCMP(p, "...", 3) == 0) - p += 3; - p = skip_type(p, TRUE); - if (p == sp) - { - *syn_error = TRUE; - return p; // syntax error - } - if (*p == ',') - p = skipwhite(p + 1); - } - if (*p == '>') - p++; - } - else - { - p = skipwhite(p); - p = skip_type(skipwhite(p + 1), FALSE); - p = skipwhite(p); - if (*p == '>') - ++p; - } - - return p; -} - -/* - * Skip over a function type. Returns a pointer to the character after the - * type. "syn_error" is set to TRUE on syntax error. - */ - static char_u * -skip_func_type(char_u *p, int *syn_error) -{ - if (*p == '(') - { - // handle func(args): type - ++p; - while (*p != ')' && *p != NUL) - { - char_u *sp = p; - - if (STRNCMP(p, "...", 3) == 0) - p += 3; - p = skip_type(p, TRUE); - if (p == sp) - { - *syn_error = TRUE; - return p; // syntax error - } - if (*p == ',') - p = skipwhite(p + 1); - } - if (*p == ')') - { - if (p[1] == ':') - p = skip_type(skipwhite(p + 2), FALSE); - else - ++p; - } - } - else - { - // handle func: return_type - p = skip_type(skipwhite(p + 1), FALSE); - } - - return p; -} - /* * Skip over a type definition and return a pointer to just after it. * When "optional" is TRUE then a leading "?" is accepted. @@ -1541,8 +1188,7 @@ skip_func_type(char_u *p, int *syn_error) char_u * skip_type(char_u *start, int optional) { - char_u *p = start; - int syn_error = FALSE; + char_u *p = start; if (optional && *p == '?') ++p; @@ -1554,17 +1200,44 @@ skip_type(char_u *start, int optional) // Skip over ""; this is permissive about white space. if (*skipwhite(p) == '<') { - p = skip_member_type(start, p, &syn_error); - if (syn_error) - return p; + p = skipwhite(p); + p = skip_type(skipwhite(p + 1), FALSE); + p = skipwhite(p); + if (*p == '>') + ++p; } else if ((*p == '(' || (*p == ':' && VIM_ISWHITE(p[1]))) && STRNCMP("func", start, 4) == 0) { - // skip over function type - p = skip_func_type(p, &syn_error); - if (syn_error) - return p; + if (*p == '(') + { + // handle func(args): type + ++p; + while (*p != ')' && *p != NUL) + { + char_u *sp = p; + + if (STRNCMP(p, "...", 3) == 0) + p += 3; + p = skip_type(p, TRUE); + if (p == sp) + return p; // syntax error + if (*p == ',') + p = skipwhite(p + 1); + } + if (*p == ')') + { + if (p[1] == ':') + p = skip_type(skipwhite(p + 2), FALSE); + else + ++p; + } + } + else + { + // handle func: return_type + p = skip_type(skipwhite(p + 1), FALSE); + } } return p; @@ -1749,173 +1422,6 @@ parse_type_func(char_u **arg, size_t len, garray_T *type_gap, int give_error) return type; } -/* - * Parse a "tuple" type at "*arg" and advance over it. - * When "give_error" is TRUE give error messages, otherwise be quiet. - * Return NULL for failure. - */ - static type_T * -parse_type_tuple(char_u **arg, garray_T *type_gap, int give_error) -{ - char_u *p; - type_T *type; - type_T *ret_type = NULL; - int typecount = -1; - int flags = 0; - garray_T tuple_types_ga; - - ga_init2(&tuple_types_ga, sizeof(type_T *), 10); - - // tuple<{type}, {type}> - // tuple<{type}, ...{type}> - if (**arg != '<') - { - if (give_error) - { - if (*skipwhite(*arg) == '<') - semsg(_(e_no_white_space_allowed_before_str_str), "<", *arg); - else - semsg(_(e_missing_type_after_str), "tuple"); - } - - // only "tuple" is specified - return NULL; - } - - p = ++*arg; - typecount = 0; - while (*p != NUL && *p != '>') - { - if (STRNCMP(p, "...", 3) == 0) - { - flags |= TTFLAG_VARARGS; - p += 3; - } - - type = parse_type(&p, type_gap, give_error); - if (type == NULL) - goto on_err; - - if ((flags & TTFLAG_VARARGS) != 0 && type->tt_type != VAR_LIST) - { - char *tofree; - semsg(_(e_variadic_tuple_must_end_with_list_type_str), - type_name(type, &tofree)); - vim_free(tofree); - goto on_err; - } - - // Add the item type - if (ga_grow(&tuple_types_ga, 1) == FAIL) - goto on_err; - ((type_T **)tuple_types_ga.ga_data)[tuple_types_ga.ga_len] = type; - tuple_types_ga.ga_len++; - typecount++; - - // Nothing comes after "...{type}". - if (flags & TTFLAG_VARARGS) - break; - - if (*p != ',' && *skipwhite(p) == ',') - { - if (give_error) - semsg(_(e_no_white_space_allowed_before_str_str), ",", p); - goto on_err; - } - if (*p == ',') - { - ++p; - if (!VIM_ISWHITE(*p)) - { - if (give_error) - semsg(_(e_white_space_required_after_str_str), - ",", p - 1); - goto on_err; - } - } - p = skipwhite(p); - } - - p = skipwhite(p); - if (*p != '>' || typecount <= 0) - { - if (give_error) - semsg(_(e_missing_type_after_str), p); - goto on_err; - } - *arg = p + 1; - - ret_type = alloc_tuple_type(typecount, type_gap); - ret_type->tt_flags = flags; - ret_type->tt_argcount = typecount; - if (tuple_type_add_types(ret_type, typecount, type_gap) == FAIL) - return NULL; - mch_memmove(ret_type->tt_args, tuple_types_ga.ga_data, - sizeof(type_T *) * typecount); - -on_err: - ga_clear(&tuple_types_ga); - - return ret_type; -} - -/* - * Parse a "object" type at "*arg" and advance over it. - * When "give_error" is TRUE give error messages, otherwise be quiet. - * Return NULL for failure. - */ - static type_T * -parse_type_object(char_u **arg, garray_T *type_gap, int give_error) -{ - char_u *arg_start = *arg; - type_T *object_type; - int prev_called_emsg = called_emsg; - - // object or object - if (**arg != '<') - { - if (give_error) - { - if (*skipwhite(*arg) == '<') - semsg(_(e_no_white_space_allowed_before_str_str), "<", *arg); - else - semsg(_(e_missing_type_after_str), "object"); - } - - // only "object" is specified - return NULL; - } - - // skip spaces following "object<" - *arg = skipwhite(*arg + 1); - - object_type = parse_type(arg, type_gap, give_error); - if (object_type == NULL) - return NULL; - - *arg = skipwhite(*arg); - if (**arg != '>' && called_emsg == prev_called_emsg) - { - if (give_error) - semsg(_(e_missing_gt_after_type_str), arg_start); - return NULL; - } - ++*arg; - - if (object_type->tt_type == VAR_ANY) - return &t_object_any; - - if (object_type->tt_type != VAR_OBJECT) - { - // specified type is not a class - if (give_error) - semsg(_(e_class_name_not_found_str), arg_start); - return NULL; - } - - return object_type; -} - /* * Parse a user defined type at "*arg" and advance over it. * It can be a class or an interface or a typealias name, possibly imported. @@ -2064,13 +1570,6 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error) return &t_number; } break; - case 'o': - if (len == 6 && STRNCMP(*arg, "object", len) == 0) - { - *arg += len; - return parse_type_object(arg, type_gap, give_error); - } - break; case 's': if (len == 6 && STRNCMP(*arg, "string", len) == 0) { @@ -2078,13 +1577,6 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error) return &t_string; } break; - case 't': - if (len == 5 && STRNCMP(*arg, "tuple", len) == 0) - { - *arg += len; - return parse_type_tuple(arg, type_gap, give_error); - } - break; case 'v': if (len == 4 && STRNCMP(*arg, "void", len) == 0) { @@ -2126,27 +1618,13 @@ equal_type(type_T *type1, type_T *type2, int flags) case VAR_JOB: case VAR_CHANNEL: case VAR_INSTR: + case VAR_CLASS: + case VAR_OBJECT: case VAR_TYPEALIAS: break; // not composite is always OK - case VAR_OBJECT: - case VAR_CLASS: - // Objects are considered equal if they are from the same class - return type1->tt_class == type2->tt_class; case VAR_LIST: case VAR_DICT: return equal_type(type1->tt_member, type2->tt_member, flags); - case VAR_TUPLE: - if (type1->tt_argcount != type2->tt_argcount) - return FALSE; - if (type1->tt_argcount < 0 - || type1->tt_args == NULL || type2->tt_args == NULL) - return TRUE; - for (i = 0; i < type1->tt_argcount; ++i) - if ((flags & ETYPE_ARG_UNKNOWN) == 0 - && !equal_type(type1->tt_args[i], type2->tt_args[i], - flags)) - return FALSE; - return TRUE; case VAR_FUNC: case VAR_PARTIAL: if (!equal_type(type1->tt_member, type2->tt_member, flags) @@ -2247,8 +1725,7 @@ common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap) if (type1->tt_type == type2->tt_type) { - if (type1->tt_type == VAR_LIST - || type1->tt_type == VAR_DICT) + if (type1->tt_type == VAR_LIST || type2->tt_type == VAR_DICT) { type_T *common; @@ -2259,41 +1736,17 @@ common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap) *dest = get_dict_type(common, type_gap); return; } - else if (type1->tt_type == VAR_FUNC) + + if (type1->tt_type == VAR_FUNC) { common_type_var_func(type1, type2, dest, type_gap); return; } - else if (type1->tt_type == VAR_OBJECT) - { - *dest = &t_object_any; - return; - } } *dest = &t_any; } -/* - * Return the item type of a List, Dict or a Tuple - */ - type_T * -get_item_type(type_T *type) -{ - if (type->tt_type == VAR_TUPLE) - { - if (type->tt_argcount != 1) - return &t_any; - - if (type->tt_flags & TTFLAG_VARARGS) - return type->tt_args[0]->tt_member; - else - return type->tt_args[0]; - } - - return type->tt_member; -} - /* * Push an entry onto the type stack. "type" used both for the current type * and the declared type. @@ -2411,40 +1864,6 @@ get_member_type_from_stack( return result; } -/* - * Get the types of items in a tuple on the stack of "cctx". - * Returns the number of types. Returns -1 on failure. - */ - int -get_tuple_type_from_stack( - int count, - garray_T *tuple_types_gap, - cctx_T *cctx) -{ - garray_T *stack = &cctx->ctx_type_stack; - type2_T *typep; - type_T *type = NULL; - - // Use "unknown" for an empty tuple - if (count == 0) - return 0; - - // Find the common type from following items. - typep = ((type2_T *)stack->ga_data) + stack->ga_len; - for (int i = 0; i < count; i++) - { - type = (typep - (count - i))->type_curr; - if (check_type_is_value(type) == FAIL) - return -1; - if (ga_grow(tuple_types_gap, 1) == FAIL) - return -1; - ((type_T **)tuple_types_gap->ga_data)[tuple_types_gap->ga_len] = type; - tuple_types_gap->ga_len++; - } - - return tuple_types_gap->ga_len; -} - char * vartype_name(vartype_T type) { @@ -2462,7 +1881,6 @@ vartype_name(vartype_T type) case VAR_JOB: return "job"; case VAR_CHANNEL: return "channel"; case VAR_LIST: return "list"; - case VAR_TUPLE: return "tuple"; case VAR_DICT: return "dict"; case VAR_INSTR: return "instr"; case VAR_CLASS: return "class"; @@ -2500,65 +1918,6 @@ type_name_list_or_dict(char *name, type_T *type, char **tofree) return *tofree; } -/* - * Return the type name of a tuple. - * The result may be in allocated memory, in which case "tofree" is set. - */ - static char * -type_name_tuple(type_T *type, char **tofree) -{ - garray_T ga; - int i; - int varargs = (type->tt_flags & TTFLAG_VARARGS) ? 1 : 0; - char *arg_free = NULL; - - ga_init2(&ga, 1, 100); - if (ga_grow(&ga, 20) == FAIL) - goto failed; - STRCPY(ga.ga_data, "tuple<"); - ga.ga_len += 6; - - if (type->tt_argcount <= 0) - // empty tuple - ga_concat(&ga, (char_u *)"any"); - else - { - if (type->tt_args == NULL) - ga_concat(&ga, (char_u *)"[unknown]"); - else - { - for (i = 0; i < type->tt_argcount; ++i) - { - char *arg_type; - int len; - - arg_type = type_name(type->tt_args[i], &arg_free); - if (i > 0) - { - STRCPY((char *)ga.ga_data + ga.ga_len, ", "); - ga.ga_len += 2; - } - len = (int)STRLEN(arg_type); - if (ga_grow(&ga, len + 8) == FAIL) - goto failed; - if (varargs && i == type->tt_argcount - 1) - ga_concat(&ga, (char_u *)"..."); - ga_concat(&ga, (char_u *)arg_type); - VIM_CLEAR(arg_free); - } - } - } - - STRCPY((char *)ga.ga_data + ga.ga_len, ">"); - *tofree = ga.ga_data; - return ga.ga_data; - -failed: - vim_free(arg_free); - ga_clear(&ga); - return "[unknown]"; -} - /* * Return the type name of a Class (class) or Object (object). * The result may be in allocated memory, in which case "tofree" is set. @@ -2575,7 +1934,7 @@ type_name_class_or_obj(char *name, type_T *type, char **tofree) name = "enum"; } else - class_name = (char_u *)"any"; + class_name = (char_u *)"Unknown"; size_t len = STRLEN(name) + STRLEN(class_name) + 3; *tofree = alloc(len); @@ -2676,9 +2035,6 @@ type_name(type_T *type, char **tofree) case VAR_DICT: return type_name_list_or_dict(name, type, tofree); - case VAR_TUPLE: - return type_name_tuple(type, tofree); - case VAR_CLASS: case VAR_OBJECT: return type_name_class_or_obj(name, type, tofree); diff --git a/src/viminfo.c b/src/viminfo.c index f1e1fc37..5f1ad747 100644 --- a/src/viminfo.c +++ b/src/viminfo.c @@ -1263,7 +1263,6 @@ read_viminfo_varlist(vir_T *virp, int writing) case 'L': type = VAR_LIST; break; case 'B': type = VAR_BLOB; break; case 'X': type = VAR_SPECIAL; break; - case 'T': type = VAR_TUPLE; break; } tab = vim_strchr(tab, '\t'); @@ -1271,8 +1270,7 @@ read_viminfo_varlist(vir_T *virp, int writing) { tv.v_type = type; if (type == VAR_STRING || type == VAR_DICT - || type == VAR_LIST || type == VAR_BLOB - || type == VAR_TUPLE) + || type == VAR_LIST || type == VAR_BLOB) tv.vval.v_string = viminfo_readstring(virp, (int)(tab - virp->vir_line + 1), TRUE); else if (type == VAR_FLOAT) @@ -1284,7 +1282,7 @@ read_viminfo_varlist(vir_T *virp, int writing) || tv.vval.v_number == VVAL_TRUE)) tv.v_type = VAR_BOOL; } - if (type == VAR_DICT || type == VAR_LIST || type == VAR_TUPLE) + if (type == VAR_DICT || type == VAR_LIST) { typval_T *etv = eval_expr(tv.vval.v_string, NULL); @@ -1372,7 +1370,7 @@ write_viminfo_varlist(FILE *fp) s = "DIC"; if (di != NULL && !set_ref_in_ht( - &di->dv_hashtab, copyID, NULL, NULL) + &di->dv_hashtab, copyID, NULL) && di->dv_copyID == copyID) // has a circular reference, can't turn the // value into a string @@ -1386,27 +1384,13 @@ write_viminfo_varlist(FILE *fp) s = "LIS"; if (l != NULL && !set_ref_in_list_items( - l, copyID, NULL, NULL) + l, copyID, NULL) && l->lv_copyID == copyID) // has a circular reference, can't turn the // value into a string continue; break; } - case VAR_TUPLE: - { - tuple_T *tuple = this_var->di_tv.vval.v_tuple; - int copyID = get_copyID(); - - s = "TUP"; - if (tuple != NULL && !set_ref_in_tuple_items( - tuple, copyID, NULL, NULL) - && tuple->tv_copyID == copyID) - // has a circular reference, can't turn the - // value into a string - continue; - break; - } case VAR_BLOB: s = "BLO"; break; case VAR_BOOL: s = "XPL"; break; // backwards compat. case VAR_SPECIAL: s = "XPL"; break; @@ -2899,8 +2883,7 @@ read_viminfo_up_to_marks( if (virp->vir_version < VIMINFO_VERSION_WITH_REGISTERS) eof = read_viminfo_register(virp, forceit); else - do - { + do { eof = viminfo_readline(virp); } while (!eof && (virp->vir_line[0] == TAB || virp->vir_line[0] == '<')); diff --git a/src/window.c b/src/window.c index 1eb32bc3..55168d53 100644 --- a/src/window.c +++ b/src/window.c @@ -97,14 +97,14 @@ static int close_disallowed = 0; * make sure the previously selected window is still there. * Must be matched with exactly one call to window_layout_unlock()! */ - void + static void window_layout_lock(void) { ++split_disallowed; ++close_disallowed; } - void + static void window_layout_unlock(void) { --split_disallowed; @@ -3285,8 +3285,7 @@ may_trigger_win_scrolled_resized(void) { // Create the list for v:event.windows before making the snapshot. windows_list = list_alloc_with_items(size_count); - if (windows_list != NULL) - check_window_scroll_resize(NULL, NULL, NULL, windows_list, NULL); + (void)check_window_scroll_resize(NULL, NULL, NULL, windows_list, NULL); } dict_T *scroll_dict = NULL; @@ -3297,7 +3296,8 @@ may_trigger_win_scrolled_resized(void) if (scroll_dict != NULL) { scroll_dict->dv_refcount = 1; - check_window_scroll_resize(NULL, NULL, NULL, NULL, scroll_dict); + (void)check_window_scroll_resize(NULL, NULL, NULL, NULL, + scroll_dict); } } #endif @@ -3314,11 +3314,7 @@ may_trigger_win_scrolled_resized(void) recursive = TRUE; // If both are to be triggered do WinResized first. - if (trigger_resize -#ifdef FEAT_EVAL - && windows_list != NULL -#endif - ) + if (trigger_resize) { #ifdef FEAT_EVAL save_v_event_T save_v_event; @@ -5643,6 +5639,10 @@ win_enter_ext(win_T *wp, int flags) did_decrement = TRUE; } #endif +#ifdef FEAT_TERMINAL + if (bt_terminal(curwin->w_buffer)) + update_topline(); +#endif win_fix_current_dir(); @@ -7034,7 +7034,7 @@ win_fix_scroll(int resize) { int diff = (wp->w_winrow - wp->w_prev_winrow) + (wp->w_height - wp->w_prev_height); - pos_T cursor = wp->w_cursor; + linenr_T lnum = wp->w_cursor.lnum; wp->w_cursor.lnum = wp->w_botline - 1; // Add difference in height and row to botline. @@ -7048,8 +7048,7 @@ win_fix_scroll(int resize) wp->w_fraction = FRACTION_MULT; scroll_to_fraction(wp, wp->w_prev_height); - wp->w_cursor = cursor; - wp->w_valid &= ~VALID_WCOL; + wp->w_cursor.lnum = lnum; } else if (wp == curwin) wp->w_valid &= ~VALID_CROW; diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index 072ef630..9031d713 100644 --- a/src/xxd/xxd.c +++ b/src/xxd/xxd.c @@ -357,7 +357,7 @@ parse_hex_digit(int c) parse_bin_digit(int c) { return (c >= '0' && c <= '1') ? c - '0' - : -1; + : -1; } /* @@ -405,53 +405,53 @@ huntype( continue; if (hextype == HEX_NORMAL || hextype == HEX_POSTSCRIPT) - { + { n3 = n2; n2 = n1; n1 = parse_hex_digit(c); if (n1 == -1 && ign_garb) continue; - } + } else /* HEX_BITS */ - { + { n1 = parse_hex_digit(c); if (n1 == -1 && ign_garb) continue; - bt = parse_bin_digit(c); - if (bt != -1) - { - b = ((b << 1) | bt); - ++bcnt; - } - } + bt = parse_bin_digit(c); + if (bt != -1) + { + b = ((b << 1) | bt); + ++bcnt; + } + } ign_garb = 0; if ((hextype != HEX_POSTSCRIPT) && (p >= cols)) { - if (hextype == HEX_NORMAL) - { + if (hextype == HEX_NORMAL) + { if (n1 < 0) - { - p = 0; - continue; - } + { + p = 0; + continue; + } want_off = (want_off << 4) | n1; - } - else /* HEX_BITS */ - { + } + else /* HEX_BITS */ + { if (n1 < 0) - { - p = 0; - bcnt = 0; - continue; - } + { + p = 0; + bcnt = 0; + continue; + } want_off = (want_off << 4) | n1; - } - continue; - } + } + continue; + } if (base_off + want_off != have_off) { @@ -468,35 +468,35 @@ huntype( } if (hextype == HEX_NORMAL || hextype == HEX_POSTSCRIPT) - { - if (n2 >= 0 && n1 >= 0) - { - putc_or_die((n2 << 4) | n1, fpo); - have_off++; - want_off++; - n1 = -1; - if (!hextype && (++p >= cols)) - /* skip the rest of the line as garbage */ - c = skip_to_eol(fpi, c); - } - else if (n1 < 0 && n2 < 0 && n3 < 0) - /* already stumbled into garbage, skip line, wait and see */ - c = skip_to_eol(fpi, c); - } + { + if (n2 >= 0 && n1 >= 0) + { + putc_or_die((n2 << 4) | n1, fpo); + have_off++; + want_off++; + n1 = -1; + if (!hextype && (++p >= cols)) + /* skip the rest of the line as garbage */ + c = skip_to_eol(fpi, c); + } + else if (n1 < 0 && n2 < 0 && n3 < 0) + /* already stumbled into garbage, skip line, wait and see */ + c = skip_to_eol(fpi, c); + } else /* HEX_BITS */ - { - if (bcnt == 8) - { - putc_or_die(b, fpo); - have_off++; - want_off++; - b = 0; - bcnt = 0; - if (++p >= cols) - /* skip the rest of the line as garbage */ - c = skip_to_eol(fpi, c); - } - } + { + if (bcnt == 8) + { + putc_or_die(b, fpo); + have_off++; + want_off++; + b = 0; + bcnt = 0; + if (++p >= cols) + /* skip the rest of the line as garbage */ + c = skip_to_eol(fpi, c); + } + } if (c == '\n') { @@ -595,41 +595,41 @@ begin_coloring_char (char *l, int *c, int e, int ebcdic) if (ebcdic) { if ((e >= 75 && e <= 80) || (e >= 90 && e <= 97) || - (e >= 107 && e <= 111) || (e >= 121 && e <= 127) || - (e >= 129 && e <= 137) || (e >= 145 && e <= 154) || - (e >= 162 && e <= 169) || (e >= 192 && e <= 201) || - (e >= 208 && e <= 217) || (e >= 226 && e <= 233) || - (e >= 240 && e <= 249) || (e == 189) || (e == 64) || - (e == 173) || (e == 224) ) - l[(*c)++] = COLOR_GREEN; + (e >= 107 && e <= 111) || (e >= 121 && e <= 127) || + (e >= 129 && e <= 137) || (e >= 145 && e <= 154) || + (e >= 162 && e <= 169) || (e >= 192 && e <= 201) || + (e >= 208 && e <= 217) || (e >= 226 && e <= 233) || + (e >= 240 && e <= 249) || (e == 189) || (e == 64) || + (e == 173) || (e == 224) ) + l[(*c)++] = COLOR_GREEN; else if (e == 37 || e == 13 || e == 5) - l[(*c)++] = COLOR_YELLOW; + l[(*c)++] = COLOR_YELLOW; else if (e == 0) - l[(*c)++] = COLOR_WHITE; + l[(*c)++] = COLOR_WHITE; else if (e == 255) - l[(*c)++] = COLOR_BLUE; + l[(*c)++] = COLOR_BLUE; else - l[(*c)++] = COLOR_RED; + l[(*c)++] = COLOR_RED; } else /* ASCII */ { #if defined(__MVS__) && __CHARSET_LIB == 0 if (e >= 64) - l[(*c)++] = COLOR_GREEN; + l[(*c)++] = COLOR_GREEN; #else if (e > 31 && e < 127) - l[(*c)++] = COLOR_GREEN; + l[(*c)++] = COLOR_GREEN; #endif else if (e == 9 || e == 10 || e == 13) - l[(*c)++] = COLOR_YELLOW; + l[(*c)++] = COLOR_YELLOW; else if (e == 0) - l[(*c)++] = COLOR_WHITE; + l[(*c)++] = COLOR_WHITE; else if (e == 255) - l[(*c)++] = COLOR_BLUE; + l[(*c)++] = COLOR_BLUE; else - l[(*c)++] = COLOR_RED; + l[(*c)++] = COLOR_RED; } l[(*c)++] = 'm'; } @@ -815,20 +815,20 @@ main(int argc, char *argv[]) } } else if (!STRNCMP(pp, "-n", 2)) - { - if (pp[2] && STRNCMP("ame", pp + 2, 3)) - varname = pp + 2; - else - { - if (!argv[2]) - exit_with_usage(); - varname = argv[2]; - argv++; - argc--; - } - } + { + if (pp[2] && STRNCMP("ame", pp + 2, 3)) + varname = pp + 2; + else + { + if (!argv[2]) + exit_with_usage(); + varname = argv[2]; + argv++; + argc--; + } + } else if (!STRNCMP(pp, "-R", 2)) - { + { char *pw = pp + 2; if (!pw[0]) { @@ -849,7 +849,7 @@ main(int argc, char *argv[]) color = enable_color(); else exit_with_usage(); - } + } else if (!strcmp(argv[1], "--")) /* end of options */ { argv++; @@ -867,9 +867,9 @@ main(int argc, char *argv[]) if (hextype != (HEX_CINCLUDE | HEX_BITS)) { - /* Allow at most one bit to be set in hextype */ - if (hextype & (hextype - 1)) - error_exit(1, "only one of -b, -e, -u, -p, -i can be used"); + /* Allow at most one bit to be set in hextype */ + if (hextype & (hextype - 1)) + error_exit(1, "only one of -b, -e, -u, -p, -i can be used"); } if (!colsgiven || (!cols && hextype != HEX_POSTSCRIPT)) @@ -952,11 +952,11 @@ main(int argc, char *argv[]) case HEX_NORMAL: case HEX_POSTSCRIPT: case HEX_BITS: - return huntype(fp, fpo, cols, hextype, - negseek ? -seekoff : seekoff); - break; + return huntype(fp, fpo, cols, hextype, + negseek ? -seekoff : seekoff); + break; default: - error_exit(-1, "Sorry, cannot revert this type of hexdump"); + error_exit(-1, "Sorry, cannot revert this type of hexdump"); } if (seekoff || negseek || !relseek) @@ -988,7 +988,7 @@ main(int argc, char *argv[]) { /* A user-set variable name overrides fp == stdin */ if (varname == NULL && fp != stdin) - varname = argv[1]; + varname = argv[1]; if (varname != NULL) { @@ -1000,28 +1000,28 @@ main(int argc, char *argv[]) p = 0; while ((length < 0 || p < length) && (c = getc_or_die(fp)) != EOF) - { - if (hextype & HEX_BITS) + { + if (hextype & HEX_BITS) { - if (p == 0) - fputs_or_die(" ", fpo); - else if (p % cols == 0) - fputs_or_die(",\n ", fpo); - else - fputs_or_die(", ", fpo); - - FPRINTF_OR_DIE((fpo, "0b")); - for (int j = 7; j >= 0; j--) - putc_or_die((c & (1 << j)) ? '1' : '0', fpo); - p++; + if (p == 0) + fputs_or_die(" ", fpo); + else if (p % cols == 0) + fputs_or_die(",\n ", fpo); + else + fputs_or_die(", ", fpo); + + FPRINTF_OR_DIE((fpo, "0b")); + for (int j = 7; j >= 0; j--) + putc_or_die((c & (1 << j)) ? '1' : '0', fpo); + p++; } - else + else { FPRINTF_OR_DIE((fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X", (p % cols) ? ", " : (!p ? " " : ",\n "), c)); p++; } - } + } if (p) fputs_or_die("\n", fpo); @@ -1065,7 +1065,7 @@ main(int argc, char *argv[]) { grplen = octspergrp + octspergrp + 1; /* chars per octet group */ if (color) - grplen += 11 * octspergrp; /* color-code needs 11 extra characters */ + grplen += 11 * octspergrp; /* color-code needs 11 extra characters */ } else /* hextype == HEX_BITS */ grplen = 8 * octspergrp + 1; @@ -1083,15 +1083,15 @@ main(int argc, char *argv[]) c = addrlen + 1 + (grplen * x) / octspergrp; if (hextype == HEX_NORMAL || hextype == HEX_LITTLEENDIAN) { - if (color) - { + if (color) + { COLOR_PROLOGUE begin_coloring_char(l,&c,e,ebcdic); l[c++] = hexx[(e >> 4) & 0xf]; l[c++] = hexx[e & 0xf]; COLOR_EPILOGUE } - else /*No colors*/ + else /*No colors*/ { l[c] = hexx[(e >> 4) & 0xf]; l[++c] = hexx[e & 0xf]; @@ -1112,95 +1112,95 @@ main(int argc, char *argv[]) c = (grplen * cols - 1) / octspergrp; if (color) - { - if (hextype == HEX_BITS) - c += addrlen + 3 + p*12; - else - c = addrlen + 3 + (grplen * cols - 1)/octspergrp + p*12; - - COLOR_PROLOGUE - begin_coloring_char(l,&c,e,ebcdic); + { + if (hextype == HEX_BITS) + c += addrlen + 3 + p*12; + else + c = addrlen + 3 + (grplen * cols - 1)/octspergrp + p*12; + + COLOR_PROLOGUE + begin_coloring_char(l,&c,e,ebcdic); #if defined(__MVS__) && __CHARSET_LIB == 0 - if (e >= 64) - l[c++] = e; - else - l[c++] = '.'; + if (e >= 64) + l[c++] = e; + else + l[c++] = '.'; #else - if (ebcdic) - e = (e < 64) ? '.' : etoa64[e-64]; - l[c++] = (e > 31 && e < 127) ? e : '.'; + if (ebcdic) + e = (e < 64) ? '.' : etoa64[e-64]; + l[c++] = (e > 31 && e < 127) ? e : '.'; #endif - COLOR_EPILOGUE - } + COLOR_EPILOGUE + } else /*no colors*/ - { - if (ebcdic) - e = (e < 64) ? '.' : etoa64[e-64]; + { + if (ebcdic) + e = (e < 64) ? '.' : etoa64[e-64]; - if (hextype == HEX_LITTLEENDIAN) - c -= 1; + if (hextype == HEX_LITTLEENDIAN) + c -= 1; - c += addrlen + 3 + p; - l[c++] = + c += addrlen + 3 + p; + l[c++] = #if defined(__MVS__) && __CHARSET_LIB == 0 - (e >= 64) + (e >= 64) #else - (e > 31 && e < 127) + (e > 31 && e < 127) #endif - ? e : '.'; - } - n++; - if (++p == cols) - { - l[c++] = '\n'; - l[c] = '\0'; - xxdline(fpo, l, autoskip ? nonzero : 1); - nonzero = 0; - p = 0; - } + ? e : '.'; + } + n++; + if (++p == cols) + { + l[c++] = '\n'; + l[c] = '\0'; + xxdline(fpo, l, autoskip ? nonzero : 1); + nonzero = 0; + p = 0; + } } if (p) { l[c++] = '\n'; l[c] = '\0'; if (color) - { - x = p; - if (hextype == HEX_LITTLEENDIAN) - { - int fill = octspergrp - (p % octspergrp); - if (fill == octspergrp) fill = 0; - - c = addrlen + 1 + (grplen * (x - (octspergrp-fill))) / octspergrp; - - for (i = 0; i < fill;i++) - { - COLOR_PROLOGUE - l[c++] = COLOR_RED; - l[c++] = 'm'; - l[c++] = ' '; /* empty space */ - COLOR_EPILOGUE - x++; - p++; - } - } - - if (hextype != HEX_BITS) - { - c = addrlen + 1 + (grplen * x) / octspergrp; - c += cols - p; - c += (cols - p) / octspergrp; - - for (i = cols - p; i > 0;i--) - { - COLOR_PROLOGUE - l[c++] = COLOR_RED; - l[c++] = 'm'; - l[c++] = ' '; /* empty space */ - COLOR_EPILOGUE - } - } - } + { + x = p; + if (hextype == HEX_LITTLEENDIAN) + { + int fill = octspergrp - (p % octspergrp); + if (fill == octspergrp) fill = 0; + + c = addrlen + 1 + (grplen * (x - (octspergrp-fill))) / octspergrp; + + for (i = 0; i < fill;i++) + { + COLOR_PROLOGUE + l[c++] = COLOR_RED; + l[c++] = 'm'; + l[c++] = ' '; /* empty space */ + COLOR_EPILOGUE + x++; + p++; + } + } + + if (hextype != HEX_BITS) + { + c = addrlen + 1 + (grplen * x) / octspergrp; + c += cols - p; + c += (cols - p) / octspergrp; + + for (i = cols - p; i > 0;i--) + { + COLOR_PROLOGUE + l[c++] = COLOR_RED; + l[c++] = 'm'; + l[c++] = ' '; /* empty space */ + COLOR_EPILOGUE + } + } + } xxdline(fpo, l, 1); } else if (autoskip)